@crystaldesign/web-planner-logic 24.12.0-beta.9 → 24.12.0-rc.1

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 (94) hide show
  1. package/build/cjs/{DivaBoxPlanner-7b508f32.js → DivaBoxPlanner-ed867881.js} +2 -2
  2. package/build/cjs/{DivaStandardPlanner-c73e6e57.js → DivaStandardPlanner-31757726.js} +9 -8
  3. package/build/cjs/{DoorPlanner-ffa7af62.js → DoorPlanner-4eb75da2.js} +3 -3
  4. package/build/cjs/{Host3DSignalR-d3830717.js → Host3DSignalR-6b8cace7.js} +20 -38
  5. package/build/cjs/{LiviqueWWSHandler-85a1dc89.js → LiviqueWWSHandler-977c3952.js} +2 -2
  6. package/build/cjs/{PfisterWWSHandler-b47dba23.js → PfisterWWSHandler-ca73bf2c.js} +2 -2
  7. package/build/cjs/{PlannerHandler2D-9d9d1af9.js → PlannerHandler2D-fee08c06.js} +37 -32
  8. package/build/cjs/{SeriousBasketHandler-28f031fa.js → SeriousBasketHandler-712a57c0.js} +2 -2
  9. package/build/cjs/{ShelfPlanner-4b697826.js → ShelfPlanner-8db07a13.js} +1 -1
  10. package/build/cjs/{StandardWWSHandler-ab0c107b.js → StandardWWSHandler-435c1ce1.js} +2 -2
  11. package/build/cjs/{index-bceec53b.js → index-2758bcda.js} +801 -1451
  12. package/build/cjs/index.js +1 -2
  13. package/build/esm/{DivaBoxPlanner-81bbe89c.js → DivaBoxPlanner-0f855505.js} +2 -2
  14. package/build/esm/{DivaStandardPlanner-c3f7e518.js → DivaStandardPlanner-7d18b2c2.js} +9 -8
  15. package/build/esm/{DoorPlanner-f4b338c4.js → DoorPlanner-62fe0f1e.js} +3 -3
  16. package/build/esm/{Host3DSignalR-45bb9e24.js → Host3DSignalR-42b4d1d2.js} +20 -19
  17. package/build/esm/{LiviqueWWSHandler-d401b8c4.js → LiviqueWWSHandler-049eb5fd.js} +2 -2
  18. package/build/esm/{PfisterWWSHandler-ebfad71d.js → PfisterWWSHandler-3ab3de4e.js} +2 -2
  19. package/build/esm/{PlannerHandler2D-fb755d99.js → PlannerHandler2D-0feebd6f.js} +37 -32
  20. package/build/esm/{SeriousBasketHandler-53ff90b8.js → SeriousBasketHandler-53dd21ff.js} +2 -2
  21. package/build/esm/{ShelfPlanner-569fe7f0.js → ShelfPlanner-268c974f.js} +1 -1
  22. package/build/esm/{StandardWWSHandler-b903e37c.js → StandardWWSHandler-385a2299.js} +2 -2
  23. package/build/esm/{index-3bbc6483.js → index-1effd2df.js} +803 -1451
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/index.d.ts +1 -2
  26. package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts +1 -2
  28. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/Articles/ArticleInfoType.d.ts +1 -2
  30. package/build/types/web-planner-logic/src/interface/Articles/ArticleInfoType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/Articles/InitArticleType.d.ts +2 -2
  32. package/build/types/web-planner-logic/src/interface/Articles/InitArticleType.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts +1 -3
  34. package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/interface/Configuration.d.ts +0 -1
  36. package/build/types/web-planner-logic/src/interface/Configuration.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts +2 -0
  38. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +1 -0
  40. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts +2 -0
  42. package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/interface/Products/index.d.ts +6 -1
  44. package/build/types/web-planner-logic/src/interface/Products/index.d.ts.map +1 -1
  45. package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts +1 -1
  46. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +6 -6
  47. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
  48. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts +50 -57
  49. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts.map +1 -1
  50. package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts +1 -3
  51. package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts.map +1 -1
  52. package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts +1 -3
  53. package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts.map +1 -1
  54. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts +1 -3
  55. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts.map +1 -1
  56. package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts +1 -3
  57. package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts.map +1 -1
  58. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +2 -2
  59. package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts +1 -2
  60. package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts.map +1 -1
  61. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +3 -4
  62. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  63. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +56 -61
  64. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  65. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts +0 -2
  66. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts.map +1 -1
  67. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts +12 -13
  68. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts.map +1 -1
  69. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts +3 -44
  70. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts.map +1 -1
  71. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +5 -5
  72. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
  73. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +3 -6
  74. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  75. package/build/types/web-planner-logic/src/logic/Set/FavoritesHandler.d.ts.map +1 -1
  76. package/build/types/web-planner-logic/src/model/Articles/CatalogArticleData.d.ts.map +1 -1
  77. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts +3 -2
  78. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts.map +1 -1
  79. package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts +2 -0
  80. package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts.map +1 -1
  81. package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts +2 -0
  82. package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts.map +1 -1
  83. package/build/types/web-planner-logic/src/model/Options/CatalogOptionValueData.d.ts.map +1 -1
  84. package/build/types/web-planner-logic/src/test/mocFunctions/index.d.ts.map +1 -1
  85. package/build/types/web-planner-logic/src/test/scripts/create_renderorder.d.ts.map +1 -1
  86. package/build/types/web-planner-logic/src/test/scripts/getOrigProductId.d.ts.map +1 -1
  87. package/build/types/web-planner-logic/src/test/scripts/productHandlerMoc.d.ts.map +1 -1
  88. package/package.json +16 -17
  89. package/build/cjs/ProductBasketHandler-22cb7ee4.js +0 -62
  90. package/build/esm/ProductBasketHandler-68443648.js +0 -55
  91. package/build/types/web-planner-logic/src/logic/Basket/ProductBasketHandler.d.ts +0 -14
  92. package/build/types/web-planner-logic/src/logic/Basket/ProductBasketHandler.d.ts.map +0 -1
  93. package/build/types/web-planner-logic/src/logic/Product/Product.d.ts +0 -71
  94. package/build/types/web-planner-logic/src/logic/Product/Product.d.ts.map +0 -1
@@ -431,7 +431,6 @@ var DivaApiHandler = /*#__PURE__*/function () {
431
431
  mediaServiceApiKey: data.divaMediaServiceApiKey,
432
432
  language: lang !== null && lang !== void 0 ? lang : this.getLanguage(),
433
433
  abTestCases: data.abTestCases !== undefined ? data.abTestCases : [],
434
- checkForProductsInStock: data.checkForProductsInStock,
435
434
  checkForProductsPrice: data.checkForProductsPrice,
436
435
  doDisablePlanner2D: data.doDisablePlanner2D,
437
436
  diva3dStaticBGImage: data.diva3dStaticBGImage != undefined ? data.diva3dStaticBGImage : false,
@@ -503,29 +502,23 @@ var DivaApiHandler = /*#__PURE__*/function () {
503
502
  var _this$apiConfig$host, _this$apiConfig10;
504
503
  return (_this$apiConfig$host = (_this$apiConfig10 = this.apiConfig) === null || _this$apiConfig10 === void 0 ? void 0 : _this$apiConfig10.host3d) !== null && _this$apiConfig$host !== void 0 ? _this$apiConfig$host : '';
505
504
  }
506
- }, {
507
- key: "doCheckForProductsInStock",
508
- value: function doCheckForProductsInStock() {
509
- var _this$divaWebConfigDa4;
510
- return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.checkForProductsInStock;
511
- }
512
505
  }, {
513
506
  key: "doCheckForProductsPrice",
514
507
  value: function doCheckForProductsPrice() {
515
- var _this$divaWebConfigDa5;
516
- return this.doCheckForProductsInStock() || ((_this$divaWebConfigDa5 = this.divaWebConfigData) === null || _this$divaWebConfigDa5 === void 0 ? void 0 : _this$divaWebConfigDa5.checkForProductsPrice);
508
+ var _this$divaWebConfigDa4;
509
+ return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.checkForProductsPrice;
517
510
  }
518
511
  }, {
519
512
  key: "getReportConfigIdentifier",
520
513
  value: function getReportConfigIdentifier() {
521
- var _this$divaWebConfigDa6;
522
- return (_this$divaWebConfigDa6 = this.divaWebConfigData) === null || _this$divaWebConfigDa6 === void 0 ? void 0 : _this$divaWebConfigDa6.reportConfigIdentifier;
514
+ var _this$divaWebConfigDa5;
515
+ return (_this$divaWebConfigDa5 = this.divaWebConfigData) === null || _this$divaWebConfigDa5 === void 0 ? void 0 : _this$divaWebConfigDa5.reportConfigIdentifier;
523
516
  }
524
517
  }, {
525
518
  key: "getPrintOptions",
526
519
  value: function getPrintOptions() {
527
- var _this$divaWebConfigDa7;
528
- var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa7 = this.divaWebConfigData) === null || _this$divaWebConfigDa7 === void 0 ? void 0 : _this$divaWebConfigDa7.reportConfig;
520
+ var _this$divaWebConfigDa6;
521
+ var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa6 = this.divaWebConfigData) === null || _this$divaWebConfigDa6 === void 0 ? void 0 : _this$divaWebConfigDa6.reportConfig;
529
522
  return {
530
523
  Gdpr: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithGDPR),
531
524
  PlanningSketch: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithPlanningSketch),
