@crystaldesign/web-planner-logic 24.13.0-beta.12 → 24.13.0-beta.13

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 (50) hide show
  1. package/build/cjs/{DivaBoxPlanner-df030103.js → DivaBoxPlanner-8014a683.js} +2 -2
  2. package/build/cjs/{DivaStandardPlanner-ec161f05.js → DivaStandardPlanner-a31c4fcd.js} +2 -2
  3. package/build/cjs/{DoorPlanner-d649d3e0.js → DoorPlanner-8d079ddb.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-4ff8a82c.js → Host3DSignalR-7b21d1e9.js} +1 -1
  5. package/build/cjs/{LiviqueWWSHandler-8b969a35.js → LiviqueWWSHandler-4136ccdd.js} +1 -1
  6. package/build/cjs/{PfisterWWSHandler-67f6f800.js → PfisterWWSHandler-2dfc936a.js} +1 -1
  7. package/build/cjs/{PlannerHandler2D-2123a819.js → PlannerHandler2D-aec63404.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-cecca329.js → SeriousBasketHandler-64d5e5ac.js} +1 -1
  9. package/build/cjs/{ShelfPlanner-1f6c17bd.js → ShelfPlanner-87ddb7cf.js} +1 -1
  10. package/build/cjs/{StandardWWSHandler-84c14168.js → StandardWWSHandler-f7f0f838.js} +1 -1
  11. package/build/cjs/{index-55163fb5.js → index-f7ce608d.js} +230 -140
  12. package/build/cjs/index.js +1 -1
  13. package/build/esm/{DivaBoxPlanner-c5f19be3.js → DivaBoxPlanner-256f6673.js} +2 -2
  14. package/build/esm/{DivaStandardPlanner-b5403631.js → DivaStandardPlanner-15069451.js} +2 -2
  15. package/build/esm/{DoorPlanner-53e38ab9.js → DoorPlanner-b9f3c272.js} +1 -1
  16. package/build/esm/{Host3DSignalR-be8b605a.js → Host3DSignalR-45e86f11.js} +1 -1
  17. package/build/esm/{LiviqueWWSHandler-d88c02c3.js → LiviqueWWSHandler-7aae2b64.js} +1 -1
  18. package/build/esm/{PfisterWWSHandler-5458c5ab.js → PfisterWWSHandler-1affb9d8.js} +1 -1
  19. package/build/esm/{PlannerHandler2D-61827907.js → PlannerHandler2D-87d42a9b.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-d4db882d.js → SeriousBasketHandler-928f3aac.js} +1 -1
  21. package/build/esm/{ShelfPlanner-2ea25ecc.js → ShelfPlanner-48c3e993.js} +1 -1
  22. package/build/esm/{StandardWWSHandler-5391f27a.js → StandardWWSHandler-56b87098.js} +1 -1
  23. package/build/esm/{index-d51f7edd.js → index-8f2db083.js} +230 -140
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/interface/Basket/BasketEvent.d.ts +1 -1
  26. package/build/types/web-planner-logic/src/interface/Basket/BasketEvent.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/Configuration.d.ts +2 -2
  28. package/build/types/web-planner-logic/src/interface/Configuration.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +0 -1
  30. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts +2 -0
  32. package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts +2 -4
  34. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +1 -1
  36. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +6 -5
  38. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts +5 -0
  40. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +3 -0
  42. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  44. package/build/types/web-planner-logic/src/logic/Set/FavoritesHandler.d.ts.map +1 -1
  45. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts.map +1 -1
  46. package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts +2 -0
  47. package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts.map +1 -1
  48. package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts +2 -0
  49. package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts.map +1 -1
  50. package/package.json +2 -2
@@ -883,8 +883,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
883
883
  return '/v1/products/' + productId + '/list';
884
884
  }
