@crystaldesign/web-planner-logic 26.13.0-beta.32 → 26.13.0-beta.34

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 (184) hide show
  1. package/build/cjs/{DivaBoxPlanner-f9f577b0.js → DivaBoxPlanner-7f6bd584.js} +3 -3
  2. package/build/cjs/{DivaStandardPlanner-fd71c557.js → DivaStandardPlanner-77c603dc.js} +1903 -195
  3. package/build/cjs/{DoorPlanner-1e941d6e.js → DoorPlanner-5de2bbf0.js} +2 -2
  4. package/build/cjs/{Host3DSignalR-7aa4d347.js → Host3DSignalR-26b95303.js} +2 -2
  5. package/build/cjs/{LiviqueWWSHandler-c8f83739.js → LiviqueWWSHandler-1e419862.js} +2 -2
  6. package/build/cjs/{PfisterWWSHandler-d3fd59c5.js → PfisterWWSHandler-b2f7a5ec.js} +2 -2
  7. package/build/cjs/{PlannerHandler2D-e6d1cebc.js → PlannerHandler2D-ff734c3e.js} +10 -10
  8. package/build/cjs/{SeriousBasketHandler-c8abdb16.js → SeriousBasketHandler-e54bd31b.js} +2 -2
  9. package/build/cjs/{ShelfPlanner-173ee746.js → ShelfPlanner-08e15d16.js} +489 -193
  10. package/build/cjs/{StandardWWSHandler-e31f5446.js → StandardWWSHandler-0e7b20dc.js} +2 -2
  11. package/build/cjs/{index-76d3a1ec.js → index-5dd5fb4b.js} +7067 -2170
  12. package/build/cjs/index.js +9 -3
  13. package/build/esm/{DivaBoxPlanner-086b4c02.js → DivaBoxPlanner-6ac448b4.js} +3 -3
  14. package/build/esm/{DivaStandardPlanner-9864a9dd.js → DivaStandardPlanner-abd9609d.js} +1893 -186
  15. package/build/esm/{DoorPlanner-d29bc13e.js → DoorPlanner-fde32e61.js} +2 -2
  16. package/build/esm/{Host3DSignalR-dbe6624e.js → Host3DSignalR-0f97c7f3.js} +2 -2
  17. package/build/esm/{LiviqueWWSHandler-60691979.js → LiviqueWWSHandler-9ee5b7cb.js} +2 -2
  18. package/build/esm/{PfisterWWSHandler-1fe8accd.js → PfisterWWSHandler-b9699549.js} +2 -2
  19. package/build/esm/{PlannerHandler2D-88b9a108.js → PlannerHandler2D-8d963e77.js} +2 -2
  20. package/build/esm/{SeriousBasketHandler-0a3966d6.js → SeriousBasketHandler-40e7e46c.js} +2 -2
  21. package/build/esm/{ShelfPlanner-614b7281.js → ShelfPlanner-69cbb2c1.js} +489 -193
  22. package/build/esm/{StandardWWSHandler-12b16709.js → StandardWWSHandler-dbf02663.js} +2 -2
  23. package/build/esm/{index-8d311c4b.js → index-88148ccc.js} +7022 -2163
  24. package/build/esm/index.js +2 -2
  25. package/build/types/web-planner-logic/src/index.d.ts +6 -1
  26. package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/Articles/CatalogArticleDataType.d.ts +13 -0
  28. package/build/types/web-planner-logic/src/interface/Articles/CatalogArticleDataType.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +5 -0
  30. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts +15 -1
  32. package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts +10 -0
  34. package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/interface/Planner/ISaveSetPlanner.d.ts +10 -0
  36. package/build/types/web-planner-logic/src/interface/Planner/ISaveSetPlanner.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/interface/Planner/RoomSceneTypes.d.ts +76 -0
  38. package/build/types/web-planner-logic/src/interface/Planner/RoomSceneTypes.d.ts.map +1 -0
  39. package/build/types/web-planner-logic/src/interface/Rendering/AlternativeRendering.d.ts +4 -0
  40. package/build/types/web-planner-logic/src/interface/Rendering/AlternativeRendering.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/interface/ShelfPlanner/ShelfAccessoiresView.d.ts +5 -0
  42. package/build/types/web-planner-logic/src/interface/ShelfPlanner/ShelfAccessoiresView.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts +1 -1
  44. package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts.map +1 -1
  45. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts.map +1 -1
  46. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts +7 -0
  47. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts.map +1 -1
  48. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +51 -7
  49. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts.map +1 -1
  50. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlannerGrid.d.ts +14 -2
  51. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlannerGrid.d.ts.map +1 -1
  52. package/build/types/web-planner-logic/src/logic/ConfigTree/viewerStateToggles.d.ts +19 -0
  53. package/build/types/web-planner-logic/src/logic/ConfigTree/viewerStateToggles.d.ts.map +1 -0
  54. package/build/types/web-planner-logic/src/logic/ConfigTree/viewerStateToggles.test.d.ts +2 -0
  55. package/build/types/web-planner-logic/src/logic/ConfigTree/viewerStateToggles.test.d.ts.map +1 -0
  56. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +107 -23
  57. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  58. package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts +74 -9
  59. package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts.map +1 -1
  60. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts +175 -4
  61. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts.map +1 -1
  62. package/build/types/web-planner-logic/src/logic/Planner/IDM3D/idm3dTranslation.d.ts +6 -7
  63. package/build/types/web-planner-logic/src/logic/Planner/IDM3D/idm3dTranslation.d.ts.map +1 -1
  64. package/build/types/web-planner-logic/src/logic/Planner/IDM3D/idm3dTranslation.test.d.ts +2 -0
  65. package/build/types/web-planner-logic/src/logic/Planner/IDM3D/idm3dTranslation.test.d.ts.map +1 -0
  66. package/build/types/web-planner-logic/src/logic/Planner/Placement/carrierGuests.d.ts +75 -0
  67. package/build/types/web-planner-logic/src/logic/Planner/Placement/carrierGuests.d.ts.map +1 -0
  68. package/build/types/web-planner-logic/src/logic/Planner/Placement/guestPlacement.d.ts +47 -0
  69. package/build/types/web-planner-logic/src/logic/Planner/Placement/guestPlacement.d.ts.map +1 -0
  70. package/build/types/web-planner-logic/src/logic/Planner/Placement/guestPlacement.test.d.ts +2 -0
  71. package/build/types/web-planner-logic/src/logic/Planner/Placement/guestPlacement.test.d.ts.map +1 -0
  72. package/build/types/web-planner-logic/src/logic/Planner/Placement/placementDefaults.d.ts +9 -0
  73. package/build/types/web-planner-logic/src/logic/Planner/Placement/placementDefaults.d.ts.map +1 -0
  74. package/build/types/web-planner-logic/src/logic/Planner/Placement/placementRules.d.ts +78 -0
  75. package/build/types/web-planner-logic/src/logic/Planner/Placement/placementRules.d.ts.map +1 -0
  76. package/build/types/web-planner-logic/src/logic/Planner/Placement/placementRules.test.d.ts +2 -0
  77. package/build/types/web-planner-logic/src/logic/Planner/Placement/placementRules.test.d.ts.map +1 -0
  78. package/build/types/web-planner-logic/src/logic/Planner/Placement/placementSlots.d.ts +81 -0
  79. package/build/types/web-planner-logic/src/logic/Planner/Placement/placementSlots.d.ts.map +1 -0
  80. package/build/types/web-planner-logic/src/logic/Planner/Placement/placementTypes.d.ts +13 -0
  81. package/build/types/web-planner-logic/src/logic/Planner/Placement/placementTypes.d.ts.map +1 -0
  82. package/build/types/web-planner-logic/src/logic/Planner/PlannerUtils/DockingPointHandler.d.ts +1 -1
  83. package/build/types/web-planner-logic/src/logic/Planner/PlannerUtils/DockingPointHandler.d.ts.map +1 -1
  84. package/build/types/web-planner-logic/src/logic/Planner/PlannerUtils/SVGUtils.d.ts +1 -1
  85. package/build/types/web-planner-logic/src/logic/Planner/Rendering/PlannerHandler3D.d.ts +13 -1
  86. package/build/types/web-planner-logic/src/logic/Planner/Rendering/PlannerHandler3D.d.ts.map +1 -1
  87. package/build/types/web-planner-logic/src/logic/Planner/Room/elementShapes.d.ts +56 -0
  88. package/build/types/web-planner-logic/src/logic/Planner/Room/elementShapes.d.ts.map +1 -0
  89. package/build/types/web-planner-logic/src/logic/Planner/Room/elementShapes.test.d.ts +2 -0
  90. package/build/types/web-planner-logic/src/logic/Planner/Room/elementShapes.test.d.ts.map +1 -0
  91. package/build/types/web-planner-logic/src/logic/Planner/Room/roomCollisions.d.ts +90 -0
  92. package/build/types/web-planner-logic/src/logic/Planner/Room/roomCollisions.d.ts.map +1 -0
  93. package/build/types/web-planner-logic/src/logic/Planner/Room/roomCollisions.test.d.ts +2 -0
  94. package/build/types/web-planner-logic/src/logic/Planner/Room/roomCollisions.test.d.ts.map +1 -0
  95. package/build/types/web-planner-logic/src/logic/Planner/Room/roomGroups.d.ts +32 -0
  96. package/build/types/web-planner-logic/src/logic/Planner/Room/roomGroups.d.ts.map +1 -0
  97. package/build/types/web-planner-logic/src/logic/Planner/Room/roomGroups.test.d.ts +2 -0
  98. package/build/types/web-planner-logic/src/logic/Planner/Room/roomGroups.test.d.ts.map +1 -0
  99. package/build/types/web-planner-logic/src/logic/Planner/Room/roomProperties.test.d.ts +2 -0
  100. package/build/types/web-planner-logic/src/logic/Planner/Room/roomProperties.test.d.ts.map +1 -0
  101. package/build/types/web-planner-logic/src/logic/Planner/Room/roomScenes.d.ts +21 -0
  102. package/build/types/web-planner-logic/src/logic/Planner/Room/roomScenes.d.ts.map +1 -0
  103. package/build/types/web-planner-logic/src/logic/Planner/Room/roomScenes.test.d.ts +2 -0
  104. package/build/types/web-planner-logic/src/logic/Planner/Room/roomScenes.test.d.ts.map +1 -0
  105. package/build/types/web-planner-logic/src/logic/Planner/Room/roomValidation.d.ts +13 -0
  106. package/build/types/web-planner-logic/src/logic/Planner/Room/roomValidation.d.ts.map +1 -0
  107. package/build/types/web-planner-logic/src/logic/Planner/Room/roomValidation.test.d.ts +2 -0
  108. package/build/types/web-planner-logic/src/logic/Planner/Room/roomValidation.test.d.ts.map +1 -0
  109. package/build/types/web-planner-logic/src/logic/Planner/Room/rtvFeatures.d.ts +17 -0
  110. package/build/types/web-planner-logic/src/logic/Planner/Room/rtvFeatures.d.ts.map +1 -0
  111. package/build/types/web-planner-logic/src/logic/Planner/Room/rtvFeatures.test.d.ts +2 -0
  112. package/build/types/web-planner-logic/src/logic/Planner/Room/rtvFeatures.test.d.ts.map +1 -0
  113. package/build/types/web-planner-logic/src/logic/Planner/Room/wallBinding.d.ts +72 -0
  114. package/build/types/web-planner-logic/src/logic/Planner/Room/wallBinding.d.ts.map +1 -0
  115. package/build/types/web-planner-logic/src/logic/Planner/Room/wallBinding.test.d.ts +2 -0
  116. package/build/types/web-planner-logic/src/logic/Planner/Room/wallBinding.test.d.ts.map +1 -0
  117. package/build/types/web-planner-logic/src/logic/Planner/Room/wallMode.d.ts +7 -0
  118. package/build/types/web-planner-logic/src/logic/Planner/Room/wallMode.d.ts.map +1 -0
  119. package/build/types/web-planner-logic/src/logic/Planner/plannerSwitch.d.ts +32 -0
  120. package/build/types/web-planner-logic/src/logic/Planner/plannerSwitch.d.ts.map +1 -0
  121. package/build/types/web-planner-logic/src/logic/Planner/plannerSwitch.test.d.ts +2 -0
  122. package/build/types/web-planner-logic/src/logic/Planner/plannerSwitch.test.d.ts.map +1 -0
  123. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +12 -6
  124. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
  125. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +26 -6
  126. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  127. package/build/types/web-planner-logic/src/model/Articles/Article/CatalogArticleData.d.ts +4 -0
  128. package/build/types/web-planner-logic/src/model/Articles/Article/CatalogArticleData.d.ts.map +1 -1
  129. package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts +27 -0
  130. package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts.map +1 -1
  131. package/build/types/web-planner-logic/src/model/Catalog/DivaCatalogData.d.ts.map +1 -1
  132. package/build/types/web-planner-logic/src/model/Catalog/IDMCatalogData.d.ts.map +1 -1
  133. package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts +10 -0
  134. package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts.map +1 -1
  135. package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts +4 -1
  136. package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts.map +1 -1
  137. package/build/types/web-planner-logic/src/model/Planner/DockingPoint.d.ts +1 -1
  138. package/build/types/web-planner-logic/src/model/Planner/DockingPoint.d.ts.map +1 -1
  139. package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts +29 -0
  140. package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts.map +1 -1
  141. package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts.map +1 -1
  142. package/build/types/web-planner-logic/src/test/alternateRenderingToggle.test.d.ts +2 -0
  143. package/build/types/web-planner-logic/src/test/alternateRenderingToggle.test.d.ts.map +1 -0
  144. package/build/types/web-planner-logic/src/test/capturedSetImages.test.d.ts +1 -0
  145. package/build/types/web-planner-logic/src/test/capturedSetImages.test.d.ts.map +1 -1
  146. package/build/types/web-planner-logic/src/test/carrierGuests.test.d.ts +2 -0
  147. package/build/types/web-planner-logic/src/test/carrierGuests.test.d.ts.map +1 -0
  148. package/build/types/web-planner-logic/src/test/copyRestoreConnectors.test.d.ts +2 -0
  149. package/build/types/web-planner-logic/src/test/copyRestoreConnectors.test.d.ts.map +1 -0
  150. package/build/types/web-planner-logic/src/test/dragZones.test.d.ts +2 -0
  151. package/build/types/web-planner-logic/src/test/dragZones.test.d.ts.map +1 -0
  152. package/build/types/web-planner-logic/src/test/familySwapInPlace.test.d.ts +2 -0
  153. package/build/types/web-planner-logic/src/test/familySwapInPlace.test.d.ts.map +1 -0
  154. package/build/types/web-planner-logic/src/test/headlessRoomScenes.test.d.ts +2 -0
  155. package/build/types/web-planner-logic/src/test/headlessRoomScenes.test.d.ts.map +1 -0
  156. package/build/types/web-planner-logic/src/test/liveArUpdate.test.d.ts +2 -0
  157. package/build/types/web-planner-logic/src/test/liveArUpdate.test.d.ts.map +1 -0
  158. package/build/types/web-planner-logic/src/test/oltRectBody.test.d.ts +2 -0
  159. package/build/types/web-planner-logic/src/test/oltRectBody.test.d.ts.map +1 -0
  160. package/build/types/web-planner-logic/src/test/plannerRoomScenesSwitch.test.d.ts +2 -0
  161. package/build/types/web-planner-logic/src/test/plannerRoomScenesSwitch.test.d.ts.map +1 -0
  162. package/build/types/web-planner-logic/src/test/planning2DCapture.test.d.ts +2 -0
  163. package/build/types/web-planner-logic/src/test/planning2DCapture.test.d.ts.map +1 -0
  164. package/build/types/web-planner-logic/src/test/planningRoundTrip.test.d.ts +2 -0
  165. package/build/types/web-planner-logic/src/test/planningRoundTrip.test.d.ts.map +1 -0
  166. package/build/types/web-planner-logic/src/test/roomDragContact.test.d.ts +2 -0
  167. package/build/types/web-planner-logic/src/test/roomDragContact.test.d.ts.map +1 -0
  168. package/build/types/web-planner-logic/src/test/roomPlacement.test.d.ts +2 -0
  169. package/build/types/web-planner-logic/src/test/roomPlacement.test.d.ts.map +1 -0
  170. package/build/types/web-planner-logic/src/test/roomScenePlanning.test.d.ts +2 -0
  171. package/build/types/web-planner-logic/src/test/roomScenePlanning.test.d.ts.map +1 -0
  172. package/build/types/web-planner-logic/src/test/rotationSnap.test.d.ts +2 -0
  173. package/build/types/web-planner-logic/src/test/rotationSnap.test.d.ts.map +1 -0
  174. package/build/types/web-planner-logic/src/test/shelfEditNoting.test.d.ts +3 -0
  175. package/build/types/web-planner-logic/src/test/shelfEditNoting.test.d.ts.map +1 -0
  176. package/build/types/web-planner-logic/src/test/shelfGridCarryOver.test.d.ts +2 -0
  177. package/build/types/web-planner-logic/src/test/shelfGridCarryOver.test.d.ts.map +1 -0
  178. package/build/types/web-planner-logic/src/test/shelfMoveLocks.test.d.ts +2 -0
  179. package/build/types/web-planner-logic/src/test/shelfMoveLocks.test.d.ts.map +1 -0
  180. package/build/types/web-planner-logic/src/test/shelfOfferedCells.test.d.ts +2 -0
  181. package/build/types/web-planner-logic/src/test/shelfOfferedCells.test.d.ts.map +1 -0
  182. package/build/types/web-planner-logic/src/test/sideCopySubstitute.test.d.ts +3 -0
  183. package/build/types/web-planner-logic/src/test/sideCopySubstitute.test.d.ts.map +1 -0
  184. package/package.json +3 -3
