@crystaldesign/web-planner-logic 26.9.0 → 26.9.1-rc.0

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 (33) hide show
  1. package/build/cjs/{DivaBoxPlanner-9a2fbe9e.js → DivaBoxPlanner-ec7f0b5b.js} +2 -2
  2. package/build/cjs/{DivaStandardPlanner-8aaf279a.js → DivaStandardPlanner-f0ddf891.js} +2 -2
  3. package/build/cjs/{DoorPlanner-2d72fc2a.js → DoorPlanner-afb8bac8.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-3654d9c2.js → Host3DSignalR-adb977d5.js} +1 -1
  5. package/build/cjs/{LiviqueWWSHandler-471e5110.js → LiviqueWWSHandler-8ce888ee.js} +1 -1
  6. package/build/cjs/{PfisterWWSHandler-830e8d0f.js → PfisterWWSHandler-e14c5ad0.js} +1 -1
  7. package/build/cjs/{PlannerHandler2D-d63e0e68.js → PlannerHandler2D-c7e7a2ad.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-18bbab93.js → SeriousBasketHandler-ab70c3f2.js} +1 -1
  9. package/build/cjs/{ShelfPlanner-101a4cfe.js → ShelfPlanner-77dec265.js} +383 -130
  10. package/build/cjs/{StandardWWSHandler-67586d69.js → StandardWWSHandler-40acdc54.js} +1 -1
  11. package/build/cjs/{index-a0f1de4d.js → index-ee4680de.js} +818 -710
  12. package/build/cjs/index.js +1 -1
  13. package/build/esm/{DivaBoxPlanner-111611fc.js → DivaBoxPlanner-b9780c8d.js} +2 -2
  14. package/build/esm/{DivaStandardPlanner-8a46797c.js → DivaStandardPlanner-0610c5cb.js} +2 -2
  15. package/build/esm/{DoorPlanner-7bb1df73.js → DoorPlanner-9173724e.js} +1 -1
  16. package/build/esm/{Host3DSignalR-f86cf2af.js → Host3DSignalR-afd64d70.js} +1 -1
  17. package/build/esm/{LiviqueWWSHandler-c9734701.js → LiviqueWWSHandler-a4b0e92c.js} +1 -1
  18. package/build/esm/{PfisterWWSHandler-7f6c04dd.js → PfisterWWSHandler-bd729608.js} +1 -1
  19. package/build/esm/{PlannerHandler2D-1d57065e.js → PlannerHandler2D-b36ad7d6.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-4bebdfbc.js → SeriousBasketHandler-8a3bc8c3.js} +1 -1
  21. package/build/esm/{ShelfPlanner-b9733aa7.js → ShelfPlanner-05264b37.js} +384 -131
  22. package/build/esm/{StandardWWSHandler-eaead4e9.js → StandardWWSHandler-4bb4d5f8.js} +1 -1
  23. package/build/esm/{index-f1d0a83b.js → index-d54bf057.js} +818 -710
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts +19 -0
  26. package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +25 -0
  28. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +12 -0
  30. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/test/plannerBusinessEvents.test.d.ts +3 -0
  32. package/build/types/web-planner-logic/src/test/plannerBusinessEvents.test.d.ts.map +1 -0
  33. package/package.json +2 -2
@@ -29726,7 +29726,7 @@ var DivaArticle = /*#__PURE__*/function () {
29726
29726
  break;
29727
29727
  }
29728
29728
  _context.next = 4;
29729
- return import('./ShelfPlanner-b9733aa7.js');
29729
+ return import('./ShelfPlanner-05264b37.js');
29730
29730
  case 4:
29731
29731
  _yield$import = _context.sent;
29732
29732
  ShelfPlanner = _yield$import["default"];
@@ -37764,7 +37764,7 @@ var DivaSet = /*#__PURE__*/function () {
37764
37764
  break;
37765
37765
  }
37766
37766
  _context5.next = 3;
37767
- return import('./DoorPlanner-7bb1df73.js');
37767
+ return import('./DoorPlanner-9173724e.js');
37768
37768
  case 3:
37769
37769
  _yield$import = _context5.sent;
37770
37770
  DoorPlanner = _yield$import["default"];
@@ -38373,7 +38373,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
38373
38373
  key: "createSet",
