kitchen-simulator 1.1.1-test.49 → 1.1.1-test.50

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 (358) hide show
  1. package/es/@history.js +2 -0
  2. package/es/AppContext.js +3 -0
  3. package/es/KitchenConfigurator.js +645 -0
  4. package/es/KitchenConfiguratorApp.js +480 -0
  5. package/es/actions/area-actions.js +14 -0
  6. package/es/actions/export.js +23 -0
  7. package/es/actions/groups-actions.js +89 -0
  8. package/es/actions/holes-actions.js +119 -0
  9. package/es/actions/items-actions.js +313 -0
  10. package/es/actions/lines-actions.js +81 -0
  11. package/es/actions/project-actions.js +281 -0
  12. package/es/actions/scene-actions.js +33 -0
  13. package/es/actions/vertices-actions.js +27 -0
  14. package/es/actions/viewer2d-actions.js +58 -0
  15. package/es/actions/viewer3d-actions.js +23 -0
  16. package/es/catalog/areas/area/planner-element.js +40 -0
  17. package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  18. package/es/catalog/areas/area/textures/grass.jpg +0 -0
  19. package/es/catalog/areas/area/textures/parquet.jpg +0 -0
  20. package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  21. package/es/catalog/areas/area/textures/tile1.jpg +0 -0
  22. package/es/catalog/catalog.js +277 -0
  23. package/es/catalog/envMap/nx.hdr +0 -0
  24. package/es/catalog/envMap/ny.hdr +0 -0
  25. package/es/catalog/envMap/nz.hdr +0 -0
  26. package/es/catalog/envMap/px.hdr +0 -0
  27. package/es/catalog/envMap/py.hdr +0 -0
  28. package/es/catalog/envMap/pz.hdr +0 -0
  29. package/es/catalog/factories/area-factory-3d.js +181 -0
  30. package/es/catalog/factories/area-factory.js +81 -0
  31. package/es/catalog/factories/export.js +7 -0
  32. package/es/catalog/factories/wall-factory-3d.js +202 -0
  33. package/es/catalog/factories/wall-factory.js +268 -0
  34. package/es/catalog/holes/door-closet/planner-element.js +222 -0
  35. package/es/catalog/holes/door-double/door_double.png +0 -0
  36. package/es/catalog/holes/door-double/planner-element.js +315 -0
  37. package/es/catalog/holes/door-exterior/planner-element.js +215 -0
  38. package/es/catalog/holes/door-interior/planner-element.js +227 -0
  39. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  40. package/es/catalog/holes/door-panic/planner-element.js +503 -0
  41. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  42. package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
  43. package/es/catalog/holes/door-sliding/planner-element.js +225 -0
  44. package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
  45. package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
  46. package/es/catalog/holes/export.js +13 -0
  47. package/es/catalog/holes/gate/gate.jpg +0 -0
  48. package/es/catalog/holes/window-clear/planner-element.js +166 -0
  49. package/es/catalog/holes/window-clear/texture.png +0 -0
  50. package/es/catalog/holes/window-cross/planner-element.js +165 -0
  51. package/es/catalog/holes/window-cross/texture.png +0 -0
  52. package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
  53. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  54. package/es/catalog/holes/window-vertical/planner-element.js +276 -0
  55. package/es/catalog/holes/window-vertical/texture.png +0 -0
  56. package/es/catalog/lines/wall/planner-element.js +70 -0
  57. package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  58. package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
  59. package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
  60. package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
  61. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  62. package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  63. package/es/catalog/lines/wall/textures/morden.jpg +0 -0
  64. package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
  65. package/es/catalog/lines/wall/textures/painted.jpg +0 -0
  66. package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  67. package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
  68. package/es/catalog/lines/wall/wall.png +0 -0
  69. package/es/catalog/molding/molding-dcm/planner-element.js +28 -0
  70. package/es/catalog/molding/molding-dcm/texture.png +0 -0
  71. package/es/catalog/molding/molding-fbm/planner-element.js +28 -0
  72. package/es/catalog/molding/molding-fbm/texture.png +0 -0
  73. package/es/catalog/molding/molding-lrm/planner-element.js +28 -0
  74. package/es/catalog/molding/molding-lrm/texture.png +0 -0
  75. package/es/catalog/properties/export.js +21 -0
  76. package/es/catalog/properties/property-checkbox.js +116 -0
  77. package/es/catalog/properties/property-color.js +39 -0
  78. package/es/catalog/properties/property-enum.js +97 -0
  79. package/es/catalog/properties/property-hidden.js +19 -0
  80. package/es/catalog/properties/property-lenght-measure.js +101 -0
  81. package/es/catalog/properties/property-length-measure.js +134 -0
  82. package/es/catalog/properties/property-length-measure_hole.js +101 -0
  83. package/es/catalog/properties/property-number.js +48 -0
  84. package/es/catalog/properties/property-read-only.js +26 -0
  85. package/es/catalog/properties/property-string.js +48 -0
  86. package/es/catalog/properties/property-toggle.js +39 -0
  87. package/es/catalog/properties/shared-property-style.js +14 -0
  88. package/es/catalog/utils/FuseUtils.js +82 -0
  89. package/es/catalog/utils/exporter.js +148 -0
  90. package/es/catalog/utils/geom-utils.js +189 -0
  91. package/es/catalog/utils/item-loader.js +1521 -0
  92. package/es/catalog/utils/load-obj.js +91 -0
  93. package/es/catalog/utils/mtl-loader.js +358 -0
  94. package/es/catalog/utils/obj-loader.js +477 -0
  95. package/es/class/FuseUtils.js +82 -0
  96. package/es/class/area.js +145 -0
  97. package/es/class/export.js +24 -0
  98. package/es/class/group.js +440 -0
  99. package/es/class/guide.js +62 -0
  100. package/es/class/hole.js +929 -0
  101. package/es/class/item.js +1883 -0
  102. package/es/class/layer.js +667 -0
  103. package/es/class/line.js +1180 -0
  104. package/es/class/project.js +793 -0
  105. package/es/class/vertex.js +202 -0
  106. package/es/components/content.js +107 -0
  107. package/es/components/disclaimer/disclaimer.js +97 -0
  108. package/es/components/export.js +9 -0
  109. package/es/components/style/button.js +113 -0
  110. package/es/components/style/cancel-button.js +22 -0
  111. package/es/components/style/content-container.js +33 -0
  112. package/es/components/style/content-title.js +29 -0
  113. package/es/components/style/delete-button.js +25 -0
  114. package/es/components/style/export.js +31 -0
  115. package/es/components/style/form-block.js +24 -0
  116. package/es/components/style/form-color-input.js +27 -0
  117. package/es/components/style/form-label.js +26 -0
  118. package/es/components/style/form-number-input.js +213 -0
  119. package/es/components/style/form-number-input_2.js +206 -0
  120. package/es/components/style/form-select.js +68 -0
  121. package/es/components/style/form-slider.js +61 -0
  122. package/es/components/style/form-submit-button.js +26 -0
  123. package/es/components/style/form-text-input.js +95 -0
  124. package/es/components/viewer2d/area.js +81 -0
  125. package/es/components/viewer2d/export.js +31 -0
  126. package/es/components/viewer2d/grids/grid-horizontal-streak.js +37 -0
  127. package/es/components/viewer2d/grids/grid-streak.js +37 -0
  128. package/es/components/viewer2d/grids/grid-vertical-streak.js +37 -0
  129. package/es/components/viewer2d/grids/grids.js +35 -0
  130. package/es/components/viewer2d/group.js +53 -0
  131. package/es/components/viewer2d/item.js +513 -0
  132. package/es/components/viewer2d/layer.js +164 -0
  133. package/es/components/viewer2d/line.js +882 -0
  134. package/es/components/viewer2d/ruler.js +100 -0
  135. package/es/components/viewer2d/rulerDist.js +146 -0
  136. package/es/components/viewer2d/rulerX.js +151 -0
  137. package/es/components/viewer2d/rulerY.js +153 -0
  138. package/es/components/viewer2d/scene.js +140 -0
  139. package/es/components/viewer2d/snap.js +74 -0
  140. package/es/components/viewer2d/state.js +78 -0
  141. package/es/components/viewer2d/utils.js +198 -0
  142. package/es/components/viewer2d/vertex.js +65 -0
  143. package/es/components/viewer2d/viewer2d.js +1398 -0
  144. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2592 -0
  145. package/es/components/viewer3d/dcm.js +401 -0
  146. package/es/components/viewer3d/fbm.js +414 -0
  147. package/es/components/viewer3d/front3D.js +66 -0
  148. package/es/components/viewer3d/grid-creator.js +25 -0
  149. package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
  150. package/es/components/viewer3d/grids/grid-streak.js +27 -0
  151. package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
  152. package/es/components/viewer3d/libs/first-person-controls.js +67 -0
  153. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
  154. package/es/components/viewer3d/libs/mtl-loader.js +357 -0
  155. package/es/components/viewer3d/libs/obj-loader.js +462 -0
  156. package/es/components/viewer3d/libs/orbit-controls.js +699 -0
  157. package/es/components/viewer3d/libs/pointer-lock-controls.js +46 -0
  158. package/es/components/viewer3d/lrm.js +305 -0
  159. package/es/components/viewer3d/model.js +708 -0
  160. package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
  161. package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
  162. package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
  163. package/es/components/viewer3d/ruler-utils/ruler3D.js +227 -0
  164. package/es/components/viewer3d/ruler-utils/scene3D.js +60 -0
  165. package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
  166. package/es/components/viewer3d/scene-creator.js +3608 -0
  167. package/es/components/viewer3d/three-memory-cleaner.js +51 -0
  168. package/es/components/viewer3d/viewer3d-first-person.js +315 -0
  169. package/es/components/viewer3d/viewer3d.js +2527 -0
  170. package/es/constants.js +636 -0
  171. package/es/index.js +16 -0
  172. package/es/models.js +510 -0
  173. package/es/plugins/SVGLoader.js +1412 -0
  174. package/es/plugins/autosave.js +33 -0
  175. package/es/plugins/console-debugger.js +37 -0
  176. package/es/plugins/export.js +9 -0
  177. package/es/plugins/keyboard.js +101 -0
  178. package/es/reducers/areas-reducer.js +12 -0
  179. package/es/reducers/export.js +25 -0
  180. package/es/reducers/groups-reducer.js +38 -0
  181. package/es/reducers/holes-reducer.js +62 -0
  182. package/es/reducers/items-reducer.js +140 -0
  183. package/es/reducers/lines-reducer.js +45 -0
  184. package/es/reducers/project-reducer.js +129 -0
  185. package/es/reducers/reducer.js +19 -0
  186. package/es/reducers/scene-reducer.js +28 -0
  187. package/es/reducers/user-reducer.js +40 -0
  188. package/es/reducers/vertices-reducer.js +19 -0
  189. package/es/reducers/viewer2d-reducer.js +75 -0
  190. package/es/reducers/viewer3d-reducer.js +56 -0
  191. package/es/shared-style.js +66 -0
  192. package/es/styles/export.js +5 -0
  193. package/es/styles/tabs.css +40 -0
  194. package/es/translator/en.js +104 -0
  195. package/es/translator/it.js +79 -0
  196. package/es/translator/ru.js +79 -0
  197. package/es/translator/translator.js +84 -0
  198. package/es/utils/browser.js +33 -0
  199. package/es/utils/email-validator.js +4 -0
  200. package/es/utils/export.js +25 -0
  201. package/es/utils/geometry.js +2420 -0
  202. package/es/utils/get-edges-of-subgraphs.js +27 -0
  203. package/es/utils/graph-cycles.js +237 -0
  204. package/es/utils/graph-inner-cycles.js +46 -0
  205. package/es/utils/graph.js +150 -0
  206. package/es/utils/helper.js +268 -0
  207. package/es/utils/history.js +29 -0
  208. package/es/utils/id-broker.js +19 -0
  209. package/es/utils/logger.js +8 -0
  210. package/es/utils/math.js +50 -0
  211. package/es/utils/molding.js +871 -0
  212. package/es/utils/name-generator.js +18 -0
  213. package/es/utils/objects-utils.js +50 -0
  214. package/es/utils/phone-validator.js +4 -0
  215. package/es/utils/process-black-list.js +18 -0
  216. package/es/utils/react-if.js +18 -0
  217. package/es/utils/snap-scene.js +99 -0
  218. package/es/utils/snap.js +237 -0
  219. package/es/utils/summarizeCart.js +24 -0
  220. package/es/utils/threeCSG.es6.js +498 -0
  221. package/es/version.js +2 -0
  222. package/lib/catalog/properties/property-string.js +55 -0
  223. package/lib/catalog/properties/property-toggle.js +46 -0
  224. package/lib/catalog/properties/shared-property-style.js +20 -0
  225. package/lib/catalog/utils/FuseUtils.js +88 -0
  226. package/lib/catalog/utils/exporter.js +155 -0
  227. package/lib/catalog/utils/geom-utils.js +205 -0
  228. package/lib/catalog/utils/item-loader.js +1533 -0
  229. package/lib/catalog/utils/load-obj.js +99 -0
  230. package/lib/catalog/utils/mtl-loader.js +363 -0
  231. package/lib/catalog/utils/obj-loader.js +482 -0
  232. package/lib/class/FuseUtils.js +88 -0
  233. package/lib/class/area.js +150 -0
  234. package/lib/class/export.js +96 -0
  235. package/lib/class/group.js +445 -0
  236. package/lib/class/guide.js +67 -0
  237. package/lib/class/hole.js +934 -0
  238. package/lib/class/item.js +1889 -0
  239. package/lib/class/layer.js +672 -0
  240. package/lib/class/line.js +1186 -0
  241. package/lib/class/project.js +799 -0
  242. package/lib/class/vertex.js +207 -0
  243. package/lib/components/content.js +116 -0
  244. package/lib/components/disclaimer/disclaimer.js +105 -0
  245. package/lib/components/export.js +33 -0
  246. package/lib/components/style/button.js +120 -0
  247. package/lib/components/style/cancel-button.js +29 -0
  248. package/lib/components/style/content-container.js +40 -0
  249. package/lib/components/style/content-title.js +37 -0
  250. package/lib/components/style/delete-button.js +34 -0
  251. package/lib/components/style/export.js +121 -0
  252. package/lib/components/style/form-block.js +31 -0
  253. package/lib/components/style/form-color-input.js +34 -0
  254. package/lib/components/style/form-label.js +33 -0
  255. package/lib/components/style/form-number-input.js +220 -0
  256. package/lib/components/style/form-number-input_2.js +213 -0
  257. package/lib/components/style/form-select.js +75 -0
  258. package/lib/components/style/form-slider.js +68 -0
  259. package/lib/components/style/form-submit-button.js +35 -0
  260. package/lib/components/style/form-text-input.js +101 -0
  261. package/lib/components/viewer2d/area.js +88 -0
  262. package/lib/components/viewer2d/export.js +121 -0
  263. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
  264. package/lib/components/viewer2d/grids/grid-streak.js +44 -0
  265. package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
  266. package/lib/components/viewer2d/grids/grids.js +44 -0
  267. package/lib/components/viewer2d/group.js +62 -0
  268. package/lib/components/viewer2d/item.js +521 -0
  269. package/lib/components/viewer2d/layer.js +171 -0
  270. package/lib/components/viewer2d/line.js +892 -0
  271. package/lib/components/viewer2d/ruler.js +107 -0
  272. package/lib/components/viewer2d/rulerDist.js +153 -0
  273. package/lib/components/viewer2d/rulerX.js +158 -0
  274. package/lib/components/viewer2d/rulerY.js +160 -0
  275. package/lib/components/viewer2d/scene.js +147 -0
  276. package/lib/components/viewer2d/snap.js +83 -0
  277. package/lib/components/viewer2d/state.js +87 -0
  278. package/lib/components/viewer2d/utils.js +210 -0
  279. package/lib/components/viewer2d/vertex.js +74 -0
  280. package/lib/components/viewer2d/viewer2d.js +1405 -0
  281. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2597 -0
  282. package/lib/components/viewer3d/dcm.js +407 -0
  283. package/lib/components/viewer3d/fbm.js +420 -0
  284. package/lib/components/viewer3d/front3D.js +75 -0
  285. package/lib/components/viewer3d/grid-creator.js +34 -0
  286. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +44 -0
  287. package/lib/components/viewer3d/grids/grid-streak.js +35 -0
  288. package/lib/components/viewer3d/grids/grid-vertical-streak.js +44 -0
  289. package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
  290. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
  291. package/lib/components/viewer3d/libs/mtl-loader.js +363 -0
  292. package/lib/components/viewer3d/libs/obj-loader.js +468 -0
  293. package/lib/components/viewer3d/libs/orbit-controls.js +705 -0
  294. package/lib/components/viewer3d/libs/pointer-lock-controls.js +52 -0
  295. package/lib/components/viewer3d/lrm.js +311 -0
  296. package/lib/components/viewer3d/model.js +714 -0
  297. package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
  298. package/lib/components/viewer3d/ruler-utils/itemRect.js +68 -0
  299. package/lib/components/viewer3d/ruler-utils/layer3D.js +502 -0
  300. package/lib/components/viewer3d/ruler-utils/ruler3D.js +234 -0
  301. package/lib/components/viewer3d/ruler-utils/scene3D.js +68 -0
  302. package/lib/components/viewer3d/ruler-utils/state3D.js +25 -0
  303. package/lib/components/viewer3d/scene-creator.js +3642 -0
  304. package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
  305. package/lib/components/viewer3d/viewer3d-first-person.js +320 -0
  306. package/lib/components/viewer3d/viewer3d.js +2532 -0
  307. package/lib/constants.js +645 -0
  308. package/lib/index.js +96 -0
  309. package/lib/models.js +517 -0
  310. package/lib/plugins/SVGLoader.js +1417 -0
  311. package/lib/plugins/autosave.js +39 -0
  312. package/lib/plugins/console-debugger.js +44 -0
  313. package/lib/plugins/export.js +33 -0
  314. package/lib/plugins/keyboard.js +107 -0
  315. package/lib/reducers/areas-reducer.js +18 -0
  316. package/lib/reducers/export.js +97 -0
  317. package/lib/reducers/groups-reducer.js +44 -0
  318. package/lib/reducers/holes-reducer.js +68 -0
  319. package/lib/reducers/items-reducer.js +146 -0
  320. package/lib/reducers/lines-reducer.js +51 -0
  321. package/lib/reducers/project-reducer.js +135 -0
  322. package/lib/reducers/reducer.js +26 -0
  323. package/lib/reducers/scene-reducer.js +34 -0
  324. package/lib/reducers/user-reducer.js +46 -0
  325. package/lib/reducers/vertices-reducer.js +25 -0
  326. package/lib/reducers/viewer2d-reducer.js +82 -0
  327. package/lib/reducers/viewer3d-reducer.js +63 -0
  328. package/lib/shared-style.js +72 -0
  329. package/lib/styles/export.js +13 -0
  330. package/lib/translator/en.js +110 -0
  331. package/lib/translator/it.js +85 -0
  332. package/lib/translator/ru.js +85 -0
  333. package/lib/translator/translator.js +90 -0
  334. package/lib/utils/browser.js +40 -0
  335. package/lib/utils/email-validator.js +10 -0
  336. package/lib/utils/export.js +56 -0
  337. package/lib/utils/geometry.js +2516 -0
  338. package/lib/utils/get-edges-of-subgraphs.js +34 -0
  339. package/lib/utils/graph-cycles.js +240 -0
  340. package/lib/utils/graph-inner-cycles.js +54 -0
  341. package/lib/utils/graph.js +157 -0
  342. package/lib/utils/helper.js +291 -0
  343. package/lib/utils/history.js +36 -0
  344. package/lib/utils/id-broker.js +25 -0
  345. package/lib/utils/logger.js +14 -0
  346. package/lib/utils/math.js +57 -0
  347. package/lib/utils/molding.js +895 -0
  348. package/lib/utils/name-generator.js +23 -0
  349. package/lib/utils/objects-utils.js +60 -0
  350. package/lib/utils/phone-validator.js +10 -0
  351. package/lib/utils/process-black-list.js +24 -0
  352. package/lib/utils/react-if.js +24 -0
  353. package/lib/utils/snap-scene.js +105 -0
  354. package/lib/utils/snap.js +249 -0
  355. package/lib/utils/summarizeCart.js +30 -0
  356. package/lib/utils/threeCSG.es6.js +503 -0
  357. package/lib/version.js +8 -0
  358. package/package.json +3 -3