@@ -4,14 +4,14 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
4
4
  import _createClass from '@babel/runtime/helpers/createClass';
5
5
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
6
6
  import _regeneratorRuntime from '@babel/runtime/regenerator';
7
- import { G as Grid, a as articleHandlerInstance, b as setHandlerInstance } from './index-8d311c4b.js';
7
+ import { G as Grid, f as familyMembersOf, a as articleHandlerInstance, b as setHandlerInstance } from './index-88148ccc.js';
8
8
  import DivaUtils, { DivaError } from '@crystaldesign/diva-utils';
9
9
  import '@babel/runtime/helpers/slicedToArray';
10
10
  import '@babel/runtime/helpers/objectWithoutProperties';
11
11
  import 'axios';
12
12
  import '@babel/runtime/helpers/typeof';
13
13
  import '@babel/runtime/helpers/toArray';
14
- import '@crystaldesign/planner-2d-core';
14
+ import '@crystaldesign/planner-core';
15
15
  import '@crystaldesign/basket-model';
16
16
  import 'fast-xml-parser';
17
17
  import '@babel/runtime/helpers/possibleConstructorReturn';
@@ -28,6 +28,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
28
28
  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; }
29
29
  var LOG = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
30
30
 
31
+ /** The accessoire really went into the cell - not a rejected fit, whose article is deleted again. */
32
+ function isPlaced(result) {
33
+ return result !== false && result.index !== undefined && !!result.accessoire && result.type !== 'doesNotFit' && !result.type.startsWith('notAllowed');
34
+ }
35
+
31
36
  /** Values the parents pass on to their accessoires with their global options, per basketId of the accessoire. */