@@ -545,8 +538,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
545
538
  }, {
546
539
  key: "get3DRenderGroup",
547
540
  value: function get3DRenderGroup() {
548
- var _this$divaWebConfigDa8, _this$divaWebConfigDa9;
549
- return (_this$divaWebConfigDa8 = (_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dRenderGroup) !== null && _this$divaWebConfigDa8 !== void 0 ? _this$divaWebConfigDa8 : '';
541
+ var _this$divaWebConfigDa7, _this$divaWebConfigDa8;
542
+ return (_this$divaWebConfigDa7 = (_this$divaWebConfigDa8 = this.divaWebConfigData) === null || _this$divaWebConfigDa8 === void 0 ? void 0 : _this$divaWebConfigDa8.diva3dRenderGroup) !== null && _this$divaWebConfigDa7 !== void 0 ? _this$divaWebConfigDa7 : '';
550
543
  }
551
544
  }, {
552
545
  key: "getServerId",
@@ -583,86 +576,86 @@ var DivaApiHandler = /*#__PURE__*/function () {
583
576
  }, {
584
577
  key: "getDiva3dStaticBGImage",
585
578
  value: function getDiva3dStaticBGImage() {
586
- var _this$divaWebConfigDa10;
587
- return (_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3dStaticBGImage;
579
+ var _this$divaWebConfigDa9;
580
+ return (_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dStaticBGImage;
588
581
  }
589
582
  }, {
590
583
  key: "getDiva3dStaticBGImage_DefaultRoomList",
591
584
  value: function getDiva3dStaticBGImage_DefaultRoomList() {
592
- var _this$divaWebConfigDa11, _this$divaWebConfigDa12;
593
- return ((_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa12 = this.divaWebConfigData) === null || _this$divaWebConfigDa12 === void 0 ? void 0 : _this$divaWebConfigDa12.diva3dStaticBGImage_DefaultRoomList;
585
+ var _this$divaWebConfigDa10, _this$divaWebConfigDa11;
586
+ return ((_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.diva3dStaticBGImage_DefaultRoomList;
594
587
  }
595
588
  }, {
596
589
  key: "getDiva3DAllowDefaultCatRoomList",
597
590
  value: function getDiva3DAllowDefaultCatRoomList() {
598
- var _this$divaWebConfigDa13;
599
- return (_this$divaWebConfigDa13 = this.divaWebConfigData) === null || _this$divaWebConfigDa13 === void 0 ? void 0 : _this$divaWebConfigDa13.diva3DAllowDefaultCatRoomList;
591
+ var _this$divaWebConfigDa12;
592
+ return (_this$divaWebConfigDa12 = this.divaWebConfigData) === null || _this$divaWebConfigDa12 === void 0 ? void 0 : _this$divaWebConfigDa12.diva3DAllowDefaultCatRoomList;
600
593
  }
601
594
  }, {
602
595
  key: "doAllowSetPlanner",
603
596
  value: function doAllowSetPlanner() {
604
- var _this$divaWebConfigDa14;
605
- return (_this$divaWebConfigDa14 = this.divaWebConfigData) === null || _this$divaWebConfigDa14 === void 0 ? void 0 : _this$divaWebConfigDa14.doAllowSetPlanner;
597
+ var _this$divaWebConfigDa13;
598
+ return (_this$divaWebConfigDa13 = this.divaWebConfigData) === null || _this$divaWebConfigDa13 === void 0 ? void 0 : _this$divaWebConfigDa13.doAllowSetPlanner;
606
599
  }
607
600
  }, {
608
601
  key: "getHidePlanner",
609
602
  value: function getHidePlanner() {
610
- var _this$divaWebConfigDa15;
611
- return !!((_this$divaWebConfigDa15 = this.divaWebConfigData) !== null && _this$divaWebConfigDa15 !== void 0 && (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) !== null && _this$divaWebConfigDa15 !== void 0 && _this$divaWebConfigDa15.hidePlanner);
603
+ var _this$divaWebConfigDa14;
604
+ return !!((_this$divaWebConfigDa14 = this.divaWebConfigData) !== null && _this$divaWebConfigDa14 !== void 0 && (_this$divaWebConfigDa14 = _this$divaWebConfigDa14.viewConfig) !== null && _this$divaWebConfigDa14 !== void 0 && _this$divaWebConfigDa14.hidePlanner);
612
605
  }
613
606
  }, {
614
607
  key: "getDoShowAR",
615
608
  value: function getDoShowAR() {
616
- var _this$divaWebConfigDa16;
617
- return (_this$divaWebConfigDa16 = this.divaWebConfigData) === null || _this$divaWebConfigDa16 === void 0 || (_this$divaWebConfigDa16 = _this$divaWebConfigDa16.viewConfig) === null || _this$divaWebConfigDa16 === void 0 ? void 0 : _this$divaWebConfigDa16.enableAR;
609
+ var _this$divaWebConfigDa15;
610
+ return (_this$divaWebConfigDa15 = this.divaWebConfigData) === null || _this$divaWebConfigDa15 === void 0 || (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) === null || _this$divaWebConfigDa15 === void 0 ? void 0 : _this$divaWebConfigDa15.enableAR;
618
611
  }
619
612
  }, {
620
613
  key: "forceShowRTV",
621
614
  value: function forceShowRTV() {
622
- var _this$divaWebConfigDa17;
623
- return (_this$divaWebConfigDa17 = this.divaWebConfigData) === null || _this$divaWebConfigDa17 === void 0 || (_this$divaWebConfigDa17 = _this$divaWebConfigDa17.viewConfig) === null || _this$divaWebConfigDa17 === void 0 ? void 0 : _this$divaWebConfigDa17.forceRTV;
615
+ var _this$divaWebConfigDa16;
616
+ return (_this$divaWebConfigDa16 = this.divaWebConfigData) === null || _this$divaWebConfigDa16 === void 0 || (_this$divaWebConfigDa16 = _this$divaWebConfigDa16.viewConfig) === null || _this$divaWebConfigDa16 === void 0 ? void 0 : _this$divaWebConfigDa16.forceRTV;
624
617
  }
625
618
  }, {
626
619
  key: "getDoShowRTV",
627
620
  value: function getDoShowRTV() {
628
- var _this$divaWebConfigDa18;
629
- return (_this$divaWebConfigDa18 = this.divaWebConfigData) === null || _this$divaWebConfigDa18 === void 0 || (_this$divaWebConfigDa18 = _this$divaWebConfigDa18.viewConfig) === null || _this$divaWebConfigDa18 === void 0 ? void 0 : _this$divaWebConfigDa18.enableRTV;
621
+ var _this$divaWebConfigDa17;
622
+ return (_this$divaWebConfigDa17 = this.divaWebConfigData) === null || _this$divaWebConfigDa17 === void 0 || (_this$divaWebConfigDa17 = _this$divaWebConfigDa17.viewConfig) === null || _this$divaWebConfigDa17 === void 0 ? void 0 : _this$divaWebConfigDa17.enableRTV;
630
623
  }
631
624
  }, {
632
625
  key: "getEnableRTVUnityKombi",
633
626
  value: function getEnableRTVUnityKombi() {
634
- var _this$divaWebConfigDa19;
635
- return !!((_this$divaWebConfigDa19 = this.divaWebConfigData) !== null && _this$divaWebConfigDa19 !== void 0 && _this$divaWebConfigDa19.viewConfig.enableRtvUnityKombi);
627
+ var _this$divaWebConfigDa18;
628
+ return !!((_this$divaWebConfigDa18 = this.divaWebConfigData) !== null && _this$divaWebConfigDa18 !== void 0 && _this$divaWebConfigDa18.viewConfig.enableRtvUnityKombi);
636
629
  }
637
630
  }, {
638
631
  key: "getDoDisablePlanner2D",
639
632
  value: function getDoDisablePlanner2D() {
640
- var _this$divaWebConfigDa20;
641
- return !!((_this$divaWebConfigDa20 = this.divaWebConfigData) !== null && _this$divaWebConfigDa20 !== void 0 && _this$divaWebConfigDa20.doDisablePlanner2D);
633
+ var _this$divaWebConfigDa19;
634
+ return !!((_this$divaWebConfigDa19 = this.divaWebConfigData) !== null && _this$divaWebConfigDa19 !== void 0 && _this$divaWebConfigDa19.doDisablePlanner2D);
642
635
  }
643
636
  }, {
644
637
  key: "getRoomListInProduct",
645
638
  value: function getRoomListInProduct() {
646
- var _this$divaWebConfigDa21;
647
- return !!((_this$divaWebConfigDa21 = this.divaWebConfigData) !== null && _this$divaWebConfigDa21 !== void 0 && (_this$divaWebConfigDa21 = _this$divaWebConfigDa21.viewConfig) !== null && _this$divaWebConfigDa21 !== void 0 && _this$divaWebConfigDa21.roomListInProduct);
639
+ var _this$divaWebConfigDa20;
640
+ return !!((_this$divaWebConfigDa20 = this.divaWebConfigData) !== null && _this$divaWebConfigDa20 !== void 0 && (_this$divaWebConfigDa20 = _this$divaWebConfigDa20.viewConfig) !== null && _this$divaWebConfigDa20 !== void 0 && _this$divaWebConfigDa20.roomListInProduct);
648
641
  }
649
642
  }, {
650
643
  key: "getPlannerType",
651
644
  value: function getPlannerType() {
652
- var _this$divaWebConfigDa22;
653
- return (_this$divaWebConfigDa22 = this.divaWebConfigData) === null || _this$divaWebConfigDa22 === void 0 || (_this$divaWebConfigDa22 = _this$divaWebConfigDa22.viewConfig) === null || _this$divaWebConfigDa22 === void 0 ? void 0 : _this$divaWebConfigDa22.plannerType;
645
+ var _this$divaWebConfigDa21;
646
+ return (_this$divaWebConfigDa21 = this.divaWebConfigData) === null || _this$divaWebConfigDa21 === void 0 || (_this$divaWebConfigDa21 = _this$divaWebConfigDa21.viewConfig) === null || _this$divaWebConfigDa21 === void 0 ? void 0 : _this$divaWebConfigDa21.plannerType;
654
647
  }
655
648
  }, {
656
649
  key: "getLoadSupplierColors",
657
650
  value: function getLoadSupplierColors() {
658
- var _this$divaWebConfigDa23;
659
- return !!((_this$divaWebConfigDa23 = this.divaWebConfigData) !== null && _this$divaWebConfigDa23 !== void 0 && _this$divaWebConfigDa23.loadSupplierColors);
651
+ var _this$divaWebConfigDa22;
652
+ return !!((_this$divaWebConfigDa22 = this.divaWebConfigData) !== null && _this$divaWebConfigDa22 !== void 0 && _this$divaWebConfigDa22.loadSupplierColors);
660
653
  }
661
654
  }, {
662
655
  key: "showSelectionModeZero",
663
656
  value: function showSelectionModeZero() {
664
- var _this$divaWebConfigDa24;
665
- return !!((_this$divaWebConfigDa24 = this.divaWebConfigData) !== null && _this$divaWebConfigDa24 !== void 0 && _this$divaWebConfigDa24.showSelectionModeZero);
657
+ var _this$divaWebConfigDa23;
658
+ return !!((_this$divaWebConfigDa23 = this.divaWebConfigData) !== null && _this$divaWebConfigDa23 !== void 0 && _this$divaWebConfigDa23.showSelectionModeZero);
666
659
  }
667
660
  }, {
668
661
  key: "ruleDescSeperator",
@@ -682,8 +675,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
682
675
  }, {
683
676
  key: "getDoCheckVariantData",
684
677
  value: function getDoCheckVariantData() {
685
- var _this$divaWebConfigDa25;
686
- return (_this$divaWebConfigDa25 = this.divaWebConfigData) === null || _this$divaWebConfigDa25 === void 0 ? void 0 : _this$divaWebConfigDa25.doCheckVariantData;
678
+ var _this$divaWebConfigDa24;
679
+ return (_this$divaWebConfigDa24 = this.divaWebConfigData) === null || _this$divaWebConfigDa24 === void 0 ? void 0 : _this$divaWebConfigDa24.doCheckVariantData;
687
680
  }
688
681
  }, {
689
682
  key: "setI18n",
@@ -763,7 +756,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
763
756
  }, {
764
757
  key: "getBasketDataUrlCacheKey",
765
758
  value: function getBasketDataUrlCacheKey(divaNr) {
766
- //if divaNr is a variant of a divaNr (saves with favorites) divaNr looks like: "Diva-123456_0001". Here we got do build the querystring differently
759
+ //this is only used for testing logic to stiff match the query hash so moched calls are used
767
760
  var qs;
768
761
  if (divaNr.includes('_') && divaNr.substring(divaNr.indexOf('_') + 1).length == 4) {
769
762
  var splittedDivaNr = divaNr.split('_');
@@ -776,50 +769,50 @@ var DivaApiHandler = /*#__PURE__*/function () {
776
769
  }, {
777
770
  key: "getViewConfig",
778
771
  value: function getViewConfig() {
779
- var _this$divaWebConfigDa26;
780
- return (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.viewConfig;
772
+ var _this$divaWebConfigDa25;
773
+ return (_this$divaWebConfigDa25 = this.divaWebConfigData) === null || _this$divaWebConfigDa25 === void 0 ? void 0 : _this$divaWebConfigDa25.viewConfig;
781
774
  }
782
775
  }, {
783
776
  key: "getEmailConfig",
784
777
  value: function getEmailConfig() {
785
- var _this$divaWebConfigDa27;
786
- return (_this$divaWebConfigDa27 = this.divaWebConfigData) === null || _this$divaWebConfigDa27 === void 0 ? void 0 : _this$divaWebConfigDa27.emailConfig;
778
+ var _this$divaWebConfigDa26;
779
+ return (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.emailConfig;
787
780
  }
788
781
  }, {
789
782
  key: "getABTestCases",
790
783
  value: function getABTestCases() {
791
- var _this$divaWebConfigDa28, _this$divaWebConfigDa29;
792
- return (_this$divaWebConfigDa28 = (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.abTestCases) !== null && _this$divaWebConfigDa28 !== void 0 ? _this$divaWebConfigDa28 : [];
784
+ var _this$divaWebConfigDa27, _this$divaWebConfigDa28;
785
+ return (_this$divaWebConfigDa27 = (_this$divaWebConfigDa28 = this.divaWebConfigData) === null || _this$divaWebConfigDa28 === void 0 ? void 0 : _this$divaWebConfigDa28.abTestCases) !== null && _this$divaWebConfigDa27 !== void 0 ? _this$divaWebConfigDa27 : [];
793
786
  }
794
787
  }, {
795
788
  key: "getBarrierConfig",
796
789
  value: function getBarrierConfig() {
797
- var _this$divaWebConfigDa30;
798
- return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.barrierConfig;
790
+ var _this$divaWebConfigDa29;
791
+ return (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.barrierConfig;
799
792
  }
800
793
  }, {
801
794
  key: "getTemplateConfig",
802
795
  value: function getTemplateConfig() {
803
- var _this$divaWebConfigDa31;
804
- return (_this$divaWebConfigDa31 = this.divaWebConfigData) === null || _this$divaWebConfigDa31 === void 0 ? void 0 : _this$divaWebConfigDa31.templateConfig;
796
+ var _this$divaWebConfigDa30;
797
+ return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.templateConfig;
805
798
  }
806
799
  }, {
807
800
  key: "showDivaNr",
808
801
  value: function showDivaNr() {
809
- var _this$divaWebConfigDa32;
810
- return (_this$divaWebConfigDa32 = this.divaWebConfigData) === null || _this$divaWebConfigDa32 === void 0 ? void 0 : _this$divaWebConfigDa32.showDivaNr;
802
+ var _this$divaWebConfigDa31;
803
+ return (_this$divaWebConfigDa31 = this.divaWebConfigData) === null || _this$divaWebConfigDa31 === void 0 ? void 0 : _this$divaWebConfigDa31.showDivaNr;
811
804
  }
812
805
  }, {
813
806
  key: "onErrorHandling",
814
807
  value: function onErrorHandling() {
815
- var _this$divaWebConfigDa33;
816
- return (_this$divaWebConfigDa33 = this.divaWebConfigData) === null || _this$divaWebConfigDa33 === void 0 ? void 0 : _this$divaWebConfigDa33.onErrorHandling;
808
+ var _this$divaWebConfigDa32;
809
+ return (_this$divaWebConfigDa32 = this.divaWebConfigData) === null || _this$divaWebConfigDa32 === void 0 ? void 0 : _this$divaWebConfigDa32.onErrorHandling;
817
810
  }
818
811
  }, {
819
812
  key: "diva3DRenderingDefault",
820
813
  value: function diva3DRenderingDefault() {
821
- var _this$divaWebConfigDa34;
822
- return (_this$divaWebConfigDa34 = this.divaWebConfigData) === null || _this$divaWebConfigDa34 === void 0 ? void 0 : _this$divaWebConfigDa34.diva3DRenderingDefault;
814
+ var _this$divaWebConfigDa33;
815
+ return (_this$divaWebConfigDa33 = this.divaWebConfigData) === null || _this$divaWebConfigDa33 === void 0 ? void 0 : _this$divaWebConfigDa33.diva3DRenderingDefault;
823
816
  }
824
817
  }, {
825
818
  key: "getJwt",
@@ -834,8 +827,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
834
827
  }, {
835
828
  key: "getUseMask",
836
829
  value: function getUseMask() {
837
- var _this$divaWebConfigDa35;
838
- return (_this$divaWebConfigDa35 = this.divaWebConfigData) === null || _this$divaWebConfigDa35 === void 0 ? void 0 : _this$divaWebConfigDa35.useMask;
830
+ var _this$divaWebConfigDa34;
831
+ return (_this$divaWebConfigDa34 = this.divaWebConfigData) === null || _this$divaWebConfigDa34 === void 0 ? void 0 : _this$divaWebConfigDa34.useMask;
839
832
  }
840
833
  }, {
841
834
  key: "apiUrl",
@@ -895,22 +888,10 @@ var DivaApiHandler = /*#__PURE__*/function () {
895
888
  }, {
896
889
  key: "getBasketDataUrl",
897
890
  value: function getBasketDataUrl(divaNr) {
898
- //if divaNr is a variant of a divaNr (saves with favorites) divaNr looks like: "Diva-123456_0001". Here we got do build the querystring differently
899
- if (divaNr.includes('_') && divaNr.substring(divaNr.indexOf('_') + 1).length == 4) {
900
- var _divaNr$split = divaNr.split('_'),
901
- _divaNr$split2 = _slicedToArray__default["default"](_divaNr$split, 2),
902
- DivaNrAndDoc = _divaNr$split2[0],
903
- variantId = _divaNr$split2[1];
904
- var _DivaNrAndDoc$split = DivaNrAndDoc.split('-'),
905
- _DivaNrAndDoc$split2 = _slicedToArray__default["default"](_DivaNrAndDoc$split, 3),
906
- _onlyDivaNr = _DivaNrAndDoc$split2[1],
907
- _version = _DivaNrAndDoc$split2[2];
908
- return '/baskets/configuration?divaNr=' + 'DIVA-' + _onlyDivaNr + (_version ? '&version=' + _version : '') + '&variantId=' + Number(variantId) + '&dontRepairBasket=true';
909
- }
910
- var _divaNr$split3 = divaNr.split('-'),
911
- _divaNr$split4 = _slicedToArray__default["default"](_divaNr$split3, 3),
912
- onlyDivaNr = _divaNr$split4[1],
913
- version = _divaNr$split4[2];
891
+ var _divaNr$split = divaNr.split('-'),
892
+ _divaNr$split2 = _slicedToArray__default["default"](_divaNr$split, 3),
893
+ onlyDivaNr = _divaNr$split2[1],
894
+ version = _divaNr$split2[2];
914
895
  return '/baskets/configuration?divaNr=' + 'DIVA-' + onlyDivaNr + (version ? '&version=' + version : '') + '&dontRepairBasket=true';
915
896
  }
916
897
  }, {
@@ -1040,9 +1021,9 @@ var DivaApiHandler = /*#__PURE__*/function () {
1040
1021
  return '/baskets/uniqueDivaNr';
1041
1022
  }
1042
1023
  }, {
1043
- key: "fillBasketEkText",
1044
- value: function fillBasketEkText() {
1045
- return '/baskets/fillektext';
1024
+ key: "checkMatchingProducts",
1025
+ value: function checkMatchingProducts() {
1026
+ return '/v1/products/matching';
1046
1027
  }
1047
1028
  }, {
1048
1029
  key: "getAccountList",
@@ -1367,14 +1348,14 @@ var DivaApiHandler = /*#__PURE__*/function () {
1367
1348
  }, {
1368
1349
  key: "dontLoadAdditionalModelInfos",
1369
1350
  get: function get() {
1370
- var _this$divaWebConfigDa36;
1371
- return (_this$divaWebConfigDa36 = this.divaWebConfigData) === null || _this$divaWebConfigDa36 === void 0 ? void 0 : _this$divaWebConfigDa36.dontLoadAdditionalModelInfos;
1351
+ var _this$divaWebConfigDa35;
1352
+ return (_this$divaWebConfigDa35 = this.divaWebConfigData) === null || _this$divaWebConfigDa35 === void 0 ? void 0 : _this$divaWebConfigDa35.dontLoadAdditionalModelInfos;
1372
1353
  }
1373
1354
  }, {
1374
1355
  key: "dontLoadCatalogEditorLiteMask",
1375
1356
  get: function get() {
1376
- var _this$divaWebConfigDa37;
1377
- return (_this$divaWebConfigDa37 = this.divaWebConfigData) === null || _this$divaWebConfigDa37 === void 0 ? void 0 : _this$divaWebConfigDa37.dontLoadCatalogEditorLiteMask;
1357
+ var _this$divaWebConfigDa36;
1358
+ return (_this$divaWebConfigDa36 = this.divaWebConfigData) === null || _this$divaWebConfigDa36 === void 0 ? void 0 : _this$divaWebConfigDa36.dontLoadCatalogEditorLiteMask;
1378
1359
  }
1379
1360
  }, {
1380
1361
  key: "OrganizationId",
@@ -1633,6 +1614,16 @@ var ArticleOptionData = /*#__PURE__*/function () {
1633
1614
  get: function get() {
1634
1615
  return this.opt.catalogOPT.contentItemId;
1635
1616
  }
1617
+ }, {
1618
+ key: "showSearchbar",
1619
+ get: function get() {
1620
+ return this.opt.catalogOPT.showSearchbar;
1621
+ }
1622
+ }, {
1623
+ key: "showFilter",
1624
+ get: function get() {
1625
+ return this.opt.catalogOPT.showFilter;
1626
+ }
1636
1627
  }, {
1637
1628
  key: "pdfUrl",
1638
1629
  get: function get() {
@@ -17866,6 +17857,12 @@ var OptionCatalogData = /*#__PURE__*/function () {
17866
17857
  case 'INFO_URL':
17867
17858
  this.opt.url = prop.Value;
17868
17859
  break;
17860
+ case 'SHOW_SEARCHBAR':
17861
+ this.opt.showSearchbar = prop.Value;
17862
+ break;
17863
+ case 'SHOW_FILTER':
17864
+ this.opt.showFilter = prop.Value;
17865
+ break;
17869
17866
  case 'INFO_PDF':
17870
17867
  this.opt.pdfUrl = prop.Value;
17871
17868
  break;
@@ -18066,6 +18063,16 @@ var OptionCatalogData = /*#__PURE__*/function () {
18066
18063
  get: function get() {
18067
18064
  return this.opt.url;
18068
18065
  }
18066
+ }, {
18067
+ key: "showSearchbar",
18068
+ get: function get() {
18069
+ return this.opt.showSearchbar;
18070
+ }
18071
+ }, {
18072
+ key: "showFilter",
18073
+ get: function get() {
18074
+ return this.opt.showFilter;
18075
+ }
18069
18076
  }, {
18070
18077
  key: "pdfUrl",
18071
18078
  get: function get() {
@@ -18527,6 +18534,8 @@ var DivaCatalogData = /*#__PURE__*/function () {
18527
18534
  //Warnings
18528
18535
  else if (item.Codex == 'HIDECONSTRUCTIONWARNING') {
18529
18536
  _this.catalogData.doCheckConstructionWarnings = item.Value == '0';
18537
+ } else if (item.Codex == 'FORCECONSTRUCTIONWARNINGARTICLES') {
18538
+ _this.catalogData.forceConstructionWarningForArticles = item.Value.split(';');
18530
18539
  } else if (item.Codex == 'HIDECOMPLETENESSWARNING') {
18531
18540
  _this.catalogData.hideCompletenessWarning = item.Value == '1';
18532
18541
  }
@@ -19347,6 +19356,11 @@ var DivaCatalogData = /*#__PURE__*/function () {
19347
19356
  get: function get() {
19348
19357
  return this.catalogData.doCheckConstructionWarnings;
19349
19358
  }
19359
+ }, {
19360
+ key: "forceConstructionWarningForArticles",
19361
+ get: function get() {
19362
+ return this.catalogData.forceConstructionWarningForArticles;
19363
+ }
19350
19364
  }, {
19351
19365
  key: "doHideCompletenessWarning",
19352
19366
  get: function get() {
@@ -20491,7 +20505,7 @@ var DivaArticle = /*#__PURE__*/function () {
20491
20505
  ruleDesc_locales: initParams.RuleDesc_locales,
20492
20506
  toDeleteAfterInit: false,
20493
20507
  doUpdatePlannerSize: false,
20494
- shelfPlanData: initParams.ShelfPlanData ? DivaUtils__default["default"].DecodeBasketJson(initParams.ShelfPlanData) : undefined,
20508
+ shelfPlanData: initParams.ShelfPlandata ? DivaUtils__default["default"].DecodeBasketJson(initParams.ShelfPlandata) : undefined,
20495
20509
  typeNr: articleData.typeNr,
20496
20510
  initDecisions: initParams.initDecisions,
20497
20511
  previousPartlistArticles: initParams.PreviousPartlistArticles,
@@ -21808,6 +21822,18 @@ var DivaArticle = /*#__PURE__*/function () {
21808
21822
  get: function get() {
21809
21823
  return DivaUtils.md5(this.CatalogData.catalogGuid + '_' + this.articleCodex + '_' + JSON.stringify(this.VariantValuesWithoutOPTandOPV).replace(/"/g, '@'));
21810
21824
  }
21825
+ }, {
21826
+ key: "articleProductHash",
21827
+ get: function get() {
21828
+ var hash = this.catalogCodex + '_' + this.articleCodex + '_' + this.quantity + '_';
21829
+ for (var key in this.articleOptionStates) {
21830
+ var myArtOption = this.articleOptionStates[key];
21831
+ if (myArtOption.isDoShow && (!(myArtOption.idmVariantenArt == 95 || myArtOption.idmVariantenArt == 96 || myArtOption.idmVariantenArt == 97) || myArtOption.isVisibleFreeText) && myArtOption.val && myArtOption.visibleCount > 0 && !myArtOption.isDescribingState) {
21832
+ hash = hash + myArtOption.optionCodex.substring(3) + '_' + myArtOption.val.codex.substring(3) + (myArtOption.measureUnit && myArtOption.freeText !== undefined ? '_' + myArtOption.freeText : '') + (!myArtOption.measureUnit && myArtOption.isFreeText ? '_' + myArtOption.isFreeText : '');
21833
+ }
21834
+ }
21835
+ return DivaUtils.md5(hash);
21836
+ }
21811
21837
  }, {
21812
21838
  key: "VariantValuesWithoutOPTandOPV",
21813
21839
  get: function get() {
@@ -22880,6 +22906,8 @@ var DivaArticle = /*#__PURE__*/function () {
22880
22906
  optionImgForPrint: optionImgForPrint,
22881
22907
  optionsForPrint: optionsForPrint
22882
22908
  });
22909
+ } else {
22910
+ LOG$c.debug('not loading partlistarticle: ' + articleCodex + ' cause quantity is zero');
22883
22911
  }
22884
22912
  }
22885
22913
  return partlistArticlesToLoad;
@@ -23576,7 +23604,7 @@ var DivaArticle = /*#__PURE__*/function () {
23576
23604
  break;
23577
23605
  }
23578
23606
  _context.next = 4;
23579
- return Promise.resolve().then(function () { return require('./ShelfPlanner-4b697826.js'); });
23607
+ return Promise.resolve().then(function () { return require('./ShelfPlanner-8db07a13.js'); });
23580
23608
  case 4:
23581
23609
  _yield$import = _context.sent;
23582
23610
  ShelfPlanner = _yield$import["default"];
@@ -24348,12 +24376,12 @@ var DivaArticle = /*#__PURE__*/function () {
24348
24376
  }
24349
24377
  var myOptItem = {
24350
24378
  BasketID: this.basketId,
24351
- OPTCodex: OP.substring(3),
24379
+ OPT: OP.substring(3),
24352
24380
  OPTName: myArtOption.optionOrigName,
24353
24381
  OPTName_locales: myArtOption.optionName_locales,
24354
24382
  OptionOCD: myArtOption.optionOcd,
24355
24383
  OCD: myArtOption.ocd,
24356
- OPVCodex: myArtOption.val.codex.substring(3),
24384
+ OPV: myArtOption.val.codex.substring(3),
24357
24385
  vOPV: !this.CatalogData.dontUseVCodexInBasket ? myArtOption.vCodex : undefined,
24358
24386
  OPVName: DivaUtils__default["default"].stripTags(myArtOption.name),
24359
24387
  OPVName_locales: DivaUtils__default["default"].stripTagsFromDict((_myArtOption$valName_ = myArtOption.valName_locales) !== null && _myArtOption$valName_ !== void 0 ? _myArtOption$valName_ : {}),
@@ -24389,7 +24417,7 @@ var DivaArticle = /*#__PURE__*/function () {
24389
24417
  }
24390
24418
  }, {
24391
24419
  key: "getConfigPriceData",
24392
- value: function getConfigPriceData(VariantBasketData) {
24420
+ value: function getConfigPriceData(VariantBasketDatas) {
24393
24421
  var myPriceData = new basketModel.JsonConfigPriceData();
24394
24422
  myPriceData.BasePrices = [];
24395
24423
  if (this.price != 0) {
@@ -24415,12 +24443,12 @@ var DivaArticle = /*#__PURE__*/function () {
24415
24443
  } else {
24416
24444
  if (checkPrice.IsPercentage) {
24417
24445
  //Check if variantBasketdata is set as addPercentage
24418
- //TODO klären mit Franz - ist das schon der richtige Ort? In dem Fall wird VariantBasketData nicht als AddPercentage gekennzeichnet und im Checkout 1 wird CHF stattt % angezeigt.
24419
- for (var _i10 = 0; _i10 < VariantBasketData.length; _i10++) {
24446
+ //TODO klären mit Franz - ist das schon der richtige Ort? In dem Fall wird VariantBasketDatas nicht als AddPercentage gekennzeichnet und im Checkout 1 wird CHF stattt % angezeigt.
24447
+ for (var _i10 = 0; _i10 < VariantBasketDatas.length; _i10++) {
24420
24448
  var priceOPT = checkPrice.OPT.startsWith('OPT') ? checkPrice.OPT.substring(3) : checkPrice;
24421
- if (VariantBasketData[_i10].OPT == priceOPT) {
24449
+ if (VariantBasketDatas[_i10].OPT == priceOPT) {
24422
24450
  if (!isNaN(checkPrice.Price)) {
24423
- VariantBasketData[_i10].AddPercentage = checkPrice.Price * 100;
24451
+ VariantBasketDatas[_i10].AddPercentage = checkPrice.Price * 100;
24424
24452
  }
24425
24453
  }
24426
24454
  }
@@ -24436,18 +24464,18 @@ var DivaArticle = /*#__PURE__*/function () {
24436
24464
  var maxPrice = 0,
24437
24465
  maxPriceOPT = '';
24438
24466
  if (!myPriceData.BasePrice && !this.CatalogData.ignoreMaxPriceAsBP) {
24439
- for (var _i11 = 0; _i11 < VariantBasketData.length; _i11++) {
24440
- var variant = VariantBasketData[_i11];
24467
+ for (var _i11 = 0; _i11 < VariantBasketDatas.length; _i11++) {
24468
+ var variant = VariantBasketDatas[_i11];
24441
24469
  if (variant.AddPrice && (!variant.AddPrice || variant.AddPrice > maxPrice)) {
24442
24470
  maxPrice = variant.AddPrice;
24443
24471
  maxPriceOPT = variant.OPT;
24444
24472
  }
24445
24473
  }
24446
24474
  }
24447
- for (var _i12 = 0; _i12 < VariantBasketData.length; _i12++) {
24475
+ for (var _i12 = 0; _i12 < VariantBasketDatas.length; _i12++) {
24448
24476
  //WCTODO Prio 2 bei Maßauswahl
24449
24477
  var CalcPrice = void 0,
24450
- _variant = VariantBasketData[_i12],
24478
+ _variant = VariantBasketDatas[_i12],
24451
24479
  isPercentage = false;
24452
24480
  if (_variant.AddPercentage) {
24453
24481
  isPercentage = true;
@@ -25062,7 +25090,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25062
25090
  }
25063
25091
  }
25064
25092
  }
25065
- if (value == undefined) {
25093
+ if (value == undefined && myArtOPS.isFreeText && !variantValues[_key + '_val']) {
25066
25094
  val = myArtOPS.option.freetextDefaultValue;
25067
25095
  if (val) {
25068
25096
  value = val;
@@ -26937,7 +26965,9 @@ var DivaSet = /*#__PURE__*/function () {
26937
26965
  _defineProperty__default["default"](this, "_supplierColors", void 0);
26938
26966
  /**Favorits state */
26939
26967
  _defineProperty__default["default"](this, "_handlelingCurrentFavorites", false);
26940
- _defineProperty__default["default"](this, "_favorites", void 0);
26968
+ _defineProperty__default["default"](this, "_favorites", {
26969
+ VariantValues: {}
26970
+ });
26941
26971
  //disabledVariants holds the state for explicitly variants that the user did not like so they got unselected in der summary
26942
26972
  _defineProperty__default["default"](this, "_disabledVariants", []);
26943
26973
  //for viewSummarylist to not always calc all the different valid variants we cache them and reset them when favoritesselection is changes
@@ -28106,7 +28136,7 @@ var DivaSet = /*#__PURE__*/function () {
28106
28136
  break;
28107
28137
  }
28108
28138
  _context4.next = 3;
28109
- return Promise.resolve().then(function () { return require('./DoorPlanner-ffa7af62.js'); });
28139
+ return Promise.resolve().then(function () { return require('./DoorPlanner-4eb75da2.js'); });
28110
28140
  case 3:
28111
28141
  _yield$import = _context4.sent;
28112
28142
  DoorPlanner = _yield$import["default"];
@@ -28150,8 +28180,6 @@ var DivaSet = /*#__PURE__*/function () {
28150
28180
  set: function set(favorites) {
28151
28181
  this._favorites = favorites;
28152
28182
  }
28153
-
28154
- //private disabledVariants: number[] = [];
28155
28183
  }, {
28156
28184
  key: "disabledVariants",
28157
28185
  get: function get() {
@@ -28160,7 +28188,6 @@ var DivaSet = /*#__PURE__*/function () {
28160
28188
  set: function set(val) {
28161
28189
  this._disabledVariants = val;
28162
28190
  }
28163
- //private allVariantsCache FavoritesVariants[]
28164
28191
  }, {
28165
28192
  key: "allVariantsCache",
28166
28193
  get: function get() {
@@ -28283,558 +28310,6 @@ var DivaSet = /*#__PURE__*/function () {
28283
28310
  }]);
28284
28311
  }();
28285
28312
 
28286
- //Diese Klasse verwaltet Productlogiken
28287
- var Product = /*#__PURE__*/function () {
28288
- function Product(id, divaNr, articles, price, image, shortDescription, childProducts, dockingPointInfos, affiliate, retailerArticleNr, minQuantity, increments) {
28289
- _classCallCheck__default["default"](this, Product);
28290
- _defineProperty__default["default"](this, "id", void 0);
28291
- _defineProperty__default["default"](this, "productPrice", void 0);
28292
- _defineProperty__default["default"](this, "_divaNr", void 0);
28293
- _defineProperty__default["default"](this, "shortDescriptionData", void 0);
28294
- _defineProperty__default["default"](this, "imageData", void 0);
28295
- _defineProperty__default["default"](this, "articles", void 0);
28296
- _defineProperty__default["default"](this, "families", []);
28297
- _defineProperty__default["default"](this, "childProductsData", void 0);
28298
- _defineProperty__default["default"](this, "childProductsGroupedData", void 0);
28299
- _defineProperty__default["default"](this, "dockingPointInfos", void 0);
28300
- _defineProperty__default["default"](this, "_affiliate", void 0);
28301
- _defineProperty__default["default"](this, "_retailerArticleNr", void 0);
28302
- _defineProperty__default["default"](this, "_minQuantity", void 0);
28303
- _defineProperty__default["default"](this, "_increments", void 0);
28304
- _defineProperty__default["default"](this, "_curTargetArticles", void 0);
28305
- this.id = id;
28306
- this._divaNr = divaNr;
28307
- this.articles = articles;
28308
- this.productPrice = price;
28309
- this.childProductsData = childProducts;
28310
- this.shortDescriptionData = shortDescription;
28311
- this.imageData = image;
28312
- this.dockingPointInfos = dockingPointInfos;
28313
- this._affiliate = affiliate;
28314
- this._retailerArticleNr = retailerArticleNr;
28315
- this._minQuantity = minQuantity === 1 ? undefined : minQuantity;
28316
- this._increments = increments === 1 ? undefined : increments;
28317
- this._curTargetArticles = [];
28318
- if (this.childProductsData) {
28319
- this.childProductsGroupedData = {};
28320
- for (var i = 0; i < this.childProductsData.length; i++) {
28321
- if (!this.childProductsGroupedData[this.childProductsData[i]]) this.childProductsGroupedData[this.childProductsData[i]] = 0;
28322
- this.childProductsGroupedData[this.childProductsData[i]]++;
28323
- }
28324
- }
28325
- }
28326
- return _createClass__default["default"](Product, [{
28327
- key: "initFamilies",
28328
- value: function initFamilies(families) {
28329
- for (var i = 0; i < families.length; i++) {
28330
- var _families$i$childProd;
28331
- if ((_families$i$childProd = families[i].childProducts) !== null && _families$i$childProd !== void 0 && _families$i$childProd.includes(this.id)) this.families.push();
28332
- }
28333
- this.families = families;
28334
- }
28335
- }, {
28336
- key: "price",
28337
- get: function get() {
28338
- return this.productPrice;
28339
- }
28340
- }, {
28341
- key: "productId",
28342
- get: function get() {
28343
- return this.id;
28344
- }
28345
- }, {
28346
- key: "divaNr",
28347
- get: function get() {
28348
- return this._divaNr;
28349
- }
28350
- }, {
28351
- key: "isFamily",
28352
- get: function get() {
28353
- return this.childProducts !== undefined;
28354
- }
28355
- }, {
28356
- key: "variantValues",
28357
- get: function get() {
28358
- return this.articles[0].variantValues;
28359
- }
28360
- }, {
28361
- key: "childProducts",
28362
- get: function get() {
28363
- return this.childProductsData;
28364
- }
28365
- }, {
28366
- key: "childProductsGrouped",
28367
- get: function get() {
28368
- return this.childProductsGroupedData;
28369
- }
28370
- }, {
28371
- key: "shortDescription",
28372
- get: function get() {
28373
- return this.shortDescriptionData;
28374
- }
28375
- }, {
28376
- key: "image",
28377
- get: function get() {
28378
- return this.imageData;
28379
- }
28380
- }, {
28381
- key: "affiliate",
28382
- get: function get() {
28383
- return this._affiliate;
28384
- }
28385
- }, {
28386
- key: "retailerArticleNr",
28387
- get: function get() {
28388
- return this._retailerArticleNr;
28389
- }
28390
- }, {
28391
- key: "increments",
28392
- get: function get() {
28393
- // return 2;
28394
- return this._increments;
28395
- }
28396
- }, {
28397
- key: "minQuantity",
28398
- get: function get() {
28399
- // return 3;
28400
- return this._minQuantity;
28401
- }
28402
- }, {
28403
- key: "curTargetArticles",
28404
- get: function get() {
28405
- return this._curTargetArticles;
28406
- },
28407
- set: function set(targentArticles) {
28408
- this._curTargetArticles = targentArticles;
28409
- }
28410
- }, {
28411
- key: "DockingPointInfos",
28412
- get: function get() {
28413
- return this.dockingPointInfos;
28414
- }
28415
- }, {
28416
- key: "CatalogCodexes",
28417
- get: function get() {
28418
- var catalogCodexes = [];
28419
- for (var i = 0; i < this.articles.length; i++) {
28420
- catalogCodexes.push(this.articles[i].catalogCodex);
28421
- }
28422
- return catalogCodexes;
28423
- }
28424
- }, {
28425
- key: "findOPVCodexInVariantValues",
28426
- value: function findOPVCodexInVariantValues(opt, opv) {
28427
- return this.articles.find(function (article) {
28428
- return article.variantValues.find(function (variant) {
28429
- return variant.OPT === opt && variant.OPV === opv;
28430
- });
28431
- });
28432
- }
28433
- }]);
28434
- }();
28435
-
28436
- var DivaProductHandler = /*#__PURE__*/function () {
28437
- function DivaProductHandler() {
28438
- _classCallCheck__default["default"](this, DivaProductHandler);
28439
- _defineProperty__default["default"](this, "singleProducts", {});
28440
- _defineProperty__default["default"](this, "familyProducts", {});
28441
- _defineProperty__default["default"](this, "singleProductsGrouped", {});
28442
- // key is CatalogCodex and ArticleCodex
28443
- //the number is the qunaitity of the current loaded product
28444
- _defineProperty__default["default"](this, "currentFamilies", {});
28445
- _defineProperty__default["default"](this, "currentSingleProducts", {});
28446
- }
28447
- return _createClass__default["default"](DivaProductHandler, [{
28448
- key: "addProducts",
28449
- value: function addProducts(variants, families) {
28450
- var newProducts = [];
28451
- var newFamilies = [];
28452
- for (var i = 0; i < variants.length; i++) {
28453
- var _variant$discountedPr;
28454
- var article = variants[i].articles[0];
28455
- var variant = variants[i];
28456
- var codex = article.catalogCodex + '_' + article.articleCodex;
28457
- if (!this.singleProductsGrouped[codex]) this.singleProductsGrouped[codex] = {};
28458
- this.singleProductsGrouped[codex][variants[i]._id] = new Product(variant._id, variant.divaNr, variant.articles, (_variant$discountedPr = variant.discountedPrice) !== null && _variant$discountedPr !== void 0 ? _variant$discountedPr : variant.addedPrice, variant.image, variant.shortDescription, undefined, variant.dockingPointInfos, variant.affiliate, variant.retailerArticleNr, variant.minQuantity, variant.increments);
28459
- this.singleProducts[variant._id] = this.singleProductsGrouped[codex][variant._id];
28460
- newProducts.push(this.singleProductsGrouped[codex][variant._id]);
28461
- }
28462
- if (families !== null && families !== void 0 && families.length) for (var _i = 0; _i < families.length; _i++) {
28463
- var _family$discountedPri;
28464
- var family = families[_i];
28465
- this.familyProducts[family._id] = new Product(family._id, family.divaNr, family.articles, (_family$discountedPri = family.discountedPrice) !== null && _family$discountedPri !== void 0 ? _family$discountedPri : family.addedPrice, family.image, family.shortDescription, family.childProducts, family.dockingPointInfos, family.affiliate, family.retailerArticleNr, family.minQuantity, family.increments);
28466
- newFamilies.push(this.familyProducts[family._id]);
28467
- }
28468
- for (var _i2 = 0; _i2 < newProducts.length; _i2++) {
28469
- newProducts[_i2].initFamilies(newFamilies);
28470
- }
28471
- }
28472
- }, {
28473
- key: "loadProductsOfSets",
28474
- value: function () {
28475
- var _loadProductsOfSets = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(orderSets, involvedSetIds) {
28476
- return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
28477
- while (1) switch (_context.prev = _context.next) {
28478
- case 0:
28479
- case "end":
28480
- return _context.stop();
28481
- }
28482
- }, _callee);
28483
- }));
28484
- function loadProductsOfSets(_x, _x2) {
28485
- return _loadProductsOfSets.apply(this, arguments);
28486
- }
28487
- return loadProductsOfSets;
28488
- }()
28489
- }, {
28490
- key: "updateProducts",
28491
- value: function () {
28492
- var _updateProducts = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(set, from, productId) {
28493
- return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
28494
- while (1) switch (_context2.prev = _context2.next) {
28495
- case 0:
28496
- case "end":
28497
- return _context2.stop();
28498
- }
28499
- }, _callee2);
28500
- }));
28501
- function updateProducts(_x3, _x4, _x5) {
28502
- return _updateProducts.apply(this, arguments);
28503
- }
28504
- return updateProducts;
28505
- }()
28506
- }, {
28507
- key: "updateArticleProducts",
28508
- value: function updateArticleProducts(set) {
28509
- var articles = set.getDivaArticles();
28510
- var targetArticles = Object.keys(articles);
28511
- for (var i = 0; i < targetArticles.length; i++) {
28512
- var article = articles[targetArticles[i]];
28513
- var productVariants = this.singleProductsGrouped[article.catalogCodex + '_' + article.articleCodex];
28514
- for (var key in productVariants) {
28515
- var product = productVariants[key];
28516
- product.curTargetArticles = [];
28517
- }
28518
- }
28519
- for (var _i3 = 0; _i3 < targetArticles.length; _i3++) {
28520
- var _article = articles[targetArticles[_i3]];
28521
- if (!_article) continue;
28522
- var _productVariants = this.singleProductsGrouped[_article.catalogCodex + '_' + _article.articleCodex];
28523
- var newProduct = undefined;
28524
- var _loop = function _loop() {
28525
- var product = _productVariants[_key];
28526
- var productVariantValues = _article.VariantValuesWithoutOPTandOPVInObject;
28527
- var notFound = false;
28528
- var _loop2 = function _loop2(j) {
28529
- if (!productVariantValues.find(function (item) {
28530
- return item.OPT == product.variantValues[j].OPT && item.OPV == product.variantValues[j].OPV;
28531
- })) {
28532
- //only notFound set to true when the opt in general does exist in the productVariants only the value of it is different
28533
- if (productVariantValues.find(function (item) {
28534
- return item.OPT == product.variantValues[j].OPT;
28535
- })) {
28536
- notFound = true;
28537
- return 1; // break
28538
- }
28539
- }
28540
- };
28541
- for (var j = 0; j < product.variantValues.length; j++) {
28542
- if (_loop2(j)) break;
28543
- }
28544
- if (!notFound) {
28545
- newProduct = product;
28546
- newProduct.curTargetArticles.push(_article.basketId);
28547
- return 1; // break
28548
- }
28549
- };
28550
- for (var _key in _productVariants) {
28551
- if (_loop()) break;
28552
- }
28553
- _article.curProduct = newProduct;
28554
- }
28555
- }
28556
- }, {
28557
- key: "updateFamilyProducts",
28558
- value: function updateFamilyProducts() {
28559
- this.currentFamilies = {};
28560
- var familiesToCheck = this.getFamiliesToCheck();
28561
- var biggestFamily;
28562
- do {
28563
- biggestFamily = this.findBiggestFamily(familiesToCheck);
28564
- if (biggestFamily) {
28565
- if (!this.currentFamilies[biggestFamily.productId]) this.currentFamilies[biggestFamily.productId] = 0;
28566
- this.currentFamilies[biggestFamily.productId]++;
28567
- }
28568
- } while (biggestFamily);
28569
- }
28570
- }, {
28571
- key: "getFamiliesToCheck",
28572
- value: function getFamiliesToCheck() {
28573
- var familiesToCheck = {};
28574
- for (var key in this.familyProducts) {
28575
- var familiy = this.familyProducts[key];
28576
- if (!familiy.childProducts) continue;
28577
- for (var i = 0; i < familiy.childProducts.length; i++) {
28578
- if (this.currentSingleProducts[familiy.childProducts[i]]) {
28579
- familiesToCheck[familiy.productId] = familiy;
28580
- break;
28581
- }
28582
- }
28583
- }
28584
- return familiesToCheck;
28585
- }
28586
- }, {
28587
- key: "findBiggestFamily",
28588
- value: function findBiggestFamily(familiesToCheck) {
28589
- var matchingFamilies = [];
28590
- var biggestFamily = false;
28591
- for (var iKey in familiesToCheck) {
28592
- var family = familiesToCheck[iKey];
28593
- var notFit = false;
28594
- for (var jKey in family.childProductsGrouped) {
28595
- //if product does not currently exist or the quantity is to small
28596
- if (!this.currentSingleProducts[jKey] || this.currentSingleProducts[jKey] < family.childProductsGrouped[jKey]) {
28597
- notFit = true;
28598
- break;
28599
- }
28600
- }
28601
- if (!notFit) matchingFamilies.push(family);
28602
- }
28603
-
28604
- //from all the matching families find the bigges one
28605
- for (var i = 0; i < matchingFamilies.length; i++) {
28606
- if (!biggestFamily || biggestFamily.childProducts.length > matchingFamilies[i].childProducts.length) {
28607
- biggestFamily = matchingFamilies[i];
28608
- }
28609
- }
28610
- if (biggestFamily) {
28611
- //we found a final bigges familiy. Now subtract the familiy products quantity in the dictionary products for the next run
28612
- for (var key in biggestFamily.childProductsGrouped) {
28613
- biggestFamily.childProductsGrouped;
28614
- this.currentSingleProducts[key] = this.currentSingleProducts[key] - biggestFamily.childProductsGrouped[key];
28615
- }
28616
- }
28617
- return biggestFamily;
28618
- }
28619
- }, {
28620
- key: "checkQuantitySteps",
28621
- value: function () {
28622
- var _checkQuantitySteps = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(set, from, productId) {
28623
- var articles, somethingChanged, key, product, currentQuantity, deltaQuantity, whatToDo, article;
28624
- return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
28625
- while (1) switch (_context3.prev = _context3.next) {
28626
- case 0:
28627
- articles = set.getDivaArticles();
28628
- somethingChanged = false;
28629
- _context3.t0 = _regeneratorRuntime__default["default"].keys(this.currentSingleProducts);
28630
- case 3:
28631
- if ((_context3.t1 = _context3.t0()).done) {
28632
- _context3.next = 38;
28633
- break;
28634
- }
28635
- key = _context3.t1.value;
28636
- product = this.singleProducts[key];
28637
- currentQuantity = this.currentSingleProducts[key];
28638
- deltaQuantity = 0;
28639
- whatToDo = undefined;
28640
- if (product.minQuantity !== undefined) {
28641
- if (product.minQuantity > currentQuantity || product.increments !== undefined && product.increments > currentQuantity) {
28642
- if (from == 'onDelete') {
28643
- whatToDo = 'deleteArticle';
28644
- deltaQuantity = currentQuantity;
28645
- } else {
28646
- whatToDo = 'increaseQunatity';
28647
- deltaQuantity = product.minQuantity - currentQuantity;
28648
- }
28649
- somethingChanged = 'byMinQuantity';
28650
- }
28651
- }
28652
- if (!(product.increments && whatToDo !== 'deleteArticle')) {
28653
- _context3.next = 22;
28654
- break;
28655
- }
28656
- case 11:
28657
- if (!((currentQuantity + deltaQuantity) % product.increments !== 0 || from == 'onDelete' && productId == key)) {
28658
- _context3.next = 22;
28659
- break;
28660
- }
28661
- deltaQuantity++;
28662
- somethingChanged = 'byImcrement';
28663
- if (!(whatToDo !== 'increaseQunatity')) {
28664
- _context3.next = 20;
28665
- break;
28666
- }
28667
- if (!((currentQuantity - deltaQuantity) % product.increments === 0 && from != 'onAdd')) {
28668
- _context3.next = 19;
28669
- break;
28670
- }
28671
- if (!(product.minQuantity === undefined || product.minQuantity <= currentQuantity - deltaQuantity || currentQuantity - deltaQuantity === 0)) {
28672
- _context3.next = 19;
28673
- break;
28674
- }
28675
- whatToDo = 'decreaseQunatity';
28676
- return _context3.abrupt("break", 22);
28677
- case 19:
28678
- if ((currentQuantity + deltaQuantity) % product.increments === 0 && from != 'onDelete') {
28679
- whatToDo = 'increaseQunatity';
28680
- }
28681
- case 20:
28682
- _context3.next = 11;
28683
- break;
28684
- case 22:
28685
- if (!(whatToDo !== undefined)) {
28686
- _context3.next = 36;
28687
- break;
28688
- }
28689
- case 23:
28690
- if (!(deltaQuantity !== 0)) {
28691
- _context3.next = 36;
28692
- break;
28693
- }
28694
- article = articles[product.curTargetArticles[0]]; //attention!! If an article has a quantity bigger than 1 this wont work!
28695
- if (!(whatToDo === 'increaseQunatity')) {
28696
- _context3.next = 30;
28697
- break;
28698
- }
28699
- _context3.next = 28;
28700
- return setHandlerInstance.addPlannerElement(set, article.articleCodex, {
28701
- variantValues: article.VariantValues
28702
- }, 'initializingProduct');
28703
- case 28:
28704
- _context3.next = 33;
28705
- break;
28706
- case 30:
28707
- _context3.next = 32;
28708
- return setHandlerInstance.deleteElementFromSet(set, article, false, undefined, true);
28709
- case 32:
28710
- product.curTargetArticles.splice(0, 1);
28711
- case 33:
28712
- deltaQuantity--;
28713
- _context3.next = 23;
28714
- break;
28715
- case 36:
28716
- _context3.next = 3;
28717
- break;
28718
- case 38:
28719
- return _context3.abrupt("return", somethingChanged);
28720
- case 39:
28721
- case "end":
28722
- return _context3.stop();
28723
- }
28724
- }, _callee3, this);
28725
- }));
28726
- function checkQuantitySteps(_x6, _x7, _x8) {
28727
- return _checkQuantitySteps.apply(this, arguments);
28728
- }
28729
- return checkQuantitySteps;
28730
- }()
28731
- /**
28732
- * this functions controlls if the list of configItems is available or not
28733
- * @param configItems
28734
- * @param variantsInfo
28735
- * @param articles
28736
- * @param targetArticles
28737
- * @returns
28738
- */
28739
- }, {
28740
- key: "checkProductInStock",
28741
- value: function checkProductInStock(configItems, variantsInfo, articles, targetArticles) {
28742
- var productsKey = articles[targetArticles[0]].catalogCodex + '_' + articles[targetArticles[0]].articleCodex;
28743
- var products = this.singleProductsGrouped[productsKey];
28744
- var indexesToDelete = [];
28745
- for (var i = 0; i < variantsInfo.length; i++) {
28746
- var variantInStock = false;
28747
- var variantInfo = variantsInfo[i];
28748
- for (var key in products) {
28749
- //***GUF***DEBUG HERE
28750
- var productVariantValues = products[key].variantValues;
28751
- var notFound = false;
28752
- var _loop3 = function _loop3() {
28753
- var variant = variantInfo.variants[j];
28754
- if (!productVariantValues.find(function (item) {
28755
- return variant.OPT === item.OPT && variant.OPV === item.OPV;
28756
- })) {
28757
- //only notFound set to true when the opt in general does exist in the productVariants only the value of it is different
28758
- if (productVariantValues.find(function (item) {
28759
- return variant.OPT === item.OPT;
28760
- })) {
28761
- notFound = true;
28762
- return 1; // break
28763
- }
28764
- }
28765
- };
28766
- for (var j = 0; j < variantInfo.variants.length; j++) {
28767
- if (_loop3()) break;
28768
- }
28769
- if (!notFound) {
28770
- variantInStock = true;
28771
- break;
28772
- }
28773
- }
28774
- if (!variantInStock) {
28775
- if (configItems[i]) {
28776
- indexesToDelete.push(i);
28777
- }
28778
- }
28779
- }
28780
- for (var _i4 = indexesToDelete.length - 1; _i4 >= 0; _i4--) {
28781
- configItems.splice(indexesToDelete[_i4], 1);
28782
- }
28783
- return configItems;
28784
- }
28785
- }, {
28786
- key: "getPrice",
28787
- value: function getPrice() {
28788
- var price = 0;
28789
- for (var key in this.currentSingleProducts) {
28790
- price += this.singleProducts[key].price * this.currentSingleProducts[key];
28791
- }
28792
- for (var _key2 in this.currentFamilies) {
28793
- price += this.singleProducts[_key2].price * this.currentFamilies[_key2];
28794
- }
28795
- return price;
28796
- }
28797
- }, {
28798
- key: "getCurrentProducts",
28799
- value: function getCurrentProducts() {
28800
- var products = this.currentSingleProducts;
28801
- for (var key in this.currentFamilies) {
28802
- products[key] = this.currentFamilies[key];
28803
- }
28804
- return products;
28805
- }
28806
- }, {
28807
- key: "getProductById",
28808
- value: function getProductById(productId) {
28809
- var product;
28810
- product = this.singleProducts[productId];
28811
- if (!product) this.familyProducts[productId];
28812
- return product;
28813
- }
28814
- }, {
28815
- key: "getBestMatch",
28816
- value: function getBestMatch(articles) {
28817
- var OPTION_CODEX = 'KOPFTEIL';
28818
- if (!articles) return;
28819
- for (var key in articles) {
28820
- var _article$VariantValue;
28821
- var article = articles[key];
28822
- var opv = (_article$VariantValue = article.VariantValues['OPT' + OPTION_CODEX]) === null || _article$VariantValue === void 0 ? void 0 : _article$VariantValue.replace('OPV', '');
28823
- var products = this.singleProductsGrouped[article.catalogCodex + '_' + article.articleCodex];
28824
- if (!products || !opv) continue;
28825
- for (var pId in products) {
28826
- var _products$pId$affilia;
28827
- if ((_products$pId$affilia = products[pId].affiliate) !== null && _products$pId$affilia !== void 0 && _products$pId$affilia.length) if (products[pId].findOPVCodexInVariantValues(OPTION_CODEX, opv)) {
28828
- return products[pId];
28829
- }
28830
- }
28831
- }
28832
- return undefined;
28833
- }
28834
- }]);
28835
- }();
28836
- var productHandlerInstance = new DivaProductHandler();
28837
-
28838
28313
  var SummaryHandler = /*#__PURE__*/function () {
28839
28314
  function SummaryHandler() {
28840
28315
  _classCallCheck__default["default"](this, SummaryHandler);
@@ -29172,30 +28647,16 @@ var SummaryHandler = /*#__PURE__*/function () {
29172
28647
  }, {
29173
28648
  key: "getSummaryItems",
29174
28649
  value: function () {
29175
- var _getSummaryItems = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(sets, doConfigure, doAllowSetPlanner) {
28650
+ var _getSummaryItems = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(sets, doConfigure) {
29176
28651
  var ret, _key5, set, items, type;
29177
28652
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
29178
28653
  while (1) switch (_context.prev = _context.next) {
29179
28654
  case 0:
29180
28655
  ret = [];
29181
- if (!doAllowSetPlanner) {
29182
- _context.next = 5;
29183
- break;
29184
- }
29185
- ret = [{
29186
- items: this.getArticlesForSummary(sets),
29187
- type: 'SUMMARY_ARTICLES',
29188
- name: 'ARTICLELIST',
29189
- price: setHandlerInstance.getTotalPrice(sets),
29190
- quantity: 1
29191
- }];
29192
- _context.next = 29;
29193
- break;
29194
- case 5:
29195
28656
  _context.t0 = _regeneratorRuntime__default["default"].keys(sets);
29196
- case 6:
28657
+ case 2:
29197
28658
  if ((_context.t1 = _context.t0()).done) {
29198
- _context.next = 29;
28659
+ _context.next = 25;
29199
28660
  break;
29200
28661
  }
29201
28662
  _key5 = _context.t1.value;
@@ -29203,9 +28664,9 @@ var SummaryHandler = /*#__PURE__*/function () {
29203
28664
  items = void 0;
29204
28665
  type = this.getSummaryType(set);
29205
28666
  _context.t2 = type;
29206
- _context.next = _context.t2 === 'SUMMARY_PARTLIST' ? 14 : _context.t2 === 'SUMMARY_OPTIONTREE' ? 17 : _context.t2 === 'VARIANTS' ? 19 : _context.t2 === 'PARTLIST_AND_SPECIALOPTIONS' ? 25 : 27;
28667
+ _context.next = _context.t2 === 'SUMMARY_PARTLIST' ? 10 : _context.t2 === 'SUMMARY_OPTIONTREE' ? 13 : _context.t2 === 'VARIANTS' ? 15 : _context.t2 === 'PARTLIST_AND_SPECIALOPTIONS' ? 21 : 23;
29207
28668
  break;
29208
- case 14:
28669
+ case 10:
29209
28670
  items = this.buildSummaryItemsOfPartlist(set);
29210
28671
  ret.push({
29211
28672
  items: items,
@@ -29214,33 +28675,33 @@ var SummaryHandler = /*#__PURE__*/function () {
29214
28675
  price: set.getSetPrice(),
29215
28676
  quantity: 1
29216
28677
  });
29217
- return _context.abrupt("break", 27);
29218
- case 17:
28678
+ return _context.abrupt("break", 23);
28679
+ case 13:
29219
28680
  ret = ret.concat(this.getOptionTreeSummary(set));
29220
- return _context.abrupt("break", 27);
29221
- case 19:
28681
+ return _context.abrupt("break", 23);
28682
+ case 15:
29222
28683
  _context.t3 = ret;
29223
- _context.next = 22;
28684
+ _context.next = 18;
29224
28685
  return this.getVariantsSummary(doConfigure, set);
29225
- case 22:
28686
+ case 18:
29226
28687
  _context.t4 = _context.sent;
29227
28688
  _context.t3.push.call(_context.t3, _context.t4);
29228
- return _context.abrupt("break", 27);
29229
- case 25:
28689
+ return _context.abrupt("break", 23);
28690
+ case 21:
29230
28691
  ret.push(this.buildSummaryItemsOfPartlistWithSpecialOptions(set));
29231
- return _context.abrupt("break", 27);
29232
- case 27:
29233
- _context.next = 6;
28692
+ return _context.abrupt("break", 23);
28693
+ case 23:
28694
+ _context.next = 2;
29234
28695
  break;
29235
- case 29:
28696
+ case 25:
29236
28697
  return _context.abrupt("return", ret);
29237
- case 30:
28698
+ case 26:
29238
28699
  case "end":
29239
28700
  return _context.stop();
29240
28701
  }
29241
28702
  }, _callee, this);
29242
28703
  }));
29243
- function getSummaryItems(_x, _x2, _x3) {
28704
+ function getSummaryItems(_x, _x2) {
29244
28705
  return _getSummaryItems.apply(this, arguments);
29245
28706
  }
29246
28707
  return getSummaryItems;
@@ -29344,69 +28805,15 @@ var SummaryHandler = /*#__PURE__*/function () {
29344
28805
  }
29345
28806
  return ret;
29346
28807
  }
29347
- }, {
29348
- key: "getArticlesForSummary",
29349
- value: function getArticlesForSummary(sets) {
29350
- var ret = {};
29351
- for (var setId in sets) {
29352
- var set = sets[setId];
29353
- var articles = set.getDivaArticles();
29354
- for (var basketId in articles) {
29355
- var article = articles[basketId];
29356
- if (!article.curProduct) {
29357
- var _key9 = article.catalogCodex + '_' + article.articleCodex + '_' + article.articleVariantDesc();
29358
- if (ret[_key9]) {
29359
- var _ret$_key9$targetArti;
29360
- ret[_key9].quantity = ret[_key9].quantity + article.quantity;
29361
- ret[_key9].targetBasketIds.push(article.basketId);
29362
- (_ret$_key9$targetArti = ret[_key9].targetArticlePosNrs) === null || _ret$_key9$targetArti === void 0 || _ret$_key9$targetArti.push(article.posNr);
29363
- } else {
29364
- ret[_key9] = {
29365
- setId: setId,
29366
- title: article.name,
29367
- title_locales: article.name_locales,
29368
- description: article.actSizeText,
29369
- isDefined: true,
29370
- price: article.price,
29371
- quantity: article.quantity,
29372
- codex: article.articleCodex,
29373
- targetBasketIds: [article.basketId],
29374
- posNr: Object.keys(ret).length,
29375
- image: article.imageUrl,
29376
- targetArticlePosNrs: [article.posNr]
29377
- };
29378
- }
29379
- }
29380
- }
29381
- }
29382
- var curProducts = productHandlerInstance.getCurrentProducts();
29383
- for (var _key10 in curProducts) {
29384
- var product = productHandlerInstance.getProductById(_key10);
29385
- ret[_key10] = {
29386
- setId: 'PRODUCTS',
29387
- title: product.shortDescription,
29388
- description: '',
29389
- isDefined: true,
29390
- price: product.price,
29391
- quantity: curProducts[_key10],
29392
- codex: product.productId,
29393
- targetBasketIds: [],
29394
- posNr: Object.keys(ret).length,
29395
- image: product.image,
29396
- targetArticlePosNrs: []
29397
- };
29398
- }
29399
- return ret;
29400
- }
29401
28808
  }, {
29402
28809
  key: "getSummaryItemsOfAllSets",
29403
28810
  value: function getSummaryItemsOfAllSets(sets, set) {
29404
28811
  var summaryItemsOfAllSets = {};
29405
- for (var _key11 in sets) {
29406
- var _set = sets[_key11];
28812
+ for (var _key9 in sets) {
28813
+ var _set = sets[_key9];
29407
28814
  var articlePosNrs = this.getArticlesPosNr(_set.getDivaArticles(true));
29408
28815
  var summaryItems = this.buildSummaryItems(articlePosNrs, _set);
29409
- summaryItemsOfAllSets[_key11] = {
28816
+ summaryItemsOfAllSets[_key9] = {
29410
28817
  setName: _set.CatalogData.catalogName,
29411
28818
  setPrice: _set.getSetPrice(),
29412
28819
  summaryItems: summaryItems
@@ -29420,10 +28827,10 @@ var SummaryHandler = /*#__PURE__*/function () {
29420
28827
  var groupedArticles = setHandlerInstance.getDockedGroupedArticles(set);
29421
28828
  var retGroups = {};
29422
28829
  var articlesCodexesOnIndex = {};
29423
- for (var _key12 in groupedArticles) {
29424
- var basketId = groupedArticles[_key12][Object.keys(groupedArticles[_key12])[0]].basketId;
28830
+ for (var _key10 in groupedArticles) {
28831
+ var basketId = groupedArticles[_key10][Object.keys(groupedArticles[_key10])[0]].basketId;
29425
28832
  retGroups[basketId] = {
29426
- articles: groupedArticles[_key12],
28833
+ articles: groupedArticles[_key10],
29427
28834
  quantity: 1
29428
28835
  };
29429
28836
  }
@@ -29438,12 +28845,12 @@ var SummaryHandler = /*#__PURE__*/function () {
29438
28845
  articlesCodexesOnIndex[articleCodex].push(i);
29439
28846
  }
29440
28847
  }
29441
- for (var _key13 in articlesCodexesOnIndex) {
29442
- if (articlesCodexesOnIndex[_key13].length > 1) {
28848
+ for (var _key11 in articlesCodexesOnIndex) {
28849
+ if (articlesCodexesOnIndex[_key11].length > 1) {
29443
28850
  //group the single groups by the aricleCodex
29444
28851
  var articles = [];
29445
- for (var _i4 = 0; _i4 < articlesCodexesOnIndex[_key13].length; _i4++) {
29446
- var _group = groupedArticles[articlesCodexesOnIndex[_key13][_i4]];
28852
+ for (var _i4 = 0; _i4 < articlesCodexesOnIndex[_key11].length; _i4++) {
28853
+ var _group = groupedArticles[articlesCodexesOnIndex[_key11][_i4]];
29447
28854
  articles.push({
29448
28855
  article: _group[Object.keys(_group)[0]]
29449
28856
  });
@@ -29499,12 +28906,12 @@ var SummaryHandler = /*#__PURE__*/function () {
29499
28906
  }
29500
28907
 
29501
28908
  //old logic TODO: Delete in 2024
29502
- if (Object.keys(tabGroups).length === 0) for (var _key14 in article.articleOptionStates) {
29503
- var _ops = article.articleOptionStates[_key14];
28909
+ if (Object.keys(tabGroups).length === 0) for (var _key12 in article.articleOptionStates) {
28910
+ var _ops = article.articleOptionStates[_key12];
29504
28911
  if (!_ops.isInvisible && (_ops.selectionmode != 0 || (_ops.visibleCount > 1 || _ops.isFreeText) && article.set.api.showSelectionModeZero()) && _ops.isDoShow && _ops.valCodex != 'OPVNR') {
29505
28912
  var tabGroup = _ops.option.addOptionToTabgroupInPartlistSummary;
29506
28913
  if (tabGroup) tabGroups.push({
29507
- optionCodex: _key14,
28914
+ optionCodex: _key12,
29508
28915
  tabGroup: tabGroup
29509
28916
  });
29510
28917
  }
@@ -29539,8 +28946,8 @@ var SummaryHandler = /*#__PURE__*/function () {
29539
28946
  }
29540
28947
 
29541
28948
  //old logic TODO: Delete in 2024
29542
- for (var _key15 in article.articleOptionStates) {
29543
- var _optionState = article.articleOptionStates[_key15];
28949
+ for (var _key13 in article.articleOptionStates) {
28950
+ var _optionState = article.articleOptionStates[_key13];
29544
28951
  if (_optionState.option.addOptionToTabgroupInPartlistSummary == tabGroup && !_optionState.isInvisible && _optionState.isDoShow && _optionState.visibleCount > 0 && _optionState.valCodex != 'OPVNR') {
29545
28952
  opss.push(_optionState);
29546
28953
  }
@@ -29704,7 +29111,7 @@ var SummaryHandler = /*#__PURE__*/function () {
29704
29111
  }
29705
29112
  }, _callee3);
29706
29113
  }));
29707
- function getVariantsSummary(_x4, _x5) {
29114
+ function getVariantsSummary(_x3, _x4) {
29708
29115
  return _getVariantsSummary.apply(this, arguments);
29709
29116
  }
29710
29117
  return getVariantsSummary;
@@ -29732,8 +29139,8 @@ var SummaryHandler = /*#__PURE__*/function () {
29732
29139
  key: "getArticlesPrice",
29733
29140
  value: function getArticlesPrice(articles) {
29734
29141
  var price = 0;
29735
- for (var _key16 in articles) {
29736
- price = price + articles[_key16].price * articles[_key16].quantity;
29142
+ for (var _key14 in articles) {
29143
+ price = price + articles[_key14].price * articles[_key14].quantity;
29737
29144
  }
29738
29145
  return price;
29739
29146
  }
@@ -29753,10 +29160,11 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29753
29160
  return _createClass__default["default"](DivaFavoritesHandler, [{
29754
29161
  key: "initSet",
29755
29162
  value: function initSet(set, orderSet) {
29756
- var _orderSet$ConfigVaria;
29163
+ var _orderSet$TinyVariant;
29757
29164
  set.favorites = orderSet !== null && orderSet !== void 0 && orderSet.Favorites ? orderSet.Favorites : new basketModel.Favorites();
29758
- if ((_orderSet$ConfigVaria = orderSet.ConfigVariants) !== null && _orderSet$ConfigVaria !== void 0 && _orderSet$ConfigVaria.length) {
29759
- set.oldConfigVariants = _toConsumableArray__default["default"](orderSet.ConfigVariants);
29165
+ if ((_orderSet$TinyVariant = orderSet.TinyVariantConfiguration) !== null && _orderSet$TinyVariant !== void 0 && _orderSet$TinyVariant.length) {
29166
+ var _orderSet$TinyVariant2;
29167
+ set.oldConfigVariants = _toConsumableArray__default["default"]((_orderSet$TinyVariant2 = orderSet.TinyVariantConfiguration) !== null && _orderSet$TinyVariant2 !== void 0 ? _orderSet$TinyVariant2 : []);
29760
29168
  }
29761
29169
  set.disabledVariants = [];
29762
29170
  }
@@ -29773,33 +29181,35 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29773
29181
  key: "getVariantsForSummary",
29774
29182
  value: function () {
29775
29183
  var _getVariantsForSummary = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(set) {
29776
- var _set$allVariantsCache;
29184
+ var _set$actions, _set$allVariantsCache, _set$actions2;
29777
29185
  var variants;
29778
29186
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
29779
29187
  while (1) switch (_context.prev = _context.next) {
29780
29188
  case 0:
29781
29189
  this.isCalcForSummary = true;
29190
+ (_set$actions = set.actions) === null || _set$actions === void 0 || _set$actions.toggleLoading('calcfavorites', false, true);
29782
29191
  if (!((_set$allVariantsCache = set.allVariantsCache) !== null && _set$allVariantsCache !== void 0)) {
29783
- _context.next = 5;
29192
+ _context.next = 6;
29784
29193
  break;
29785
29194
  }
29786
29195
  _context.t0 = _set$allVariantsCache;
29787
- _context.next = 8;
29196
+ _context.next = 9;
29788
29197
  break;
29789
- case 5:
29790
- _context.next = 7;
29198
+ case 6:
29199
+ _context.next = 8;
29791
29200
  return this.getAllValidVariants(set);
29792
- case 7:
29793
- _context.t0 = _context.sent;
29794
29201
  case 8:
29202
+ _context.t0 = _context.sent;
29203
+ case 9:
29795
29204
  variants = _context.t0;
29205
+ (_set$actions2 = set.actions) === null || _set$actions2 === void 0 || _set$actions2.toggleLoading('calcfavorites', false, false);
29796
29206
  this.isCalcForSummary = false;
29797
29207
  return _context.abrupt("return", {
29798
29208
  disabled: set.disabledVariants,
29799
29209
  variants: variants,
29800
29210
  singleOptions: this.repairFavorites(set).singleOptions
29801
29211
  });
29802
- case 11:
29212
+ case 13:
29803
29213
  case "end":
29804
29214
  return _context.stop();
29805
29215
  }
@@ -29976,8 +29386,9 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29976
29386
  if (!((_set$oldConfigVariant = set.oldConfigVariants) !== null && _set$oldConfigVariant !== void 0 && _set$oldConfigVariant.length)) return 0;
29977
29387
  var highestId = 0;
29978
29388
  for (var i = 0; i < set.oldConfigVariants.length; i++) {
29979
- if (highestId < set.oldConfigVariants[i].VariantID) {
29980
- highestId = set.oldConfigVariants[i].VariantID;
29389
+ var variant = set.oldConfigVariants[i];
29390
+ if (variant.VariantID && highestId < variant.VariantID) {
29391
+ highestId = variant.VariantID;
29981
29392
  }
29982
29393
  }
29983
29394
  return highestId + 1;
@@ -29990,15 +29401,17 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29990
29401
  for (var i = 0; i < set.oldConfigVariants.length; i++) {
29991
29402
  var oldConfigVariant = set.oldConfigVariants[i];
29992
29403
  var tryNext = false;
29993
- for (var basketId in variant.targetArticles) {
29404
+ var _loop2 = function _loop2(basketId) {
29994
29405
  var articleNew = variant.targetArticles[basketId];
29995
- var articleOld = oldConfigVariant.SetVariantData[basketId];
29406
+ var articleOld = oldConfigVariant.OrderSets[0].OrderLines.find(function (ol) {
29407
+ return ol.BasketID == basketId;
29408
+ });
29996
29409
  if (!articleOld) {
29997
29410
  tryNext = true;
29998
- continue;
29411
+ return 1; // continue
29999
29412
  }
30000
- var _loop2 = function _loop2(opt) {
30001
- var option = articleOld.VariantValues.find(function (v) {
29413
+ var _loop3 = function _loop3(opt) {
29414
+ var option = articleOld.VariantBasketDatas.find(function (v) {
30002
29415
  return 'OPT' + v.OPT == opt;
30003
29416
  });
30004
29417
  if (!option) {
@@ -30012,9 +29425,12 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30012
29425
  },
30013
29426
  _ret;
30014
29427
  for (var opt in articleNew) {
30015
- _ret = _loop2(opt);
29428
+ _ret = _loop3(opt);
30016
29429
  if (_ret === 0) continue;
30017
29430
  }
29431
+ };
29432
+ for (var basketId in variant.targetArticles) {
29433
+ if (_loop2(basketId)) continue;
30018
29434
  }
30019
29435
  if (tryNext) continue;
30020
29436
  return oldConfigVariant.VariantID;
@@ -30059,7 +29475,7 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30059
29475
  var optionValue = set.CatalogData.getOptionValue(opvs[i]);
30060
29476
  var optionValueName = optionValue === null || optionValue === void 0 ? void 0 : optionValue.name;
30061
29477
  var optionValueImage = optionValue === null || optionValue === void 0 ? void 0 : optionValue.image;
30062
- favorit = new basketModel.Favorit(opt, opvs[i], targetArticles, optionName, optionValueName, optionValueImage);
29478
+ favorit = new basketModel.Favorite(opt, opvs[i], targetArticles, optionName, optionValueName, optionValueImage);
30063
29479
  this.setFavorites(set, opt, opvs[i], favorit, remove);
30064
29480
  }
30065
29481
  set.disabledVariants = [];
@@ -30455,14 +29871,28 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30455
29871
  var optionsMatching = {};
30456
29872
  for (var basketId in variant.targetArticles) {
30457
29873
  var articleVariantValues = variant.targetArticles[basketId];
29874
+ var _loop4 = function _loop4(opt) {
29875
+ var _articleWithOption$Va;
29876
+ if (optionsMatching[opt]) return 0; // continue
29877
+ var articleWithOption = oldConfig.OrderSets[0].OrderLines.find(function (ol) {
29878
+ return ol.VariantBasketDatas.find(function (v) {
29879
+ return 'OPT' + v.OPT === opt;
29880
+ });
29881
+ });
29882
+ if ('OPV' + (articleWithOption === null || articleWithOption === void 0 || (_articleWithOption$Va = articleWithOption.VariantBasketDatas.find(function (v) {
29883
+ return 'OPT' + v.OPT === opt;
29884
+ })) === null || _articleWithOption$Va === void 0 ? void 0 : _articleWithOption$Va.OPV) == articleVariantValues[opt]) {
29885
+ optionsMatching[opt] = true;
29886
+ } else {
29887
+ tryNext = true;
29888
+ return 1; // break
29889
+ }
29890
+ },
29891
+ _ret2;
30458
29892
  for (var opt in articleVariantValues) {
30459
- if (optionsMatching[opt]) continue;
30460
- if (oldConfig.Variant[opt] == articleVariantValues[opt]) {
30461
- optionsMatching[opt] = true;
30462
- } else {
30463
- tryNext = true;
30464
- break;
30465
- }
29893
+ _ret2 = _loop4(opt);
29894
+ if (_ret2 === 0) continue;
29895
+ if (_ret2 === 1) break;
30466
29896
  }
30467
29897
  if (tryNext) break;
30468
29898
  }
@@ -31294,6 +30724,53 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
31294
30724
  }();
31295
30725
  var configTreeHandler = new DivaConfigTreeHandler();
31296
30726
 
30727
+ //Diese Klasse verwaltet Productlogiken
30728
+ var DivaProductHandler = /*#__PURE__*/function () {
30729
+ function DivaProductHandler() {
30730
+ _classCallCheck__default["default"](this, DivaProductHandler);
30731
+ }
30732
+ return _createClass__default["default"](DivaProductHandler, [{
30733
+ key: "getPrice",
30734
+ value: function getPrice() {
30735
+ var price = 0;
30736
+ return price;
30737
+ }
30738
+ }, {
30739
+ key: "updateProducts",
30740
+ value: function () {
30741
+ var _updateProducts = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(sets, api, from) {
30742
+ return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
30743
+ while (1) switch (_context.prev = _context.next) {
30744
+ case 0:
30745
+ ({
30746
+ catalogs: sets.map(function (set) {
30747
+ return {
30748
+ articles: Object.values(set.getDivaArticles()).map(function (article) {
30749
+ return {
30750
+ codex: article.articleCodex,
30751
+ hash: article.articleProductHash
30752
+ };
30753
+ }),
30754
+ catalogGuid: set.CatalogData.catalogGuid
30755
+ };
30756
+ })
30757
+ });
30758
+ return _context.abrupt("return");
30759
+ case 2:
30760
+ case "end":
30761
+ return _context.stop();
30762
+ }
30763
+ }, _callee);
30764
+ }));
30765
+ function updateProducts(_x, _x2, _x3) {
30766
+ return _updateProducts.apply(this, arguments);
30767
+ }
30768
+ return updateProducts;
30769
+ }()
30770
+ }]);
30771
+ }();
30772
+ var productHandlerInstance = new DivaProductHandler();
30773
+
31297
30774
  function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
31298
30775
  function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31299
30776
  var LOG$8 = DivaUtils__default["default"].initLog('Planner', 'DIVA-SET-HANDLER');
@@ -31342,11 +30819,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
31342
30819
  _context.next = 12;
31343
30820
  return set.plannerHandler.initSet(set, catalogData, undefined);
31344
30821
  case 12:
31345
- _context.next = 14;
31346
- return productHandlerInstance.updateProducts(set, 'onAdd');
31347
- case 14:
31348
30822
  return _context.abrupt("return", set);
31349
- case 15:
30823
+ case 13:
31350
30824
  case "end":
31351
30825
  return _context.stop();
31352
30826
  }
@@ -31403,7 +30877,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
31403
30877
  PosNr: orderline.PosNr,
31404
30878
  VariantValues: variantValues,
31405
30879
  VariantItemData: orderline.VariantBasketDatas,
31406
- ShelfPlanData: orderline.ShelfPlandata,
30880
+ ShelfPlandata: orderline.ShelfPlandata,
31407
30881
  elementId: (_orderline$ElementID = orderline.ElementID) !== null && _orderline$ElementID !== void 0 ? _orderline$ElementID : elements === null || elements === void 0 || (_elements$find = elements.find(function (element) {
31408
30882
  return element.basketID == orderline.BasketID;
31409
30883
  })) === null || _elements$find === void 0 ? void 0 : _elements$find.elementID
@@ -32130,19 +31604,12 @@ var DivaSetHandler = /*#__PURE__*/function () {
32130
31604
  _context13.next = 16;
32131
31605
  return articleHandlerInstance.toDoAfterArticleLoaded(newArticle, defaultHeaderValues, {}, from, undefined, ignorePlanner);
32132
31606
  case 16:
32133
- if (!(from === 'initializing')) {
32134
- _context13.next = 19;
32135
- break;
32136
- }
32137
- _context13.next = 19;
32138
- return productHandlerInstance.updateProducts(set, 'onAdd');
32139
- case 19:
32140
31607
  LOG$8.successTransaction('ON_PLAN_ARTICLE', {
32141
31608
  art: articleCodex,
32142
31609
  artName: newArticle.name
32143
31610
  });
32144
31611
  return _context13.abrupt("return", newArticle);
32145
- case 21:
31612
+ case 18:
32146
31613
  case "end":
32147
31614
  return _context13.stop();
32148
31615
  }
@@ -32275,7 +31742,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32275
31742
  key: "deleteElementFromSet",
32276
31743
  value: function () {
32277
31744
  var _deleteElementFromSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee14(set, article, autoCorrectAVL_AVR, deletionType, dontReload) {
32278
- var _deletedArticle$doorP, _set$CatalogData, _deletedArticle$curPr;
31745
+ var _deletedArticle$doorP, _set$CatalogData;
32279
31746
  var setId, deletedArticle, articles, key, newSelectedElement, oldTransform, result, _set$getArticleByBask3, elementDeleted;
32280
31747
  return _regeneratorRuntime__default["default"].wrap(function _callee14$(_context16) {
32281
31748
  while (1) switch (_context16.prev = _context16.next) {
@@ -32335,20 +31802,13 @@ var DivaSetHandler = /*#__PURE__*/function () {
32335
31802
  _context16.next = 27;
32336
31803
  return this.updateArticlesOptionStatesOfActSet(set, {}, []);
32337
31804
  case 27:
32338
- if (dontReload) {
32339
- _context16.next = 30;
32340
- break;
32341
- }
32342
- _context16.next = 30;
32343
- return productHandlerInstance.updateProducts(set, 'onDelete', deletedArticle === null || deletedArticle === void 0 || (_deletedArticle$curPr = deletedArticle.curProduct) === null || _deletedArticle$curPr === void 0 ? void 0 : _deletedArticle$curPr.productId);
32344
- case 30:
32345
31805
  return _context16.abrupt("return", {
32346
31806
  success: elementDeleted,
32347
31807
  selectElementId: newSelectedElement,
32348
31808
  setId: setId,
32349
31809
  oldTransform: oldTransform
32350
31810
  });
32351
- case 31:
31811
+ case 28:
32352
31812
  case "end":
32353
31813
  return _context16.stop();
32354
31814
  }
@@ -33130,8 +32590,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
33130
32590
  key: "variantsEvaluator",
33131
32591
  value: (function () {
33132
32592
  var _variantsEvaluator = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee23(set, configItems, configStepKey, paletteType) {
33133
- var _set$WebConfig, _set$ViewConfig, _configItems$;
33134
- var opt, checkForProductsInStock, calcVariantsForPricePreview, previewType, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
32593
+ var _set$ViewConfig, _configItems$;
32594
+ var opt, calcVariantsForPricePreview, previewType, _set$api$ReturnToFrom, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
33135
32595
  return _regeneratorRuntime__default["default"].wrap(function _callee23$(_context25) {
33136
32596
  while (1) switch (_context25.prev = _context25.next) {
33137
32597
  case 0:
@@ -33142,37 +32602,33 @@ var DivaSetHandler = /*#__PURE__*/function () {
33142
32602
  }
33143
32603
  return _context25.abrupt("return", configItems);
33144
32604
  case 3:
33145
- checkForProductsInStock = ((_set$WebConfig = set.WebConfig) === null || _set$WebConfig === void 0 ? void 0 : _set$WebConfig.checkForProductsInStock) && !(opt !== null && opt !== void 0 && opt.isDescribingState);
33146
32605
  calcVariantsForPricePreview = false;
33147
32606
  previewType = (_set$ViewConfig = set.ViewConfig) === null || _set$ViewConfig === void 0 ? void 0 : _set$ViewConfig.pricePreview;
33148
32607
  if (previewType) {
33149
- 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));
32608
+ 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));
33150
32609
  }
33151
32610
  if (set.PlannerMode === 'BoxPlanner') calcVariantsForPricePreview = false;
33152
32611
  if (paletteType == 'GAL' && ((_configItems$ = configItems[0]) === null || _configItems$ === void 0 ? void 0 : _configItems$.groupName) === undefined || paletteType == 'TEXTBOX' || paletteType == 'NUMBERBOX' || paletteType == 'RANGE') {
33153
32612
  calcVariantsForPricePreview = false;
33154
32613
  }
33155
- if (!(checkForProductsInStock || calcVariantsForPricePreview)) {
33156
- _context25.next = 19;
32614
+ if (!calcVariantsForPricePreview) {
32615
+ _context25.next = 17;
33157
32616
  break;
33158
32617
  }
33159
32618
  targetArticles = set.configTree.getTargetArticles(configStepKey);
33160
32619
  startTime = new Date();
33161
- _context25.next = 14;
32620
+ _context25.next = 13;
33162
32621
  return this.calcVariants(set, configItems, targetArticles);
33163
- case 14:
32622
+ case 13:
33164
32623
  variants = _context25.sent;
33165
32624
  endTime = new Date();
33166
32625
  if (endTime.getTime() - startTime.getTime() > 1000) set.dontCalcPricePreviewDueToPerformanceIssues = true;
33167
32626
  if (previewType) {
33168
32627
  this.calcPricePreview(set, configItems, variants);
33169
32628
  }
33170
- if (checkForProductsInStock) {
33171
- configItems = productHandlerInstance.checkProductInStock(configItems, variants, set.getDivaArticles(), targetArticles);
33172
- }
33173
- case 19:
32629
+ case 17:
33174
32630
  return _context25.abrupt("return", configItems);
33175
- case 20:
32631
+ case 18:
33176
32632
  case "end":
33177
32633
  return _context25.stop();
33178
32634
  }
@@ -33346,29 +32802,22 @@ var DivaSetHandler = /*#__PURE__*/function () {
33346
32802
  _context27.next = 19;
33347
32803
  return this.updateEdoArticles(set, retValues.newEDOExtraArticles);
33348
32804
  case 19:
33349
- if (!(from == 'FromViewClick')) {
33350
- _context27.next = 22;
33351
- break;
33352
- }
33353
- _context27.next = 22;
33354
- return productHandlerInstance.updateProducts(set, 'onConfig');
33355
- case 22:
33356
32805
  if (set.CatalogData.hasAlternateRenderings) set.CatalogData.updateAlternativeRenderings(set.getDivaArticles());
33357
32806
 
33358
32807
  //Update Planner - check if planner data changed
33359
32808
  if (!(!ignorePlanner && from != 'calcVariant')) {
33360
- _context27.next = 51;
32809
+ _context27.next = 48;
33361
32810
  break;
33362
32811
  }
33363
32812
  targetElementIds = this.getElementIdsOfArticles(set, targetArticlesWithNewValues);
33364
- _context27.next = 27;
32813
+ _context27.next = 24;
33365
32814
  return set.plannerHandler.updatePlanner(set.getSetId(), myValues, targetElementIds);
33366
- case 27:
32815
+ case 24:
33367
32816
  resultPlannerUpdate = _context27.sent;
33368
32817
  i = 0;
33369
- case 29:
32818
+ case 26:
33370
32819
  if (!(i < resultPlannerUpdate.elemIdsToDelete.length)) {
33371
- _context27.next = 38;
32820
+ _context27.next = 35;
33372
32821
  break;
33373
32822
  }
33374
32823
  articleToDel = set.getArticleByElementId(resultPlannerUpdate.elemIdsToDelete[i]);
@@ -33376,43 +32825,43 @@ var DivaSetHandler = /*#__PURE__*/function () {
33376
32825
  if (index > -1) {
33377
32826
  targetArticlesWithNewValues.splice(index, 1);
33378
32827
  }
33379
- _context27.next = 35;
32828
+ _context27.next = 32;
33380
32829
  return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[i], false, resultPlannerUpdate.deletionType);
33381
- case 35:
32830
+ case 32:
33382
32831
  i++;
33383
- _context27.next = 29;
32832
+ _context27.next = 26;
33384
32833
  break;
33385
- case 38:
32834
+ case 35:
33386
32835
  if (!(resultPlannerUpdate.elementIdToCopy && resultPlannerUpdate.elementIdToCopy.length > 0)) {
33387
- _context27.next = 51;
32836
+ _context27.next = 48;
33388
32837
  break;
33389
32838
  }
33390
32839
  //Todo copy these elements
33391
32840
  articleCopyRelation = new Map();
33392
32841
  i = 0;
33393
- case 41:
32842
+ case 38:
33394
32843
  if (!(i < resultPlannerUpdate.elementIdToCopy.length)) {
33395
- _context27.next = 49;
32844
+ _context27.next = 46;
33396
32845
  break;
33397
32846
  }
33398
- _context27.next = 44;
32847
+ _context27.next = 41;
33399
32848
  return this.copyArticleByElementId(set, resultPlannerUpdate.elementIdToCopy[i], resultPlannerUpdate.ignoreOptionsToCopy);
33400
- case 44:
32849
+ case 41:
33401
32850
  newArticle = _context27.sent;
33402
32851
  articleCopyRelation.set(resultPlannerUpdate.elementIdToCopy[i], newArticle.basketId);
33403
- case 46:
32852
+ case 43:
33404
32853
  i++;
33405
- _context27.next = 41;
32854
+ _context27.next = 38;
33406
32855
  break;
33407
- case 49:
33408
- _context27.next = 51;
32856
+ case 46:
32857
+ _context27.next = 48;
33409
32858
  return set.plannerHandler.copyPlannerElements(set.getSetId(), articleCopyRelation, {
33410
32859
  dpType: resultPlannerUpdate.copyDPType ? resultPlannerUpdate.copyDPType : 'NO',
33411
32860
  copyType: resultPlannerUpdate.copyType,
33412
32861
  changedOPT: resultPlannerUpdate.changedOPT,
33413
32862
  targetElements: resultPlannerUpdate.targetElements
33414
32863
  });
33415
- case 51:
32864
+ case 48:
33416
32865
  this.updatePosNrOfAccessoiresOfTargetArticles(set, targetArticlesWithNewValues);
33417
32866
  if (from == 'FromViewClick' && (_Object$keys = Object.keys(myValues)) !== null && _Object$keys !== void 0 && _Object$keys.length) {
33418
32867
  this.confirmOptionsInMetric(set, [Object.keys(myValues)[0]], 'onSelectConfig');
@@ -33422,7 +32871,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33422
32871
  elementIdsToUpdateSelection: (_resultPlannerUpdate = resultPlannerUpdate) === null || _resultPlannerUpdate === void 0 ? void 0 : _resultPlannerUpdate.elementIdsToUpdateSelection,
33423
32872
  setId: set.getSetId()
33424
32873
  });
33425
- case 54:
32874
+ case 51:
33426
32875
  case "end":
33427
32876
  return _context27.stop();
33428
32877
  }
@@ -33568,7 +33017,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33568
33017
  articleHandlerInstance.defineAllOptionsOfArticles(articles);
33569
33018
  } else if (key === set.getSetId()) {
33570
33019
  for (var _key in basketIdsOnOptions) {
33571
- articlesAndOptions[_key] = {
33020
+ if (articles[_key]) articlesAndOptions[_key] = {
33572
33021
  article: articles[_key],
33573
33022
  options: basketIdsOnOptions[_key]
33574
33023
  };
@@ -33719,7 +33168,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33719
33168
  value: function getTotalPrice(sets) {
33720
33169
  var _this$actSet;
33721
33170
  var price = 0;
33722
- if ((_this$actSet = this.actSet(sets)) !== null && _this$actSet !== void 0 && (_this$actSet = _this$actSet.WebConfig) !== null && _this$actSet !== void 0 && _this$actSet.checkForProductsInStock) {
33171
+ if ((_this$actSet = this.actSet(sets)) !== null && _this$actSet !== void 0 && (_this$actSet = _this$actSet.WebConfig) !== null && _this$actSet !== void 0 && _this$actSet.checkForProductsPrice && productHandlerInstance.getPrice()) {
33723
33172
  return productHandlerInstance.getPrice();
33724
33173
  }
33725
33174
  for (var key in sets) {
@@ -33733,7 +33182,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33733
33182
  var _this$actSet2;
33734
33183
  var price = 0;
33735
33184
  var bruttoActive = false;
33736
- if ((_this$actSet2 = this.actSet(sets)) !== null && _this$actSet2 !== void 0 && (_this$actSet2 = _this$actSet2.WebConfig) !== null && _this$actSet2 !== void 0 && _this$actSet2.checkForProductsInStock) {
33185
+ if ((_this$actSet2 = this.actSet(sets)) !== null && _this$actSet2 !== void 0 && (_this$actSet2 = _this$actSet2.WebConfig) !== null && _this$actSet2 !== void 0 && _this$actSet2.checkForProductsPrice && productHandlerInstance.getPrice()) {
33737
33186
  return productHandlerInstance.getPrice();
33738
33187
  }
33739
33188
  for (var key in sets) {
@@ -33760,7 +33209,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33760
33209
  key: "fillOrderLinesAndOrderSets",
33761
33210
  value: function () {
33762
33211
  var _fillOrderLinesAndOrderSets = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28(sets, divaBasketHandler, repairOnly, setPlanner, returnTo) {
33763
- var _set$WebConfig2;
33212
+ var _set$WebConfig;
33764
33213
  var orderSets, basketData, set, setPosNr, price, key, _set$basketConfigVari, _OrderLinesOfActSet$, _set, catalogData, articles, orderLineInitInfos, newOrderSet, OrderLinesOfActSet, ret, _key2, i, _basketData$OrderSets, _basketData$SetPlanne, oderSetsIsInActPlanning, setId, j;
33765
33214
  return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context30) {
33766
33215
  while (1) switch (_context30.prev = _context30.next) {
@@ -33770,7 +33219,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33770
33219
  set = this.actSet(sets); //ACHTUNG: Wenn man das nicht zuerst löscht, gibt es beim wiederholten basket Speichern doppelte Einträge
33771
33220
  basketData.setSAPOrderLines([]);
33772
33221
  setPosNr = 0;
33773
- if (set !== null && set !== void 0 && (_set$WebConfig2 = set.WebConfig) !== null && _set$WebConfig2 !== void 0 && _set$WebConfig2.checkForProductsPrice) {
33222
+ if (set !== null && set !== void 0 && (_set$WebConfig = set.WebConfig) !== null && _set$WebConfig !== void 0 && _set$WebConfig.checkForProductsPrice) {
33774
33223
  price = set.priceForActHash();
33775
33224
  if (!price) {
33776
33225
  basketData.OrigProductId = undefined;
@@ -33807,7 +33256,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33807
33256
  if (newOrderSet.SetImage == '' && (_OrderLinesOfActSet$ = OrderLinesOfActSet[0]) !== null && _OrderLinesOfActSet$ !== void 0 && _OrderLinesOfActSet$.Image && _set.PlannerMode == 'No') {
33808
33257
  newOrderSet.SetImage = OrderLinesOfActSet[0].Image.replace('_low', '');
33809
33258
  }
33810
- ret = divaBasketHandler.divaWWSHandler.getWWSData(basketData, _set, newOrderSet, OrderLinesOfActSet, productHandlerInstance.getCurrentProducts());
33259
+ ret = divaBasketHandler.divaWWSHandler.getWWSData(basketData, _set, newOrderSet, OrderLinesOfActSet);
33811
33260
  for (_key2 in ret) {
33812
33261
  if (_key2 == 'orderlines') {
33813
33262
  OrderLinesOfActSet = ret[_key2];
@@ -33911,8 +33360,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
33911
33360
  });
33912
33361
  if (origOrderSet) {
33913
33362
  origOrderSet.CatalogName = actOrderSet.CatalogName;
33363
+ origOrderSet.AccountName = actOrderSet.AccountName;
33364
+ origOrderSet.AccountLogo = actOrderSet.AccountLogo;
33914
33365
  origOrderSet.CatalogOfflineVersion = actOrderSet.CatalogOfflineVersion;
33915
33366
  origOrderSet.CatalogGUID = actOrderSet.CatalogGUID;
33367
+ origOrderSet.CollectionGUID = actOrderSet.CollectionGUID;
33916
33368
  origOrderSet.OrderLines = actOrderSet.OrderLines;
33917
33369
  origOrderSet.OrderSetDesc = actOrderSet.OrderSetDesc;
33918
33370
  origOrderSet.OrigZKATNr = actOrderSet.OrigZKATNr;
@@ -33925,11 +33377,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
33925
33377
  origOrderSet.BBox = actOrderSet.BBox;
33926
33378
  origOrderSet.VariantDescription = actOrderSet.VariantDescription;
33927
33379
  if (actOrderSet.ConfigVariants && origOrderSet.ConfigVariants) origOrderSet.ConfigVariants = actOrderSet.ConfigVariants.map(function (variant, index) {
33380
+ var _origOrderSet$ConfigV;
33381
+ var configVariant = (_origOrderSet$ConfigV = origOrderSet.ConfigVariants) === null || _origOrderSet$ConfigV === void 0 ? void 0 : _origOrderSet$ConfigV[index];
33382
+ if (!configVariant) return variant;
33928
33383
  return _objectSpread$8(_objectSpread$8({}, variant), {}, {
33929
- SetImage: origOrderSet.ConfigVariants[index].SetImage,
33930
- HQRenderScript: origOrderSet.ConfigVariants[index].HQRenderScript,
33931
- Set2DImage: origOrderSet.ConfigVariants[index].Set2DImage,
33932
- Diva3DProject: origOrderSet.ConfigVariants[index].Diva3DProject
33384
+ SetImage: configVariant.SetImage,
33385
+ HQRenderScript: configVariant.HQRenderScript,
33386
+ Set2DImage: configVariant.Set2DImage,
33387
+ Diva3DProject: configVariant.Diva3DProject
33933
33388
  });
33934
33389
  });
33935
33390
  }
@@ -33938,7 +33393,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
33938
33393
  _loop7();
33939
33394
  }
33940
33395
  }
33941
-
33942
33396
  /**************************SpeicherRoutinen*************************************/
33943
33397
  }, {
33944
33398
  key: "isNoArticleToSave",
@@ -34022,7 +33476,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
34022
33476
  CatalogOfflineFilesLastUpdate: catalogData.offlineFilesLastUpdate,
34023
33477
  Description: catalogData.description,
34024
33478
  GroupType: GroupType,
34025
- MainPosNr: posNr,
34026
33479
  OfflineData: catalogData.offlineData,
34027
33480
  SetArticleNr: set.SetArticleNr ? set.SetArticleNr : catalogData.retailArticleNr,
34028
33481
  SetArticleNrPrefix: set.SetArticleNrPrefix,
@@ -34271,31 +33724,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
34271
33724
  Info: ((_set$api$getI18n$t = (_set$api$getI18n = set.api.getI18n()) === null || _set$api$getI18n === void 0 || (_set$api$getI18n$t2 = _set$api$getI18n.t) === null || _set$api$getI18n$t2 === void 0 ? void 0 : _set$api$getI18n$t2.call(_set$api$getI18n, 'utils.width_first_letter', 'B')) !== null && _set$api$getI18n$t !== void 0 ? _set$api$getI18n$t : 'B') + ': ' + dim.X + ' cm x ' + ((_set$api$getI18n$t3 = (_set$api$getI18n2 = set.api.getI18n()) === null || _set$api$getI18n2 === void 0 || (_set$api$getI18n2$t = _set$api$getI18n2.t) === null || _set$api$getI18n2$t === void 0 ? void 0 : _set$api$getI18n2$t.call(_set$api$getI18n2, 'utils.depth_first_letter', 'T')) !== null && _set$api$getI18n$t3 !== void 0 ? _set$api$getI18n$t3 : 'T') + ': ' + dim.Y + ' cm' + (dim.Z ? ' x ' + ((_set$api$getI18n$t4 = (_set$api$getI18n3 = set.api.getI18n()) === null || _set$api$getI18n3 === void 0 || (_set$api$getI18n3$t = _set$api$getI18n3.t) === null || _set$api$getI18n3$t === void 0 ? void 0 : _set$api$getI18n3$t.call(_set$api$getI18n3, 'utils.height_first_letter', 'H')) !== null && _set$api$getI18n$t4 !== void 0 ? _set$api$getI18n$t4 : 'H') + ': ' + dim.X + ' cm' : '')
34272
33725
  });
34273
33726
  }
34274
- }, {
34275
- key: "loadProductsOfSets",
34276
- value: function () {
34277
- var _loadProductsOfSets = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(orderSets, involvedSetIds) {
34278
- return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context36) {
34279
- while (1) switch (_context36.prev = _context36.next) {
34280
- case 0:
34281
- _context36.next = 2;
34282
- return productHandlerInstance.loadProductsOfSets(orderSets, involvedSetIds);
34283
- case 2:
34284
- case "end":
34285
- return _context36.stop();
34286
- }
34287
- }, _callee34);
34288
- }));
34289
- function loadProductsOfSets(_x113, _x114) {
34290
- return _loadProductsOfSets.apply(this, arguments);
34291
- }
34292
- return loadProductsOfSets;
34293
- }()
34294
- }, {
34295
- key: "addProducts",
34296
- value: function addProducts(variants, families) {
34297
- productHandlerInstance.addProducts(variants, families);
34298
- }
34299
33727
  }, {
34300
33728
  key: "getAllProducts",
34301
33729
  value: function getAllProducts(sets) {
@@ -34323,28 +33751,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
34323
33751
  }, {
34324
33752
  key: "addOrderSetArticlesToExistingSet",
34325
33753
  value: function () {
34326
- var _addOrderSetArticlesToExistingSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(set, orderSet, lastSetToInitialize) {
34327
- return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context37) {
34328
- while (1) switch (_context37.prev = _context37.next) {
33754
+ var _addOrderSetArticlesToExistingSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(set, orderSet, lastSetToInitialize) {
33755
+ return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context36) {
33756
+ while (1) switch (_context36.prev = _context36.next) {
34329
33757
  case 0:
34330
33758
  //TODO: GLOBAL STUFF
34331
33759
  //this.updateActSet(set);
34332
33760
  orderSet.changeBasketIds();
34333
- _context37.next = 3;
33761
+ _context36.next = 3;
34334
33762
  return this.initOrderLineArticles(set, orderSet);
34335
33763
  case 3:
34336
- _context37.next = 5;
33764
+ _context36.next = 5;
34337
33765
  return set.plannerHandler.extendSet(set, orderSet.SetPlanData, lastSetToInitialize);
34338
33766
  case 5:
34339
- _context37.next = 7;
34340
- return productHandlerInstance.updateProducts(set, 'onAdd');
34341
- case 7:
34342
33767
  case "end":
34343
- return _context37.stop();
33768
+ return _context36.stop();
34344
33769
  }
34345
- }, _callee35, this);
33770
+ }, _callee34, this);
34346
33771
  }));
34347
- function addOrderSetArticlesToExistingSet(_x115, _x116, _x117) {
33772
+ function addOrderSetArticlesToExistingSet(_x113, _x114, _x115) {
34348
33773
  return _addOrderSetArticlesToExistingSet.apply(this, arguments);
34349
33774
  }
34350
33775
  return addOrderSetArticlesToExistingSet;
@@ -34669,21 +34094,29 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34669
34094
  }, {
34670
34095
  key: "initProductId",
34671
34096
  value: function () {
34672
- var _initProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(api, productId, keepOldDivaNr) {
34097
+ var _initProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(api, productId) {
34098
+ var result;
34673
34099
  return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
34674
34100
  while (1) switch (_context2.prev = _context2.next) {
34675
34101
  case 0:
34676
34102
  _context2.next = 2;
34677
- return this.loadProduct(api, productId, keepOldDivaNr);
34103
+ return this.getProduct(api, productId);
34678
34104
  case 2:
34105
+ result = _context2.sent;
34106
+ this.assignNewDivaNr = true;
34107
+ _context2.next = 6;
34108
+ return this.initBasket(api, result.divaNr, {
34109
+ basket: result.configuration
34110
+ }, false);
34111
+ case 6:
34679
34112
  return _context2.abrupt("return", _context2.sent);
34680
- case 3:
34113
+ case 7:
34681
34114
  case "end":
34682
34115
  return _context2.stop();
34683
34116
  }
34684
34117
  }, _callee2, this);
34685
34118
  }));
34686
- function initProductId(_x2, _x3, _x4) {
34119
+ function initProductId(_x2, _x3) {
34687
34120
  return _initProductId.apply(this, arguments);
34688
34121
  }
34689
34122
  return initProductId;
@@ -34729,7 +34162,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34729
34162
  }
34730
34163
  }, _callee3, this);
34731
34164
  }));
34732
- function tryInitFirstCatalog(_x5) {
34165
+ function tryInitFirstCatalog(_x4) {
34733
34166
  return _tryInitFirstCatalog.apply(this, arguments);
34734
34167
  }
34735
34168
  return tryInitFirstCatalog;
@@ -34764,7 +34197,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34764
34197
  }
34765
34198
  }, _callee4, this);
34766
34199
  }));
34767
- function createNewDivaNr(_x6) {
34200
+ function createNewDivaNr(_x5) {
34768
34201
  return _createNewDivaNr.apply(this, arguments);
34769
34202
  }
34770
34203
  return createNewDivaNr;
@@ -34794,7 +34227,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34794
34227
  } else {
34795
34228
  this.origConfiguration.originDivaNr = divaNr;
34796
34229
  }
34797
- if (this.plannerConfig.returnTo != 'REPAIR_BASKET' && basket.StatusKey == 'BASE_CONFIGURATION') {
34230
+ if (this.plannerConfig.returnTo != 'REPAIR_BASKET' && (basket.StatusKey == 'BASE_CONFIGURATION' || keepOldDivaNr === false)) {
34798
34231
  this.assignNewDivaNr = true;
34799
34232
  basket.CustomerJourneyId = DivaUtils.nanoid();
34800
34233
  basket.StatusKey = 'USER_CONFIGURATION';
@@ -34812,7 +34245,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34812
34245
  basket.OrderSets[i].SetID = newSetId;
34813
34246
  }
34814
34247
  }
34815
- if (!(this.assignNewDivaNr && !keepOldDivaNr)) {
34248
+ if (!this.assignNewDivaNr) {
34816
34249
  _context5.next = 29;
34817
34250
  break;
34818
34251
  }
@@ -34892,7 +34325,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34892
34325
  }
34893
34326
  }, _callee5, this);
34894
34327
  }));
34895
- function initBasket(_x7, _x8, _x9, _x10, _x11) {
34328
+ function initBasket(_x6, _x7, _x8, _x9, _x10) {
34896
34329
  return _initBasket.apply(this, arguments);
34897
34330
  }
34898
34331
  return initBasket;
@@ -34971,7 +34404,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34971
34404
  }
34972
34405
  }, _callee6, this);
34973
34406
  }));
34974
- function loadBasketByCatalogCodex(_x12) {
34407
+ function loadBasketByCatalogCodex(_x11) {
34975
34408
  return _loadBasketByCatalogCodex.apply(this, arguments);
34976
34409
  }
34977
34410
  return loadBasketByCatalogCodex;
@@ -34979,7 +34412,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34979
34412
  }, {
34980
34413
  key: "loadBasketByDivaNr",
34981
34414
  value: function () {
34982
- var _loadBasketByDivaNr = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee7(api, divaNr, keepOldDivaNr, origProductId) {
34415
+ var _loadBasketByDivaNr = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee7(api, divaNr) {
34983
34416
  var variantData;
34984
34417
  return _regeneratorRuntime__default["default"].wrap(function _callee7$(_context7) {
34985
34418
  while (1) switch (_context7.prev = _context7.next) {
@@ -34990,13 +34423,13 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34990
34423
  case 3:
34991
34424
  variantData = _context7.sent;
34992
34425
  _context7.next = 6;
34993
- return this.initBasket(api, divaNr, variantData, keepOldDivaNr, origProductId);
34426
+ return this.initBasket(api, divaNr, variantData);
34994
34427
  case 6:
34995
34428
  return _context7.abrupt("return", _context7.sent);
34996
34429
  case 9:
34997
34430
  _context7.prev = 9;
34998
34431
  _context7.t0 = _context7["catch"](0);
34999
- LOG$7.error(new DivaUtils.DivaError('DivaNr konnte in der Datenbank nicht gefunden werden', {
34432
+ LOG$7.error(new DivaUtils.DivaError('DivaNr cannot be found in Database', {
35000
34433
  code: 'WC_0004',
35001
34434
  custom: {
35002
34435
  divaNr: divaNr
@@ -35009,7 +34442,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35009
34442
  }
35010
34443
  }, _callee7, this, [[0, 9]]);
35011
34444
  }));
35012
- function loadBasketByDivaNr(_x13, _x14, _x15, _x16) {
34445
+ function loadBasketByDivaNr(_x12, _x13) {
35013
34446
  return _loadBasketByDivaNr.apply(this, arguments);
35014
34447
  }
35015
34448
  return loadBasketByDivaNr;
@@ -35022,98 +34455,65 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35022
34455
  return _regeneratorRuntime__default["default"].wrap(function _callee8$(_context8) {
35023
34456
  while (1) switch (_context8.prev = _context8.next) {
35024
34457
  case 0:
35025
- _context8.next = 2;
34458
+ _context8.prev = 0;
34459
+ _context8.next = 3;
35026
34460
  return api.getDataCache(api.getProductBasketUrl(key, productId), undefined, undefined, 'catalog', 'POST', {
35027
34461
  fields: fields !== null && fields !== void 0 && fields.length ? fields : undefined
35028
34462
  });
35029
- case 2:
34463
+ case 3:
35030
34464
  variantData = _context8.sent;
35031
34465
  if (!(variantData.Error || !variantData.basket)) {
35032
- _context8.next = 8;
34466
+ _context8.next = 9;
35033
34467
  break;
35034
34468
  }
35035
- LOG$7.error(new DivaUtils.DivaError('ProductId konnte in der Datenbank nicht gefunden werden', {
34469
+ LOG$7.error(new DivaUtils.DivaError('CustomProductId cannot be found in Database', {
35036
34470
  code: 'WC_0005',
35037
34471
  custom: {
34472
+ key: key,
35038
34473
  productId: productId
35039
34474
  }
35040
34475
  }));
35041
34476
  return _context8.abrupt("return", false);
35042
- case 8:
35043
- return _context8.abrupt("return", this.initBasket(api, variantData.basket.DivaNr, variantData, undefined, productId));
35044
34477
  case 9:
34478
+ return _context8.abrupt("return", this.initBasket(api, variantData.basket.DivaNr, variantData, undefined, productId));
34479
+ case 10:
34480
+ _context8.next = 16;
34481
+ break;
34482
+ case 12:
34483
+ _context8.prev = 12;
34484
+ _context8.t0 = _context8["catch"](0);
34485
+ LOG$7.error(new DivaUtils.DivaError('Error while fetching product data', {
34486
+ code: 'WC_0005',
34487
+ custom: {
34488
+ productId: productId
34489
+ }
34490
+ }));
34491
+ return _context8.abrupt("return", false);
34492
+ case 16:
35045
34493
  case "end":
35046
34494
  return _context8.stop();
35047
34495
  }
35048
- }, _callee8, this);
34496
+ }, _callee8, this, [[0, 12]]);
35049
34497
  }));
35050
- function loadBasketByCustomProductId(_x17, _x18, _x19, _x20) {
34498
+ function loadBasketByCustomProductId(_x14, _x15, _x16, _x17) {
35051
34499
  return _loadBasketByCustomProductId.apply(this, arguments);
35052
34500
  }
35053
34501
  return loadBasketByCustomProductId;
35054
34502
  }()
35055
34503
  }, {
35056
- key: "loadProduct",
34504
+ key: "getProduct",
35057
34505
  value: function () {
35058
- var _loadProduct = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(api, productId, keepOldDivaNr) {
35059
- var result, divaNr, id, successfully;
34506
+ var _getProduct = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(api, productId) {
34507
+ var result;
35060
34508
  return _regeneratorRuntime__default["default"].wrap(function _callee9$(_context9) {
35061
34509
  while (1) switch (_context9.prev = _context9.next) {
35062
34510
  case 0:
35063
34511
  _context9.next = 2;
35064
- return this.getProduct(api, productId);
35065
- case 2:
35066
- result = _context9.sent;
35067
- if (!(result === false)) {
35068
- _context9.next = 5;
35069
- break;
35070
- }
35071
- return _context9.abrupt("return", false);
35072
- case 5:
35073
- divaNr = result.divaNr;
35074
- if (result.originDivaNr) {
35075
- divaNr = result.originDivaNr;
35076
- } else if (result.variantId !== undefined) {
35077
- id = result.variantId;
35078
- divaNr = result.divaNr + '_' + id.toString().padStart(4, '0');
35079
- }
35080
- _context9.next = 9;
35081
- return this.loadBasketByDivaNr(api, divaNr, keepOldDivaNr, productId);
35082
- case 9:
35083
- successfully = _context9.sent;
35084
- result.type = 'ProductId';
35085
- if (!successfully) {
35086
- _context9.next = 15;
35087
- break;
35088
- }
35089
- return _context9.abrupt("return", result);
35090
- case 15:
35091
- return _context9.abrupt("return", false);
35092
- case 16:
35093
- case "end":
35094
- return _context9.stop();
35095
- }
35096
- }, _callee9, this);
35097
- }));
35098
- function loadProduct(_x21, _x22, _x23) {
35099
- return _loadProduct.apply(this, arguments);
35100
- }
35101
- return loadProduct;
35102
- }()
35103
- }, {
35104
- key: "getProduct",
35105
- value: function () {
35106
- var _getProduct = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(api, productId) {
35107
- var result;
35108
- return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
35109
- while (1) switch (_context10.prev = _context10.next) {
35110
- case 0:
35111
- _context10.next = 2;
35112
34512
  return api.getDataCache(api.getProductUrl(productId), undefined, undefined, 'catalog');
35113
34513
  case 2:
35114
- result = _context10.sent;
34514
+ result = _context9.sent;
35115
34515
  if (!(result.Error || !result)) {
35116
- _context10.next = 6;
34516
+ _context9.next = 6;
35117
34517
  break;
35118
34518
  }
35119
34519
  LOG$7.error(new DivaUtils.DivaError('ProductId konnte in der Datenbank nicht gefunden werden', {
@@ -35122,16 +34522,16 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35122
34522
  productId: productId
35123
34523
  }
35124
34524
  }));
35125
- return _context10.abrupt("return", false);
34525
+ return _context9.abrupt("return", false);
35126
34526
  case 6:
35127
- return _context10.abrupt("return", result[0]);
34527
+ return _context9.abrupt("return", result[0]);
35128
34528
  case 7:
35129
34529
  case "end":
35130
- return _context10.stop();
34530
+ return _context9.stop();
35131
34531
  }
35132
- }, _callee10);
34532
+ }, _callee9);
35133
34533
  }));
35134
- function getProduct(_x24, _x25) {
34534
+ function getProduct(_x18, _x19) {
35135
34535
  return _getProduct.apply(this, arguments);
35136
34536
  }
35137
34537
  return getProduct;
@@ -35139,15 +34539,14 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35139
34539
  }, {
35140
34540
  key: "createNewBasket",
35141
34541
  value: function () {
35142
- var _createNewBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee11(api, initObject, divaNr, lang) {
34542
+ var _createNewBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(api, initObject, divaNr, lang) {
35143
34543
  var setId, orderSet, basketInitObejct, basket;
35144
- return _regeneratorRuntime__default["default"].wrap(function _callee11$(_context11) {
35145
- while (1) switch (_context11.prev = _context11.next) {
34544
+ return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
34545
+ while (1) switch (_context10.prev = _context10.next) {
35146
34546
  case 0:
35147
34547
  setId = 'PLANNING_' + Math.random().toString(36).substring(6);
35148
34548
  orderSet = new basketModel.OrderSetData({
35149
34549
  SetID: setId,
35150
- MainPosNr: 1,
35151
34550
  AccountSessionGUID: initObject.accountSessionGuid,
35152
34551
  CatalogCodex: initObject.catalogCodex,
35153
34552
  CatalogGUID: initObject.catalogGuid,
@@ -35155,10 +34554,10 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35155
34554
  Favorites: new basketModel.Favorites()
35156
34555
  });
35157
34556
  if (!(initObject.accountGuid && !orderSet.AccountSessionGUID)) {
35158
- _context11.next = 5;
34557
+ _context10.next = 5;
35159
34558
  break;
35160
34559
  }
35161
- _context11.next = 5;
34560
+ _context10.next = 5;
35162
34561
  return api.setAccountSessionGuid({
35163
34562
  os: orderSet,
35164
34563
  accountGuid: initObject.accountGuid,
@@ -35176,14 +34575,14 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35176
34575
  CustomerJourneyId: DivaUtils.nanoid()
35177
34576
  };
35178
34577
  basket = new basketModel.BasketData(basketInitObejct);
35179
- return _context11.abrupt("return", basket);
34578
+ return _context10.abrupt("return", basket);
35180
34579
  case 8:
35181
34580
  case "end":
35182
- return _context11.stop();
34581
+ return _context10.stop();
35183
34582
  }
35184
- }, _callee11);
34583
+ }, _callee10);
35185
34584
  }));
35186
- function createNewBasket(_x26, _x27, _x28, _x29) {
34585
+ function createNewBasket(_x20, _x21, _x22, _x23) {
35187
34586
  return _createNewBasket.apply(this, arguments);
35188
34587
  }
35189
34588
  return createNewBasket;
@@ -35202,11 +34601,11 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35202
34601
  }, {
35203
34602
  key: "saveToBasket",
35204
34603
  value: function () {
35205
- var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(api, actBasket, returnTo) {
34604
+ var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee11(api, actBasket, returnTo) {
35206
34605
  var _this$plannerConfig$c4, _this$_basketHandler, _api$getJwt;
35207
34606
  var response;
35208
- return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
35209
- while (1) switch (_context12.prev = _context12.next) {
34607
+ return _regeneratorRuntime__default["default"].wrap(function _callee11$(_context11) {
34608
+ while (1) switch (_context11.prev = _context11.next) {
35210
34609
  case 0:
35211
34610
  LOG$7.startTransaction({
35212
34611
  event: 'SaveBasketOnAPI',
@@ -35218,12 +34617,12 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35218
34617
  actBasket.ReportConfigIdentifier = api.getReportConfigIdentifier();
35219
34618
  actBasket.PrintOptions = api.getPrintOptions(this.reportConfig);
35220
34619
  actBasket.ClientLanguage = api.getLanguage();
35221
- _context12.next = 8;
34620
+ _context11.next = 8;
35222
34621
  return DivaUtils__default["default"].updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser, this.plannerConfig.settings.keepSalesPersonDataInBasket);
35223
34622
  case 8:
35224
34623
  actBasket.UserLanguage = api.getLanguage();
35225
34624
  actBasket.PrintRetailLogo = (_this$plannerConfig$c4 = this.plannerConfig.currentOrganization) === null || _this$plannerConfig$c4 === void 0 ? void 0 : _this$plannerConfig$c4.logoUrl;
35226
- _context12.next = 12;
34625
+ _context11.next = 12;
35227
34626
  return (_this$_basketHandler = this._basketHandler) === null || _this$_basketHandler === void 0 ? void 0 : _this$_basketHandler.saveBasket({
35228
34627
  jwt: (_api$getJwt = api.getJwt()) !== null && _api$getJwt !== void 0 ? _api$getJwt : undefined,
35229
34628
  basket: actBasket,
@@ -35232,30 +34631,30 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35232
34631
  apiKey: api.getApiKey()
35233
34632
  });
35234
34633
  case 12:
35235
- response = _context12.sent;
34634
+ response = _context11.sent;
35236
34635
  if (!(response != 'ERROR_NO_BASKET_SAVED')) {
35237
- _context12.next = 17;
34636
+ _context11.next = 17;
35238
34637
  break;
35239
34638
  }
35240
34639
  this.baskets[this.actDivaNr] = new basketModel.BasketData(response);
35241
- _context12.next = 19;
34640
+ _context11.next = 19;
35242
34641
  break;
35243
34642
  case 17:
35244
34643
  if (!(response === 'ERROR_NO_BASKET_SAVED' || response === 'ERROR_BASKET_AFTER_SAVE')) {
35245
- _context12.next = 19;
34644
+ _context11.next = 19;
35246
34645
  break;
35247
34646
  }
35248
- return _context12.abrupt("return", response);
34647
+ return _context11.abrupt("return", response);
35249
34648
  case 19:
35250
34649
  LOG$7.successTransaction('saveBasketOnAPI');
35251
- return _context12.abrupt("return", response === null || response === void 0 ? void 0 : response._id);
34650
+ return _context11.abrupt("return", response === null || response === void 0 ? void 0 : response._id);
35252
34651
  case 21:
35253
34652
  case "end":
35254
- return _context12.stop();
34653
+ return _context11.stop();
35255
34654
  }
35256
- }, _callee12, this);
34655
+ }, _callee11, this);
35257
34656
  }));
35258
- function saveToBasket(_x30, _x31, _x32) {
34657
+ function saveToBasket(_x24, _x25, _x26) {
35259
34658
  return _saveToBasket.apply(this, arguments);
35260
34659
  }
35261
34660
  return saveToBasket;
@@ -35368,61 +34767,53 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35368
34767
  }, {
35369
34768
  key: "initWWSClient",
35370
34769
  value: function () {
35371
- var _initWWSClient = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee13(wwsClient) {
35372
- var _yield$import, PfisterWWSHandler, _yield$import2, LiviqueWWSHandler, _yield$import3, SeriousWWSHandler, _yield$import4, ProductWWSHandler, _yield$import5, StandardWWSHandler;
35373
- return _regeneratorRuntime__default["default"].wrap(function _callee13$(_context13) {
35374
- while (1) switch (_context13.prev = _context13.next) {
34770
+ var _initWWSClient = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(wwsClient) {
34771
+ var _yield$import, PfisterWWSHandler, _yield$import2, LiviqueWWSHandler, _yield$import3, SeriousWWSHandler, _yield$import4, StandardWWSHandler;
34772
+ return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
34773
+ while (1) switch (_context12.prev = _context12.next) {
35375
34774
  case 0:
35376
- _context13.t0 = wwsClient;
35377
- _context13.next = _context13.t0 === 'Pfister' ? 3 : _context13.t0 === 'Livique' ? 9 : _context13.t0 === 'Serious' ? 15 : _context13.t0 === 'Product' ? 21 : 27;
34775
+ _context12.t0 = wwsClient;
34776
+ _context12.next = _context12.t0 === 'Pfister' ? 3 : _context12.t0 === 'Livique' ? 9 : _context12.t0 === 'Serious' ? 15 : 21;
35378
34777
  break;
35379
34778
  case 3:
35380
- _context13.next = 5;
35381
- return Promise.resolve().then(function () { return require('./PfisterWWSHandler-b47dba23.js'); });
34779
+ _context12.next = 5;
34780
+ return Promise.resolve().then(function () { return require('./PfisterWWSHandler-ca73bf2c.js'); });
35382
34781
  case 5:
35383
- _yield$import = _context13.sent;
34782
+ _yield$import = _context12.sent;
35384
34783
  PfisterWWSHandler = _yield$import["default"];
35385
34784
  this._divaWWSHandler = new PfisterWWSHandler();
35386
- return _context13.abrupt("break", 33);
34785
+ return _context12.abrupt("break", 27);
35387
34786
  case 9:
35388
- _context13.next = 11;
35389
- return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-85a1dc89.js'); });
34787
+ _context12.next = 11;
34788
+ return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-977c3952.js'); });
35390
34789
  case 11:
35391
- _yield$import2 = _context13.sent;
34790
+ _yield$import2 = _context12.sent;
35392
34791
  LiviqueWWSHandler = _yield$import2["default"];
35393
34792
  this._divaWWSHandler = new LiviqueWWSHandler();
35394
- return _context13.abrupt("break", 33);
34793
+ return _context12.abrupt("break", 27);
35395
34794
  case 15:
35396
- _context13.next = 17;
35397
- return Promise.resolve().then(function () { return require('./SeriousBasketHandler-28f031fa.js'); });
34795
+ _context12.next = 17;
34796
+ return Promise.resolve().then(function () { return require('./SeriousBasketHandler-712a57c0.js'); });
35398
34797
  case 17:
35399
- _yield$import3 = _context13.sent;
34798
+ _yield$import3 = _context12.sent;
35400
34799
  SeriousWWSHandler = _yield$import3["default"];
35401
34800
  this._divaWWSHandler = new SeriousWWSHandler();
35402
- return _context13.abrupt("break", 33);
34801
+ return _context12.abrupt("break", 27);
35403
34802
  case 21:
35404
- _context13.next = 23;
35405
- return Promise.resolve().then(function () { return require('./ProductBasketHandler-22cb7ee4.js'); });
34803
+ _context12.next = 23;
34804
+ return Promise.resolve().then(function () { return require('./StandardWWSHandler-435c1ce1.js'); });
35406
34805
  case 23:
35407
- _yield$import4 = _context13.sent;
35408
- ProductWWSHandler = _yield$import4["default"];
35409
- this._divaWWSHandler = new ProductWWSHandler();
35410
- return _context13.abrupt("break", 33);
35411
- case 27:
35412
- _context13.next = 29;
35413
- return Promise.resolve().then(function () { return require('./StandardWWSHandler-ab0c107b.js'); });
35414
- case 29:
35415
- _yield$import5 = _context13.sent;
35416
- StandardWWSHandler = _yield$import5["default"];
34806
+ _yield$import4 = _context12.sent;
34807
+ StandardWWSHandler = _yield$import4["default"];
35417
34808
  this._divaWWSHandler = new StandardWWSHandler();
35418
- return _context13.abrupt("break", 33);
35419
- case 33:
34809
+ return _context12.abrupt("break", 27);
34810
+ case 27:
35420
34811
  case "end":
35421
- return _context13.stop();
34812
+ return _context12.stop();
35422
34813
  }
35423
- }, _callee13, this);
34814
+ }, _callee12, this);
35424
34815
  }));
35425
- function initWWSClient(_x33) {
34816
+ function initWWSClient(_x27) {
35426
34817
  return _initWWSClient.apply(this, arguments);
35427
34818
  }
35428
34819
  return initWWSClient;
@@ -36025,7 +35416,7 @@ var Rendering = /*#__PURE__*/function () {
36025
35416
  this.creationTime = new Date();
36026
35417
  this.layerMaskThreeTexture = undefined;
36027
35418
  this.hasStaticBackground = hasStaticBG;
36028
- this.mediaServiceSaveMode = mediaServiceSaveMode;
35419
+ this.mediaServiceSaveMode = mediaServiceSaveMode !== null && mediaServiceSaveMode !== void 0 ? mediaServiceSaveMode : 'STREAM';
36029
35420
  this.urlToSavedRendering = '';
36030
35421
  this.catalogData = {
36031
35422
  catalogCodex: '',
@@ -36070,12 +35461,12 @@ var Rendering = /*#__PURE__*/function () {
36070
35461
  }, {
36071
35462
  key: "getHasStaticBackground",
36072
35463
  value: function getHasStaticBackground() {
36073
- return this.hasStaticBackground;
35464
+ return !!this.hasStaticBackground;
36074
35465
  }
36075
35466
  }, {
36076
35467
  key: "getIsFullscreenRendering",
36077
35468
  value: function getIsFullscreenRendering() {
36078
- return this.isFullscreenRendering;
35469
+ return !!this.isFullscreenRendering;
36079
35470
  }
36080
35471
  }, {
36081
35472
  key: "setIsFullscreenRendering",
@@ -36085,12 +35476,13 @@ var Rendering = /*#__PURE__*/function () {
36085
35476
  }, {
36086
35477
  key: "getHasDimensionLines",
36087
35478
  value: function getHasDimensionLines() {
36088
- return this.hasDimensionLines;
35479
+ return !!this.hasDimensionLines;
36089
35480
  }
36090
35481
  }, {
36091
35482
  key: "getPlannerMeasureDigits",
36092
35483
  value: function getPlannerMeasureDigits() {
36093
- return this.plannerMeasureDigits;
35484
+ var _this$plannerMeasureD;
35485
+ return (_this$plannerMeasureD = this.plannerMeasureDigits) !== null && _this$plannerMeasureD !== void 0 ? _this$plannerMeasureD : 0;
36094
35486
  }
36095
35487
  }, {
36096
35488
  key: "getIsAlternateRendering",
@@ -36310,6 +35702,7 @@ var Rendering = /*#__PURE__*/function () {
36310
35702
  return this.catalogData.catalogCodex;
36311
35703
  },
36312
35704
  set: function set(val) {
35705
+ if (!val) return;
36313
35706
  this.catalogData.catalogCodex = val;
36314
35707
  }
36315
35708
  }, {
@@ -36318,6 +35711,7 @@ var Rendering = /*#__PURE__*/function () {
36318
35711
  return this.catalogData.catalogGUID;
36319
35712
  },
36320
35713
  set: function set(val) {
35714
+ if (!val) return;
36321
35715
  this.catalogData.catalogGUID = val;
36322
35716
  }
36323
35717
  }, {
@@ -36341,7 +35735,7 @@ var Rendering = /*#__PURE__*/function () {
36341
35735
  }, {
36342
35736
  key: "HasLayerMask",
36343
35737
  get: function get() {
36344
- return this.hasLayerMask;
35738
+ return !!this.hasLayerMask;
36345
35739
  },
36346
35740
  set: function set(hasLayerMask) {
36347
35741
  this.hasLayerMask = hasLayerMask;
@@ -36349,17 +35743,19 @@ var Rendering = /*#__PURE__*/function () {
36349
35743
  }, {
36350
35744
  key: "RenderWidth",
36351
35745
  get: function get() {
36352
- return this.renderWidth;
35746
+ var _this$renderWidth;
35747
+ return (_this$renderWidth = this.renderWidth) !== null && _this$renderWidth !== void 0 ? _this$renderWidth : 0;
36353
35748
  }
36354
35749
  }, {
36355
35750
  key: "RenderHeight",
36356
35751
  get: function get() {
36357
- return this.renderHeight;
35752
+ var _this$renderHeight;
35753
+ return (_this$renderHeight = this.renderHeight) !== null && _this$renderHeight !== void 0 ? _this$renderHeight : 0;
36358
35754
  }
36359
35755
  }, {
36360
35756
  key: "getHasLayerMask",
36361
35757
  value: function getHasLayerMask() {
36362
- return this.hasLayerMask;
35758
+ return !!this.hasLayerMask;
36363
35759
  }
36364
35760
  }, {
36365
35761
  key: "getLayerMaskForSrc",
@@ -36795,7 +36191,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36795
36191
  while (1) switch (_context3.prev = _context3.next) {
36796
36192
  case 0:
36797
36193
  _context3.next = 2;
36798
- return Promise.resolve().then(function () { return require('./Host3DSignalR-d3830717.js'); });
36194
+ return Promise.resolve().then(function () { return require('./Host3DSignalR-6b8cace7.js'); });
36799
36195
  case 2:
36800
36196
  _yield$import = _context3.sent;
36801
36197
  Host3DSignalR = _yield$import["default"];
@@ -38347,7 +37743,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38347
37743
  break;
38348
37744
  case 8:
38349
37745
  _context4.next = 10;
38350
- return Promise.resolve().then(function () { return require('./DivaStandardPlanner-c73e6e57.js'); });
37746
+ return Promise.resolve().then(function () { return require('./DivaStandardPlanner-31757726.js'); });
38351
37747
  case 10:
38352
37748
  _yield$import = _context4.sent;
38353
37749
  DivaStandardPlanner = _yield$import["default"];
@@ -38358,7 +37754,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38358
37754
  return _context4.abrupt("break", 21);
38359
37755
  case 15:
38360
37756
  _context4.next = 17;
38361
- return Promise.resolve().then(function () { return require('./DivaBoxPlanner-7b508f32.js'); });
37757
+ return Promise.resolve().then(function () { return require('./DivaBoxPlanner-ed867881.js'); });
38362
37758
  case 17:
38363
37759
  _yield$import2 = _context4.sent;
38364
37760
  DivaBoxPlanner = _yield$import2["default"];
@@ -38492,6 +37888,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38492
37888
  key: "getSetImageAsUrl",
38493
37889
  value: (function () {
38494
37890
  var _getSetImageAsUrl = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee6(setId) {
37891
+ var _rendering$get3DDimIn, _rendering$get3DDimIn2, _rendering$get3DDimIn3;
38495
37892
  var rendering;
38496
37893
  return _regeneratorRuntime__default["default"].wrap(function _callee6$(_context6) {
38497
37894
  while (1) switch (_context6.prev = _context6.next) {
@@ -38504,9 +37901,9 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38504
37901
  return _context6.abrupt("return", {
38505
37902
  url: rendering === null || rendering === void 0 ? void 0 : rendering.UrlToSavedRendering,
38506
37903
  dimensions: {
38507
- w: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w,
38508
- h: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h,
38509
- d: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d
37904
+ w: ((_rendering$get3DDimIn = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w) !== null && _rendering$get3DDimIn !== void 0 ? _rendering$get3DDimIn : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w : undefined,
37905
+ h: ((_rendering$get3DDimIn2 = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h) !== null && _rendering$get3DDimIn2 !== void 0 ? _rendering$get3DDimIn2 : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h : undefined,
37906
+ d: ((_rendering$get3DDimIn3 = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d) !== null && _rendering$get3DDimIn3 !== void 0 ? _rendering$get3DDimIn3 : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d : undefined
38510
37907
  }
38511
37908
  });
38512
37909
  case 5:
@@ -39503,7 +38900,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39503
38900
  //Do also pass the correct price format
39504
38901
  (_this$actions = _this.actions) === null || _this$actions === void 0 || (_this$actions$toggleL = _this$actions.toggleLoading) === null || _this$actions$toggleL === void 0 || _this$actions$toggleL.call(_this$actions, 'SUMMARY');
39505
38902
  _context2.next = 6;
39506
- return summaryHandlerInstance.getSummaryItems(_this.sets, _this.doConfigure.bind(_this), _this.doAllowSetPlanner());
38903
+ return summaryHandlerInstance.getSummaryItems(_this.sets, _this.doConfigure.bind(_this));
39507
38904
  case 6:
39508
38905
  summaryItems = _context2.sent;
39509
38906
  (_this$updateSummaryIt = _this.updateSummaryItems) === null || _this$updateSummaryIt === void 0 || _this$updateSummaryIt.call(_this, summaryItems, setPriceFormat, summaryHandlerInstance.getSummaryStepWarning(_this.actSet(), summaryItems));
@@ -39588,11 +38985,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39588
38985
  _this.updateViewButtonsDependigOnConfigStructure();
39589
38986
  baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newArticle.basketId);
39590
38987
  if (!dontUpdateView) (_this$updateElementSe = _this.updateElementSelectionPlanner) === null || _this$updateElementSe === void 0 || _this$updateElementSe.call(_this, [baseArticle.setId], [baseArticle.elementId], true);
39591
- _context3.next = 29;
38988
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAdd');
38989
+ _context3.next = 30;
39592
38990
  return _this.checkVariantData();
39593
- case 29:
39594
- return _context3.abrupt("return", 'ElementAdded');
39595
38991
  case 30:
38992
+ return _context3.abrupt("return", 'ElementAdded');
38993
+ case 31:
39596
38994
  case "end":
39597
38995
  return _context3.stop();
39598
38996
  }
@@ -39672,8 +39070,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39672
39070
  (_this$updateViewPlann3 = _this.updateViewPlannerElements) === null || _this$updateViewPlann3 === void 0 || _this$updateViewPlann3.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
39673
39071
  _this.updatePlannerView('ADD_ACC_ON_SHELF_PLANNER');
39674
39072
  }
39073
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfAdd');
39074
+ _this.checkVariantData();
39675
39075
  return _context5.abrupt("return", retVal);
39676
- case 8:
39076
+ case 10:
39677
39077
  case "end":
39678
39078
  return _context5.stop();
39679
39079
  }
@@ -39717,7 +39117,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39717
39117
  _this.updateViewButtonsDependigOnConfigStructure();
39718
39118
  (_this$updateViewPlann5 = _this.updateViewPlannerElements) === null || _this$updateViewPlann5 === void 0 || _this$updateViewPlann5.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
39719
39119
  _this.updatePlannerView('DELETE_ACC_ON_SHELF_PLANNER');
39720
- case 9:
39120
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfDelete');
39121
+ _this.checkVariantData();
39122
+ case 11:
39721
39123
  case "end":
39722
39124
  return _context6.stop();
39723
39125
  }
@@ -39775,22 +39177,24 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39775
39177
  _defineProperty__default["default"](this, "updateAccessoireQuantity", /*#__PURE__*/function () {
39776
39178
  var _ref8 = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee8(accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle) {
39777
39179
  var _this$actions11, _this$actions11$toggl, _this$actions12, _this$actions12$toggl;
39778
- var ret;
39180
+ var set, ret;
39779
39181
  return _regeneratorRuntime__default["default"].wrap(function _callee8$(_context8) {
39780
39182
  while (1) switch (_context8.prev = _context8.next) {
39781
39183
  case 0:
39184
+ set = _this.actSet();
39782
39185
  (_this$actions11 = _this.actions) === null || _this$actions11 === void 0 || (_this$actions11$toggl = _this$actions11.toggleLoading) === null || _this$actions11$toggl === void 0 || _this$actions11$toggl.call(_this$actions11, 'LoadingArticles_' + accessoireItem.articleCodex, false, true);
39783
- _context8.next = 3;
39784
- return setHandlerInstance.updateAccessoireQuantity(_this.actSet(), accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle);
39785
- case 3:
39186
+ _context8.next = 4;
39187
+ return setHandlerInstance.updateAccessoireQuantity(set, accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle);
39188
+ case 4:
39786
39189
  ret = _context8.sent;
39787
39190
  (_this$actions12 = _this.actions) === null || _this$actions12 === void 0 || (_this$actions12$toggl = _this$actions12.toggleLoading) === null || _this$actions12$toggl === void 0 || _this$actions12$toggl.call(_this$actions12, 'LoadingArticles_' + accessoireItem.articleCodex, false, false);
39788
39191
  if (ret.somethingChanged) _this.updateConfigStructure();
39789
39192
  _this.updatePlannerView('UPDATE_ACC_QUANTITY');
39790
39193
  _this.updatePriceInView();
39791
39194
  _this.updateViewButtonsDependigOnConfigStructure();
39195
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireUpdate');
39792
39196
  _this.checkVariantData();
39793
- case 10:
39197
+ case 12:
39794
39198
  case "end":
39795
39199
  return _context8.stop();
39796
39200
  }
@@ -39818,9 +39222,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39818
39222
  _this.updatePriceInView();
39819
39223
  _this.updateViewButtonsDependigOnConfigStructure();
39820
39224
  }
39225
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireDelete');
39821
39226
  _this.checkVariantData();
39822
39227
  return _context9.abrupt("return", wasDeleted);
39823
- case 7:
39228
+ case 8:
39824
39229
  case "end":
39825
39230
  return _context9.stop();
39826
39231
  }
@@ -39902,9 +39307,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39902
39307
  returnValues = _context11.sent;
39903
39308
  (_this$actions14 = _this.actions) === null || _this$actions14 === void 0 || (_this$actions14$toggl = _this$actions14.toggleLoading) === null || _this$actions14$toggl === void 0 || _this$actions14$toggl.call(_this$actions14, 'doConfigure', false, false);
39904
39309
  structure = setHandlerInstance.loadConfigStructureOfActSet(set, _this.getCurPlannerType());
39310
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onConfig');
39905
39311
  _this.checkVariantData();
39906
39312
  if (dontUpdatePlannerView) {
39907
- _context11.next = 18;
39313
+ _context11.next = 19;
39908
39314
  break;
39909
39315
  }
39910
39316
  _this.updateConfiguratorStructure(structure);
@@ -39918,16 +39324,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39918
39324
  _this.updateViewButtonsDependigOnConfigStructure();
39919
39325
  _this.updatePlannerView('DO_CONFIGURE', myValues);
39920
39326
  _this.updateWebConfiguratorTitle();
39921
- _context11.next = 18;
39327
+ _context11.next = 19;
39922
39328
  return _this.getFreePlacesOnGrids(undefined, 'doConfigure');
39923
- case 18:
39329
+ case 19:
39924
39330
  if (dontCallEvents) {
39925
- _context11.next = 21;
39331
+ _context11.next = 22;
39926
39332
  break;
39927
39333
  }
39928
- _context11.next = 21;
39334
+ _context11.next = 22;
39929
39335
  return _this.fillBaksetforOnWebPlanerConfigChange(myValues);
39930
- case 21:
39336
+ case 22:
39931
39337
  case "end":
39932
39338
  return _context11.stop();
39933
39339
  }
@@ -40053,11 +39459,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40053
39459
  case 12:
40054
39460
  loadSuccessful = _context13.sent;
40055
39461
  if (!loadSuccessful) {
40056
- _context13.next = 55;
39462
+ _context13.next = 58;
40057
39463
  break;
40058
39464
  }
40059
39465
  if (!(typeof loadSuccessful != 'boolean')) {
40060
- _context13.next = 23;
39466
+ _context13.next = 25;
40061
39467
  break;
40062
39468
  }
40063
39469
  if (!(loadSuccessful.type == 'ProductList')) {
@@ -40074,53 +39480,49 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40074
39480
  (_this$actions15 = this.actions) === null || _this$actions15 === void 0 || (_this$actions15$toggl = _this$actions15.toggleLoading) === null || _this$actions15$toggl === void 0 || _this$actions15$toggl.call(_this$actions15, 'Planner_Loading', false, false);
40075
39481
  return _context13.abrupt("return", true);
40076
39482
  case 23:
40077
- //TODO: get prices of matching product with more than one element
40078
-
40079
- //else if (DivaApiHandler.doCheckForProductsPrice()) {
40080
- // await DivaSetHandler.loadProductsOfSets(
40081
- // this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr),
40082
- // this.divaBasketHandler.actBasket.SetPlannerInfos?.InvolvedSetIds,
40083
- // );
40084
- //}
40085
-
39483
+ _context13.next = 26;
39484
+ break;
39485
+ case 25:
39486
+ if (this.api.doCheckForProductsPrice()) ;
39487
+ case 26:
40086
39488
  this.divaNr = this.divaBasketHandler.actDivaNr;
40087
39489
  initSetState = this.getInitStateForSet();
40088
39490
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
40089
- _context13.next = 28;
39491
+ _context13.next = 31;
40090
39492
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
40091
- case 28:
39493
+ case 31:
40092
39494
  set = this.actSet();
40093
39495
  if (!((_initSetState$api$web = initSetState.api.webConfig) !== null && _initSetState$api$web !== void 0 && _initSetState$api$web.checkForProductsPrice)) {
40094
- _context13.next = 40;
39496
+ _context13.next = 43;
40095
39497
  break;
40096
39498
  }
40097
39499
  if (!(typeof loadSuccessful != 'boolean' && loadSuccessful.type == 'ProductId')) {
40098
- _context13.next = 35;
39500
+ _context13.next = 38;
40099
39501
  break;
40100
39502
  }
40101
39503
  products = loadSuccessful;
40102
39504
  set === null || set === void 0 || set.remindPriceForHash(products);
40103
- _context13.next = 40;
39505
+ _context13.next = 43;
40104
39506
  break;
40105
- case 35:
39507
+ case 38:
40106
39508
  if (!this.divaBasketHandler.actBasket.OrigProductId) {
40107
- _context13.next = 40;
39509
+ _context13.next = 43;
40108
39510
  break;
40109
39511
  }
40110
- _context13.next = 38;
39512
+ _context13.next = 41;
40111
39513
  return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
40112
- case 38:
39514
+ case 41:
40113
39515
  result = _context13.sent;
40114
39516
  if (result) {
40115
39517
  set === null || set === void 0 || set.remindPriceForHash(result);
40116
39518
  }
40117
- case 40:
40118
- _context13.next = 42;
39519
+ case 43:
39520
+ _context13.next = 45;
40119
39521
  return viewReadyPromise;
40120
- case 42:
40121
- _context13.next = 44;
39522
+ case 45:
39523
+ _context13.next = 47;
40122
39524
  return this.initView();
40123
- case 44:
39525
+ case 47:
40124
39526
  (_this$actions16 = this.actions) === null || _this$actions16 === void 0 || _this$actions16.onEvent({
40125
39527
  type: 'onConfiguratorReady'
40126
39528
  });
@@ -40144,11 +39546,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40144
39546
  divaNr: basket.DivaNr,
40145
39547
  documentVersion: basket.DocumentVersion.toString()
40146
39548
  });
40147
- _context13.next = 52;
39549
+ _context13.next = 55;
40148
39550
  return this.fillBaksetforOnWebPlanerConfigChange(undefined, true);
40149
- case 52:
40150
- return _context13.abrupt("return", true);
40151
39551
  case 55:
39552
+ return _context13.abrupt("return", true);
39553
+ case 58:
40152
39554
  this.onInitializationError();
40153
39555
  //fehler beim laden vom basket..
40154
39556
  LOG$1.errorTransaction('LOADING_BASKET', 'BASKET_0002', 'Fehler beim Laden des Baskets', {
@@ -40166,7 +39568,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40166
39568
  plannerMode: this.getCurImageMode(),*/
40167
39569
  });
40168
39570
  return _context13.abrupt("return", false);
40169
- case 58:
39571
+ case 61:
40170
39572
  case "end":
40171
39573
  return _context13.stop();
40172
39574
  }
@@ -40328,7 +39730,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40328
39730
  break;
40329
39731
  }
40330
39732
  (_this$initConfigurato = this.initConfiguratorStructure) === null || _this$initConfigurato === void 0 || _this$initConfigurato.call(this, setHandlerInstance.loadConfigStructureForOnlyProductsList());
40331
- _context15.next = 17;
39733
+ _context15.next = 18;
40332
39734
  break;
40333
39735
  case 7:
40334
39736
  _context15.next = 9;
@@ -40343,11 +39745,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40343
39745
  (_this$updateViewPlann9 = this.updateViewPlannerElements) === null || _this$updateViewPlann9 === void 0 || _this$updateViewPlann9.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set), set.getSetId(), set.firstElementId);
40344
39746
  this.updatePlannerView('INIT_VIEW');
40345
39747
  this.onBasketInitialized();
39748
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onInit');
40346
39749
  this.checkVariantData();
40347
- case 17:
40348
- _context15.next = 19;
39750
+ case 18:
39751
+ _context15.next = 20;
40349
39752
  return this.runInitMode(plannerMode);
40350
- case 19:
39753
+ case 20:
40351
39754
  case "end":
40352
39755
  return _context15.stop();
40353
39756
  }
@@ -40446,31 +39849,32 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40446
39849
  i = 0;
40447
39850
  case 8:
40448
39851
  if (!(i < orderSets.length)) {
40449
- _context17.next = 23;
39852
+ _context17.next = 24;
40450
39853
  break;
40451
39854
  }
40452
39855
  orderset = orderSets[i];
40453
39856
  lastSetToInitialize = setHandlerInstance.getOrderSetShouldInitPlanner(orderSets, i);
40454
39857
  loadedSet = setHandlerInstance.findLoadedSet(this.sets, orderset.CatalogCodex, orderset.AccountGUID);
40455
39858
  if (!loadedSet) {
40456
- _context17.next = 17;
39859
+ _context17.next = 18;
40457
39860
  break;
40458
39861
  }
40459
39862
  _context17.next = 15;
40460
39863
  return setHandlerInstance.addOrderSetArticlesToExistingSet(loadedSet, orderset, lastSetToInitialize);
40461
39864
  case 15:
40462
- _context17.next = 19;
39865
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onAdd');
39866
+ _context17.next = 20;
40463
39867
  break;
40464
- case 17:
40465
- _context17.next = 19;
39868
+ case 18:
39869
+ _context17.next = 20;
40466
39870
  return setHandlerInstance.initSet(orderset, this.getInitStateForSet(), lastSetToInitialize);
40467
- case 19:
40468
- this.cleanUpEmptySets(true);
40469
39871
  case 20:
39872
+ this.cleanUpEmptySets(true);
39873
+ case 21:
40470
39874
  i++;
40471
39875
  _context17.next = 8;
40472
39876
  break;
40473
- case 23:
39877
+ case 24:
40474
39878
  this.divaBasketHandler.actBasket.OrderSets = [];
40475
39879
  this.updatePriceInView();
40476
39880
  this.updateWebConfiguratorTitle();
@@ -40478,7 +39882,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40478
39882
  (_this$updateViewPlann10 = this.updateViewPlannerElements) === null || _this$updateViewPlann10 === void 0 || _this$updateViewPlann10.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40479
39883
  articlesKeys = Object.keys(this.actSet().getDivaArticles());
40480
39884
  this.loadPaletteInfos(undefined, [articlesKeys[0]], articlesKeys);
40481
- case 30:
39885
+ case 31:
40482
39886
  case "end":
40483
39887
  return _context17.stop();
40484
39888
  }
@@ -40489,37 +39893,6 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40489
39893
  }
40490
39894
  return addSetToActPlanningByDivaNr;
40491
39895
  }()
40492
- }, {
40493
- key: "initProductId",
40494
- value: function () {
40495
- var _initProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee18(productId) {
40496
- var loadSuccessful;
40497
- return _regeneratorRuntime__default["default"].wrap(function _callee18$(_context18) {
40498
- while (1) switch (_context18.prev = _context18.next) {
40499
- case 0:
40500
- _context18.next = 2;
40501
- return this.divaBasketHandler.initProductId(this.api, productId, true);
40502
- case 2:
40503
- loadSuccessful = _context18.sent;
40504
- if (!(typeof loadSuccessful != 'boolean')) {
40505
- _context18.next = 6;
40506
- break;
40507
- }
40508
- setHandlerInstance.addProducts([loadSuccessful], []);
40509
- return _context18.abrupt("return", loadSuccessful.divaNr);
40510
- case 6:
40511
- return _context18.abrupt("return", false);
40512
- case 7:
40513
- case "end":
40514
- return _context18.stop();
40515
- }
40516
- }, _callee18, this);
40517
- }));
40518
- function initProductId(_x49) {
40519
- return _initProductId.apply(this, arguments);
40520
- }
40521
- return initProductId;
40522
- }()
40523
39896
  }, {
40524
39897
  key: "cleanUpEmptySets",
40525
39898
  value: function cleanUpEmptySets(ignoreActSet) {
@@ -40548,28 +39921,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40548
39921
  }, {
40549
39922
  key: "setActSetCurConfigStepKey",
40550
39923
  value: function () {
40551
- var _setActSetCurConfigStepKey = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee19(curConfigStepKey) {
39924
+ var _setActSetCurConfigStepKey = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee18(curConfigStepKey) {
40552
39925
  var set;
40553
- return _regeneratorRuntime__default["default"].wrap(function _callee19$(_context19) {
40554
- while (1) switch (_context19.prev = _context19.next) {
39926
+ return _regeneratorRuntime__default["default"].wrap(function _callee18$(_context18) {
39927
+ while (1) switch (_context18.prev = _context18.next) {
40555
39928
  case 0:
40556
39929
  set = this.actSet();
40557
39930
  if (set) {
40558
- _context19.next = 3;
39931
+ _context18.next = 3;
40559
39932
  break;
40560
39933
  }
40561
- return _context19.abrupt("return");
39934
+ return _context18.abrupt("return");
40562
39935
  case 3:
40563
39936
  set.ActConfigStepKey = curConfigStepKey;
40564
- _context19.next = 6;
39937
+ _context18.next = 6;
40565
39938
  return setHandlerInstance.updateNavigation(set);
40566
39939
  case 6:
40567
39940
  case "end":
40568
- return _context19.stop();
39941
+ return _context18.stop();
40569
39942
  }
40570
- }, _callee19, this);
39943
+ }, _callee18, this);
40571
39944
  }));
40572
- function setActSetCurConfigStepKey(_x50) {
39945
+ function setActSetCurConfigStepKey(_x49) {
40573
39946
  return _setActSetCurConfigStepKey.apply(this, arguments);
40574
39947
  }
40575
39948
  return setActSetCurConfigStepKey;
@@ -40708,17 +40081,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40708
40081
  }, {
40709
40082
  key: "deletePlannerElement",
40710
40083
  value: function () {
40711
- var _deletePlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee20(setId, elementId, denyElementSelectionClear) {
40084
+ var _deletePlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee19(setId, elementId, denyElementSelectionClear) {
40712
40085
  var _this$updateViewPlann11;
40713
40086
  var set, result, _this$updateElementSe5, _this$updateElementSe6;
40714
- return _regeneratorRuntime__default["default"].wrap(function _callee20$(_context20) {
40715
- while (1) switch (_context20.prev = _context20.next) {
40087
+ return _regeneratorRuntime__default["default"].wrap(function _callee19$(_context19) {
40088
+ while (1) switch (_context19.prev = _context19.next) {
40716
40089
  case 0:
40717
40090
  set = this.sets[setId];
40718
- _context20.next = 3;
40091
+ _context19.next = 3;
40719
40092
  return setHandlerInstance.deleteElementFromSetByElemId(set, elementId, true);
40720
40093
  case 3:
40721
- result = _context20.sent;
40094
+ result = _context19.sent;
40722
40095
  this.updateConfigStructure();
40723
40096
  (_this$updateViewPlann11 = this.updateViewPlannerElements) === null || _this$updateViewPlann11 === void 0 || _this$updateViewPlann11.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40724
40097
  this.updatePlannerView('DELETE_PLANNER_ELEMENT');
@@ -40728,16 +40101,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40728
40101
  if (result.selectElementId) (_this$updateElementSe5 = this.updateElementSelectionPlanner) === null || _this$updateElementSe5 === void 0 || _this$updateElementSe5.call(this, [result.setId], [result.selectElementId], true);else (_this$updateElementSe6 = this.updateElementSelectionPlanner) === null || _this$updateElementSe6 === void 0 || _this$updateElementSe6.call(this, [], [], true);
40729
40102
  }
40730
40103
  this.updatePriceInView();
40104
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onDelete');
40731
40105
  this.checkVariantData();
40732
- _context20.next = 14;
40106
+ _context19.next = 15;
40733
40107
  return this.getFreePlacesOnGrids(undefined, 'deleteElement');
40734
- case 14:
40108
+ case 15:
40735
40109
  case "end":
40736
- return _context20.stop();
40110
+ return _context19.stop();
40737
40111
  }
40738
- }, _callee20, this);
40112
+ }, _callee19, this);
40739
40113
  }));
40740
- function deletePlannerElement(_x51, _x52, _x53) {
40114
+ function deletePlannerElement(_x50, _x51, _x52) {
40741
40115
  return _deletePlannerElement.apply(this, arguments);
40742
40116
  }
40743
40117
  return deletePlannerElement;
@@ -40751,17 +40125,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40751
40125
  }, {
40752
40126
  key: "copyPlannerElement",
40753
40127
  value: (function () {
40754
- var _copyPlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee21(setId, elementId, curConfigKey, copyInfo) {
40128
+ var _copyPlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee20(setId, elementId, curConfigKey, copyInfo) {
40755
40129
  var _this$updateViewPlann12;
40756
40130
  var set, newSelectedArticle, newConfigStepKey, _this$updateElementSe7, baseArticle;
40757
- return _regeneratorRuntime__default["default"].wrap(function _callee21$(_context21) {
40758
- while (1) switch (_context21.prev = _context21.next) {
40131
+ return _regeneratorRuntime__default["default"].wrap(function _callee20$(_context20) {
40132
+ while (1) switch (_context20.prev = _context20.next) {
40759
40133
  case 0:
40760
40134
  set = this.sets[setId];
40761
- _context21.next = 3;
40135
+ _context20.next = 3;
40762
40136
  return setHandlerInstance.copyPlannerElement(set, elementId, copyInfo);
40763
40137
  case 3:
40764
- newSelectedArticle = _context21.sent;
40138
+ newSelectedArticle = _context20.sent;
40765
40139
  this.updateConfigStructure();
40766
40140
  (_this$updateViewPlann12 = this.updateViewPlannerElements) === null || _this$updateViewPlann12 === void 0 || _this$updateViewPlann12.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40767
40141
  this.updatePlannerView('COPY_PLANNER_ELEMENT');
@@ -40774,17 +40148,18 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40774
40148
  baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newSelectedArticle.basketId);
40775
40149
  (_this$updateElementSe7 = this.updateElementSelectionPlanner) === null || _this$updateElementSe7 === void 0 || _this$updateElementSe7.call(this, [baseArticle.setId], [baseArticle.elementId], true);
40776
40150
  }
40777
- _context21.next = 13;
40151
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onCopy');
40152
+ _context20.next = 14;
40778
40153
  return this.checkVariantData();
40779
- case 13:
40780
- return _context21.abrupt("return", newConfigStepKey);
40781
40154
  case 14:
40155
+ return _context20.abrupt("return", newConfigStepKey);
40156
+ case 15:
40782
40157
  case "end":
40783
- return _context21.stop();
40158
+ return _context20.stop();
40784
40159
  }
40785
- }, _callee21, this);
40160
+ }, _callee20, this);
40786
40161
  }));
40787
- function copyPlannerElement(_x54, _x55, _x56, _x57) {
40162
+ function copyPlannerElement(_x53, _x54, _x55, _x56) {
40788
40163
  return _copyPlannerElement.apply(this, arguments);
40789
40164
  }
40790
40165
  return copyPlannerElement;
@@ -40813,33 +40188,33 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40813
40188
  }, {
40814
40189
  key: "getFreePlacesOnGrids",
40815
40190
  value: function () {
40816
- var _getFreePlacesOnGrids = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee22(gridGroup, from) {
40191
+ var _getFreePlacesOnGrids = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee21(gridGroup, from) {
40817
40192
  var _this$updateFreePlace;
40818
40193
  var set, freeShelfGrids, plannedShelfGrids;
40819
- return _regeneratorRuntime__default["default"].wrap(function _callee22$(_context22) {
40820
- while (1) switch (_context22.prev = _context22.next) {
40194
+ return _regeneratorRuntime__default["default"].wrap(function _callee21$(_context21) {
40195
+ while (1) switch (_context21.prev = _context21.next) {
40821
40196
  case 0:
40822
40197
  set = this.actSet();
40823
40198
  if (set) {
40824
- _context22.next = 3;
40199
+ _context21.next = 3;
40825
40200
  break;
40826
40201
  }
40827
40202
  throw new Error('getFreePlacesOnGrids: act set is not defined!');
40828
40203
  case 3:
40829
40204
  if (!gridGroup) {
40830
- _context22.next = 9;
40205
+ _context21.next = 9;
40831
40206
  break;
40832
40207
  }
40833
- _context22.next = 6;
40208
+ _context21.next = 6;
40834
40209
  return setHandlerInstance.getFreeShelfGrids(set, gridGroup);
40835
40210
  case 6:
40836
- _context22.t0 = _context22.sent;
40837
- _context22.next = 10;
40211
+ _context21.t0 = _context21.sent;
40212
+ _context21.next = 10;
40838
40213
  break;
40839
40214
  case 9:
40840
- _context22.t0 = undefined;
40215
+ _context21.t0 = undefined;
40841
40216
  case 10:
40842
- freeShelfGrids = _context22.t0;
40217
+ freeShelfGrids = _context21.t0;
40843
40218
  plannedShelfGrids = setHandlerInstance.getPlannedShelfGrids(set);
40844
40219
  LOG$1.debug('TOULA', 'freeShelfGrids', freeShelfGrids, 'plannedShelfGrids', plannedShelfGrids);
40845
40220
  LOG$1.debug('update free from: ' + from, 'freeShelfGrids', freeShelfGrids, 'plannedShelfGrids', plannedShelfGrids);
@@ -40847,17 +40222,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40847
40222
  freeShelfGrids: freeShelfGrids,
40848
40223
  plannedShelfGrids: plannedShelfGrids
40849
40224
  });
40850
- return _context22.abrupt("return", {
40225
+ return _context21.abrupt("return", {
40851
40226
  freeShelfGrids: freeShelfGrids,
40852
40227
  plannedShelfGrids: plannedShelfGrids
40853
40228
  });
40854
40229
  case 16:
40855
40230
  case "end":
40856
- return _context22.stop();
40231
+ return _context21.stop();
40857
40232
  }
40858
- }, _callee22, this);
40233
+ }, _callee21, this);
40859
40234
  }));
40860
- function getFreePlacesOnGrids(_x58, _x59) {
40235
+ function getFreePlacesOnGrids(_x57, _x58) {
40861
40236
  return _getFreePlacesOnGrids.apply(this, arguments);
40862
40237
  }
40863
40238
  return getFreePlacesOnGrids;
@@ -40874,36 +40249,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40874
40249
  }, {
40875
40250
  key: "moveShelfItemToGrid",
40876
40251
  value: function () {
40877
- var _moveShelfItemToGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee23(accessoireBasketId, parentBasketId, gridName, cellIndex) {
40252
+ var _moveShelfItemToGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee22(accessoireBasketId, parentBasketId, gridName, cellIndex) {
40878
40253
  var set, newGridId;
40879
- return _regeneratorRuntime__default["default"].wrap(function _callee23$(_context23) {
40880
- while (1) switch (_context23.prev = _context23.next) {
40254
+ return _regeneratorRuntime__default["default"].wrap(function _callee22$(_context22) {
40255
+ while (1) switch (_context22.prev = _context22.next) {
40881
40256
  case 0:
40882
40257
  set = this.actSet();
40883
40258
  if (set) {
40884
- _context23.next = 3;
40259
+ _context22.next = 3;
40885
40260
  break;
40886
40261
  }
40887
- return _context23.abrupt("return");
40262
+ return _context22.abrupt("return");
40888
40263
  case 3:
40889
- _context23.next = 5;
40264
+ _context22.next = 5;
40890
40265
  return setHandlerInstance.moveShelfItemToGrid(set, accessoireBasketId, parentBasketId, gridName, cellIndex);
40891
40266
  case 5:
40892
- newGridId = _context23.sent;
40267
+ newGridId = _context22.sent;
40893
40268
  this.updatePlannerView('MOVE_SHELF_ITEM');
40894
40269
  if (!newGridId) {
40895
- _context23.next = 10;
40270
+ _context22.next = 10;
40896
40271
  break;
40897
40272
  }
40898
- _context23.next = 10;
40273
+ _context22.next = 10;
40899
40274
  return this.getFreePlacesOnGrids(newGridId, 'move shelf');
40900
40275
  case 10:
40901
40276
  case "end":
40902
- return _context23.stop();
40277
+ return _context22.stop();
40903
40278
  }
40904
- }, _callee23, this);
40279
+ }, _callee22, this);
40905
40280
  }));
40906
- function moveShelfItemToGrid(_x60, _x61, _x62, _x63) {
40281
+ function moveShelfItemToGrid(_x59, _x60, _x61, _x62) {
40907
40282
  return _moveShelfItemToGrid.apply(this, arguments);
40908
40283
  }
40909
40284
  return moveShelfItemToGrid;
@@ -40911,27 +40286,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40911
40286
  }, {
40912
40287
  key: "resetArticle",
40913
40288
  value: function () {
40914
- var _resetArticle = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee24(basketId) {
40289
+ var _resetArticle = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee23(basketId) {
40915
40290
  var set;
40916
- return _regeneratorRuntime__default["default"].wrap(function _callee24$(_context24) {
40917
- while (1) switch (_context24.prev = _context24.next) {
40291
+ return _regeneratorRuntime__default["default"].wrap(function _callee23$(_context23) {
40292
+ while (1) switch (_context23.prev = _context23.next) {
40918
40293
  case 0:
40919
40294
  set = this.actSet();
40920
40295
  if (set) {
40921
- _context24.next = 3;
40296
+ _context23.next = 3;
40922
40297
  break;
40923
40298
  }
40924
- return _context24.abrupt("return");
40299
+ return _context23.abrupt("return");
40925
40300
  case 3:
40926
- _context24.next = 5;
40301
+ _context23.next = 5;
40927
40302
  return setHandlerInstance.resetArticle(set, basketId);
40928
40303
  case 5:
40929
40304
  case "end":
40930
- return _context24.stop();
40305
+ return _context23.stop();
40931
40306
  }
40932
- }, _callee24, this);
40307
+ }, _callee23, this);
40933
40308
  }));
40934
- function resetArticle(_x64) {
40309
+ function resetArticle(_x63) {
40935
40310
  return _resetArticle.apply(this, arguments);
40936
40311
  }
40937
40312
  return resetArticle;
@@ -40939,27 +40314,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40939
40314
  }, {
40940
40315
  key: "checkVariantData",
40941
40316
  value: function () {
40942
- var _checkVariantData = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee25() {
40317
+ var _checkVariantData = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee24() {
40943
40318
  var somethingChanged;
40944
- return _regeneratorRuntime__default["default"].wrap(function _callee25$(_context25) {
40945
- while (1) switch (_context25.prev = _context25.next) {
40319
+ return _regeneratorRuntime__default["default"].wrap(function _callee24$(_context24) {
40320
+ while (1) switch (_context24.prev = _context24.next) {
40946
40321
  case 0:
40947
40322
  if (!this.api.getDoCheckVariantData()) {
40948
- _context25.next = 5;
40323
+ _context24.next = 5;
40949
40324
  break;
40950
40325
  }
40951
- _context25.next = 3;
40326
+ _context24.next = 3;
40952
40327
  return setHandlerInstance.checkVariantData(this.actSet());
40953
40328
  case 3:
40954
- somethingChanged = _context25.sent;
40329
+ somethingChanged = _context24.sent;
40955
40330
  if (somethingChanged) {
40956
40331
  this.updatePriceInView();
40957
40332
  }
40958
40333
  case 5:
40959
40334
  case "end":
40960
- return _context25.stop();
40335
+ return _context24.stop();
40961
40336
  }
40962
- }, _callee25, this);
40337
+ }, _callee24, this);
40963
40338
  }));
40964
40339
  function checkVariantData() {
40965
40340
  return _checkVariantData.apply(this, arguments);
@@ -41055,7 +40430,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41055
40430
  }, {
41056
40431
  key: "saveToBasketWrapper",
41057
40432
  value: function () {
41058
- var _saveToBasketWrapper = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee26(event, repairOnly, force) {
40433
+ var _saveToBasketWrapper = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee25(event, repairOnly, force) {
41059
40434
  var _this$actions25,
41060
40435
  _this$actions25$toggl,
41061
40436
  _this$actions26,
@@ -41063,48 +40438,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41063
40438
  _this2 = this,
41064
40439
  _this$actions30,
41065
40440
  _this$i18n14;
41066
- var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product, _result, result, _this$actions27, _this$i18n8, _this$i18n9, _this$actions28, _this$i18n10, _this$i18n11, _this$actions29, _this$i18n12, _this$i18n13, _this$updatePlannerMs2, _this$actions31, _this$i18n15;
41067
- return _regeneratorRuntime__default["default"].wrap(function _callee26$(_context26) {
41068
- while (1) switch (_context26.prev = _context26.next) {
40441
+ 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;
40442
+ return _regeneratorRuntime__default["default"].wrap(function _callee25$(_context25) {
40443
+ while (1) switch (_context25.prev = _context25.next) {
41069
40444
  case 0:
41070
40445
  returnTo = this.getReturnTo(event);
41071
40446
  finalEvent = event;
41072
40447
  if (!(returnTo == 'OPEN_LEAFLET_BARRIER')) {
41073
- _context26.next = 16;
40448
+ _context25.next = 14;
41074
40449
  break;
41075
40450
  }
41076
40451
  product = undefined;
41077
40452
  if (!((_this$api$getBarrierC = this.api.getBarrierConfig()) !== null && _this$api$getBarrierC !== void 0 && _this$api$getBarrierC.affiliate)) {
41078
- _context26.next = 10;
40453
+ _context25.next = 8;
41079
40454
  break;
41080
40455
  }
41081
- _context26.next = 7;
40456
+ _context25.next = 7;
41082
40457
  return this.api.getDataCache(this.api.getCatalogProductUrl(this.actSet().getCatalogCodex()), undefined, undefined, 'catalog');
41083
40458
  case 7:
41084
- _result = _context26.sent;
41085
- productHandlerInstance.addProducts(_result, []);
41086
- product = productHandlerInstance.getBestMatch(this.getDivaArticles());
41087
- case 10:
41088
- _context26.next = 12;
40459
+ _context25.sent;
40460
+ case 8:
40461
+ _context25.next = 10;
41089
40462
  return (_this$openLeafeltBarr = this.openLeafeltBarrier) === null || _this$openLeafeltBarr === void 0 ? void 0 : _this$openLeafeltBarr.call(this, this.divaBasketHandler, this.api.getBarrierConfig(), product);
41090
- case 12:
41091
- finalEvent = _context26.sent;
40463
+ case 10:
40464
+ finalEvent = _context25.sent;
41092
40465
  if (finalEvent) {
41093
- _context26.next = 15;
40466
+ _context25.next = 13;
41094
40467
  break;
41095
40468
  }
41096
- return _context26.abrupt("return", 'canceled');
41097
- case 15:
40469
+ return _context25.abrupt("return", 'canceled');
40470
+ case 13:
41098
40471
  returnTo = finalEvent == 'onAddToBasket' ? 'OPEN_PDF' : returnTo;
41099
- case 16:
40472
+ case 14:
41100
40473
  (_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);
41101
- _context26.next = 19;
40474
+ _context25.next = 17;
41102
40475
  return this.saveToBasket(finalEvent, repairOnly, force);
41103
- case 19:
41104
- result = _context26.sent;
40476
+ case 17:
40477
+ result = _context25.sent;
41105
40478
  (_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);
41106
40479
  if (!(result === 'canceled')) {
41107
- _context26.next = 25;
40480
+ _context25.next = 23;
41108
40481
  break;
41109
40482
  }
41110
40483
  LOG$1.error(new DivaUtils.DivaError('failed to save Basket'));
@@ -41112,12 +40485,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41112
40485
  text: ((_this$i18n8 = this.i18n()) === null || _this$i18n8 === void 0 ? void 0 : _this$i18n8.t('modal.general_error')) + ' --- ' + DivaUtils__default["default"].formatDate(new Date(), true, undefined, true) + ' --- ' + DivaUtils__default["default"].getCurrentTraceId() ? ((_this$i18n9 = this.i18n()) === null || _this$i18n9 === void 0 ? void 0 : _this$i18n9.t('modal.errorcode')) + ': ' + DivaUtils__default["default"].getCurrentTraceId() : '',
41113
40486
  accept: true
41114
40487
  });
41115
- return _context26.abrupt("return", result);
41116
- case 25:
41117
- _context26.t0 = returnTo;
41118
- _context26.next = _context26.t0 === 'OPEN_PDF' ? 28 : _context26.t0 === 'SAVE_BASKET_WITH_MODAL' ? 30 : 31;
40488
+ return _context25.abrupt("return", result);
40489
+ case 23:
40490
+ _context25.t0 = returnTo;
40491
+ _context25.next = _context25.t0 === 'OPEN_PDF' ? 26 : _context25.t0 === 'SAVE_BASKET_WITH_MODAL' ? 28 : 29;
41119
40492
  break;
41120
- case 28:
40493
+ case 26:
41121
40494
  if (!this.getBasket().PDFDocumentURL) {
41122
40495
  LOG$1.error(new DivaUtils.DivaError('PDF url is missing in basket', {
41123
40496
  code: 'WC_0010'
@@ -41135,39 +40508,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41135
40508
  }
41136
40509
  });
41137
40510
  }
41138
- return _context26.abrupt("break", 31);
41139
- case 30:
40511
+ return _context25.abrupt("break", 29);
40512
+ case 28:
41140
40513
  (_this$actions30 = this.actions) === null || _this$actions30 === void 0 || _this$actions30.openModal({
41141
40514
  text: (_this$i18n14 = this.i18n()) === null || _this$i18n14 === void 0 ? void 0 : _this$i18n14.t('modal.planning_saved'),
41142
40515
  accept: true
41143
40516
  });
41144
- case 31:
40517
+ case 29:
41145
40518
  if (!(result == 'noArticleToSave')) {
41146
- _context26.next = 34;
40519
+ _context25.next = 32;
41147
40520
  break;
41148
40521
  }
41149
40522
  (_this$updatePlannerMs2 = this.updatePlannerMsgContainer) === null || _this$updatePlannerMs2 === void 0 || _this$updatePlannerMs2.call(this, 'NOTHING_TO_SAVE', true, 'INFO', 'NOTHING_TO_SAVE', true);
41150
- return _context26.abrupt("return", 'canceled');
41151
- case 34:
41152
- if (!(result == 'payloadToBig')) {
41153
- _context26.next = 37;
41154
- break;
41155
- }
41156
- (_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.openModal({
41157
- accept: true,
41158
- text: (_this$i18n15 = this.i18n()) === null || _this$i18n15 === void 0 ? void 0 : _this$i18n15.t('configurator.PAYLOAD_TO_BIG'),
41159
- title: 'modals.error_saving'
41160
- });
41161
- return _context26.abrupt("return", 'canceled');
41162
- case 37:
41163
- return _context26.abrupt("return", result);
41164
- case 38:
40523
+ return _context25.abrupt("return", 'canceled');
40524
+ case 32:
40525
+ return _context25.abrupt("return", result);
40526
+ case 33:
41165
40527
  case "end":
41166
- return _context26.stop();
40528
+ return _context25.stop();
41167
40529
  }
41168
- }, _callee26, this);
40530
+ }, _callee25, this);
41169
40531
  }));
41170
- function saveToBasketWrapper(_x65, _x66, _x67) {
40532
+ function saveToBasketWrapper(_x64, _x65, _x66) {
41171
40533
  return _saveToBasketWrapper.apply(this, arguments);
41172
40534
  }
41173
40535
  return saveToBasketWrapper;
@@ -41175,51 +40537,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41175
40537
  }, {
41176
40538
  key: "saveToBasket",
41177
40539
  value: function () {
41178
- var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee27(event, repairOnly, force) {
41179
- var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions32, _this$actions33;
41180
- var set, actBasket, returnTo, oldReturnTo, count, basketData, bytes, result, newDivaNr, _result2, _event4, product;
41181
- return _regeneratorRuntime__default["default"].wrap(function _callee27$(_context27) {
41182
- while (1) switch (_context27.prev = _context27.next) {
40540
+ var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee26(event, repairOnly, force) {
40541
+ var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions31, _this$actions32, _this$actions33;
40542
+ var set, actBasket, returnTo, oldReturnTo, result, newDivaNr, _result2, _event4, product;
40543
+ return _regeneratorRuntime__default["default"].wrap(function _callee26$(_context26) {
40544
+ while (1) switch (_context26.prev = _context26.next) {
41183
40545
  case 0:
41184
40546
  set = this.actSet();
41185
40547
  if (!(setHandlerInstance.isNoArticleToSave(this.sets) && !force)) {
41186
- _context27.next = 3;
40548
+ _context26.next = 3;
41187
40549
  break;
41188
40550
  }
41189
- return _context27.abrupt("return", 'noArticleToSave');
40551
+ return _context26.abrupt("return", 'noArticleToSave');
41190
40552
  case 3:
41191
40553
  actBasket = this.divaBasketHandler.actBasket;
41192
40554
  returnTo = this.getReturnTo(event);
41193
40555
  if (!((_returnTo = returnTo) !== null && _returnTo !== void 0 && _returnTo.startsWith('FAVORITS') && favoritesHandlerInstance.FavoritesDefined(set))) {
41194
- _context27.next = 22;
40556
+ _context26.next = 13;
41195
40557
  break;
41196
40558
  }
41197
40559
  oldReturnTo = returnTo;
41198
40560
  this.ReturnTo = returnTo.replace('FAVORITS_', '');
41199
- _context27.next = 10;
41200
- return this.getValidVariantsLength();
41201
- case 10:
41202
- count = _context27.sent;
41203
- _context27.next = 13;
41204
- return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !!repairOnly, this.doAllowSetPlanner(), this.ReturnTo);
41205
- case 13:
41206
- basketData = _context27.sent;
41207
- bytes = new TextEncoder().encode(JSON.stringify(basketData.getAsJson())).length;
41208
- if (!(bytes * count > 15000000)) {
41209
- _context27.next = 17;
41210
- break;
41211
- }
41212
- return _context27.abrupt("return", 'payloadToBig');
41213
- case 17:
41214
- _context27.next = 19;
40561
+ _context26.next = 10;
41215
40562
  return this.handleFavorites('SAVE');
41216
- case 19:
41217
- result = _context27.sent;
40563
+ case 10:
40564
+ result = _context26.sent;
41218
40565
  if (result === 'canceled') {
41219
40566
  this.ReturnTo = oldReturnTo;
41220
40567
  }
41221
- return _context27.abrupt("return", result);
41222
- case 22:
40568
+ return _context26.abrupt("return", result);
40569
+ case 13:
41223
40570
  LOG$1.startTransaction({
41224
40571
  event: (_event = event) !== null && _event !== void 0 ? _event : 'onAddToBasket',
41225
40572
  message: 'Perform case: ' + ((_event2 = event) !== null && _event2 !== void 0 ? _event2 : 'onAddToBasket'),
@@ -41234,13 +40581,13 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41234
40581
  warningTime: 2000,
41235
40582
  errorTime: 4000
41236
40583
  });
41237
- _context27.t0 = this.divaBasketHandler;
41238
- _context27.t1 = this.divaBasketHandler.actDivaNr;
41239
- _context27.next = 27;
40584
+ _context26.t0 = this.divaBasketHandler;
40585
+ _context26.t1 = this.divaBasketHandler.actDivaNr;
40586
+ _context26.next = 18;
41240
40587
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !!repairOnly, this.doAllowSetPlanner(), this.ReturnTo);
41241
- case 27:
41242
- _context27.t2 = _context27.sent;
41243
- _context27.t0.setBasketData.call(_context27.t0, _context27.t1, _context27.t2);
40588
+ case 18:
40589
+ _context26.t2 = _context26.sent;
40590
+ _context26.t0.setBasketData.call(_context26.t0, _context26.t1, _context26.t2);
41244
40591
  if ((_returnTo2 = returnTo) !== null && _returnTo2 !== void 0 && _returnTo2.endsWith('OPEN_SELLER_BASKET')) {
41245
40592
  this.ReturnTo = 'OPEN_SELLER_BASKET';
41246
40593
  returnTo = this.ReturnTo;
@@ -41256,13 +40603,14 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41256
40603
  actBasket.Updated = Date.now();
41257
40604
  LOG$1.successTransaction('FILL_BASKET');
41258
40605
  if (!returnTo) {
41259
- _context27.next = 63;
40606
+ _context26.next = 55;
41260
40607
  break;
41261
40608
  }
41262
- _context27.t3 = returnTo;
41263
- _context27.next = _context27.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 39 : _context27.t3 === 'OPEN_SELLER_BASKET' ? 41 : _context27.t3 === 'OPEN_PDF' ? 43 : _context27.t3 === 'SAVE_BASKET_WITH_MODAL' ? 43 : _context27.t3 === 'SAVE_BASKET' ? 43 : _context27.t3 === 'SAVE_BASKET_SYNC' ? 43 : _context27.t3 === 'OPEN_LEAFLET_BARRIER' ? 43 : 63;
40609
+ _context26.t3 = returnTo;
40610
+ _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;
41264
40611
  break;
41265
- case 39:
40612
+ case 30:
40613
+ (_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.toggleLoading('buildScene', false, false);
41266
40614
  (_this$actions32 = this.actions) === null || _this$actions32 === void 0 || _this$actions32.openComponent({
41267
40615
  type: 'SELLER',
41268
40616
  parameters: {
@@ -41270,12 +40618,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41270
40618
  divaNr: actBasket.DivaNr
41271
40619
  },
41272
40620
  internal: {
41273
- basketData: actBasket,
41274
- edited: true
40621
+ basketData: actBasket
41275
40622
  }
41276
40623
  });
41277
- return _context27.abrupt("break", 63);
41278
- case 41:
40624
+ return _context26.abrupt("break", 55);
40625
+ case 33:
41279
40626
  (_this$actions33 = this.actions) === null || _this$actions33 === void 0 || _this$actions33.openComponent({
41280
40627
  type: 'SELLER',
41281
40628
  parameters: {
@@ -41286,37 +40633,37 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41286
40633
  basketData: actBasket
41287
40634
  }
41288
40635
  });
41289
- return _context27.abrupt("break", 63);
41290
- case 43:
40636
+ return _context26.abrupt("break", 55);
40637
+ case 35:
41291
40638
  if (!(event == 'onSaveProduct')) {
41292
- _context27.next = 53;
40639
+ _context26.next = 45;
41293
40640
  break;
41294
40641
  }
41295
40642
  //copy basket, so we only save a copy as baseconfiguration and can continue working with the original basket
41296
40643
  actBasket = new basketModel.BasketData(JSON.parse(JSON.stringify(actBasket)));
41297
- _context27.next = 47;
40644
+ _context26.next = 39;
41298
40645
  return DivaUtils__default["default"].updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser);
41299
- case 47:
41300
- _context27.next = 49;
40646
+ case 39:
40647
+ _context26.next = 41;
41301
40648
  return this.api.getDataWithoutCache(this.api.getUniqueNewDivaNr(), undefined, 'basket');
41302
- case 49:
41303
- newDivaNr = _context27.sent;
40649
+ case 41:
40650
+ newDivaNr = _context26.sent;
41304
40651
  actBasket.convertToBaseConfiguration(newDivaNr.divaNr);
41305
- _context27.next = 62;
40652
+ _context26.next = 54;
41306
40653
  break;
41307
- case 53:
40654
+ case 45:
41308
40655
  if (this.divaBasketHandler.basketWasSavedWithCurrentDocVersion) {
41309
40656
  this.divaBasketHandler.basketWasSavedWithCurrentDocVersion = undefined;
41310
40657
  actBasket.setDocumentVersion(actBasket.getDocumentVersion() + 1);
41311
40658
  }
41312
40659
  this.divaBasketHandler.basketWasSavedWithCurrentDocVersion = true;
41313
40660
  actBasket.setDivaNr(this.divaBasketHandler.actDivaNr.split('-').length > 2 ? this.divaBasketHandler.actDivaNr.split('-')[0] + '-' + this.divaBasketHandler.actDivaNr.split('-')[1] : this.divaBasketHandler.actDivaNr);
41314
- _context27.next = 58;
40661
+ _context26.next = 50;
41315
40662
  return this.divaBasketHandler.saveToBasket(this.api, actBasket, returnTo);
41316
- case 58:
41317
- _result2 = _context27.sent;
40663
+ case 50:
40664
+ _result2 = _context26.sent;
41318
40665
  if (!(_result2 === 'ERROR_NO_BASKET_SAVED' || _result2 === 'ERROR_BASKET_AFTER_SAVE')) {
41319
- _context27.next = 62;
40666
+ _context26.next = 54;
41320
40667
  break;
41321
40668
  }
41322
40669
  LOG$1.errorTransaction((_event4 = event) !== null && _event4 !== void 0 ? _event4 : 'onAddToBasket', 'WC_0019', 'Error saving basket', {
@@ -41325,23 +40672,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41325
40672
  status: this.getBasketData().Status,
41326
40673
  bv: set.getSetPrice() / 1000
41327
40674
  });
41328
- return _context27.abrupt("return", 'canceled');
41329
- case 62:
41330
- return _context27.abrupt("break", 63);
41331
- case 63:
40675
+ return _context26.abrupt("return", 'canceled');
40676
+ case 54:
40677
+ return _context26.abrupt("break", 55);
40678
+ case 55:
41332
40679
  if (returnTo == 'DONT_SAVE_BASKET') event = 'dontSaveBasket';
41333
- _context27.next = 66;
40680
+ _context26.next = 58;
41334
40681
  return this.addToBasket(actBasket, event);
41335
- case 66:
41336
- product = _context27.sent;
41337
- return _context27.abrupt("return", product !== null && product !== void 0 ? product : 'saved');
41338
- case 68:
40682
+ case 58:
40683
+ product = _context26.sent;
40684
+ return _context26.abrupt("return", product !== null && product !== void 0 ? product : 'saved');
40685
+ case 60:
41339
40686
  case "end":
41340
- return _context27.stop();
40687
+ return _context26.stop();
41341
40688
  }
41342
- }, _callee27, this);
40689
+ }, _callee26, this);
41343
40690
  }));
41344
- function saveToBasket(_x68, _x69, _x70) {
40691
+ function saveToBasket(_x67, _x68, _x69) {
41345
40692
  return _saveToBasket.apply(this, arguments);
41346
40693
  }
41347
40694
  return saveToBasket;
@@ -41542,16 +40889,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41542
40889
  }, {
41543
40890
  key: "getEnableUnityRtvKombi",
41544
40891
  value: function getEnableUnityRtvKombi() {
41545
- var _this$actSet24;
40892
+ var _this$actSet24, _this$actSet25;
41546
40893
  // if force rtv disable unity kombi - biohort
41547
40894
  if ((_this$actSet24 = this.actSet()) !== null && _this$actSet24 !== void 0 && _this$actSet24.CatalogData.divaForceRTV) return false;
41548
- return this.api.getEnableRTVUnityKombi();
40895
+ return ((_this$actSet25 = this.actSet()) === null || _this$actSet25 === void 0 ? void 0 : _this$actSet25.CatalogData.divaArReady) == true && this.api.getEnableRTVUnityKombi();
41549
40896
  }
41550
40897
  }, {
41551
40898
  key: "getShelfPlannerRTV",
41552
40899
  value: function getShelfPlannerRTV() {
41553
- var _this$actSet25;
41554
- return (_this$actSet25 = this.actSet()) === null || _this$actSet25 === void 0 ? void 0 : _this$actSet25.CatalogData.useShelfPlannerRTV;
40900
+ var _this$actSet26;
40901
+ return (_this$actSet26 = this.actSet()) === null || _this$actSet26 === void 0 ? void 0 : _this$actSet26.CatalogData.useShelfPlannerRTV;
41555
40902
  }
41556
40903
  }, {
41557
40904
  key: "getBasketData",
@@ -41566,23 +40913,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41566
40913
  }, {
41567
40914
  key: "getBasketDataWithEkText",
41568
40915
  value: function () {
41569
- var _getBasketDataWithEkText = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28() {
41570
- return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context28) {
41571
- while (1) switch (_context28.prev = _context28.next) {
40916
+ var _getBasketDataWithEkText = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee27() {
40917
+ return _regeneratorRuntime__default["default"].wrap(function _callee27$(_context27) {
40918
+ while (1) switch (_context27.prev = _context27.next) {
41572
40919
  case 0:
41573
- _context28.t0 = this.divaBasketHandler;
41574
- _context28.t1 = this.divaBasketHandler.actDivaNr;
41575
- _context28.next = 4;
40920
+ _context27.t0 = this.divaBasketHandler;
40921
+ _context27.t1 = this.divaBasketHandler.actDivaNr;
40922
+ _context27.next = 4;
41576
40923
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, true, this.doAllowSetPlanner(), this.ReturnTo);
41577
40924
  case 4:
41578
- _context28.t2 = _context28.sent;
41579
- _context28.t0.setBasketData.call(_context28.t0, _context28.t1, _context28.t2);
41580
- return _context28.abrupt("return", this.divaBasketHandler.actBasket);
40925
+ _context27.t2 = _context27.sent;
40926
+ _context27.t0.setBasketData.call(_context27.t0, _context27.t1, _context27.t2);
40927
+ return _context27.abrupt("return", this.divaBasketHandler.actBasket);
41581
40928
  case 7:
41582
40929
  case "end":
41583
- return _context28.stop();
40930
+ return _context27.stop();
41584
40931
  }
41585
- }, _callee28, this);
40932
+ }, _callee27, this);
41586
40933
  }));
41587
40934
  function getBasketDataWithEkText() {
41588
40935
  return _getBasketDataWithEkText.apply(this, arguments);
@@ -41592,8 +40939,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41592
40939
  }, {
41593
40940
  key: "getCatalogData",
41594
40941
  value: function getCatalogData() {
41595
- var _this$actSet26;
41596
- return (_this$actSet26 = this.actSet()) === null || _this$actSet26 === void 0 ? void 0 : _this$actSet26.CatalogData;
40942
+ var _this$actSet27;
40943
+ return (_this$actSet27 = this.actSet()) === null || _this$actSet27 === void 0 ? void 0 : _this$actSet27.CatalogData;
41597
40944
  }
41598
40945
  }, {
41599
40946
  key: "ReturnTo",
@@ -41608,7 +40955,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41608
40955
  }, {
41609
40956
  key: "addToBasket",
41610
40957
  value: function () {
41611
- var _addToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee29(actBasket) {
40958
+ var _addToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28(actBasket) {
41612
40959
  var _this$actions34,
41613
40960
  _this$actions35,
41614
40961
  _this$actions36,
@@ -41627,14 +40974,14 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41627
40974
  to,
41628
40975
  variants,
41629
40976
  products,
41630
- _args29 = arguments;
41631
- return _regeneratorRuntime__default["default"].wrap(function _callee29$(_context29) {
41632
- while (1) switch (_context29.prev = _context29.next) {
40977
+ _args28 = arguments;
40978
+ return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context28) {
40979
+ while (1) switch (_context28.prev = _context28.next) {
41633
40980
  case 0:
41634
- event = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : 'onAddToBasket';
40981
+ event = _args28.length > 1 && _args28[1] !== undefined ? _args28[1] : 'onAddToBasket';
41635
40982
  addToBasketLog = true;
41636
- _context29.t0 = event;
41637
- _context29.next = _context29.t0 === 'onWebPlanerPrint' ? 5 : _context29.t0 === 'onWebPlanerSave' ? 8 : _context29.t0 === 'onWebPlanerShare' ? 11 : _context29.t0 === 'onRequestConsulation' ? 14 : _context29.t0 === 'onSave' ? 17 : _context29.t0 === 'onSendEmail' ? 20 : _context29.t0 === 'onSaveProduct' ? 25 : _context29.t0 === 'dontSaveBasket' ? 33 : _context29.t0 === 'onAddToBasket' ? 35 : 35;
40983
+ _context28.t0 = event;
40984
+ _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;
41638
40985
  break;
41639
40986
  case 5:
41640
40987
  this.handleSuccessTransaction('onPrintBasket', actBasket);
@@ -41642,35 +40989,35 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41642
40989
  type: 'onWebPlanerPrint',
41643
40990
  data: actBasket.getAsJson()
41644
40991
  });
41645
- return _context29.abrupt("break", 38);
40992
+ return _context28.abrupt("break", 38);
41646
40993
  case 8:
41647
40994
  this.handleSuccessTransaction('onSaveBasket', actBasket);
41648
40995
  (_this$actions35 = this.actions) === null || _this$actions35 === void 0 || _this$actions35.onEvent({
41649
40996
  type: 'onWebPlanerSave',
41650
40997
  data: actBasket.getAsJson()
41651
40998
  });
41652
- return _context29.abrupt("break", 38);
40999
+ return _context28.abrupt("break", 38);
41653
41000
  case 11:
41654
41001
  this.handleSuccessTransaction('onShareBasket', actBasket);
41655
41002
  (_this$actions36 = this.actions) === null || _this$actions36 === void 0 || _this$actions36.onEvent({
41656
41003
  type: 'onWebPlanerShare',
41657
41004
  data: actBasket.getAsJson()
41658
41005
  });
41659
- return _context29.abrupt("break", 38);
41006
+ return _context28.abrupt("break", 38);
41660
41007
  case 14:
41661
41008
  this.handleSuccessTransaction('onRequestConsulation', actBasket);
41662
41009
  (_this$actions37 = this.actions) === null || _this$actions37 === void 0 || _this$actions37.onEvent({
41663
41010
  type: 'onRequestConsulation',
41664
41011
  data: actBasket.getAsJson()
41665
41012
  });
41666
- return _context29.abrupt("break", 38);
41013
+ return _context28.abrupt("break", 38);
41667
41014
  case 17:
41668
41015
  this.handleSuccessTransaction('onSave', actBasket);
41669
41016
  (_this$actions38 = this.actions) === null || _this$actions38 === void 0 || _this$actions38.onEvent({
41670
41017
  type: 'onSave',
41671
41018
  data: actBasket.getAsJson()
41672
41019
  });
41673
- return _context29.abrupt("break", 38);
41020
+ return _context28.abrupt("break", 38);
41674
41021
  case 20:
41675
41022
  emailConfig = (_this$divaBasketHandl3 = this.divaBasketHandler.emailConfig) !== null && _this$divaBasketHandl3 !== void 0 ? _this$divaBasketHandl3 : this.getEmailConfig(); //reset the emailConfig
41676
41023
  this.divaBasketHandler.emailConfig = undefined;
@@ -41706,23 +41053,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41706
41053
  type: 'onAddToBasket',
41707
41054
  data: actBasket.getAsJson()
41708
41055
  });
41709
- return _context29.abrupt("break", 38);
41056
+ return _context28.abrupt("break", 38);
41710
41057
  case 25:
41711
41058
  this.actSet().CatalogData;
41712
- _context29.next = 28;
41059
+ _context28.next = 28;
41713
41060
  return this.api.saveAsProduct(this.sets, actBasket);
41714
41061
  case 28:
41715
- products = _context29.sent;
41062
+ products = _context28.sent;
41716
41063
  this.handleSuccessTransaction('onSaveProduct', actBasket);
41717
41064
  (_this$actions40 = this.actions) === null || _this$actions40 === void 0 || _this$actions40.onEvent({
41718
41065
  type: 'onAddToBasket',
41719
41066
  data: actBasket.getAsJson()
41720
41067
  });
41721
41068
  if (!products) {
41722
- _context29.next = 33;
41069
+ _context28.next = 33;
41723
41070
  break;
41724
41071
  }
41725
- return _context29.abrupt("return", products[0]);
41072
+ return _context28.abrupt("return", products[0]);
41726
41073
  case 33:
41727
41074
  this.handleSuccessTransaction('onAddToBasketCallback', actBasket);
41728
41075
  addToBasketLog = false;
@@ -41732,16 +41079,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41732
41079
  type: 'onAddToBasket',
41733
41080
  data: actBasket.getAsJson()
41734
41081
  });
41735
- return _context29.abrupt("break", 38);
41082
+ return _context28.abrupt("break", 38);
41736
41083
  case 38:
41737
- return _context29.abrupt("return");
41084
+ return _context28.abrupt("return");
41738
41085
  case 39:
41739
41086
  case "end":
41740
- return _context29.stop();
41087
+ return _context28.stop();
41741
41088
  }
41742
- }, _callee29, this);
41089
+ }, _callee28, this);
41743
41090
  }));
41744
- function addToBasket(_x71) {
41091
+ function addToBasket(_x70) {
41745
41092
  return _addToBasket.apply(this, arguments);
41746
41093
  }
41747
41094
  return addToBasket;
@@ -42022,9 +41369,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42022
41369
  key: "initApiForLogicOnly",
42023
41370
  value: //just for testing purposes
42024
41371
  function () {
42025
- var _initApiForLogicOnly = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee30(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
42026
- return _regeneratorRuntime__default["default"].wrap(function _callee30$(_context30) {
42027
- while (1) switch (_context30.prev = _context30.next) {
41372
+ var _initApiForLogicOnly = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee29(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
41373
+ return _regeneratorRuntime__default["default"].wrap(function _callee29$(_context29) {
41374
+ while (1) switch (_context29.prev = _context29.next) {
42028
41375
  case 0:
42029
41376
  //empty services
42030
41377
  this.api = new DivaApiHandler(_objectSpread$5(_objectSpread$5({}, this.plannerConfig), {}, {
@@ -42037,17 +41384,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42037
41384
  jwt: jwt,
42038
41385
  apiKey: apiKey
42039
41386
  }), handler);
42040
- _context30.next = 3;
41387
+ _context29.next = 3;
42041
41388
  return this.divaBasketHandler.initWWSClient(this.api.getWWSClient());
42042
41389
  case 3:
42043
41390
  this.plannerHandler = new DivaPlannerHandler(true);
42044
41391
  case 4:
42045
41392
  case "end":
42046
- return _context30.stop();
41393
+ return _context29.stop();
42047
41394
  }
42048
- }, _callee30, this);
41395
+ }, _callee29, this);
42049
41396
  }));
42050
- function initApiForLogicOnly(_x72, _x73, _x74, _x75, _x76, _x77, _x78) {
41397
+ function initApiForLogicOnly(_x71, _x72, _x73, _x74, _x75, _x76, _x77) {
42051
41398
  return _initApiForLogicOnly.apply(this, arguments);
42052
41399
  }
42053
41400
  return initApiForLogicOnly;
@@ -42060,16 +41407,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42060
41407
  }, {
42061
41408
  key: "loadBasket",
42062
41409
  value: function () {
42063
- var _loadBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee31() {
42064
- return _regeneratorRuntime__default["default"].wrap(function _callee31$(_context31) {
42065
- while (1) switch (_context31.prev = _context31.next) {
41410
+ var _loadBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee30() {
41411
+ return _regeneratorRuntime__default["default"].wrap(function _callee30$(_context30) {
41412
+ while (1) switch (_context30.prev = _context30.next) {
42066
41413
  case 0:
42067
- return _context31.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
41414
+ return _context30.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
42068
41415
  case 1:
42069
41416
  case "end":
42070
- return _context31.stop();
41417
+ return _context30.stop();
42071
41418
  }
42072
- }, _callee31, this);
41419
+ }, _callee30, this);
42073
41420
  }));
42074
41421
  function loadBasket() {
42075
41422
  return _loadBasket.apply(this, arguments);
@@ -42084,31 +41431,31 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42084
41431
  }, {
42085
41432
  key: "initBasket",
42086
41433
  value: function () {
42087
- var _initBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee32(init3D, ignoreFavorites) {
41434
+ var _initBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee31(init3D, ignoreFavorites) {
42088
41435
  var _initSetState$api$web2;
42089
41436
  var initSetState, sets, result, _sets$, set, basket;
42090
- return _regeneratorRuntime__default["default"].wrap(function _callee32$(_context32) {
42091
- while (1) switch (_context32.prev = _context32.next) {
41437
+ return _regeneratorRuntime__default["default"].wrap(function _callee31$(_context31) {
41438
+ while (1) switch (_context31.prev = _context31.next) {
42092
41439
  case 0:
42093
41440
  this.divaNr = this.divaBasketHandler.actDivaNr;
42094
41441
  initSetState = this.getInitStateForSet(!init3D);
42095
41442
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
42096
- _context32.next = 5;
41443
+ _context31.next = 5;
42097
41444
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
42098
41445
  case 5:
42099
- sets = _context32.sent;
41446
+ sets = _context31.sent;
42100
41447
  if (!((_initSetState$api$web2 = initSetState.api.webConfig) !== null && _initSetState$api$web2 !== void 0 && _initSetState$api$web2.checkForProductsPrice)) {
42101
- _context32.next = 12;
41448
+ _context31.next = 12;
42102
41449
  break;
42103
41450
  }
42104
41451
  if (!this.divaBasketHandler.actBasket.OrigProductId) {
42105
- _context32.next = 12;
41452
+ _context31.next = 12;
42106
41453
  break;
42107
41454
  }
42108
- _context32.next = 10;
41455
+ _context31.next = 10;
42109
41456
  return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
42110
41457
  case 10:
42111
- result = _context32.sent;
41458
+ result = _context31.sent;
42112
41459
  if (result) {
42113
41460
  (_sets$ = sets[0]) === null || _sets$ === void 0 || _sets$.remindPriceForHash(result);
42114
41461
  }
@@ -42117,24 +41464,24 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42117
41464
  set = this.actSet();
42118
41465
  setHandlerInstance.loadConfigStructureOfActSet(set, this.getCurPlannerType());
42119
41466
  if (!(favoritesHandlerInstance.FavoritesDefined(set) && !ignoreFavorites)) {
42120
- _context32.next = 17;
41467
+ _context31.next = 17;
42121
41468
  break;
42122
41469
  }
42123
- _context32.next = 17;
41470
+ _context31.next = 17;
42124
41471
  return this.handleFavorites(init3D ? 'CALC' : 'REPAIR');
42125
41472
  case 17:
42126
- _context32.next = 19;
41473
+ _context31.next = 19;
42127
41474
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !init3D, this.doAllowSetPlanner(), this.ReturnTo);
42128
41475
  case 19:
42129
- basket = _context32.sent;
42130
- return _context32.abrupt("return", basket);
41476
+ basket = _context31.sent;
41477
+ return _context31.abrupt("return", basket);
42131
41478
  case 21:
42132
41479
  case "end":
42133
- return _context32.stop();
41480
+ return _context31.stop();
42134
41481
  }
42135
- }, _callee32, this);
41482
+ }, _callee31, this);
42136
41483
  }));
42137
- function initBasket(_x79, _x80) {
41484
+ function initBasket(_x78, _x79) {
42138
41485
  return _initBasket.apply(this, arguments);
42139
41486
  }
42140
41487
  return initBasket;
@@ -42148,21 +41495,21 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42148
41495
  }, {
42149
41496
  key: "getValidVariantsLength",
42150
41497
  value: function () {
42151
- var _getValidVariantsLength = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee33() {
41498
+ var _getValidVariantsLength = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee32() {
42152
41499
  var set;
42153
- return _regeneratorRuntime__default["default"].wrap(function _callee33$(_context33) {
42154
- while (1) switch (_context33.prev = _context33.next) {
41500
+ return _regeneratorRuntime__default["default"].wrap(function _callee32$(_context32) {
41501
+ while (1) switch (_context32.prev = _context32.next) {
42155
41502
  case 0:
42156
41503
  set = this.actSet();
42157
- _context33.next = 3;
41504
+ _context32.next = 3;
42158
41505
  return favoritesHandlerInstance.getValidVariants(set, true);
42159
41506
  case 3:
42160
- return _context33.abrupt("return", _context33.sent.length);
41507
+ return _context32.abrupt("return", _context32.sent.length);
42161
41508
  case 4:
42162
41509
  case "end":
42163
- return _context33.stop();
41510
+ return _context32.stop();
42164
41511
  }
42165
- }, _callee33, this);
41512
+ }, _callee32, this);
42166
41513
  }));
42167
41514
  function getValidVariantsLength() {
42168
41515
  return _getValidVariantsLength.apply(this, arguments);
@@ -42172,46 +41519,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42172
41519
  }, {
42173
41520
  key: "handleFavorites",
42174
41521
  value: function () {
42175
- var _handleFavorites = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(mode) {
41522
+ var _handleFavorites = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee33(mode) {
42176
41523
  var _this4 = this;
42177
41524
  var set, i;
42178
- return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context34) {
42179
- while (1) switch (_context34.prev = _context34.next) {
41525
+ return _regeneratorRuntime__default["default"].wrap(function _callee33$(_context33) {
41526
+ while (1) switch (_context33.prev = _context33.next) {
42180
41527
  case 0:
42181
41528
  set = this.actSet();
42182
41529
  i = 0;
42183
41530
  case 2:
42184
41531
  if (!favoritesHandlerInstance.IsCalcForSummary) {
42185
- _context34.next = 11;
41532
+ _context33.next = 11;
42186
41533
  break;
42187
41534
  }
42188
- _context34.next = 5;
41535
+ _context33.next = 5;
42189
41536
  return DivaUtils__default["default"].Sleep(200);
42190
41537
  case 5:
42191
41538
  i++;
42192
41539
  if (!(i > 1000)) {
42193
- _context34.next = 9;
41540
+ _context33.next = 9;
42194
41541
  break;
42195
41542
  }
42196
41543
  LOG$1.error(new DivaUtils.DivaError('error on generating Variants of Summary'));
42197
- return _context34.abrupt("break", 11);
41544
+ return _context33.abrupt("break", 11);
42198
41545
  case 9:
42199
- _context34.next = 2;
41546
+ _context33.next = 2;
42200
41547
  break;
42201
41548
  case 11:
42202
- _context34.next = 13;
41549
+ _context33.next = 13;
42203
41550
  return favoritesHandlerInstance.handleFavorites(set, mode, this.divaBasketHandler.actBasket, this.saveToBasketWrapper.bind(this), this.doConfigure.bind(this), function () {
42204
41551
  return _this4.update2DGrid(set);
42205
41552
  }, this.actions);
42206
41553
  case 13:
42207
- return _context34.abrupt("return", _context34.sent);
41554
+ return _context33.abrupt("return", _context33.sent);
42208
41555
  case 14:
42209
41556
  case "end":
42210
- return _context34.stop();
41557
+ return _context33.stop();
42211
41558
  }
42212
- }, _callee34, this);
41559
+ }, _callee33, this);
42213
41560
  }));
42214
- function handleFavorites(_x81) {
41561
+ function handleFavorites(_x80) {
42215
41562
  return _handleFavorites.apply(this, arguments);
42216
41563
  }
42217
41564
  return handleFavorites;
@@ -42224,48 +41571,48 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42224
41571
  }, {
42225
41572
  key: "initSapOrderLinesFromBasket",
42226
41573
  value: function () {
42227
- var _initSapOrderLinesFromBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(divaNr, init3D, onlyLoadOldBakset) {
41574
+ var _initSapOrderLinesFromBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(divaNr, init3D, onlyLoadOldBakset) {
42228
41575
  var result, oldBasket, basket;
42229
- return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context35) {
42230
- while (1) switch (_context35.prev = _context35.next) {
41576
+ return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context34) {
41577
+ while (1) switch (_context34.prev = _context34.next) {
42231
41578
  case 0:
42232
41579
  if (divaNr) this.divaBasketHandler.updateDivaNrInBasket(divaNr);
42233
- _context35.next = 3;
41580
+ _context34.next = 3;
42234
41581
  return this.loadBasket();
42235
41582
  case 3:
42236
- result = _context35.sent;
41583
+ result = _context34.sent;
42237
41584
  if (!onlyLoadOldBakset) {
42238
- _context35.next = 6;
41585
+ _context34.next = 6;
42239
41586
  break;
42240
41587
  }
42241
- return _context35.abrupt("return", {
41588
+ return _context34.abrupt("return", {
42242
41589
  oldBasket: new basketModel.BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket))),
42243
41590
  cache: {}
42244
41591
  });
42245
41592
  case 6:
42246
41593
  if (!(result === false)) {
42247
- _context35.next = 8;
41594
+ _context34.next = 8;
42248
41595
  break;
42249
41596
  }
42250
41597
  throw new Error('Could not load basket! ' + divaNr);
42251
41598
  case 8:
42252
41599
  oldBasket = new basketModel.BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket)));
42253
- _context35.next = 11;
41600
+ _context34.next = 11;
42254
41601
  return this.initBasket(init3D);
42255
41602
  case 11:
42256
- basket = _context35.sent;
42257
- return _context35.abrupt("return", {
41603
+ basket = _context34.sent;
41604
+ return _context34.abrupt("return", {
42258
41605
  basket: basket,
42259
41606
  oldBasket: oldBasket,
42260
41607
  cache: this.api.getJsonDataCache()
42261
41608
  });
42262
41609
  case 13:
42263
41610
  case "end":
42264
- return _context35.stop();
41611
+ return _context34.stop();
42265
41612
  }
42266
- }, _callee35, this);
41613
+ }, _callee34, this);
42267
41614
  }));
42268
- function initSapOrderLinesFromBasket(_x82, _x83, _x84) {
41615
+ function initSapOrderLinesFromBasket(_x81, _x82, _x83) {
42269
41616
  return _initSapOrderLinesFromBasket.apply(this, arguments);
42270
41617
  }
42271
41618
  return initSapOrderLinesFromBasket;
@@ -42290,6 +41637,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42290
41637
  }
42291
41638
  return undefined;
42292
41639
  }
41640
+ }, {
41641
+ key: "setsAsArray",
41642
+ get: function get() {
41643
+ return Object.values(this.sets);
41644
+ }
42293
41645
 
42294
41646
  /**
42295
41647
  * This function returns the planner mode.
@@ -60223,7 +59575,7 @@ var ProductHandler = /*#__PURE__*/function () {
60223
59575
  }, {
60224
59576
  key: "isSameProduct",
60225
59577
  value: function isSameProduct(product, setHash, diva3dProject, orderLines, varinatData, catalogCodex) {
60226
- var _product$articles;
59578
+ var _product$articles, _product$configuratio, _product$configuratio2;
60227
59579
  //For new products we store the setHash and hqRenderScript in order to determine if the product changed.
60228
59580
  if (product.uniqueHash !== undefined) {
60229
59581
  return product.uniqueHash === 'v1' + setHash + DivaUtils.md5(diva3dProject);
@@ -60234,22 +59586,22 @@ var ProductHandler = /*#__PURE__*/function () {
60234
59586
  return false;
60235
59587
  }
60236
59588
  //For older products without setHash we use the old comparison logic
59589
+ var orderlines = (_product$configuratio = (_product$configuratio2 = product.configuration) === null || _product$configuratio2 === void 0 || (_product$configuratio2 = _product$configuratio2.OrderSets) === null || _product$configuratio2 === void 0 ? void 0 : _product$configuratio2[0].OrderLines) !== null && _product$configuratio !== void 0 ? _product$configuratio : [];
60237
59590
  var _loop = function _loop() {
60238
- var _article$variantValue;
60239
- var article = product.articles[i];
59591
+ var article = orderlines[i];
60240
59592
  var orderLine = orderLines.find(function (ol) {
60241
- return ol.ArticleCodex == article.articleCodex && catalogCodex == article.catalogCodex;
59593
+ return ol.ArticleCodex == article.ArticleCodex && catalogCodex == article.CatalogCodex;
60242
59594
  });
60243
- if (!orderLine || ((_article$variantValue = article.variantValues) === null || _article$variantValue === void 0 ? void 0 : _article$variantValue.length) != (varinatData === null || varinatData === void 0 ? void 0 : varinatData.length)) {
59595
+ if (!orderLine) {
60244
59596
  return {
60245
59597
  v: false
60246
59598
  };
60247
59599
  }
60248
59600
  var _loop2 = function _loop2() {
60249
- var varinatValue = article.variantValues[j];
60250
- if (!(varinatData !== null && varinatData !== void 0 && varinatData.find(function (vb) {
59601
+ var varinatValue = article.VariantBasketDatas[j];
59602
+ if (!varinatData.find(function (vb) {
60251
59603
  return vb.OPT == varinatValue['OPT'] && vb.OPV == varinatValue['OPV'];
60252
- }))) {
59604
+ })) {
60253
59605
  return {
60254
59606
  v: {
60255
59607
  v: false
@@ -60258,14 +59610,14 @@ var ProductHandler = /*#__PURE__*/function () {
60258
59610
  }
60259
59611
  },
60260
59612
  _ret2;
60261
- for (var j = 0; j < (((_article$variantValue2 = article.variantValues) === null || _article$variantValue2 === void 0 ? void 0 : _article$variantValue2.length) || 0); j++) {
60262
- var _article$variantValue2;
59613
+ for (var j = 0; j < (((_article$VariantBaske = article.VariantBasketDatas) === null || _article$VariantBaske === void 0 ? void 0 : _article$VariantBaske.length) || 0); j++) {
59614
+ var _article$VariantBaske;
60263
59615
  _ret2 = _loop2();
60264
59616
  if (_ret2) return _ret2.v;
60265
59617
  }
60266
59618
  },
60267
59619
  _ret;
60268
- for (var i = 0; i < product.articles.length; i++) {
59620
+ for (var i = 0; i < orderlines.length; i++) {
60269
59621
  _ret = _loop();
60270
59622
  if (_ret) return _ret.v;
60271
59623
  }
@@ -60805,7 +60157,6 @@ exports.DockingPoint = DockingPoint;
60805
60157
  exports.Grid = Grid;
60806
60158
  exports.HQRenderScript = HQRenderScript;
60807
60159
  exports.OptionCatalogData = OptionCatalogData;
60808
- exports.Product = Product;
60809
60160
  exports.Rendering = Rendering;
60810
60161
  exports.Vector2 = Vector2;
60811
60162
  exports.Vector3 = Vector3;
@@ -60814,6 +60165,5 @@ exports.articleHandlerInstance = articleHandlerInstance;
60814
60165
  exports.creatRenderOrders = creatRenderOrders;
60815
60166
  exports.getOrigProductId = getOrigProductId;
60816
60167
  exports.loadAndRepairBasket = loadAndRepairBasket;
60817
- exports.productHandlerInstance = productHandlerInstance;
60818
60168
  exports.setHandlerInstance = setHandlerInstance;
60819
60169
  exports.summaryHandlerInstance = summaryHandlerInstance;