package/es/@history.js ADDED
@@ -0,0 +1,2 @@
1
+ import * as history from 'history';
2
+ export default history.createBrowserHistory();
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ var AppContext = /*#__PURE__*/React.createContext({});
3
+ export default AppContext;
@@ -0,0 +1,645 @@
1
+ var _excluded = ["width", "height", "state", "stateExtractor"];
2
+ 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); }
3
+ 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); }
4
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
5
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
6
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
7
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
8
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
9
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
10
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
11
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+ 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; } }
13
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
14
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
15
+ 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; }
16
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
19
+ 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); } }
20
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
21
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
22
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
23
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
24
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
25
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
26
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
27
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
28
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
29
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
30
+ 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); }
31
+ import axios from 'axios';
32
+ import * as convert from 'convert-units';
33
+ import { Plugins as PlannerPlugins } from "./index";
34
+ import PropTypes from 'prop-types';
35
+ import React, { Component } from 'react';
36
+ import { connect } from 'react-redux';
37
+ import { bindActionCreators } from 'redux';
38
+ import * as constants from "./constants";
39
+ import { base64Decode } from "./utils/helper";
40
+ import actions from "./actions/export";
41
+ import Catalog from "./catalog/catalog";
42
+ import { Content } from "./components/export";
43
+ import Translator from "./translator/translator";
44
+ import { objectsMap } from "./utils/objects-utils";
45
+ import { VERSION } from "./version";
46
+ var toolbarW = 0;
47
+ var wrapperStyle = {
48
+ display: 'flex',
49
+ flexFlow: 'row nowrap'
50
+ };
51
+ var KitchenConfigurator = /*#__PURE__*/function (_Component) {
52
+ function KitchenConfigurator(props) {
53
+ var _utmRequestData2, _utmRequestData3, _utmRequestData4, _utmRequestData5, _utmRequestData6, _utmRequestData7, _utmRequestData8, _utmRequestData9, _utmRequestData0;
54
+ var _this;
55
+ _classCallCheck(this, KitchenConfigurator);
56
+ _this = _callSuper(this, KitchenConfigurator, [props]);
57
+
58
+ // utm tracking
59
+ _defineProperty(_this, "handleBeforeUnload", function (e) {
60
+ var areas = _this.props.stateExtractor(_this.props.state).getIn(['scene', 'layers', _this.props.stateExtractor(_this.props.state).scene.selectedLayer, 'areas']);
61
+ if (!_this.state.isSaved && areas.size > 0) {
62
+ setTimeout(function () {
63
+ _this.setState({
64
+ savePromptVisible: true,
65
+ isLeaving: true
66
+ });
67
+ }, 500);
68
+ _this.saveProjectToStorage();
69
+
70
+ // This line is required to trigger the browser confirmation dialog
71
+ e.preventDefault();
72
+ e.returnValue = '';
73
+ return '';
74
+ }
75
+ });
76
+ var utmDetailParams = new URLSearchParams(_this.props.location && _this.props.location.search);
77
+ var utmStrEncoded = utmDetailParams.get('details');
78
+ var utmRequestData = null;
79
+ if (utmStrEncoded) {
80
+ try {
81
+ var _utmRequestData;
82
+ utmRequestData = JSON.parse(base64Decode(utmStrEncoded));
83
+ utmRequestData = JSON.parse((_utmRequestData = utmRequestData) === null || _utmRequestData === void 0 ? void 0 : _utmRequestData.utm);
84
+ } catch (e) {
85
+ console.error('Cannot parse utm parameter: ', error);
86
+ utmRequestData = null;
87
+ }
88
+ }
89
+ _this.state = {
90
+ savePopupVisible: false,
91
+ quotePopupVisible: false,
92
+ assistPopupVisible: false,
93
+ newProjectPopupVisible: false,
94
+ isModalVisible: false,
95
+ submitPromptVisible: false,
96
+ stateSubmitType: constants.SUBMIT_REQUEST_ASSIST,
97
+ savePromptVisible: false,
98
+ isShowProperty: true,
99
+ submitTosave: false,
100
+ signOpen: false,
101
+ myProjectsOpen: false,
102
+ myProjectsToLogin: false,
103
+ downloadPopupVisible: false,
104
+ // For Toolbar Item
105
+ toolbar: '',
106
+ reviewQuotePopupOpened: false,
107
+ floorOpened: false,
108
+ cabinetOpened: false,
109
+ applianceOpened: false,
110
+ finishingOpened: false,
111
+ doorStyleOpen: false,
112
+ wizardStepOpend: false,
113
+ tutorialMouseEventsAdd: false,
114
+ replaceCabinetFlag: false,
115
+ isSnackBarOpen: false,
116
+ isSnackBar1Open: false,
117
+ redirectURL: '',
118
+ snackBarMessage: '',
119
+ isSaved: false,
120
+ isLeaving: false
121
+ };
122
+
123
+ // For UTM tracking
124
+ _this.utm = {
125
+ utm_source: ((_utmRequestData2 = utmRequestData) === null || _utmRequestData2 === void 0 ? void 0 : _utmRequestData2.source) || 'source',
126
+ utm_medium: ((_utmRequestData3 = utmRequestData) === null || _utmRequestData3 === void 0 ? void 0 : _utmRequestData3.medium) || 'medium',
127
+ utm_campaign: ((_utmRequestData4 = utmRequestData) === null || _utmRequestData4 === void 0 ? void 0 : _utmRequestData4.campaign) || 'campaign',
128
+ utm_term: ((_utmRequestData5 = utmRequestData) === null || _utmRequestData5 === void 0 ? void 0 : _utmRequestData5.term) || 'term',
129
+ utm_content: ((_utmRequestData6 = utmRequestData) === null || _utmRequestData6 === void 0 ? void 0 : _utmRequestData6.content) || 'content',
130
+ gclid: ((_utmRequestData7 = utmRequestData) === null || _utmRequestData7 === void 0 ? void 0 : _utmRequestData7.gclid) || 'gclid',
131
+ msclkid: ((_utmRequestData8 = utmRequestData) === null || _utmRequestData8 === void 0 ? void 0 : _utmRequestData8.msclkid) || 'msclkid',
132
+ fbclid: ((_utmRequestData9 = utmRequestData) === null || _utmRequestData9 === void 0 ? void 0 : _utmRequestData9.fbclid) || 'fbclid',
133
+ ttclid: ((_utmRequestData0 = utmRequestData) === null || _utmRequestData0 === void 0 ? void 0 : _utmRequestData0.ttclid) || 'ttclid'
134
+ };
135
+ _this.openFloor = _this.openFloor.bind(_this);
136
+ _this.openCabinet = _this.openCabinet.bind(_this);
137
+ _this.openFinishing = _this.openFinishing.bind(_this);
138
+ _this.openAppliance = _this.openAppliance.bind(_this);
139
+ _this.toggleDoorStyle = _this.toggleDoorStyle.bind(_this);
140
+ _this.onReviewQuoteClicked = _this.onReviewQuoteClicked.bind(_this);
141
+ _this.closeFloorTB = _this.closeFloorTB.bind(_this);
142
+ _this.closeCabinetTB = _this.closeCabinetTB.bind(_this);
143
+ _this.closeFinishingTB = _this.closeFinishingTB.bind(_this);
144
+ _this.closeApplianceTB = _this.closeApplianceTB.bind(_this);
145
+ _this.setToolbar = _this.setToolbar.bind(_this);
146
+ _this.replaceCabinet = _this.replaceCabinet.bind(_this);
147
+ _this.setSubmitToSave = _this.setSubmitToSave.bind(_this);
148
+ _this.setSignOpen = _this.setSignOpen.bind(_this);
149
+ _this.setMyProjectsOpen = _this.setMyProjectsOpen.bind(_this);
150
+ _this.setMyProjectsToLogin = _this.setMyProjectsToLogin.bind(_this);
151
+ _this.setDownloadPopupVisible = _this.setDownloadPopupVisible.bind(_this);
152
+ _this.neverShowInput = /*#__PURE__*/React.createRef(null);
153
+ _this.setShowProperty = _this.setShowProperty.bind(_this);
154
+ return _this;
155
+ }
156
+
157
+ // Toolbar control functions
158
+ _inherits(KitchenConfigurator, _Component);
159
+ return _createClass(KitchenConfigurator, [{
160
+ key: "setToolbar",
161
+ value: function setToolbar(toolBarKey) {
162
+ this.setState({
163
+ toolbar: toolBarKey
164
+ });
165
+ }
166
+ }, {
167
+ key: "setShowProperty",
168
+ value: function setShowProperty(value) {
169
+ this.setState({
170
+ isShowProperty: value
171
+ });
172
+ }
173
+ }, {
174
+ key: "setMyProjectsOpen",
175
+ value: function setMyProjectsOpen(value) {
176
+ this.setState({
177
+ myProjectsOpen: value
178
+ });
179
+ this.setState({
180
+ signOpen: false
181
+ });
182
+ this.setState({
183
+ wizardStepOpend: false
184
+ });
185
+ }
186
+ }, {
187
+ key: "setMyProjectsToLogin",
188
+ value: function setMyProjectsToLogin(value) {
189
+ this.setState({
190
+ myProjectsToLogin: value
191
+ });
192
+ }
193
+ }, {
194
+ key: "setDownloadPopupVisible",
195
+ value: function setDownloadPopupVisible(value) {
196
+ this.setState({
197
+ reviewQuotePopupOpened: false
198
+ });
199
+ this.setState({
200
+ savePopupVisible: false
201
+ });
202
+ this.setState({
203
+ quotePopupVisible: false
204
+ });
205
+ this.setState({
206
+ submitTosave: false
207
+ });
208
+ this.setState({
209
+ assistPopupVisible: false
210
+ });
211
+ this.setState({
212
+ newProjectPopupVisible: false
213
+ });
214
+ this.setState({
215
+ downloadPopupVisible: value
216
+ });
217
+ }
218
+ }, {
219
+ key: "setSubmitToSave",
220
+ value: function setSubmitToSave(value) {
221
+ this.setState({
222
+ submitTosave: value
223
+ });
224
+ }
225
+ }, {
226
+ key: "setSignOpen",
227
+ value: function setSignOpen(value) {
228
+ this.setState({
229
+ wizardStepOpend: false
230
+ });
231
+ this.setState({
232
+ myProjectsOpen: false
233
+ });
234
+ this.setState({
235
+ signOpen: value
236
+ });
237
+ }
238
+ }, {
239
+ key: "openFloor",
240
+ value: function openFloor() {
241
+ this.setState({
242
+ floorOpened: true
243
+ });
244
+ document.getElementById('make_floorplan_inactive').parentElement.parentElement.style.zIndex = 999;
245
+ }
246
+ }, {
247
+ key: "openCabinet",
248
+ value: function openCabinet() {
249
+ this.setState({
250
+ cabinetOpened: true
251
+ });
252
+ document.getElementById('add_cabinets_inactive').parentElement.parentElement.style.zIndex = 999;
253
+ }
254
+ }, {
255
+ key: "toggleDoorStyle",
256
+ value: function toggleDoorStyle(visible) {
257
+ this.setState({
258
+ doorStyleOpen: visible
259
+ });
260
+ document.getElementById('select_doorstyle_inactive').parentElement.parentElement.style.zIndex = visible ? 999 : 6;
261
+ }
262
+ }, {
263
+ key: "replaceCabinet",
264
+ value: function replaceCabinet(value) {
265
+ this.setState({
266
+ replaceCabinetFlag: value
267
+ });
268
+ }
269
+ }, {
270
+ key: "openAppliance",
271
+ value: function openAppliance() {
272
+ this.setState({
273
+ applianceOpened: true
274
+ });
275
+ document.getElementById('add_appliances_inactive').parentElement.parentElement.style.zIndex = 999;
276
+ }
277
+ }, {
278
+ key: "openFinishing",
279
+ value: function openFinishing() {
280
+ this.setState({
281
+ finishingOpened: true
282
+ });
283
+ document.getElementById('finishing_touches_inactive').parentElement.parentElement.style.zIndex = 999;
284
+ }
285
+ }, {
286
+ key: "onReviewQuoteClicked",
287
+ value: function onReviewQuoteClicked(visible) {
288
+ this.setState({
289
+ reviewQuotePopupOpened: visible
290
+ });
291
+ document.getElementById('review_quote_inactive').parentElement.parentElement.style.zIndex = visible ? 999 : 6;
292
+ }
293
+ }, {
294
+ key: "closeFloorTB",
295
+ value: function closeFloorTB() {
296
+ this.setState({
297
+ floorOpened: false
298
+ });
299
+ document.getElementById('make_floorplan_inactive') && (document.getElementById('make_floorplan_inactive').parentElement.parentElement.style.zIndex = 6);
300
+ }
301
+ }, {
302
+ key: "closeCabinetTB",
303
+ value: function closeCabinetTB() {
304
+ this.setState({
305
+ cabinetOpened: false
306
+ });
307
+ document.getElementById('add_cabinets_inactive').parentElement.parentElement.style.zIndex = 6;
308
+ }
309
+ }, {
310
+ key: "closeFinishingTB",
311
+ value: function closeFinishingTB() {
312
+ this.setState({
313
+ finishingOpened: false
314
+ });
315
+ document.getElementById('finishing_touches_inactive').parentElement.parentElement.style.zIndex = 6;
316
+ }
317
+ }, {
318
+ key: "closeApplianceTB",
319
+ value: function closeApplianceTB() {
320
+ this.setState({
321
+ applianceOpened: false
322
+ });
323
+ document.getElementById('add_appliances_inactive').parentElement.parentElement.style.zIndex = 6;
324
+ }
325
+ }, {
326
+ key: "closeDoorstyle",
327
+ value: function closeDoorstyle() {
328
+ this.setState({});
329
+ document.getElementById('select_doorstyle_inactive').parentElement.parentElement.style.zIndex = 6;
330
+ }
331
+ }, {
332
+ key: "closeReviewQuote",
333
+ value: function closeReviewQuote() {
334
+ this.setState({});
335
+ document.getElementById('review_quote_inactive').parentElement.parentElement.style.zIndex = 6;
336
+ }
337
+ }, {
338
+ key: "getChildContext",
339
+ value: function getChildContext() {
340
+ var _this2 = this;
341
+ return _objectSpread(_objectSpread({}, objectsMap(actions, function (actionNamespace) {
342
+ return _this2.props[actionNamespace];
343
+ })), {}, {
344
+ translator: this.props.translator,
345
+ catalog: this.props.catalog
346
+ });
347
+ }
348
+ }, {
349
+ key: "saveProjectToStorage",
350
+ value: function saveProjectToStorage() {
351
+ var _this$props = this.props,
352
+ state = _this$props.state,
353
+ stateExtractor = _this$props.stateExtractor;
354
+ var extractedState = stateExtractor(state);
355
+ var projectData = JSON.stringify(extractedState.get('scene').toJS());
356
+ sessionStorage.setItem(window.location.href, projectData);
357
+ }
358
+ }, {
359
+ key: "componentDidMount",
360
+ value: function componentDidMount() {
361
+ var _this3 = this;
362
+ window.addEventListener('beforeunload', this.handleBeforeUnload);
363
+ console.log('context =>', this.context);
364
+ window.forRedo = [];
365
+ var store = this.context.store;
366
+ var _this$props2 = this.props,
367
+ projectActions = _this$props2.projectActions,
368
+ catalog = _this$props2.catalog,
369
+ stateExtractor = _this$props2.stateExtractor,
370
+ state = _this$props2.state,
371
+ plugins = _this$props2.plugins;
372
+ projectActions.initCatalog(catalog);
373
+ var match = this.props.match;
374
+ if (sessionStorage.getItem(window.location.href)) {
375
+ var jsonData = sessionStorage.getItem(window.location.href);
376
+ projectActions.loadProject(JSON.parse(jsonData), this.props.categoryData);
377
+ sessionStorage.removeItem(window.location.href);
378
+ return;
379
+ }
380
+ if (match && match.params.pid === undefined) {
381
+ var newplugins = [].concat(_toConsumableArray(plugins), [PlannerPlugins.Autosave('KitchenConfigurator_v0', false)]);
382
+ newplugins.forEach(function (newplugin) {
383
+ return newplugin(store, stateExtractor);
384
+ });
385
+ projectActions.newProject();
386
+ sessionStorage.setItem('projectTitle', 'Untitled');
387
+ projectActions.rename('Untitled');
388
+ sessionStorage.removeItem('projectId');
389
+ sessionStorage.removeItem('email');
390
+ sessionStorage.removeItem('firstName');
391
+ sessionStorage.removeItem('lastName');
392
+ sessionStorage.removeItem('usedObjects');
393
+ return;
394
+ }
395
+ if (match && match.params.pid !== undefined) {
396
+ if (match.params.pid === 'new') {
397
+ projectActions.newProject();
398
+ sessionStorage.setItem('projectTitle', 'Untitled');
399
+ projectActions.rename('Untitled');
400
+ sessionStorage.removeItem('projectId');
401
+ sessionStorage.removeItem('email');
402
+ sessionStorage.removeItem('firstName');
403
+ sessionStorage.removeItem('lastName');
404
+ sessionStorage.removeItem('usedObjects');
405
+ } else {
406
+ axios.post("".concat(constants.API_SERVER_URL, "/api/project/loadPidProject"), {
407
+ pid: match.params.pid,
408
+ visualizerName: sessionStorage.getItem('visualizerName')
409
+ }).then(/*#__PURE__*/function () {
410
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(response) {
411
+ var projectElement, jsonData, _t;
412
+ return _regenerator().w(function (_context) {
413
+ while (1) switch (_context.p = _context.n) {
414
+ case 0:
415
+ projectElement = response.data.projectElement;
416
+ if (!(projectElement.length === 0)) {
417
+ _context.n = 1;
418
+ break;
419
+ }
420
+ return _context.a(2);
421
+ case 1:
422
+ sessionStorage.setItem('projectTitle', projectElement[0].title);
423
+ projectActions.rename(projectElement[0].title);
424
+ sessionStorage.setItem('projectId', projectElement[0].id);
425
+ sessionStorage.setItem('email', projectElement[0].email);
426
+ sessionStorage.setItem('firstName', projectElement[0].firstName);
427
+ sessionStorage.setItem('lastName', projectElement[0].lastName);
428
+ sessionStorage.setItem('phone', projectElement[0].phone);
429
+ if (!projectElement[0].project_data) {
430
+ _context.n = 2;
431
+ break;
432
+ }
433
+ jsonData = JSON.parse(projectElement[0].project_data);
434
+ _context.n = 5;
435
+ break;
436
+ case 2:
437
+ _context.p = 2;
438
+ _context.n = 3;
439
+ return axios.post("".concat(constants.API_SERVER_URL, "/api/project/loadPidData"), {
440
+ pid: match.params.pid
441
+ }).data.data;
442
+ case 3:
443
+ jsonData = _context.v;
444
+ _context.n = 5;
445
+ break;
446
+ case 4:
447
+ _context.p = 4;
448
+ _t = _context.v;
449
+ _this3.setState({
450
+ isSnackBarOpen: true,
451
+ snackBarMessage: _t
452
+ });
453
+ case 5:
454
+ jsonData.isLoadingCabinet = false;
455
+ projectActions.loadProject(jsonData, _this3.props.categoryData);
456
+ case 6:
457
+ return _context.a(2);
458
+ }
459
+ }, _callee, null, [[2, 4]]);
460
+ }));
461
+ return function (_x) {
462
+ return _ref.apply(this, arguments);
463
+ };
464
+ }());
465
+ }
466
+ sessionStorage.removeItem('user_type');
467
+ sessionStorage.removeItem('project_type');
468
+ sessionStorage.removeItem('project_timeline');
469
+ }
470
+ }
471
+ }, {
472
+ key: "componentWillUnmount",
473
+ value: function componentWillUnmount() {
474
+ window.addEventListener('beforeunload', this.handleBeforeUnload);
475
+ window.onbeforeunload = null;
476
+ }
477
+ }, {
478
+ key: "componentWillMount",
479
+ value: function componentWillMount() {}
480
+ }, {
481
+ key: "componentWillReceiveProps",
482
+ value: function componentWillReceiveProps(nextProps) {
483
+ var stateExtractor = nextProps.stateExtractor,
484
+ state = nextProps.state,
485
+ projectActions = nextProps.projectActions,
486
+ catalog = nextProps.catalog;
487
+ var plannerState = stateExtractor(state);
488
+ var catalogReady = plannerState.getIn(['catalog', 'ready']);
489
+ if (!catalogReady) {
490
+ projectActions.initCatalog(catalog);
491
+ }
492
+ }
493
+ }, {
494
+ key: "isProjectEmpty",
495
+ value: function isProjectEmpty(scene) {
496
+ var layers = scene.layers,
497
+ selectedLayer = scene.selectedLayer;
498
+ var layer = layers.get(selectedLayer);
499
+ return layer.areas.size + layer.lines.size + layer.holes.size + layer.items.size === 0;
500
+ }
501
+ }, {
502
+ key: "render",
503
+ value: function render() {
504
+ var _this$props3 = this.props,
505
+ width = _this$props3.width,
506
+ height = _this$props3.height,
507
+ state = _this$props3.state,
508
+ stateExtractor = _this$props3.stateExtractor,
509
+ props = _objectWithoutProperties(_this$props3, _excluded);
510
+ var _this$state = this.state,
511
+ savePopupVisible = _this$state.savePopupVisible,
512
+ quotePopupVisible = _this$state.quotePopupVisible,
513
+ assistPopupVisible = _this$state.assistPopupVisible,
514
+ signOpen = _this$state.signOpen,
515
+ myProjectsOpen = _this$state.myProjectsOpen;
516
+ var contentW = width - toolbarW;
517
+ var categoryData = this.props.categoryData;
518
+ // console.log(categoryData);
519
+ // let contentW = width - toolbarW - sidebarW;
520
+ // let toolbarH = height - footerBarH;
521
+ // let contentH = height - footerBarH;
522
+ // let sidebarH = height - footerBarH;
523
+ var toolbarH = height;
524
+ var contentH = height;
525
+ var sidebarH = height;
526
+ var headerW = width;
527
+ var headerH = 60;
528
+ var extractedState = stateExtractor(state);
529
+ var doorStyle = extractedState.get('doorStyle');
530
+ if (extractedState.getIn(['scene', 'layers', extractedState.scene.selectedLayer, 'doorStyle']) !== undefined && extractedState.getIn(['scene', 'layers', extractedState.scene.selectedLayer, 'doorStyle']) !== null) {
531
+ var extractedStateData = extractedState.getIn(['scene', 'layers', extractedState.scene.selectedLayer, 'doorStyle']);
532
+ var doorIdAvailable = false;
533
+ if (this.props.categoryData.doorStyles && this.props.categoryData.doorStyles.items) {
534
+ this.props.categoryData.doorStyles.items.find(function (category) {
535
+ doorIdAvailable = category.items.find(function (style) {
536
+ var item = style.items.find(function (it) {
537
+ return it.id === extractedStateData.id;
538
+ });
539
+ if (item) {
540
+ colorItem = item;
541
+ return true;
542
+ } else {
543
+ return false;
544
+ }
545
+ });
546
+ });
547
+ }
548
+ if (doorIdAvailable) doorStyle = extractedStateData;
549
+ }
550
+ var firstVisit = this.state.wizardStepOpend && this.isProjectEmpty(extractedState.scene);
551
+ var allVisible = firstVisit || signOpen || myProjectsOpen;
552
+ var _scene = extractedState.getIn(['scene']);
553
+ var len = convert(_scene.width).from(_scene.unit).to('cm');
554
+ var _viewer2D = extractedState.getIn(['viewer2D']);
555
+ if (_viewer2D.size > 0) {
556
+ var scaleX = width / len * 3;
557
+ var scaleY = height / len * 3;
558
+ var scale = scaleX > scaleY ? scaleY : scaleX;
559
+ var _e = width - len * scale,
560
+ _f = height - len * scale;
561
+ var viewer = _viewer2D.toJS();
562
+ if (viewer.e === 0 && viewer.f === 0) {
563
+ _viewer2D = _viewer2D.merge({
564
+ e: viewer.viewerWidth / 2 - viewer.SVGWidth / 2,
565
+ f: viewer.viewerHeight / 2 - viewer.SVGHeight / 2,
566
+ a: 0.99,
567
+ d: 0.99
568
+ });
569
+ }
570
+ }
571
+ extractedState = extractedState.merge({
572
+ viewer2D: _viewer2D
573
+ });
574
+ return /*#__PURE__*/React.createElement("section", null, /*#__PURE__*/React.createElement("div", {
575
+ style: _objectSpread(_objectSpread({}, wrapperStyle), {}, {
576
+ height: height
577
+ })
578
+ }, /*#__PURE__*/React.createElement(Content, _extends({
579
+ width: contentW,
580
+ height: contentH,
581
+ catalog: this.props.catalog,
582
+ state: extractedState,
583
+ toolBar: this.state.toolbar,
584
+ setToolbar: this.setToolbar,
585
+ replaceCabinet: this.replaceCabinet,
586
+ keyDownEnable: !savePopupVisible && !quotePopupVisible && !assistPopupVisible
587
+ }, props, {
588
+ onWheel: function onWheel(event) {
589
+ return event.preventDefault();
590
+ }
591
+ }))));
592
+ }
593
+ }]);
594
+ }(Component);
595
+ KitchenConfigurator.propTypes = {
596
+ translator: PropTypes.instanceOf(Translator),
597
+ catalog: PropTypes.instanceOf(Catalog),
598
+ allowProjectFileSupport: PropTypes.bool,
599
+ plugins: PropTypes.arrayOf(PropTypes.func),
600
+ autosaveKey: PropTypes.string,
601
+ autosaveDelay: PropTypes.number,
602
+ width: PropTypes.number.isRequired,
603
+ height: PropTypes.number.isRequired,
604
+ stateExtractor: PropTypes.func.isRequired,
605
+ toolbarButtons: PropTypes.array,
606
+ sidebarComponents: PropTypes.array,
607
+ footerbarComponents: PropTypes.array,
608
+ customContents: PropTypes.object,
609
+ softwareSignature: PropTypes.string,
610
+ configData: PropTypes.object
611
+ };
612
+ KitchenConfigurator.contextTypes = {
613
+ store: PropTypes.object.isRequired
614
+ };
615
+ KitchenConfigurator.childContextTypes = _objectSpread(_objectSpread({}, objectsMap(actions, function () {
616
+ return PropTypes.object;
617
+ })), {}, {
618
+ translator: PropTypes.object,
619
+ catalog: PropTypes.object
620
+ });
621
+ KitchenConfigurator.defaultProps = {
622
+ translator: new Translator(),
623
+ catalog: new Catalog(),
624
+ plugins: [],
625
+ allowProjectFileSupport: true,
626
+ softwareSignature: "KitchenConfigurator ".concat(VERSION),
627
+ toolbarButtons: [],
628
+ sidebarComponents: [],
629
+ footerbarComponents: [],
630
+ customContents: {},
631
+ configData: {}
632
+ };
633
+
634
+ //redux connect
635
+ function mapStateToProps(reduxState) {
636
+ return {
637
+ state: reduxState
638
+ };
639
+ }
640
+ function mapDispatchToProps(dispatch) {
641
+ return objectsMap(actions, function (actionNamespace) {
642
+ return bindActionCreators(actions[actionNamespace], dispatch);
643
+ });
644
+ }
645
+ export default connect(mapStateToProps, mapDispatchToProps)(KitchenConfigurator);