32
37
  var ShelfPlanner = /*#__PURE__*/function () {
33
38
  function ShelfPlanner(data, article) {
@@ -70,8 +75,12 @@ var ShelfPlanner = /*#__PURE__*/function () {
70
75
  _defineProperty(this, "shelfDebugSeq", 0);
71
76
  //accessoires of grids that were cleared by a grid rule, per gridIndex and the HeightGridCellCountOnRule entry the grid
72
77
  //ran as. They get placed again when the grid becomes active again under the same entry - eg a shelf that is configured
73
- //from 100cm to 50cm and back keeps its accessoires. A grid that comes back under another entry starts with that entry's initAcc
78
+ //from 100cm to 50cm and back keeps its accessoires. A grid that comes back under another entry starts with that entry's
79
+ //initAcc; with rtv-next it first takes what the change cleared (placeTransferredAccessoires)
74
80
  _defineProperty(this, "stashedAccessoires", {});
81
+ //a memory is outdated once something was edited by hand after it was taken (the init jump of a shelf edits nothing)
82
+ _defineProperty(this, "editEpoch", 0);
83
+ _defineProperty(this, "stashEpochs", {});
75
84
  this.article = article;
76
85
  this.restorePending = !!article.shelfPlanData;
77
86
  this.disableCellsByElement = data.DisableCells;
@@ -206,7 +215,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
206
215
  key: "onConfigChanged",
207
216
  value: (function () {
208
217
  var _onConfigChanged = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(variantValues) {
209
- var newHeightSet, gridsTodos, ruleIndexesBefore, i, _i, grid, _i2, _i3, _grid, grids, _i4, _grid2$DisableCellsBy, _grid2;
218
+ var newHeightSet, gridsTodos, ruleIndexesBefore, i, _i, grid, clearedNow, _i2, stashed, _i3, _grid, own, carryOver, grids, _i4, _grid2$DisableCellsBy, _grid2;
210
219
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
211
220
  while (1) switch (_context2.prev = _context2.next) {
212
221
  case 0:
@@ -248,39 +257,42 @@ var ShelfPlanner = /*#__PURE__*/function () {
248
257
  _context2.next = 5;
249
258
  break;
250
259
  case 14:
260
+ //what this change clears, per grid - carried over into a grid that comes back without an up-to-date memory of its own
261
+ clearedNow = new Map(); //first delete all disables grids then init all the new ones
251
262
  _i2 = 0;
252
- case 15:
263
+ case 16:
253
264
  if (!(_i2 < gridsTodos.length)) {
254
- _context2.next = 24;
265
+ _context2.next = 26;
255
266
  break;
256
267
  }
257
268
  if (gridsTodos[_i2].length) {
258
- _context2.next = 18;
269
+ _context2.next = 19;
259
270
  break;
260
271
  }
261
- return _context2.abrupt("continue", 21);
262
- case 18:
272
+ return _context2.abrupt("continue", 23);
273
+ case 19:
263
274
  //remember the accessoires before they get deleted, so they can be placed again when the grid becomes active again
264
- this.stashAccessoiresOfGrid(_i2, ruleIndexesBefore[_i2]);
265
- _context2.next = 21;
275
+ stashed = this.stashAccessoiresOfGrid(_i2, ruleIndexesBefore[_i2]);
276
+ if (!this.isOnlyInitContent(this.grids[_i2], stashed)) clearedNow.set(_i2, stashed);
277
+ _context2.next = 23;
266
278
  return this.grids[_i2].deleteAllAccOfGrid();
267
- case 21:
279
+ case 23:
268
280
  _i2++;
269
- _context2.next = 15;
281
+ _context2.next = 16;
270
282
  break;
271
- case 24:
283
+ case 26:
272
284
  _i3 = 0;
273
- case 25:
285
+ case 27:
274
286
  if (!(_i3 < gridsTodos.length)) {
275
- _context2.next = 41;
287
+ _context2.next = 65;
276
288
  break;
277
289
  }
278
290
  if (gridsTodos[_i3].length) {
279
- _context2.next = 28;
291
+ _context2.next = 30;
280
292
  break;
281
293
  }
282
- return _context2.abrupt("continue", 38);
283
- case 28:
294
+ return _context2.abrupt("continue", 62);
295
+ case 30:
284
296
  if (gridsTodos[_i3].includes('heightGridRule')) {
285
297
  this.creatNewGrid(_i3);
286
298
  newHeightSet = true;
@@ -288,58 +300,109 @@ var ShelfPlanner = /*#__PURE__*/function () {
288
300
  //read the grid after a possible recreate, the replaced one is not the grid that gets filled
289
301
  _grid = this.grids[_i3];
290
302
  if (!((gridsTodos[_i3].includes('heightGridRule') || gridsTodos[_i3].includes('disableGridRule')) && !_grid.DisabledByRule)) {
291
- _context2.next = 38;
303
+ _context2.next = 62;
292
304
  break;
293
305
  }
294
306
  if (!this.restorePending) {
295
- _context2.next = 33;
307
+ _context2.next = 35;
296
308
  break;
297
309
  }
298
- return _context2.abrupt("continue", 38);
299
- case 33:
300
- _context2.next = 35;
301
- return this.placeStashedAccessoiresOfGrid(_i3);
310
+ return _context2.abrupt("continue", 62);
302
311
  case 35:
303
- if (_context2.sent) {
304
- _context2.next = 38;
312
+ //the grid's own memory beats the initAcc while nothing was edited since, else another grid's newer content is carried over
313
+ own = this.takeStashOfGrid(_i3); //only rtv-next carries content over between grids, otherwise the memory is restored as is
314
+ carryOver = this.article.set.CatalogData.divaUseRtvNext;
315
+ _context2.t0 = own && (!own.outdated || !carryOver);
316
+ if (!_context2.t0) {
317
+ _context2.next = 42;
318
+ break;
319
+ }
320
+ _context2.next = 41;
321
+ return this.placeStashedAccessoiresInGrid(_i3, own.accessoires);
322
+ case 41:
323
+ _context2.t0 = _context2.sent;
324
+ case 42:
325
+ if (!_context2.t0) {
326
+ _context2.next = 45;
327
+ break;
328
+ }
329
+ clearedNow["delete"](_i3);
330
+ return _context2.abrupt("continue", 62);
331
+ case 45:
332
+ _context2.t1 = carryOver;
333
+ if (!_context2.t1) {
334
+ _context2.next = 50;
335
+ break;
336
+ }
337
+ _context2.next = 49;
338
+ return this.placeTransferredAccessoires(_i3, clearedNow);
339
+ case 49:
340
+ _context2.t1 = _context2.sent;
341
+ case 50:
342
+ if (!_context2.t1) {
343
+ _context2.next = 54;
305
344
  break;
306
345
  }
307
- _context2.next = 38;
346
+ _context2.next = 53;
308
347
  return this.initAccList(_i3);
309
- case 38:
348
+ case 53:
349
+ return _context2.abrupt("continue", 62);
350
+ case 54:
351
+ if (!(carryOver && own !== null && own !== void 0 && own.outdated)) {
352
+ _context2.next = 60;
353
+ break;
354
+ }
355
+ this.logShelfDebug({
356
+ phase: 'configChanged',
357
+ action: 'stashOutdatedRestored',
358
+ gridIndex: _i3,
359
+ detail: 'edited since, but nothing to carry over'
360
+ });
361
+ _context2.next = 58;
362
+ return this.placeStashedAccessoiresInGrid(_i3, own.accessoires);
363
+ case 58:
364
+ if (!_context2.sent) {
365
+ _context2.next = 60;
366
+ break;
367
+ }
368
+ return _context2.abrupt("continue", 62);
369
+ case 60:
370
+ _context2.next = 62;
371
+ return this.initAccList(_i3);
372
+ case 62:
310
373
  _i3++;
311
- _context2.next = 25;
374
+ _context2.next = 27;
312
375
  break;
313
- case 41:
376
+ case 65:
314
377
  if (!(!newHeightSet && Object.keys(variantValues).length)) {
315
- _context2.next = 52;
378
+ _context2.next = 76;
316
379
  break;
317
380
  }
318
381
  grids = this.activeGrids;
319
382
  _i4 = 0;
320
- case 44:
383
+ case 68:
321
384
  if (!(_i4 < grids.length)) {
322
- _context2.next = 52;
385
+ _context2.next = 76;
323
386
  break;
324
387
  }
325
388
  _grid2 = grids[_i4];
326
389
  if (!((_grid2$DisableCellsBy = _grid2.DisableCellsByMeasures) !== null && _grid2$DisableCellsBy !== void 0 && _grid2$DisableCellsBy.options.find(function (o) {
327
390
  return Object.keys(variantValues).includes('OPT' + o.opt);
328
391
  }) || !!_grid2.disableCellsByRules)) {
329
- _context2.next = 49;
392
+ _context2.next = 73;
330
393
  break;
331
394
  }
332
395
  newHeightSet = true;
333
- return _context2.abrupt("break", 52);
334
- case 49:
396
+ return _context2.abrupt("break", 76);
397
+ case 73:
335
398
  _i4++;
336
- _context2.next = 44;
399
+ _context2.next = 68;
337
400
  break;
338
- case 52:
401
+ case 76:
339
402
  if (newHeightSet) {
340
403
  this.updateDisabledCells();
341
404
  }
342
- case 53:
405
+ case 77:
343
406
  case "end":
344
407
  return _context2.stop();
345
408
  }
@@ -367,8 +430,145 @@ var ShelfPlanner = /*#__PURE__*/function () {
367
430
  key: "stashAccessoiresOfGrid",
368
431
  value: function stashAccessoiresOfGrid(gridIndex, ruleIndex) {
369
432
  var stashedAccessoires = this.collectAccessoiresToStash(this.grids[gridIndex], this.valuesPassedOnByParents());
370
- if (!stashedAccessoires.length) return;
371
- this.stashedAccessoires[this.stashKey(gridIndex, ruleIndex)] = stashedAccessoires;
433
+ if (!stashedAccessoires.length) return stashedAccessoires;
434
+ var stashKey = this.stashKey(gridIndex, ruleIndex);
435
+ this.stashedAccessoires[stashKey] = stashedAccessoires;
436
+ this.stashEpochs[stashKey] = this.editEpoch;
437
+ return stashedAccessoires;
438
+ }
439
+
440
+ /** A hand edit of this shelf or of an accessoire inside it (add, delete, move) - outdates the memories taken before. */
441
+ }, {
442
+ key: "noteUserEdit",
443
+ value: function noteUserEdit() {
444
+ var _this$article$accesso;
445
+ this.editEpoch++;
446
+ (_this$article$accesso = this.article.accessoireParentArticle) === null || _this$article$accesso === void 0 || (_this$article$accesso = _this$article$accesso.shelfPlanner) === null || _this$article$accesso === void 0 || _this$article$accesso.noteUserEdit();
447
+ }
448
+
449
+ /** The hand edit noted last changed nothing (eg the drop did not fit) - the memories taken before it stay up to date. */
450
+ }, {
451
+ key: "withdrawUserEdit",
452
+ value: function withdrawUserEdit() {
453
+ var _this$article$accesso2;
454
+ this.editEpoch--;
455
+ (_this$article$accesso2 = this.article.accessoireParentArticle) === null || _this$article$accesso2 === void 0 || (_this$article$accesso2 = _this$article$accesso2.shelfPlanner) === null || _this$article$accesso2 === void 0 || _this$article$accesso2.withdrawUserEdit();
456
+ }
457
+
458
+ /**
459
+ * True when a grid held nothing but its own initAcc - eg the Kleiderstange of a shelf that only passes through another
460
+ * width while it initializes. Such content is not carried over, the other grid starts with its own initAcc.
461
+ */
462
+ }, {
463
+ key: "isOnlyInitContent",
464
+ value: function isOnlyInitContent(grid, stashed) {
465
+ return stashed.every(function (acc) {
466
+ var _grid$InitAccArr;
467
+ return (_grid$InitAccArr = grid.InitAccArr) === null || _grid$InitAccArr === void 0 ? void 0 : _grid$InitAccArr.some(function (init) {
468
+ return init.Codex === acc.articleCodex && init.initRH.includes(acc.cellIndex);
469
+ });
470
+ });
471
+ }
472
+
473
+ /**
474
+ * Fallback for a grid without an up-to-date memory of its own: places what this change cleared from it, else from a grid
475
+ * the change switched off, mapped by family (eg the 50cm tablar comes back as the 100cm one). The cleared grid keeps its
476
+ * own memory.
477
+ * @param cleared what this change cleared, per grid - a placed source is taken out
478
+ * @returns how many were placed
479
+ */
480
+ }, {
481
+ key: "placeTransferredAccessoires",
482
+ value: (function () {
483
+ var _placeTransferredAccessoires = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(gridIndex, cleared) {
484
+ var _this = this;
485
+ var sources, _iterator, _step, source, accessoires, placed;
486
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
487
+ while (1) switch (_context3.prev = _context3.next) {
488
+ case 0:
489
+ //a grid that stays active keeps its content for itself
490
+ sources = [gridIndex].concat(_toConsumableArray(_toConsumableArray(cleared.keys()).filter(function (source) {
491
+ return source !== gridIndex && _this.grids[source].DisabledByRule;
492
+ })));
493
+ _iterator = _createForOfIteratorHelper(sources);
494
+ _context3.prev = 2;
495
+ _iterator.s();
496
+ case 4:
497
+ if ((_step = _iterator.n()).done) {
498
+ _context3.next = 18;
499
+ break;
500
+ }
501
+ source = _step.value;
502
+ accessoires = cleared.get(source);
503
+ if (accessoires) {
504
+ _context3.next = 9;
505
+ break;
506
+ }
507
+ return _context3.abrupt("continue", 16);
508
+ case 9:
509
+ _context3.next = 11;
510
+ return this.placeStashedAccessoiresInGrid(gridIndex, accessoires, true);
511
+ case 11:
512
+ placed = _context3.sent;
513
+ if (placed) {
514
+ _context3.next = 14;
515
+ break;
516
+ }
517
+ return _context3.abrupt("continue", 16);
518
+ case 14:
519
+ cleared["delete"](source);
520
+ return _context3.abrupt("return", placed);
521
+ case 16:
522
+ _context3.next = 4;
523
+ break;
524
+ case 18:
525
+ _context3.next = 23;
526
+ break;
527
+ case 20:
528
+ _context3.prev = 20;
529
+ _context3.t0 = _context3["catch"](2);
530
+ _iterator.e(_context3.t0);
531
+ case 23:
532
+ _context3.prev = 23;
533
+ _iterator.f();
534
+ return _context3.finish(23);
535
+ case 26:
536
+ return _context3.abrupt("return", 0);
537
+ case 27:
538
+ case "end":
539
+ return _context3.stop();
540
+ }
541
+ }, _callee3, this, [[2, 20, 23, 26]]);
542
+ }));
543
+ function placeTransferredAccessoires(_x3, _x4) {
544
+ return _placeTransferredAccessoires.apply(this, arguments);
545
+ }
546
+ return placeTransferredAccessoires;
547
+ }() /** How many accessoires of `articleCodex` or of its family the grid holds, each counted in the cell it starts in. */)
548
+ }, {
549
+ key: "countPlacedOfFamily",
550
+ value: function countPlacedOfFamily(grid, articleCodex) {
551
+ var codexes = [articleCodex].concat(_toConsumableArray(familyMembersOf(articleCodex, this.article.CatalogData.allCatalogArticles)));
552
+ var startsHere = function startsHere(cell) {
553
+ return cell.InUse === cell.Index && !cell.OnlyPlaceHolder;
554
+ };
555
+ return grid.Cells.filter(function (cell) {
556
+ var _cell$Article$article, _cell$Article;
557
+ return startsHere(cell) && codexes.includes((_cell$Article$article = (_cell$Article = cell.Article) === null || _cell$Article === void 0 ? void 0 : _cell$Article.articleCodex) !== null && _cell$Article$article !== void 0 ? _cell$Article$article : '');
558
+ }).length;
559
+ }
560
+
561
+ /** The article itself when the grid allows it, else the members of its family the grid allows. */
562
+ }, {
563
+ key: "familyCandidates",
564
+ value: function familyCandidates(grid, articleCodex) {
565
+ var allowed = grid.getAllArticleRelations();
566
+ var family = familyMembersOf(articleCodex, this.article.CatalogData.allCatalogArticles).filter(function (codex) {
567
+ return codex !== articleCodex;
568
+ });
569
+ return [articleCodex].concat(_toConsumableArray(family)).filter(function (codex) {
570
+ return allowed.includes(codex);
571
+ });
372
572
  }
373
573
 
374
574
  /** The memory is per grid and per HeightGridCellCountOnRule entry, false when the grid runs without a matching entry. */
@@ -389,25 +589,13 @@ var ShelfPlanner = /*#__PURE__*/function () {
389
589
  var stashedAccessoires = [];
390
590
  var inheritedValues = ShelfPlanner.addValuesPassedOnBy(this.article, parentInheritedValues);
391
591
  for (var i = 0; i < grid.Cells.length; i++) {
392
- var _inheritedValues$acce;
592
+ var _accessoire$shelfPlan, _accessoire$shelfPlan2, _inheritedValues$acce;
393
593
  var cell = grid.Cells[i];
394
594
  var accessoire = cell.Article;
395
595
  if (cell.InUse !== i || !accessoire) continue;
396
596
 
397
597
  //the accessoire can be a shelf itself (eg an EINBAU), its own accessoires are grouped by its own grids
398
- var accessoires = {};
399
- var accessoireShelfPlanner = accessoire.shelfPlanner;
400
- for (var j = 0; j < ((_accessoireShelfPlann = accessoireShelfPlanner === null || accessoireShelfPlanner === void 0 ? void 0 : accessoireShelfPlanner.grids.length) !== null && _accessoireShelfPlann !== void 0 ? _accessoireShelfPlann : 0); j++) {
401
- var _accessoireShelfPlann;
402
- var accessoireGrid = accessoireShelfPlanner.grids[j];
403
- var accessoiresOfGrid = accessoireShelfPlanner.collectAccessoiresToStash(accessoireGrid, inheritedValues);
404
- if (accessoiresOfGrid.length) {
405
- accessoires[accessoireGrid.ShelfIndex] = {
406
- ruleIndex: accessoireGrid.CurrentLoadedRuleIndex,
407
- accessoires: accessoiresOfGrid
408
- };
409
- }
410
- }
598
+ var accessoires = (_accessoire$shelfPlan = (_accessoire$shelfPlan2 = accessoire.shelfPlanner) === null || _accessoire$shelfPlan2 === void 0 ? void 0 : _accessoire$shelfPlan2.collectOwnAccessoiresToStash(inheritedValues)) !== null && _accessoire$shelfPlan !== void 0 ? _accessoire$shelfPlan : {};
411
599
 
412
600
  //a value the accessoire only took over from the parent is not remembered: placed again, the accessoire takes over the
413
601
  //parent's value of that time, the parent may have changed it in between
@@ -453,134 +641,210 @@ var ShelfPlanner = /*#__PURE__*/function () {
453
641
  * @returns the values passed on per basketId, a new object
454
642
  */
455
643
  }, {
456
- key: "placeStashedAccessoiresOfGrid",
457
- value: (
644
+ key: "collectOwnAccessoiresToStash",
645
+ value: /** The accessoires of all grids of this shelfplanner, grouped by grid - eg the drawers of an EINBAU that gets replaced. */
646
+ function collectOwnAccessoiresToStash() {
647
+ var parentInheritedValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.valuesPassedOnByParents();
648
+ var accessoires = {};
649
+ for (var j = 0; j < this.grids.length; j++) {
650
+ var grid = this.grids[j];
651
+ var accessoiresOfGrid = this.collectAccessoiresToStash(grid, parentInheritedValues);
652
+ if (accessoiresOfGrid.length) accessoires[grid.ShelfIndex] = {
653
+ ruleIndex: grid.CurrentLoadedRuleIndex,
654
+ accessoires: accessoiresOfGrid
655
+ };
656
+ }
657
+ return accessoires;
658
+ }
659
+
458
660
  /**
459
- * Places the accessoires remembered for the rule entry the grid runs now back into their cells.
661
+ * Takes the accessoires remembered for the rule entry the grid runs now out of the memory.
460
662
  * @param gridIndex grid that became active again
461
- * @returns how many accessoires were placed - 0 means the grid is still empty and needs its initAcc
663
+ * @returns the remembered accessoires and whether something was edited by hand since they were taken
664
+ */
665
+ }, {
666
+ key: "takeStashOfGrid",
667
+ value: function takeStashOfGrid(gridIndex) {
668
+ //a recreated grid already runs its new rule entry, only accessoires planned under that entry belong into it
669
+ var stashKey = this.stashKey(gridIndex, this.grids[gridIndex].CurrentLoadedRuleIndex);
670
+ var accessoires = this.stashedAccessoires[stashKey];
671
+ var outdated = this.stashEpochs[stashKey] !== this.editEpoch;
672
+ //remove it first, a reconfiguration triggered by placing them must not place them a second time
673
+ delete this.stashedAccessoires[stashKey];
674
+ delete this.stashEpochs[stashKey];
675
+ return accessoires !== null && accessoires !== void 0 && accessoires.length ? {
676
+ accessoires: accessoires,
677
+ outdated: outdated
678
+ } : undefined;
679
+ }
680
+
681
+ /**
682
+ * Places stashed accessoires that are grouped by gridIndex - used for the accessoires of an accessoire.
683
+ * @param mapByFamily the accessoire was replaced by another member of its family: its grids run their own rule entry, and
684
+ * every accessoire is placed as itself or as the family member the grid allows
462
685
  */
463
- function () {
464
- var _placeStashedAccessoiresOfGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(gridIndex) {
465
- var stashKey, stashedAccessoires;
466
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
467
- while (1) switch (_context3.prev = _context3.next) {
468
- case 0:
469
- //a recreated grid already runs its new rule entry, only accessoires planned under that entry belong into it
470
- stashKey = this.stashKey(gridIndex, this.grids[gridIndex].CurrentLoadedRuleIndex);
471
- stashedAccessoires = this.stashedAccessoires[stashKey];
472
- if (stashedAccessoires !== null && stashedAccessoires !== void 0 && stashedAccessoires.length) {
473
- _context3.next = 4;
474
- break;
475
- }
476
- return _context3.abrupt("return", 0);
477
- case 4:
478
- //remove it first, a reconfiguration triggered by placing them must not place them a second time
479
- delete this.stashedAccessoires[stashKey];
480
- _context3.next = 7;
481
- return this.placeStashedAccessoiresInGrid(gridIndex, stashedAccessoires);
482
- case 7:
483
- return _context3.abrupt("return", _context3.sent);
484
- case 8:
485
- case "end":
486
- return _context3.stop();
487
- }
488
- }, _callee3, this);
489
- }));
490
- function placeStashedAccessoiresOfGrid(_x3) {
491
- return _placeStashedAccessoiresOfGrid.apply(this, arguments);
492
- }
493
- return placeStashedAccessoiresOfGrid;
494
- }() /** Places stashed accessoires that are grouped by gridIndex - used for the accessoires of an accessoire. */)
495
686
  }, {
496
687
  key: "placeStashedAccessoiresByGrid",
497
688
  value: (function () {
498
689
  var _placeStashedAccessoiresByGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(stashedAccessoires) {
499
- var gridIndexes, i, gridIndex, grid, stashed;
690
+ var mapByFamily,
691
+ gridIndexes,
692
+ i,
693
+ gridIndex,
694
+ grid,
695
+ stashed,
696
+ _args4 = arguments;
500
697
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
501
698
  while (1) switch (_context4.prev = _context4.next) {
502
699
  case 0:
700
+ mapByFamily = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : false;
503
701
  gridIndexes = Object.keys(stashedAccessoires);
504
702
  i = 0;
505
- case 2:
703
+ case 3:
506
704
  if (!(i < gridIndexes.length)) {
507
- _context4.next = 18;
705
+ _context4.next = 19;
508
706
  break;
509
707
  }
510
708
  gridIndex = Number(gridIndexes[i]);
511
709
  grid = this.getGridByIndex(gridIndex);
512
710
  stashed = stashedAccessoires[gridIndex]; //the accessoire was created new, its grids run their own rule entry with that entry's initAcc in place. A grid that
513
711
  //runs another entry than the remembered accessoires were planned under keeps them
514
- if (!(!grid || grid.CurrentLoadedRuleIndex !== stashed.ruleIndex)) {
515
- _context4.next = 8;
712
+ if (!(!grid || !mapByFamily && grid.CurrentLoadedRuleIndex !== stashed.ruleIndex)) {
713
+ _context4.next = 9;
516
714
  break;
517
715
  }
518
- return _context4.abrupt("continue", 15);
519
- case 8:
520
- _context4.next = 10;
716
+ return _context4.abrupt("continue", 16);
717
+ case 9:
718
+ _context4.next = 11;
521
719
  return grid.deleteAllAccOfGrid();
522
- case 10:
523
- _context4.next = 12;
524
- return this.placeStashedAccessoiresInGrid(gridIndex, stashed.accessoires);
525
- case 12:
720
+ case 11:
721
+ _context4.next = 13;
722
+ return this.placeStashedAccessoiresInGrid(gridIndex, stashed.accessoires, mapByFamily);
723
+ case 13:
526
724
  if (_context4.sent) {
527
- _context4.next = 15;
725
+ _context4.next = 16;
528
726
  break;
529
727
  }
530
- _context4.next = 15;
728
+ _context4.next = 16;
531
729
  return this.initAccList(gridIndex);
532
- case 15:
730
+ case 16:
533
731
  i++;
534
- _context4.next = 2;
732
+ _context4.next = 3;
535
733
  break;
536
- case 18:
734
+ case 19:
537
735
  case "end":
538
736
  return _context4.stop();
539
737
  }
540
738
  }, _callee4, this);
541
739
  }));
542
- function placeStashedAccessoiresByGrid(_x4) {
740
+ function placeStashedAccessoiresByGrid(_x5) {
543
741
  return _placeStashedAccessoiresByGrid.apply(this, arguments);
544
742
  }
545
743
  return placeStashedAccessoiresByGrid;
546
- }() /** @returns how many of the stashed accessoires were placed */)
744
+ }()
745
+ /**
746
+ * @param mapByFamily an accessoire the grid does not allow is placed as the member of its family the grid allows
747
+ * @returns how many of the stashed accessoires were placed
748
+ */
749
+ )
547
750
  }, {
548
751
  key: "placeStashedAccessoiresInGrid",
549
752
  value: (function () {
550
753
  var _placeStashedAccessoiresInGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(gridIndex, stashedAccessoires) {
551
- var placedAccessoires, grid, i, stashed, result, fitResult, accessoire, variantValues;
754
+ var mapByFamily,
755
+ placedAccessoires,
756
+ grid,
757
+ i,
758
+ stashed,
759
+ result,
760
+ _iterator2,
761
+ _step2,
762
+ articleCodex,
763
+ fitResult,
764
+ accessoire,
765
+ replaced,
766
+ variantValues,
767
+ _args5 = arguments;
552
768
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
553
769
  while (1) switch (_context5.prev = _context5.next) {
554
770
  case 0:
771
+ mapByFamily = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : false;
555
772
  placedAccessoires = 0;
556
773
  grid = this.getGridByIndex(gridIndex);
557
774
  if (grid) {
558
- _context5.next = 4;
775
+ _context5.next = 5;
559
776
  break;
560
777
  }
561
778
  return _context5.abrupt("return", placedAccessoires);
562
- case 4:
563
- i = 0;
564
779
  case 5:
780
+ i = 0;
781
+ case 6:
565
782
  if (!(i < stashedAccessoires.length)) {
566
- _context5.next = 29;
783
+ _context5.next = 53;
567
784
  break;
568
785
  }
569
786
  stashed = stashedAccessoires[i];
570
- grid.ActAccessoire = stashed.articleCodex;
571
- _context5.next = 10;
787
+ result = false;
788
+ _iterator2 = _createForOfIteratorHelper(mapByFamily ? this.familyCandidates(grid, stashed.articleCodex) : [stashed.articleCodex]);
789
+ _context5.prev = 10;
790
+ _iterator2.s();
791
+ case 12:
792
+ if ((_step2 = _iterator2.n()).done) {
793
+ _context5.next = 23;
794
+ break;
795
+ }
796
+ articleCodex = _step2.value;
797
+ grid.ActAccessoire = articleCodex;
798
+ _context5.next = 17;
572
799
  return setHandlerInstance.addAccessorieOnShelfPlanner(this.article.set, gridIndex, stashed.cellIndex, this.article.basketId, {
573
800
  noMove: stashed.noMove,
574
801
  noDelete: stashed.noDelete,
575
- byInit: true
802
+ byInit: true,
803
+ onlyOfferedCells: mapByFamily
576
804
  });
577
- case 10:
805
+ case 17:
578
806
  result = _context5.sent;
579
807
  grid.ActAccessoire = undefined;
580
- fitResult = result === false || result.index === undefined ? undefined : result;
808
+ if (!isPlaced(result)) {
809
+ _context5.next = 21;
810
+ break;
811
+ }
812
+ return _context5.abrupt("break", 23);
813
+ case 21:
814
+ _context5.next = 12;
815
+ break;
816
+ case 23:
817
+ _context5.next = 28;
818
+ break;
819
+ case 25:
820
+ _context5.prev = 25;
821
+ _context5.t0 = _context5["catch"](10);
822
+ _iterator2.e(_context5.t0);
823
+ case 28:
824
+ _context5.prev = 28;
825
+ _iterator2.f();
826
+ return _context5.finish(28);
827
+ case 31:
828
+ //a failed fit still returns its result, with the temporary article already deleted
829
+ fitResult = mapByFamily ? isPlaced(result) ? result : undefined : result === false || result.index === undefined ? undefined : result;
581
830
  accessoire = fitResult === null || fitResult === void 0 ? void 0 : fitResult.accessoire;
831
+ if (!(mapByFamily && (!fitResult || !accessoire))) {
832
+ _context5.next = 36;
833
+ break;
834
+ }
835
+ //carrying over is a best effort - what has no fitting family member in this grid is left out
836
+ this.logShelfDebug({
837
+ phase: 'configChanged',
838
+ action: 'accessoryNotTransferred',
839
+ gridIndex: gridIndex,
840
+ cellIndex: stashed.cellIndex,
841
+ articleCodex: stashed.articleCodex,
842
+ detail: 'no member of its family fits into this grid'
843
+ });
844
+ return _context5.abrupt("continue", 50);
845
+ case 36:
582
846
  if (!(!fitResult || !accessoire)) {
583
- _context5.next = 17;
847
+ _context5.next = 39;
584
848
  break;
585
849
  }
586
850
  LOG.error(new DivaError('shelfaccessoire of a switched off grid does not fit anymore and gets dropped', {
@@ -594,37 +858,46 @@ var ShelfPlanner = /*#__PURE__*/function () {
594
858
  parentBasketId: this.article.basketId
595
859
  }
596
860
  }));
597
- return _context5.abrupt("continue", 26);
598
- case 17:
861
+ return _context5.abrupt("continue", 50);
862
+ case 39:
599
863
  accessoire.quantity = stashed.quantity;
600
864
  placedAccessoires++;
865
+ replaced = accessoire.articleCodex !== stashed.articleCodex;
866
+ if (mapByFamily) this.logShelfDebug({
867
+ phase: 'configChanged',
868
+ action: 'accessoryTransferred',
869
+ gridIndex: gridIndex,
870
+ cellIndex: stashed.cellIndex,
871
+ articleCodex: accessoire.articleCodex,
872
+ detail: replaced ? "as family member of ".concat(stashed.articleCodex) : 'same article'
873
+ });
601
874
  variantValues = this.valuesToPlaceAgain(stashed, accessoire);
602
875
  if (!Object.keys(variantValues).length) {
603
- _context5.next = 23;
876
+ _context5.next = 47;
604
877
  break;
605
878
  }
606
- _context5.next = 23;
879
+ _context5.next = 47;
607
880
  return articleHandlerInstance.updateCfgValues(accessoire, variantValues, {});
608
- case 23:
881
+ case 47:
609
882
  if (!accessoire.shelfPlanner) {
610
- _context5.next = 26;
883
+ _context5.next = 50;
611
884
  break;
612
885
  }
613
- _context5.next = 26;
614
- return accessoire.shelfPlanner.placeStashedAccessoiresByGrid(stashed.accessoires);
615
- case 26:
886
+ _context5.next = 50;
887
+ return accessoire.shelfPlanner.placeStashedAccessoiresByGrid(stashed.accessoires, mapByFamily || replaced);
888
+ case 50:
616
889
  i++;
617
- _context5.next = 5;
890
+ _context5.next = 6;
618
891
  break;
619
- case 29:
892
+ case 53:
620
893
  return _context5.abrupt("return", placedAccessoires);
621
- case 30:
894
+ case 54:
622
895
  case "end":
623
896
  return _context5.stop();
624
897
  }
625
- }, _callee5, this);
898
+ }, _callee5, this, [[10, 25, 28, 31]]);
626
899
  }));