885
885
  }, {
886
- key: "getProductBasketUrl",
887
- value: function getProductBasketUrl(key, value) {
886
+ key: "getProductByKeyValueUrl",
887
+ value: function getProductByKeyValueUrl(key, value) {
888
888
  return "/v1/products/basket?key=".concat(key, "&value=").concat(value);
889
889
  }
890
890
  }, {
@@ -1597,6 +1597,16 @@ var ArticleOptionData = /*#__PURE__*/function () {
1597
1597
  get: function get() {
1598
1598
  return this.opt.catalogOPT.contentItemId;
1599
1599
  }
1600
+ }, {
1601
+ key: "showSearchbar",
1602
+ get: function get() {
1603
+ return this.opt.catalogOPT.showSearchbar;
1604
+ }
1605
+ }, {
1606
+ key: "showFilter",
1607
+ get: function get() {
1608
+ return this.opt.catalogOPT.showFilter;
1609
+ }
1600
1610
  }, {
1601
1611
  key: "pdfUrl",
1602
1612
  get: function get() {
@@ -17830,6 +17840,12 @@ var OptionCatalogData = /*#__PURE__*/function () {
17830
17840
  case 'INFO_URL':
17831
17841
  this.opt.url = prop.Value;
17832
17842
  break;
17843
+ case 'SHOW_SEARCHBAR':
17844
+ this.opt.showSearchbar = prop.Value;
17845
+ break;
17846
+ case 'SHOW_FILTER':
17847
+ this.opt.showFilter = prop.Value;
17848
+ break;
17833
17849
  case 'INFO_PDF':
17834
17850
  this.opt.pdfUrl = prop.Value;
17835
17851
  break;
@@ -18030,6 +18046,16 @@ var OptionCatalogData = /*#__PURE__*/function () {
18030
18046
  get: function get() {
18031
18047
  return this.opt.url;
18032
18048
  }
18049
+ }, {
18050
+ key: "showSearchbar",
18051
+ get: function get() {
18052
+ return this.opt.showSearchbar;
18053
+ }
18054
+ }, {
18055
+ key: "showFilter",
18056
+ get: function get() {
18057
+ return this.opt.showFilter;
18058
+ }
18033
18059
  }, {
18034
18060
  key: "pdfUrl",
18035
18061
  get: function get() {
@@ -18126,7 +18152,6 @@ var DivaCatalogData = /*#__PURE__*/function () {
18126
18152
  brandName: json.Brandname,
18127
18153
  mediaUrl: '',
18128
18154
  // https://retail.diva-portal.de/files/33/9680c4a3-fc60-4541-8738-4859d9b24e9d/";
18129
- imageBaseUrl: '',
18130
18155
  subFolder: json.SubFolder,
18131
18156
  longDescription: json.LongDescription,
18132
18157
  longDescription_locales: json.LongDescription_locales,
@@ -18328,9 +18353,7 @@ var DivaCatalogData = /*#__PURE__*/function () {
18328
18353
  key: "getMediaURL",
18329
18354
  value: function getMediaURL(subFolder) {
18330
18355
  var retval = '';
18331
- if (this.catalogData.imageBaseUrl != '') {
18332
- retval = this.catalogData.imageBaseUrl;
18333
- } else if (this.api.getBaseUrl().substring(0, 4) == 'http') {
18356
+ if (this.api.getBaseUrl().substring(0, 4) == 'http') {
18334
18357
  retval = this.api.getBaseUrl() + '/' + this.api.getServerId() + '/';
18335
18358
  }
18336
18359
  if (subFolder != '') retval += subFolder + '/';
@@ -23561,7 +23584,7 @@ var DivaArticle = /*#__PURE__*/function () {
23561
23584
  break;
23562
23585
  }
23563
23586
  _context.next = 4;
23564
- return import('./ShelfPlanner-2ea25ecc.js');
23587
+ return import('./ShelfPlanner-48c3e993.js');
23565
23588
  case 4:
23566
23589
  _yield$import = _context.sent;
23567
23590
  ShelfPlanner = _yield$import["default"];
@@ -26904,6 +26927,7 @@ var DivaSet = /*#__PURE__*/function () {
26904
26927
  _defineProperty(this, "setId", void 0);
26905
26928
  _defineProperty(this, "_isActSet", false);
26906
26929
  _defineProperty(this, "setData", void 0);
26930
+ _defineProperty(this, "_onlyCalcVariants", void 0);
26907
26931
  _defineProperty(this, "divaArticles", void 0);
26908
26932
  //Schlüssel ist basketId
26909
26933
  _defineProperty(this, "configSingleData", void 0);
@@ -28093,7 +28117,7 @@ var DivaSet = /*#__PURE__*/function () {
28093
28117
  break;
28094
28118
  }
28095
28119
  _context4.next = 3;
28096
- return import('./DoorPlanner-53e38ab9.js');
28120
+ return import('./DoorPlanner-b9f3c272.js');
28097
28121
  case 3:
28098
28122
  _yield$import = _context4.sent;
28099
28123
  DoorPlanner = _yield$import["default"];
@@ -28158,6 +28182,14 @@ var DivaSet = /*#__PURE__*/function () {
28158
28182
  get: function get() {
28159
28183
  return this.setState;
28160
28184
  }
28185
+ }, {
28186
+ key: "onlyCalcVariants",
28187
+ get: function get() {
28188
+ return this._onlyCalcVariants;
28189
+ },
28190
+ set: function set(val) {
28191
+ this._onlyCalcVariants = val;
28192
+ }
28161
28193
 
28162
28194
  /**
28163
28195
  *
@@ -29598,7 +29630,7 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29598
29630
  key: "getValidVariants",
29599
29631
  value: function () {
29600
29632
  var _getValidVariants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(set, useCache) {
29601
- var allvariants, validVariants, i;
29633
+ var allvariants, validVariants, i, _set$onlyCalcVariants;
29602
29634
  return _regeneratorRuntime.wrap(function _callee3$(_context4) {
29603
29635
  while (1) switch (_context4.prev = _context4.next) {
29604
29636
  case 0:
@@ -29619,7 +29651,9 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29619
29651
  validVariants = [];
29620
29652
  for (i = 0; i < allvariants.length; i++) {
29621
29653
  if (!set.disabledVariants.includes(allvariants[i].id)) {
29622
- validVariants.push(allvariants[i]);
29654
+ if (!((_set$onlyCalcVariants = set.onlyCalcVariants) !== null && _set$onlyCalcVariants !== void 0 && _set$onlyCalcVariants.length) || set.onlyCalcVariants.includes(allvariants[i].id)) {
29655
+ validVariants.push(allvariants[i]);
29656
+ }
29623
29657
  }
29624
29658
  }
29625
29659
  return _context4.abrupt("return", validVariants);
@@ -30724,6 +30758,34 @@ var DivaProductHandler = /*#__PURE__*/function () {
30724
30758
  }
30725
30759
  return updateProducts;
30726
30760
  }()
30761
+ }, {
30762
+ key: "getBestMatch",
30763
+ value: function getBestMatch(articles, products) {
30764
+ var OPTION_CODEX = 'KOPFTEIL';
30765
+ if (!articles) return;
30766
+ for (var key in articles) {
30767
+ var _article$VariantValue;
30768
+ var article = articles[key];
30769
+ var opv = (_article$VariantValue = article.VariantValues['OPT' + OPTION_CODEX]) === null || _article$VariantValue === void 0 ? void 0 : _article$VariantValue.replace('OPV', '');
30770
+ if (!products || !opv) continue;
30771
+ for (var i = 0; i < products.length; i++) {
30772
+ var _products$i$affiliate;
30773
+ if ((_products$i$affiliate = products[i].affiliate) !== null && _products$i$affiliate !== void 0 && _products$i$affiliate.length) if (this.findOPVCodexInVariantValues(products[i], OPTION_CODEX, opv)) {
30774
+ return products[i];
30775
+ }
30776
+ }
30777
+ }
30778
+ return undefined;
30779
+ }
30780
+ }, {
30781
+ key: "findOPVCodexInVariantValues",
30782
+ value: function findOPVCodexInVariantValues(product, opt, opv) {
30783
+ return product.articles.find(function (article) {
30784
+ return article.variantValues.find(function (variant) {
30785
+ return variant.OPT === opt && variant.OPV === opv;
30786
+ });
30787
+ });
30788
+ }
30727
30789
  }]);
30728
30790
  }();
30729
30791
  var productHandlerInstance = new DivaProductHandler();
@@ -32548,7 +32610,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32548
32610
  value: (function () {
32549
32611
  var _variantsEvaluator = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(set, configItems, configStepKey, paletteType) {
32550
32612
  var _set$ViewConfig, _configItems$;
32551
- var opt, calcVariantsForPricePreview, previewType, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
32613
+ var opt, calcVariantsForPricePreview, previewType, _set$api$ReturnToFrom, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
32552
32614
  return _regeneratorRuntime.wrap(function _callee23$(_context25) {
32553
32615
  while (1) switch (_context25.prev = _context25.next) {
32554
32616
  case 0:
@@ -32562,7 +32624,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32562
32624
  calcVariantsForPricePreview = false;
32563
32625
  previewType = (_set$ViewConfig = set.ViewConfig) === null || _set$ViewConfig === void 0 ? void 0 : _set$ViewConfig.pricePreview;
32564
32626
  if (previewType) {
32565
- calcVariantsForPricePreview = !set.dontCalcPricePreviewDueToPerformanceIssues && !opt.showOnSeparatTabgroup && (!((_set$CatalogData$show = set.CatalogData.showPricePreviewOnlyOnOptions) !== null && _set$CatalogData$show !== void 0 && _set$CatalogData$show.length) || set.CatalogData.showPricePreviewOnlyOnOptions.includes(opt.codex));
32627
+ calcVariantsForPricePreview = !set.dontCalcPricePreviewDueToPerformanceIssues && !((_set$api$ReturnToFrom = set.api.ReturnToFromParams) !== null && _set$api$ReturnToFrom !== void 0 && _set$api$ReturnToFrom.includes('PRODUCTCREATOR')) && !opt.showOnSeparatTabgroup && (!((_set$CatalogData$show = set.CatalogData.showPricePreviewOnlyOnOptions) !== null && _set$CatalogData$show !== void 0 && _set$CatalogData$show.length) || set.CatalogData.showPricePreviewOnlyOnOptions.includes(opt.codex));
32566
32628
  }
32567
32629
  if (set.PlannerMode === 'BoxPlanner') calcVariantsForPricePreview = false;
32568
32630
  if (paletteType == 'GAL' && ((_configItems$ = configItems[0]) === null || _configItems$ === void 0 ? void 0 : _configItems$.groupName) === undefined || paletteType == 'TEXTBOX' || paletteType == 'NUMBERBOX' || paletteType == 'RANGE') {
@@ -34052,7 +34114,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34052
34114
  key: "initProductId",
34053
34115
  value: function () {
34054
34116
  var _initProductId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(api, productId) {
34055
- var result;
34117
+ var result, successful;
34056
34118
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
34057
34119
  while (1) switch (_context2.prev = _context2.next) {
34058
34120
  case 0:
@@ -34064,10 +34126,17 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34064
34126
  _context2.next = 6;
34065
34127
  return this.initBasket(api, result.divaNr, {
34066
34128
  basket: result.configuration
34067
- }, false);
34129
+ }, false, productId);
34068
34130
  case 6:
34069
- return _context2.abrupt("return", _context2.sent);
34070
- case 7:
34131
+ successful = _context2.sent;
34132
+ if (!successful) {
34133
+ _context2.next = 9;
34134
+ break;
34135
+ }
34136
+ return _context2.abrupt("return", result);
34137
+ case 9:
34138
+ return _context2.abrupt("return", false);
34139
+ case 10:
34071
34140
  case "end":
34072
34141
  return _context2.stop();
34073
34142
  }
@@ -34414,7 +34483,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34414
34483
  case 0:
34415
34484
  _context8.prev = 0;
34416
34485
  _context8.next = 3;
34417
- return api.getDataCache(api.getProductBasketUrl(key, productId), undefined, undefined, 'catalog', 'POST', {
34486
+ return api.getDataCache(api.getProductByKeyValueUrl(key, productId), undefined, undefined, 'catalog', 'POST', {
34418
34487
  fields: fields !== null && fields !== void 0 && fields.length ? fields : undefined
34419
34488
  });
34420
34489
  case 3:
@@ -34747,7 +34816,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34747
34816
  break;
34748
34817
  case 3:
34749
34818
  _context12.next = 5;
34750
- return import('./PfisterWWSHandler-5458c5ab.js');
34819
+ return import('./PfisterWWSHandler-1affb9d8.js');
34751
34820
  case 5:
34752
34821
  _yield$import = _context12.sent;
34753
34822
  PfisterWWSHandler = _yield$import["default"];
@@ -34755,7 +34824,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34755
34824
  return _context12.abrupt("break", 27);
34756
34825
  case 9:
34757
34826
  _context12.next = 11;
34758
- return import('./LiviqueWWSHandler-d88c02c3.js');
34827
+ return import('./LiviqueWWSHandler-7aae2b64.js');
34759
34828
  case 11:
34760
34829
  _yield$import2 = _context12.sent;
34761
34830
  LiviqueWWSHandler = _yield$import2["default"];
@@ -34763,7 +34832,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34763
34832
  return _context12.abrupt("break", 27);
34764
34833
  case 15:
34765
34834
  _context12.next = 17;
34766
- return import('./SeriousBasketHandler-d4db882d.js');
34835
+ return import('./SeriousBasketHandler-928f3aac.js');
34767
34836
  case 17:
34768
34837
  _yield$import3 = _context12.sent;
34769
34838
  SeriousWWSHandler = _yield$import3["default"];
@@ -34771,7 +34840,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34771
34840
  return _context12.abrupt("break", 27);
34772
34841
  case 21:
34773
34842
  _context12.next = 23;
34774
- return import('./StandardWWSHandler-5391f27a.js');
34843
+ return import('./StandardWWSHandler-56b87098.js');
34775
34844
  case 23:
34776
34845
  _yield$import4 = _context12.sent;
34777
34846
  StandardWWSHandler = _yield$import4["default"];
@@ -36161,7 +36230,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36161
36230
  while (1) switch (_context3.prev = _context3.next) {
36162
36231
  case 0:
36163
36232
  _context3.next = 2;
36164
- return import('./Host3DSignalR-be8b605a.js');
36233
+ return import('./Host3DSignalR-45e86f11.js');
36165
36234
  case 2:
36166
36235
  _yield$import = _context3.sent;
36167
36236
  Host3DSignalR = _yield$import["default"];
@@ -37713,7 +37782,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
37713
37782
  break;
37714
37783
  case 8:
37715
37784
  _context4.next = 10;
37716
- return import('./DivaStandardPlanner-b5403631.js');
37785
+ return import('./DivaStandardPlanner-15069451.js');
37717
37786
  case 10:
37718
37787
  _yield$import = _context4.sent;
37719
37788
  DivaStandardPlanner = _yield$import["default"];
@@ -37724,7 +37793,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
37724
37793
  return _context4.abrupt("break", 21);
37725
37794
  case 15:
37726
37795
  _context4.next = 17;
37727
- return import('./DivaBoxPlanner-c5f19be3.js');
37796
+ return import('./DivaBoxPlanner-256f6673.js');
37728
37797
  case 17:
37729
37798
  _yield$import2 = _context4.sent;
37730
37799
  DivaBoxPlanner = _yield$import2["default"];
@@ -40401,76 +40470,90 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40401
40470
  key: "saveToBasketWrapper",
40402
40471
  value: function () {
40403
40472
  var _saveToBasketWrapper = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25(event, repairOnly, force) {
40404
- var _this$actions25,
40405
- _this$actions25$toggl,
40406
- _this$actions26,
40473
+ var _this$actions26,
40407
40474
  _this$actions26$toggl,
40475
+ _this$actions27,
40476
+ _this$actions27$toggl,
40408
40477
  _this2 = this,
40409
- _this$actions30,
40478
+ _this$actions31,
40410
40479
  _this$i18n14;
40411
- var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product, result, _this$actions27, _this$i18n8, _this$i18n9, _this$actions28, _this$i18n10, _this$i18n11, _this$actions29, _this$i18n12, _this$i18n13, _this$updatePlannerMs2;
40480
+ var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product, _this$actSet9, url, _result, _this$actions25, result, _this$actions28, _this$i18n8, _this$i18n9, _this$actions29, _this$i18n10, _this$i18n11, _this$actions30, _this$i18n12, _this$i18n13, _this$updatePlannerMs2;
40412
40481
  return _regeneratorRuntime.wrap(function _callee25$(_context25) {
40413
40482
  while (1) switch (_context25.prev = _context25.next) {
40414
40483
  case 0:
40415
40484
  returnTo = this.getReturnTo(event);
40416
- finalEvent = event;
40485
+ finalEvent = {
40486
+ event: event,
40487
+ saveBasket: true
40488
+ };
40417
40489
  if (!(returnTo == 'OPEN_LEAFLET_BARRIER')) {
40418
- _context25.next = 14;
40490
+ _context25.next = 21;
40419
40491
  break;
40420
40492
  }
40421
40493
  product = undefined;
40422
40494
  if (!((_this$api$getBarrierC = this.api.getBarrierConfig()) !== null && _this$api$getBarrierC !== void 0 && _this$api$getBarrierC.affiliate)) {
40423
- _context25.next = 8;
40495
+ _context25.next = 10;
40424
40496
  break;
40425
40497
  }
40426
- _context25.next = 7;
40427
- return this.api.getDataCache(this.api.getCatalogProductUrl(this.actSet().getCatalogCodex()), undefined, undefined, 'catalog');
40428
- case 7:
40429
- _context25.sent;
40498
+ url = this.api.getCatalogProductUrl(this.actSet().getCatalogCodex());
40499
+ _context25.next = 8;
40500
+ return this.api.getDataCache(url, url, undefined, 'catalog');
40430
40501
  case 8:
40431
- _context25.next = 10;
40432
- return (_this$openLeafeltBarr = this.openLeafeltBarrier) === null || _this$openLeafeltBarr === void 0 ? void 0 : _this$openLeafeltBarr.call(this, this.divaBasketHandler, this.api.getBarrierConfig(), product);
40502
+ _result = _context25.sent;
40503
+ product = productHandlerInstance.getBestMatch((_this$actSet9 = this.actSet()) === null || _this$actSet9 === void 0 ? void 0 : _this$actSet9.getDivaArticles(), _result);
40433
40504
  case 10:
40505
+ _context25.next = 12;
40506
+ return (_this$openLeafeltBarr = this.openLeafeltBarrier) === null || _this$openLeafeltBarr === void 0 ? void 0 : _this$openLeafeltBarr.call(this, this.divaBasketHandler, this.api.getBarrierConfig(), product);
40507
+ case 12:
40434
40508
  finalEvent = _context25.sent;
40435
40509
  if (finalEvent) {
40436
- _context25.next = 13;
40510
+ _context25.next = 17;
40437
40511
  break;
40438
40512
  }
40439
40513
  return _context25.abrupt("return", 'canceled');
40440
- case 13:
40441
- returnTo = finalEvent == 'onAddToBasket' ? 'OPEN_PDF' : returnTo;
40442
- case 14:
40443
- (_this$actions25 = this.actions) === null || _this$actions25 === void 0 || (_this$actions25$toggl = _this$actions25.toggleLoading) === null || _this$actions25$toggl === void 0 || _this$actions25$toggl.call(_this$actions25, 'Planner_Saving', false, true);
40444
- _context25.next = 17;
40445
- return this.saveToBasket(finalEvent, repairOnly, force);
40446
40514
  case 17:
40515
+ if (!(!finalEvent.saveBasket && finalEvent.event)) {
40516
+ _context25.next = 20;
40517
+ break;
40518
+ }
40519
+ (_this$actions25 = this.actions) === null || _this$actions25 === void 0 || _this$actions25.onEvent({
40520
+ type: finalEvent.event
40521
+ });
40522
+ return _context25.abrupt("return", 'canceled');
40523
+ case 20:
40524
+ returnTo = finalEvent.event == 'onAddToBasket' ? 'OPEN_PDF' : returnTo;
40525
+ case 21:
40526
+ (_this$actions26 = this.actions) === null || _this$actions26 === void 0 || (_this$actions26$toggl = _this$actions26.toggleLoading) === null || _this$actions26$toggl === void 0 || _this$actions26$toggl.call(_this$actions26, 'Planner_Saving', false, true);
40527
+ _context25.next = 24;
40528
+ return this.saveToBasket(finalEvent.event, repairOnly, force);
40529
+ case 24:
40447
40530
  result = _context25.sent;
40448
- (_this$actions26 = this.actions) === null || _this$actions26 === void 0 || (_this$actions26$toggl = _this$actions26.toggleLoading) === null || _this$actions26$toggl === void 0 || _this$actions26$toggl.call(_this$actions26, 'Planner_Saving', false, false);
40531
+ (_this$actions27 = this.actions) === null || _this$actions27 === void 0 || (_this$actions27$toggl = _this$actions27.toggleLoading) === null || _this$actions27$toggl === void 0 || _this$actions27$toggl.call(_this$actions27, 'Planner_Saving', false, false);
40449
40532
  if (!(result === 'canceled')) {
40450
- _context25.next = 23;
40533
+ _context25.next = 30;
40451
40534
  break;
40452
40535
  }
40453
40536
  LOG$1.error(new DivaError('failed to save Basket'));
40454
- (_this$actions27 = this.actions) === null || _this$actions27 === void 0 || _this$actions27.openModal({
40537
+ (_this$actions28 = this.actions) === null || _this$actions28 === void 0 || _this$actions28.openModal({
40455
40538
  text: ((_this$i18n8 = this.i18n()) === null || _this$i18n8 === void 0 ? void 0 : _this$i18n8.t('modal.general_error')) + ' --- ' + DivaUtils.formatDate(new Date(), true, undefined, true) + ' --- ' + DivaUtils.getCurrentTraceId() ? ((_this$i18n9 = this.i18n()) === null || _this$i18n9 === void 0 ? void 0 : _this$i18n9.t('modal.errorcode')) + ': ' + DivaUtils.getCurrentTraceId() : '',
40456
40539
  accept: true
40457
40540
  });
40458
40541
  return _context25.abrupt("return", result);
40459
- case 23:
40542
+ case 30:
40460
40543
  _context25.t0 = returnTo;
40461
- _context25.next = _context25.t0 === 'OPEN_PDF' ? 26 : _context25.t0 === 'SAVE_BASKET_WITH_MODAL' ? 28 : 29;
40544
+ _context25.next = _context25.t0 === 'OPEN_PDF' ? 33 : _context25.t0 === 'SAVE_BASKET_WITH_MODAL' ? 35 : 36;
40462
40545
  break;
40463
- case 26:
40546
+ case 33:
40464
40547
  if (!this.getBasket().PDFDocumentURL) {
40465
40548
  LOG$1.error(new DivaError('PDF url is missing in basket', {
40466
40549
  code: 'WC_0010'
40467
40550
  }));
40468
- (_this$actions28 = this.actions) === null || _this$actions28 === void 0 || _this$actions28.openModal({
40551
+ (_this$actions29 = this.actions) === null || _this$actions29 === void 0 || _this$actions29.openModal({
40469
40552
  text: ((_this$i18n10 = this.i18n()) === null || _this$i18n10 === void 0 ? void 0 : _this$i18n10.t('modal.general_error')) + ' --- ' + DivaUtils.formatDate(new Date(), true, undefined, true) + ' --- ' + DivaUtils.getCurrentTraceId() ? ((_this$i18n11 = this.i18n()) === null || _this$i18n11 === void 0 ? void 0 : _this$i18n11.t('modal.errorcode')) + ': ' + DivaUtils.getCurrentTraceId() : '',
40470
40553
  accept: true
40471
40554
  });
40472
40555
  } else {
40473
- (_this$actions29 = this.actions) === null || _this$actions29 === void 0 || _this$actions29.openModal({
40556
+ (_this$actions30 = this.actions) === null || _this$actions30 === void 0 || _this$actions30.openModal({
40474
40557
  text: (_this$i18n12 = this.i18n()) === null || _this$i18n12 === void 0 ? void 0 : _this$i18n12.t(this.divaBasketHandler.actBasket.Status === 'ORDER' ? 'modal.open_order_pdf_now' : 'modal.open_leaflet_pdf_now'),
40475
40558
  accept: (_this$i18n13 = this.i18n()) === null || _this$i18n13 === void 0 ? void 0 : _this$i18n13.t('modals.open_now'),
40476
40559
  callback: function callback() {
@@ -40478,22 +40561,22 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40478
40561
  }
40479
40562
  });
40480
40563
  }
40481
- return _context25.abrupt("break", 29);
40482
- case 28:
40483
- (_this$actions30 = this.actions) === null || _this$actions30 === void 0 || _this$actions30.openModal({
40564
+ return _context25.abrupt("break", 36);
40565
+ case 35:
40566
+ (_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.openModal({
40484
40567
  text: (_this$i18n14 = this.i18n()) === null || _this$i18n14 === void 0 ? void 0 : _this$i18n14.t('modal.planning_saved'),
40485
40568
  accept: true
40486
40569
  });
40487
- case 29:
40570
+ case 36:
40488
40571
  if (!(result == 'noArticleToSave')) {
40489
- _context25.next = 32;
40572
+ _context25.next = 39;
40490
40573
  break;
40491
40574
  }
40492
40575
  (_this$updatePlannerMs2 = this.updatePlannerMsgContainer) === null || _this$updatePlannerMs2 === void 0 || _this$updatePlannerMs2.call(this, 'NOTHING_TO_SAVE', true, 'INFO', 'NOTHING_TO_SAVE', true);
40493
40576
  return _context25.abrupt("return", 'canceled');
40494
- case 32:
40577
+ case 39:
40495
40578
  return _context25.abrupt("return", result);
40496
- case 33:
40579
+ case 40:
40497
40580
  case "end":
40498
40581
  return _context25.stop();
40499
40582
  }
@@ -40508,7 +40591,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40508
40591
  key: "saveToBasket",
40509
40592
  value: function () {
40510
40593
  var _saveToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26(event, repairOnly, force) {
40511
- var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions31, _this$actions32, _this$actions33;
40594
+ var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions32, _this$actions33, _this$actions34;
40512
40595
  var set, actBasket, returnTo, oldReturnTo, result, newDivaNr, _result2, _event4, product;
40513
40596
  return _regeneratorRuntime.wrap(function _callee26$(_context26) {
40514
40597
  while (1) switch (_context26.prev = _context26.next) {
@@ -40580,8 +40663,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40580
40663
  _context26.next = _context26.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 30 : _context26.t3 === 'OPEN_SELLER_BASKET' ? 33 : _context26.t3 === 'OPEN_PDF' ? 35 : _context26.t3 === 'SAVE_BASKET_WITH_MODAL' ? 35 : _context26.t3 === 'SAVE_BASKET' ? 35 : _context26.t3 === 'SAVE_BASKET_SYNC' ? 35 : _context26.t3 === 'OPEN_LEAFLET_BARRIER' ? 35 : 55;
40581
40664
  break;
40582
40665
  case 30:
40583
- (_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.toggleLoading('buildScene', false, false);
40584
- (_this$actions32 = this.actions) === null || _this$actions32 === void 0 || _this$actions32.openComponent({
40666
+ (_this$actions32 = this.actions) === null || _this$actions32 === void 0 || _this$actions32.toggleLoading('buildScene', false, false);
40667
+ (_this$actions33 = this.actions) === null || _this$actions33 === void 0 || _this$actions33.openComponent({
40585
40668
  type: 'SELLER',
40586
40669
  parameters: {
40587
40670
  module: 'PCreator',
@@ -40593,7 +40676,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40593
40676
  });
40594
40677
  return _context26.abrupt("break", 55);
40595
40678
  case 33:
40596
- (_this$actions33 = this.actions) === null || _this$actions33 === void 0 || _this$actions33.openComponent({
40679
+ (_this$actions34 = this.actions) === null || _this$actions34 === void 0 || _this$actions34.openComponent({
40597
40680
  type: 'SELLER',
40598
40681
  parameters: {
40599
40682
  module: 'Basket',
@@ -40707,8 +40790,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40707
40790
 
40708
40791
  //if planner is hidden by config but nothing is planned initially
40709
40792
  if (plannerType === 'NONE') {
40710
- var _this$plannerConfig$a7, _this$actSet9;
40711
- if (!this.plannerConfig.divaNr && this.plannerConfig.catalogCodex && !((_this$plannerConfig$a7 = this.plannerConfig.articleCodexes) !== null && _this$plannerConfig$a7 !== void 0 && _this$plannerConfig$a7.length) && !this.plannerConfig.productId && !this.plannerConfig.customProductId && !this.plannerConfig.basketData && !((_this$actSet9 = this.actSet()) !== null && _this$actSet9 !== void 0 && (_this$actSet9 = _this$actSet9.CatalogData.startPlannerArticle) !== null && _this$actSet9 !== void 0 && _this$actSet9.length)) {
40793
+ var _this$plannerConfig$a7, _this$actSet10;
40794
+ if (!this.plannerConfig.divaNr && this.plannerConfig.catalogCodex && !((_this$plannerConfig$a7 = this.plannerConfig.articleCodexes) !== null && _this$plannerConfig$a7 !== void 0 && _this$plannerConfig$a7.length) && !this.plannerConfig.productId && !this.plannerConfig.customProductId && !this.plannerConfig.basketData && !((_this$actSet10 = this.actSet()) !== null && _this$actSet10 !== void 0 && (_this$actSet10 = _this$actSet10.CatalogData.startPlannerArticle) !== null && _this$actSet10 !== void 0 && _this$actSet10.length)) {
40712
40795
  plannerType = 'PLANNER';
40713
40796
  }
40714
40797
  }
@@ -40748,38 +40831,38 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40748
40831
  }, {
40749
40832
  key: "getCurCatalogCodex",
40750
40833
  value: function getCurCatalogCodex() {
40751
- var _this$actSet10;
40752
- return (_this$actSet10 = this.actSet()) === null || _this$actSet10 === void 0 ? void 0 : _this$actSet10.getCatalogCodex();
40834
+ var _this$actSet11;
40835
+ return (_this$actSet11 = this.actSet()) === null || _this$actSet11 === void 0 ? void 0 : _this$actSet11.getCatalogCodex();
40753
40836
  }
40754
40837
  }, {
40755
40838
  key: "getCurCatalogName",
40756
40839
  value: function getCurCatalogName() {
40757
- var _this$actSet11;
40758
- return (_this$actSet11 = this.actSet()) === null || _this$actSet11 === void 0 ? void 0 : _this$actSet11.getCatalogName();
40840
+ var _this$actSet12;
40841
+ return (_this$actSet12 = this.actSet()) === null || _this$actSet12 === void 0 ? void 0 : _this$actSet12.getCatalogName();
40759
40842
  }
40760
40843
  }, {
40761
40844
  key: "getCurAccountName",
40762
40845
  value: function getCurAccountName() {
40763
- var _this$actSet12;
40764
- return (_this$actSet12 = this.actSet()) === null || _this$actSet12 === void 0 ? void 0 : _this$actSet12.getAccountName();
40846
+ var _this$actSet13;
40847
+ return (_this$actSet13 = this.actSet()) === null || _this$actSet13 === void 0 ? void 0 : _this$actSet13.getAccountName();
40765
40848
  }
40766
40849
  }, {
40767
40850
  key: "getCurSupplierGuid",
40768
40851
  value: function getCurSupplierGuid() {
40769
- var _this$actSet13;
40770
- return (_this$actSet13 = this.actSet()) === null || _this$actSet13 === void 0 ? void 0 : _this$actSet13.getSupplierGuid();
40852
+ var _this$actSet14;
40853
+ return (_this$actSet14 = this.actSet()) === null || _this$actSet14 === void 0 ? void 0 : _this$actSet14.getSupplierGuid();
40771
40854
  }
40772
40855
  }, {
40773
40856
  key: "getCurSetPrice",
40774
40857
  value: function getCurSetPrice() {
40775
- var _this$actSet$getSetPr, _this$actSet14;
40776
- return (_this$actSet$getSetPr = (_this$actSet14 = this.actSet()) === null || _this$actSet14 === void 0 ? void 0 : _this$actSet14.getSetPrice()) !== null && _this$actSet$getSetPr !== void 0 ? _this$actSet$getSetPr : 0;
40858
+ var _this$actSet$getSetPr, _this$actSet15;
40859
+ return (_this$actSet$getSetPr = (_this$actSet15 = this.actSet()) === null || _this$actSet15 === void 0 ? void 0 : _this$actSet15.getSetPrice()) !== null && _this$actSet$getSetPr !== void 0 ? _this$actSet$getSetPr : 0;
40777
40860
  }
40778
40861
  }, {
40779
40862
  key: "getCurImageMode",
40780
40863
  value: function getCurImageMode() {
40781
- var _this$actSet15;
40782
- return (_this$actSet15 = this.actSet()) !== null && _this$actSet15 !== void 0 && (_this$actSet15 = _this$actSet15.CatalogData) !== null && _this$actSet15 !== void 0 && _this$actSet15.has3dModels ? '3D' : '2D';
40864
+ var _this$actSet16;
40865
+ return (_this$actSet16 = this.actSet()) !== null && _this$actSet16 !== void 0 && (_this$actSet16 = _this$actSet16.CatalogData) !== null && _this$actSet16 !== void 0 && _this$actSet16.has3dModels ? '3D' : '2D';
40783
40866
  }
40784
40867
  }, {
40785
40868
  key: "getViewConfig",
@@ -40810,65 +40893,65 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40810
40893
  }, {
40811
40894
  key: "doShow3DDimensionLines",
40812
40895
  value: function doShow3DDimensionLines() {
40813
- var _this$actSet16;
40814
- return (_this$actSet16 = this.actSet()) === null || _this$actSet16 === void 0 || (_this$actSet16 = _this$actSet16.CatalogData) === null || _this$actSet16 === void 0 ? void 0 : _this$actSet16.doShow3DDimensionLines;
40896
+ var _this$actSet17;
40897
+ return (_this$actSet17 = this.actSet()) === null || _this$actSet17 === void 0 || (_this$actSet17 = _this$actSet17.CatalogData) === null || _this$actSet17 === void 0 ? void 0 : _this$actSet17.doShow3DDimensionLines;
40815
40898
  }
40816
40899
  }, {
40817
40900
  key: "hidePlannerUiIcons",
40818
40901
  value: function hidePlannerUiIcons() {
40819
- var _this$actSet17;
40820
- return (_this$actSet17 = this.actSet()) === null || _this$actSet17 === void 0 || (_this$actSet17 = _this$actSet17.CatalogData) === null || _this$actSet17 === void 0 ? void 0 : _this$actSet17.hidePlannerUiIcons;
40902
+ var _this$actSet18;
40903
+ return (_this$actSet18 = this.actSet()) === null || _this$actSet18 === void 0 || (_this$actSet18 = _this$actSet18.CatalogData) === null || _this$actSet18 === void 0 ? void 0 : _this$actSet18.hidePlannerUiIcons;
40821
40904
  }
40822
40905
  }, {
40823
40906
  key: "doShowPlannerReplaceMode",
40824
40907
  value: function doShowPlannerReplaceMode() {
40825
- var _this$actSet18, _this$api$getViewConf2, _catalogData$PlannerP, _catalogData$PlannerP2;
40826
- var catalogData = (_this$actSet18 = this.actSet()) === null || _this$actSet18 === void 0 ? void 0 : _this$actSet18.CatalogData;
40908
+ var _this$actSet19, _this$api$getViewConf2, _catalogData$PlannerP, _catalogData$PlannerP2;
40909
+ var catalogData = (_this$actSet19 = this.actSet()) === null || _this$actSet19 === void 0 ? void 0 : _this$actSet19.CatalogData;
40827
40910
  return (catalogData === null || catalogData === void 0 ? void 0 : catalogData.replaceModeActive) && ((_this$api$getViewConf2 = this.api.getViewConfig()) === null || _this$api$getViewConf2 === void 0 ? void 0 : _this$api$getViewConf2.showReplaceFunctionInPlanner) && Object.entries(catalogData.allCatalogPlannerArticles).length > 1 && Object.entries((_catalogData$PlannerP = (_catalogData$PlannerP2 = catalogData.PlannerPaletteViewInfo) === null || _catalogData$PlannerP2 === void 0 ? void 0 : _catalogData$PlannerP2.catalogPlannerArticles) !== null && _catalogData$PlannerP !== void 0 ? _catalogData$PlannerP : {}).length > 1;
40828
40911
  }
40829
40912
  }, {
40830
40913
  key: "doPlannerReplaceAutoSwitch",
40831
40914
  value: function doPlannerReplaceAutoSwitch() {
40832
- var _this$actSet19, _this$api$getViewConf3;
40833
- var catalogData = (_this$actSet19 = this.actSet()) === null || _this$actSet19 === void 0 ? void 0 : _this$actSet19.CatalogData;
40915
+ var _this$actSet20, _this$api$getViewConf3;
40916
+ var catalogData = (_this$actSet20 = this.actSet()) === null || _this$actSet20 === void 0 ? void 0 : _this$actSet20.CatalogData;
40834
40917
  return (catalogData === null || catalogData === void 0 ? void 0 : catalogData.catalogPlannsCompletely) && this.doShowPlannerReplaceMode() && ((_this$api$getViewConf3 = this.api.getViewConfig()) === null || _this$api$getViewConf3 === void 0 ? void 0 : _this$api$getViewConf3.allowAutoSwitchInReplaceFunctionInPlanner);
40835
40918
  }
40836
40919
  }, {
40837
40920
  key: "getHidePlanner",
40838
40921
  value: function getHidePlanner() {
40839
- var _this$actSet20;
40840
- return this.api.getHidePlanner() || !!((_this$actSet20 = this.actSet()) !== null && _this$actSet20 !== void 0 && _this$actSet20.CatalogData.useBoxPlanner);
40922
+ var _this$actSet21;
40923
+ return this.api.getHidePlanner() || !!((_this$actSet21 = this.actSet()) !== null && _this$actSet21 !== void 0 && _this$actSet21.CatalogData.useBoxPlanner);
40841
40924
  }
40842
40925
  }, {
40843
40926
  key: "getAllowRTV",
40844
40927
  value: function getAllowRTV() {
40845
- var _this$actSet21, _this$actSet22;
40928
+ var _this$actSet22, _this$actSet23;
40846
40929
  if (this.getEnableUnityRtvKombi()) return false;
40847
40930
  if (this.api.forceShowRTV()) return true;
40848
- if ((_this$actSet21 = this.actSet()) !== null && _this$actSet21 !== void 0 && _this$actSet21.CatalogData.divaForceRTV) return true;
40849
- if (this.api.getDoShowRTV() && (_this$actSet22 = this.actSet()) !== null && _this$actSet22 !== void 0 && _this$actSet22.CatalogData.divaArReady) return true;
40931
+ if ((_this$actSet22 = this.actSet()) !== null && _this$actSet22 !== void 0 && _this$actSet22.CatalogData.divaForceRTV) return true;
40932
+ if (this.api.getDoShowRTV() && (_this$actSet23 = this.actSet()) !== null && _this$actSet23 !== void 0 && _this$actSet23.CatalogData.divaArReady) return true;
40850
40933
  return false;
40851
40934
  }
40852
40935
  }, {
40853
40936
  key: "geAllowQRCodeAR",
40854
40937
  value: function geAllowQRCodeAR() {
40855
- var _this$actSet23;
40856
- if (this.api.getDoShowAR() && (_this$actSet23 = this.actSet()) !== null && _this$actSet23 !== void 0 && _this$actSet23.CatalogData.divaArReady) return true;
40938
+ var _this$actSet24;
40939
+ if (this.api.getDoShowAR() && (_this$actSet24 = this.actSet()) !== null && _this$actSet24 !== void 0 && _this$actSet24.CatalogData.divaArReady) return true;
40857
40940
  return false;
40858
40941
  }
40859
40942
  }, {
40860
40943
  key: "getEnableUnityRtvKombi",
40861
40944
  value: function getEnableUnityRtvKombi() {
40862
- var _this$actSet24, _this$actSet25;
40945
+ var _this$actSet25, _this$actSet26;
40863
40946
  // if force rtv disable unity kombi - biohort
40864
- if ((_this$actSet24 = this.actSet()) !== null && _this$actSet24 !== void 0 && _this$actSet24.CatalogData.divaForceRTV) return false;
40865
- return ((_this$actSet25 = this.actSet()) === null || _this$actSet25 === void 0 ? void 0 : _this$actSet25.CatalogData.divaArReady) == true && this.api.getEnableRTVUnityKombi();
40947
+ if ((_this$actSet25 = this.actSet()) !== null && _this$actSet25 !== void 0 && _this$actSet25.CatalogData.divaForceRTV) return false;
40948
+ return ((_this$actSet26 = this.actSet()) === null || _this$actSet26 === void 0 ? void 0 : _this$actSet26.CatalogData.divaArReady) == true && this.api.getEnableRTVUnityKombi();
40866
40949
  }
40867
40950
  }, {
40868
40951
  key: "getShelfPlannerRTV",
40869
40952
  value: function getShelfPlannerRTV() {
40870
- var _this$actSet26;
40871
- return (_this$actSet26 = this.actSet()) === null || _this$actSet26 === void 0 ? void 0 : _this$actSet26.CatalogData.useShelfPlannerRTV;
40953
+ var _this$actSet27;
40954
+ return (_this$actSet27 = this.actSet()) === null || _this$actSet27 === void 0 ? void 0 : _this$actSet27.CatalogData.useShelfPlannerRTV;
40872
40955
  }
40873
40956
  }, {
40874
40957
  key: "getBasketData",
@@ -40909,8 +40992,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40909
40992
  }, {
40910
40993
  key: "getCatalogData",
40911
40994
  value: function getCatalogData() {
40912
- var _this$actSet27;
40913
- return (_this$actSet27 = this.actSet()) === null || _this$actSet27 === void 0 ? void 0 : _this$actSet27.CatalogData;
40995
+ var _this$actSet28;
40996
+ return (_this$actSet28 = this.actSet()) === null || _this$actSet28 === void 0 ? void 0 : _this$actSet28.CatalogData;
40914
40997
  }
40915
40998
  }, {
40916
40999
  key: "ReturnTo",
@@ -40926,16 +41009,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40926
41009
  key: "addToBasket",
40927
41010
  value: function () {
40928
41011
  var _addToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(actBasket) {
40929
- var _this$actions34,
40930
- _this$actions35,
41012
+ var _this$actions35,
40931
41013
  _this$actions36,
40932
41014
  _this$actions37,
40933
41015
  _this$actions38,
41016
+ _this$actions39,
40934
41017
  _this$divaBasketHandl3,
40935
41018
  _this3 = this,
40936
- _this$actions39,
40937
41019
  _this$actions40,
40938
- _this$actions41;
41020
+ _this$actions41,
41021
+ _this$actions42,
41022
+ _this$actions43;
40939
41023
  var event,
40940
41024
  addToBasketLog,
40941
41025
  emailConfig,
@@ -40951,43 +41035,43 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40951
41035
  event = _args28.length > 1 && _args28[1] !== undefined ? _args28[1] : 'onAddToBasket';
40952
41036
  addToBasketLog = true;
40953
41037
  _context28.t0 = event;
40954
- _context28.next = _context28.t0 === 'onWebPlanerPrint' ? 5 : _context28.t0 === 'onWebPlanerSave' ? 8 : _context28.t0 === 'onWebPlanerShare' ? 11 : _context28.t0 === 'onRequestConsulation' ? 14 : _context28.t0 === 'onSave' ? 17 : _context28.t0 === 'onSendEmail' ? 20 : _context28.t0 === 'onSaveProduct' ? 25 : _context28.t0 === 'dontSaveBasket' ? 33 : _context28.t0 === 'onAddToBasket' ? 35 : 35;
41038
+ _context28.next = _context28.t0 === 'onWebPlanerPrint' ? 5 : _context28.t0 === 'onWebPlanerSave' ? 8 : _context28.t0 === 'onWebPlanerShare' ? 11 : _context28.t0 === 'onRequestConsulation' ? 14 : _context28.t0 === 'onSave' ? 17 : _context28.t0 === 'onSendEmail' ? 20 : _context28.t0 === 'onSaveProduct' ? 25 : _context28.t0 === 'dontSaveBasket' ? 33 : _context28.t0 === 'onAddToBasket' ? 35 : 38;
40955
41039
  break;
40956
41040
  case 5:
40957
41041
  this.handleSuccessTransaction('onPrintBasket', actBasket);
40958
- (_this$actions34 = this.actions) === null || _this$actions34 === void 0 || _this$actions34.onEvent({
41042
+ (_this$actions35 = this.actions) === null || _this$actions35 === void 0 || _this$actions35.onEvent({
40959
41043
  type: 'onWebPlanerPrint',
40960
41044
  data: actBasket.getAsJson()
40961
41045
  });
40962
- return _context28.abrupt("break", 38);
41046
+ return _context28.abrupt("break", 40);
40963
41047
  case 8:
40964
41048
  this.handleSuccessTransaction('onSaveBasket', actBasket);
40965
- (_this$actions35 = this.actions) === null || _this$actions35 === void 0 || _this$actions35.onEvent({
41049
+ (_this$actions36 = this.actions) === null || _this$actions36 === void 0 || _this$actions36.onEvent({
40966
41050
  type: 'onWebPlanerSave',
40967
41051
  data: actBasket.getAsJson()
40968
41052
  });
40969
- return _context28.abrupt("break", 38);
41053
+ return _context28.abrupt("break", 40);
40970
41054
  case 11:
40971
41055
  this.handleSuccessTransaction('onShareBasket', actBasket);
40972
- (_this$actions36 = this.actions) === null || _this$actions36 === void 0 || _this$actions36.onEvent({
41056
+ (_this$actions37 = this.actions) === null || _this$actions37 === void 0 || _this$actions37.onEvent({
40973
41057
  type: 'onWebPlanerShare',
40974
41058
  data: actBasket.getAsJson()
40975
41059
  });
40976
- return _context28.abrupt("break", 38);
41060
+ return _context28.abrupt("break", 40);
40977
41061
  case 14:
40978
41062
  this.handleSuccessTransaction('onRequestConsulation', actBasket);
40979
- (_this$actions37 = this.actions) === null || _this$actions37 === void 0 || _this$actions37.onEvent({
41063
+ (_this$actions38 = this.actions) === null || _this$actions38 === void 0 || _this$actions38.onEvent({
40980
41064
  type: 'onRequestConsulation',
40981
41065
  data: actBasket.getAsJson()
40982
41066
  });
40983
- return _context28.abrupt("break", 38);
41067
+ return _context28.abrupt("break", 40);
40984
41068
  case 17:
40985
41069
  this.handleSuccessTransaction('onSave', actBasket);
40986
- (_this$actions38 = this.actions) === null || _this$actions38 === void 0 || _this$actions38.onEvent({
41070
+ (_this$actions39 = this.actions) === null || _this$actions39 === void 0 || _this$actions39.onEvent({
40987
41071
  type: 'onSave',
40988
41072
  data: actBasket.getAsJson()
40989
41073
  });
40990
- return _context28.abrupt("break", 38);
41074
+ return _context28.abrupt("break", 40);
40991
41075
  case 20:
40992
41076
  emailConfig = (_this$divaBasketHandl3 = this.divaBasketHandler.emailConfig) !== null && _this$divaBasketHandl3 !== void 0 ? _this$divaBasketHandl3 : this.getEmailConfig(); //reset the emailConfig
40993
41077
  this.divaBasketHandler.emailConfig = undefined;
@@ -41019,11 +41103,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41019
41103
  });
41020
41104
  this.handleSuccessTransaction('onSendEmail', actBasket);
41021
41105
  }
41022
- (_this$actions39 = this.actions) === null || _this$actions39 === void 0 || _this$actions39.onEvent({
41106
+ (_this$actions40 = this.actions) === null || _this$actions40 === void 0 || _this$actions40.onEvent({
41023
41107
  type: 'onAddToBasket',
41024
41108
  data: actBasket.getAsJson()
41025
41109
  });
41026
- return _context28.abrupt("break", 38);
41110
+ return _context28.abrupt("break", 40);
41027
41111
  case 25:
41028
41112
  this.actSet().CatalogData;
41029
41113
  _context28.next = 28;
@@ -41031,7 +41115,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41031
41115
  case 28:
41032
41116
  products = _context28.sent;
41033
41117
  this.handleSuccessTransaction('onSaveProduct', actBasket);
41034
- (_this$actions40 = this.actions) === null || _this$actions40 === void 0 || _this$actions40.onEvent({
41118
+ (_this$actions41 = this.actions) === null || _this$actions41 === void 0 || _this$actions41.onEvent({
41035
41119
  type: 'onAddToBasket',
41036
41120
  data: actBasket.getAsJson()
41037
41121
  });
@@ -41045,14 +41129,20 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41045
41129
  addToBasketLog = false;
41046
41130
  case 35:
41047
41131
  if (addToBasketLog) this.handleSuccessTransaction('onAddToBasket', actBasket);
41048
- (_this$actions41 = this.actions) === null || _this$actions41 === void 0 || _this$actions41.onEvent({
41132
+ (_this$actions42 = this.actions) === null || _this$actions42 === void 0 || _this$actions42.onEvent({
41049
41133
  type: 'onAddToBasket',
41050
41134
  data: actBasket.getAsJson()
41051
41135
  });
41052
- return _context28.abrupt("break", 38);
41136
+ return _context28.abrupt("break", 40);
41053
41137
  case 38:
41138
+ (_this$actions43 = this.actions) === null || _this$actions43 === void 0 || _this$actions43.onEvent({
41139
+ type: event,
41140
+ data: actBasket.getAsJson()
41141
+ });
41142
+ return _context28.abrupt("break", 40);
41143
+ case 40:
41054
41144
  return _context28.abrupt("return");
41055
- case 39:
41145
+ case 41:
41056
41146
  case "end":
41057
41147
  return _context28.stop();
41058
41148
  }
@@ -41077,8 +41167,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41077
41167
  }, {
41078
41168
  key: "openPDFpostAsEvent",
41079
41169
  value: function openPDFpostAsEvent(mongoDBId) {
41080
- var _this$actions42, _this$actions43, _this$actions44;
41081
- (_this$actions42 = this.actions) === null || _this$actions42 === void 0 || _this$actions42.updateBreadcrumbs({
41170
+ var _this$actions44, _this$actions45, _this$actions46;
41171
+ (_this$actions44 = this.actions) === null || _this$actions44 === void 0 || _this$actions44.updateBreadcrumbs({
41082
41172
  type: 'update',
41083
41173
  param: {
41084
41174
  groupId: 'SHOWROOM',
@@ -41092,7 +41182,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41092
41182
  }
41093
41183
  }
41094
41184
  });
41095
- (_this$actions43 = this.actions) === null || _this$actions43 === void 0 || _this$actions43.updateBreadcrumbs({
41185
+ (_this$actions45 = this.actions) === null || _this$actions45 === void 0 || _this$actions45.updateBreadcrumbs({
41096
41186
  type: 'update',
41097
41187
  param: {
41098
41188
  groupId: 'SHOWROOM',
@@ -41106,7 +41196,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41106
41196
  }
41107
41197
  }
41108
41198
  });
41109
- (_this$actions44 = this.actions) === null || _this$actions44 === void 0 || _this$actions44.openComponent({
41199
+ (_this$actions46 = this.actions) === null || _this$actions46 === void 0 || _this$actions46.openComponent({
41110
41200
  type: 'REPORT',
41111
41201
  parameters: {
41112
41202
  id: mongoDBId
@@ -41326,14 +41416,14 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41326
41416
  }, {
41327
41417
  key: "subscribeToWebPlannerEvents",
41328
41418
  value: function subscribeToWebPlannerEvents() {
41329
- var _this$actions45;
41330
- (_this$actions45 = this.actions) === null || _this$actions45 === void 0 || _this$actions45.subscribeEvents(this.addToBasketEventFunction);
41419
+ var _this$actions47;
41420
+ (_this$actions47 = this.actions) === null || _this$actions47 === void 0 || _this$actions47.subscribeEvents(this.addToBasketEventFunction);
41331
41421
  }
41332
41422
  }, {
41333
41423
  key: "unsubscribeFromWebPlannerEvents",
41334
41424
  value: function unsubscribeFromWebPlannerEvents() {
41335
- var _this$actions46;
41336
- (_this$actions46 = this.actions) === null || _this$actions46 === void 0 || _this$actions46.unSubscribeEvents(this.addToBasketEventFunction);
41425
+ var _this$actions48;
41426
+ (_this$actions48 = this.actions) === null || _this$actions48 === void 0 || _this$actions48.unSubscribeEvents(this.addToBasketEventFunction);
41337
41427
  }
41338
41428
  }, {
41339
41429
  key: "initApiForLogicOnly",
@@ -41401,7 +41491,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41401
41491
  }, {
41402
41492
  key: "initBasket",
41403
41493
  value: function () {
41404
- var _initBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(init3D, ignoreFavorites) {
41494
+ var _initBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(init3D, ignoreFavorites, onlyCalcVariants) {
41405
41495
  var _initSetState$api$web2;
41406
41496
  var initSetState, sets, result, _sets$, set, basket;
41407
41497
  return _regeneratorRuntime.wrap(function _callee31$(_context31) {
@@ -41430,28 +41520,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41430
41520
  (_sets$ = sets[0]) === null || _sets$ === void 0 || _sets$.remindPriceForHash(result);
41431
41521
  }
41432
41522
  case 12:
41433
- //TODO: GLOBAL STUFF
41434
41523
  set = this.actSet();
41524
+ if (set) set.onlyCalcVariants = onlyCalcVariants;
41435
41525
  setHandlerInstance.loadConfigStructureOfActSet(set, this.getCurPlannerType());
41436
41526
  if (!(favoritesHandlerInstance.FavoritesDefined(set) && !ignoreFavorites)) {
41437
- _context31.next = 17;
41527
+ _context31.next = 18;
41438
41528
  break;
41439
41529
  }
41440
- _context31.next = 17;
41530
+ _context31.next = 18;
41441
41531
  return this.handleFavorites(init3D ? 'CALC' : 'REPAIR');
41442
- case 17:
41443
- _context31.next = 19;
41532
+ case 18:
41533
+ _context31.next = 20;
41444
41534
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !init3D, this.doAllowSetPlanner(), this.ReturnTo);
41445
- case 19:
41535
+ case 20:
41446
41536
  basket = _context31.sent;
41447
41537
  return _context31.abrupt("return", basket);
41448
- case 21:
41538
+ case 22:
41449
41539
  case "end":
41450
41540
  return _context31.stop();
41451
41541
  }
41452
41542
  }, _callee31, this);
41453
41543
  }));
41454
- function initBasket(_x78, _x79) {
41544
+ function initBasket(_x78, _x79, _x80) {
41455
41545
  return _initBasket.apply(this, arguments);
41456
41546
  }
41457
41547
  return initBasket;
@@ -41528,7 +41618,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41528
41618
  }
41529
41619
  }, _callee33, this);
41530
41620
  }));
41531
- function handleFavorites(_x80) {
41621
+ function handleFavorites(_x81) {
41532
41622
  return _handleFavorites.apply(this, arguments);
41533
41623
  }
41534
41624
  return handleFavorites;
@@ -41582,7 +41672,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41582
41672
  }
41583
41673
  }, _callee34, this);
41584
41674
  }));
41585
- function initSapOrderLinesFromBasket(_x81, _x82, _x83) {
41675
+ function initSapOrderLinesFromBasket(_x82, _x83, _x84) {
41586
41676
  return _initSapOrderLinesFromBasket.apply(this, arguments);
41587
41677
  }
41588
41678
  return initSapOrderLinesFromBasket;