38374
38374
  value: function () {
38375
38375
  var _createSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(catalogData, orderSet, initSetState, lastSetToInitialize) {
38376
- var set, _orderSet$OrderLines;
38376
+ var set, _orderSet$OrderLines, restoredAccessoires;
38377
38377
  return _regeneratorRuntime.wrap(function _callee$(_context) {
38378
38378
  while (1) switch (_context.prev = _context.next) {
38379
38379
  case 0:
@@ -38382,7 +38382,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
38382
38382
  favoritesHandlerInstance.initSet(set, orderSet);
38383
38383
  //falls keine Article initialisiert werden sollen
38384
38384
  if (initSetState.initEmptyPlanner) {
38385
- _context.next = 13;
38385
+ _context.next = 19;
38386
38386
  break;
38387
38387
  }
38388
38388
  _context.next = 6;
@@ -38398,14 +38398,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
38398
38398
  _context.next = 11;
38399
38399
  return this.reinitArticlesAfterDocking(set, orderSet);
38400
38400
  case 11:
38401
- _context.next = 15;
38402
- break;
38401
+ _context.next = 13;
38402
+ return this.restoreShelfAccessoiresOfSet(set);
38403
38403
  case 13:
38404
- _context.next = 15;
38404
+ restoredAccessoires = _context.sent;
38405
+ if (!restoredAccessoires) {
38406
+ _context.next = 17;
38407
+ break;
38408
+ }
38409
+ _context.next = 17;
38410
+ return this.updateArticlesOptionStatesOfActSet(set, {}, [], undefined, 'initializing', undefined, true);
38411
+ case 17:
38412
+ _context.next = 21;
38413
+ break;
38414
+ case 19:
38415
+ _context.next = 21;
38405
38416
  return set.plannerHandler.initSet(set, catalogData, undefined);
38406
- case 15:
38417
+ case 21:
38407
38418
  return _context.abrupt("return", set);
38408
- case 16:
38419
+ case 22:
38409
38420
  case "end":
38410
38421
  return _context.stop();
38411
38422
  }
@@ -38489,7 +38500,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
38489
38500
  value: function () {
38490
38501
  var _initOrderLineArticles = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(set, orderSet) {
38491
38502
  var _JSON$parse;
38492
- var catalogData, toLoadArticles, previousPartlistArticles, elements, _loop, i, _loop2, basketId, _i, toloadArticle, catalogArticle, newArticle, _i2, _newArticle, parentArticle, _newArticle$shelfPlan, _i3, cellsOfGrid, j, cell, gridIndex, accessoire, doesFit, _i4, _newArticle2$doorPlan, _newArticle2;
38503
+ var catalogData, toLoadArticles, previousPartlistArticles, elements, _loop, i, _loop2, basketId, _i, toloadArticle, catalogArticle, newArticle, _i2, _newArticle, parentArticle, _i3, _newArticle2$doorPlan, _newArticle2;
38493
38504
  return _regeneratorRuntime.wrap(function _callee3$(_context5) {
38494
38505
  while (1) switch (_context5.prev = _context5.next) {
38495
38506
  case 0:
@@ -38651,135 +38662,232 @@ var DivaSetHandler = /*#__PURE__*/function () {
38651
38662
  _context5.next = 25;
38652
38663
  break;
38653
38664
  case 47:
38654
- _i2 = 0;
38655
- case 48:
38656
- if (!(_i2 < toLoadArticles.length)) {
38657
- _context5.next = 77;
38658
- break;
38659
- }
38660
- _newArticle = set.getArticleByBasketId(toLoadArticles[_i2].basketId);
38661
- if (_newArticle !== null && _newArticle !== void 0 && _newArticle.relatedToBasketId) {
38662
- parentArticle = set.getArticleByBasketId(_newArticle.relatedToBasketId);
38663
- if (parentArticle) {
38664
- parentArticle.addAccessoire(_newArticle);
38665
- if (!_newArticle.isDockable) {
38666
- parentArticle.setAccessoirePos(_newArticle.basketId, _newArticle.quantity, _newArticle.groupName);
38667
- _newArticle.accessoireParentArticle = parentArticle;
38665
+ //init Accessoires at their parents
38666
+ for (_i2 = 0; _i2 < toLoadArticles.length; _i2++) {
38667
+ _newArticle = set.getArticleByBasketId(toLoadArticles[_i2].basketId);
38668
+ if (_newArticle !== null && _newArticle !== void 0 && _newArticle.relatedToBasketId) {
38669
+ parentArticle = set.getArticleByBasketId(_newArticle.relatedToBasketId);
38670
+ if (parentArticle) {
38671
+ parentArticle.addAccessoire(_newArticle);
38672
+ if (!_newArticle.isDockable) {
38673
+ parentArticle.setAccessoirePos(_newArticle.basketId, _newArticle.quantity, _newArticle.groupName);
38674
+ _newArticle.accessoireParentArticle = parentArticle;
38675
+ }
38668
38676
  }
38669
38677
  }
38670
38678
  }
38671
- //init shelfAcc on parent
38672
- if (!(_newArticle !== null && _newArticle !== void 0 && _newArticle.shelfPlanner)) {
38673
- _context5.next = 74;
38679
+ _i3 = 0;
38680
+ case 49:
38681
+ if (!(_i3 < toLoadArticles.length)) {
38682
+ _context5.next = 62;
38674
38683
  break;
38675
38684
  }
38676
- if (!((_newArticle$shelfPlan = _newArticle.shelfPlanData) !== null && _newArticle$shelfPlan !== void 0 && _newArticle$shelfPlan.ShelfPlanner2)) {
38677
- _context5.next = 74;
38685
+ _newArticle2 = set.getArticleByBasketId(toLoadArticles[_i3].basketId);
38686
+ if (_newArticle2) {
38687
+ _context5.next = 53;
38678
38688
  break;
38679
38689
  }
38680
- _i3 = 0;
38681
- case 54:
38682
- if (!(_i3 < _newArticle.shelfPlanData.ShelfPlanner2.length)) {
38683
- _context5.next = 74;
38690
+ return _context5.abrupt("continue", 59);
38691
+ case 53:
38692
+ if (!(_newArticle2.j3D && _newArticle2.j3D.Doors && !((_newArticle2$doorPlan = _newArticle2.doorPlanner) !== null && _newArticle2$doorPlan !== void 0 && _newArticle2$doorPlan.alreadyInitialized(_newArticle2.basketId)))) {
38693
+ _context5.next = 56;
38694
+ break;
38695
+ }
38696
+ _context5.next = 56;
38697
+ return set.initializeDoorPlanner(_newArticle2.j3D, _newArticle2);
38698
+ case 56:
38699
+ if (!_newArticle2.doorPlanner) {
38700
+ _context5.next = 59;
38701
+ break;
38702
+ }
38703
+ _newArticle2.doorPlanner.initDoorPlanner();
38704
+ return _context5.abrupt("break", 62);
38705
+ case 59:
38706
+ _i3++;
38707
+ _context5.next = 49;
38708
+ break;
38709
+ case 62:
38710
+ set.configSingle = configTreeHandler.checkIfLoadedArticlesAreConfigSingle(set);
38711
+ _context5.next = 65;
38712
+ return this.updateArticlesOptionStatesOfActSet(set, {}, [], undefined, 'initializing');
38713
+ case 65:
38714
+ DivaUtils.endSpanOfApm('Articles initialize');
38715
+ case 66:
38716
+ case "end":
38717
+ return _context5.stop();
38718
+ }
38719
+ }, _callee3, this);
38720
+ }));
38721
+ function initOrderLineArticles(_x7, _x8) {
38722
+ return _initOrderLineArticles.apply(this, arguments);
38723
+ }
38724
+ return initOrderLineArticles;
38725
+ }()
38726
+ /**
38727
+ * Restores the shelfaccessoires of every article of a loaded set - see the call in createSet for why it runs there.
38728
+ * @returns how many accessoires were placed back into their cells
38729
+ */
38730
+ }, {
38731
+ key: "restoreShelfAccessoiresOfSet",
38732
+ value: (function () {
38733
+ var _restoreShelfAccessoiresOfSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(set) {
38734
+ var articles, restoredAccessoires, i;
38735
+ return _regeneratorRuntime.wrap(function _callee4$(_context6) {
38736
+ while (1) switch (_context6.prev = _context6.next) {
38737
+ case 0:
38738
+ articles = Object.values(set.getDivaArticles());
38739
+ restoredAccessoires = 0;
38740
+ i = 0;
38741
+ case 3:
38742
+ if (!(i < articles.length)) {
38743
+ _context6.next = 11;
38744
+ break;
38745
+ }
38746
+ _context6.t0 = restoredAccessoires;
38747
+ _context6.next = 7;
38748
+ return this.restoreShelfAccessoires(set, articles[i]);
38749
+ case 7:
38750
+ restoredAccessoires = _context6.t0 += _context6.sent;
38751
+ case 8:
38752
+ i++;
38753
+ _context6.next = 3;
38754
+ break;
38755
+ case 11:
38756
+ return _context6.abrupt("return", restoredAccessoires);
38757
+ case 12:
38758
+ case "end":
38759
+ return _context6.stop();
38760
+ }
38761
+ }, _callee4, this);
38762
+ }));
38763
+ function restoreShelfAccessoiresOfSet(_x9) {
38764
+ return _restoreShelfAccessoiresOfSet.apply(this, arguments);
38765
+ }
38766
+ return restoreShelfAccessoiresOfSet;
38767
+ }()
38768
+ /**
38769
+ * Places the shelfaccessoires of a saved basket back into the cells of their parent shelfplanner.
38770
+ * Has to run on a settled configuration - see the call in initOrderLineArticles.
38771
+ * Accessoires that do not fit anymore (eg. the grid got smaller since the basket was saved) get deleted, because
38772
+ * they would stay in the basket as a position that is not visible on the shelf.
38773
+ */
38774
+ )
38775
+ }, {
38776
+ key: "restoreShelfAccessoires",
38777
+ value: (function () {
38778
+ var _restoreShelfAccessoires = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(set, article) {
38779
+ var _article$shelfPlanDat;
38780
+ var restoredAccessoires, shelfPlanner, savedGrids, i, cellsOfGrid, j, _shelfPlanner$getGrid, cell, gridIndex, accessoire, doesFit;
38781
+ return _regeneratorRuntime.wrap(function _callee5$(_context7) {
38782
+ while (1) switch (_context7.prev = _context7.next) {
38783
+ case 0:
38784
+ restoredAccessoires = 0;
38785
+ shelfPlanner = article.shelfPlanner;
38786
+ if (shelfPlanner) {
38787
+ _context7.next = 4;
38684
38788
  break;
38685
38789
  }
38686
- cellsOfGrid = _newArticle.shelfPlanData.ShelfPlanner2[_i3];
38790
+ return _context7.abrupt("return", restoredAccessoires);
38791
+ case 4:
38792
+ savedGrids = (_article$shelfPlanDat = article.shelfPlanData) === null || _article$shelfPlanDat === void 0 ? void 0 : _article$shelfPlanDat.ShelfPlanner2;
38793
+ if (savedGrids) {
38794
+ _context7.next = 8;
38795
+ break;
38796
+ }
38797
+ shelfPlanner.RestorePending = false;
38798
+ return _context7.abrupt("return", restoredAccessoires);
38799
+ case 8:
38800
+ i = 0;
38801
+ case 9:
38802
+ if (!(i < savedGrids.length)) {
38803
+ _context7.next = 36;
38804
+ break;
38805
+ }
38806
+ cellsOfGrid = savedGrids[i];
38687
38807
  j = 0;
38688
- case 57:
38808
+ case 12:
38689
38809
  if (!(j < cellsOfGrid.length)) {
38690
- _context5.next = 71;
38810
+ _context7.next = 33;
38691
38811
  break;
38692
38812
  }
38693
38813
  cell = cellsOfGrid[j];
38694
- gridIndex = cell.gridIndex !== undefined ? cell.gridIndex : _i3;
38695
- if (!(cell.inUse != -1 && j == cell.inUse)) {
38696
- _context5.next = 68;
38814
+ gridIndex = cell.gridIndex !== undefined ? cell.gridIndex : i;
38815
+ if (!(cell.inUse == -1 || j != cell.inUse)) {
38816
+ _context7.next = 17;
38697
38817
  break;
38698
38818
  }
38819
+ return _context7.abrupt("continue", 30);
38820
+ case 17:
38699
38821
  accessoire = set.getArticleByBasketId(cell.usedArticleData.BasketID);
38700
- if (!accessoire) {
38701
- _context5.next = 68;
38822
+ if (accessoire) {
38823
+ _context7.next = 20;
38702
38824
  break;
38703
38825
  }
38704
- doesFit = _newArticle.shelfPlanner.tryFitOnShelfOfGrid(gridIndex, j, accessoire);
38826
+ return _context7.abrupt("continue", 30);
38827
+ case 20:
38828
+ doesFit = shelfPlanner.tryFitOnShelfOfGrid(gridIndex, j, accessoire);
38705
38829
  if (!(doesFit !== false && doesFit.type != 'doesNotFit' && doesFit.type != 'notAllowedByParentRule' && doesFit.type != 'notAllowedByAccessoireRule' && doesFit.type != 'notAllowedByMaxQuantityReached' && doesFit.index !== undefined)) {
38706
- _context5.next = 68;
38830
+ _context7.next = 27;
38707
38831
  break;
38708
38832
  }
38709
- _context5.next = 67;
38710
- return _newArticle.shelfPlanner.addAccessoireInCellInGrid(accessoire, gridIndex, j, doesFit.type, {
38833
+ _context7.next = 24;
38834
+ return shelfPlanner.addAccessoireInCellInGrid(accessoire, gridIndex, j, doesFit.type, {
38711
38835
  noDelete: cell.noDelete,
38712
38836
  noMove: cell.noMove
38713
38837
  });
38714
- case 67:
38838
+ case 24:
38715
38839
  accessoire.relatedToShelfGrid = gridIndex;
38716
- case 68:
38840
+ restoredAccessoires++;
38841
+ return _context7.abrupt("continue", 30);
38842
+ case 27:
38843
+ LOG$9.error(new DivaError('saved shelfaccessoire does not fit anymore and gets deleted', {
38844
+ code: 'WC_0015',
38845
+ custom: {
38846
+ accessoirePosNr: accessoire.posNr,
38847
+ accessoireCodex: accessoire.articleCodex,
38848
+ accessoireBasketId: accessoire.basketId,
38849
+ shelfHeight: accessoire.shelfHeight,
38850
+ savedCell: j,
38851
+ gridIndex: gridIndex,
38852
+ gridName: (_shelfPlanner$getGrid = shelfPlanner.getGridByIndex(gridIndex)) === null || _shelfPlanner$getGrid === void 0 ? void 0 : _shelfPlanner$getGrid.GridName,
38853
+ doesFit: doesFit,
38854
+ parentPosNr: article.posNr,
38855
+ parentArticleCodex: article.articleCodex,
38856
+ parentBasketId: article.basketId,
38857
+ parentWidth: article.width
38858
+ }
38859
+ }));
38860
+ _context7.next = 30;
38861
+ return this.deleteElementFromSet(set, accessoire, false, undefined, true);
38862
+ case 30:
38717
38863
  j++;
38718
- _context5.next = 57;
38864
+ _context7.next = 12;
38719
38865
  break;
38720
- case 71:
38721
- _i3++;
38722
- _context5.next = 54;
38723
- break;
38724
- case 74:
38725
- _i2++;
38726
- _context5.next = 48;
38727
- break;
38728
- case 77:
38729
- _i4 = 0;
38730
- case 78:
38731
- if (!(_i4 < toLoadArticles.length)) {
38732
- _context5.next = 91;
38733
- break;
38734
- }
38735
- _newArticle2 = set.getArticleByBasketId(toLoadArticles[_i4].basketId);
38736
- if (_newArticle2) {
38737
- _context5.next = 82;
38738
- break;
38739
- }
38740
- return _context5.abrupt("continue", 88);
38741
- case 82:
38742
- if (!(_newArticle2.j3D && _newArticle2.j3D.Doors && !((_newArticle2$doorPlan = _newArticle2.doorPlanner) !== null && _newArticle2$doorPlan !== void 0 && _newArticle2$doorPlan.alreadyInitialized(_newArticle2.basketId)))) {
38743
- _context5.next = 85;
38744
- break;
38745
- }
38746
- _context5.next = 85;
38747
- return set.initializeDoorPlanner(_newArticle2.j3D, _newArticle2);
38748
- case 85:
38749
- if (!_newArticle2.doorPlanner) {
38750
- _context5.next = 88;
38751
- break;
38752
- }
38753
- _newArticle2.doorPlanner.initDoorPlanner();
38754
- return _context5.abrupt("break", 91);
38755
- case 88:
38756
- _i4++;
38757
- _context5.next = 78;
38866
+ case 33:
38867
+ i++;
38868
+ _context7.next = 9;
38758
38869
  break;
38759
- case 91:
38760
- set.configSingle = configTreeHandler.checkIfLoadedArticlesAreConfigSingle(set);
38761
- _context5.next = 94;
38762
- return this.updateArticlesOptionStatesOfActSet(set, {}, [], undefined, 'initializing');
38763
- case 94:
38764
- DivaUtils.endSpanOfApm('Articles initialize');
38765
- case 95:
38870
+ case 36:
38871
+ shelfPlanner.RestorePending = false;
38872
+ return _context7.abrupt("return", restoredAccessoires);
38873
+ case 38:
38766
38874
  case "end":
38767
- return _context5.stop();
38875
+ return _context7.stop();
38768
38876
  }
38769
- }, _callee3, this);
38877
+ }, _callee5, this);
38770
38878
  }));
38771
- function initOrderLineArticles(_x7, _x8) {
38772
- return _initOrderLineArticles.apply(this, arguments);
38879
+ function restoreShelfAccessoires(_x10, _x11) {
38880
+ return _restoreShelfAccessoires.apply(this, arguments);
38773
38881
  }
38774
- return initOrderLineArticles;
38775
- }()
38882
+ return restoreShelfAccessoires;
38883
+ }())
38776
38884
  }, {
38777
38885
  key: "initSetsByOrderSet",
38778
38886
  value: function () {
38779
- var _initSetsByOrderSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(orderSets, initSetState) {
38887
+ var _initSetsByOrderSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(orderSets, initSetState) {
38780
38888
  var sets, i, orderSet, _initSetState$updateS;
38781
- return _regeneratorRuntime.wrap(function _callee4$(_context6) {
38782
- while (1) switch (_context6.prev = _context6.next) {
38889
+ return _regeneratorRuntime.wrap(function _callee6$(_context8) {
38890
+ while (1) switch (_context8.prev = _context8.next) {
38783
38891
  case 0:
38784
38892
  sets = [];
38785
38893
  if (initSetState.involvedSetIds) {
@@ -38790,7 +38898,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
38790
38898
  i = 0;
38791
38899
  case 3:
38792
38900
  if (!(i < orderSets.length)) {
38793
- _context6.next = 15;
38901
+ _context8.next = 15;
38794
38902
  break;
38795
38903
  }
38796
38904
  orderSet = orderSets[i];
@@ -38801,28 +38909,28 @@ var DivaSetHandler = /*#__PURE__*/function () {
38801
38909
  }
38802
38910
  }
38803
38911
  if (!(!initSetState.specificSetIdToLoad || initSetState.specificSetIdToLoad == orderSets[i].SetID)) {
38804
- _context6.next = 12;
38912
+ _context8.next = 12;
38805
38913
  break;
38806
38914
  }
38807
- _context6.t0 = sets;
38808
- _context6.next = 10;
38915
+ _context8.t0 = sets;
38916
+ _context8.next = 10;
38809
38917
  return this.initSet(orderSets[i], initSetState, initSetState.updateSetImage, this.getOrderSetShouldInitPlanner(orderSets, i));
38810
38918
  case 10:
38811
- _context6.t1 = _context6.sent;
38812
- _context6.t0.push.call(_context6.t0, _context6.t1);
38919
+ _context8.t1 = _context8.sent;
38920
+ _context8.t0.push.call(_context8.t0, _context8.t1);
38813
38921
  case 12:
38814
38922
  i++;
38815
- _context6.next = 3;
38923
+ _context8.next = 3;
38816
38924
  break;
38817
38925
  case 15:
38818
- return _context6.abrupt("return", sets);
38926
+ return _context8.abrupt("return", sets);
38819
38927
  case 16:
38820
38928
  case "end":
38821
- return _context6.stop();
38929
+ return _context8.stop();
38822
38930
  }
38823
- }, _callee4, this);
38931
+ }, _callee6, this);
38824
38932
  }));
38825
- function initSetsByOrderSet(_x9, _x10) {
38933
+ function initSetsByOrderSet(_x12, _x13) {
38826
38934
  return _initSetsByOrderSet.apply(this, arguments);
38827
38935
  }
38828
38936
  return initSetsByOrderSet;
@@ -38883,25 +38991,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
38883
38991
  }, {
38884
38992
  key: "initSet",
38885
38993
  value: function () {
38886
- var _initSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(orderSet, initSetState, updateSetImage, lastSetToInitialize) {
38994
+ var _initSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(orderSet, initSetState, updateSetImage, lastSetToInitialize) {
38887
38995
  var _orderSet$OrderLines2, _initSetState$article;
38888
38996
  var catalogData, articlesToInitialize, set, params, j, _initSetState$initVar, _catalogData$promoted, variantValues, image;
38889
- return _regeneratorRuntime.wrap(function _callee5$(_context7) {
38890
- while (1) switch (_context7.prev = _context7.next) {
38997
+ return _regeneratorRuntime.wrap(function _callee7$(_context9) {
38998
+ while (1) switch (_context9.prev = _context9.next) {
38891
38999
  case 0:
38892
39000
  LOG$9.debug('DivaSetHandler.initSetsByBasketData: ' + orderSet.SetID);
38893
- _context7.next = 3;
39001
+ _context9.next = 3;
38894
39002
  return catalogHandlerInstance.getCatalogData(initSetState, orderSet.ModelCatalogCodex ? orderSet.ModelCatalogCodex : orderSet.CatalogCodex, orderSet);
38895
39003
  case 3:
38896
- catalogData = _context7.sent;
39004
+ catalogData = _context9.sent;
38897
39005
  articlesToInitialize = !((_orderSet$OrderLines2 = orderSet.OrderLines) !== null && _orderSet$OrderLines2 !== void 0 && _orderSet$OrderLines2.length) ? (_initSetState$article = initSetState.articlesToInitialize) !== null && _initSetState$article !== void 0 ? _initSetState$article : catalogData.startPlannerArticle : undefined;
38898
39006
  catalogData.checkIfUseBoxPlanner(articlesToInitialize !== null && articlesToInitialize !== void 0 ? articlesToInitialize : orderSet.OrderLines.map(function (o) {
38899
39007
  return o.ArticleCodex;
38900
39008
  }));
38901
- _context7.next = 8;
39009
+ _context9.next = 8;
38902
39010
  return this.createSet(catalogData, orderSet, initSetState, lastSetToInitialize);
38903
39011
  case 8:
38904
- set = _context7.sent;
39012
+ set = _context9.sent;
38905
39013
  if (set.api.getLoadSupplierColors() && initSetState.supplierColors) {
38906
39014
  set.supplierColors = initSetState.supplierColors;
38907
39015
  }
@@ -38919,24 +39027,24 @@ var DivaSetHandler = /*#__PURE__*/function () {
38919
39027
  }
38920
39028
  }
38921
39029
  if (!(articlesToInitialize && articlesToInitialize.length > 0)) {
38922
- _context7.next = 24;
39030
+ _context9.next = 24;
38923
39031
  break;
38924
39032
  }
38925
39033
  DivaUtils.startSpanOfApm('Articles initialize');
38926
39034
  j = 0;
38927
39035
  case 15:
38928
39036
  if (!(j < articlesToInitialize.length)) {
38929
- _context7.next = 22;
39037
+ _context9.next = 22;
38930
39038
  break;
38931
39039
  }
38932
39040
  variantValues = (_initSetState$initVar = initSetState.initVariantValues) !== null && _initSetState$initVar !== void 0 ? _initSetState$initVar : catalogData === null || catalogData === void 0 || (_catalogData$promoted = catalogData.promotedOpvs) === null || _catalogData$promoted === void 0 || (_catalogData$promoted = _catalogData$promoted.articles) === null || _catalogData$promoted === void 0 || (_catalogData$promoted = _catalogData$promoted[articlesToInitialize[j]]) === null || _catalogData$promoted === void 0 || (_catalogData$promoted = _catalogData$promoted[0]) === null || _catalogData$promoted === void 0 ? void 0 : _catalogData$promoted.variantValues;
38933
- _context7.next = 19;
39041
+ _context9.next = 19;
38934
39042
  return this.addPlannerElement(set, articlesToInitialize[j], _objectSpread$c(_objectSpread$c({}, params), variantValues ? {
38935
39043
  variantValues: variantValues
38936
39044
  } : {}));
38937
39045
  case 19:
38938
39046
  j++;
38939
- _context7.next = 15;
39047
+ _context9.next = 15;
38940
39048
  break;
38941
39049
  case 22:
38942
39050
  //display image of article if there is no planner
@@ -38946,14 +39054,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
38946
39054
  }
38947
39055
  DivaUtils.endSpanOfApm('Articles initialize');
38948
39056
  case 24:
38949
- return _context7.abrupt("return", set);
39057
+ return _context9.abrupt("return", set);
38950
39058
  case 25:
38951
39059
  case "end":
38952
- return _context7.stop();
39060
+ return _context9.stop();
38953
39061
  }
38954
- }, _callee5, this);
39062
+ }, _callee7, this);
38955
39063
  }));
38956
- function initSet(_x11, _x12, _x13, _x14) {
39064
+ function initSet(_x14, _x15, _x16, _x17) {
38957
39065
  return _initSet.apply(this, arguments);
38958
39066
  }
38959
39067
  return initSet;
@@ -38965,10 +39073,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
38965
39073
  }, {
38966
39074
  key: "destroyPlannerHandler",
38967
39075
  value: (function () {
38968
- var _destroyPlannerHandler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(set, doDestroy3DHostConnection) {
39076
+ var _destroyPlannerHandler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(set, doDestroy3DHostConnection) {
38969
39077
  var result;
38970
- return _regeneratorRuntime.wrap(function _callee6$(_context8) {
38971
- while (1) switch (_context8.prev = _context8.next) {
39078
+ return _regeneratorRuntime.wrap(function _callee8$(_context10) {
39079
+ while (1) switch (_context10.prev = _context10.next) {
38972
39080
  case 0:
38973
39081
  result = set.plannerHandler.destroyAllPlanner();
38974
39082
  if (result) {
@@ -38981,11 +39089,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
38981
39089
  }
38982
39090
  case 2:
38983
39091
  case "end":
38984
- return _context8.stop();
39092
+ return _context10.stop();
38985
39093
  }
38986
- }, _callee6);
39094
+ }, _callee8);
38987
39095
  }));
38988
- function destroyPlannerHandler(_x15, _x16) {
39096
+ function destroyPlannerHandler(_x18, _x19) {
38989
39097
  return _destroyPlannerHandler.apply(this, arguments);
38990
39098
  }
38991
39099
  return destroyPlannerHandler;
@@ -39010,37 +39118,37 @@ var DivaSetHandler = /*#__PURE__*/function () {
39010
39118
  }, {
39011
39119
  key: "addPlannerElement",
39012
39120
  value: (function () {
39013
- var _addPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(set, artCodex, initParams, from) {
39121
+ var _addPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(set, artCodex, initParams, from) {
39014
39122
  var newArticle, plannerElement, _set$getArticleByBask;
39015
- return _regeneratorRuntime.wrap(function _callee7$(_context9) {
39016
- while (1) switch (_context9.prev = _context9.next) {
39123
+ return _regeneratorRuntime.wrap(function _callee9$(_context11) {
39124
+ while (1) switch (_context11.prev = _context11.next) {
39017
39125
  case 0:
39018
- _context9.next = 2;
39126
+ _context11.next = 2;
39019
39127
  return this.addArticleToActSet(set, artCodex, initParams, undefined, from);
39020
39128
  case 2:
39021
- newArticle = _context9.sent;
39022
- _context9.next = 5;
39129
+ newArticle = _context11.sent;
39130
+ _context11.next = 5;
39023
39131
  return set.plannerHandler.addPlannerElement(set.getSetId(), newArticle.basketId, initParams);
39024
39132
  case 5:
39025
- plannerElement = _context9.sent;
39133
+ plannerElement = _context11.sent;
39026
39134
  if (!(set.CatalogData.reconfigAfterArticleDocked || !!newArticle.getArticleOptionState('OPTLASTSTACKEDARTICLE'))) {
39027
- _context9.next = 9;
39135
+ _context11.next = 9;
39028
39136
  break;
39029
39137
  }
39030
- _context9.next = 9;
39138
+ _context11.next = 9;
39031
39139
  return this.updateArticlesOptionStatesOfActSet(set, {}, []);
39032
39140
  case 9:
39033
39141
  if (newArticle.relatedToBasketId && plannerElement) {
39034
39142
  (_set$getArticleByBask = set.getArticleByBasketId(newArticle.relatedToBasketId)) === null || _set$getArticleByBask === void 0 || _set$getArticleByBask.addPlannerDataAccessoire(plannerElement);
39035
39143
  }
39036
- return _context9.abrupt("return", newArticle);
39144
+ return _context11.abrupt("return", newArticle);
39037
39145
  case 11:
39038
39146
  case "end":
39039
- return _context9.stop();
39147
+ return _context11.stop();
39040
39148
  }
39041
- }, _callee7, this);
39149
+ }, _callee9, this);
39042
39150
  }));
39043
- function addPlannerElement(_x17, _x18, _x19, _x20) {
39151
+ function addPlannerElement(_x20, _x21, _x22, _x23) {
39044
39152
  return _addPlannerElement.apply(this, arguments);
39045
39153
  }
39046
39154
  return addPlannerElement;
@@ -39059,19 +39167,19 @@ var DivaSetHandler = /*#__PURE__*/function () {
39059
39167
  }, {
39060
39168
  key: "movePlannerElement",
39061
39169
  value: (function () {
39062
- var _movePlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(set, elementId, absoluteMoveIndex) {
39063
- return _regeneratorRuntime.wrap(function _callee8$(_context10) {
39064
- while (1) switch (_context10.prev = _context10.next) {
39170
+ var _movePlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(set, elementId, absoluteMoveIndex) {
39171
+ return _regeneratorRuntime.wrap(function _callee10$(_context12) {
39172
+ while (1) switch (_context12.prev = _context12.next) {
39065
39173
  case 0:
39066
- _context10.next = 2;
39174
+ _context12.next = 2;
39067
39175
  return set.plannerHandler.movePlannerElements(set.getSetId(), elementId, absoluteMoveIndex);
39068
39176
  case 2:
39069
39177
  case "end":
39070
- return _context10.stop();
39178
+ return _context12.stop();
39071
39179
  }
39072
- }, _callee8);
39180
+ }, _callee10);
39073
39181
  }));
39074
- function movePlannerElement(_x21, _x22, _x23) {
39182
+ function movePlannerElement(_x24, _x25, _x26) {
39075
39183
  return _movePlannerElement.apply(this, arguments);
39076
39184
  }
39077
39185
  return movePlannerElement;
@@ -39090,10 +39198,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
39090
39198
  }, {
39091
39199
  key: "copyPlannerElement",
39092
39200
  value: (function () {
39093
- var _copyPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(set, elementId, copyInfo) {
39201
+ var _copyPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(set, elementId, copyInfo) {
39094
39202
  var allElementsToCopy, articleCopyRelation, newSelectedArticle, i, newArticle;
39095
- return _regeneratorRuntime.wrap(function _callee9$(_context11) {
39096
- while (1) switch (_context11.prev = _context11.next) {
39203
+ return _regeneratorRuntime.wrap(function _callee11$(_context13) {
39204
+ while (1) switch (_context13.prev = _context13.next) {
39097
39205
  case 0:
39098
39206
  allElementsToCopy = set.plannerHandler.getPlannerElementsInfluencedByCopy(set.getSetId(), elementId, copyInfo);
39099
39207
  articleCopyRelation = []; // array because can be multiple times the same obj
@@ -39101,13 +39209,13 @@ var DivaSetHandler = /*#__PURE__*/function () {
39101
39209
  i = 0;
39102
39210
  case 4:
39103
39211
  if (!(i < allElementsToCopy.length)) {
39104
- _context11.next = 13;
39212
+ _context13.next = 13;
39105
39213
  break;
39106
39214
  }
39107
- _context11.next = 7;
39215
+ _context13.next = 7;
39108
39216
  return this.copyArticleByElementId(set, allElementsToCopy[i]);
39109
39217
  case 7:
39110
- newArticle = _context11.sent;
39218
+ newArticle = _context13.sent;
39111
39219
  if (newSelectedArticle == undefined) newSelectedArticle = newArticle;
39112
39220
  articleCopyRelation.push({
39113
39221
  key: allElementsToCopy[i],
@@ -39115,20 +39223,20 @@ var DivaSetHandler = /*#__PURE__*/function () {
39115
39223
  });
39116
39224
  case 10:
39117
39225
  i++;
39118
- _context11.next = 4;
39226
+ _context13.next = 4;
39119
39227
  break;
39120
39228
  case 13:
39121
- _context11.next = 15;
39229
+ _context13.next = 15;
39122
39230
  return set.plannerHandler.copyPlannerElements(set.getSetId(), articleCopyRelation, copyInfo);
39123
39231
  case 15:
39124
- return _context11.abrupt("return", newSelectedArticle);
39232
+ return _context13.abrupt("return", newSelectedArticle);
39125
39233
  case 16:
39126
39234
  case "end":
39127
- return _context11.stop();
39235
+ return _context13.stop();
39128
39236
  }
39129
- }, _callee9, this);
39237
+ }, _callee11, this);
39130
39238
  }));
39131
- function copyPlannerElement(_x24, _x25, _x26) {
39239
+ function copyPlannerElement(_x27, _x28, _x29) {
39132
39240
  return _copyPlannerElement.apply(this, arguments);
39133
39241
  }
39134
39242
  return copyPlannerElement;
@@ -39188,28 +39296,28 @@ var DivaSetHandler = /*#__PURE__*/function () {
39188
39296
  }, {
39189
39297
  key: "copyArticleByElementId",
39190
39298
  value: (function () {
39191
- var _copyArticleByElementId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(set, elementId, ignoreOptionsToCopy) {
39299
+ var _copyArticleByElementId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(set, elementId, ignoreOptionsToCopy) {
39192
39300
  var origArticle, variantValuesToCopy, i, newArticle;
39193
- return _regeneratorRuntime.wrap(function _callee10$(_context12) {
39194
- while (1) switch (_context12.prev = _context12.next) {
39301
+ return _regeneratorRuntime.wrap(function _callee12$(_context14) {
39302
+ while (1) switch (_context14.prev = _context14.next) {
39195
39303
  case 0:
39196
39304
  origArticle = set.getArticleByElementId(elementId);
39197
39305
  variantValuesToCopy = origArticle.VariantValues;
39198
39306
  if (ignoreOptionsToCopy !== null && ignoreOptionsToCopy !== void 0 && ignoreOptionsToCopy.length) for (i = 0; i < ignoreOptionsToCopy.length; i++) variantValuesToCopy[ignoreOptionsToCopy[i]] = '';
39199
- _context12.next = 5;
39307
+ _context14.next = 5;
39200
39308
  return this.addArticleToActSet(set, set.getArticleCodex(elementId), {
39201
39309
  variantValues: variantValuesToCopy
39202
39310
  }, true);
39203
39311
  case 5:
39204
- newArticle = _context12.sent;
39205
- return _context12.abrupt("return", newArticle);
39312
+ newArticle = _context14.sent;
39313
+ return _context14.abrupt("return", newArticle);
39206
39314
  case 7:
39207
39315
  case "end":
39208
- return _context12.stop();
39316
+ return _context14.stop();
39209
39317
  }
39210
- }, _callee10, this);
39318
+ }, _callee12, this);
39211
39319
  }));
39212
- function copyArticleByElementId(_x27, _x28, _x29) {
39320
+ function copyArticleByElementId(_x30, _x31, _x32) {
39213
39321
  return _copyArticleByElementId.apply(this, arguments);
39214
39322
  }
39215
39323
  return copyArticleByElementId;
@@ -39217,22 +39325,22 @@ var DivaSetHandler = /*#__PURE__*/function () {
39217
39325
  }, {
39218
39326
  key: "resetArticle",
39219
39327
  value: function () {
39220
- var _resetArticle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(set, basketId) {
39328
+ var _resetArticle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(set, basketId) {
39221
39329
  var article;
39222
- return _regeneratorRuntime.wrap(function _callee11$(_context13) {
39223
- while (1) switch (_context13.prev = _context13.next) {
39330
+ return _regeneratorRuntime.wrap(function _callee13$(_context15) {
39331
+ while (1) switch (_context15.prev = _context15.next) {
39224
39332
  case 0:
39225
39333
  article = set.getDivaArticles()[basketId];
39226
39334
  article.clearArticleOptionStates();
39227
- _context13.next = 4;
39335
+ _context15.next = 4;
39228
39336
  return articleHandlerInstance.toDoAfterArticleLoaded(article, {}, {}, 'initializing');
39229
39337
  case 4:
39230
39338
  case "end":
39231
- return _context13.stop();
39339
+ return _context15.stop();
39232
39340
  }
39233
- }, _callee11);
39341
+ }, _callee13);
39234
39342
  }));
39235
- function resetArticle(_x30, _x31) {
39343
+ function resetArticle(_x33, _x34) {
39236
39344
  return _resetArticle.apply(this, arguments);
39237
39345
  }
39238
39346
  return resetArticle;
@@ -39240,7 +39348,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
39240
39348
  }, {
39241
39349
  key: "addArticleToActSet",
39242
39350
  value: function () {
39243
- var _addArticleToActSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(set, articleCodex, initParams, ignorePlanner) {
39351
+ var _addArticleToActSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(set, articleCodex, initParams, ignorePlanner) {
39244
39352
  var from,
39245
39353
  newArticle,
39246
39354
  _set$getArticleByBask2,
@@ -39250,17 +39358,17 @@ var DivaSetHandler = /*#__PURE__*/function () {
39250
39358
  _newArticle$catalogAr,
39251
39359
  rule,
39252
39360
  value,
39253
- _args14 = arguments;
39254
- return _regeneratorRuntime.wrap(function _callee12$(_context14) {
39255
- while (1) switch (_context14.prev = _context14.next) {
39361
+ _args16 = arguments;
39362
+ return _regeneratorRuntime.wrap(function _callee14$(_context16) {
39363
+ while (1) switch (_context16.prev = _context16.next) {
39256
39364
  case 0:
39257
- from = _args14.length > 4 && _args14[4] !== undefined ? _args14[4] : 'initializing';
39258
- _context14.next = 3;
39365
+ from = _args16.length > 4 && _args16[4] !== undefined ? _args16[4] : 'initializing';
39366
+ _context16.next = 3;
39259
39367
  return articleHandlerInstance.loadArticle(set, articleCodex, initParams);
39260
39368
  case 3:
39261
- newArticle = _context14.sent;
39369
+ newArticle = _context16.sent;
39262
39370
  if (newArticle) {
39263
- _context14.next = 6;
39371
+ _context16.next = 6;
39264
39372
  break;
39265
39373
  }
39266
39374
  throw new Error("articleCodex '" + articleCodex + "' not found in article list. Could be due to exclusivity or a bug in the application!");
@@ -39290,11 +39398,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
39290
39398
  }
39291
39399
  }
39292
39400
  if (!(from !== 'toDeleteShelf')) {
39293
- _context14.next = 16;
39401
+ _context16.next = 16;
39294
39402
  break;
39295
39403
  }
39296
39404
  set.addArticle(newArticle);
39297
- _context14.next = 15;
39405
+ _context16.next = 15;
39298
39406
  return articleHandlerInstance.toDoAfterArticleLoaded(newArticle, defaultHeaderValues, {}, from, undefined, ignorePlanner);
39299
39407
  case 15:
39300
39408
  if (newArticle.relatedToBasketId) {
@@ -39313,14 +39421,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
39313
39421
  });
39314
39422
  }
39315
39423
  case 16:
39316
- return _context14.abrupt("return", newArticle);
39424
+ return _context16.abrupt("return", newArticle);
39317
39425
  case 17:
39318
39426
  case "end":
39319
- return _context14.stop();
39427
+ return _context16.stop();
39320
39428
  }
39321
- }, _callee12);
39429
+ }, _callee14);
39322
39430
  }));
39323
- function addArticleToActSet(_x32, _x33, _x34, _x35) {
39431
+ function addArticleToActSet(_x35, _x36, _x37, _x38) {
39324
39432
  return _addArticleToActSet.apply(this, arguments);
39325
39433
  }
39326
39434
  return addArticleToActSet;
@@ -39328,10 +39436,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
39328
39436
  }, {
39329
39437
  key: "updateAccessoireQuantity",
39330
39438
  value: function () {
39331
- var _updateAccessoireQuantity = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(set, accessoireItem, relatedToBasketId, nQuantity, forceConfigSingle) {
39439
+ var _updateAccessoireQuantity = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(set, accessoireItem, relatedToBasketId, nQuantity, forceConfigSingle) {
39332
39440
  var changed3D, somethingChanged, articleCodex, parentArticle, configSingle, _accessoire$quantity, _accessoire, accessoire, curQuantity, delta, newQuantity;
39333
- return _regeneratorRuntime.wrap(function _callee13$(_context15) {
39334
- while (1) switch (_context15.prev = _context15.next) {
39441
+ return _regeneratorRuntime.wrap(function _callee15$(_context17) {
39442
+ while (1) switch (_context17.prev = _context17.next) {
39335
39443
  case 0:
39336
39444
  //Falls das Accessoire bereits existiert nur die Quantity Updaten. Ansonsten das Accessoire neu laden.
39337
39445
  //Falls die Neue Quantity == 0 ist muss es gelöscht werden
@@ -39341,7 +39449,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
39341
39449
  parentArticle = set.getArticleByBasketId(relatedToBasketId);
39342
39450
  configSingle = forceConfigSingle || set.CatalogData.forceConfigAllAccessoires;
39343
39451
  if (!parentArticle) {
39344
- _context15.next = 29;
39452
+ _context17.next = 29;
39345
39453
  break;
39346
39454
  }
39347
39455
  accessoire = parentArticle.getAccessoireByArticleCodex(articleCodex)[0];
@@ -39349,25 +39457,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
39349
39457
  delta = nQuantity - curQuantity;
39350
39458
  newQuantity = !configSingle ? delta : nQuantity;
39351
39459
  if (!(delta + ((_accessoire$quantity = (_accessoire = accessoire) === null || _accessoire === void 0 ? void 0 : _accessoire.quantity) !== null && _accessoire$quantity !== void 0 ? _accessoire$quantity : 0) > 0)) {
39352
- _context15.next = 24;
39460
+ _context17.next = 24;
39353
39461
  break;
39354
39462
  }
39355
39463
  if (!(accessoire == undefined || !configSingle)) {
39356
- _context15.next = 17;
39464
+ _context17.next = 17;
39357
39465
  break;
39358
39466
  }
39359
- _context15.next = 14;
39467
+ _context17.next = 14;
39360
39468
  return this.addArticleToActSet(set, articleCodex, {
39361
39469
  quantity: newQuantity,
39362
39470
  relatedToBasketId: relatedToBasketId,
39363
39471
  notDocking: true
39364
39472
  });
39365
39473
  case 14:
39366
- accessoire = _context15.sent;
39367
- _context15.next = 19;
39474
+ accessoire = _context17.sent;
39475
+ _context17.next = 19;
39368
39476
  break;
39369
39477
  case 17:
39370
- _context15.next = 19;
39478
+ _context17.next = 19;
39371
39479
  return articleHandlerInstance.updateAccessoireQuantity(accessoire, newQuantity);
39372
39480
  case 19:
39373
39481
  if (accessoireItem.isVisualized && !accessoireItem.isPlannerElement) {
@@ -39376,11 +39484,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
39376
39484
  }
39377
39485
  set.giveAccNewPosNrByBasketId(set.getBaseParentArticleOfAccessoire(relatedToBasketId).basketId);
39378
39486
  somethingChanged = true;
39379
- _context15.next = 29;
39487
+ _context17.next = 29;
39380
39488
  break;
39381
39489
  case 24:
39382
39490
  if (!(delta < 0 && accessoire != undefined)) {
39383
- _context15.next = 29;
39491
+ _context17.next = 29;
39384
39492
  break;
39385
39493
  }
39386
39494
  if (accessoireItem.isVisualized && !accessoireItem.isPlannerElement) {
@@ -39388,20 +39496,20 @@ var DivaSetHandler = /*#__PURE__*/function () {
39388
39496
  changed3D = true;
39389
39497
  }
39390
39498
  somethingChanged = true;
39391
- _context15.next = 29;
39499
+ _context17.next = 29;
39392
39500
  return this.deleteElementFromSet(set, accessoire);
39393
39501
  case 29:
39394
- return _context15.abrupt("return", {
39502
+ return _context17.abrupt("return", {
39395
39503
  somethingChanged: somethingChanged,
39396
39504
  changed3D: changed3D
39397
39505
  });
39398
39506
  case 30:
39399
39507
  case "end":
39400
- return _context15.stop();
39508
+ return _context17.stop();
39401
39509
  }
39402
- }, _callee13, this);
39510
+ }, _callee15, this);
39403
39511
  }));
39404
- function updateAccessoireQuantity(_x36, _x37, _x38, _x39, _x40) {
39512
+ function updateAccessoireQuantity(_x39, _x40, _x41, _x42, _x43) {
39405
39513
  return _updateAccessoireQuantity.apply(this, arguments);
39406
39514
  }
39407
39515
  return updateAccessoireQuantity;
@@ -39409,36 +39517,36 @@ var DivaSetHandler = /*#__PURE__*/function () {
39409
39517
  }, {
39410
39518
  key: "deleteElementFromSetByElemId",
39411
39519
  value: function () {
39412
- var _deleteElementFromSetByElemId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(set, elementId, autoCorrectAVL_AVR, deletionType) {
39520
+ var _deleteElementFromSetByElemId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(set, elementId, autoCorrectAVL_AVR, deletionType) {
39413
39521
  var article;
39414
- return _regeneratorRuntime.wrap(function _callee14$(_context16) {
39415
- while (1) switch (_context16.prev = _context16.next) {
39522
+ return _regeneratorRuntime.wrap(function _callee16$(_context18) {
39523
+ while (1) switch (_context18.prev = _context18.next) {
39416
39524
  case 0:
39417
39525
  if (!set) {
39418
- _context16.next = 6;
39526
+ _context18.next = 6;
39419
39527
  break;
39420
39528
  }
39421
39529
  article = set.getArticleByElementId(elementId);
39422
39530
  if (!article) {
39423
- _context16.next = 6;
39531
+ _context18.next = 6;
39424
39532
  break;
39425
39533
  }
39426
- _context16.next = 5;
39534
+ _context18.next = 5;
39427
39535
  return this.deleteElementFromSet(set, article, autoCorrectAVL_AVR, deletionType);
39428
39536
  case 5:
39429
- return _context16.abrupt("return", _context16.sent);
39537
+ return _context18.abrupt("return", _context18.sent);
39430
39538
  case 6:
39431
- return _context16.abrupt("return", {
39539
+ return _context18.abrupt("return", {
39432
39540
  success: false,
39433
39541
  setId: set.getSetId()
39434
39542
  });
39435
39543
  case 7:
39436
39544
  case "end":
39437
- return _context16.stop();
39545
+ return _context18.stop();
39438
39546
  }
39439
- }, _callee14, this);
39547
+ }, _callee16, this);
39440
39548
  }));
39441
- function deleteElementFromSetByElemId(_x41, _x42, _x43, _x44) {
39549
+ function deleteElementFromSetByElemId(_x44, _x45, _x46, _x47) {
39442
39550
  return _deleteElementFromSetByElemId.apply(this, arguments);
39443
39551
  }
39444
39552
  return deleteElementFromSetByElemId;
@@ -39446,18 +39554,18 @@ var DivaSetHandler = /*#__PURE__*/function () {
39446
39554
  }, {
39447
39555
  key: "deleteElementFromSet",
39448
39556
  value: function () {
39449
- var _deleteElementFromSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(set, article, autoCorrectAVL_AVR, deletionType, dontReload, dontCheckInfluencedPlannerElements) {
39557
+ var _deleteElementFromSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(set, article, autoCorrectAVL_AVR, deletionType, dontReload, dontCheckInfluencedPlannerElements) {
39450
39558
  var _deletedArticle$doorP, _set$CatalogData;
39451
39559
  var setId, success, newSelectedElement, allElementsToDelete, i, art, deletedArticle, articles, key, oldTransform, result, _set$getArticleByBask3;
39452
- return _regeneratorRuntime.wrap(function _callee15$(_context17) {
39453
- while (1) switch (_context17.prev = _context17.next) {
39560
+ return _regeneratorRuntime.wrap(function _callee17$(_context19) {
39561
+ while (1) switch (_context19.prev = _context19.next) {
39454
39562
  case 0:
39455
39563
  setId = set.getSetId();
39456
39564
  if (!(set == undefined)) {
39457
- _context17.next = 3;
39565
+ _context19.next = 3;
39458
39566
  break;
39459
39567
  }
39460
- return _context17.abrupt("return", {
39568
+ return _context19.abrupt("return", {
39461
39569
  success: false,
39462
39570
  selectElementId: undefined,
39463
39571
  setId: setId
@@ -39466,49 +39574,49 @@ var DivaSetHandler = /*#__PURE__*/function () {
39466
39574
  success = false;
39467
39575
  newSelectedElement = undefined;
39468
39576
  if (dontCheckInfluencedPlannerElements) {
39469
- _context17.next = 15;
39577
+ _context19.next = 15;
39470
39578
  break;
39471
39579
  }
39472
39580
  allElementsToDelete = set.plannerHandler.getPlannerElementsInfluencedByDeletion(setId, article.elementId, deletionType);
39473
39581
  i = 0;
39474
39582
  case 8:
39475
39583
  if (!(i < allElementsToDelete.length)) {
39476
- _context17.next = 15;
39584
+ _context19.next = 15;
39477
39585
  break;
39478
39586
  }
39479
39587
  art = set.getArticleByElementId(allElementsToDelete[i]);
39480
- _context17.next = 12;
39588
+ _context19.next = 12;
39481
39589
  return this.deleteElementFromSet(set, art, undefined, 'STD_DONTUPDATE', true, true);
39482
39590
  case 12:
39483
39591
  i++;
39484
- _context17.next = 8;
39592
+ _context19.next = 8;
39485
39593
  break;
39486
39594
  case 15:
39487
39595
  deletedArticle = article; //accessoires löschen
39488
39596
  articles = set.getAccessoiresOfBasketId(article.basketId);
39489
- _context17.t0 = _regeneratorRuntime.keys(articles);
39597
+ _context19.t0 = _regeneratorRuntime.keys(articles);
39490
39598
  case 18:
39491
- if ((_context17.t1 = _context17.t0()).done) {
39492
- _context17.next = 24;
39599
+ if ((_context19.t1 = _context19.t0()).done) {
39600
+ _context19.next = 24;
39493
39601
  break;
39494
39602
  }
39495
- key = _context17.t1.value;
39496
- _context17.next = 22;
39603
+ key = _context19.t1.value;
39604
+ _context19.next = 22;
39497
39605
  return this.deleteElementFromSet(set, articles[key], undefined, undefined, true);
39498
39606
  case 22:
39499
- _context17.next = 18;
39607
+ _context19.next = 18;
39500
39608
  break;
39501
39609
  case 24:
39502
39610
  oldTransform = undefined;
39503
39611
  if (deletedArticle) deletedArticle.deleted = true;
39504
39612
  if (!(deletedArticle !== null && deletedArticle !== void 0 && deletedArticle.hasCatalogPlannerArticle)) {
39505
- _context17.next = 32;
39613
+ _context19.next = 32;
39506
39614
  break;
39507
39615
  }
39508
- _context17.next = 29;
39616
+ _context19.next = 29;
39509
39617
  return set.plannerHandler.deletePlannerElement(setId, deletedArticle.elementId, autoCorrectAVL_AVR, deletionType);
39510
39618
  case 29:
39511
- result = _context17.sent;
39619
+ result = _context19.sent;
39512
39620
  newSelectedElement = result.newElementToSelect;
39513
39621
  oldTransform = result.transform;
39514
39622
  case 32:
@@ -39521,13 +39629,13 @@ var DivaSetHandler = /*#__PURE__*/function () {
39521
39629
  deletedArticle === null || deletedArticle === void 0 || (_deletedArticle$doorP = deletedArticle.doorPlanner) === null || _deletedArticle$doorP === void 0 || _deletedArticle$doorP.deleteElement(deletedArticle.basketId);
39522
39630
  success = set.deleteArticle(article.basketId);
39523
39631
  if (!((set.CatalogData.bundleRules || set.CatalogData.reconfigAfterArticleDocked || set !== null && set !== void 0 && (_set$CatalogData = set.CatalogData) !== null && _set$CatalogData !== void 0 && _set$CatalogData.getOption('OPTLASTSTACKEDARTICLE')) && !dontReload)) {
39524
- _context17.next = 38;
39632
+ _context19.next = 38;
39525
39633
  break;
39526
39634
  }
39527
- _context17.next = 38;
39635
+ _context19.next = 38;
39528
39636
  return this.updateArticlesOptionStatesOfActSet(set, {}, []);
39529
39637
  case 38:
39530
- return _context17.abrupt("return", {
39638
+ return _context19.abrupt("return", {
39531
39639
  success: success,
39532
39640
  selectElementId: newSelectedElement,
39533
39641
  setId: setId,
@@ -39535,11 +39643,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
39535
39643
  });
39536
39644
  case 39:
39537
39645
  case "end":
39538
- return _context17.stop();
39646
+ return _context19.stop();
39539
39647
  }
39540
- }, _callee15, this);
39648
+ }, _callee17, this);
39541
39649
  }));
39542
- function deleteElementFromSet(_x45, _x46, _x47, _x48, _x49, _x50) {
39650
+ function deleteElementFromSet(_x48, _x49, _x50, _x51, _x52, _x53) {
39543
39651
  return _deleteElementFromSet.apply(this, arguments);
39544
39652
  }
39545
39653
  return deleteElementFromSet;
@@ -39547,22 +39655,22 @@ var DivaSetHandler = /*#__PURE__*/function () {
39547
39655
  }, {
39548
39656
  key: "addAccessorieOnShelfPlanner",
39549
39657
  value: function () {
39550
- var _addAccessorieOnShelfPlanner = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(set, gridIndex, cellIndex, parentBasketId, params) {
39658
+ var _addAccessorieOnShelfPlanner = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(set, gridIndex, cellIndex, parentBasketId, params) {
39551
39659
  var parentArticle, articleCodex, accessoire, doesFit;
39552
- return _regeneratorRuntime.wrap(function _callee16$(_context18) {
39553
- while (1) switch (_context18.prev = _context18.next) {
39660
+ return _regeneratorRuntime.wrap(function _callee18$(_context20) {
39661
+ while (1) switch (_context20.prev = _context20.next) {
39554
39662
  case 0:
39555
39663
  parentArticle = set.getArticleByBasketId(parentBasketId);
39556
39664
  if (!(parentArticle !== null && parentArticle !== void 0 && parentArticle.shelfPlanner)) {
39557
- _context18.next = 24;
39665
+ _context20.next = 24;
39558
39666
  break;
39559
39667
  }
39560
39668
  articleCodex = parentArticle.shelfPlanner.getActAccessoireOfGrid(gridIndex);
39561
39669
  if (!articleCodex) {
39562
- _context18.next = 24;
39670
+ _context20.next = 24;
39563
39671
  break;
39564
39672
  }
39565
- _context18.next = 6;
39673
+ _context20.next = 6;
39566
39674
  return this.addArticleToActSet(set, articleCodex, {
39567
39675
  relatedToBasketId: parentBasketId,
39568
39676
  relatedToShelf: parentBasketId,
@@ -39570,52 +39678,52 @@ var DivaSetHandler = /*#__PURE__*/function () {
39570
39678
  partlistCodexToInit: params === null || params === void 0 ? void 0 : params.partlistCodexToInit
39571
39679
  });
39572
39680
  case 6:
39573
- accessoire = _context18.sent;
39681
+ accessoire = _context20.sent;
39574
39682
  doesFit = parentArticle.shelfPlanner.tryFitOnShelfOfGrid(gridIndex, cellIndex, accessoire);
39575
39683
  if (!(doesFit !== false && doesFit.type != 'doesNotFit' && doesFit.type != 'notAllowedByParentRule' && doesFit.type != 'notAllowedByAccessoireRule' && doesFit.type != 'notAllowedByMaxQuantityReached' && doesFit.index !== undefined)) {
39576
- _context18.next = 20;
39684
+ _context20.next = 20;
39577
39685
  break;
39578
39686
  }
39579
- _context18.next = 11;
39687
+ _context20.next = 11;
39580
39688
  return parentArticle.shelfPlanner.addAccessoireInCellInGrid(accessoire, gridIndex, doesFit.index, doesFit.type, params);
39581
39689
  case 11:
39582
39690
  set.giveAccNewPosNrByBasketId(set.getBaseParentArticleOfAccessoire(parentBasketId).basketId);
39583
39691
  if (!parentArticle.shelfPlanner.allMontageOptions.length) {
39584
- _context18.next = 15;
39692
+ _context20.next = 15;
39585
39693
  break;
39586
39694
  }
39587
- _context18.next = 15;
39695
+ _context20.next = 15;
39588
39696
  return this.updateArticlesOptionStatesOfActSet(set, {}, [parentArticle.basketId], true, 'initializing');
39589
39697
  case 15:
39590
39698
  if (params !== null && params !== void 0 && params.byInit) {
39591
- _context18.next = 18;
39699
+ _context20.next = 18;
39592
39700
  break;
39593
39701
  }
39594
- _context18.next = 18;
39702
+ _context20.next = 18;
39595
39703
  return parentArticle.shelfPlanner.onConfigChanged({});
39596
39704
  case 18:
39597
- _context18.next = 22;
39705
+ _context20.next = 22;
39598
39706
  break;
39599
39707
  case 20:
39600
- _context18.next = 22;
39708
+ _context20.next = 22;
39601
39709
  return this.deleteElementFromSet(set, accessoire);
39602
39710
  case 22:
39603
39711
  if (!(doesFit !== false)) {
39604
- _context18.next = 24;
39712
+ _context20.next = 24;
39605
39713
  break;
39606
39714
  }
39607
- return _context18.abrupt("return", _objectSpread$c(_objectSpread$c({}, doesFit), {}, {
39715
+ return _context20.abrupt("return", _objectSpread$c(_objectSpread$c({}, doesFit), {}, {
39608
39716
  accessoire: accessoire
39609
39717
  }));
39610
39718
  case 24:
39611
- return _context18.abrupt("return", false);
39719
+ return _context20.abrupt("return", false);
39612
39720
  case 25:
39613
39721
  case "end":
39614
- return _context18.stop();
39722
+ return _context20.stop();
39615
39723
  }
39616
- }, _callee16, this);
39724
+ }, _callee18, this);
39617
39725
  }));
39618
- function addAccessorieOnShelfPlanner(_x51, _x52, _x53, _x54, _x55) {
39726
+ function addAccessorieOnShelfPlanner(_x54, _x55, _x56, _x57, _x58) {
39619
39727
  return _addAccessorieOnShelfPlanner.apply(this, arguments);
39620
39728
  }
39621
39729
  return addAccessorieOnShelfPlanner;
@@ -39623,29 +39731,29 @@ var DivaSetHandler = /*#__PURE__*/function () {
39623
39731
  }, {
39624
39732
  key: "moveShelfItem",
39625
39733
  value: function () {
39626
- var _moveShelfItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(set, grid, initialIndex, finalIndex) {
39734
+ var _moveShelfItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(set, grid, initialIndex, finalIndex) {
39627
39735
  var article;
39628
- return _regeneratorRuntime.wrap(function _callee17$(_context19) {
39629
- while (1) switch (_context19.prev = _context19.next) {
39736
+ return _regeneratorRuntime.wrap(function _callee19$(_context21) {
39737
+ while (1) switch (_context21.prev = _context21.next) {
39630
39738
  case 0:
39631
39739
  article = set.getArticleByBasketId(grid.basketId);
39632
39740
  if (!(article && article.shelfPlanner)) {
39633
- _context19.next = 5;
39741
+ _context21.next = 5;
39634
39742
  break;
39635
39743
  }
39636
- _context19.next = 4;
39744
+ _context21.next = 4;
39637
39745
  return article.shelfPlanner.grids[grid.ShelfIndex].moveCell(initialIndex, finalIndex);
39638
39746
  case 4:
39639
- return _context19.abrupt("return", _context19.sent);
39747
+ return _context21.abrupt("return", _context21.sent);
39640
39748
  case 5:
39641
- return _context19.abrupt("return", 'NOTHING_CHANGED');
39749
+ return _context21.abrupt("return", 'NOTHING_CHANGED');
39642
39750
  case 6:
39643
39751
  case "end":
39644
- return _context19.stop();
39752
+ return _context21.stop();
39645
39753
  }
39646
- }, _callee17);
39754
+ }, _callee19);
39647
39755
  }));
39648
- function moveShelfItem(_x56, _x57, _x58, _x59) {
39756
+ function moveShelfItem(_x59, _x60, _x61, _x62) {
39649
39757
  return _moveShelfItem.apply(this, arguments);
39650
39758
  }
39651
39759
  return moveShelfItem;
@@ -39666,11 +39774,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
39666
39774
  }, {
39667
39775
  key: "getFreeShelfGrids",
39668
39776
  value: function () {
39669
- var _getFreeShelfGrids = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(set, gridGroup) {
39777
+ var _getFreeShelfGrids = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20(set, gridGroup) {
39670
39778
  var _article$shelfPlanner;
39671
39779
  var articles, article, articleCodex, accessoire, ret;
39672
- return _regeneratorRuntime.wrap(function _callee18$(_context20) {
39673
- while (1) switch (_context20.prev = _context20.next) {
39780
+ return _regeneratorRuntime.wrap(function _callee20$(_context22) {
39781
+ while (1) switch (_context22.prev = _context22.next) {
39674
39782
  case 0:
39675
39783
  articles = set.getDivaArticlesByGridGroup(gridGroup);
39676
39784
  article = Object.values(articles).find(function (a) {
@@ -39679,38 +39787,38 @@ var DivaSetHandler = /*#__PURE__*/function () {
39679
39787
  });
39680
39788
  articleCodex = article === null || article === void 0 || (_article$shelfPlanner = article.shelfPlanner) === null || _article$shelfPlanner === void 0 ? void 0 : _article$shelfPlanner.getSelectedAccessoireById(gridGroup);
39681
39789
  if (!(!article || !articleCodex)) {
39682
- _context20.next = 5;
39790
+ _context22.next = 5;
39683
39791
  break;
39684
39792
  }
39685
- return _context20.abrupt("return", undefined);
39793
+ return _context22.abrupt("return", undefined);
39686
39794
  case 5:
39687
- _context20.next = 7;
39795
+ _context22.next = 7;
39688
39796
  return this.addArticleToActSet(set, articleCodex, {
39689
39797
  relatedToBasketId: article.basketId,
39690
39798
  relatedToShelf: article.basketId,
39691
39799
  relatedToShelfGrid: 0
39692
39800
  }, false, 'toDeleteShelf');
39693
39801
  case 7:
39694
- accessoire = _context20.sent;
39695
- _context20.next = 10;
39802
+ accessoire = _context22.sent;
39803
+ _context22.next = 10;
39696
39804
  return accessoire.updateShelfPlannerState({});
39697
39805
  case 10:
39698
39806
  articleHandlerInstance.initCfgValues(accessoire, {});
39699
- _context20.next = 13;
39807
+ _context22.next = 13;
39700
39808
  return articleHandlerInstance.updateCfgValues(accessoire, {}, {}, true, true);
39701
39809
  case 13:
39702
39810
  ret = this.getFreePlaces(gridGroup, articles, accessoire);
39703
- _context20.next = 16;
39811
+ _context22.next = 16;
39704
39812
  return this.deleteElementFromSet(set, accessoire, undefined, undefined, true);
39705
39813
  case 16:
39706
- return _context20.abrupt("return", ret);
39814
+ return _context22.abrupt("return", ret);
39707
39815
  case 17:
39708
39816
  case "end":
39709
- return _context20.stop();
39817
+ return _context22.stop();
39710
39818
  }
39711
- }, _callee18, this);
39819
+ }, _callee20, this);
39712
39820
  }));
39713
- function getFreeShelfGrids(_x60, _x61) {
39821
+ function getFreeShelfGrids(_x63, _x64) {
39714
39822
  return _getFreeShelfGrids.apply(this, arguments);
39715
39823
  }
39716
39824
  return getFreeShelfGrids;
@@ -39769,62 +39877,62 @@ var DivaSetHandler = /*#__PURE__*/function () {
39769
39877
  }, {
39770
39878
  key: "moveShelfItemToGrid",
39771
39879
  value: function () {
39772
- var _moveShelfItemToGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(set, accessoireBasketId, parentBasketId, gridName, cellIndex) {
39880
+ var _moveShelfItemToGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21(set, accessoireBasketId, parentBasketId, gridName, cellIndex) {
39773
39881
  var _oldGrid$Cells$find;
39774
39882
  var artices, accessoire, oldParent, newParent, oldGrid, newGrid, index;
39775
- return _regeneratorRuntime.wrap(function _callee19$(_context21) {
39776
- while (1) switch (_context21.prev = _context21.next) {
39883
+ return _regeneratorRuntime.wrap(function _callee21$(_context23) {
39884
+ while (1) switch (_context23.prev = _context23.next) {
39777
39885
  case 0:
39778
39886
  artices = set.getDivaArticles();
39779
39887
  accessoire = artices[accessoireBasketId];
39780
39888
  oldParent = accessoire.accessoireParentArticle;
39781
39889
  newParent = artices[parentBasketId];
39782
39890
  if (!(accessoire.relatedToShelfGrid === undefined)) {
39783
- _context21.next = 6;
39891
+ _context23.next = 6;
39784
39892
  break;
39785
39893
  }
39786
- return _context21.abrupt("return");
39894
+ return _context23.abrupt("return");
39787
39895
  case 6:
39788
39896
  if (oldParent !== null && oldParent !== void 0 && oldParent.shelfPlanner) {
39789
- _context21.next = 8;
39897
+ _context23.next = 8;
39790
39898
  break;
39791
39899
  }
39792
- return _context21.abrupt("return");
39900
+ return _context23.abrupt("return");
39793
39901
  case 8:
39794
39902
  if (newParent !== null && newParent !== void 0 && newParent.shelfPlanner) {
39795
- _context21.next = 10;
39903
+ _context23.next = 10;
39796
39904
  break;
39797
39905
  }
39798
- return _context21.abrupt("return");
39906
+ return _context23.abrupt("return");
39799
39907
  case 10:
39800
39908
  oldGrid = oldParent.shelfPlanner.getGridByIndex(accessoire.relatedToShelfGrid);
39801
39909
  newGrid = newParent.shelfPlanner.getGridByGridName(gridName);
39802
39910
  if (oldGrid) {
39803
- _context21.next = 14;
39911
+ _context23.next = 14;
39804
39912
  break;
39805
39913
  }
39806
- return _context21.abrupt("return");
39914
+ return _context23.abrupt("return");
39807
39915
  case 14:
39808
39916
  if (newGrid) {
39809
- _context21.next = 16;
39917
+ _context23.next = 16;
39810
39918
  break;
39811
39919
  }
39812
- return _context21.abrupt("return");
39920
+ return _context23.abrupt("return");
39813
39921
  case 16:
39814
39922
  index = oldGrid === null || oldGrid === void 0 || (_oldGrid$Cells$find = oldGrid.Cells.find(function (c, i) {
39815
39923
  var _c$Article;
39816
39924
  return c.Index === c.InUse && ((_c$Article = c.Article) === null || _c$Article === void 0 ? void 0 : _c$Article.basketId) == accessoire.basketId;
39817
39925
  })) === null || _oldGrid$Cells$find === void 0 ? void 0 : _oldGrid$Cells$find.Index;
39818
39926
  if (!(index === undefined)) {
39819
- _context21.next = 19;
39927
+ _context23.next = 19;
39820
39928
  break;
39821
39929
  }
39822
- return _context21.abrupt("return");
39930
+ return _context23.abrupt("return");
39823
39931
  case 19:
39824
- _context21.next = 21;
39932
+ _context23.next = 21;
39825
39933
  return oldParent.shelfPlanner.deleteAccessoireOfCellInGrid(accessoire.relatedToShelfGrid, index);
39826
39934
  case 21:
39827
- _context21.next = 23;
39935
+ _context23.next = 23;
39828
39936
  return newParent.shelfPlanner.addAccessoireInCellInGrid(accessoire, newGrid.ShelfIndex, cellIndex, 'fitsOn');
39829
39937
  case 23:
39830
39938
  accessoire.relatedToShelfGrid = newGrid.ShelfIndex;
@@ -39836,17 +39944,17 @@ var DivaSetHandler = /*#__PURE__*/function () {
39836
39944
  set.giveAccNewPosNrByBasketId(set.getBaseParentArticleOfAccessoire(oldParent.basketId).basketId);
39837
39945
  }
39838
39946
  set.giveAccNewPosNrByBasketId(set.getBaseParentArticleOfAccessoire(newParent.basketId).basketId);
39839
- _context21.next = 28;
39947
+ _context23.next = 28;
39840
39948
  return this.updateArticlesOptionStatesOfActSet(set, {}, [oldParent.basketId, newParent.basketId]);
39841
39949
  case 28:
39842
- return _context21.abrupt("return", newGrid.getGridIdByArticleCodex(accessoire.articleCodex));
39950
+ return _context23.abrupt("return", newGrid.getGridIdByArticleCodex(accessoire.articleCodex));
39843
39951
  case 29:
39844
39952
  case "end":
39845
- return _context21.stop();
39953
+ return _context23.stop();
39846
39954
  }
39847
- }, _callee19, this);
39955
+ }, _callee21, this);
39848
39956
  }));
39849
- function moveShelfItemToGrid(_x62, _x63, _x64, _x65, _x66) {
39957
+ function moveShelfItemToGrid(_x65, _x66, _x67, _x68, _x69) {
39850
39958
  return _moveShelfItemToGrid.apply(this, arguments);
39851
39959
  }
39852
39960
  return moveShelfItemToGrid;
@@ -39854,33 +39962,33 @@ var DivaSetHandler = /*#__PURE__*/function () {
39854
39962
  }, {
39855
39963
  key: "deleteAccessorieOnShelfPlanner",
39856
39964
  value: function () {
39857
- var _deleteAccessorieOnShelfPlanner = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20(set, gridIndex, cellIndex, parentBasketId, dontReload) {
39965
+ var _deleteAccessorieOnShelfPlanner = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22(set, gridIndex, cellIndex, parentBasketId, dontReload) {
39858
39966
  var _parentArticle$shelfP2;
39859
39967
  var parentArticle, articeToDelete, _parentArticle$shelfP3;
39860
- return _regeneratorRuntime.wrap(function _callee20$(_context22) {
39861
- while (1) switch (_context22.prev = _context22.next) {
39968
+ return _regeneratorRuntime.wrap(function _callee22$(_context24) {
39969
+ while (1) switch (_context24.prev = _context24.next) {
39862
39970
  case 0:
39863
39971
  parentArticle = set.getArticleByBasketId(parentBasketId);
39864
- _context22.next = 3;
39972
+ _context24.next = 3;
39865
39973
  return parentArticle === null || parentArticle === void 0 || (_parentArticle$shelfP2 = parentArticle.shelfPlanner) === null || _parentArticle$shelfP2 === void 0 ? void 0 : _parentArticle$shelfP2.deleteAccessoireOfCellInGrid(gridIndex, cellIndex);
39866
39974
  case 3:
39867
- articeToDelete = _context22.sent;
39975
+ articeToDelete = _context24.sent;
39868
39976
  if (!articeToDelete) {
39869
- _context22.next = 9;
39977
+ _context24.next = 9;
39870
39978
  break;
39871
39979
  }
39872
- _context22.next = 7;
39980
+ _context24.next = 7;
39873
39981
  return this.deleteElementFromSet(set, articeToDelete, false, undefined, dontReload);
39874
39982
  case 7:
39875
- _context22.next = 9;
39983
+ _context24.next = 9;
39876
39984
  return parentArticle === null || parentArticle === void 0 || (_parentArticle$shelfP3 = parentArticle.shelfPlanner) === null || _parentArticle$shelfP3 === void 0 ? void 0 : _parentArticle$shelfP3.onConfigChanged({});
39877
39985
  case 9:
39878
39986
  case "end":
39879
- return _context22.stop();
39987
+ return _context24.stop();
39880
39988
  }
39881
- }, _callee20, this);
39989
+ }, _callee22, this);
39882
39990
  }));
39883
- function deleteAccessorieOnShelfPlanner(_x67, _x68, _x69, _x70, _x71) {
39991
+ function deleteAccessorieOnShelfPlanner(_x70, _x71, _x72, _x73, _x74) {
39884
39992
  return _deleteAccessorieOnShelfPlanner.apply(this, arguments);
39885
39993
  }
39886
39994
  return deleteAccessorieOnShelfPlanner;
@@ -39888,25 +39996,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
39888
39996
  }, {
39889
39997
  key: "updatePlannerTrans",
39890
39998
  value: function () {
39891
- var _updatePlannerTrans = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21(set, plannerElementID, deltaMove, deltaAngleDeg, rotCorrection, transState, autoDockingDistance) {
39999
+ var _updatePlannerTrans = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(set, plannerElementID, deltaMove, deltaAngleDeg, rotCorrection, transState, autoDockingDistance) {
39892
40000
  var updateConfig;
39893
- return _regeneratorRuntime.wrap(function _callee21$(_context23) {
39894
- while (1) switch (_context23.prev = _context23.next) {
40001
+ return _regeneratorRuntime.wrap(function _callee23$(_context25) {
40002
+ while (1) switch (_context25.prev = _context25.next) {
39895
40003
  case 0:
39896
40004
  updateConfig = set.plannerHandler.updatePlannerTrans(set.getSetId(), plannerElementID, deltaMove, deltaAngleDeg, rotCorrection, transState, autoDockingDistance);
39897
40005
  if (!updateConfig) {
39898
- _context23.next = 4;
40006
+ _context25.next = 4;
39899
40007
  break;
39900
40008
  }
39901
- _context23.next = 4;
40009
+ _context25.next = 4;
39902
40010
  return this.updateArticlesOptionStatesOfActSet(set, {}, [], true, 'initializingAfterTrans');
39903
40011
  case 4:
39904
40012
  case "end":
39905
- return _context23.stop();
40013
+ return _context25.stop();
39906
40014
  }
39907
- }, _callee21, this);
40015
+ }, _callee23, this);
39908
40016
  }));
39909
- function updatePlannerTrans(_x72, _x73, _x74, _x75, _x76, _x77, _x78) {
40017
+ function updatePlannerTrans(_x75, _x76, _x77, _x78, _x79, _x80, _x81) {
39910
40018
  return _updatePlannerTrans.apply(this, arguments);
39911
40019
  }
39912
40020
  return updatePlannerTrans;
@@ -39988,10 +40096,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
39988
40096
  }, {
39989
40097
  key: "deleteAccessoire",
39990
40098
  value: function () {
39991
- var _deleteAccessoire = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22(set, articleCodex, parentBasketId) {
40099
+ var _deleteAccessoire = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24(set, articleCodex, parentBasketId) {
39992
40100
  var divaArticles, articlesToDelete, key, articleToDelete, maxQuantity, i;
39993
- return _regeneratorRuntime.wrap(function _callee22$(_context24) {
39994
- while (1) switch (_context24.prev = _context24.next) {
40101
+ return _regeneratorRuntime.wrap(function _callee24$(_context26) {
40102
+ while (1) switch (_context26.prev = _context26.next) {
39995
40103
  case 0:
39996
40104
  divaArticles = set.getDivaArticles();
39997
40105
  articlesToDelete = [];
@@ -40003,7 +40111,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
40003
40111
  }
40004
40112
  }
40005
40113
  if (!(articlesToDelete.length > 0)) {
40006
- _context24.next = 17;
40114
+ _context26.next = 17;
40007
40115
  break;
40008
40116
  }
40009
40117
  articlesToDelete.sort(function (a, b) {
@@ -40017,27 +40125,27 @@ var DivaSetHandler = /*#__PURE__*/function () {
40017
40125
  }
40018
40126
  }
40019
40127
  if (!(articleToDelete.quantity > 1)) {
40020
- _context24.next = 14;
40128
+ _context26.next = 14;
40021
40129
  break;
40022
40130
  }
40023
- _context24.next = 11;
40131
+ _context26.next = 11;
40024
40132
  return articleHandlerInstance.updateAccessoireQuantity(articleToDelete, articleToDelete.quantity - 1);
40025
40133
  case 11:
40026
- return _context24.abrupt("return", true);
40134
+ return _context26.abrupt("return", true);
40027
40135
  case 14:
40028
- _context24.next = 16;
40136
+ _context26.next = 16;
40029
40137
  return this.deleteElementFromSet(articleToDelete.set, articleToDelete);
40030
40138
  case 16:
40031
- return _context24.abrupt("return", _context24.sent);
40139
+ return _context26.abrupt("return", _context26.sent);
40032
40140
  case 17:
40033
- return _context24.abrupt("return", false);
40141
+ return _context26.abrupt("return", false);
40034
40142
  case 18:
40035
40143
  case "end":
40036
- return _context24.stop();
40144
+ return _context26.stop();
40037
40145
  }
40038
- }, _callee22, this);
40146
+ }, _callee24, this);
40039
40147
  }));
40040
- function deleteAccessoire(_x79, _x80, _x81) {
40148
+ function deleteAccessoire(_x82, _x83, _x84) {
40041
40149
  return _deleteAccessoire.apply(this, arguments);
40042
40150
  }
40043
40151
  return deleteAccessoire;
@@ -40214,19 +40322,19 @@ var DivaSetHandler = /*#__PURE__*/function () {
40214
40322
  }, {
40215
40323
  key: "configSingleIsChanged",
40216
40324
  value: (function () {
40217
- var _configSingleIsChanged = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(set, newIsConfigSingle, groupedOptions, groupedArticles) {
40325
+ var _configSingleIsChanged = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25(set, newIsConfigSingle, groupedOptions, groupedArticles) {
40218
40326
  var _set$getArticleByBask4, variantValues, key;
40219
- return _regeneratorRuntime.wrap(function _callee23$(_context25) {
40220
- while (1) switch (_context25.prev = _context25.next) {
40327
+ return _regeneratorRuntime.wrap(function _callee25$(_context27) {
40328
+ while (1) switch (_context27.prev = _context27.next) {
40221
40329
  case 0:
40222
40330
  set.configSingle = newIsConfigSingle;
40223
40331
  if (!(!set.configSingle && !set.CatalogData.onConfigSingleDontGeneralize && groupedOptions && groupedArticles)) {
40224
- _context25.next = 7;
40332
+ _context27.next = 7;
40225
40333
  break;
40226
40334
  }
40227
40335
  variantValues = (_set$getArticleByBask4 = set.getArticleByBasketId(groupedArticles[0])) === null || _set$getArticleByBask4 === void 0 ? void 0 : _set$getArticleByBask4.VariantValues;
40228
40336
  if (!variantValues) {
40229
- _context25.next = 7;
40337
+ _context27.next = 7;
40230
40338
  break;
40231
40339
  }
40232
40340
  for (key in variantValues) {
@@ -40234,15 +40342,15 @@ var DivaSetHandler = /*#__PURE__*/function () {
40234
40342
  delete variantValues[key];
40235
40343
  }
40236
40344
  }
40237
- _context25.next = 7;
40345
+ _context27.next = 7;
40238
40346
  return this.updateArticlesOptionStatesOfActSet(set, variantValues, groupedArticles);
40239
40347
  case 7:
40240
40348
  case "end":
40241
- return _context25.stop();
40349
+ return _context27.stop();
40242
40350
  }
40243
- }, _callee23, this);
40351
+ }, _callee25, this);
40244
40352
  }));
40245
- function configSingleIsChanged(_x82, _x83, _x84, _x85) {
40353
+ function configSingleIsChanged(_x85, _x86, _x87, _x88) {
40246
40354
  return _configSingleIsChanged.apply(this, arguments);
40247
40355
  }
40248
40356
  return configSingleIsChanged;
@@ -40342,28 +40450,28 @@ var DivaSetHandler = /*#__PURE__*/function () {
40342
40450
  }, {
40343
40451
  key: "loadConfigItemsOfActSetByConfigStepKey",
40344
40452
  value: function () {
40345
- var _loadConfigItemsOfActSetByConfigStepKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24(set, configStepKey, visible, hidePricePreview) {
40453
+ var _loadConfigItemsOfActSetByConfigStepKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26(set, configStepKey, visible, hidePricePreview) {
40346
40454
  var _configItems$option, _configItems$option2, _configItems$option3, _configItems$option4;
40347
40455
  var configItems, paletteType, filterType, stepInfo, contentItemId, contentItemTeaser, description;
40348
- return _regeneratorRuntime.wrap(function _callee24$(_context26) {
40349
- while (1) switch (_context26.prev = _context26.next) {
40456
+ return _regeneratorRuntime.wrap(function _callee26$(_context28) {
40457
+ while (1) switch (_context28.prev = _context28.next) {
40350
40458
  case 0:
40351
- _context26.next = 2;
40459
+ _context28.next = 2;
40352
40460
  return configTreeHandler.getConifgItemsForView(set, configStepKey);
40353
40461
  case 2:
40354
- configItems = _context26.sent;
40462
+ configItems = _context28.sent;
40355
40463
  paletteType = set.configTree.getCurPaletteType(set, configStepKey);
40356
40464
  configItems.configItems = this.removeDockingInfluencableconfigItems(set, configItems.configItems, configStepKey);
40357
- _context26.next = 7;
40465
+ _context28.next = 7;
40358
40466
  return this.variantsEvaluator(set, configItems.configItems, configStepKey, paletteType, hidePricePreview);
40359
40467
  case 7:
40360
- configItems.configItems = _context26.sent;
40468
+ configItems.configItems = _context28.sent;
40361
40469
  filterType = set.configTree.getCurFilterType(configStepKey, configItems.configItems);
40362
40470
  stepInfo = set.configTree.getStepInfo(configStepKey);
40363
40471
  contentItemId = (_configItems$option = configItems.option) === null || _configItems$option === void 0 ? void 0 : _configItems$option.contentItemId;
40364
40472
  contentItemTeaser = (_configItems$option2 = configItems.option) === null || _configItems$option2 === void 0 ? void 0 : _configItems$option2.contentItemTeaser;
40365
40473
  description = (_configItems$option3 = configItems.option) === null || _configItems$option3 === void 0 ? void 0 : _configItems$option3.description;
40366
- return _context26.abrupt("return", _objectSpread$c(_objectSpread$c(_objectSpread$c({
40474
+ return _context28.abrupt("return", _objectSpread$c(_objectSpread$c(_objectSpread$c({
40367
40475
  isRenderedNotInSettingPalette: set.configTree.isRenderedNotInSettingPalette(configStepKey),
40368
40476
  isRenderedInAccessorieStep: set.configTree.isRenderedInAccessorieStep(configStepKey),
40369
40477
  visible: set.configTree.getVisibility(configStepKey, visible, set.CatalogData)
@@ -40379,11 +40487,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
40379
40487
  }));
40380
40488
  case 14:
40381
40489
  case "end":
40382
- return _context26.stop();
40490
+ return _context28.stop();
40383
40491
  }
40384
- }, _callee24, this);
40492
+ }, _callee26, this);
40385
40493
  }));
40386
- function loadConfigItemsOfActSetByConfigStepKey(_x86, _x87, _x88, _x89) {
40494
+ function loadConfigItemsOfActSetByConfigStepKey(_x89, _x90, _x91, _x92) {
40387
40495
  return _loadConfigItemsOfActSetByConfigStepKey.apply(this, arguments);
40388
40496
  }
40389
40497
  return loadConfigItemsOfActSetByConfigStepKey;
@@ -40425,41 +40533,41 @@ var DivaSetHandler = /*#__PURE__*/function () {
40425
40533
  }, {
40426
40534
  key: "variantsEvaluator",
40427
40535
  value: (function () {
40428
- var _variantsEvaluator = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25(set, configItems, configStepKey, paletteType, hidePricePreview) {
40536
+ var _variantsEvaluator = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27(set, configItems, configStepKey, paletteType, hidePricePreview) {
40429
40537
  var _configItems$0$option, _set$api$ReturnToFrom, _set$CatalogData$show, _set$CatalogData$hide;
40430
40538
  var opt, previewType, _opt$checkForReversed, targetArticles, variants, pricesVisible;
40431
- return _regeneratorRuntime.wrap(function _callee25$(_context27) {
40432
- while (1) switch (_context27.prev = _context27.next) {
40539
+ return _regeneratorRuntime.wrap(function _callee27$(_context29) {
40540
+ while (1) switch (_context29.prev = _context29.next) {
40433
40541
  case 0:
40434
40542
  if (configItems[0]) {
40435
- _context27.next = 2;
40543
+ _context29.next = 2;
40436
40544
  break;
40437
40545
  }
40438
- return _context27.abrupt("return", configItems);
40546
+ return _context29.abrupt("return", configItems);
40439
40547
  case 2:
40440
40548
  opt = set.CatalogData.getOption((_configItems$0$option = configItems[0].optionOcd) !== null && _configItems$0$option !== void 0 ? _configItems$0$option : configItems[0].op);
40441
40549
  previewType = set.api.pricePreview;
40442
40550
  if (!(!opt || opt.mergeIDMToOPG || configItems[0].isOPVG || opt.showOnSeparatTabgroup || set.PlannerMode === 'BoxPlanner' || ['TEXTBOX', 'NUMBERBOX', 'RANGE'].includes(paletteType) || (_set$api$ReturnToFrom = set.api.ReturnToFromParams) !== null && _set$api$ReturnToFrom !== void 0 && _set$api$ReturnToFrom.includes('PRODUCTCREATOR'))) {
40443
- _context27.next = 6;
40551
+ _context29.next = 6;
40444
40552
  break;
40445
40553
  }
40446
- return _context27.abrupt("return", configItems);
40554
+ return _context29.abrupt("return", configItems);
40447
40555
  case 6:
40448
40556
  if (!(!previewType || previewType == 'off' || configItems.length == 1 || opt.isDescribingState || configItems.length > 300 && !configItems[0].groupName || (_set$CatalogData$show = set.CatalogData.showPricePreviewOnlyOnOptions) !== null && _set$CatalogData$show !== void 0 && _set$CatalogData$show.length && !set.CatalogData.showPricePreviewOnlyOnOptions.includes(opt.codex.substring(3)) || (_set$CatalogData$hide = set.CatalogData.hidePricePreviewOnlyOnOptions) !== null && _set$CatalogData$hide !== void 0 && _set$CatalogData$hide.length && set.CatalogData.hidePricePreviewOnlyOnOptions.includes(opt.codex.substring(3)) || hidePricePreview)) {
40449
- _context27.next = 9;
40557
+ _context29.next = 9;
40450
40558
  break;
40451
40559
  }
40452
40560
  if (!(!set.logTotalStateForVariants && !((_opt$checkForReversed = opt.checkForReversed) !== null && _opt$checkForReversed !== void 0 && _opt$checkForReversed.checkForReversingChanges))) {
40453
- _context27.next = 9;
40561
+ _context29.next = 9;
40454
40562
  break;
40455
40563
  }
40456
- return _context27.abrupt("return", configItems);
40564
+ return _context29.abrupt("return", configItems);
40457
40565
  case 9:
40458
40566
  targetArticles = set.configTree.getTargetArticles(configStepKey);
40459
- _context27.next = 12;
40567
+ _context29.next = 12;
40460
40568
  return this.calcVariants(set, configItems, targetArticles, opt);
40461
40569
  case 12:
40462
- variants = _context27.sent;
40570
+ variants = _context29.sent;
40463
40571
  if (previewType) {
40464
40572
  pricesVisible = this.checkIfPriceDiffers(variants);
40465
40573
  configItems.map(function (c, index) {
@@ -40469,14 +40577,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
40469
40577
  };
40470
40578
  });
40471
40579
  }
40472
- return _context27.abrupt("return", configItems);
40580
+ return _context29.abrupt("return", configItems);
40473
40581
  case 15:
40474
40582
  case "end":
40475
- return _context27.stop();
40583
+ return _context29.stop();
40476
40584
  }
40477
- }, _callee25, this);
40585
+ }, _callee27, this);
40478
40586
  }));
40479
- function variantsEvaluator(_x90, _x91, _x92, _x93, _x94) {
40587
+ function variantsEvaluator(_x93, _x94, _x95, _x96, _x97) {
40480
40588
  return _variantsEvaluator.apply(this, arguments);
40481
40589
  }
40482
40590
  return variantsEvaluator;
@@ -40484,10 +40592,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
40484
40592
  }, {
40485
40593
  key: "calcVariants",
40486
40594
  value: function () {
40487
- var _calcVariants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26(realSet, configItems, targetArticles, option) {
40488
- var variantInfo, articles, origPrice, articleConfigs, i, basketId, totalConfig, key, parentNames, _i5, configItem, _ref, _ref2;
40489
- return _regeneratorRuntime.wrap(function _callee26$(_context28) {
40490
- while (1) switch (_context28.prev = _context28.next) {
40595
+ var _calcVariants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(realSet, configItems, targetArticles, option) {
40596
+ var variantInfo, articles, origPrice, articleConfigs, i, basketId, totalConfig, key, parentNames, _i4, configItem, _ref, _ref2;
40597
+ return _regeneratorRuntime.wrap(function _callee28$(_context30) {
40598
+ while (1) switch (_context30.prev = _context30.next) {
40491
40599
  case 0:
40492
40600
  variantInfo = [];
40493
40601
  articles = realSet.getDivaArticles(true, true);
@@ -40496,15 +40604,15 @@ var DivaSetHandler = /*#__PURE__*/function () {
40496
40604
  i = 0;
40497
40605
  case 5:
40498
40606
  if (!(i < targetArticles.length)) {
40499
- _context28.next = 13;
40607
+ _context30.next = 13;
40500
40608
  break;
40501
40609
  }
40502
40610
  basketId = targetArticles[i];
40503
40611
  if (articles[basketId]) {
40504
- _context28.next = 9;
40612
+ _context30.next = 9;
40505
40613
  break;
40506
40614
  }
40507
- return _context28.abrupt("continue", 10);
40615
+ return _context30.abrupt("continue", 10);
40508
40616
  case 9:
40509
40617
  articleConfigs[basketId] = {
40510
40618
  config: articles[basketId].VisibleVariantValues,
@@ -40512,7 +40620,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
40512
40620
  };
40513
40621
  case 10:
40514
40622
  i++;
40515
- _context28.next = 5;
40623
+ _context30.next = 5;
40516
40624
  break;
40517
40625
  case 13:
40518
40626
  totalConfig = {};
@@ -40523,40 +40631,40 @@ var DivaSetHandler = /*#__PURE__*/function () {
40523
40631
  };
40524
40632
  }
40525
40633
  parentNames = [];
40526
- _i5 = 0;
40634
+ _i4 = 0;
40527
40635
  case 17:
40528
- if (!(_i5 < configItems.length)) {
40529
- _context28.next = 30;
40636
+ if (!(_i4 < configItems.length)) {
40637
+ _context30.next = 30;
40530
40638
  break;
40531
40639
  }
40532
- configItem = configItems[_i5];
40640
+ configItem = configItems[_i4];
40533
40641
  if (!(configItem.isParentOPVG || configItem.idmOpgValCodex)) {
40534
- _context28.next = 26;
40642
+ _context30.next = 26;
40535
40643
  break;
40536
40644
  }
40537
40645
  if (!parentNames.includes((_ref = configItem.isParentOPVG ? configItem.parentName : configItem.idmOpgValCodex) !== null && _ref !== void 0 ? _ref : '')) {
40538
- _context28.next = 25;
40646
+ _context30.next = 25;
40539
40647
  break;
40540
40648
  }
40541
- variantInfo.push(variantInfo[_i5 - 1]);
40542
- return _context28.abrupt("continue", 27);
40649
+ variantInfo.push(variantInfo[_i4 - 1]);
40650
+ return _context30.abrupt("continue", 27);
40543
40651
  case 25:
40544
40652
  parentNames.push((_ref2 = configItem.isParentOPVG ? configItem.parentName : configItem.idmOpgValCodex) !== null && _ref2 !== void 0 ? _ref2 : '');
40545
40653
  case 26:
40546
- variantInfo.push(this.getVariant(realSet.cloneSet(), configItem, articleConfigs, totalConfig, targetArticles, option, origPrice, _i5, variantInfo[_i5 - 1]));
40654
+ variantInfo.push(this.getVariant(realSet.cloneSet(), configItem, articleConfigs, totalConfig, targetArticles, option, origPrice, _i4, variantInfo[_i4 - 1]));
40547
40655
  case 27:
40548
- _i5++;
40549
- _context28.next = 17;
40656
+ _i4++;
40657
+ _context30.next = 17;
40550
40658
  break;
40551
40659
  case 30:
40552
- return _context28.abrupt("return", variantInfo);
40660
+ return _context30.abrupt("return", variantInfo);
40553
40661
  case 31:
40554
40662
  case "end":
40555
- return _context28.stop();
40663
+ return _context30.stop();
40556
40664
  }
40557
- }, _callee26, this);
40665
+ }, _callee28, this);
40558
40666
  }));
40559
- function calcVariants(_x95, _x96, _x97, _x98) {
40667
+ function calcVariants(_x98, _x99, _x100, _x101) {
40560
40668
  return _calcVariants.apply(this, arguments);
40561
40669
  }
40562
40670
  return calcVariants;
@@ -40564,32 +40672,32 @@ var DivaSetHandler = /*#__PURE__*/function () {
40564
40672
  }, {
40565
40673
  key: "getVariant",
40566
40674
  value: function () {
40567
- var _getVariant = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27(set, item, origConfigs, totalConfig, targetArticles, option, origPrice, index, previousPromise) {
40568
- var firstPrice, prevProm, startTime, doUseConfigs, hashVariantValues, variantValues, i, basketId, origConfig, key, hash, dataHash, _i6, reversingCheck, ret, endTime, calcTime, price, priceObj;
40569
- return _regeneratorRuntime.wrap(function _callee27$(_context29) {
40570
- while (1) switch (_context29.prev = _context29.next) {
40675
+ var _getVariant = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29(set, item, origConfigs, totalConfig, targetArticles, option, origPrice, index, previousPromise) {
40676
+ var firstPrice, prevProm, startTime, doUseConfigs, hashVariantValues, variantValues, i, basketId, origConfig, key, hash, dataHash, _i5, reversingCheck, ret, endTime, calcTime, price, priceObj;
40677
+ return _regeneratorRuntime.wrap(function _callee29$(_context31) {
40678
+ while (1) switch (_context31.prev = _context31.next) {
40571
40679
  case 0:
40572
40680
  firstPrice = undefined;
40573
40681
  prevProm = undefined;
40574
40682
  if (!previousPromise) {
40575
- _context29.next = 9;
40683
+ _context31.next = 9;
40576
40684
  break;
40577
40685
  }
40578
- _context29.next = 5;
40686
+ _context31.next = 5;
40579
40687
  return previousPromise;
40580
40688
  case 5:
40581
- prevProm = _context29.sent;
40689
+ prevProm = _context31.sent;
40582
40690
  firstPrice = prevProm.firstPrice;
40583
- _context29.next = 10;
40691
+ _context31.next = 10;
40584
40692
  break;
40585
40693
  case 9:
40586
40694
  firstPrice = set.getSetPrice();
40587
40695
  case 10:
40588
40696
  if (!(index == 0)) {
40589
- _context29.next = 13;
40697
+ _context31.next = 13;
40590
40698
  break;
40591
40699
  }
40592
- _context29.next = 13;
40700
+ _context31.next = 13;
40593
40701
  return DivaUtils.Sleep(item.idmOpgOptionCodex ? 200 : 50);
40594
40702
  case 13:
40595
40703
  startTime = new Date();
@@ -40620,37 +40728,37 @@ var DivaSetHandler = /*#__PURE__*/function () {
40620
40728
  hash = md5(JSON.stringify([].concat(hashVariantValues, _toConsumableArray(Object.values(totalConfig)))));
40621
40729
  dataHash = set.CatalogData.getVariantsPriceByHash(hash);
40622
40730
  if (!(dataHash && (!set.logTotalStateForVariants || dataHash.articleSnapshot))) {
40623
- _context29.next = 24;
40731
+ _context31.next = 24;
40624
40732
  break;
40625
40733
  }
40626
40734
  LOG$9.debug('calcingVariant from Option:' + option.codex + ' and index: ' + index + ' hash hit!', dataHash, [].concat(hashVariantValues, _toConsumableArray(Object.values(totalConfig))), targetArticles);
40627
- return _context29.abrupt("return", _objectSpread$c(_objectSpread$c({}, dataHash), {}, {
40735
+ return _context31.abrupt("return", _objectSpread$c(_objectSpread$c({}, dataHash), {}, {
40628
40736
  origPrice: origPrice,
40629
40737
  firstPrice: firstPrice
40630
40738
  }));
40631
40739
  case 24:
40632
- _i6 = 0;
40740
+ _i5 = 0;
40633
40741
  case 25:
40634
- if (!(_i6 < variantValues.length)) {
40635
- _context29.next = 31;
40742
+ if (!(_i5 < variantValues.length)) {
40743
+ _context31.next = 31;
40636
40744
  break;
40637
40745
  }
40638
- _context29.next = 28;
40639
- return this.updateArticlesOptionStatesOfActSet(set, variantValues[_i6], [targetArticles[_i6]], true, 'calcVariant');
40746
+ _context31.next = 28;
40747
+ return this.updateArticlesOptionStatesOfActSet(set, variantValues[_i5], [targetArticles[_i5]], true, 'calcVariant');
40640
40748
  case 28:
40641
- _i6++;
40642
- _context29.next = 25;
40749
+ _i5++;
40750
+ _context31.next = 25;
40643
40751
  break;
40644
40752
  case 31:
40645
40753
  reversingCheck = undefined;
40646
40754
  if (!option.checkForReversed) {
40647
- _context29.next = 37;
40755
+ _context31.next = 37;
40648
40756
  break;
40649
40757
  }
40650
- _context29.next = 35;
40758
+ _context31.next = 35;
40651
40759
  return this.checkForReversingChanges(set, origConfigs, option, option.checkForReversed.checkOnlyForOptions);
40652
40760
  case 35:
40653
- ret = _context29.sent;
40761
+ ret = _context31.sent;
40654
40762
  reversingCheck = {
40655
40763
  checkingForReversingChanges: option.checkForReversed.checkForReversingChanges,
40656
40764
  hasReversingChanges: ret.hasReversingChanges,
@@ -40674,14 +40782,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
40674
40782
  articleSnapshot: set.logTotalStateForVariants ? set.cloneSet().getDivaArticles() : undefined
40675
40783
  };
40676
40784
  set.CatalogData.setVariantsPriceByHash(hash, priceObj);
40677
- return _context29.abrupt("return", priceObj);
40785
+ return _context31.abrupt("return", priceObj);
40678
40786
  case 44:
40679
40787
  case "end":
40680
- return _context29.stop();
40788
+ return _context31.stop();
40681
40789
  }
40682
- }, _callee27, this);
40790
+ }, _callee29, this);
40683
40791
  }));
40684
- function getVariant(_x99, _x100, _x101, _x102, _x103, _x104, _x105, _x106, _x107) {
40792
+ function getVariant(_x102, _x103, _x104, _x105, _x106, _x107, _x108, _x109, _x110) {
40685
40793
  return _getVariant.apply(this, arguments);
40686
40794
  }
40687
40795
  return getVariant;
@@ -40689,53 +40797,53 @@ var DivaSetHandler = /*#__PURE__*/function () {
40689
40797
  }, {
40690
40798
  key: "checkIfPriceDiffers",
40691
40799
  value: function () {
40692
- var _checkIfPriceDiffers = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(promises) {
40800
+ var _checkIfPriceDiffers = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30(promises) {
40693
40801
  var results, i, price, j;
40694
- return _regeneratorRuntime.wrap(function _callee28$(_context30) {
40695
- while (1) switch (_context30.prev = _context30.next) {
40802
+ return _regeneratorRuntime.wrap(function _callee30$(_context32) {
40803
+ while (1) switch (_context32.prev = _context32.next) {
40696
40804
  case 0:
40697
40805
  results = [];
40698
40806
  i = 0;
40699
40807
  case 2:
40700
40808
  if (!(i < promises.length)) {
40701
- _context30.next = 19;
40809
+ _context32.next = 19;
40702
40810
  break;
40703
40811
  }
40704
- _context30.t0 = results;
40705
- _context30.next = 6;
40812
+ _context32.t0 = results;
40813
+ _context32.next = 6;
40706
40814
  return promises[i];
40707
40815
  case 6:
40708
- _context30.t1 = _context30.sent;
40709
- _context30.t0.push.call(_context30.t0, _context30.t1);
40816
+ _context32.t1 = _context32.sent;
40817
+ _context32.t0.push.call(_context32.t0, _context32.t1);
40710
40818
  price = results[0].price;
40711
40819
  j = 1;
40712
40820
  case 10:
40713
40821
  if (!(j < results.length)) {
40714
- _context30.next = 16;
40822
+ _context32.next = 16;
40715
40823
  break;
40716
40824
  }
40717
40825
  if (!(price !== results[j].price)) {
40718
- _context30.next = 13;
40826
+ _context32.next = 13;
40719
40827
  break;
40720
40828
  }
40721
- return _context30.abrupt("return", true);
40829
+ return _context32.abrupt("return", true);
40722
40830
  case 13:
40723
40831
  j++;
40724
- _context30.next = 10;
40832
+ _context32.next = 10;
40725
40833
  break;
40726
40834
  case 16:
40727
40835
  i++;
40728
- _context30.next = 2;
40836
+ _context32.next = 2;
40729
40837
  break;
40730
40838
  case 19:
40731
- return _context30.abrupt("return", false);
40839
+ return _context32.abrupt("return", false);
40732
40840
  case 20:
40733
40841
  case "end":
40734
- return _context30.stop();
40842
+ return _context32.stop();
40735
40843
  }
40736
- }, _callee28);
40844
+ }, _callee30);
40737
40845
  }));
40738
- function checkIfPriceDiffers(_x108) {
40846
+ function checkIfPriceDiffers(_x111) {
40739
40847
  return _checkIfPriceDiffers.apply(this, arguments);
40740
40848
  }
40741
40849
  return checkIfPriceDiffers;
@@ -40743,49 +40851,49 @@ var DivaSetHandler = /*#__PURE__*/function () {
40743
40851
  }, {
40744
40852
  key: "checkForReversingChanges",
40745
40853
  value: function () {
40746
- var _checkForReversingChanges = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29(set, origConfigs, option, checkOnlyForOptions) {
40854
+ var _checkForReversingChanges = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(set, origConfigs, option, checkOnlyForOptions) {
40747
40855
  var hasReversingChanges, reversingVariantValues, basketId, origConfig, article, variantValues, _iterator2, _step2, ops, _ops$valCodex;
40748
- return _regeneratorRuntime.wrap(function _callee29$(_context31) {
40749
- while (1) switch (_context31.prev = _context31.next) {
40856
+ return _regeneratorRuntime.wrap(function _callee31$(_context33) {
40857
+ while (1) switch (_context33.prev = _context33.next) {
40750
40858
  case 0:
40751
40859
  hasReversingChanges = false;
40752
40860
  reversingVariantValues = {};
40753
- _context31.t0 = _regeneratorRuntime.keys(origConfigs);
40861
+ _context33.t0 = _regeneratorRuntime.keys(origConfigs);
40754
40862
  case 3:
40755
- if ((_context31.t1 = _context31.t0()).done) {
40756
- _context31.next = 32;
40863
+ if ((_context33.t1 = _context33.t0()).done) {
40864
+ _context33.next = 32;
40757
40865
  break;
40758
40866
  }
40759
- basketId = _context31.t1.value;
40867
+ basketId = _context33.t1.value;
40760
40868
  origConfig = origConfigs[basketId].config;
40761
40869
  article = set.getArticleByBasketId(basketId);
40762
40870
  if (article) {
40763
- _context31.next = 9;
40871
+ _context33.next = 9;
40764
40872
  break;
40765
40873
  }
40766
40874
  throw new Error('Article not found for basketId: ' + basketId);
40767
40875
  case 9:
40768
40876
  variantValues = article.VisibleVariantValues;
40769
40877
  _iterator2 = _createForOfIteratorHelper$4(article.articleOptionStates.values());
40770
- _context31.prev = 11;
40878
+ _context33.prev = 11;
40771
40879
  _iterator2.s();
40772
40880
  case 13:
40773
40881
  if ((_step2 = _iterator2.n()).done) {
40774
- _context31.next = 22;
40882
+ _context33.next = 22;
40775
40883
  break;
40776
40884
  }
40777
40885
  ops = _step2.value;
40778
40886
  if (!(ops.optionCodex == option.codex)) {
40779
- _context31.next = 17;
40887
+ _context33.next = 17;
40780
40888
  break;
40781
40889
  }
40782
- return _context31.abrupt("break", 22);
40890
+ return _context33.abrupt("break", 22);
40783
40891
  case 17:
40784
40892
  if (!(checkOnlyForOptions !== null && checkOnlyForOptions !== void 0 && checkOnlyForOptions.length && !checkOnlyForOptions.includes(ops.optionCodex))) {
40785
- _context31.next = 19;
40893
+ _context33.next = 19;
40786
40894
  break;
40787
40895
  }
40788
- return _context31.abrupt("continue", 20);
40896
+ return _context33.abrupt("continue", 20);
40789
40897
  case 19:
40790
40898
  if (ops && origConfig[ops.optionCodex] && (!ops.visibleCount || variantValues[ops.optionCodex] != origConfig[ops.optionCodex]) && (!ops.isInvisible || ops.visibleCount == 0)) {
40791
40899
  hasReversingChanges = true;
@@ -40795,34 +40903,34 @@ var DivaSetHandler = /*#__PURE__*/function () {
40795
40903
  };
40796
40904
  }
40797
40905
  case 20:
40798
- _context31.next = 13;
40906
+ _context33.next = 13;
40799
40907
  break;
40800
40908
  case 22:
40801
- _context31.next = 27;
40909
+ _context33.next = 27;
40802
40910
  break;
40803
40911
  case 24:
40804
- _context31.prev = 24;
40805
- _context31.t2 = _context31["catch"](11);
40806
- _iterator2.e(_context31.t2);
40912
+ _context33.prev = 24;
40913
+ _context33.t2 = _context33["catch"](11);
40914
+ _iterator2.e(_context33.t2);
40807
40915
  case 27:
40808
- _context31.prev = 27;
40916
+ _context33.prev = 27;
40809
40917
  _iterator2.f();
40810
- return _context31.finish(27);
40918
+ return _context33.finish(27);
40811
40919
  case 30:
40812
- _context31.next = 3;
40920
+ _context33.next = 3;
40813
40921
  break;
40814
40922
  case 32:
40815
- return _context31.abrupt("return", {
40923
+ return _context33.abrupt("return", {
40816
40924
  hasReversingChanges: hasReversingChanges,
40817
40925
  reversingVariantValues: reversingVariantValues
40818
40926
  });
40819
40927
  case 33:
40820
40928
  case "end":
40821
- return _context31.stop();
40929
+ return _context33.stop();
40822
40930
  }
40823
- }, _callee29, null, [[11, 24, 27, 30]]);
40931
+ }, _callee31, null, [[11, 24, 27, 30]]);
40824
40932
  }));
40825
- function checkForReversingChanges(_x109, _x110, _x111, _x112) {
40933
+ function checkForReversingChanges(_x112, _x113, _x114, _x115) {
40826
40934
  return _checkForReversingChanges.apply(this, arguments);
40827
40935
  }
40828
40936
  return checkForReversingChanges;
@@ -40836,11 +40944,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
40836
40944
  }, {
40837
40945
  key: "updateArticlesOptionStatesOfActSet",
40838
40946
  value: (function () {
40839
- var _updateArticlesOptionStatesOfActSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30(set, myValues, targetArticlesWithNewValues, ignorePlanner, from, partlistDiff, forceUpdate) {
40947
+ var _updateArticlesOptionStatesOfActSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32(set, myValues, targetArticlesWithNewValues, ignorePlanner, from, partlistDiff, forceUpdate) {
40840
40948
  var _resultPlannerUpdate;
40841
40949
  var elementsToDeleteById, targetArticlesToUpdateOnly, previousValues, articles, article, optState, retValues, diff, resultPlannerUpdate, targetElementIds, i, articleToDel, index, result, articleCopyRelation, newArticle, rpu, copyIndex;
40842
- return _regeneratorRuntime.wrap(function _callee30$(_context32) {
40843
- while (1) switch (_context32.prev = _context32.next) {
40950
+ return _regeneratorRuntime.wrap(function _callee32$(_context34) {
40951
+ while (1) switch (_context34.prev = _context34.next) {
40844
40952
  case 0:
40845
40953
  elementsToDeleteById = [];
40846
40954
  targetArticlesToUpdateOnly = [];
@@ -40859,55 +40967,55 @@ var DivaSetHandler = /*#__PURE__*/function () {
40859
40967
  optState = article === null || article === void 0 ? void 0 : article.getArticleJsonVariantValues();
40860
40968
  previousValues = structuredClone(optState);
40861
40969
  }
40862
- _context32.next = 8;
40970
+ _context34.next = 8;
40863
40971
  return articleHandlerInstance.updateArticlesOptionStates(myValues, targetArticlesWithNewValues, targetArticlesToUpdateOnly, set.getDivaArticles(true), from);
40864
40972
  case 8:
40865
- retValues = _context32.sent;
40973
+ retValues = _context34.sent;
40866
40974
  targetArticlesWithNewValues = retValues.targetArticlesToUpdate;
40867
40975
  if (!(retValues.partlistArticlesToLoad.length > 0)) {
40868
- _context32.next = 19;
40976
+ _context34.next = 19;
40869
40977
  break;
40870
40978
  }
40871
40979
  diff = targetArticlesToUpdateOnly.length - Object.keys(set.getDivaArticles()).length;
40872
40980
  if (!(diff == 0 || partlistDiff == diff)) {
40873
- _context32.next = 17;
40981
+ _context34.next = 17;
40874
40982
  break;
40875
40983
  }
40876
- _context32.next = 15;
40984
+ _context34.next = 15;
40877
40985
  return articleHandlerInstance.correctPartlistArticlesByGlobalRules(set, retValues.partlistArticlesToLoad, set.CatalogData.bundleRules, {
40878
40986
  doChange: false
40879
40987
  });
40880
40988
  case 15:
40881
- _context32.next = 19;
40989
+ _context34.next = 19;
40882
40990
  break;
40883
40991
  case 17:
40884
- _context32.next = 19;
40992
+ _context34.next = 19;
40885
40993
  return this.updateArticlesOptionStatesOfActSet(set, {}, targetArticlesWithNewValues, ignorePlanner, from, diff);
40886
40994
  case 19:
40887
40995
  if (!(from !== 'initializingPartlist')) {
40888
- _context32.next = 22;
40996
+ _context34.next = 22;
40889
40997
  break;
40890
40998
  }
40891
- _context32.next = 22;
40999
+ _context34.next = 22;
40892
41000
  return this.updateEdoArticles(set, retValues.newEDOExtraArticles);
40893
41001
  case 22:
40894
41002
  if (set.CatalogData.hasAlternateRenderings) set.CatalogData.updateAlternativeRenderings(set.getDivaArticles());
40895
41003
 
40896
41004
  //Update Planner - check if planner data changed
40897
41005
  if (!(!ignorePlanner && from != 'calcVariant')) {
40898
- _context32.next = 64;
41006
+ _context34.next = 64;
40899
41007
  break;
40900
41008
  }
40901
41009
  targetElementIds = this.getElementIdsOfArticles(set, targetArticlesWithNewValues);
40902
- _context32.next = 27;
41010
+ _context34.next = 27;
40903
41011
  return set.plannerHandler.updatePlanner(set.getSetId(), myValues, targetElementIds, forceUpdate);
40904
41012
  case 27:
40905
- resultPlannerUpdate = _context32.sent;
41013
+ resultPlannerUpdate = _context34.sent;
40906
41014
  if (!resultPlannerUpdate.failed) {
40907
- _context32.next = 31;
41015
+ _context34.next = 31;
40908
41016
  break;
40909
41017
  }
40910
- _context32.next = 31;
41018
+ _context34.next = 31;
40911
41019
  return articleHandlerInstance.updateArticlesOptionStates(previousValues, targetArticlesWithNewValues, targetArticlesToUpdateOnly, set.getDivaArticles(true), from);
40912
41020
  case 31:
40913
41021
  elementsToDeleteById = resultPlannerUpdate.elemIdsToDelete;
@@ -40919,35 +41027,35 @@ var DivaSetHandler = /*#__PURE__*/function () {
40919
41027
  }
40920
41028
  }
40921
41029
  if (!resultPlannerUpdate.doDeleteBackGrid) {
40922
- _context32.next = 40;
41030
+ _context34.next = 40;
40923
41031
  break;
40924
41032
  }
40925
- _context32.next = 36;
41033
+ _context34.next = 36;
40926
41034
  return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[0], false, resultPlannerUpdate.deletionType);
40927
41035
  case 36:
40928
- result = _context32.sent;
41036
+ result = _context34.sent;
40929
41037
  //Others are deleted recursive
40930
41038
  if (result.selectElementId) {
40931
41039
  resultPlannerUpdate.elementIdsToUpdateSelection = [result.selectElementId];
40932
41040
  }
40933
- _context32.next = 47;
41041
+ _context34.next = 47;
40934
41042
  break;
40935
41043
  case 40:
40936
41044
  i = 0;
40937
41045
  case 41:
40938
41046
  if (!(i < resultPlannerUpdate.elemIdsToDelete.length)) {
40939
- _context32.next = 47;
41047
+ _context34.next = 47;
40940
41048
  break;
40941
41049
  }
40942
- _context32.next = 44;
41050
+ _context34.next = 44;
40943
41051
  return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[i], false, resultPlannerUpdate.deletionType);
40944
41052
  case 44:
40945
41053
  i++;
40946
- _context32.next = 41;
41054
+ _context34.next = 41;
40947
41055
  break;
40948
41056
  case 47:
40949
41057
  if (!(resultPlannerUpdate.elementIdToCopy && resultPlannerUpdate.elementIdToCopy.length > 0)) {
40950
- _context32.next = 63;
41058
+ _context34.next = 63;
40951
41059
  break;
40952
41060
  }
40953
41061
  //Todo copy these elements
@@ -40955,20 +41063,20 @@ var DivaSetHandler = /*#__PURE__*/function () {
40955
41063
  i = 0;
40956
41064
  case 50:
40957
41065
  if (!(i < resultPlannerUpdate.elementIdToCopy.length)) {
40958
- _context32.next = 58;
41066
+ _context34.next = 58;
40959
41067
  break;
40960
41068
  }
40961
- _context32.next = 53;
41069
+ _context34.next = 53;
40962
41070
  return this.copyArticleByElementId(set, resultPlannerUpdate.elementIdToCopy[i], resultPlannerUpdate.ignoreOptionsToCopy);
40963
41071
  case 53:
40964
- newArticle = _context32.sent;
41072
+ newArticle = _context34.sent;
40965
41073
  articleCopyRelation.push({
40966
41074
  key: resultPlannerUpdate.elementIdToCopy[i],
40967
41075
  value: newArticle.basketId
40968
41076
  });
40969
41077
  case 55:
40970
41078
  i++;
40971
- _context32.next = 50;
41079
+ _context34.next = 50;
40972
41080
  break;
40973
41081
  case 58:
40974
41082
  rpu = resultPlannerUpdate;
@@ -40978,10 +41086,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
40978
41086
  z: rpu.copyType == 'BoxPlanner_backside' ? -1 : 0
40979
41087
  };
40980
41088
  if (!(resultPlannerUpdate.copyType == 'BoxPlanner_backside')) {
40981
- _context32.next = 63;
41089
+ _context34.next = 63;
40982
41090
  break;
40983
41091
  }
40984
- _context32.next = 63;
41092
+ _context34.next = 63;
40985
41093
  return set.plannerHandler.copyPlannerElements(set.getSetId(), articleCopyRelation, {
40986
41094
  copyIndex: copyIndex,
40987
41095
  copyType: resultPlannerUpdate.copyType,
@@ -40991,18 +41099,18 @@ var DivaSetHandler = /*#__PURE__*/function () {
40991
41099
  case 63:
40992
41100
  this.updatePosNrOfAccessoiresOfTargetArticles(set, targetArticlesWithNewValues);
40993
41101
  case 64:
40994
- return _context32.abrupt("return", {
41102
+ return _context34.abrupt("return", {
40995
41103
  articleCountChanged: elementsToDeleteById.length > 0,
40996
41104
  elementIdsToUpdateSelection: (_resultPlannerUpdate = resultPlannerUpdate) === null || _resultPlannerUpdate === void 0 ? void 0 : _resultPlannerUpdate.elementIdsToUpdateSelection,
40997
41105
  setId: set.getSetId()
40998
41106
  });
40999
41107
  case 65:
41000
41108
  case "end":
41001
- return _context32.stop();
41109
+ return _context34.stop();
41002
41110
  }
41003
- }, _callee30, this);
41111
+ }, _callee32, this);
41004
41112
  }));
41005
- function updateArticlesOptionStatesOfActSet(_x113, _x114, _x115, _x116, _x117, _x118, _x119) {
41113
+ function updateArticlesOptionStatesOfActSet(_x116, _x117, _x118, _x119, _x120, _x121, _x122) {
41006
41114
  return _updateArticlesOptionStatesOfActSet.apply(this, arguments);
41007
41115
  }
41008
41116
  return updateArticlesOptionStatesOfActSet;
@@ -41039,63 +41147,63 @@ var DivaSetHandler = /*#__PURE__*/function () {
41039
41147
  }, {
41040
41148
  key: "updateEdoArticles",
41041
41149
  value: function () {
41042
- var _updateEdoArticles = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(set, edoArticlesToLoad) {
41043
- var oldBasketIds, i, article, newArticles, _i7, _i8;
41044
- return _regeneratorRuntime.wrap(function _callee31$(_context33) {
41045
- while (1) switch (_context33.prev = _context33.next) {
41150
+ var _updateEdoArticles = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33(set, edoArticlesToLoad) {
41151
+ var oldBasketIds, i, article, newArticles, _i6, _i7;
41152
+ return _regeneratorRuntime.wrap(function _callee33$(_context35) {
41153
+ while (1) switch (_context35.prev = _context35.next) {
41046
41154
  case 0:
41047
41155
  if (!(set.edoExtraArticles.length > 0 || edoArticlesToLoad.length > 0)) {
41048
- _context33.next = 22;
41156
+ _context35.next = 22;
41049
41157
  break;
41050
41158
  }
41051
41159
  oldBasketIds = _toConsumableArray(set.edoExtraArticles);
41052
41160
  i = 0;
41053
41161
  case 3:
41054
41162
  if (!(i < set.edoExtraArticles.length)) {
41055
- _context33.next = 11;
41163
+ _context35.next = 11;
41056
41164
  break;
41057
41165
  }
41058
41166
  article = set.getArticleByBasketId(set.edoExtraArticles[i]);
41059
41167
  if (!article) {
41060
- _context33.next = 8;
41168
+ _context35.next = 8;
41061
41169
  break;
41062
41170
  }
41063
- _context33.next = 8;
41171
+ _context35.next = 8;
41064
41172
  return this.deleteElementFromSet(set, article);
41065
41173
  case 8:
41066
41174
  i++;
41067
- _context33.next = 3;
41175
+ _context35.next = 3;
41068
41176
  break;
41069
41177
  case 11:
41070
41178
  set.edoExtraArticles = [];
41071
41179
  newArticles = [];
41072
- _i7 = 0;
41180
+ _i6 = 0;
41073
41181
  case 14:
41074
- if (!(_i7 < edoArticlesToLoad.length)) {
41075
- _context33.next = 21;
41182
+ if (!(_i6 < edoArticlesToLoad.length)) {
41183
+ _context35.next = 21;
41076
41184
  break;
41077
41185
  }
41078
- _context33.next = 17;
41079
- return this.addArticleToActSet(set, edoArticlesToLoad[_i7].ArticleCodex, _objectSpread$c(_objectSpread$c({}, edoArticlesToLoad[_i7]), {}, {
41080
- basketId: oldBasketIds[_i7]
41186
+ _context35.next = 17;
41187
+ return this.addArticleToActSet(set, edoArticlesToLoad[_i6].ArticleCodex, _objectSpread$c(_objectSpread$c({}, edoArticlesToLoad[_i6]), {}, {
41188
+ basketId: oldBasketIds[_i6]
41081
41189
  }), true);
41082
41190
  case 17:
41083
- newArticles[_i7] = _context33.sent;
41191
+ newArticles[_i6] = _context35.sent;
41084
41192
  case 18:
41085
- _i7++;
41086
- _context33.next = 14;
41193
+ _i6++;
41194
+ _context35.next = 14;
41087
41195
  break;
41088
41196
  case 21:
41089
- for (_i8 = 0; _i8 < newArticles.length; _i8++) {
41090
- set.edoExtraArticles.push(newArticles[_i8].basketId);
41197
+ for (_i7 = 0; _i7 < newArticles.length; _i7++) {
41198
+ set.edoExtraArticles.push(newArticles[_i7].basketId);
41091
41199
  }
41092
41200
  case 22:
41093
41201
  case "end":
41094
- return _context33.stop();
41202
+ return _context35.stop();
41095
41203
  }
41096
- }, _callee31, this);
41204
+ }, _callee33, this);
41097
41205
  }));
41098
- function updateEdoArticles(_x120, _x121) {
41206
+ function updateEdoArticles(_x123, _x124) {
41099
41207
  return _updateEdoArticles.apply(this, arguments);
41100
41208
  }
41101
41209
  return updateEdoArticles;
@@ -41261,11 +41369,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
41261
41369
  }, {
41262
41370
  key: "fillOrderLinesAndOrderSets",
41263
41371
  value: function () {
41264
- var _fillOrderLinesAndOrderSets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32(sets, divaBasketHandler, repairOnly, setPlanner, returnTo) {
41372
+ var _fillOrderLinesAndOrderSets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(sets, divaBasketHandler, repairOnly, setPlanner, returnTo) {
41265
41373
  var _set$getMatchingProdu2, _set$getMatchingProdu3;
41266
41374
  var orderSets, basketData, set, _set$getMatchingProdu, key, _set$basketConfigVari, _OrderLinesOfActSet$, _set, catalogData, articles, newOrderSet, customDimensions, OrderLinesOfActSet, ret, _key2, i, _basketData$OrderSets, _basketData$SetPlanne, oderSetsIsInActPlanning, setId, j;
41267
- return _regeneratorRuntime.wrap(function _callee32$(_context34) {
41268
- while (1) switch (_context34.prev = _context34.next) {
41375
+ return _regeneratorRuntime.wrap(function _callee34$(_context36) {
41376
+ while (1) switch (_context36.prev = _context36.next) {
41269
41377
  case 0:
41270
41378
  orderSets = [];
41271
41379
  basketData = divaBasketHandler.actBasket;
@@ -41277,32 +41385,32 @@ var DivaSetHandler = /*#__PURE__*/function () {
41277
41385
  }
41278
41386
  basketData.MatchingProductId = set === null || set === void 0 || (_set$getMatchingProdu2 = set.getMatchingProduct()) === null || _set$getMatchingProdu2 === void 0 ? void 0 : _set$getMatchingProdu2._id;
41279
41387
  basketData.MatchingProductRetailerArticleNr = set === null || set === void 0 || (_set$getMatchingProdu3 = set.getMatchingProduct()) === null || _set$getMatchingProdu3 === void 0 || (_set$getMatchingProdu3 = _set$getMatchingProdu3.retailerArticleNr) === null || _set$getMatchingProdu3 === void 0 ? void 0 : _set$getMatchingProdu3.toString();
41280
- _context34.t0 = _regeneratorRuntime.keys(sets);
41388
+ _context36.t0 = _regeneratorRuntime.keys(sets);
41281
41389
  case 8:
41282
- if ((_context34.t1 = _context34.t0()).done) {
41283
- _context34.next = 32;
41390
+ if ((_context36.t1 = _context36.t0()).done) {
41391
+ _context36.next = 32;
41284
41392
  break;
41285
41393
  }
41286
- key = _context34.t1.value;
41394
+ key = _context36.t1.value;
41287
41395
  _set = sets[key];
41288
41396
  catalogData = _set.CatalogData;
41289
41397
  articles = _set.getDivaArticles();
41290
- _context34.next = 15;
41398
+ _context36.next = 15;
41291
41399
  return this.getOrderSet(_set, catalogData, divaBasketHandler.actDivaNr, basketData, repairOnly, returnTo);
41292
41400
  case 15:
41293
- newOrderSet = _context34.sent;
41401
+ newOrderSet = _context36.sent;
41294
41402
  basketData.setIsPlanning(_set.SetType == 'PLANNING' ? '1' : '0');
41295
- _context34.next = 19;
41403
+ _context36.next = 19;
41296
41404
  return _set.getCustomDimensionsOfActSet();
41297
41405
  case 19:
41298
- customDimensions = _context34.sent;
41406
+ customDimensions = _context36.sent;
41299
41407
  OrderLinesOfActSet = articleHandlerInstance.getOrderLinesOfArticles(articles, customDimensions, repairOnly, !!((_set$basketConfigVari = _set.basketConfigVariants) !== null && _set$basketConfigVari !== void 0 && _set$basketConfigVari.length));
41300
41408
  articleHandlerInstance.checkForRoundingError(OrderLinesOfActSet, _set);
41301
41409
  if (OrderLinesOfActSet.length) {
41302
- _context34.next = 24;
41410
+ _context36.next = 24;
41303
41411
  break;
41304
41412
  }
41305
- return _context34.abrupt("continue", 8);
41413
+ return _context36.abrupt("continue", 8);
41306
41414
  case 24:
41307
41415
  OrderLinesOfActSet = divaBasketHandler.divaWWSHandler.repairWWSFlags(articles, OrderLinesOfActSet);
41308
41416
  if (newOrderSet.SetImage == '' && (_OrderLinesOfActSet$ = OrderLinesOfActSet[0]) !== null && _OrderLinesOfActSet$ !== void 0 && _OrderLinesOfActSet$.Image && _set.PlannerMode == 'No') {
@@ -41324,7 +41432,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
41324
41432
  }
41325
41433
  newOrderSet.setOrderLines(OrderLinesOfActSet);
41326
41434
  orderSets.push(newOrderSet);
41327
- _context34.next = 8;
41435
+ _context36.next = 8;
41328
41436
  break;
41329
41437
  case 32:
41330
41438
  //fill diva3DProject for renderings & AR Converter
@@ -41332,7 +41440,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
41332
41440
  i = 0;
41333
41441
  case 34:
41334
41442
  if (!(i < ((_basketData$OrderSets = basketData.OrderSets) === null || _basketData$OrderSets === void 0 ? void 0 : _basketData$OrderSets.length))) {
41335
- _context34.next = 49;
41443
+ _context36.next = 49;
41336
41444
  break;
41337
41445
  }
41338
41446
  oderSetsIsInActPlanning = false;
@@ -41340,18 +41448,18 @@ var DivaSetHandler = /*#__PURE__*/function () {
41340
41448
  j = 0;
41341
41449
  case 38:
41342
41450
  if (!(j < orderSets.length)) {
41343
- _context34.next = 45;
41451
+ _context36.next = 45;
41344
41452
  break;
41345
41453
  }
41346
41454
  if (!(orderSets[j].SetID == setId)) {
41347
- _context34.next = 42;
41455
+ _context36.next = 42;
41348
41456
  break;
41349
41457
  }
41350
41458
  oderSetsIsInActPlanning = true;
41351
- return _context34.abrupt("break", 45);
41459
+ return _context36.abrupt("break", 45);
41352
41460
  case 42:
41353
41461
  j++;
41354
- _context34.next = 38;
41462
+ _context36.next = 38;
41355
41463
  break;
41356
41464
  case 45:
41357
41465
  if (!oderSetsIsInActPlanning && !((_basketData$SetPlanne = basketData.SetPlannerInfos) !== null && _basketData$SetPlanne !== void 0 && _basketData$SetPlanne.InvolvedSetIds.includes(setId))) {
@@ -41359,7 +41467,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
41359
41467
  }
41360
41468
  case 46:
41361
41469
  i++;
41362
- _context34.next = 34;
41470
+ _context36.next = 34;
41363
41471
  break;
41364
41472
  case 49:
41365
41473
  basketData.SetPlannerInfos = setPlanner ? this.getSetPlannerInfos(Object.keys(sets), orderSets) : undefined;
@@ -41371,14 +41479,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
41371
41479
  } else {
41372
41480
  basketData.setOrderSets(orderSets);
41373
41481
  }
41374
- return _context34.abrupt("return", basketData);
41482
+ return _context36.abrupt("return", basketData);
41375
41483
  case 53:
41376
41484
  case "end":
41377
- return _context34.stop();
41485
+ return _context36.stop();
41378
41486
  }
41379
- }, _callee32, this);
41487
+ }, _callee34, this);
41380
41488
  }));
41381
- function fillOrderLinesAndOrderSets(_x122, _x123, _x124, _x125, _x126) {
41489
+ function fillOrderLinesAndOrderSets(_x125, _x126, _x127, _x128, _x129) {
41382
41490
  return _fillOrderLinesAndOrderSets.apply(this, arguments);
41383
41491
  }
41384
41492
  return fillOrderLinesAndOrderSets;
@@ -41468,50 +41576,50 @@ var DivaSetHandler = /*#__PURE__*/function () {
41468
41576
  }, {
41469
41577
  key: "ensure3DConnectionReady",
41470
41578
  value: function () {
41471
- var _ensure3DConnectionReady = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33(set) {
41579
+ var _ensure3DConnectionReady = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35(set) {
41472
41580
  var _handler$checkConnect;
41473
41581
  var is3DSet, handler, setId, tWait, ready;
41474
- return _regeneratorRuntime.wrap(function _callee33$(_context35) {
41475
- while (1) switch (_context35.prev = _context35.next) {
41582
+ return _regeneratorRuntime.wrap(function _callee35$(_context37) {
41583
+ while (1) switch (_context37.prev = _context37.next) {
41476
41584
  case 0:
41477
41585
  is3DSet = ['3DImage', '3DCOMB', 'BoxPlanner', 'RTViewer'].includes(set.getPlannerMode());
41478
41586
  if (is3DSet) {
41479
- _context35.next = 3;
41587
+ _context37.next = 3;
41480
41588
  break;
41481
41589
  }
41482
- return _context35.abrupt("return");
41590
+ return _context37.abrupt("return");
41483
41591
  case 3:
41484
41592
  handler = set.plannerHandler;
41485
41593
  if (handler !== null && handler !== void 0 && (_handler$checkConnect = handler.checkConnectionInitialized) !== null && _handler$checkConnect !== void 0 && _handler$checkConnect.call(handler)) {
41486
- _context35.next = 6;
41594
+ _context37.next = 6;
41487
41595
  break;
41488
41596
  }
41489
- return _context35.abrupt("return");
41597
+ return _context37.abrupt("return");
41490
41598
  case 6:
41491
41599
  if (!handler.is3DConnectionFullyReady()) {
41492
- _context35.next = 8;
41600
+ _context37.next = 8;
41493
41601
  break;
41494
41602
  }
41495
- return _context35.abrupt("return");
41603
+ return _context37.abrupt("return");
41496
41604
  case 8:
41497
41605
  setId = set.getSetId();
41498
41606
  tWait = Date.now();
41499
41607
  LOG$9.debug("ensure3DConnectionReady: 3D connection not ready yet \u2014 waiting (setId=".concat(setId, ")"));
41500
- _context35.next = 13;
41608
+ _context37.next = 13;
41501
41609
  return handler.await3DConnectionReady(30000);
41502
41610
  case 13:
41503
- ready = _context35.sent;
41611
+ ready = _context37.sent;
41504
41612
  LOG$9.debug("ensure3DConnectionReady: ".concat(ready ? 'connection READY' : 'connection TIMEOUT', " after ").concat(Date.now() - tWait, "ms (setId=").concat(setId, ")"));
41505
41613
  if (!ready) {
41506
41614
  LOG$9.warn("ensure3DConnectionReady: proceeding without ready 3D connection \u2014 artifact requests may time out (setId=".concat(setId, ")"));
41507
41615
  }
41508
41616
  case 16:
41509
41617
  case "end":
41510
- return _context35.stop();
41618
+ return _context37.stop();
41511
41619
  }
41512
- }, _callee33);
41620
+ }, _callee35);
41513
41621
  }));
41514
- function ensure3DConnectionReady(_x127) {
41622
+ function ensure3DConnectionReady(_x130) {
41515
41623
  return _ensure3DConnectionReady.apply(this, arguments);
41516
41624
  }
41517
41625
  return ensure3DConnectionReady;
@@ -41552,27 +41660,27 @@ var DivaSetHandler = /*#__PURE__*/function () {
41552
41660
  }, {
41553
41661
  key: "flushPendingUploadsViaMediaService",
41554
41662
  value: (function () {
41555
- var _flushPendingUploadsViaMediaService = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35(basket) {
41663
+ var _flushPendingUploadsViaMediaService = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee37(basket) {
41556
41664
  var pendingUploads, uploaded, _iterator3, _step3, _loop8;
41557
- return _regeneratorRuntime.wrap(function _callee35$(_context38) {
41558
- while (1) switch (_context38.prev = _context38.next) {
41665
+ return _regeneratorRuntime.wrap(function _callee37$(_context40) {
41666
+ while (1) switch (_context40.prev = _context40.next) {
41559
41667
  case 0:
41560
41668
  pendingUploads = basket.listPendingUploads();
41561
41669
  if (pendingUploads.length) {
41562
- _context38.next = 3;
41670
+ _context40.next = 3;
41563
41671
  break;
41564
41672
  }
41565
- return _context38.abrupt("return");
41673
+ return _context40.abrupt("return");
41566
41674
  case 3:
41567
- _context38.next = 5;
41675
+ _context40.next = 5;
41568
41676
  return Promise.all(pendingUploads.map(/*#__PURE__*/function () {
41569
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(pendingUpload) {
41677
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee36(pendingUpload) {
41570
41678
  var orderSet, url;
41571
- return _regeneratorRuntime.wrap(function _callee34$(_context36) {
41572
- while (1) switch (_context36.prev = _context36.next) {
41679
+ return _regeneratorRuntime.wrap(function _callee36$(_context38) {
41680
+ while (1) switch (_context38.prev = _context38.next) {
41573
41681
  case 0:
41574
41682
  orderSet = basket.getOrderSet(pendingUpload.setId);
41575
- _context36.next = 3;
41683
+ _context38.next = 3;
41576
41684
  return mediaServiceHandler.uploadImageBlobPermanent(pendingUpload.blob, pendingUpload.fileName, pendingUpload.slot === 'planning2D' ? 'P2D' : 'PAI', {
41577
41685
  divaNr: basket.DivaNr,
41578
41686
  setId: pendingUpload.setId,
@@ -41583,38 +41691,38 @@ var DivaSetHandler = /*#__PURE__*/function () {
41583
41691
  setHash: orderSet === null || orderSet === void 0 ? void 0 : orderSet.SetHash
41584
41692
  }, basket.OrganizationId);
41585
41693
  case 3:
41586
- url = _context36.sent;
41587
- return _context36.abrupt("return", {
41694
+ url = _context38.sent;
41695
+ return _context38.abrupt("return", {
41588
41696
  pendingUpload: pendingUpload,
41589
41697
  orderSet: orderSet,
41590
41698
  url: url
41591
41699
  });
41592
41700
  case 5:
41593
41701
  case "end":
41594
- return _context36.stop();
41702
+ return _context38.stop();
41595
41703
  }
41596
- }, _callee34);
41704
+ }, _callee36);
41597
41705
  }));
41598
- return function (_x129) {
41706
+ return function (_x132) {
41599
41707
  return _ref3.apply(this, arguments);
41600
41708
  };
41601
41709
  }()));
41602
41710
  case 5:
41603
- uploaded = _context38.sent;
41711
+ uploaded = _context40.sent;
41604
41712
  _iterator3 = _createForOfIteratorHelper$4(uploaded);
41605
- _context38.prev = 7;
41713
+ _context40.prev = 7;
41606
41714
  _loop8 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop8() {
41607
41715
  var _step3$value, pendingUpload, orderSet, url, _orderSet$ConfigVaria, configVariant, _orderSet$SetImages, setImage;
41608
- return _regeneratorRuntime.wrap(function _loop8$(_context37) {
41609
- while (1) switch (_context37.prev = _context37.next) {
41716
+ return _regeneratorRuntime.wrap(function _loop8$(_context39) {
41717
+ while (1) switch (_context39.prev = _context39.next) {
41610
41718
  case 0:
41611
41719
  _step3$value = _step3.value, pendingUpload = _step3$value.pendingUpload, orderSet = _step3$value.orderSet, url = _step3$value.url;
41612
41720
  if (!(!url || !orderSet)) {
41613
- _context37.next = 4;
41721
+ _context39.next = 4;
41614
41722
  break;
41615
41723
  }
41616
41724
  if (!url) LOG$9.warn("flushPendingUploadsViaMediaService: upload failed for ".concat(pendingUpload.slot, " set ").concat(pendingUpload.setId));
41617
- return _context37.abrupt("return", 1);
41725
+ return _context39.abrupt("return", 1);
41618
41726
  case 4:
41619
41727
  if (pendingUpload.slot === 'planning2D') {
41620
41728
  if (pendingUpload.variantId !== undefined) {
@@ -41633,46 +41741,46 @@ var DivaSetHandler = /*#__PURE__*/function () {
41633
41741
  }
41634
41742
  case 5:
41635
41743
  case "end":
41636
- return _context37.stop();
41744
+ return _context39.stop();
41637
41745
  }
41638
41746
  }, _loop8);
41639
41747
  });
41640
41748
  _iterator3.s();
41641
41749
  case 10:
41642
41750
  if ((_step3 = _iterator3.n()).done) {
41643
- _context38.next = 16;
41751
+ _context40.next = 16;
41644
41752
  break;
41645
41753
  }
41646
- return _context38.delegateYield(_loop8(), "t0", 12);
41754
+ return _context40.delegateYield(_loop8(), "t0", 12);
41647
41755
  case 12:
41648
- if (!_context38.t0) {
41649
- _context38.next = 14;
41756
+ if (!_context40.t0) {
41757
+ _context40.next = 14;
41650
41758
  break;
41651
41759
  }
41652
- return _context38.abrupt("continue", 14);
41760
+ return _context40.abrupt("continue", 14);
41653
41761
  case 14:
41654
- _context38.next = 10;
41762
+ _context40.next = 10;
41655
41763
  break;
41656
41764
  case 16:
41657
- _context38.next = 21;
41765
+ _context40.next = 21;
41658
41766
  break;
41659
41767
  case 18:
41660
- _context38.prev = 18;
41661
- _context38.t1 = _context38["catch"](7);
41662
- _iterator3.e(_context38.t1);
41768
+ _context40.prev = 18;
41769
+ _context40.t1 = _context40["catch"](7);
41770
+ _iterator3.e(_context40.t1);
41663
41771
  case 21:
41664
- _context38.prev = 21;
41772
+ _context40.prev = 21;
41665
41773
  _iterator3.f();
41666
- return _context38.finish(21);
41774
+ return _context40.finish(21);
41667
41775
  case 24:
41668
41776
  basket.clearPendingUploads();
41669
41777
  case 25:
41670
41778
  case "end":
41671
- return _context38.stop();
41779
+ return _context40.stop();
41672
41780
  }
41673
- }, _callee35, null, [[7, 18, 21, 24]]);
41781
+ }, _callee37, null, [[7, 18, 21, 24]]);
41674
41782
  }));
41675
- function flushPendingUploadsViaMediaService(_x128) {
41783
+ function flushPendingUploadsViaMediaService(_x131) {
41676
41784
  return _flushPendingUploadsViaMediaService.apply(this, arguments);
41677
41785
  }
41678
41786
  return flushPendingUploadsViaMediaService;
@@ -41680,11 +41788,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
41680
41788
  }, {
41681
41789
  key: "getOrderSet",
41682
41790
  value: function () {
41683
- var _getOrderSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee36(set, catalogData, divaNr, basketData, repairOnly, returnTo) {
41791
+ var _getOrderSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee38(set, catalogData, divaNr, basketData, repairOnly, returnTo) {
41684
41792
  var _Object$values$, _set$getDivaArticles, _hqRenderScript2, _urlToAiImages, _alternateSetImages, _set$basketConfigVari2, _set$basketConfigVari3;
41685
41793
  var dontGenerateImages, orderSet, GroupType, plannerData, setImage, urlToPlanning2D, urlToAiImages, alternateSetImages, hqRenderScript, dimensions, _set$plannerHandler$g, _set$plannerHandler2, _set$plannerHandler2$, promise3D, promise2D, promiseAiImages, promise3DAlternate, _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, strict, is3DSet, _hqRenderScript, missing, plannerWarnings, bruttoPrice;
41686
- return _regeneratorRuntime.wrap(function _callee36$(_context39) {
41687
- while (1) switch (_context39.prev = _context39.next) {
41794
+ return _regeneratorRuntime.wrap(function _callee38$(_context41) {
41795
+ while (1) switch (_context41.prev = _context41.next) {
41688
41796
  case 0:
41689
41797
  dontGenerateImages = repairOnly || returnTo == 'DONT_SAVE_BASKET' || returnTo == 'TEST_CONFIGURATORLOGIC';
41690
41798
  DivaUtils.startSpanOfApm('GetSet3D und 2D Image');
@@ -41697,11 +41805,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
41697
41805
  hqRenderScript = undefined;
41698
41806
  dimensions = {};
41699
41807
  if (dontGenerateImages) {
41700
- _context39.next = 39;
41808
+ _context41.next = 39;
41701
41809
  break;
41702
41810
  }
41703
41811
  this.resetPendingUploadsForSet(basketData, set.getSetId());
41704
- _context39.next = 14;
41812
+ _context41.next = 14;
41705
41813
  return this.ensure3DConnectionReady(set);
41706
41814
  case 14:
41707
41815
  promise3D = this.getSetImage(set, true);
@@ -41713,10 +41821,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
41713
41821
  promise3DAlternate = this.getAlternateSetImages(set);
41714
41822
  }
41715
41823
  // Run HQ render-script after the 3D save request finishes so two SaveProjectWithOptions calls are not in flight
41716
- _context39.next = 20;
41824
+ _context41.next = 20;
41717
41825
  return Promise.all([promise3D, promise2D, promiseAiImages, promise3DAlternate]);
41718
41826
  case 20:
41719
- _yield$Promise$all = _context39.sent;
41827
+ _yield$Promise$all = _context41.sent;
41720
41828
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 4);
41721
41829
  _yield$Promise$all2$ = _yield$Promise$all2[0];
41722
41830
  setImage = _yield$Promise$all2$.url;
@@ -41724,10 +41832,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
41724
41832
  urlToPlanning2D = _yield$Promise$all2[1];
41725
41833
  urlToAiImages = _yield$Promise$all2[2];
41726
41834
  alternateSetImages = _yield$Promise$all2[3];
41727
- _context39.next = 30;
41835
+ _context41.next = 30;
41728
41836
  return this.getHQRenderScript(set, divaNr);
41729
41837
  case 30:
41730
- hqRenderScript = _context39.sent;
41838
+ hqRenderScript = _context41.sent;
41731
41839
  // Strict-mode artifact validation. Surfaces render-farm timeouts as a
41732
41840
  // hard failure so the mass-configurator can show a per-product retry
41733
41841
  // button instead of silently persisting a basket with no rendering.
@@ -41736,14 +41844,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
41736
41844
  strict = (_set$plannerHandler$g = (_set$plannerHandler2 = set.plannerHandler) === null || _set$plannerHandler2 === void 0 || (_set$plannerHandler2$ = _set$plannerHandler2.getStrictArtifactGeneration) === null || _set$plannerHandler2$ === void 0 ? void 0 : _set$plannerHandler2$.call(_set$plannerHandler2)) !== null && _set$plannerHandler$g !== void 0 ? _set$plannerHandler$g : false;
41737
41845
  is3DSet = ['3DImage', '3DCOMB', 'BoxPlanner', 'RTViewer'].includes(set.getPlannerMode());
41738
41846
  if (!(strict && is3DSet)) {
41739
- _context39.next = 39;
41847
+ _context41.next = 39;
41740
41848
  break;
41741
41849
  }
41742
41850
  missing = [];
41743
41851
  if (!setImage) missing.push('3DImage');
41744
41852
  if (!((_hqRenderScript = hqRenderScript) !== null && _hqRenderScript !== void 0 && _hqRenderScript._id)) missing.push('HQRenderScript');
41745
41853
  if (!(missing.length > 0)) {
41746
- _context39.next = 39;
41854
+ _context41.next = 39;
41747
41855
  break;
41748
41856
  }
41749
41857
  throw new ArtifactGenerationError(set.getSetId(), missing);
@@ -41813,14 +41921,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
41813
41921
  MetaData: !((_set$basketConfigVari2 = set.basketConfigVariants) !== null && _set$basketConfigVari2 !== void 0 && _set$basketConfigVari2.length) ? set.MetaData : undefined,
41814
41922
  MetaData_locales: !((_set$basketConfigVari3 = set.basketConfigVariants) !== null && _set$basketConfigVari3 !== void 0 && _set$basketConfigVari3.length) ? set.MetaData_locales : undefined
41815
41923
  });
41816
- return _context39.abrupt("return", orderSet);
41924
+ return _context41.abrupt("return", orderSet);
41817
41925
  case 45:
41818
41926
  case "end":
41819
- return _context39.stop();
41927
+ return _context41.stop();
41820
41928
  }
41821
- }, _callee36, this);
41929
+ }, _callee38, this);
41822
41930
  }));
41823
- function getOrderSet(_x130, _x131, _x132, _x133, _x134, _x135) {
41931
+ function getOrderSet(_x133, _x134, _x135, _x136, _x137, _x138) {
41824
41932
  return _getOrderSet.apply(this, arguments);
41825
41933
  }
41826
41934
  return getOrderSet;
@@ -41833,25 +41941,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
41833
41941
  }, {
41834
41942
  key: "getSetImage",
41835
41943
  value: (function () {
41836
- var _getSetImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee37(set, overwriteLastSavedRendering) {
41944
+ var _getSetImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee39(set, overwriteLastSavedRendering) {
41837
41945
  var is3D, saved, _yield$set$plannerHan, dimensions, url;
41838
- return _regeneratorRuntime.wrap(function _callee37$(_context40) {
41839
- while (1) switch (_context40.prev = _context40.next) {
41946
+ return _regeneratorRuntime.wrap(function _callee39$(_context42) {
41947
+ while (1) switch (_context42.prev = _context42.next) {
41840
41948
  case 0:
41841
41949
  is3D = ['3DImage', '3DCOMB', 'BoxPlanner', 'RTViewer'].includes(set.getPlannerMode());
41842
41950
  if (!is3D) {
41843
- _context40.next = 13;
41951
+ _context42.next = 13;
41844
41952
  break;
41845
41953
  }
41846
- _context40.next = 4;
41954
+ _context42.next = 4;
41847
41955
  return set.plannerHandler.saveSetImage(overwriteLastSavedRendering);
41848
41956
  case 4:
41849
- saved = _context40.sent;
41957
+ saved = _context42.sent;
41850
41958
  if (saved) {
41851
- _context40.next = 7;
41959
+ _context42.next = 7;
41852
41960
  break;
41853
41961
  }
41854
- return _context40.abrupt("return", {
41962
+ return _context42.abrupt("return", {
41855
41963
  dimensions: {
41856
41964
  w: undefined,
41857
41965
  h: undefined,
@@ -41860,18 +41968,18 @@ var DivaSetHandler = /*#__PURE__*/function () {
41860
41968
  url: undefined
41861
41969
  });
41862
41970
  case 7:
41863
- _context40.next = 9;
41971
+ _context42.next = 9;
41864
41972
  return set.plannerHandler.getSetImageAsUrl(set.getSetId());
41865
41973
  case 9:
41866
- _yield$set$plannerHan = _context40.sent;
41974
+ _yield$set$plannerHan = _context42.sent;
41867
41975
  dimensions = _yield$set$plannerHan.dimensions;
41868
41976
  url = _yield$set$plannerHan.url;
41869
- return _context40.abrupt("return", {
41977
+ return _context42.abrupt("return", {
41870
41978
  dimensions: dimensions,
41871
41979
  url: url
41872
41980
  });
41873
41981
  case 13:
41874
- return _context40.abrupt("return", {
41982
+ return _context42.abrupt("return", {
41875
41983
  dimensions: {
41876
41984
  w: undefined,
41877
41985
  h: undefined,
@@ -41880,11 +41988,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
41880
41988
  });
41881
41989
  case 14:
41882
41990
  case "end":
41883
- return _context40.stop();
41991
+ return _context42.stop();
41884
41992
  }
41885
- }, _callee37);
41993
+ }, _callee39);
41886
41994
  }));
41887
- function getSetImage(_x136, _x137) {
41995
+ function getSetImage(_x139, _x140) {
41888
41996
  return _getSetImage.apply(this, arguments);
41889
41997
  }
41890
41998
  return getSetImage;
@@ -41892,44 +42000,44 @@ var DivaSetHandler = /*#__PURE__*/function () {
41892
42000
  }, {
41893
42001
  key: "getHQRenderScript",
41894
42002
  value: function () {
41895
- var _getHQRenderScript = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee38(set, divaNr) {
42003
+ var _getHQRenderScript = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee40(set, divaNr) {
41896
42004
  var is3D, hqRenderScript, createdHQRenderScript;
41897
- return _regeneratorRuntime.wrap(function _callee38$(_context41) {
41898
- while (1) switch (_context41.prev = _context41.next) {
42005
+ return _regeneratorRuntime.wrap(function _callee40$(_context43) {
42006
+ while (1) switch (_context43.prev = _context43.next) {
41899
42007
  case 0:
41900
42008
  is3D = ['3DImage', '3DCOMB', 'BoxPlanner', 'RTViewer'].includes(set.getPlannerMode());
41901
42009
  if (is3D) {
41902
- _context41.next = 3;
42010
+ _context43.next = 3;
41903
42011
  break;
41904
42012
  }
41905
- return _context41.abrupt("return");
42013
+ return _context43.abrupt("return");
41906
42014
  case 3:
41907
- _context41.next = 5;
42015
+ _context43.next = 5;
41908
42016
  return set.plannerHandler.saveSetHQRenderScript();
41909
42017
  case 5:
41910
42018
  hqRenderScript = set.plannerHandler.getSetHQRenderScript();
41911
42019
  if (hqRenderScript) {
41912
- _context41.next = 8;
42020
+ _context43.next = 8;
41913
42021
  break;
41914
42022
  }
41915
- return _context41.abrupt("return");
42023
+ return _context43.abrupt("return");
41916
42024
  case 8:
41917
- _context41.next = 10;
42025
+ _context43.next = 10;
41918
42026
  return set.api.postHQRenderScript({
41919
42027
  divaNr: divaNr,
41920
42028
  hqRenderscript: hqRenderScript,
41921
42029
  organization: set.api.OrganizationId
41922
42030
  });
41923
42031
  case 10:
41924
- createdHQRenderScript = _context41.sent;
41925
- return _context41.abrupt("return", createdHQRenderScript);
42032
+ createdHQRenderScript = _context43.sent;
42033
+ return _context43.abrupt("return", createdHQRenderScript);
41926
42034
  case 12:
41927
42035
  case "end":
41928
- return _context41.stop();
42036
+ return _context43.stop();
41929
42037
  }
41930
- }, _callee38);
42038
+ }, _callee40);
41931
42039
  }));
41932
- function getHQRenderScript(_x138, _x139) {
42040
+ function getHQRenderScript(_x141, _x142) {
41933
42041
  return _getHQRenderScript.apply(this, arguments);
41934
42042
  }
41935
42043
  return getHQRenderScript;
@@ -41943,34 +42051,34 @@ var DivaSetHandler = /*#__PURE__*/function () {
41943
42051
  }, {
41944
42052
  key: "getAlternateSetImages",
41945
42053
  value: (function () {
41946
- var _getAlternateSetImages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee39(set) {
42054
+ var _getAlternateSetImages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee41(set) {
41947
42055
  var is2D, catalogData, setImages;
41948
- return _regeneratorRuntime.wrap(function _callee39$(_context42) {
41949
- while (1) switch (_context42.prev = _context42.next) {
42056
+ return _regeneratorRuntime.wrap(function _callee41$(_context44) {
42057
+ while (1) switch (_context44.prev = _context44.next) {
41950
42058
  case 0:
41951
42059
  is2D = !['3DImage', '3DCOMB', 'BoxPlanner'].includes(set.getPlannerMode());
41952
42060
  if (!(is2D || set.onlyRunLogic)) {
41953
- _context42.next = 3;
42061
+ _context44.next = 3;
41954
42062
  break;
41955
42063
  }
41956
- return _context42.abrupt("return", []);
42064
+ return _context44.abrupt("return", []);
41957
42065
  case 3:
41958
42066
  catalogData = set.CatalogData;
41959
- _context42.next = 6;
42067
+ _context44.next = 6;
41960
42068
  return set.plannerHandler.saveAlternateSetImages(catalogData.catalogCodex, catalogData.catalogGuid);
41961
42069
  case 6:
41962
- _context42.next = 8;
42070
+ _context44.next = 8;
41963
42071
  return set.plannerHandler.getAlternateSetImagesAsSetImageData(set.getSetId());
41964
42072
  case 8:
41965
- setImages = _context42.sent;
41966
- return _context42.abrupt("return", setImages);
42073
+ setImages = _context44.sent;
42074
+ return _context44.abrupt("return", setImages);
41967
42075
  case 10:
41968
42076
  case "end":
41969
- return _context42.stop();
42077
+ return _context44.stop();
41970
42078
  }
41971
- }, _callee39);
42079
+ }, _callee41);
41972
42080
  }));
41973
- function getAlternateSetImages(_x140) {
42081
+ function getAlternateSetImages(_x143) {
41974
42082
  return _getAlternateSetImages.apply(this, arguments);
41975
42083
  }
41976
42084
  return getAlternateSetImages;
@@ -41978,31 +42086,31 @@ var DivaSetHandler = /*#__PURE__*/function () {
41978
42086
  }, {
41979
42087
  key: "get2DSetImage",
41980
42088
  value: function () {
41981
- var _get2DSetImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee40(set, basketData, variantId) {
42089
+ var _get2DSetImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee42(set, basketData, variantId) {
41982
42090
  var urlToPlanning2D, planning2DAsJPGBase64, fileName;
41983
- return _regeneratorRuntime.wrap(function _callee40$(_context43) {
41984
- while (1) switch (_context43.prev = _context43.next) {
42091
+ return _regeneratorRuntime.wrap(function _callee42$(_context45) {
42092
+ while (1) switch (_context45.prev = _context45.next) {
41985
42093
  case 0:
41986
42094
  urlToPlanning2D = undefined;
41987
42095
  planning2DAsJPGBase64 = set.getPlanning2DAsJpg();
41988
42096
  if (!(planning2DAsJPGBase64 != undefined && planning2DAsJPGBase64 != '' && planning2DAsJPGBase64 != 'data:,')) {
41989
- _context43.next = 7;
42097
+ _context45.next = 7;
41990
42098
  break;
41991
42099
  }
41992
42100
  fileName = this.getPendingUploadFileName(basketData, set.getSetId(), 'planning2D', 'jpg', variantId);
41993
- _context43.next = 6;
42101
+ _context45.next = 6;
41994
42102
  return set.plannerHandler.saveSet2DImage(basketData, set.getSetId(), planning2DAsJPGBase64, fileName, variantId);
41995
42103
  case 6:
41996
- urlToPlanning2D = _context43.sent;
42104
+ urlToPlanning2D = _context45.sent;
41997
42105
  case 7:
41998
- return _context43.abrupt("return", urlToPlanning2D);
42106
+ return _context45.abrupt("return", urlToPlanning2D);
41999
42107
  case 8:
42000
42108
  case "end":
42001
- return _context43.stop();
42109
+ return _context45.stop();
42002
42110
  }
42003
- }, _callee40, this);
42111
+ }, _callee42, this);
42004
42112
  }));
42005
- function get2DSetImage(_x141, _x142, _x143) {
42113
+ function get2DSetImage(_x144, _x145, _x146) {
42006
42114
  return _get2DSetImage.apply(this, arguments);
42007
42115
  }
42008
42116
  return get2DSetImage;
@@ -42010,29 +42118,29 @@ var DivaSetHandler = /*#__PURE__*/function () {
42010
42118
  }, {
42011
42119
  key: "getAiImages",
42012
42120
  value: function () {
42013
- var _getAiImages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee41(set, basketData) {
42121
+ var _getAiImages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee43(set, basketData) {
42014
42122
  var aiImages, fileName, savedImages;
42015
- return _regeneratorRuntime.wrap(function _callee41$(_context44) {
42016
- while (1) switch (_context44.prev = _context44.next) {
42123
+ return _regeneratorRuntime.wrap(function _callee43$(_context46) {
42124
+ while (1) switch (_context46.prev = _context46.next) {
42017
42125
  case 0:
42018
42126
  aiImages = set.getAiImagesAsJpg();
42019
42127
  fileName = this.getPendingUploadFileName(basketData, set.getSetId(), 'aiImage', 'png'); // Save all AI images in parallel
42020
- _context44.next = 4;
42128
+ _context46.next = 4;
42021
42129
  return Promise.all(aiImages.map(function (_ref4) {
42022
42130
  var promptId = _ref4.promptId,
42023
42131
  base64 = _ref4.base64;
42024
42132
  return set.plannerHandler.saveAiImage(basketData, set.getSetId(), promptId, base64, fileName);
42025
42133
  }));
42026
42134
  case 4:
42027
- savedImages = _context44.sent;
42028
- return _context44.abrupt("return", savedImages);
42135
+ savedImages = _context46.sent;
42136
+ return _context46.abrupt("return", savedImages);
42029
42137
  case 6:
42030
42138
  case "end":
42031
- return _context44.stop();
42139
+ return _context46.stop();
42032
42140
  }
42033
- }, _callee41, this);
42141
+ }, _callee43, this);
42034
42142
  }));
42035
- function getAiImages(_x144, _x145) {
42143
+ function getAiImages(_x147, _x148) {
42036
42144
  return _getAiImages.apply(this, arguments);
42037
42145
  }
42038
42146
  return getAiImages;
@@ -42040,37 +42148,37 @@ var DivaSetHandler = /*#__PURE__*/function () {
42040
42148
  }, {
42041
42149
  key: "getAiImage",
42042
42150
  value: function () {
42043
- var _getAiImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee42(set, basketData) {
42151
+ var _getAiImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee44(set, basketData) {
42044
42152
  var aiImages, _aiImages$, promptId, base64, fileName;
42045
- return _regeneratorRuntime.wrap(function _callee42$(_context45) {
42046
- while (1) switch (_context45.prev = _context45.next) {
42153
+ return _regeneratorRuntime.wrap(function _callee44$(_context47) {
42154
+ while (1) switch (_context47.prev = _context47.next) {
42047
42155
  case 0:
42048
42156
  aiImages = set.getAiImagesAsJpg();
42049
42157
  if (!(aiImages.length === 0)) {
42050
- _context45.next = 3;
42158
+ _context47.next = 3;
42051
42159
  break;
42052
42160
  }
42053
- return _context45.abrupt("return", undefined);
42161
+ return _context47.abrupt("return", undefined);
42054
42162
  case 3:
42055
42163
  if (basketData) {
42056
- _context45.next = 5;
42164
+ _context47.next = 5;
42057
42165
  break;
42058
42166
  }
42059
- return _context45.abrupt("return", undefined);
42167
+ return _context47.abrupt("return", undefined);
42060
42168
  case 5:
42061
42169
  _aiImages$ = aiImages[0], promptId = _aiImages$.promptId, base64 = _aiImages$.base64;
42062
42170
  fileName = this.getPendingUploadFileName(basketData, set.getSetId(), 'aiImage', 'png');
42063
- _context45.next = 9;
42171
+ _context47.next = 9;
42064
42172
  return set.plannerHandler.saveAiImage(basketData, set.getSetId(), promptId, base64, fileName);
42065
42173
  case 9:
42066
- return _context45.abrupt("return", _context45.sent);
42174
+ return _context47.abrupt("return", _context47.sent);
42067
42175
  case 10:
42068
42176
  case "end":
42069
- return _context45.stop();
42177
+ return _context47.stop();
42070
42178
  }
42071
- }, _callee42, this);
42179
+ }, _callee44, this);
42072
42180
  }));
42073
- function getAiImage(_x146, _x147) {
42181
+ function getAiImage(_x149, _x150) {
42074
42182
  return _getAiImage.apply(this, arguments);
42075
42183
  }
42076
42184
  return getAiImage;
@@ -42113,25 +42221,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
42113
42221
  }, {
42114
42222
  key: "addOrderSetArticlesToExistingSet",
42115
42223
  value: function () {
42116
- var _addOrderSetArticlesToExistingSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee43(set, orderSet, lastSetToInitialize) {
42117
- return _regeneratorRuntime.wrap(function _callee43$(_context46) {
42118
- while (1) switch (_context46.prev = _context46.next) {
42224
+ var _addOrderSetArticlesToExistingSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee45(set, orderSet, lastSetToInitialize) {
42225
+ return _regeneratorRuntime.wrap(function _callee45$(_context48) {
42226
+ while (1) switch (_context48.prev = _context48.next) {
42119
42227
  case 0:
42120
42228
  //TODO: GLOBAL STUFF
42121
42229
  //this.updateActSet(set);
42122
42230
  orderSet.changeBasketIds();
42123
- _context46.next = 3;
42231
+ _context48.next = 3;
42124
42232
  return this.initOrderLineArticles(set, orderSet);
42125
42233
  case 3:
42126
- _context46.next = 5;
42234
+ _context48.next = 5;
42127
42235
  return set.plannerHandler.extendSet(set, orderSet.SetPlanData, lastSetToInitialize);
42128
42236
  case 5:
42129
42237
  case "end":
42130
- return _context46.stop();
42238
+ return _context48.stop();
42131
42239
  }
42132
- }, _callee43, this);
42240
+ }, _callee45, this);
42133
42241
  }));
42134
- function addOrderSetArticlesToExistingSet(_x148, _x149, _x150) {
42242
+ function addOrderSetArticlesToExistingSet(_x151, _x152, _x153) {
42135
42243
  return _addOrderSetArticlesToExistingSet.apply(this, arguments);
42136
42244
  }
42137
42245
  return addOrderSetArticlesToExistingSet;
@@ -43239,7 +43347,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
43239
43347
  break;
43240
43348
  case 3:
43241
43349
  _context12.next = 5;
43242
- return import('./PfisterWWSHandler-7f6c04dd.js');
43350
+ return import('./PfisterWWSHandler-bd729608.js');
43243
43351
  case 5:
43244
43352
  _yield$import = _context12.sent;
43245
43353
  PfisterWWSHandler = _yield$import["default"];
@@ -43247,7 +43355,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
43247
43355
  return _context12.abrupt("break", 27);
43248
43356
  case 9:
43249
43357
  _context12.next = 11;
43250
- return import('./LiviqueWWSHandler-c9734701.js');
43358
+ return import('./LiviqueWWSHandler-a4b0e92c.js');
43251
43359
  case 11:
43252
43360
  _yield$import2 = _context12.sent;
43253
43361
  LiviqueWWSHandler = _yield$import2["default"];
@@ -43255,7 +43363,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
43255
43363
  return _context12.abrupt("break", 27);
43256
43364
  case 15:
43257
43365
  _context12.next = 17;
43258
- return import('./SeriousBasketHandler-4bebdfbc.js');
43366
+ return import('./SeriousBasketHandler-8a3bc8c3.js');
43259
43367
  case 17:
43260
43368
  _yield$import3 = _context12.sent;
43261
43369
  SeriousWWSHandler = _yield$import3["default"];
@@ -43263,7 +43371,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
43263
43371
  return _context12.abrupt("break", 27);
43264
43372
  case 21:
43265
43373
  _context12.next = 23;
43266
- return import('./StandardWWSHandler-eaead4e9.js');
43374
+ return import('./StandardWWSHandler-4bb4d5f8.js');
43267
43375
  case 23:
43268
43376
  _yield$import4 = _context12.sent;
43269
43377
  StandardWWSHandler = _yield$import4["default"];
@@ -44687,7 +44795,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
44687
44795
  while (1) switch (_context3.prev = _context3.next) {
44688
44796
  case 0:
44689
44797
  _context3.next = 2;
44690
- return import('./Host3DSignalR-f86cf2af.js');
44798
+ return import('./Host3DSignalR-afd64d70.js');
44691
44799
  case 2:
44692
44800
  _yield$import = _context3.sent;
44693
44801
  Host3DSignalR = _yield$import["default"];
@@ -46373,7 +46481,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
46373
46481
  break;
46374
46482
  case 8:
46375
46483
  _context5.next = 10;
46376
- return import('./DivaStandardPlanner-8a46797c.js');
46484
+ return import('./DivaStandardPlanner-0610c5cb.js');
46377
46485
  case 10:
46378
46486
  _yield$import = _context5.sent;
46379
46487
  DivaStandardPlanner = _yield$import["default"];
@@ -46384,7 +46492,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
46384
46492
  return _context5.abrupt("break", 21);
46385
46493
  case 15:
46386
46494
  _context5.next = 17;
46387
- return import('./DivaBoxPlanner-111611fc.js');
46495
+ return import('./DivaBoxPlanner-b9780c8d.js');
46388
46496
  case 17:
46389
46497
  _yield$import2 = _context5.sent;
46390
46498
  DivaBoxPlanner = _yield$import2["default"];