627
- function placeStashedAccessoiresInGrid(_x5, _x6) {
900
+ function placeStashedAccessoiresInGrid(_x6, _x7) {
628
901
  return _placeStashedAccessoiresInGrid.apply(this, arguments);
629
902
  }
630
903
  return placeStashedAccessoiresInGrid;
@@ -646,17 +919,17 @@ var ShelfPlanner = /*#__PURE__*/function () {
646
919
  });
647
920
  if (!ownInheritableCodices.length) return variantValues;
648
921
  var inheritedNow = (_ShelfPlanner$addValu = ShelfPlanner.addValuesPassedOnBy(this.article, this.valuesPassedOnByParents())[accessoire.basketId]) !== null && _ShelfPlanner$addValu !== void 0 ? _ShelfPlanner$addValu : {};
649
- var _iterator = _createForOfIteratorHelper(ownInheritableCodices),
650
- _step;
922
+ var _iterator3 = _createForOfIteratorHelper(ownInheritableCodices),
923
+ _step3;
651
924
  try {
652
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
653
- var codex = _step.value;
925
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
926
+ var codex = _step3.value;
654
927
  if (inheritedNow[codex] !== undefined && inheritedNow[codex] !== stashed.inheritedValues[codex]) delete variantValues[codex];
655
928
  }
656
929
  } catch (err) {
657
- _iterator.e(err);
930
+ _iterator3.e(err);
658
931
  } finally {
659
- _iterator.f();
932
+ _iterator3.f();
660
933
  }
661
934
  return variantValues;
662
935
  }
@@ -669,7 +942,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
669
942
  key: "initAccList",
670
943
  value: (function () {
671
944
  var _initAccList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(gridIndex) {
672
- var grids, i, grid, j, initAcc, k, _this$article$accesso, shelfId, accessoires, _accessoireToDelete$s, accessoireToDelete, rh;
945
+ var grids, i, grid, heldByFamily, j, _this$article$Catalog, _this$article$Catalog2, _heldByFamily$get, initAcc, family, held, placed, k, parentIsReal, _this$article$accesso3, shelfId, accessoires, _accessoireToDelete$s, accessoireToDelete, rh;
673
946
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
674
947
  while (1) switch (_context6.prev = _context6.next) {
675
948
  case 0:
@@ -677,7 +950,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
677
950
  i = 0;
678
951
  case 2:
679
952
  if (!(i < grids.length)) {
680
- _context6.next = 37;
953
+ _context6.next = 43;
681
954
  break;
682
955
  }
683
956
  grid = grids[i];
@@ -685,25 +958,31 @@ var ShelfPlanner = /*#__PURE__*/function () {
685
958
  _context6.next = 6;
686
959
  break;
687
960
  }
688
- return _context6.abrupt("continue", 34);
961
+ return _context6.abrupt("continue", 40);
689
962
  case 6:
690
963
  if (grid.InitAccArr) {
691
964
  _context6.next = 8;
692
965
  break;
693
966
  }
694
- return _context6.abrupt("continue", 34);
967
+ return _context6.abrupt("continue", 40);
695
968
  case 8:
969
+ //only tops up: what the grid held of a family before (eg a carried over Kleiderstange in another cell) counts once
970
+ heldByFamily = new Map();
696
971
  j = 0;
697
- case 9:
972
+ case 10:
698
973
  if (!(j < grid.InitAccArr.length)) {
699
- _context6.next = 34;
974
+ _context6.next = 40;
700
975
  break;
701
976
  }
702
977
  initAcc = grid.InitAccArr[j];
703
- k = 0;
704
- case 12:
978
+ family = (_this$article$Catalog = (_this$article$Catalog2 = this.article.CatalogData.allCatalogArticles[initAcc.Codex]) === null || _this$article$Catalog2 === void 0 ? void 0 : _this$article$Catalog2.accessoireFamily) !== null && _this$article$Catalog !== void 0 ? _this$article$Catalog : initAcc.Codex;
979
+ held = (_heldByFamily$get = heldByFamily.get(family)) !== null && _heldByFamily$get !== void 0 ? _heldByFamily$get : this.countPlacedOfFamily(grid, initAcc.Codex);
980
+ placed = Math.min(held, initAcc.initRH.length);
981
+ heldByFamily.set(family, held - placed);
982
+ k = placed;
983
+ case 17:
705
984
  if (!(k < initAcc.initRH.length)) {
706
- _context6.next = 31;
985
+ _context6.next = 37;
707
986
  break;
708
987
  }
709
988
  grid.ActAccessoire = initAcc.Codex;
@@ -715,56 +994,58 @@ var ShelfPlanner = /*#__PURE__*/function () {
715
994
  articleCodex: initAcc.Codex,
716
995
  detail: 'from InitAccArr — a missing matching accessoryPlaced entry right after means the init placement failed'
717
996
  });
718
- _context6.next = 17;
997
+ _context6.next = 22;
719
998
  return setHandlerInstance.addAccessorieOnShelfPlanner(this.article.set, grid.ShelfIndex, initAcc.initRH[k], grid.basketId, {
720
999
  noMove: initAcc.noMove,
721
1000
  noDelete: initAcc.noDelete,
722
1001
  byInit: true
723
1002
  });
724
- case 17:
725
- if (!initAcc.replaceFromParent) {
726
- _context6.next = 27;
1003
+ case 22:
1004
+ //UseCase Atlantis Kleiderstange gets deleted on parent - not by a dry run, its parent is the real shelf it previews in
1005
+ parentIsReal = !setHandlerInstance.isDryRunArticle(this.article.accessoireParentArticle);
1006
+ if (!(initAcc.replaceFromParent && !(setHandlerInstance.isDryRunArticle(this.article) && parentIsReal))) {
1007
+ _context6.next = 33;
727
1008
  break;
728
1009
  }
729
1010
  shelfId = this.getShelfParentShelfId();
730
- if (!(shelfId && (_this$article$accesso = this.article.accessoireParentArticle) !== null && _this$article$accesso !== void 0 && _this$article$accesso.shelfPlanner)) {
731
- _context6.next = 27;
1011
+ if (!(shelfId && (_this$article$accesso3 = this.article.accessoireParentArticle) !== null && _this$article$accesso3 !== void 0 && _this$article$accesso3.shelfPlanner)) {
1012
+ _context6.next = 33;
732
1013
  break;
733
1014
  }
734
1015
  accessoires = this.article.accessoireParentArticle.shelfPlanner.getAccessorireByCodex(shelfId, initAcc.Codex);
735
1016
  if (!(accessoires && accessoires.length > 0)) {
736
- _context6.next = 27;
1017
+ _context6.next = 33;
737
1018
  break;
738
1019
  }
739
1020
  accessoireToDelete = accessoires[0];
740
1021
  rh = (_accessoireToDelete$s = accessoireToDelete.shelfPlanner) === null || _accessoireToDelete$s === void 0 ? void 0 : _accessoireToDelete$s.getRHOnParentArticle();
741
1022
  if (!(rh !== undefined && accessoireToDelete.relatedToShelfGrid !== undefined)) {
742
- _context6.next = 27;
1023
+ _context6.next = 33;
743
1024
  break;
744
1025
  }
745
- _context6.next = 27;
1026
+ _context6.next = 33;
746
1027
  return setHandlerInstance.deleteAccessorieOnShelfPlanner(this.article.set, accessoireToDelete.relatedToShelfGrid, rh, this.article.accessoireParentArticle.basketId);
747
- case 27:
1028
+ case 33:
748
1029
  grid.ActAccessoire = undefined;
749
- case 28:
1030
+ case 34:
750
1031
  k++;
751
- _context6.next = 12;
1032
+ _context6.next = 17;
752
1033
  break;
753
- case 31:
1034
+ case 37:
754
1035
  j++;
755
- _context6.next = 9;
1036
+ _context6.next = 10;
756
1037
  break;
757
- case 34:
1038
+ case 40:
758
1039
  i++;
759
1040
  _context6.next = 2;
760
1041
  break;
761
- case 37:
1042
+ case 43:
762
1043
  case "end":
763
1044
  return _context6.stop();
764
1045
  }
765
1046
  }, _callee6, this);
766
1047
  }));
767
- function initAccList(_x7) {
1048
+ function initAccList(_x8) {
768
1049
  return _initAccList.apply(this, arguments);
769
1050
  }
770
1051
  return initAccList;
@@ -854,7 +1135,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
854
1135
  }
855
1136
  }, _callee7, this);
856
1137
  }));
857
- function triggerVisibility(_x8) {
1138
+ function triggerVisibility(_x9) {
858
1139
  return _triggerVisibility.apply(this, arguments);
859
1140
  }
860
1141
  return triggerVisibility;
@@ -941,6 +1222,21 @@ var ShelfPlanner = /*#__PURE__*/function () {
941
1222
  }
942
1223
  }
943
1224
 
1225
+ /**
1226
+ * `tryFitOnShelfOfGrid` limited to the cells `getFreeSpacesOfAccessoire` offers (an active grid, room above and below,
1227
+ * neighbour and montage rules) - for a placement nobody picked by hand: a carry-over or a family swap.
1228
+ */
1229
+ }, {
1230
+ key: "tryFitOnOfferedCellOfGrid",
1231
+ value: function tryFitOnOfferedCellOfGrid(gridIndex, cellIndex, accessoire) {
1232
+ var fit = this.tryFitOnShelfOfGrid(gridIndex, cellIndex, accessoire);
1233
+ if (fit === false || fit.index === undefined || fit.type === 'doesNotFit' || fit.type.startsWith('notAllowed')) return fit;
1234
+ return this.grids[gridIndex].getFreeSpacesOfAccessoire(accessoire).includes(fit.index) ? fit : {
1235
+ type: 'doesNotFit',
1236
+ size: fit.size
1237
+ };
1238
+ }
1239
+
944
1240
  /**
945
1241
  *
946
1242
  * @param gridName
@@ -1033,7 +1329,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
1033
1329
  }
1034
1330
  }, _callee9, this);
1035
1331
  }));
1036
- function deleteAccessoireOfCellInGrid(_x9, _x10) {
1332
+ function deleteAccessoireOfCellInGrid(_x10, _x11) {
1037
1333
  return _deleteAccessoireOfCellInGrid.apply(this, arguments);
1038
1334
  }
1039
1335
  return deleteAccessoireOfCellInGrid;
@@ -1069,7 +1365,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
1069
1365
  key: "handleDeleteTakePlaceOnOtherGrids",
1070
1366
  value: (function () {
1071
1367
  var _handleDeleteTakePlaceOnOtherGrids = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(gridIndex, cellIndex, accessoire) {
1072
- var i, _cell$Article, cell, _i7, _cell$Article2, _cell, _i8;
1368
+ var i, _cell$Article2, cell, _i7, _cell$Article3, _cell, _i8;
1073
1369
  return _regeneratorRuntime.wrap(function _callee10$(_context10) {
1074
1370
  while (1) switch (_context10.prev = _context10.next) {
1075
1371
  case 0:
@@ -1082,7 +1378,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
1082
1378
  if (accessoire.shelfHeightAbove) {
1083
1379
  for (i = 0; i < accessoire.shelfHeightAbove; i++) {
1084
1380
  cell = this.grids[gridIndex].Cells[cellIndex + accessoire.shelfHeight + i];
1085
- if ((cell === null || cell === void 0 || (_cell$Article = cell.Article) === null || _cell$Article === void 0 ? void 0 : _cell$Article.basketId) === accessoire.basketId) {
1381
+ if ((cell === null || cell === void 0 || (_cell$Article2 = cell.Article) === null || _cell$Article2 === void 0 ? void 0 : _cell$Article2.basketId) === accessoire.basketId) {
1086
1382
  cell.ClearInUse();
1087
1383
  }
1088
1384
  }
@@ -1090,7 +1386,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
1090
1386
  if (accessoire.shelfHeightBelow) {
1091
1387
  for (_i7 = 0; _i7 < accessoire.shelfHeightBelow; _i7++) {
1092
1388
  _cell = this.grids[gridIndex].Cells[cellIndex - (_i7 + 1)];
1093
- if ((_cell === null || _cell === void 0 || (_cell$Article2 = _cell.Article) === null || _cell$Article2 === void 0 ? void 0 : _cell$Article2.basketId) === accessoire.basketId) {
1389
+ if ((_cell === null || _cell === void 0 || (_cell$Article3 = _cell.Article) === null || _cell$Article3 === void 0 ? void 0 : _cell$Article3.basketId) === accessoire.basketId) {
1094
1390
  _cell.ClearInUse();
1095
1391
  }
1096
1392
  }
@@ -1123,7 +1419,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
1123
1419
  }
1124
1420
  }, _callee10, this);
1125
1421
  }));
1126
- function handleDeleteTakePlaceOnOtherGrids(_x11, _x12, _x13) {
1422
+ function handleDeleteTakePlaceOnOtherGrids(_x12, _x13, _x14) {
1127
1423
  return _handleDeleteTakePlaceOnOtherGrids.apply(this, arguments);
1128
1424
  }
1129
1425
  return handleDeleteTakePlaceOnOtherGrids;
@@ -1188,7 +1484,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
1188
1484
  }
1189
1485
  }, _callee11, this);
1190
1486
  }));
1191
- function addAccessoireInCellInGrid(_x14, _x15, _x16, _x17, _x18) {
1487
+ function addAccessoireInCellInGrid(_x15, _x16, _x17, _x18, _x19) {
1192
1488
  return _addAccessoireInCellInGrid.apply(this, arguments);
1193
1489
  }
1194
1490
  return addAccessoireInCellInGrid;
@@ -1294,10 +1590,10 @@ var ShelfPlanner = /*#__PURE__*/function () {
1294
1590
  });
1295
1591
  if (grid.ShelfIndex != i) cells[j].gridIndex = grid.ShelfIndex;
1296
1592
  if (cell.InUse == j) {
1297
- var _cell$Article3, _cell$Article4;
1593
+ var _cell$Article4, _cell$Article5;
1298
1594
  cells[j].usedArticleData = {
1299
- Codex: (_cell$Article3 = cell.Article) === null || _cell$Article3 === void 0 ? void 0 : _cell$Article3.articleCodex,
1300
- BasketID: (_cell$Article4 = cell.Article) === null || _cell$Article4 === void 0 ? void 0 : _cell$Article4.basketId
1595
+ Codex: (_cell$Article4 = cell.Article) === null || _cell$Article4 === void 0 ? void 0 : _cell$Article4.articleCodex,
1596
+ BasketID: (_cell$Article5 = cell.Article) === null || _cell$Article5 === void 0 ? void 0 : _cell$Article5.basketId
1301
1597
  };
1302
1598
  }
1303
1599
  }
@@ -1323,13 +1619,13 @@ var ShelfPlanner = /*#__PURE__*/function () {
1323
1619
  for (var j = 0; j < grid.Cells.length; j++) {
1324
1620
  var cell = grid.Cells[j];
1325
1621
  if (cell.InUse == j && cell.Article && cell.Article.model3DName && !cell.OnlyPlaceHolder) {
1326
- var _cell$Article5;
1622
+ var _cell$Article6;
1327
1623
  var cellIndex = cell.Index;
1328
1624
  if (grid.Direction == 'vertikal' && this.article.CatalogData.useShelfPlannerRTV != true) {
1329
1625
  cellIndex = grid.Cells.length - 1 - cell.Index;
1330
1626
  }
1331
1627
  accessoires.push({
1332
- basketId: (_cell$Article5 = cell.Article) === null || _cell$Article5 === void 0 ? void 0 : _cell$Article5.basketId,
1628
+ basketId: (_cell$Article6 = cell.Article) === null || _cell$Article6 === void 0 ? void 0 : _cell$Article6.basketId,
1333
1629
  gridId: grid.ShelfIndex,
1334
1630
  gridName: grid.GridName,
1335
1631
  model: cell.Article.model3DName,
@@ -1350,8 +1646,8 @@ var ShelfPlanner = /*#__PURE__*/function () {
1350
1646
  }, {
1351
1647
  key: "getShelfElementId",
1352
1648
  value: function getShelfElementId() {
1353
- var _this$article$accesso2;
1354
- if ((_this$article$accesso2 = this.article.accessoireParentArticle) !== null && _this$article$accesso2 !== void 0 && _this$article$accesso2.shelfPlanner && this.article.relatedToShelfGrid !== undefined && this.grids.length > 0) {
1649
+ var _this$article$accesso4;
1650
+ if ((_this$article$accesso4 = this.article.accessoireParentArticle) !== null && _this$article$accesso4 !== void 0 && _this$article$accesso4.shelfPlanner && this.article.relatedToShelfGrid !== undefined && this.grids.length > 0) {
1355
1651
  var rh = this.getRHOnParentArticle();
1356
1652
  var parentId = this.article.accessoireParentArticle.shelfPlanner.getShelfElementId();
1357
1653
  return parentId + '.' + this.article.relatedToShelfGrid + '.' + rh;
@@ -1366,13 +1662,13 @@ var ShelfPlanner = /*#__PURE__*/function () {
1366
1662
  }, {
1367
1663
  key: "getRHOnParentArticle",
1368
1664
  value: function getRHOnParentArticle() {
1369
- var _this$article$accesso3,
1370
- _this = this;
1665
+ var _this$article$accesso5,
1666
+ _this2 = this;
1371
1667
  if (this.article.relatedToShelfGrid === undefined) return undefined;
1372
- return (_this$article$accesso3 = this.article.accessoireParentArticle) === null || _this$article$accesso3 === void 0 || (_this$article$accesso3 = _this$article$accesso3.shelfPlanner) === null || _this$article$accesso3 === void 0 || (_this$article$accesso3 = _this$article$accesso3.grids[this.article.relatedToShelfGrid].Cells.find(function (item) {
1668
+ return (_this$article$accesso5 = this.article.accessoireParentArticle) === null || _this$article$accesso5 === void 0 || (_this$article$accesso5 = _this$article$accesso5.shelfPlanner) === null || _this$article$accesso5 === void 0 || (_this$article$accesso5 = _this$article$accesso5.grids[this.article.relatedToShelfGrid].Cells.find(function (item) {
1373
1669
  var _item$Article;
1374
- return ((_item$Article = item.Article) === null || _item$Article === void 0 ? void 0 : _item$Article.basketId) == _this.article.basketId;
1375
- })) === null || _this$article$accesso3 === void 0 ? void 0 : _this$article$accesso3.InUse;
1670
+ return ((_item$Article = item.Article) === null || _item$Article === void 0 ? void 0 : _item$Article.basketId) == _this2.article.basketId;
1671
+ })) === null || _this$article$accesso5 === void 0 ? void 0 : _this$article$accesso5.InUse;
1376
1672
  }
1377
1673
 
1378
1674
  /**
@@ -1435,8 +1731,8 @@ var ShelfPlanner = /*#__PURE__*/function () {
1435
1731
  }, {
1436
1732
  key: "getShelfParentShelfId",
1437
1733
  value: function getShelfParentShelfId() {
1438
- var _this$article$accesso4;
1439
- if (this.article.relatedToShelfGrid !== undefined) return (_this$article$accesso4 = this.article.accessoireParentArticle) === null || _this$article$accesso4 === void 0 || (_this$article$accesso4 = _this$article$accesso4.shelfPlanner) === null || _this$article$accesso4 === void 0 || (_this$article$accesso4 = _this$article$accesso4.grids[this.article.relatedToShelfGrid]) === null || _this$article$accesso4 === void 0 ? void 0 : _this$article$accesso4.ShelfId;
1734
+ var _this$article$accesso6;
1735
+ if (this.article.relatedToShelfGrid !== undefined) return (_this$article$accesso6 = this.article.accessoireParentArticle) === null || _this$article$accesso6 === void 0 || (_this$article$accesso6 = _this$article$accesso6.shelfPlanner) === null || _this$article$accesso6 === void 0 || (_this$article$accesso6 = _this$article$accesso6.grids[this.article.relatedToShelfGrid]) === null || _this$article$accesso6 === void 0 ? void 0 : _this$article$accesso6.ShelfId;
1440
1736
  return undefined;
1441
1737
  }
1442
1738
 
@@ -1496,7 +1792,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
1496
1792
  key: "disableCellsByDockedShelfs",
1497
1793
  value: (function () {
1498
1794
  var _disableCellsByDockedShelfs = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(count) {
1499
- var _this2 = this;
1795
+ var _this3 = this;
1500
1796
  var grids, _loop2, i;
1501
1797
  return _regeneratorRuntime.wrap(function _callee12$(_context13) {
1502
1798
  while (1) switch (_context13.prev = _context13.next) {
@@ -1520,7 +1816,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
1520
1816
  newlyEnabled = grid.Cells.filter(function (cell, j) {
1521
1817
  return cell.IsDisabled && !toDisableCells.includes(j);
1522
1818
  }).length;
1523
- if (newlyDisabled.length || newlyEnabled) _this2.logShelfDebug({
1819
+ if (newlyDisabled.length || newlyEnabled) _this3.logShelfDebug({
1524
1820
  phase: 'docking',
1525
1821
  action: 'disabledCellsUpdated',
1526
1822
  gridIndex: grid.ShelfIndex,
@@ -1538,7 +1834,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
1538
1834
  break;
1539
1835
  }
1540
1836
  _context12.next = 14;
1541
- return setHandlerInstance.deleteAccessorieOnShelfPlanner(_this2.article.set, grid.ShelfIndex, cell.InUse, grid.basketId);
1837
+ return setHandlerInstance.deleteAccessorieOnShelfPlanner(_this3.article.set, grid.ShelfIndex, cell.InUse, grid.basketId);
1542
1838
  case 14:
1543
1839
  cell.IsDisabled = true;
1544
1840
  case 15:
@@ -1586,7 +1882,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
1586
1882
  }
1587
1883
  }, _callee12, this);
1588
1884
  }));
1589
- function disableCellsByDockedShelfs(_x19) {
1885
+ function disableCellsByDockedShelfs(_x20) {
1590
1886
  return _disableCellsByDockedShelfs.apply(this, arguments);
1591
1887
  }
1592
1888
  return disableCellsByDockedShelfs;