@crystaldesign/web-planner-logic 24.14.0-beta.9 → 24.15.0-beta.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 (89) hide show
  1. package/build/cjs/{DivaBoxPlanner-b8c943f9.js → DivaBoxPlanner-4789bc0a.js} +8 -6
  2. package/build/cjs/{DivaStandardPlanner-d545a524.js → DivaStandardPlanner-dbdb4ba0.js} +4 -4
  3. package/build/cjs/{DoorPlanner-cbf256ac.js → DoorPlanner-e05bdec4.js} +3 -3
  4. package/build/cjs/{Host3DSignalR-38042dd4.js → Host3DSignalR-908946a2.js} +10 -11
  5. package/build/cjs/{LiviqueWWSHandler-5968a440.js → LiviqueWWSHandler-4bad8cba.js} +5 -2
  6. package/build/cjs/{PfisterWWSHandler-a19fb640.js → PfisterWWSHandler-93d9fb4d.js} +69 -18
  7. package/build/cjs/{PlannerHandler2D-104c25e8.js → PlannerHandler2D-593db35b.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-afe39b25.js → SeriousBasketHandler-f1feae09.js} +5 -2
  9. package/build/cjs/{ShelfPlanner-b68a936a.js → ShelfPlanner-47d446eb.js} +3 -3
  10. package/build/cjs/{StandardWWSHandler-d56e153f.js → StandardWWSHandler-1e7710d3.js} +5 -2
  11. package/build/cjs/{index-fc73236c.js → index-5f530bbb.js} +1102 -892
  12. package/build/cjs/index.js +2 -2
  13. package/build/esm/{DivaBoxPlanner-d5cb2761.js → DivaBoxPlanner-11ab03fc.js} +8 -6
  14. package/build/esm/{DivaStandardPlanner-7b4a2363.js → DivaStandardPlanner-fcc8d692.js} +4 -4
  15. package/build/esm/{DoorPlanner-d637db66.js → DoorPlanner-36d5e093.js} +3 -3
  16. package/build/esm/{Host3DSignalR-cc8579c6.js → Host3DSignalR-9222f4e5.js} +10 -11
  17. package/build/esm/{LiviqueWWSHandler-36b3f3bf.js → LiviqueWWSHandler-b01ffddd.js} +5 -2
  18. package/build/esm/{PfisterWWSHandler-55960acc.js → PfisterWWSHandler-327b06c0.js} +69 -18
  19. package/build/esm/{PlannerHandler2D-c5f068a9.js → PlannerHandler2D-4ca09229.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-6c11ee06.js → SeriousBasketHandler-36a1b987.js} +5 -2
  21. package/build/esm/{ShelfPlanner-ab85b5ea.js → ShelfPlanner-a08089d2.js} +3 -3
  22. package/build/esm/{StandardWWSHandler-4f44c130.js → StandardWWSHandler-96622950.js} +5 -2
  23. package/build/esm/{index-21a4713a.js → index-16bf1098.js} +1102 -892
  24. package/build/esm/index.js +2 -2
  25. package/build/types/web-planner-logic/src/interface/API/TemplateConfigType.d.ts +1 -1
  26. package/build/types/web-planner-logic/src/interface/API/TemplateConfigType.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/API/ViewConfigDataType.d.ts +4 -7
  28. package/build/types/web-planner-logic/src/interface/API/ViewConfigDataType.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts +1 -1
  30. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/Articles/CatalogArticleDataType.d.ts +3 -1
  32. package/build/types/web-planner-logic/src/interface/Articles/CatalogArticleDataType.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts +1 -0
  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 +1 -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 +5 -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.map +1 -1
  40. package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts +1 -0
  41. package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts.map +1 -1
  42. package/build/types/web-planner-logic/src/interface/OptionTypes/DecisionType.d.ts +1 -0
  43. package/build/types/web-planner-logic/src/interface/OptionTypes/DecisionType.d.ts.map +1 -1
  44. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts +2 -1
  45. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts.map +1 -1
  46. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +9 -5
  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/Article/DivaArticleHandler.d.ts +0 -3
  49. package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts.map +1 -1
  50. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts +4 -1
  51. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts.map +1 -1
  52. package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts +1 -0
  53. package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts.map +1 -1
  54. package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts +2 -1
  55. package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts.map +1 -1
  56. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts +1 -0
  57. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts.map +1 -1
  58. package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts +1 -0
  59. package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts.map +1 -1
  60. package/build/types/web-planner-logic/src/logic/ConfigTree/DoorPlanner/DoorPlanner.d.ts.map +1 -1
  61. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts.map +1 -1
  62. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +4 -7
  63. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  64. package/build/types/web-planner-logic/src/logic/DivaCatalogHandler.d.ts.map +1 -1
  65. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +8 -3
  66. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  67. package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts +3 -1
  68. package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts.map +1 -1
  69. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Host3DSignalR.d.ts.map +1 -1
  70. package/build/types/web-planner-logic/src/logic/Planner/Rendering/PlannerHandler3D.d.ts +4 -2
  71. package/build/types/web-planner-logic/src/logic/Planner/Rendering/PlannerHandler3D.d.ts.map +1 -1
  72. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts +2 -0
  73. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts.map +1 -1
  74. package/build/types/web-planner-logic/src/logic/Planner/Rendering/types.d.ts +35 -6
  75. package/build/types/web-planner-logic/src/logic/Planner/Rendering/types.d.ts.map +1 -1
  76. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts +26 -2
  77. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts.map +1 -1
  78. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +12 -16
  79. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
  80. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +6 -11
  81. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  82. package/build/types/web-planner-logic/src/model/Articles/CatalogArticleData.d.ts +10 -3
  83. package/build/types/web-planner-logic/src/model/Articles/CatalogArticleData.d.ts.map +1 -1
  84. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts +1 -0
  85. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts.map +1 -1
  86. package/build/types/web-planner-logic/src/model/Options/ArticleOptionValueData.d.ts +1 -1
  87. package/build/types/web-planner-logic/src/model/Options/ArticleOptionValueData.d.ts.map +1 -1
  88. package/build/types/web-planner-logic/src/test/datas/environments/testing/pfister-dev.d.ts.map +1 -1
  89. package/package.json +2 -2
@@ -1,10 +1,10 @@
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
1
2
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
2
3
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
3
4
  import _createClass from '@babel/runtime/helpers/createClass';
4
5
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
5
6
  import _regeneratorRuntime from '@babel/runtime/regenerator';
6
7
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
7
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
8
8
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
9
9
  import axios$1 from 'axios';
10
10
  import DivaUtils, { DivaError, md5, nanoid } from '@crystaldesign/diva-utils';
@@ -26,9 +26,9 @@ import _typeof from '@babel/runtime/helpers/typeof';
26
26
  })();
27
27
 
28
28
  var _excluded = ["type"];
29
- function ownKeys$f(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; }
30
- function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31
- var LOG$g = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
29
+ function ownKeys$g(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; }
30
+ function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31
+ var LOG$h = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
32
32
  var JsonDataCache = /*#__PURE__*/function () {
33
33
  function JsonDataCache() {
34
34
  _classCallCheck(this, JsonDataCache);
@@ -74,7 +74,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
74
74
  if (plannerConfig.settings) {
75
75
  this.initalizeWebConfigData(plannerConfig.settings, plannerConfig.lang);
76
76
  } else {
77
- LOG$g.error(new DivaError('Fehler beim laden der WebConfig', {
77
+ LOG$h.error(new DivaError('Fehler beim laden der WebConfig', {
78
78
  code: 'WC_0001'
79
79
  }));
80
80
  throw Error('Initalize failed!');
@@ -109,7 +109,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
109
109
  while (1) switch (_context.prev = _context.next) {
110
110
  case 0:
111
111
  skip = _args.length > 2 && _args[2] !== undefined ? _args[2] : 0;
112
- LOG$g.debug('DivaApiHandler.fetchData ' + url, 'DivaApiHandler, fetchData');
112
+ LOG$h.debug('DivaApiHandler.fetchData ' + url, 'DivaApiHandler, fetchData');
113
113
  if (init) {
114
114
  _context.next = 4;
115
115
  break;
@@ -118,32 +118,31 @@ var DivaApiHandler = /*#__PURE__*/function () {
118
118
  case 4:
119
119
  _context.prev = 4;
120
120
  if (!(init.method === 'POST')) {
121
- _context.next = 12;
121
+ _context.next = 11;
122
122
  break;
123
123
  }
124
- delete init.method;
125
- _context.next = 9;
124
+ _context.next = 8;
126
125
  return axios$1.post(url, init.data, init.config);
127
- case 9:
126
+ case 8:
128
127
  response = _context.sent;
129
- _context.next = 17;
128
+ _context.next = 16;
130
129
  break;
131
- case 12:
130
+ case 11:
132
131
  finalUrl = new URL(url);
133
132
  if (skip) {
134
133
  finalUrl.searchParams.append('skip', skip.toString());
135
134
  }
136
- _context.next = 16;
135
+ _context.next = 15;
137
136
  return axios$1.get(finalUrl.toString(), init.config);
138
- case 16:
137
+ case 15:
139
138
  response = _context.sent;
140
- case 17:
141
- _context.next = 19;
139
+ case 16:
140
+ _context.next = 18;
142
141
  return response.data;
143
- case 19:
142
+ case 18:
144
143
  data = _context.sent;
145
144
  if (data !== null && data !== void 0 && data.Error) {
146
- LOG$g.error(new DivaError(data.Error, {
145
+ LOG$h.error(new DivaError(data.Error, {
147
146
  code: 'WC_0001',
148
147
  custom: {
149
148
  url: url
@@ -152,36 +151,36 @@ var DivaApiHandler = /*#__PURE__*/function () {
152
151
  }
153
152
  //if data is paginated iterate and fetch all
154
153
  if (!(Array.isArray(data.data) && data.total)) {
155
- _context.next = 35;
154
+ _context.next = 34;
156
155
  break;
157
156
  }
158
157
  if (!(data.data.length + skip < data.total)) {
159
- _context.next = 34;
158
+ _context.next = 33;
160
159
  break;
161
160
  }
162
161
  nextSkip = skip + 20;
163
162
  _context.t0 = [];
164
163
  _context.t1 = _toConsumableArray(data.data);
165
164
  _context.t2 = _toConsumableArray;
166
- _context.next = 29;
165
+ _context.next = 28;
167
166
  return this.fetchData(url, init, nextSkip);
168
- case 29:
167
+ case 28:
169
168
  _context.t3 = _context.sent;
170
169
  _context.t4 = (0, _context.t2)(_context.t3);
171
170
  return _context.abrupt("return", _context.t0.concat.call(_context.t0, _context.t1, _context.t4));
172
- case 34:
171
+ case 33:
173
172
  return _context.abrupt("return", data.data);
174
- case 35:
173
+ case 34:
175
174
  return _context.abrupt("return", data);
176
- case 38:
177
- _context.prev = 38;
175
+ case 37:
176
+ _context.prev = 37;
178
177
  _context.t5 = _context["catch"](4);
179
178
  throw Error('fetch failed! ' + url + ' Error: ' + _context.t5);
180
- case 41:
179
+ case 40:
181
180
  case "end":
182
181
  return _context.stop();
183
182
  }
184
- }, _callee, this, [[4, 38]]);
183
+ }, _callee, this, [[4, 37]]);
185
184
  }));
186
185
  function fetchData(_x, _x2) {
187
186
  return _fetchData.apply(this, arguments);
@@ -233,8 +232,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
233
232
  if (this.getApplicationEnvironment() == 'WEB' && (_this$apiConfig2 = this.apiConfig) !== null && _this$apiConfig2 !== void 0 && _this$apiConfig2.api2.web) {
234
233
  api2Url = this.apiConfig.api2.web;
235
234
  }
236
- _context2.t0 = _objectSpread$f;
237
- _context2.t1 = _objectSpread$f({}, init.config.headers);
235
+ _context2.t0 = _objectSpread$g;
236
+ _context2.t1 = _objectSpread$g({}, init.config.headers);
238
237
  _context2.t2 = {};
239
238
  _context2.next = 20;
240
239
  return this.getSessionGuid('V', undefined, this.OrganizationId, api2Url);
@@ -280,7 +279,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
280
279
  _context3.next = 9;
281
280
  break;
282
281
  }
283
- LOG$g.debug('getDataFromInternalCache: ' + queryString);
282
+ LOG$h.debug('getDataFromInternalCache: ' + queryString);
284
283
  if (!this.jsonDataCache.get(myQS)) {
285
284
  _context3.next = 8;
286
285
  break;
@@ -345,9 +344,9 @@ var DivaApiHandler = /*#__PURE__*/function () {
345
344
  return this.fetchData(url, init);
346
345
  case 33:
347
346
  result = _context3.sent;
348
- this.jsonDataCache.set(myQS, result);
347
+ if (method !== 'POST') this.jsonDataCache.set(myQS, result);
349
348
  if (cacheMD5) this.jsonDataCache.set(cacheMD5, result);
350
- LOG$g.debug('getDataFromApi: ' + queryString);
349
+ LOG$h.debug('getDataFromApi: ' + queryString);
351
350
  return _context3.abrupt("return", result);
352
351
  case 38:
353
352
  case "end":
@@ -383,7 +382,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
383
382
  case 5:
384
383
  _context4.prev = 5;
385
384
  _context4.t0 = _context4["catch"](1);
386
- LOG$g.error(new DivaError('could not create product in Configurator', {
385
+ LOG$h.error(new DivaError('could not create product in Configurator', {
387
386
  cause: _context4.t0
388
387
  }));
389
388
  return _context4.abrupt("return", false);
@@ -414,11 +413,11 @@ var DivaApiHandler = /*#__PURE__*/function () {
414
413
  language: lang !== null && lang !== void 0 ? lang : this.getLanguage(),
415
414
  abTestCases: data.abTestCases !== undefined ? data.abTestCases : [],
416
415
  checkForProductsPrice: data.checkForProductsPrice,
416
+ checkForProductsMatch: data.checkForProductsMatch,
417
417
  doDisablePlanner2D: data.doDisablePlanner2D,
418
418
  diva3dStaticBGImage: data.diva3dStaticBGImage != undefined ? data.diva3dStaticBGImage : false,
419
419
  diva3dStaticBGImage_DefaultRoomList: data.diva3dStaticBGImage_DefaultRoomList != undefined ? data.diva3dStaticBGImage_DefaultRoomList : '',
420
420
  diva3DAllowDefaultCatRoomList: data.diva3DAllowDefaultCatRoomList != undefined ? data.diva3DAllowDefaultCatRoomList : true,
421
- doCheckVariantData: data.doCheckVariantData,
422
421
  templateConfig: data.templateConfig,
423
422
  doAllowSetPlanner: data.doAllowSetPlanner,
424
423
  onErrorHandling: data.onErrorHandling,
@@ -484,17 +483,23 @@ var DivaApiHandler = /*#__PURE__*/function () {
484
483
  var _this$divaWebConfigDa2;
485
484
  return (_this$divaWebConfigDa2 = this.divaWebConfigData) === null || _this$divaWebConfigDa2 === void 0 ? void 0 : _this$divaWebConfigDa2.checkForProductsPrice;
486
485
  }
486
+ }, {
487
+ key: "doCheckForProductsMatch",
488
+ value: function doCheckForProductsMatch() {
489
+ var _this$divaWebConfigDa3;
490
+ return (_this$divaWebConfigDa3 = this.divaWebConfigData) === null || _this$divaWebConfigDa3 === void 0 ? void 0 : _this$divaWebConfigDa3.checkForProductsMatch;
491
+ }
487
492
  }, {
488
493
  key: "getReportConfigIdentifier",
489
494
  value: function getReportConfigIdentifier() {
490
- var _this$divaWebConfigDa3;
491
- return (_this$divaWebConfigDa3 = this.divaWebConfigData) === null || _this$divaWebConfigDa3 === void 0 ? void 0 : _this$divaWebConfigDa3.reportConfigIdentifier;
495
+ var _this$divaWebConfigDa4;
496
+ return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.reportConfigIdentifier;
492
497
  }
493
498
  }, {
494
499
  key: "getPrintOptions",
495
500
  value: function getPrintOptions() {
496
- var _this$divaWebConfigDa4;
497
- var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.reportConfig;
501
+ var _this$divaWebConfigDa5;
502
+ var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa5 = this.divaWebConfigData) === null || _this$divaWebConfigDa5 === void 0 ? void 0 : _this$divaWebConfigDa5.reportConfig;
498
503
  return {
499
504
  Gdpr: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithGDPR),
500
505
  PlanningSketch: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithPlanningSketch),
@@ -514,8 +519,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
514
519
  }, {
515
520
  key: "get3DRenderGroup",
516
521
  value: function get3DRenderGroup() {
517
- var _this$divaWebConfigDa5, _this$divaWebConfigDa6;
518
- return (_this$divaWebConfigDa5 = (_this$divaWebConfigDa6 = this.divaWebConfigData) === null || _this$divaWebConfigDa6 === void 0 ? void 0 : _this$divaWebConfigDa6.diva3dRenderGroup) !== null && _this$divaWebConfigDa5 !== void 0 ? _this$divaWebConfigDa5 : '';
522
+ var _this$divaWebConfigDa6, _this$divaWebConfigDa7;
523
+ return (_this$divaWebConfigDa6 = (_this$divaWebConfigDa7 = this.divaWebConfigData) === null || _this$divaWebConfigDa7 === void 0 ? void 0 : _this$divaWebConfigDa7.diva3dRenderGroup) !== null && _this$divaWebConfigDa6 !== void 0 ? _this$divaWebConfigDa6 : '';
519
524
  }
520
525
  }, {
521
526
  key: "getServerId",
@@ -552,86 +557,67 @@ var DivaApiHandler = /*#__PURE__*/function () {
552
557
  }, {
553
558
  key: "getDiva3dStaticBGImage",
554
559
  value: function getDiva3dStaticBGImage() {
555
- var _this$divaWebConfigDa7;
556
- return (_this$divaWebConfigDa7 = this.divaWebConfigData) === null || _this$divaWebConfigDa7 === void 0 ? void 0 : _this$divaWebConfigDa7.diva3dStaticBGImage;
560
+ var _this$divaWebConfigDa8;
561
+ return (_this$divaWebConfigDa8 = this.divaWebConfigData) === null || _this$divaWebConfigDa8 === void 0 ? void 0 : _this$divaWebConfigDa8.diva3dStaticBGImage;
557
562
  }
558
563
  }, {
559
564
  key: "getDiva3dStaticBGImage_DefaultRoomList",
560
565
  value: function getDiva3dStaticBGImage_DefaultRoomList() {
561
- var _this$divaWebConfigDa8, _this$divaWebConfigDa9;
562
- return ((_this$divaWebConfigDa8 = this.divaWebConfigData) === null || _this$divaWebConfigDa8 === void 0 ? void 0 : _this$divaWebConfigDa8.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dStaticBGImage_DefaultRoomList;
566
+ var _this$divaWebConfigDa9, _this$divaWebConfigDa10;
567
+ return ((_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3dStaticBGImage_DefaultRoomList;
563
568
  }
564
569
  }, {
565
570
  key: "getDiva3DAllowDefaultCatRoomList",
566
571
  value: function getDiva3DAllowDefaultCatRoomList() {
567
- var _this$divaWebConfigDa10;
568
- return (_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3DAllowDefaultCatRoomList;
572
+ var _this$divaWebConfigDa11;
573
+ return (_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.diva3DAllowDefaultCatRoomList;
569
574
  }
570
575
  }, {
571
576
  key: "doAllowSetPlanner",
572
577
  value: function doAllowSetPlanner() {
573
- var _this$divaWebConfigDa11;
574
- return (_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.doAllowSetPlanner;
578
+ var _this$divaWebConfigDa12;
579
+ return (_this$divaWebConfigDa12 = this.divaWebConfigData) === null || _this$divaWebConfigDa12 === void 0 ? void 0 : _this$divaWebConfigDa12.doAllowSetPlanner;
575
580
  }
576
581
  }, {
577
582
  key: "getHidePlanner",
578
583
  value: function getHidePlanner() {
579
- var _this$divaWebConfigDa12;
580
- return !!((_this$divaWebConfigDa12 = this.divaWebConfigData) !== null && _this$divaWebConfigDa12 !== void 0 && (_this$divaWebConfigDa12 = _this$divaWebConfigDa12.viewConfig) !== null && _this$divaWebConfigDa12 !== void 0 && _this$divaWebConfigDa12.hidePlanner);
581
- }
582
- }, {
583
- key: "getDoShowAR",
584
- value: function getDoShowAR() {
585
584
  var _this$divaWebConfigDa13;
586
- return (_this$divaWebConfigDa13 = this.divaWebConfigData) === null || _this$divaWebConfigDa13 === void 0 || (_this$divaWebConfigDa13 = _this$divaWebConfigDa13.viewConfig) === null || _this$divaWebConfigDa13 === void 0 ? void 0 : _this$divaWebConfigDa13.enableAR;
587
- }
588
- }, {
589
- key: "forceShowRTV",
590
- value: function forceShowRTV() {
591
- var _this$divaWebConfigDa14;
592
- return (_this$divaWebConfigDa14 = this.divaWebConfigData) === null || _this$divaWebConfigDa14 === void 0 || (_this$divaWebConfigDa14 = _this$divaWebConfigDa14.viewConfig) === null || _this$divaWebConfigDa14 === void 0 ? void 0 : _this$divaWebConfigDa14.forceRTV;
593
- }
594
- }, {
595
- key: "getDoShowRTV",
596
- value: function getDoShowRTV() {
597
- var _this$divaWebConfigDa15;
598
- return (_this$divaWebConfigDa15 = this.divaWebConfigData) === null || _this$divaWebConfigDa15 === void 0 || (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) === null || _this$divaWebConfigDa15 === void 0 ? void 0 : _this$divaWebConfigDa15.enableRTV;
585
+ return !!((_this$divaWebConfigDa13 = this.divaWebConfigData) !== null && _this$divaWebConfigDa13 !== void 0 && (_this$divaWebConfigDa13 = _this$divaWebConfigDa13.viewConfig) !== null && _this$divaWebConfigDa13 !== void 0 && _this$divaWebConfigDa13.hidePlanner);
599
586
  }
600
587
  }, {
601
588
  key: "getEnableRTVUnityKombi",
602
589
  value: function getEnableRTVUnityKombi() {
603
- var _this$divaWebConfigDa16;
604
- return !!((_this$divaWebConfigDa16 = this.divaWebConfigData) !== null && _this$divaWebConfigDa16 !== void 0 && _this$divaWebConfigDa16.viewConfig.enableRtvUnityKombi);
590
+ return !!this.organization.settings.enableRTV;
605
591
  }
606
592
  }, {
607
593
  key: "getDoDisablePlanner2D",
608
594
  value: function getDoDisablePlanner2D() {
609
- var _this$divaWebConfigDa17;
610
- return !!((_this$divaWebConfigDa17 = this.divaWebConfigData) !== null && _this$divaWebConfigDa17 !== void 0 && _this$divaWebConfigDa17.doDisablePlanner2D);
595
+ var _this$divaWebConfigDa14;
596
+ return !!((_this$divaWebConfigDa14 = this.divaWebConfigData) !== null && _this$divaWebConfigDa14 !== void 0 && _this$divaWebConfigDa14.doDisablePlanner2D);
611
597
  }
612
598
  }, {
613
599
  key: "getRoomListInProduct",
614
600
  value: function getRoomListInProduct() {
615
- var _this$divaWebConfigDa18;
616
- return !!((_this$divaWebConfigDa18 = this.divaWebConfigData) !== null && _this$divaWebConfigDa18 !== void 0 && (_this$divaWebConfigDa18 = _this$divaWebConfigDa18.viewConfig) !== null && _this$divaWebConfigDa18 !== void 0 && _this$divaWebConfigDa18.roomListInProduct);
601
+ var _this$divaWebConfigDa15;
602
+ return !!((_this$divaWebConfigDa15 = this.divaWebConfigData) !== null && _this$divaWebConfigDa15 !== void 0 && (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) !== null && _this$divaWebConfigDa15 !== void 0 && _this$divaWebConfigDa15.roomListInProduct);
617
603
  }
618
604
  }, {
619
605
  key: "getPlannerType",
620
606
  value: function getPlannerType() {
621
- var _this$divaWebConfigDa19;
622
- return (_this$divaWebConfigDa19 = this.divaWebConfigData) === null || _this$divaWebConfigDa19 === void 0 || (_this$divaWebConfigDa19 = _this$divaWebConfigDa19.viewConfig) === null || _this$divaWebConfigDa19 === void 0 ? void 0 : _this$divaWebConfigDa19.plannerType;
607
+ var _this$divaWebConfigDa16;
608
+ return (_this$divaWebConfigDa16 = this.divaWebConfigData) === null || _this$divaWebConfigDa16 === void 0 || (_this$divaWebConfigDa16 = _this$divaWebConfigDa16.viewConfig) === null || _this$divaWebConfigDa16 === void 0 ? void 0 : _this$divaWebConfigDa16.plannerType;
623
609
  }
624
610
  }, {
625
611
  key: "getLoadSupplierColors",
626
612
  value: function getLoadSupplierColors() {
627
- var _this$divaWebConfigDa20;
628
- return !!((_this$divaWebConfigDa20 = this.divaWebConfigData) !== null && _this$divaWebConfigDa20 !== void 0 && _this$divaWebConfigDa20.loadSupplierColors);
613
+ var _this$divaWebConfigDa17;
614
+ return !!((_this$divaWebConfigDa17 = this.divaWebConfigData) !== null && _this$divaWebConfigDa17 !== void 0 && _this$divaWebConfigDa17.loadSupplierColors);
629
615
  }
630
616
  }, {
631
617
  key: "showSelectionModeZero",
632
618
  value: function showSelectionModeZero() {
633
- var _this$divaWebConfigDa21;
634
- return !!((_this$divaWebConfigDa21 = this.divaWebConfigData) !== null && _this$divaWebConfigDa21 !== void 0 && _this$divaWebConfigDa21.showSelectionModeZero);
619
+ var _this$divaWebConfigDa18;
620
+ return !!((_this$divaWebConfigDa18 = this.divaWebConfigData) !== null && _this$divaWebConfigDa18 !== void 0 && _this$divaWebConfigDa18.showSelectionModeZero);
635
621
  }
636
622
  }, {
637
623
  key: "ruleDescSeperator",
@@ -648,12 +634,6 @@ var DivaApiHandler = /*#__PURE__*/function () {
648
634
  var _this$organization3;
649
635
  return !!((_this$organization3 = this.organization) !== null && _this$organization3 !== void 0 && (_this$organization3 = _this$organization3.settings) !== null && _this$organization3 !== void 0 && _this$organization3.ruleDescWithoutParenthesis);
650
636
  }
651
- }, {
652
- key: "getDoCheckVariantData",
653
- value: function getDoCheckVariantData() {
654
- var _this$divaWebConfigDa22;
655
- return (_this$divaWebConfigDa22 = this.divaWebConfigData) === null || _this$divaWebConfigDa22 === void 0 ? void 0 : _this$divaWebConfigDa22.doCheckVariantData;
656
- }
657
637
  }, {
658
638
  key: "setI18n",
659
639
  value: function setI18n(i18n) {
@@ -745,50 +725,50 @@ var DivaApiHandler = /*#__PURE__*/function () {
745
725
  }, {
746
726
  key: "getViewConfig",
747
727
  value: function getViewConfig() {
748
- var _this$divaWebConfigDa23;
749
- return (_this$divaWebConfigDa23 = this.divaWebConfigData) === null || _this$divaWebConfigDa23 === void 0 ? void 0 : _this$divaWebConfigDa23.viewConfig;
728
+ var _this$divaWebConfigDa19;
729
+ return (_this$divaWebConfigDa19 = this.divaWebConfigData) === null || _this$divaWebConfigDa19 === void 0 ? void 0 : _this$divaWebConfigDa19.viewConfig;
750
730
  }
751
731
  }, {
752
732
  key: "getEmailConfig",
753
733
  value: function getEmailConfig() {
754
- var _this$divaWebConfigDa24;
755
- return (_this$divaWebConfigDa24 = this.divaWebConfigData) === null || _this$divaWebConfigDa24 === void 0 ? void 0 : _this$divaWebConfigDa24.emailConfig;
734
+ var _this$divaWebConfigDa20;
735
+ return (_this$divaWebConfigDa20 = this.divaWebConfigData) === null || _this$divaWebConfigDa20 === void 0 ? void 0 : _this$divaWebConfigDa20.emailConfig;
756
736
  }
757
737
  }, {
758
738
  key: "getABTestCases",
759
739
  value: function getABTestCases() {
760
- var _this$divaWebConfigDa25, _this$divaWebConfigDa26;
761
- return (_this$divaWebConfigDa25 = (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.abTestCases) !== null && _this$divaWebConfigDa25 !== void 0 ? _this$divaWebConfigDa25 : [];
740
+ var _this$divaWebConfigDa21, _this$divaWebConfigDa22;
741
+ return (_this$divaWebConfigDa21 = (_this$divaWebConfigDa22 = this.divaWebConfigData) === null || _this$divaWebConfigDa22 === void 0 ? void 0 : _this$divaWebConfigDa22.abTestCases) !== null && _this$divaWebConfigDa21 !== void 0 ? _this$divaWebConfigDa21 : [];
762
742
  }
763
743
  }, {
764
744
  key: "getBarrierConfig",
765
745
  value: function getBarrierConfig() {
766
- var _this$divaWebConfigDa27;
767
- return (_this$divaWebConfigDa27 = this.divaWebConfigData) === null || _this$divaWebConfigDa27 === void 0 ? void 0 : _this$divaWebConfigDa27.barrierConfig;
746
+ var _this$divaWebConfigDa23;
747
+ return (_this$divaWebConfigDa23 = this.divaWebConfigData) === null || _this$divaWebConfigDa23 === void 0 ? void 0 : _this$divaWebConfigDa23.barrierConfig;
768
748
  }
769
749
  }, {
770
750
  key: "getTemplateConfig",
771
751
  value: function getTemplateConfig() {
772
- var _this$divaWebConfigDa28;
773
- return (_this$divaWebConfigDa28 = this.divaWebConfigData) === null || _this$divaWebConfigDa28 === void 0 ? void 0 : _this$divaWebConfigDa28.templateConfig;
752
+ var _this$divaWebConfigDa24;
753
+ return (_this$divaWebConfigDa24 = this.divaWebConfigData) === null || _this$divaWebConfigDa24 === void 0 ? void 0 : _this$divaWebConfigDa24.templateConfig;
774
754
  }
775
755
  }, {
776
756
  key: "showDivaNr",
777
757
  value: function showDivaNr() {
778
- var _this$divaWebConfigDa29;
779
- return (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.showDivaNr;
758
+ var _this$divaWebConfigDa25;
759
+ return (_this$divaWebConfigDa25 = this.divaWebConfigData) === null || _this$divaWebConfigDa25 === void 0 ? void 0 : _this$divaWebConfigDa25.showDivaNr;
780
760
  }
781
761
  }, {
782
762
  key: "onErrorHandling",
783
763
  value: function onErrorHandling() {
784
- var _this$divaWebConfigDa30;
785
- return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.onErrorHandling;
764
+ var _this$divaWebConfigDa26;
765
+ return (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.onErrorHandling;
786
766
  }
787
767
  }, {
788
768
  key: "diva3DRenderingDefault",
789
769
  value: function diva3DRenderingDefault() {
790
- var _this$divaWebConfigDa31;
791
- return (_this$divaWebConfigDa31 = this.divaWebConfigData) === null || _this$divaWebConfigDa31 === void 0 ? void 0 : _this$divaWebConfigDa31.diva3DRenderingDefault;
770
+ var _this$divaWebConfigDa27;
771
+ return (_this$divaWebConfigDa27 = this.divaWebConfigData) === null || _this$divaWebConfigDa27 === void 0 ? void 0 : _this$divaWebConfigDa27.diva3DRenderingDefault;
792
772
  }
793
773
  }, {
794
774
  key: "getJwt",
@@ -803,8 +783,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
803
783
  }, {
804
784
  key: "getUseMask",
805
785
  value: function getUseMask() {
806
- var _this$divaWebConfigDa32;
807
- return (_this$divaWebConfigDa32 = this.divaWebConfigData) === null || _this$divaWebConfigDa32 === void 0 ? void 0 : _this$divaWebConfigDa32.useMask;
786
+ var _this$divaWebConfigDa28;
787
+ return (_this$divaWebConfigDa28 = this.divaWebConfigData) === null || _this$divaWebConfigDa28 === void 0 ? void 0 : _this$divaWebConfigDa28.useMask;
808
788
  }
809
789
  }, {
810
790
  key: "apiUrl",
@@ -976,11 +956,6 @@ var DivaApiHandler = /*#__PURE__*/function () {
976
956
  var qs = 'function=GetJsonArticlePrices' + '&catalogCodex=' + catalogCodex + '&articleCodex=' + articleCodex + (this.useEkPrices ? '&ekPrices=true' : '');
977
957
  return md5(qs.toLowerCase()).toUpperCase();
978
958
  }
979
- }, {
980
- key: "getCheckVariantDataQS",
981
- value: function getCheckVariantDataQS(setHash) {
982
- return 'function=CheckVariantData&hash=' + setHash;
983
- }
984
959
  }, {
985
960
  key: "getApiAccountLogin",
986
961
  value: function getApiAccountLogin(accountGuid) {
@@ -1172,7 +1147,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1172
1147
  case 9:
1173
1148
  _context10.prev = 9;
1174
1149
  _context10.t0 = _context10["catch"](4);
1175
- LOG$g.error(new DivaError('Error Connecting to Support-Service-LivePlanner', {
1150
+ LOG$h.error(new DivaError('Error Connecting to Support-Service-LivePlanner', {
1176
1151
  cause: _context10.t0
1177
1152
  }));
1178
1153
  case 12:
@@ -1294,7 +1269,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1294
1269
  case 14:
1295
1270
  _context12.prev = 14;
1296
1271
  _context12.t0 = _context12["catch"](6);
1297
- LOG$g.error(new DivaError('Error Connecting to Report Service', {
1272
+ LOG$h.error(new DivaError('Error Connecting to Report Service', {
1298
1273
  cause: _context12.t0
1299
1274
  }));
1300
1275
  case 17:
@@ -1324,14 +1299,14 @@ var DivaApiHandler = /*#__PURE__*/function () {
1324
1299
  }, {
1325
1300
  key: "dontLoadAdditionalModelInfos",
1326
1301
  get: function get() {
1327
- var _this$divaWebConfigDa33;
1328
- return (_this$divaWebConfigDa33 = this.divaWebConfigData) === null || _this$divaWebConfigDa33 === void 0 ? void 0 : _this$divaWebConfigDa33.dontLoadAdditionalModelInfos;
1302
+ var _this$divaWebConfigDa29;
1303
+ return (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.dontLoadAdditionalModelInfos;
1329
1304
  }
1330
1305
  }, {
1331
1306
  key: "dontLoadCatalogEditorLiteMask",
1332
1307
  get: function get() {
1333
- var _this$divaWebConfigDa34;
1334
- return (_this$divaWebConfigDa34 = this.divaWebConfigData) === null || _this$divaWebConfigDa34 === void 0 ? void 0 : _this$divaWebConfigDa34.dontLoadCatalogEditorLiteMask;
1308
+ var _this$divaWebConfigDa30;
1309
+ return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.dontLoadCatalogEditorLiteMask;
1335
1310
  }
1336
1311
  }, {
1337
1312
  key: "OrganizationId",
@@ -1339,6 +1314,12 @@ var DivaApiHandler = /*#__PURE__*/function () {
1339
1314
  var _this$organization4;
1340
1315
  return (_this$organization4 = this.organization) === null || _this$organization4 === void 0 ? void 0 : _this$organization4._id;
1341
1316
  }
1317
+ }, {
1318
+ key: "enableAR",
1319
+ get: function get() {
1320
+ var _this$organization5;
1321
+ return (_this$organization5 = this.organization) === null || _this$organization5 === void 0 || (_this$organization5 = _this$organization5.settings) === null || _this$organization5 === void 0 ? void 0 : _this$organization5.enableAR;
1322
+ }
1342
1323
  }, {
1343
1324
  key: "webConfig",
1344
1325
  get: function get() {
@@ -1644,7 +1625,7 @@ var ArticleOptionData = /*#__PURE__*/function () {
1644
1625
  }();
1645
1626
 
1646
1627
  var ArticleOptionValueData = /*#__PURE__*/function () {
1647
- function ArticleOptionValueData(codex, jsonOPV, catalogOPV, myArticle, isParentOPVG, parent) {
1628
+ function ArticleOptionValueData(codex, jsonOPV, catalogOPV, myArticle, isParentOPVG, parent, multiselectOptions) {
1648
1629
  _classCallCheck(this, ArticleOptionValueData);
1649
1630
  _defineProperty(this, "opv", void 0);
1650
1631
  this.opv = {
@@ -1680,7 +1661,7 @@ var ArticleOptionValueData = /*#__PURE__*/function () {
1680
1661
  var mySubArticleReplaceMainArticleNr;
1681
1662
  //Auf Preisliste von PriceArticleCodex zugreifen
1682
1663
  if (this.opv.rul) {
1683
- this.opv.rul = DivaUtils.getRuleByFormula(this.opv.rul);
1664
+ this.opv.rul = DivaUtils.getRuleByFormula(this.opv.rul, myArticle.catalogCodex, multiselectOptions);
1684
1665
  }
1685
1666
  if (myArticle.arePricesLoaded) {
1686
1667
  var articlePrices = myArticle.articlePrices;
@@ -16022,7 +16003,7 @@ var OptionValueCatalogData = /*#__PURE__*/function () {
16022
16003
  this.opv.images.push({
16023
16004
  fileName: image.FileName,
16024
16005
  functiontype: image.Functiontype,
16025
- jsFormula: image.JsFormula ? DivaUtils.getRuleByFormula(image.JsFormula, catalog.catalogCodex) : '',
16006
+ jsFormula: image.JsFormula ? DivaUtils.getRuleByFormula(image.JsFormula, catalog.catalogCodex, catalog.multiselectOptions) : '',
16026
16007
  name: image.Name,
16027
16008
  replaceMainImage: image.ReplaceMainImage
16028
16009
  });
@@ -16353,7 +16334,7 @@ var OptionValueCatalogData = /*#__PURE__*/function () {
16353
16334
  }]);
16354
16335
  }();
16355
16336
 
16356
- var LOG$f = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
16337
+ var LOG$g = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
16357
16338
  //kaufmännischer Artikel
16358
16339
  var CatalogArticleData = /*#__PURE__*/function () {
16359
16340
  function CatalogArticleData(jsonArticle, catalogData) {
@@ -16650,6 +16631,16 @@ var CatalogArticleData = /*#__PURE__*/function () {
16650
16631
  get: function get() {
16651
16632
  return this.catalogArticle.partListArticles;
16652
16633
  }
16634
+ }, {
16635
+ key: "getPartlistRuleOfArticleCodes",
16636
+ value: function getPartlistRuleOfArticleCodes(articleCodex) {
16637
+ var _this$partlistArticle;
16638
+ return (_this$partlistArticle = this.partlistArticlesRules) === null || _this$partlistArticle === void 0 || (_this$partlistArticle = _this$partlistArticle[0].PartListPos) === null || _this$partlistArticle === void 0 ? void 0 : _this$partlistArticle.find(function (p) {
16639
+ return p.ItemRefArticles.find(function (a) {
16640
+ return a.ArticleCodex === articleCodex;
16641
+ });
16642
+ });
16643
+ }
16653
16644
  }, {
16654
16645
  key: "groupedPartlists",
16655
16646
  get: function get() {
@@ -17054,7 +17045,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
17054
17045
  }
17055
17046
  if (json.Decisions && json.Decisions.length > 0) {
17056
17047
  this.catalogArticle.decisions = json.Decisions;
17057
- this.initDecisions();
17048
+ this.initDecisions(catalog);
17058
17049
  }
17059
17050
  if (json.TemplateCodex) {
17060
17051
  this.catalogArticle.templateCodex = json.TemplateCodex;
@@ -17074,7 +17065,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
17074
17065
  if (json.ShowroomImages) {
17075
17066
  for (var _i = 0; _i < json.ShowroomImages.length; _i++) {
17076
17067
  if (json.ShowroomImages[_i].JsFormula) {
17077
- json.ShowroomImages[_i].JsFormula = DivaUtils.getRuleByFormula(json.ShowroomImages[_i].JsFormula);
17068
+ json.ShowroomImages[_i].JsFormula = DivaUtils.getRuleByFormula(json.ShowroomImages[_i].JsFormula, catalog.catalogCodex, catalog.multiselectOptions);
17078
17069
  }
17079
17070
  }
17080
17071
  this.catalogArticle.showroomImages = json.ShowroomImages;
@@ -17148,6 +17139,12 @@ var CatalogArticleData = /*#__PURE__*/function () {
17148
17139
  }, {
17149
17140
  key: "loadArticleOptions",
17150
17141
  value: function loadArticleOptions(json, set, onlyRunLogic) {
17142
+ var multiselectOptions = json.OPT.filter(function (o) {
17143
+ var _o$OCD;
17144
+ return set.CatalogData.multiselectOptions.includes((_o$OCD = o.OCD) !== null && _o$OCD !== void 0 ? _o$OCD : o.Codex);
17145
+ }).map(function (o) {
17146
+ return o.Codex;
17147
+ });
17151
17148
  if (json.OPT && json.OPT.length != 0) {
17152
17149
  for (var i = 0; i < json.OPT.length; i++) {
17153
17150
  var myOPT = json.OPT[i];
@@ -17172,7 +17169,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
17172
17169
  catOPV = set.CatalogData.getCatalogOptionValueByCodex(tmpOPV.OCD ? tmpOPV.OCD : tmpOPV.Codex, onlyRunLogic);
17173
17170
  if (catOPV) {
17174
17171
  if (!(catOPV !== null && catOPV !== void 0 && catOPV.groupName) && catOPG) catOPV.groupName = catOPG.name;
17175
- var myOPV = new ArticleOptionValueData(tmpOPV.Codex, tmpOPV, catOPV, this, true, newOPG);
17172
+ var myOPV = new ArticleOptionValueData(tmpOPV.Codex, tmpOPV, catOPV, this, true, newOPG, multiselectOptions);
17176
17173
  allOPVsOfOPG[tmpOPV.Codex] = myOPV;
17177
17174
  }
17178
17175
  }
@@ -17185,11 +17182,11 @@ var CatalogArticleData = /*#__PURE__*/function () {
17185
17182
  var _tmpOPG = myOPT.OPV[_j],
17186
17183
  _catOPG = set.CatalogData.getCatalogOptionValueByCodex(_tmpOPG.OCD ? _tmpOPG.OCD : _tmpOPG.Codex, onlyRunLogic);
17187
17184
  if (_catOPG) {
17188
- var _newOPG = new ArticleOptionValueData(_tmpOPG.Codex, _tmpOPG, _catOPG, this, false, newOPT);
17185
+ var _newOPG = new ArticleOptionValueData(_tmpOPG.Codex, _tmpOPG, _catOPG, this, false, newOPT, multiselectOptions);
17189
17186
  allOPVsOfOPT[_tmpOPG.Codex] = _newOPG;
17190
17187
  var _catOPV = set.CatalogData.getCatalogOptionValueByCodex(_tmpOPG.OCD ? _tmpOPG.OCD : _tmpOPG.Codex, onlyRunLogic);
17191
17188
  if (_catOPV) {
17192
- var _myOPV = new ArticleOptionValueData(_tmpOPG.Codex, _tmpOPG, _catOPV, this, true, _newOPG);
17189
+ var _myOPV = new ArticleOptionValueData(_tmpOPG.Codex, _tmpOPG, _catOPV, this, true, _newOPG, multiselectOptions);
17193
17190
  _allOPVsOfOPG[_tmpOPG.Codex] = _myOPV;
17194
17191
  }
17195
17192
  _newOPG.initOPVsInOPG(_allOPVsOfOPG);
@@ -17201,7 +17198,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
17201
17198
  var _tmpOPV = myOPT.OPV[_j2],
17202
17199
  _catOPV2 = set.CatalogData.getCatalogOptionValueByCodex(_tmpOPV.OCD ? _tmpOPV.OCD : _tmpOPV.Codex, onlyRunLogic);
17203
17200
  if (_catOPV2) {
17204
- var _myOPV2 = new ArticleOptionValueData(_tmpOPV.Codex, _tmpOPV, _catOPV2, this, true, newOPT);
17201
+ var _myOPV2 = new ArticleOptionValueData(_tmpOPV.Codex, _tmpOPV, _catOPV2, this, true, newOPT, multiselectOptions);
17205
17202
  allOPVsOfOPT[_tmpOPV.Codex] = _myOPV2;
17206
17203
  }
17207
17204
  }
@@ -17226,7 +17223,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
17226
17223
 
17227
17224
  if (json.Decisions && json.Decisions.length > 0) {
17228
17225
  this.catalogArticle.decisions = JSON.parse(JSON.stringify(json.Decisions));
17229
- this.initDecisions();
17226
+ this.initDecisions(set.CatalogData);
17230
17227
  }
17231
17228
  if (json.PartLists && json.PartLists.length > 0) {
17232
17229
  this.catalogArticle.partListArticles = json.PartLists;
@@ -17243,7 +17240,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
17243
17240
  }, catalog);
17244
17241
  var articleOPG = new ArticleOptionValueData('OPVSUPPLIER_COLORS', {
17245
17242
  RUL: rule
17246
- }, catalogOPG, this, false, newOPT);
17243
+ }, catalogOPG, this, false, newOPT, catalog.multiselectOptions);
17247
17244
  allOPVsOfOPT['OPVSUPPLIER_COLORS'] = articleOPG;
17248
17245
  var supplierColorsOpvs = {};
17249
17246
  for (var i = 0; i < supplierColors.length; i++) {
@@ -17254,17 +17251,17 @@ var CatalogArticleData = /*#__PURE__*/function () {
17254
17251
  HexColor: col.HexColor,
17255
17252
  GroupName: 'Lieferantenfarben'
17256
17253
  }, catalog);
17257
- supplierColorsOpvs['OPV' + col.OptionValueCodex] = new ArticleOptionValueData('OPV' + col.OptionValueCodex, {}, colorCatalogOpv, this, true, articleOPG);
17254
+ supplierColorsOpvs['OPV' + col.OptionValueCodex] = new ArticleOptionValueData('OPV' + col.OptionValueCodex, {}, colorCatalogOpv, this, true, articleOPG, catalog.multiselectOptions);
17258
17255
  }
17259
17256
  articleOPG.initOPVsInOPG(supplierColorsOpvs);
17260
17257
  }
17261
17258
  }, {
17262
17259
  key: "loadPrices",
17263
- value: function loadPrices(json) {
17260
+ value: function loadPrices(json, catalog) {
17264
17261
  var jsonPrice = JSON.parse(JSON.stringify(json));
17265
17262
  if (jsonPrice.Rules) {
17266
17263
  for (var _key3 in jsonPrice.Rules) {
17267
- jsonPrice.Rules[_key3].JsFormula = DivaUtils.getRuleByFormula(jsonPrice.Rules[_key3].JsFormula);
17264
+ jsonPrice.Rules[_key3].JsFormula = DivaUtils.getRuleByFormula(jsonPrice.Rules[_key3].JsFormula, catalog.catalogCodex, catalog.multiselectOptions);
17268
17265
  }
17269
17266
  }
17270
17267
  this.catalogArticle.articlePrices = jsonPrice;
@@ -17272,7 +17269,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
17272
17269
  }
17273
17270
  }, {
17274
17271
  key: "initDecisions",
17275
- value: function initDecisions() {
17272
+ value: function initDecisions(catalog) {
17276
17273
  var myOptOrder = [];
17277
17274
  if (this.catalogArticle.articleOptions) {
17278
17275
  for (var _key4 in this.catalogArticle.articleOptions) {
@@ -17286,7 +17283,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
17286
17283
  for (var j = 0; j < myDecision.DOC.length; j++) {
17287
17284
  //DecisionOptionCombination
17288
17285
  var myDOC = myDecision.DOC[j];
17289
- if (myDOC.JsFormula) myDOC.JsFormula = DivaUtils.getRuleByFormula(myDOC.JsFormula);
17286
+ if (myDOC.JsFormula) myDOC.JsFormula = DivaUtils.getRuleByFormula(myDOC.JsFormula, catalog.catalogCodex, catalog.multiselectOptions);
17290
17287
  if (myDOC.ValidOptionValues) {
17291
17288
  myDOC.ValidOptions = '';
17292
17289
  var a = myDOC.ValidOptionValues.split(',');
@@ -17309,12 +17306,12 @@ var CatalogArticleData = /*#__PURE__*/function () {
17309
17306
  articleCodex: this.articleCodex
17310
17307
  };
17311
17308
  if (myDecision.Type == '0') {
17312
- LOG$f.error(new DivaError(text, {
17309
+ LOG$g.error(new DivaError(text, {
17313
17310
  code: 'WC_0011',
17314
17311
  custom: stack
17315
17312
  }));
17316
17313
  } else {
17317
- LOG$f.warn(text, undefined, stack);
17314
+ LOG$g.warn(text, undefined, stack);
17318
17315
  }
17319
17316
  myDecision.Options.splice(m, 1);
17320
17317
  m--;
@@ -18134,9 +18131,9 @@ var OptionCatalogData = /*#__PURE__*/function () {
18134
18131
  }]);
18135
18132
  }();
18136
18133
 
18137
- function ownKeys$e(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; }
18138
- function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18139
- var LOG$e = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
18134
+ function ownKeys$f(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; }
18135
+ function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18136
+ var LOG$f = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
18140
18137
 
18141
18138
  /*
18142
18139
  Diese KLasse enthält Inforamtion zu einem Catalog (C)
@@ -18975,7 +18972,7 @@ var DivaCatalogData = /*#__PURE__*/function () {
18975
18972
  key: "getCatalogOptionValueByCodex",
18976
18973
  value: function getCatalogOptionValueByCodex(codex, throwError) {
18977
18974
  if (this.optionValues && this.optionValues[codex]) return this.optionValues[codex];
18978
- LOG$e.error(new DivaError('CatalogOptionValue: ' + codex + ' does not exist', {
18975
+ LOG$f.error(new DivaError('CatalogOptionValue: ' + codex + ' does not exist', {
18979
18976
  code: 'WC_0017'
18980
18977
  }));
18981
18978
  if (throwError) {
@@ -19079,7 +19076,7 @@ var DivaCatalogData = /*#__PURE__*/function () {
19079
19076
  if (this.catalogArticles[articleCodex]) {
19080
19077
  return this.catalogArticles[articleCodex];
19081
19078
  } else {
19082
- LOG$e.error(new DivaError('Artikelcodex ' + articleCodex + ' existiert nicht im Katalog ' + this.catalogCodex, {
19079
+ LOG$f.error(new DivaError('Artikelcodex ' + articleCodex + ' existiert nicht im Katalog ' + this.catalogCodex, {
19083
19080
  code: 'WC_0006'
19084
19081
  }));
19085
19082
  if (throwError) {
@@ -19610,6 +19607,16 @@ var DivaCatalogData = /*#__PURE__*/function () {
19610
19607
  get: function get() {
19611
19608
  return this._api;
19612
19609
  }
19610
+ }, {
19611
+ key: "multiselectOptions",
19612
+ get: function get() {
19613
+ var _this$options4;
19614
+ return Object.values((_this$options4 = this.options) !== null && _this$options4 !== void 0 ? _this$options4 : {}).filter(function (o) {
19615
+ return o.isMultiselect;
19616
+ }).map(function (o) {
19617
+ return o.codex;
19618
+ });
19619
+ }
19613
19620
  }, {
19614
19621
  key: "catalogMask",
19615
19622
  get: function get() {
@@ -19676,7 +19683,7 @@ var DivaCatalogData = /*#__PURE__*/function () {
19676
19683
  var mapMask = function mapMask(mask) {
19677
19684
  var _mappedMask$catalog;
19678
19685
  if (!mask) return undefined;
19679
- var mappedMask = _objectSpread$e({}, mask);
19686
+ var mappedMask = _objectSpread$f({}, mask);
19680
19687
  var mapProperties = function mapProperties(props) {
19681
19688
  if (Array.isArray(props)) return props;
19682
19689
  var mappedProps = [];
@@ -19705,7 +19712,7 @@ var mapMask = function mapMask(mask) {
19705
19712
  return mappedMask;
19706
19713
  };
19707
19714
 
19708
- var LOG$d = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
19715
+ var LOG$e = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
19709
19716
  var DivaCatalogHandler = /*#__PURE__*/function () {
19710
19717
  function DivaCatalogHandler() {
19711
19718
  _classCallCheck(this, DivaCatalogHandler);
@@ -19726,7 +19733,7 @@ var DivaCatalogHandler = /*#__PURE__*/function () {
19726
19733
  return _context.abrupt("return", state.divaCatalogs[catalogKey]);
19727
19734
  case 5:
19728
19735
  if (!orderSet) {
19729
- _context.next = 47;
19736
+ _context.next = 53;
19730
19737
  break;
19731
19738
  }
19732
19739
  // ab hier parallell laden
@@ -19758,22 +19765,30 @@ var DivaCatalogHandler = /*#__PURE__*/function () {
19758
19765
  case 23:
19759
19766
  mask = _context.sent;
19760
19767
  case 24:
19768
+ _context.next = 29;
19769
+ break;
19770
+ case 26:
19771
+ _context.prev = 26;
19772
+ _context.t0 = _context["catch"](19);
19773
+ LOG$e.debug('no mask found: ' + _context.t0);
19774
+ case 29:
19775
+ _context.prev = 29;
19761
19776
  if (!(!state.api.dontLoadAdditionalModelInfos && catalogApiData.AccountGuid)) {
19762
- _context.next = 28;
19777
+ _context.next = 34;
19763
19778
  break;
19764
19779
  }
19765
- _context.next = 27;
19780
+ _context.next = 33;
19766
19781
  return state.api.getDataCache(state.api.getAdditionalModelInfosQS(catalogApiData.AccountGuid, catalogApiData.GUID), undefined, undefined, 'catalog');
19767
- case 27:
19782
+ case 33:
19768
19783
  additionalModelInfos = _context.sent;
19769
- case 28:
19770
- _context.next = 33;
19784
+ case 34:
19785
+ _context.next = 39;
19771
19786
  break;
19772
- case 30:
19773
- _context.prev = 30;
19774
- _context.t0 = _context["catch"](19);
19775
- LOG$d.debug('no additionalModelInfos found: ' + _context.t0);
19776
- case 33:
19787
+ case 36:
19788
+ _context.prev = 36;
19789
+ _context.t1 = _context["catch"](29);
19790
+ LOG$e.debug('no additionalModelInfos found: ' + _context.t1);
19791
+ case 39:
19777
19792
  if (state.catalogMask || mask) {
19778
19793
  if (!additionalModelInfos) additionalModelInfos = {
19779
19794
  _id: ''
@@ -19782,19 +19797,19 @@ var DivaCatalogHandler = /*#__PURE__*/function () {
19782
19797
  }
19783
19798
  catalogData = new DivaCatalogData(catalogApiData, orderSet, state.api, additionalModelInfos);
19784
19799
  if (!(catalogArticleListData.Articles && catalogArticleListData.Articles.length > 0)) {
19785
- _context.next = 39;
19800
+ _context.next = 45;
19786
19801
  break;
19787
19802
  }
19788
19803
  catalogData.initCatalogArticles(catalogArticleListData.Articles);
19789
- _context.next = 42;
19804
+ _context.next = 48;
19790
19805
  break;
19791
- case 39:
19806
+ case 45:
19792
19807
  DivaUtils.endSpanOfApm('Catalog initialize');
19793
- LOG$d.error(new DivaError('Catalog ' + catalogData.catalogName + ' not listed', {
19808
+ LOG$e.error(new DivaError('Catalog ' + catalogData.catalogName + ' not listed', {
19794
19809
  code: 'WC_0002'
19795
19810
  }));
19796
19811
  throw new Error('Articles of Catalog: ' + catalogData.catalogCodex + ' are empty');
19797
- case 42:
19812
+ case 48:
19798
19813
  if (catalogArticlePlannerListData.PlannerElements && catalogArticlePlannerListData.PlannerElements.length > 0) {
19799
19814
  catalogData.initCatalogPlannerArticles(catalogArticlePlannerListData.PlannerElements);
19800
19815
  }
@@ -19811,16 +19826,16 @@ var DivaCatalogHandler = /*#__PURE__*/function () {
19811
19826
 
19812
19827
  DivaUtils.endSpanOfApm('Catalog initialize');
19813
19828
  return _context.abrupt("return", state.divaCatalogs[catalogKey]);
19814
- case 47:
19815
- LOG$d.error(new DivaError('Catalog: ' + catalogCodex + ' not initialized! and orderSet not set', {
19829
+ case 53:
19830
+ LOG$e.error(new DivaError('Catalog: ' + catalogCodex + ' not initialized! and orderSet not set', {
19816
19831
  code: 'WC_0007'
19817
19832
  }));
19818
19833
  return _context.abrupt("return", state.divaCatalogs[catalogKey]);
19819
- case 49:
19834
+ case 55:
19820
19835
  case "end":
19821
19836
  return _context.stop();
19822
19837
  }
19823
- }, _callee, null, [[19, 30]]);
19838
+ }, _callee, null, [[19, 26], [29, 36]]);
19824
19839
  }));
19825
19840
  function getCatalogData(_x, _x2, _x3) {
19826
19841
  return _getCatalogData.apply(this, arguments);
@@ -19962,6 +19977,14 @@ var ArticleOptionStateData = /*#__PURE__*/function () {
19962
19977
  get: function get() {
19963
19978
  return this.val ? this.val.codex : undefined;
19964
19979
  }
19980
+ }, {
19981
+ key: "multiselectValCodex",
19982
+ get: function get() {
19983
+ var _this$multiSelects$ma, _this$multiSelects2;
19984
+ return (_this$multiSelects$ma = (_this$multiSelects2 = this.multiSelects) === null || _this$multiSelects2 === void 0 ? void 0 : _this$multiSelects2.map(function (v) {
19985
+ return v.codex;
19986
+ })) !== null && _this$multiSelects$ma !== void 0 ? _this$multiSelects$ma : [];
19987
+ }
19965
19988
  }, {
19966
19989
  key: "measureValue",
19967
19990
  get: function get() {
@@ -20435,12 +20458,12 @@ var ArticleOptionStateData = /*#__PURE__*/function () {
20435
20458
  }, {
20436
20459
  key: "getSelectedVals",
20437
20460
  get: function get() {
20438
- var _this$multiSelects2;
20439
- if (this.isMultiselect && (_this$multiSelects2 = this.multiSelects) !== null && _this$multiSelects2 !== void 0 && _this$multiSelects2.length) {
20440
- var _this$multiSelects$ma, _this$multiSelects3;
20441
- return (_this$multiSelects$ma = (_this$multiSelects3 = this.multiSelects) === null || _this$multiSelects3 === void 0 ? void 0 : _this$multiSelects3.map(function (m) {
20461
+ var _this$multiSelects3;
20462
+ if (this.isMultiselect && (_this$multiSelects3 = this.multiSelects) !== null && _this$multiSelects3 !== void 0 && _this$multiSelects3.length) {
20463
+ var _this$multiSelects$ma2, _this$multiSelects4;
20464
+ return (_this$multiSelects$ma2 = (_this$multiSelects4 = this.multiSelects) === null || _this$multiSelects4 === void 0 ? void 0 : _this$multiSelects4.map(function (m) {
20442
20465
  return m.codex;
20443
- })) !== null && _this$multiSelects$ma !== void 0 ? _this$multiSelects$ma : [];
20466
+ })) !== null && _this$multiSelects$ma2 !== void 0 ? _this$multiSelects$ma2 : [];
20444
20467
  }
20445
20468
  if (this.val) {
20446
20469
  return [this.val.codex];
@@ -20458,9 +20481,9 @@ var ArticleOptionStateData = /*#__PURE__*/function () {
20458
20481
  }]);
20459
20482
  }();
20460
20483
 
20461
- function ownKeys$d(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; }
20462
- function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20463
- var LOG$c = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
20484
+ function ownKeys$e(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; }
20485
+ function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20486
+ var LOG$d = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
20464
20487
  var DivaArticle = /*#__PURE__*/function () {
20465
20488
  //Hier steht die aktuelle Konfiguration
20466
20489
 
@@ -20673,7 +20696,7 @@ var DivaArticle = /*#__PURE__*/function () {
20673
20696
  var partlistArticle = this.partlistArticles[basketId];
20674
20697
  if (!onlyVisible || partlistArticle.partlistArticleVisibleInTree) partlistArticles[basketId] = partlistArticle;
20675
20698
  if (partlistArticle.hasPartlistArticle) {
20676
- partlistArticles = _objectSpread$d(_objectSpread$d({}, partlistArticles), partlistArticle.getRecursivePartlistArticles(onlyVisible));
20699
+ partlistArticles = _objectSpread$e(_objectSpread$e({}, partlistArticles), partlistArticle.getRecursivePartlistArticles(onlyVisible));
20677
20700
  }
20678
20701
  }
20679
20702
  return partlistArticles;
@@ -20704,10 +20727,20 @@ var DivaArticle = /*#__PURE__*/function () {
20704
20727
  }
20705
20728
  }
20706
20729
  if (Object.entries(partlistArticles).length && !this.CatalogData.bundleRules) {
20707
- LOG$c.error(new DivaError('sorting partlistarticles Failed', {
20730
+ LOG$d.error(new DivaError('sorting partlistarticles Failed', {
20708
20731
  custom: {
20709
- partlistArticles: partlistArticles,
20710
- partlistArticlesToLoad: partlistArticlesToLoad
20732
+ partlistArticles: Object.values(partlistArticles).map(function (p) {
20733
+ return {
20734
+ BasketId: p.basketId,
20735
+ ArticleCodex: p.articleCodex
20736
+ };
20737
+ }),
20738
+ partlistArticlesToLoad: partlistArticlesToLoad.map(function (p) {
20739
+ return {
20740
+ BasketId: p.ArticleCodex,
20741
+ ArticleCodex: p.ArticleCodex
20742
+ };
20743
+ })
20711
20744
  }
20712
20745
  }));
20713
20746
  }
@@ -20730,14 +20763,6 @@ var DivaArticle = /*#__PURE__*/function () {
20730
20763
  set: function set(posNr) {
20731
20764
  this.article.posNr = posNr;
20732
20765
  }
20733
- }, {
20734
- key: "curProduct",
20735
- get: function get() {
20736
- return this.article.curProduct;
20737
- },
20738
- set: function set(product) {
20739
- this.article.curProduct = product;
20740
- }
20741
20766
  }, {
20742
20767
  key: "isDockable",
20743
20768
  get: function get() {
@@ -20805,18 +20830,25 @@ var DivaArticle = /*#__PURE__*/function () {
20805
20830
  var bruttoPercentage = this.set.getBruttoPercentage(true);
20806
20831
  var price = this.bruttoPrice;
20807
20832
  if (bruttoPercentage) price = price - price * (bruttoPercentage / 100);
20808
- var discountPercentage = this.set.getCurrentDisountPercentage();
20833
+ var discountPercentage = this.getCurrentDisountPercentage();
20809
20834
  if (discountPercentage) {
20810
20835
  price = price - price * (discountPercentage / 100);
20811
20836
  }
20812
20837
  return price;
20813
20838
  }
20839
+ }, {
20840
+ key: "discountPercentage",
20841
+ get: function get() {
20842
+ return this.article.discountPercentage;
20843
+ },
20844
+ set: function set(val) {
20845
+ this.article.discountPercentage = val;
20846
+ }
20814
20847
  }, {
20815
20848
  key: "bruttoPrice",
20816
20849
  get: function get() {
20817
20850
  if (this.noPrice) return 0;
20818
20851
  var price = this.article.price;
20819
- if (this.curProduct) return this.curProduct.price;
20820
20852
  if (this.hasPartlistArticle) {
20821
20853
  var partlistPrice = 0;
20822
20854
  for (var key in this.partlistArticles) {
@@ -20832,7 +20864,7 @@ var DivaArticle = /*#__PURE__*/function () {
20832
20864
  }, {
20833
20865
  key: "mainPrice",
20834
20866
  get: function get() {
20835
- var discountPercentage = this.set.getCurrentDisountPercentage();
20867
+ var discountPercentage = this.getCurrentDisountPercentage();
20836
20868
  if (discountPercentage) {
20837
20869
  return DivaUtils.roundPrice(this.article.price - this.article.price * (discountPercentage / 100), 1, 2);
20838
20870
  }
@@ -20841,7 +20873,7 @@ var DivaArticle = /*#__PURE__*/function () {
20841
20873
  }, {
20842
20874
  key: "calcPrice",
20843
20875
  value: function calcPrice(dontCalcDiscount) {
20844
- var discountPercentage = this.set.getCurrentDisountPercentage();
20876
+ var discountPercentage = this.getCurrentDisountPercentage();
20845
20877
  return DivaUtils.roundPrice((dontCalcDiscount ? this.bruttoPrice : this.price) * this.quantity, !!discountPercentage ? 1 : this.CatalogData.rounding, !!discountPercentage ? 2 : this.CatalogData.digits);
20846
20878
  }
20847
20879
  }, {
@@ -20921,12 +20953,12 @@ var DivaArticle = /*#__PURE__*/function () {
20921
20953
  }, {
20922
20954
  key: "discounts",
20923
20955
  get: function get() {
20924
- var _this$set$getCurrentD;
20925
- if (!this.set.getCurrentDisountPercentage()) return undefined;
20956
+ var _this$getCurrentDisou;
20957
+ if (!this.getCurrentDisountPercentage()) return undefined;
20926
20958
  var diff = this.bruttoPrice - this.price;
20927
20959
  return [{
20928
20960
  isPercentage: true,
20929
- percentageDiscount: (_this$set$getCurrentD = this.set.getCurrentDisountPercentage()) !== null && _this$set$getCurrentD !== void 0 ? _this$set$getCurrentD : 0,
20961
+ percentageDiscount: (_this$getCurrentDisou = this.getCurrentDisountPercentage()) !== null && _this$getCurrentDisou !== void 0 ? _this$getCurrentDisou : 0,
20930
20962
  fixDiscount: DivaUtils.roundPrice(diff, this.CatalogData.rounding, this.CatalogData.digits),
20931
20963
  fixDiscountFormatted: DivaUtils.formatPrice(diff)
20932
20964
  }];
@@ -20936,13 +20968,32 @@ var DivaArticle = /*#__PURE__*/function () {
20936
20968
  get: function get() {
20937
20969
  return this.article.priceRefs;
20938
20970
  }
20971
+ }, {
20972
+ key: "getCurrentDisountPercentage",
20973
+ value: function getCurrentDisountPercentage() {
20974
+ if (this.discountPercentage) return this.discountPercentage;
20975
+ return this.set.getCurrentDisountPercentage();
20976
+ }
20977
+ }, {
20978
+ key: "getArticleOptionStatesWithOptionsForPrint",
20979
+ value: function getArticleOptionStatesWithOptionsForPrint() {
20980
+ var opsObj = _objectSpread$e({}, this.articleOptionStates);
20981
+ if (this.article.optionsForPrint) {
20982
+ for (var i = 0; i < this.article.optionsForPrint.length; i++) {
20983
+ var ops = this.getArticleOptionState(this.article.optionsForPrint[i]);
20984
+ if (ops) opsObj[ops.optionCodex] = ops;
20985
+ }
20986
+ }
20987
+ return opsObj;
20988
+ }
20939
20989
  }, {
20940
20990
  key: "articleVariantDesc",
20941
20991
  value: function articleVariantDesc() {
20942
20992
  var newLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ', ';
20993
+ var articleOptions = this.getArticleOptionStatesWithOptionsForPrint();
20943
20994
  var ret = '';
20944
- for (var key in this.articleOptionStates) {
20945
- var myOPS = this.articleOptionStates[key];
20995
+ for (var key in articleOptions) {
20996
+ var myOPS = articleOptions[key];
20946
20997
  if (!myOPS.isInvisible && myOPS.selectionmode != 0 && myOPS.isDoShow && (myOPS.visibleCount > 1 || myOPS.option.forceShowVariantDesc)) {
20947
20998
  if (ret != '') ret += newLine;
20948
20999
  if (myOPS.valCodex) {
@@ -21134,13 +21185,13 @@ var DivaArticle = /*#__PURE__*/function () {
21134
21185
  }, {
21135
21186
  key: "articleOptionStatesWithParents",
21136
21187
  get: function get() {
21137
- return _objectSpread$d(_objectSpread$d({}, this.getReqursiveArticleOptionStates()), this.articleOptionStatesData);
21188
+ return _objectSpread$e(_objectSpread$e({}, this.getReqursiveArticleOptionStates()), this.articleOptionStatesData);
21138
21189
  }
21139
21190
  }, {
21140
21191
  key: "getReqursiveArticleOptionStates",
21141
21192
  value: function getReqursiveArticleOptionStates() {
21142
21193
  var _this$partListParentA6, _this$partListParentA7, _this$partListParentA8, _this$partListParentA9, _this$accessoireParen3, _this$accessoireParen4, _this$accessoireParen5, _this$accessoireParen6;
21143
- return _objectSpread$d(_objectSpread$d(_objectSpread$d(_objectSpread$d({}, (_this$partListParentA6 = (_this$partListParentA7 = this.partListParentArticle) === null || _this$partListParentA7 === void 0 ? void 0 : _this$partListParentA7.articleOptionStatesData) !== null && _this$partListParentA6 !== void 0 ? _this$partListParentA6 : {}), (_this$partListParentA8 = (_this$partListParentA9 = this.partListParentArticle) === null || _this$partListParentA9 === void 0 ? void 0 : _this$partListParentA9.getReqursiveArticleOptionStates()) !== null && _this$partListParentA8 !== void 0 ? _this$partListParentA8 : {}), (_this$accessoireParen3 = (_this$accessoireParen4 = this.accessoireParentArticle) === null || _this$accessoireParen4 === void 0 ? void 0 : _this$accessoireParen4.articleOptionStatesData) !== null && _this$accessoireParen3 !== void 0 ? _this$accessoireParen3 : {}), (_this$accessoireParen5 = (_this$accessoireParen6 = this.accessoireParentArticle) === null || _this$accessoireParen6 === void 0 ? void 0 : _this$accessoireParen6.getReqursiveArticleOptionStates()) !== null && _this$accessoireParen5 !== void 0 ? _this$accessoireParen5 : {});
21194
+ return _objectSpread$e(_objectSpread$e(_objectSpread$e(_objectSpread$e({}, (_this$partListParentA6 = (_this$partListParentA7 = this.partListParentArticle) === null || _this$partListParentA7 === void 0 ? void 0 : _this$partListParentA7.articleOptionStatesData) !== null && _this$partListParentA6 !== void 0 ? _this$partListParentA6 : {}), (_this$partListParentA8 = (_this$partListParentA9 = this.partListParentArticle) === null || _this$partListParentA9 === void 0 ? void 0 : _this$partListParentA9.getReqursiveArticleOptionStates()) !== null && _this$partListParentA8 !== void 0 ? _this$partListParentA8 : {}), (_this$accessoireParen3 = (_this$accessoireParen4 = this.accessoireParentArticle) === null || _this$accessoireParen4 === void 0 ? void 0 : _this$accessoireParen4.articleOptionStatesData) !== null && _this$accessoireParen3 !== void 0 ? _this$accessoireParen3 : {}), (_this$accessoireParen5 = (_this$accessoireParen6 = this.accessoireParentArticle) === null || _this$accessoireParen6 === void 0 ? void 0 : _this$accessoireParen6.getReqursiveArticleOptionStates()) !== null && _this$accessoireParen5 !== void 0 ? _this$accessoireParen5 : {});
21144
21195
  }
21145
21196
  }, {
21146
21197
  key: "clearArticleOptionStates",
@@ -21851,13 +21902,14 @@ var DivaArticle = /*#__PURE__*/function () {
21851
21902
  key: "articleProductHash",
21852
21903
  get: function get() {
21853
21904
  var hash = this.catalogCodex + '_' + this.articleCodex + '_' + this.quantity + '_';
21905
+ var variantValues = [];
21854
21906
  for (var key in this.articleOptionStates) {
21855
21907
  var myArtOption = this.articleOptionStates[key];
21856
21908
  if (myArtOption.isDoShow && (!(myArtOption.idmVariantenArt == 95 || myArtOption.idmVariantenArt == 96 || myArtOption.idmVariantenArt == 97) || myArtOption.isVisibleFreeText) && myArtOption.val && myArtOption.visibleCount > 0 && !myArtOption.isDescribingState) {
21857
- hash = hash + myArtOption.optionCodex.substring(3) + '_' + myArtOption.val.codex.substring(3) + (myArtOption.measureUnit && myArtOption.freeText !== undefined ? '_' + myArtOption.freeText : '') + (!myArtOption.measureUnit && myArtOption.isFreeText ? '_' + myArtOption.isFreeText : '');
21909
+ variantValues.push(myArtOption.optionCodex.substring(3) + '_' + myArtOption.val.codex.substring(3) + (myArtOption.freeText ? '_' + myArtOption.freeText : myArtOption.measureValue ? '_' + myArtOption.measureValue : ''));
21858
21910
  }
21859
21911
  }
21860
- return md5(hash);
21912
+ return md5(hash + variantValues.join());
21861
21913
  }
21862
21914
  }, {
21863
21915
  key: "VariantValuesWithoutOPTandOPV",
@@ -22669,7 +22721,7 @@ var DivaArticle = /*#__PURE__*/function () {
22669
22721
  this.article.doUpdatePlannerSize = true;
22670
22722
  this.calcHeight = Math.round((newHeight + Number.EPSILON) * 100) / 100;
22671
22723
  } catch (e) {
22672
- LOG$c.warn('Invalid Planungdepth - IDMVariantenArt 97: ' + myArtOPS.option.name + ' ' + myArtOPS.valName, e);
22724
+ LOG$d.warn('Invalid Planungdepth - IDMVariantenArt 97: ' + myArtOPS.option.name + ' ' + myArtOPS.valName, e);
22673
22725
  }
22674
22726
  }
22675
22727
  //beim article abspeichern. Das Planungselement kann es sich per Funktion von dort dann holen
@@ -22681,7 +22733,7 @@ var DivaArticle = /*#__PURE__*/function () {
22681
22733
  this.article.doUpdatePlannerSize = true;
22682
22734
  this.calcDepth = Math.round((newDepth + Number.EPSILON) * 100) / 100;
22683
22735
  } catch (e) {
22684
- LOG$c.warn('Invalid Planungdepth - IDMVariantenArt 96: ' + myArtOPS.option.name + ' ' + myArtOPS.valName, e);
22736
+ LOG$d.warn('Invalid Planungdepth - IDMVariantenArt 96: ' + myArtOPS.option.name + ' ' + myArtOPS.valName, e);
22685
22737
  }
22686
22738
  }
22687
22739
  //beim article abspeichern. Das Planungselement kann es sich per Funktion von dort dann holen
@@ -22694,7 +22746,7 @@ var DivaArticle = /*#__PURE__*/function () {
22694
22746
  this.article.doUpdatePlannerSize = true;
22695
22747
  this.calcWidth = Math.round((newWidth + Number.EPSILON) * 100) / 100;
22696
22748
  } catch (e) {
22697
- LOG$c.warn('Invalid Planungdepth - IDMVariantenArt 95: ' + myArtOPS.option.name + ' ' + myArtOPS.valName, e);
22749
+ LOG$d.warn('Invalid Planungdepth - IDMVariantenArt 95: ' + myArtOPS.option.name + ' ' + myArtOPS.valName, e);
22698
22750
  }
22699
22751
  }
22700
22752
  }
@@ -22729,7 +22781,7 @@ var DivaArticle = /*#__PURE__*/function () {
22729
22781
  var myOptionStates = this.articleOptionStates;
22730
22782
  var myArtOPS = myOptionStates[OptionCodex];
22731
22783
  if (!myArtOPS) {
22732
- LOG$c.error(new DivaError('OptionCodex: ' + OptionCodex + ' in articleCodex: ' + this.articleCodex + ' not found!'));
22784
+ LOG$d.error(new DivaError('OptionCodex: ' + OptionCodex + ' in articleCodex: ' + this.articleCodex + ' not found!'));
22733
22785
  return;
22734
22786
  }
22735
22787
  myArtOPS.val = myOPVItem; //akteull OPV wird gesetzt
@@ -22849,10 +22901,10 @@ var DivaArticle = /*#__PURE__*/function () {
22849
22901
  }
22850
22902
  }
22851
22903
  if (decisions.length === 0) {
22852
- LOG$c.log('partlistarticle loaded for haveing 0 decisions: ', myPartListPos.ItemRefArticles);
22904
+ LOG$d.log('partlistarticle loaded for haveing 0 decisions: ', myPartListPos.ItemRefArticles);
22853
22905
  partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, newConfigValues);
22854
22906
  } else if (!partlistAdded && this.CatalogData.useDecisionPosCountValue && myPartListPos.PosCountValue > 0) {
22855
- LOG$c.log('partlistarticle loaded for having default PosCountValue ', myPartListPos.ItemRefArticles);
22907
+ LOG$d.log('partlistarticle loaded for having default PosCountValue ', myPartListPos.ItemRefArticles);
22856
22908
  partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, newConfigValues);
22857
22909
  }
22858
22910
  }
@@ -22926,13 +22978,13 @@ var DivaArticle = /*#__PURE__*/function () {
22926
22978
  RuleDesc: myRuleDesc,
22927
22979
  RuleDesc_locales: myRuleDesc_locales,
22928
22980
  PosInvisibility: myPartListPos.PosInvisibility,
22929
- VariantValues: _objectSpread$d(_objectSpread$d({}, (_previousPartlistArti = previousPartlistArticle === null || previousPartlistArticle === void 0 ? void 0 : previousPartlistArticle.VariantValues) !== null && _previousPartlistArti !== void 0 ? _previousPartlistArti : {}), newConfigValues !== null && newConfigValues !== void 0 ? newConfigValues : {}),
22981
+ VariantValues: _objectSpread$e(_objectSpread$e({}, (_previousPartlistArti = previousPartlistArticle === null || previousPartlistArticle === void 0 ? void 0 : previousPartlistArticle.VariantValues) !== null && _previousPartlistArti !== void 0 ? _previousPartlistArti : {}), newConfigValues !== null && newConfigValues !== void 0 ? newConfigValues : {}),
22930
22982
  VariantItemData: previousPartlistArticle === null || previousPartlistArticle === void 0 ? void 0 : previousPartlistArticle.VariantItemData,
22931
22983
  optionImgForPrint: optionImgForPrint,
22932
22984
  optionsForPrint: optionsForPrint
22933
22985
  });
22934
22986
  } else {
22935
- LOG$c.debug('not loading partlistarticle: ' + articleCodex + ' cause quantity is zero');
22987
+ LOG$d.debug('not loading partlistarticle: ' + articleCodex + ' cause quantity is zero');
22936
22988
  }
22937
22989
  }
22938
22990
  return partlistArticlesToLoad;
@@ -22961,7 +23013,7 @@ var DivaArticle = /*#__PURE__*/function () {
22961
23013
  }
22962
23014
  }
22963
23015
  } else {
22964
- LOG$c.error(new DivaError('For article: ' + this.articleCodex + ' name: ' + this.name + ' decisionNr: ' + DecisionNumber + ' was not found as DecisionType 3'));
23016
+ LOG$d.error(new DivaError('For article: ' + this.articleCodex + ' name: ' + this.name + ' decisionNr: ' + DecisionNumber + ' was not found as DecisionType 3'));
22965
23017
  }
22966
23018
  }
22967
23019
  return {
@@ -23002,7 +23054,7 @@ var DivaArticle = /*#__PURE__*/function () {
23002
23054
  }
23003
23055
  for (var key in this.articleOptionStates) {
23004
23056
  var myOPS = this.articleOptionStates[key];
23005
- myOPS.visibleOptionValues = _objectSpread$d({}, myOPS.option.articleOptionValues);
23057
+ myOPS.visibleOptionValues = _objectSpread$e({}, myOPS.option.articleOptionValues);
23006
23058
  myOPS.visibleCount = Object.keys(myOPS.option.articleOptionValues).length;
23007
23059
  myOPS.definedBySetFeatureFixed = false;
23008
23060
  }
@@ -23145,7 +23197,7 @@ var DivaArticle = /*#__PURE__*/function () {
23145
23197
  }
23146
23198
  break;
23147
23199
  default:
23148
- LOG$c.error(new DivaError('Action type not supported in DecisionOptionCombination', {
23200
+ LOG$d.error(new DivaError('Action type not supported in DecisionOptionCombination', {
23149
23201
  code: 'WC_0011',
23150
23202
  custom: {
23151
23203
  actionType: myDA.Type,
@@ -23233,7 +23285,7 @@ var DivaArticle = /*#__PURE__*/function () {
23233
23285
  }
23234
23286
  if (ruleValid) {
23235
23287
  ruleWasValidOnce = true;
23236
- if (m == 0) validOPVs[OPT] = _objectSpread$d({}, possibleOPVs);
23288
+ if (m == 0) validOPVs[OPT] = _objectSpread$e({}, possibleOPVs);
23237
23289
  opvCodex = opvCodex.slice(1);
23238
23290
  if (possibleOPVs[opvCodex] != null) delete validOPVs[OPT][opvCodex];
23239
23291
  }
@@ -23445,7 +23497,7 @@ var DivaArticle = /*#__PURE__*/function () {
23445
23497
  case 'ENABLE_DECISION':
23446
23498
  break;
23447
23499
  default:
23448
- LOG$c.error(new DivaError('Action type not supported in DecisionOptionCombination', {
23500
+ LOG$d.error(new DivaError('Action type not supported in DecisionOptionCombination', {
23449
23501
  code: 'WC_0011',
23450
23502
  custom: {
23451
23503
  actionType: myDA.Type,
@@ -23629,7 +23681,7 @@ var DivaArticle = /*#__PURE__*/function () {
23629
23681
  break;
23630
23682
  }
23631
23683
  _context.next = 4;
23632
- return import('./ShelfPlanner-ab85b5ea.js');
23684
+ return import('./ShelfPlanner-a08089d2.js');
23633
23685
  case 4:
23634
23686
  _yield$import = _context.sent;
23635
23687
  ShelfPlanner = _yield$import["default"];
@@ -23990,7 +24042,7 @@ var DivaArticle = /*#__PURE__*/function () {
23990
24042
  this.article.priceRefs.push(newPriceRef);
23991
24043
  }
23992
24044
  } else {
23993
- LOG$c.error(new DivaError('getPriceRefs - RuleID not defined', {
24045
+ LOG$d.error(new DivaError('getPriceRefs - RuleID not defined', {
23994
24046
  code: 'WC_0011',
23995
24047
  custom: {
23996
24048
  myRuleID: myRuleID
@@ -24130,7 +24182,9 @@ var DivaArticle = /*#__PURE__*/function () {
24130
24182
  }, {
24131
24183
  key: "updateArticleSVG",
24132
24184
  value: function updateArticleSVG() {
24133
- var _this$article$catalog2, _this$article$catalog3;
24185
+ var _this$article$catalog2,
24186
+ _this$article$catalog3,
24187
+ _this4 = this;
24134
24188
  var newSVGFile = null;
24135
24189
  var svgChangedViaSvgTausch = false;
24136
24190
  if (!this.hasCatalogPlannerArticle || ((_this$article$catalog2 = this.article.catalogArticle.catalogPlannerArticle) === null || _this$article$catalog2 === void 0 ? void 0 : _this$article$catalog2.topSvg) == undefined && ((_this$article$catalog3 = this.article.catalogArticle.catalogPlannerArticle) === null || _this$article$catalog3 === void 0 ? void 0 : _this$article$catalog3.topSvgsWithFormula) == undefined) {
@@ -24150,7 +24204,7 @@ var DivaArticle = /*#__PURE__*/function () {
24150
24204
  var svgsWithFormula = plannerCatArt.topSvgsWithFormula;
24151
24205
  for (var i = 0; i < svgsWithFormula.length; i++) {
24152
24206
  var mySVG = svgsWithFormula[i],
24153
- myRule = DivaUtils.getRuleByFormula(mySVG.JsFormula);
24207
+ myRule = DivaUtils.getRuleByFormula(mySVG.JsFormula, this.catalogCodex, this.CatalogData.multiselectOptions);
24154
24208
  if (this.evalRule(myRule, '')) {
24155
24209
  newSVGFile = mySVG.SVG;
24156
24210
  svgChangedViaSvgTausch = true;
@@ -24162,7 +24216,7 @@ var DivaArticle = /*#__PURE__*/function () {
24162
24216
  this.actPlannerData.countAVS = mySVG.AVS;
24163
24217
  this.actPlannerData.hasAVL = mySVG.HasAVL;
24164
24218
  this.actPlannerData.hasAVR = mySVG.HasAVR;
24165
- LOG$c.debug('new SVG by SVG tausch', {
24219
+ LOG$d.debug('new SVG by SVG tausch', {
24166
24220
  svg: mySVG.SVG,
24167
24221
  rule: myRule,
24168
24222
  layer: mySVG.Layer,
@@ -24187,11 +24241,11 @@ var DivaArticle = /*#__PURE__*/function () {
24187
24241
  }
24188
24242
  if (!newSVGFile) {
24189
24243
  var _plannerCatArt$topSvg;
24190
- LOG$c.error(new DivaError('No SVG found for current configuration', {
24244
+ LOG$d.error(new DivaError('No SVG found for current configuration', {
24191
24245
  code: 'WC_0011',
24192
24246
  custom: {
24193
24247
  formulas: (_plannerCatArt$topSvg = plannerCatArt.topSvgsWithFormula) === null || _plannerCatArt$topSvg === void 0 ? void 0 : _plannerCatArt$topSvg.map(function (item) {
24194
- return DivaUtils.getRuleByFormula(item.JsFormula);
24248
+ return DivaUtils.getRuleByFormula(item.JsFormula, _this4.catalogCodex, _this4.CatalogData.multiselectOptions);
24195
24249
  }),
24196
24250
  catalogName: this.CatalogData.catalogName,
24197
24251
  catalogCodex: this.catalogCodex,
@@ -24347,8 +24401,7 @@ var DivaArticle = /*#__PURE__*/function () {
24347
24401
  isActive: isActive,
24348
24402
  basketId: this.article.basketId,
24349
24403
  posNr: this.posNr,
24350
- elementId: this.article.elementId,
24351
- product: this.curProduct
24404
+ elementId: this.article.elementId
24352
24405
  };
24353
24406
  return ret;
24354
24407
  }
@@ -24368,15 +24421,9 @@ var DivaArticle = /*#__PURE__*/function () {
24368
24421
  key: "getVariantBasketData",
24369
24422
  value: function getVariantBasketData() {
24370
24423
  var variantBasketData = [];
24371
- var opsObj = _objectSpread$d({}, this.articleOptionStates);
24372
- if (this.article.optionsForPrint) {
24373
- for (var i = 0; i < this.article.optionsForPrint.length; i++) {
24374
- var ops = this.getArticleOptionState(this.article.optionsForPrint[i]);
24375
- if (ops) opsObj[ops.optionCodex] = ops;
24376
- }
24377
- }
24378
- for (var key in opsObj) {
24379
- var myArtOption = opsObj[key];
24424
+ var articleOptions = this.getArticleOptionStatesWithOptionsForPrint();
24425
+ for (var key in articleOptions) {
24426
+ var myArtOption = articleOptions[key];
24380
24427
  var OP = myArtOption.optionCodex;
24381
24428
  if (myArtOption) {
24382
24429
  var doHideSizeOption = myArtOption.idmVariantenArt == 95 || myArtOption.idmVariantenArt == 96 || myArtOption.idmVariantenArt == 97;
@@ -24554,9 +24601,9 @@ var DivaArticle = /*#__PURE__*/function () {
24554
24601
  }]);
24555
24602
  }();
24556
24603
 
24557
- function ownKeys$c(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; }
24558
- function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24559
- var LOG$b = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
24604
+ function ownKeys$d(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; }
24605
+ function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24606
+ var LOG$c = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
24560
24607
 
24561
24608
  //Diese Klasse verwaltet den Optionsbaum und ladelogik etc. eines Artikels
24562
24609
  //Diese Klasse beinhaltet alle Artikel eines Sets
@@ -24587,7 +24634,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
24587
24634
  return _context.abrupt("return", new DivaArticle(set, newBasketId, initParams, catalogArticle, catalog));
24588
24635
  case 10:
24589
24636
  //articleCodex does not exist anymore in catalog
24590
- LOG$b.error(new DivaError('articleCodex not found in article list. Could be due to exclusivity or a bug in the application!', {
24637
+ LOG$c.error(new DivaError('articleCodex not found in article list. Could be due to exclusivity or a bug in the application!', {
24591
24638
  code: 'WC_0011',
24592
24639
  custom: {
24593
24640
  articleCodex: articleCodex
@@ -24698,7 +24745,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
24698
24745
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
24699
24746
  jsonPrices = _yield$Promise$all2[0];
24700
24747
  jsonOption = _yield$Promise$all2[1];
24701
- catalogArticle.loadPrices(jsonPrices);
24748
+ catalogArticle.loadPrices(jsonPrices, set.CatalogData);
24702
24749
  catalogArticle.loadArticleOptions(jsonOption, set, set.onlyRunLogic);
24703
24750
  case 17:
24704
24751
  catalogArticle.areOptionsLoaded = true;
@@ -24812,7 +24859,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
24812
24859
  return _context6.abrupt("continue", 37);
24813
24860
  case 11:
24814
24861
  if (targetArticlesWithNewValues.includes(targetArticlesToUpdate[i])) {
24815
- valuesArray[i] = actArticle.getValidValues(_objectSpread$c({}, myValues), actArticle.CatalogData.mergeOptionsToSameOption);
24862
+ valuesArray[i] = actArticle.getValidValues(_objectSpread$d({}, myValues), actArticle.CatalogData.mergeOptionsToSameOption);
24816
24863
  }
24817
24864
  if (!(Object.entries(valuesArray[i]).length > 0 || from !== null && from !== void 0 && from.startsWith('initializing'))) {
24818
24865
  _context6.next = 32;
@@ -25451,7 +25498,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25451
25498
  }
25452
25499
  doLoadItem.BasketID = nArticle.basketId;
25453
25500
  _context15.next = 7;
25454
- return this.toDoAfterArticleLoaded(nArticle, {}, _objectSpread$c(_objectSpread$c({}, doLoadItem.VariantValues), newConfigValues), 'initializingPartlist', doLoadItem.VariantItemData);
25501
+ return this.toDoAfterArticleLoaded(nArticle, {}, _objectSpread$d(_objectSpread$d({}, doLoadItem.VariantValues), newConfigValues), 'initializingPartlist', doLoadItem.VariantItemData);
25455
25502
  case 7:
25456
25503
  article.addPartlistArticle(nArticle);
25457
25504
  case 8:
@@ -25610,7 +25657,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25610
25657
  if (ruleValid) break;
25611
25658
  }
25612
25659
  if (ruleValid) {
25613
- returnValue.push(_objectSpread$c(_objectSpread$c({}, entry), {}, {
25660
+ returnValue.push(_objectSpread$d(_objectSpread$d({}, entry), {}, {
25614
25661
  index: i
25615
25662
  }));
25616
25663
  break;
@@ -25625,7 +25672,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25625
25672
  if ((_rule$articles = rule.articles) !== null && _rule$articles !== void 0 && _rule$articles.length && !rule.articles.includes(article.articleCodex)) return false;
25626
25673
  if (rule.variantValues && !this.objectIncudesObject(rule.variantValues, article.VariantValuesWithoutOPTandOPV)) return false;
25627
25674
  if (rule.visitedOptions && !this.arrayIncludesArray(rule.visitedOptions, visitedOptions[article.basketId])) return false;
25628
- if (rule.jsFormula && !article.evalRule(DivaUtils.getRuleByFormula(rule.jsFormula))) return false;
25675
+ if (rule.jsFormula && !article.evalRule(DivaUtils.getRuleByFormula(rule.jsFormula, article.catalogCodex, article.CatalogData.multiselectOptions))) return false;
25629
25676
  if (rule.sizes) {
25630
25677
  console.error('size logic not jet implemented');
25631
25678
  return false;
@@ -25792,7 +25839,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25792
25839
  /***************************************Abspeichern orderLines******************************************************/
25793
25840
  }, {
25794
25841
  key: "getOrderLinesOfArticles",
25795
- value: function getOrderLinesOfArticles(articles, orderLineInitInfos, repairOnly, hasFavorites) {
25842
+ value: function getOrderLinesOfArticles(articles, repairOnly, hasFavorites) {
25796
25843
  var ret = [];
25797
25844
  if (Object.values(articles).length == 0) return ret;
25798
25845
  for (var key in articles) {
@@ -25801,7 +25848,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25801
25848
  var catalogData = article.CatalogData;
25802
25849
  var variantBasketDatas = article.getVariantBasketData();
25803
25850
  var orderline = new OrderLineData({
25804
- SetID: orderLineInitInfos.setId,
25851
+ SetID: article.set.getSetId(),
25805
25852
  BasketID: article.basketId,
25806
25853
  RelatedToBasketID: article.relatedToBasketId,
25807
25854
  RelatedToSubItem: article.relatedToSubItem,
@@ -25827,7 +25874,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25827
25874
  Quantity: article.quantity,
25828
25875
  TabGroups: article.getTabgroupsAsString,
25829
25876
  DockingPointInfos: setHandlerInstance.getFreeDockingPointsOfArticle(article),
25830
- ArticleVariantID: md5("_".concat(article.catalogCodex, "_").concat(orderLineInitInfos.modelCodex, "_").concat(article.articleCodex, "_").concat(article.articleVariantValues.replace(/'/g, '@'))),
25877
+ ArticleVariantID: md5("_".concat(article.catalogCodex, "_").concat(article.set.modelCodex, "_").concat(article.articleCodex, "_").concat(article.articleVariantValues.replace(/'/g, '@'))),
25831
25878
  VariantDesc: article.articleVariantDesc(),
25832
25879
  VariantDesc_locales: article.articleVariantDesc_locales(),
25833
25880
  Image: article.image ? catalogData.getCatImageURL(article.image, '') : undefined,
@@ -25862,9 +25909,9 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25862
25909
 
25863
25910
  //die Partlistarticle eines Articles auch in die Orderline pushen
25864
25911
  if (article.hasPartlistArticle) {
25865
- ret = ret.concat(this.getOrderLinesOfArticles(article.partlistArticles, orderLineInitInfos, repairOnly, hasFavorites));
25912
+ ret = ret.concat(this.getOrderLinesOfArticles(article.partlistArticles, repairOnly, hasFavorites));
25866
25913
  }
25867
- ret = ret.concat(this.getOptiontreeAccessoiresArr(orderLineInitInfos.setId, article));
25914
+ ret = ret.concat(this.getOptiontreeAccessoiresArr(article.set.getSetId(), article));
25868
25915
  }
25869
25916
  return ret;
25870
25917
  }
@@ -25877,7 +25924,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25877
25924
  key: "checkForRoundingError",
25878
25925
  value: function checkForRoundingError(orderlines, set) {
25879
25926
  var _set$CatalogData$disc;
25880
- var product = set === null || set === void 0 ? void 0 : set.priceForActHash();
25927
+ var product = set === null || set === void 0 ? void 0 : set.getMatchingProduct();
25881
25928
  if (product !== null && product !== void 0 && product.percentage && product.percentage > ((_set$CatalogData$disc = set.CatalogData.discountPercentage) !== null && _set$CatalogData$disc !== void 0 ? _set$CatalogData$disc : 0)) {
25882
25929
  var setPrice = set.getSetPrice();
25883
25930
  var olPrice = orderlines.reduce(function (sum, ol) {
@@ -26192,7 +26239,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
26192
26239
  }();
26193
26240
  var articleHandlerInstance = new DivaArticleHandler();
26194
26241
 
26195
- var LOG$a = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
26242
+ var LOG$b = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
26196
26243
  //Der in einem Set gemergte Optionsbaum
26197
26244
  var DivaConfigTreeData = /*#__PURE__*/function () {
26198
26245
  function DivaConfigTreeData() {
@@ -26881,7 +26928,7 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
26881
26928
  }
26882
26929
  }
26883
26930
  if (basketIds.length !== basketIdsSorted.length) {
26884
- LOG$a.error(new DivaError('something went wrong on build configtree'));
26931
+ LOG$b.error(new DivaError('something went wrong on build configtree'));
26885
26932
  }
26886
26933
  return basketIdsSorted;
26887
26934
  }
@@ -26961,9 +27008,9 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
26961
27008
  function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
26962
27009
  function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
26963
27010
  function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
26964
- function ownKeys$b(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; }
26965
- function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26966
- var LOG$9 = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
27011
+ function ownKeys$c(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; }
27012
+ function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
27013
+ var LOG$a = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
26967
27014
  //plz delete me
26968
27015
  var DivaSet = /*#__PURE__*/function () {
26969
27016
  function DivaSet(catalog, _setId, orderSet, initSetState) {
@@ -26987,7 +27034,8 @@ var DivaSet = /*#__PURE__*/function () {
26987
27034
  _defineProperty(this, "setType", 'PLANNING');
26988
27035
  _defineProperty(this, "configTreeData", void 0);
26989
27036
  _defineProperty(this, "doorPlannerHandler", void 0);
26990
- _defineProperty(this, "priceForHash", {});
27037
+ _defineProperty(this, "matchingProduct", void 0);
27038
+ _defineProperty(this, "matchingOrigProduct", void 0);
26991
27039
  _defineProperty(this, "_dontCalcPricePreviewDueToPerformanceIssues", false);
26992
27040
  _defineProperty(this, "_supplierColors", void 0);
26993
27041
  /**Favorits state */
@@ -27061,7 +27109,7 @@ var DivaSet = /*#__PURE__*/function () {
27061
27109
  _context.next = 10;
27062
27110
  break;
27063
27111
  }
27064
- validValues = repairVariantValuesAndPlanner ? article.getValidValues(_objectSpread$b({}, variantValues), article.CatalogData.mergeOptionsToSameOption) : {};
27112
+ validValues = repairVariantValuesAndPlanner ? article.getValidValues(_objectSpread$c({}, variantValues), article.CatalogData.mergeOptionsToSameOption) : {};
27065
27113
  _context.t0 = partlistArticlesToLoad;
27066
27114
  _context.next = 8;
27067
27115
  return articleHandlerInstance.updateCfgValues(article, repairVariantValuesAndPlanner ? validValues : variantValues, {}, undefined, loadPlas);
@@ -27443,32 +27491,6 @@ var DivaSet = /*#__PURE__*/function () {
27443
27491
  notPlannedAcc: notPlannedAcc
27444
27492
  };
27445
27493
  }
27446
- }, {
27447
- key: "getAccessoiresOfBasketIdAsArray",
27448
- value: function getAccessoiresOfBasketIdAsArray(basketId, filter) {
27449
- if (filter) {
27450
- var acc = this.getSplitPlannedAccessoiresOfBasketId(basketId);
27451
- if (filter === 'onlyNonPlanner') return Object.values(acc.notPlannedAcc);
27452
- if (filter === 'onlyPlanner') return Object.values(acc.plannedAcc);
27453
- }
27454
- return Object.values(this.getAccessoiresOfBasketId(basketId));
27455
- }
27456
- }, {
27457
- key: "getAccessoiresOfArticleRecursive",
27458
- value: function getAccessoiresOfArticleRecursive(basketId, filter) {
27459
- var accArticles = [];
27460
- var nextAcc = [];
27461
- nextAcc = this.getAccessoiresOfBasketIdAsArray(basketId, filter);
27462
- while (nextAcc.length > 0) {
27463
- accArticles = accArticles.concat(nextAcc);
27464
- var tmpNextAcc = nextAcc;
27465
- nextAcc = [];
27466
- for (var i = 0; i < tmpNextAcc.length; i++) {
27467
- nextAcc = nextAcc.concat(this.getAccessoiresOfBasketIdAsArray(tmpNextAcc[i].basketId, filter));
27468
- }
27469
- }
27470
- return accArticles;
27471
- }
27472
27494
  }, {
27473
27495
  key: "getImageOfOnlyElement",
27474
27496
  value: function getImageOfOnlyElement() {
@@ -27481,6 +27503,13 @@ var DivaSet = /*#__PURE__*/function () {
27481
27503
  }
27482
27504
  return null;
27483
27505
  }
27506
+ //this getter includes pricelogics that are specificly only for the view of the configurator
27507
+ }, {
27508
+ key: "getViewSetPrice",
27509
+ value: function getViewSetPrice(dontTakeOverwrittePrice) {
27510
+ if (this.ViewOverwrittenPrice) return this.ViewOverwrittenPrice;
27511
+ return this.getSetPrice(dontTakeOverwrittePrice);
27512
+ }
27484
27513
  }, {
27485
27514
  key: "getSetPrice",
27486
27515
  value: function getSetPrice(dontTakeOverwrittePrice) {
@@ -27491,18 +27520,29 @@ var DivaSet = /*#__PURE__*/function () {
27491
27520
  }
27492
27521
  return setPrice;
27493
27522
  }
27523
+ //this getter includes pricelogics that are specificly only for the view of the configurator
27524
+ }, {
27525
+ key: "getViewBruttoSetPrice",
27526
+ value: function getViewBruttoSetPrice(discountOnly) {
27527
+ var curProduct = this.getMatchingProduct();
27528
+ //1. if curproduct has a discount or if curproduct has no discount but added Price
27529
+ if (curProduct !== null && curProduct !== void 0 && curProduct.origPrice && curProduct !== null && curProduct !== void 0 && curProduct.onlyViewDiscountedPrice && (!discountOnly || (curProduct === null || curProduct === void 0 ? void 0 : curProduct.origPrice) !== (curProduct === null || curProduct === void 0 ? void 0 : curProduct.onlyViewDiscountedPrice))) {
27530
+ return curProduct.origPrice;
27531
+ }
27532
+ return this.getBruttoSetPrice(discountOnly);
27533
+ }
27494
27534
  /**
27495
27535
  *
27496
- * @param discoultOnly ignore usecase for "verschönerter" price
27536
+ * @param discountOnly ignore usecase for "verschönerter" price
27497
27537
  * @returns
27498
27538
  */
27499
27539
  }, {
27500
27540
  key: "getBruttoSetPrice",
27501
- value: function getBruttoSetPrice(discoultOnly) {
27502
- var curProduct = this.priceForActHash();
27541
+ value: function getBruttoSetPrice(discountOnly) {
27542
+ var curProduct = this.getMatchingProduct();
27503
27543
 
27504
27544
  //1. if curproduct has a discount or if curproduct has no discount but added Price
27505
- if (curProduct !== null && curProduct !== void 0 && curProduct.origPrice && curProduct !== null && curProduct !== void 0 && curProduct.discountPrice && (!discoultOnly || (curProduct === null || curProduct === void 0 ? void 0 : curProduct.origPrice) !== (curProduct === null || curProduct === void 0 ? void 0 : curProduct.discountPrice))) return curProduct.origPrice;
27545
+ if (curProduct !== null && curProduct !== void 0 && curProduct.origPrice && curProduct !== null && curProduct !== void 0 && curProduct.discountPrice && (!discountOnly || (curProduct === null || curProduct === void 0 ? void 0 : curProduct.origPrice) !== (curProduct === null || curProduct === void 0 ? void 0 : curProduct.discountPrice))) return curProduct.origPrice;
27506
27546
 
27507
27547
  //2. if discount exists in catalog
27508
27548
  if (this.catalogData.discountPercentage) {
@@ -27512,6 +27552,16 @@ var DivaSet = /*#__PURE__*/function () {
27512
27552
  }
27513
27553
  return setPrice;
27514
27554
  }
27555
+ //3. if any article has a discount
27556
+ if (Object.values(this.divaArticles).find(function (a) {
27557
+ return a.discountPercentage;
27558
+ })) {
27559
+ var _setPrice = 0;
27560
+ for (var _key4 in this.divaArticles) {
27561
+ _setPrice += this.divaArticles[_key4].bruttoCalcPrice;
27562
+ }
27563
+ return _setPrice;
27564
+ }
27515
27565
  return undefined;
27516
27566
  }
27517
27567
 
@@ -27628,8 +27678,8 @@ var DivaSet = /*#__PURE__*/function () {
27628
27678
  var articles = {};
27629
27679
  for (var basketId in this.divaArticles) {
27630
27680
  articles[basketId] = this.divaArticles[basketId];
27631
- if (allPartlistArticlesAlso) articles = _objectSpread$b(_objectSpread$b({}, articles), articles[basketId].getRecursivePartlistArticles());
27632
- if (visiblePartlistArticlesAlso) articles = _objectSpread$b(_objectSpread$b({}, articles), articles[basketId].getRecursivePartlistArticles(true));
27681
+ if (allPartlistArticlesAlso) articles = _objectSpread$c(_objectSpread$c({}, articles), articles[basketId].getRecursivePartlistArticles());
27682
+ if (visiblePartlistArticlesAlso) articles = _objectSpread$c(_objectSpread$c({}, articles), articles[basketId].getRecursivePartlistArticles(true));
27633
27683
  }
27634
27684
  return articles;
27635
27685
  }
@@ -27735,19 +27785,6 @@ var DivaSet = /*#__PURE__*/function () {
27735
27785
  }
27736
27786
  return articleVariantValues;
27737
27787
  }
27738
- }, {
27739
- key: "getAllProducts",
27740
- value: function getAllProducts() {
27741
- var ret = {};
27742
- for (var key in this.divaArticles) {
27743
- var article = this.divaArticles[key];
27744
- if (article.curProduct) {
27745
- if (!ret[article.curProduct.productId]) ret[article.curProduct.productId] = 0;
27746
- ret[article.curProduct.productId] += article.quantity;
27747
- }
27748
- }
27749
- return ret;
27750
- }
27751
27788
  }, {
27752
27789
  key: "deleteArticle",
27753
27790
  value: function deleteArticle(basketId) {
@@ -27804,7 +27841,7 @@ var DivaSet = /*#__PURE__*/function () {
27804
27841
  for (var _i = 0; _i < sortable.length; _i++) {
27805
27842
  this.divaArticles[sortable[_i][0]] = articles[sortable[_i][0]];
27806
27843
  }
27807
- LOG$9.debug('articles sorted');
27844
+ LOG$a.debug('articles sorted');
27808
27845
  }
27809
27846
  }, {
27810
27847
  key: "getArticlesWithAccessoires",
@@ -27940,6 +27977,8 @@ var DivaSet = /*#__PURE__*/function () {
27940
27977
  set: function set(val) {
27941
27978
  this.setArticleNrPrefix = val;
27942
27979
  }
27980
+
27981
+ //this getter includes pricelogics that are specificly only for the view of the configurator
27943
27982
  }, {
27944
27983
  key: "doAllowSetPlanner",
27945
27984
  get: function get() {
@@ -27950,16 +27989,21 @@ var DivaSet = /*#__PURE__*/function () {
27950
27989
  get: function get() {
27951
27990
  return this.setState.onlyRunLogic;
27952
27991
  }
27992
+ }, {
27993
+ key: "ViewOverwrittenPrice",
27994
+ get: function get() {
27995
+ var _this$getMatchingProd;
27996
+ var priceFromHash = (_this$getMatchingProd = this.getMatchingProduct()) === null || _this$getMatchingProd === void 0 ? void 0 : _this$getMatchingProd.onlyViewDiscountedPrice;
27997
+ if (priceFromHash) return priceFromHash;
27998
+ return undefined;
27999
+ }
27953
28000
  }, {
27954
28001
  key: "OverwrittenPrice",
27955
28002
  get: function get() {
27956
- var _this$priceForActHash;
27957
- var priceFromHash = (_this$priceForActHash = this.priceForActHash()) === null || _this$priceForActHash === void 0 ? void 0 : _this$priceForActHash.discountPrice;
28003
+ var _this$getMatchingProd2;
28004
+ var priceFromHash = (_this$getMatchingProd2 = this.getMatchingProduct()) === null || _this$getMatchingProd2 === void 0 ? void 0 : _this$getMatchingProd2.discountPrice;
27958
28005
  if (priceFromHash) return priceFromHash;
27959
28006
  return this.overwrittenPrice;
27960
- },
27961
- set: function set(val) {
27962
- this.overwrittenPrice = val;
27963
28007
  }
27964
28008
  }, {
27965
28009
  key: "ActConfigStepKey",
@@ -28128,27 +28172,24 @@ var DivaSet = /*#__PURE__*/function () {
28128
28172
  return metaDatas;
28129
28173
  }
28130
28174
  }, {
28131
- key: "priceForActHash",
28132
- value: function priceForActHash() {
28133
- if (Object.values(this.priceForHash).length == 0) return undefined;
28134
- return this.priceForHash[this.setHash];
28175
+ key: "getMatchingProduct",
28176
+ value: function getMatchingProduct() {
28177
+ return this.matchingProduct;
28135
28178
  }
28136
28179
  }, {
28137
- key: "remindPriceForHash",
28138
- value: function remindPriceForHash(product) {
28139
- var _product$availableFor, _product$discountedPr, _product$discountedPr2;
28140
- if (!((_product$availableFor = product.availableForOrganizations) !== null && _product$availableFor !== void 0 && _product$availableFor.includes(this.getSetState.organizationId))) return;
28141
- var claculatedPrice = this.getSetPrice(true);
28142
- if (!product.discountedPrice && product.addedPrice === product.calculatedPrice && claculatedPrice == product.calculatedPrice) {
28143
- return;
28144
- }
28145
- var discountExists = !!product.discountedPrice || this.catalogData.discountPercentage;
28146
- this.priceForHash[this.setHash] = {
28147
- discountPrice: (_product$discountedPr = product.discountedPrice) !== null && _product$discountedPr !== void 0 ? _product$discountedPr : 0,
28148
- origPrice: product.addedPrice,
28149
- percentage: (claculatedPrice - ((_product$discountedPr2 = product.discountedPrice) !== null && _product$discountedPr2 !== void 0 ? _product$discountedPr2 : product.addedPrice)) / (claculatedPrice / 100),
28150
- bruttoPercentage: !!product.addedPrice && discountExists && product.discountedPrice !== product.addedPrice ? (claculatedPrice - product.addedPrice) / (claculatedPrice / 100) : undefined
28151
- };
28180
+ key: "setMatchingProduct",
28181
+ value: function setMatchingProduct(product) {
28182
+ this.matchingProduct = product;
28183
+ }
28184
+ }, {
28185
+ key: "getMatchingOrigProduct",
28186
+ value: function getMatchingOrigProduct() {
28187
+ return this.matchingOrigProduct;
28188
+ }
28189
+ }, {
28190
+ key: "setMatchingOrigProduct",
28191
+ value: function setMatchingOrigProduct(product) {
28192
+ this.matchingOrigProduct = product;
28152
28193
  }
28153
28194
  }, {
28154
28195
  key: "initializeDoorPlanner",
@@ -28163,7 +28204,7 @@ var DivaSet = /*#__PURE__*/function () {
28163
28204
  break;
28164
28205
  }
28165
28206
  _context4.next = 3;
28166
- return import('./DoorPlanner-d637db66.js');
28207
+ return import('./DoorPlanner-36d5e093.js');
28167
28208
  case 3:
28168
28209
  _yield$import = _context4.sent;
28169
28210
  DoorPlanner = _yield$import["default"];
@@ -28245,16 +28286,23 @@ var DivaSet = /*#__PURE__*/function () {
28245
28286
  key: "getCurrentDisountPercentage",
28246
28287
  value: function getCurrentDisountPercentage() {
28247
28288
  var _this$catalogData$dis;
28248
- var product = this.priceForActHash();
28289
+ var product = this.getMatchingProduct();
28249
28290
  if (product !== null && product !== void 0 && product.percentage && product.percentage > ((_this$catalogData$dis = this.catalogData.discountPercentage) !== null && _this$catalogData$dis !== void 0 ? _this$catalogData$dis : 0)) return product.percentage;
28250
28291
  return this.catalogData.discountPercentage;
28251
28292
  }
28252
28293
  }, {
28253
28294
  key: "getBruttoPercentage",
28254
28295
  value: function getBruttoPercentage(ignoreMainPriceUsecase) {
28255
- var product = this.priceForActHash();
28296
+ var product = this.getMatchingProduct();
28256
28297
  if ((product === null || product === void 0 ? void 0 : product.bruttoPercentage) !== undefined && (!ignoreMainPriceUsecase || !product.percentage)) return product === null || product === void 0 ? void 0 : product.bruttoPercentage;
28257
28298
  if (this.catalogData.discountPercentage) return 0;
28299
+
28300
+ //3. if any article has a discount
28301
+ if (Object.values(this.divaArticles).find(function (a) {
28302
+ return a.discountPercentage;
28303
+ })) {
28304
+ return 0;
28305
+ }
28258
28306
  return undefined;
28259
28307
  }
28260
28308
  }, {
@@ -29187,8 +29235,8 @@ var SummaryHandler = /*#__PURE__*/function () {
29187
29235
  }();
29188
29236
  var summaryHandlerInstance = new SummaryHandler();
29189
29237
 
29190
- function ownKeys$a(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; }
29191
- function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
29238
+ function ownKeys$b(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; }
29239
+ function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
29192
29240
  DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
29193
29241
  var DivaFavoritesHandler = /*#__PURE__*/function () {
29194
29242
  function DivaFavoritesHandler() {
@@ -29880,7 +29928,7 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29880
29928
  if (targetArticle[opt] && !variantValues[opt]) variantValues[opt] = targetArticle[opt];
29881
29929
  }
29882
29930
  }
29883
- configVariant = new ConfigVariantData(variant.id, set.setName, set.setName_locales, setImage, (_hQRenderScript = hQRenderScript) === null || _hQRenderScript === void 0 ? void 0 : _hQRenderScript._id, DivaUtils.encodeBase64(set.plannerHandler.getProject3D(set.getSetId())), set.getVariantsDescription(), set.SetArticleNr, set.getSetPrice(), set.setHash, 1, set.getVariantBasketData(), articleHandlerInstance.getCompactOrderLine(_objectSpread$a(_objectSpread$a({}, set.getDivaArticles()), set.getPartlistArticlesOfSet())), variantValues, summaryHandlerInstance.convertSummaryItemsToSummaryInfo(set), plannerData != undefined ? DivaUtils.encodeBase64(JSON.stringify(plannerData)) : '', urlToPlanning2D, setHandlerInstance.getBBoxObject(set, dimensions), set.getBruttoSetPrice(), undefined, undefined, set.MetaData, set.MetaData_locales, DivaUtils.stripTagsFromDict(set.getVariantsDescription_locales()), (_basket$OrderSets$set = basket.OrderSets[setindex].ConfigVariants) === null || _basket$OrderSets$set === void 0 || (_basket$OrderSets$set = _basket$OrderSets$set[set.basketConfigVariants.length]) === null || _basket$OrderSets$set === void 0 ? void 0 : _basket$OrderSets$set.SetOrderText, (_basket$OrderSets$set2 = basket.OrderSets[setindex].ConfigVariants) === null || _basket$OrderSets$set2 === void 0 || (_basket$OrderSets$set2 = _basket$OrderSets$set2[set.basketConfigVariants.length]) === null || _basket$OrderSets$set2 === void 0 ? void 0 : _basket$OrderSets$set2.SetOrderText_locales);
29931
+ configVariant = new ConfigVariantData(variant.id, set.setName, set.setName_locales, setImage, (_hQRenderScript = hQRenderScript) === null || _hQRenderScript === void 0 ? void 0 : _hQRenderScript._id, DivaUtils.encodeBase64(set.plannerHandler.getProject3D(set.getSetId())), set.getVariantsDescription(), set.SetArticleNr, set.getSetPrice(), set.setHash, 1, set.getVariantBasketData(), articleHandlerInstance.getCompactOrderLine(_objectSpread$b(_objectSpread$b({}, set.getDivaArticles()), set.getPartlistArticlesOfSet())), variantValues, summaryHandlerInstance.convertSummaryItemsToSummaryInfo(set), plannerData != undefined ? DivaUtils.encodeBase64(JSON.stringify(plannerData)) : '', urlToPlanning2D, setHandlerInstance.getBBoxObject(set, dimensions), set.getBruttoSetPrice(), undefined, undefined, set.MetaData, set.MetaData_locales, DivaUtils.stripTagsFromDict(set.getVariantsDescription_locales()), (_basket$OrderSets$set = basket.OrderSets[setindex].ConfigVariants) === null || _basket$OrderSets$set === void 0 || (_basket$OrderSets$set = _basket$OrderSets$set[set.basketConfigVariants.length]) === null || _basket$OrderSets$set === void 0 ? void 0 : _basket$OrderSets$set.SetOrderText, (_basket$OrderSets$set2 = basket.OrderSets[setindex].ConfigVariants) === null || _basket$OrderSets$set2 === void 0 || (_basket$OrderSets$set2 = _basket$OrderSets$set2[set.basketConfigVariants.length]) === null || _basket$OrderSets$set2 === void 0 ? void 0 : _basket$OrderSets$set2.SetOrderText_locales);
29884
29932
  set.basketConfigVariants.push(configVariant);
29885
29933
  case 31:
29886
29934
  case "end":
@@ -29974,8 +30022,8 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29974
30022
  }();
29975
30023
  var favoritesHandlerInstance = new DivaFavoritesHandler();
29976
30024
 
29977
- function ownKeys$9(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; }
29978
- function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
30025
+ function ownKeys$a(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; }
30026
+ function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
29979
30027
 
29980
30028
  //Diese Klasse beinhaltet die Logik wie eine aktuelle Konfiguration mit allen möglicheen Ausprägungen mit Preisen in einem Set aussieht.
29981
30029
  //Der in einem Set gemergte Optionsbaum
@@ -30536,7 +30584,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
30536
30584
  //get schnittmenge of all the articles
30537
30585
  if (i === 0) {
30538
30586
  constructionRules = myOptionState.constructionRules;
30539
- configItems = _objectSpread$9({}, myOptionState.visibleOptionValues);
30587
+ configItems = _objectSpread$a({}, myOptionState.visibleOptionValues);
30540
30588
  } else {
30541
30589
  for (var _key2 in configItems) {
30542
30590
  if (!myOptionState.visibleOptionValues[_key2]) {
@@ -30769,84 +30817,9 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
30769
30817
  }();
30770
30818
  var configTreeHandler = new DivaConfigTreeHandler();
30771
30819
 
30772
- //Diese Klasse verwaltet Productlogiken
30773
- var DivaProductHandler = /*#__PURE__*/function () {
30774
- function DivaProductHandler() {
30775
- _classCallCheck(this, DivaProductHandler);
30776
- }
30777
- return _createClass(DivaProductHandler, [{
30778
- key: "getPrice",
30779
- value: function getPrice() {
30780
- var price = 0;
30781
- return price;
30782
- }
30783
- }, {
30784
- key: "updateProducts",
30785
- value: function () {
30786
- var _updateProducts = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(sets, api, from) {
30787
- return _regeneratorRuntime.wrap(function _callee$(_context) {
30788
- while (1) switch (_context.prev = _context.next) {
30789
- case 0:
30790
- ({
30791
- catalogs: sets.map(function (set) {
30792
- return {
30793
- articles: Object.values(set.getDivaArticles()).map(function (article) {
30794
- return {
30795
- codex: article.articleCodex,
30796
- hash: article.articleProductHash
30797
- };
30798
- }),
30799
- catalogGuid: set.CatalogData.catalogGuid
30800
- };
30801
- })
30802
- });
30803
- return _context.abrupt("return");
30804
- case 2:
30805
- case "end":
30806
- return _context.stop();
30807
- }
30808
- }, _callee);
30809
- }));
30810
- function updateProducts(_x, _x2, _x3) {
30811
- return _updateProducts.apply(this, arguments);
30812
- }
30813
- return updateProducts;
30814
- }()
30815
- }, {
30816
- key: "getBestMatch",
30817
- value: function getBestMatch(articles, products) {
30818
- var OPTION_CODEX = 'KOPFTEIL';
30819
- if (!articles) return;
30820
- for (var key in articles) {
30821
- var _article$VariantValue;
30822
- var article = articles[key];
30823
- var opv = (_article$VariantValue = article.VariantValues['OPT' + OPTION_CODEX]) === null || _article$VariantValue === void 0 ? void 0 : _article$VariantValue.replace('OPV', '');
30824
- if (!products || !opv) continue;
30825
- for (var i = 0; i < products.length; i++) {
30826
- var _products$i$affiliate;
30827
- if ((_products$i$affiliate = products[i].affiliate) !== null && _products$i$affiliate !== void 0 && _products$i$affiliate.length) if (this.findOPVCodexInVariantValues(products[i], OPTION_CODEX, opv)) {
30828
- return products[i];
30829
- }
30830
- }
30831
- }
30832
- return undefined;
30833
- }
30834
- }, {
30835
- key: "findOPVCodexInVariantValues",
30836
- value: function findOPVCodexInVariantValues(product, opt, opv) {
30837
- return product.articles.find(function (article) {
30838
- return article.variantValues.find(function (variant) {
30839
- return variant.OPT === opt && variant.OPV === opv;
30840
- });
30841
- });
30842
- }
30843
- }]);
30844
- }();
30845
- var productHandlerInstance = new DivaProductHandler();
30846
-
30847
- 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; }
30848
- 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(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; }
30849
- var LOG$8 = DivaUtils.initLog('Planner', 'DIVA-SET-HANDLER');
30820
+ function ownKeys$9(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; }
30821
+ function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
30822
+ var LOG$9 = DivaUtils.initLog('Planner', 'DIVA-SET-HANDLER');
30850
30823
 
30851
30824
  /*
30852
30825
  Diese Klasse speichert alle Sets, die in einer Planung sind
@@ -31044,7 +31017,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
31044
31017
  _context4.next = 38;
31045
31018
  break;
31046
31019
  case 37:
31047
- LOG$8.error(new DivaError('articleCodex not found in article list. Could be due to exclusivity or a bug in the application!', {
31020
+ LOG$9.error(new DivaError('articleCodex not found in article list. Could be due to exclusivity or a bug in the application!', {
31048
31021
  code: 'WC_0011',
31049
31022
  custom: {
31050
31023
  articleCodex: toloadArtilce.articleCodex
@@ -31293,7 +31266,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
31293
31266
  return _regeneratorRuntime.wrap(function _callee4$(_context6) {
31294
31267
  while (1) switch (_context6.prev = _context6.next) {
31295
31268
  case 0:
31296
- LOG$8.debug('DivaSetHandler.initSetsByBasketData: ' + orderSet.SetID);
31269
+ LOG$9.debug('DivaSetHandler.initSetsByBasketData: ' + orderSet.SetID);
31297
31270
  _context6.next = 3;
31298
31271
  return catalogHandlerInstance.getCatalogData(initSetState, orderSet.ModelCatalogCodex ? orderSet.ModelCatalogCodex : orderSet.CatalogCodex, orderSet);
31299
31272
  case 3:
@@ -31309,7 +31282,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
31309
31282
  params = {};
31310
31283
  if ((initSetState.initEmptyPlanner || !orderSet.SetPlanData || orderSet.SetPlanData == '') && catalogData.useBoxPlanner) {
31311
31284
  if (!catalogData.startPlannerArticle) {
31312
- LOG$8.error(new DivaError('No start Article defined for box planner catalog'));
31285
+ LOG$9.error(new DivaError('No start Article defined for box planner catalog'));
31313
31286
  } else {
31314
31287
  params = {
31315
31288
  boxElementID: 1,
@@ -31332,7 +31305,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
31332
31305
  }
31333
31306
  variantValues = (_initSetState$initVar = initSetState.initVariantValues) !== null && _initSetState$initVar !== void 0 ? _initSetState$initVar : catalogData === null || catalogData === void 0 || (_catalogData$promoted = catalogData.promotedOpvs) === null || _catalogData$promoted === void 0 || (_catalogData$promoted = _catalogData$promoted.articles) === null || _catalogData$promoted === void 0 || (_catalogData$promoted = _catalogData$promoted[articlesToInitialize[j]]) === null || _catalogData$promoted === void 0 || (_catalogData$promoted = _catalogData$promoted[0]) === null || _catalogData$promoted === void 0 ? void 0 : _catalogData$promoted.variantValues;
31334
31307
  _context6.next = 18;
31335
- return this.addPlannerElement(set, articlesToInitialize[j], _objectSpread$8(_objectSpread$8({}, params), variantValues ? {
31308
+ return this.addPlannerElement(set, articlesToInitialize[j], _objectSpread$9(_objectSpread$9({}, params), variantValues ? {
31336
31309
  variantValues: variantValues
31337
31310
  } : {}));
31338
31311
  case 18:
@@ -31376,9 +31349,9 @@ var DivaSetHandler = /*#__PURE__*/function () {
31376
31349
  if (doDestroy3DHostConnection) {
31377
31350
  set.plannerHandler.clearHandler3D();
31378
31351
  }
31379
- LOG$8.debug('PlannerHandler of set ' + set.getSetId() + ' was destroyed successfully');
31352
+ LOG$9.debug('PlannerHandler of set ' + set.getSetId() + ' was destroyed successfully');
31380
31353
  } else {
31381
- LOG$8.debug('Unable to destroy PlannerHandler of set ' + set.getSetId());
31354
+ LOG$9.debug('Unable to destroy PlannerHandler of set ' + set.getSetId());
31382
31355
  }
31383
31356
  case 2:
31384
31357
  case "end":
@@ -31632,6 +31605,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
31632
31605
  newArticle,
31633
31606
  _set$getArticleByBask2,
31634
31607
  defaultHeaderValues,
31608
+ partlistRule,
31609
+ decisionNr,
31610
+ _newArticle$catalogAr,
31611
+ rule,
31612
+ value,
31635
31613
  _args13 = arguments;
31636
31614
  return _regeneratorRuntime.wrap(function _callee11$(_context13) {
31637
31615
  while (1) switch (_context13.prev = _context13.next) {
@@ -31660,16 +31638,42 @@ var DivaSetHandler = /*#__PURE__*/function () {
31660
31638
  if (initParams.variantValues) {
31661
31639
  defaultHeaderValues = Object.assign(defaultHeaderValues, initParams.variantValues);
31662
31640
  }
31641
+ if (initParams.partlistCodexToInit) {
31642
+ partlistRule = newArticle.catalogArticle.getPartlistRuleOfArticleCodes(initParams.partlistCodexToInit);
31643
+ decisionNr = partlistRule === null || partlistRule === void 0 ? void 0 : partlistRule.PartListPosDecisionsAndPosCounts[0].DecisionNumber;
31644
+ if (decisionNr) {
31645
+ rule = (_newArticle$catalogAr = newArticle.catalogArticle.partlistDecisions) === null || _newArticle$catalogAr === void 0 || (_newArticle$catalogAr = _newArticle$catalogAr['D' + decisionNr]) === null || _newArticle$catalogAr === void 0 || (_newArticle$catalogAr = _newArticle$catalogAr.DOC) === null || _newArticle$catalogAr === void 0 ? void 0 : _newArticle$catalogAr[0].JsFormula;
31646
+ if (rule) {
31647
+ value = DivaUtils.getVariantValuesFromRule(rule, {});
31648
+ if (value) defaultHeaderValues = Object.assign(defaultHeaderValues, value);
31649
+ }
31650
+ }
31651
+ }
31663
31652
  if (!(from !== 'toDeleteShelf')) {
31664
- _context13.next = 14;
31653
+ _context13.next = 15;
31665
31654
  break;
31666
31655
  }
31667
31656
  set.addArticle(newArticle);
31668
- _context13.next = 14;
31657
+ _context13.next = 15;
31669
31658
  return articleHandlerInstance.toDoAfterArticleLoaded(newArticle, defaultHeaderValues, {}, from, undefined, ignorePlanner);
31670
- case 14:
31671
- return _context13.abrupt("return", newArticle);
31672
31659
  case 15:
31660
+ if (newArticle.relatedToBasketId) {
31661
+ LOG$9.businessEvent('onClickAccesorie', 'Planner', 'Accesorie wurde geplant', {
31662
+ article: {
31663
+ articleCodex: articleCodex,
31664
+ articleName: newArticle.name
31665
+ }
31666
+ });
31667
+ } else {
31668
+ LOG$9.businessEvent('onClickArticle', 'Planner', 'Accesorie wurde geplant', {
31669
+ article: {
31670
+ articleCodex: articleCodex,
31671
+ articleName: newArticle.name
31672
+ }
31673
+ });
31674
+ }
31675
+ return _context13.abrupt("return", newArticle);
31676
+ case 17:
31673
31677
  case "end":
31674
31678
  return _context13.stop();
31675
31679
  }
@@ -31801,8 +31805,9 @@ var DivaSetHandler = /*#__PURE__*/function () {
31801
31805
  }, {
31802
31806
  key: "deleteElementFromSet",
31803
31807
  value: function () {
31804
- var _deleteElementFromSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(set, article, autoCorrectAVL_AVR, deletionType, dontReload) {
31805
- var setId, allElementsToDelete, success, newSelectedElement, i, _deletedArticle$doorP, _set$CatalogData, deletedArticle, articles, key, oldTransform, result, _set$getArticleByBask3;
31808
+ var _deleteElementFromSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(set, article, autoCorrectAVL_AVR, deletionType, dontReload, dontCheckInfluencedPlannerElements) {
31809
+ var _deletedArticle$doorP, _set$CatalogData;
31810
+ var setId, success, newSelectedElement, allElementsToDelete, i, art, deletedArticle, articles, key, oldTransform, result, _set$getArticleByBask3;
31806
31811
  return _regeneratorRuntime.wrap(function _callee14$(_context16) {
31807
31812
  while (1) switch (_context16.prev = _context16.next) {
31808
31813
  case 0:
@@ -31817,44 +31822,55 @@ var DivaSetHandler = /*#__PURE__*/function () {
31817
31822
  setId: setId
31818
31823
  });
31819
31824
  case 3:
31820
- allElementsToDelete = set.plannerHandler.getPlannerElementsInfluencedByDeletion(setId, article.elementId);
31821
31825
  success = false;
31822
31826
  newSelectedElement = undefined;
31827
+ if (dontCheckInfluencedPlannerElements) {
31828
+ _context16.next = 15;
31829
+ break;
31830
+ }
31831
+ allElementsToDelete = set.plannerHandler.getPlannerElementsInfluencedByDeletion(setId, article.elementId);
31823
31832
  i = 0;
31824
- case 7:
31833
+ case 8:
31825
31834
  if (!(i < allElementsToDelete.length)) {
31826
- _context16.next = 35;
31835
+ _context16.next = 15;
31827
31836
  break;
31828
31837
  }
31829
- article = set.getArticleByElementId(allElementsToDelete[i]);
31838
+ art = set.getArticleByElementId(allElementsToDelete[i]);
31839
+ _context16.next = 12;
31840
+ return this.deleteElementFromSet(set, art, undefined, undefined, true, true);
31841
+ case 12:
31842
+ i++;
31843
+ _context16.next = 8;
31844
+ break;
31845
+ case 15:
31830
31846
  deletedArticle = article; //accessoires löschen
31831
31847
  articles = set.getAccessoiresOfBasketId(article.basketId);
31832
31848
  _context16.t0 = _regeneratorRuntime.keys(articles);
31833
- case 12:
31849
+ case 18:
31834
31850
  if ((_context16.t1 = _context16.t0()).done) {
31835
- _context16.next = 18;
31851
+ _context16.next = 24;
31836
31852
  break;
31837
31853
  }
31838
31854
  key = _context16.t1.value;
31839
- _context16.next = 16;
31840
- return this.deleteElementFromSet(set, articles[key]);
31841
- case 16:
31842
- _context16.next = 12;
31855
+ _context16.next = 22;
31856
+ return this.deleteElementFromSet(set, articles[key], undefined, undefined, true);
31857
+ case 22:
31858
+ _context16.next = 18;
31843
31859
  break;
31844
- case 18:
31860
+ case 24:
31845
31861
  oldTransform = undefined;
31846
31862
  if (deletedArticle) deletedArticle.deleted = true;
31847
31863
  if (!(deletedArticle !== null && deletedArticle !== void 0 && deletedArticle.hasCatalogPlannerArticle)) {
31848
- _context16.next = 26;
31864
+ _context16.next = 32;
31849
31865
  break;
31850
31866
  }
31851
- _context16.next = 23;
31867
+ _context16.next = 29;
31852
31868
  return set.plannerHandler.deletePlannerElement(setId, deletedArticle.elementId, autoCorrectAVL_AVR, deletionType);
31853
- case 23:
31869
+ case 29:
31854
31870
  result = _context16.sent;
31855
31871
  newSelectedElement = result.newElementToSelect;
31856
31872
  oldTransform = result.transform;
31857
- case 26:
31873
+ case 32:
31858
31874
  //falls ein Accessoire gelöscht wurde wird das Accessoire auch wo es beim Parent hinterlegt war auch gelöscht
31859
31875
  if (deletedArticle !== null && deletedArticle !== void 0 && deletedArticle.relatedToBasketId) {
31860
31876
  (_set$getArticleByBask3 = set.getArticleByBasketId(deletedArticle.relatedToBasketId)) === null || _set$getArticleByBask3 === void 0 || _set$getArticleByBask3.removeAccessoire(deletedArticle.basketId);
@@ -31864,29 +31880,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
31864
31880
  deletedArticle === null || deletedArticle === void 0 || (_deletedArticle$doorP = deletedArticle.doorPlanner) === null || _deletedArticle$doorP === void 0 || _deletedArticle$doorP.deleteElement(deletedArticle.basketId);
31865
31881
  success = set.deleteArticle(article.basketId);
31866
31882
  if (!((set.CatalogData.bundleRules || set.CatalogData.reconfigAfterArticleDocked || set !== null && set !== void 0 && (_set$CatalogData = set.CatalogData) !== null && _set$CatalogData !== void 0 && _set$CatalogData.getOption('OPTLASTSTACKEDARTICLE')) && !dontReload)) {
31867
- _context16.next = 32;
31883
+ _context16.next = 38;
31868
31884
  break;
31869
31885
  }
31870
- _context16.next = 32;
31886
+ _context16.next = 38;
31871
31887
  return this.updateArticlesOptionStatesOfActSet(set, {}, []);
31872
- case 32:
31873
- i++;
31874
- _context16.next = 7;
31875
- break;
31876
- case 35:
31888
+ case 38:
31877
31889
  return _context16.abrupt("return", {
31878
31890
  success: success,
31879
31891
  selectElementId: newSelectedElement,
31880
31892
  setId: setId,
31881
31893
  oldTransform: oldTransform
31882
31894
  });
31883
- case 36:
31895
+ case 39:
31884
31896
  case "end":
31885
31897
  return _context16.stop();
31886
31898
  }
31887
31899
  }, _callee14, this);
31888
31900
  }));
31889
- function deleteElementFromSet(_x41, _x42, _x43, _x44, _x45) {
31901
+ function deleteElementFromSet(_x41, _x42, _x43, _x44, _x45, _x46) {
31890
31902
  return _deleteElementFromSet.apply(this, arguments);
31891
31903
  }
31892
31904
  return deleteElementFromSet;
@@ -31950,7 +31962,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
31950
31962
  _context17.next = 24;
31951
31963
  break;
31952
31964
  }
31953
- return _context17.abrupt("return", _objectSpread$8(_objectSpread$8({}, doesFit), {}, {
31965
+ return _context17.abrupt("return", _objectSpread$9(_objectSpread$9({}, doesFit), {}, {
31954
31966
  accessoire: accessoire
31955
31967
  }));
31956
31968
  case 24:
@@ -31961,7 +31973,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
31961
31973
  }
31962
31974
  }, _callee15, this);
31963
31975
  }));
31964
- function addAccessorieOnShelfPlanner(_x46, _x47, _x48, _x49, _x50) {
31976
+ function addAccessorieOnShelfPlanner(_x47, _x48, _x49, _x50, _x51) {
31965
31977
  return _addAccessorieOnShelfPlanner.apply(this, arguments);
31966
31978
  }
31967
31979
  return addAccessorieOnShelfPlanner;
@@ -32035,7 +32047,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32035
32047
  }
32036
32048
  }, _callee16, this);
32037
32049
  }));
32038
- function getFreeShelfGrids(_x51, _x52) {
32050
+ function getFreeShelfGrids(_x52, _x53) {
32039
32051
  return _getFreeShelfGrids.apply(this, arguments);
32040
32052
  }
32041
32053
  return getFreeShelfGrids;
@@ -32171,7 +32183,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32171
32183
  }
32172
32184
  }, _callee17, this);
32173
32185
  }));
32174
- function moveShelfItemToGrid(_x53, _x54, _x55, _x56, _x57) {
32186
+ function moveShelfItemToGrid(_x54, _x55, _x56, _x57, _x58) {
32175
32187
  return _moveShelfItemToGrid.apply(this, arguments);
32176
32188
  }
32177
32189
  return moveShelfItemToGrid;
@@ -32205,7 +32217,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32205
32217
  }
32206
32218
  }, _callee18, this);
32207
32219
  }));
32208
- function deleteAccessorieOnShelfPlanner(_x58, _x59, _x60, _x61, _x62) {
32220
+ function deleteAccessorieOnShelfPlanner(_x59, _x60, _x61, _x62, _x63) {
32209
32221
  return _deleteAccessorieOnShelfPlanner.apply(this, arguments);
32210
32222
  }
32211
32223
  return deleteAccessorieOnShelfPlanner;
@@ -32231,7 +32243,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32231
32243
  }
32232
32244
  }, _callee19, this);
32233
32245
  }));
32234
- function updatePlannerTrans(_x63, _x64, _x65, _x66, _x67, _x68, _x69) {
32246
+ function updatePlannerTrans(_x64, _x65, _x66, _x67, _x68, _x69, _x70) {
32235
32247
  return _updatePlannerTrans.apply(this, arguments);
32236
32248
  }
32237
32249
  return updatePlannerTrans;
@@ -32345,7 +32357,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32345
32357
  }
32346
32358
  }, _callee20, this);
32347
32359
  }));
32348
- function deleteAccessoire(_x70, _x71, _x72) {
32360
+ function deleteAccessoire(_x71, _x72, _x73) {
32349
32361
  return _deleteAccessoire.apply(this, arguments);
32350
32362
  }
32351
32363
  return deleteAccessoire;
@@ -32359,18 +32371,18 @@ var DivaSetHandler = /*#__PURE__*/function () {
32359
32371
  */
32360
32372
  }, {
32361
32373
  key: "update3DPlannerView",
32362
- value: function update3DPlannerView(doRequestRendering, doRequestHqRenderScript, set, renderSize, planner3DGridEnabled, mediaServiceSaveMode, doShow3DDimensionLines, alternateRenderInfo, viewpoint, useLatestViewpoint) {
32374
+ value: function update3DPlannerView(doRequestRendering, doRequestHqRenderScript, set, renderSize, planner3DGridEnabled, mediaServiceSaveMode, doShow3DDimensionLines, alternateRenderInfo, hybrid3DInfo) {
32363
32375
  var _set$plannerHandler, _set$getAlternateRend2;
32364
32376
  var width = renderSize.imgWidth;
32365
32377
  var height = renderSize.imgHeight;
32366
- (_set$plannerHandler = set.plannerHandler) === null || _set$plannerHandler === void 0 || _set$plannerHandler.request3D(doRequestRendering, doRequestHqRenderScript, (set === null || set === void 0 || (_set$getAlternateRend2 = set.getAlternateRenderInfo()) === null || _set$getAlternateRend2 === void 0 ? void 0 : _set$getAlternateRend2.length) > 0, alternateRenderInfo, undefined, {
32378
+ (_set$plannerHandler = set.plannerHandler) === null || _set$plannerHandler === void 0 || _set$plannerHandler.request3D(doRequestRendering, doRequestHqRenderScript, true, (set === null || set === void 0 || (_set$getAlternateRend2 = set.getAlternateRenderInfo()) === null || _set$getAlternateRend2 === void 0 ? void 0 : _set$getAlternateRend2.length) > 0, alternateRenderInfo, undefined, {
32367
32379
  width: width,
32368
32380
  height: height,
32369
32381
  isFullscreenRendering: false,
32370
32382
  planner3DGridEnabled: planner3DGridEnabled,
32371
32383
  mediaServiceSaveMode: mediaServiceSaveMode,
32372
32384
  doShow3DDimensionLines: !!doShow3DDimensionLines
32373
- }, viewpoint, useLatestViewpoint);
32385
+ }, hybrid3DInfo);
32374
32386
  }
32375
32387
  }, {
32376
32388
  key: "getPlannerPaletteViewInfo",
@@ -32382,7 +32394,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32382
32394
  var articlecodex = plannerElement.articleCodex;
32383
32395
  if (type == 'PLANNERSWITCH' && selectedArticle) {
32384
32396
  if (plannerViewInfo.catalogPlannerArticles[i].filterType == 'Accessoire') continue;
32385
- cleanedCaltaogPlannerArticles.push(_objectSpread$8(_objectSpread$8({}, plannerElement), {}, {
32397
+ cleanedCaltaogPlannerArticles.push(_objectSpread$9(_objectSpread$9({}, plannerElement), {}, {
32386
32398
  sel: articlecodex == selectedArticle,
32387
32399
  groupName: ''
32388
32400
  }));
@@ -32396,12 +32408,12 @@ var DivaSetHandler = /*#__PURE__*/function () {
32396
32408
  plannerViewInfo.plannerConfiguration.updatePaletteAfterPlanningChanged = true;
32397
32409
  }
32398
32410
  }
32399
- if (!dontPushElement) cleanedCaltaogPlannerArticles.push(_objectSpread$8(_objectSpread$8({}, plannerElement), {}, {
32411
+ if (!dontPushElement) cleanedCaltaogPlannerArticles.push(_objectSpread$9(_objectSpread$9({}, plannerElement), {}, {
32400
32412
  sel: articlecodex == selectedArticle
32401
32413
  }));
32402
32414
  }
32403
32415
  }
32404
- return _objectSpread$8(_objectSpread$8({}, plannerViewInfo), {}, {
32416
+ return _objectSpread$9(_objectSpread$9({}, plannerViewInfo), {}, {
32405
32417
  catalogPlannerArticles: cleanedCaltaogPlannerArticles
32406
32418
  });
32407
32419
  }
@@ -32499,7 +32511,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32499
32511
  }
32500
32512
  }, _callee21, this);
32501
32513
  }));
32502
- function configSingleIsChanged(_x73, _x74, _x75, _x76) {
32514
+ function configSingleIsChanged(_x74, _x75, _x76, _x77) {
32503
32515
  return _configSingleIsChanged.apply(this, arguments);
32504
32516
  }
32505
32517
  return configSingleIsChanged;
@@ -32554,7 +32566,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
32554
32566
  }, {
32555
32567
  key: "loadPaletteInfos",
32556
32568
  value: function loadPaletteInfos(set, configStepKey, activeArticles, targetArticles) {
32557
- var _articles$activeArtic2;
32558
32569
  if (!activeArticles) {
32559
32570
  //wir befinden uns im planner und die Infos aller Artikel werden benötigt!
32560
32571
  activeArticles = [];
@@ -32591,7 +32602,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32591
32602
  articleInfos: articleInfos,
32592
32603
  doShowConfigSingle: doShowConfigSingle && groupedArticles.length > 1,
32593
32604
  isConfigSingle: isConfigSingle,
32594
- articleName: activeArticles[0] ? (_articles$activeArtic2 = articles[activeArticles[0]]) === null || _articles$activeArtic2 === void 0 || (_articles$activeArtic2 = _articles$activeArtic2.curProduct) === null || _articles$activeArtic2 === void 0 ? void 0 : _articles$activeArtic2.shortDescription : ''
32605
+ articleName: ''
32595
32606
  };
32596
32607
  }
32597
32608
  }, {
@@ -32617,7 +32628,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32617
32628
  filterType = set.configTree.getCurFilterType(configStepKey, optionStatesOfArticle, configItems.configItems);
32618
32629
  stepInfo = set.configTree.getStepInfo(configStepKey, optionStatesOfArticle);
32619
32630
  contentItemId = (_configItems$option = configItems.option) === null || _configItems$option === void 0 ? void 0 : _configItems$option.contentItemId;
32620
- return _context24.abrupt("return", _objectSpread$8(_objectSpread$8(_objectSpread$8({
32631
+ return _context24.abrupt("return", _objectSpread$9(_objectSpread$9(_objectSpread$9({
32621
32632
  isRenderedNotInSettingPalette: set.configTree.isRenderedNotInSettingPalette(configStepKey),
32622
32633
  isRenderedInAccessorieStep: set.configTree.isRenderedInAccessorieStep(configStepKey),
32623
32634
  visible: set.configTree.getVisibility(configStepKey, visible, set.CatalogData)
@@ -32634,7 +32645,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32634
32645
  }
32635
32646
  }, _callee22, this);
32636
32647
  }));
32637
- function loadConfigItemsOfActSetByConfigStepKey(_x77, _x78, _x79) {
32648
+ function loadConfigItemsOfActSetByConfigStepKey(_x78, _x79, _x80) {
32638
32649
  return _loadConfigItemsOfActSetByConfigStepKey.apply(this, arguments);
32639
32650
  }
32640
32651
  return loadConfigItemsOfActSetByConfigStepKey;
@@ -32721,7 +32732,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32721
32732
  }
32722
32733
  }, _callee23, this);
32723
32734
  }));
32724
- function variantsEvaluator(_x80, _x81, _x82, _x83) {
32735
+ function variantsEvaluator(_x81, _x82, _x83, _x84) {
32725
32736
  return _variantsEvaluator.apply(this, arguments);
32726
32737
  }
32727
32738
  return variantsEvaluator;
@@ -32799,7 +32810,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32799
32810
  }
32800
32811
  }, _callee24, this);
32801
32812
  }));
32802
- function calcVariants(_x84, _x85, _x86) {
32813
+ function calcVariants(_x85, _x86, _x87) {
32803
32814
  return _calcVariants.apply(this, arguments);
32804
32815
  }
32805
32816
  return calcVariants;
@@ -32964,7 +32975,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32964
32975
  }
32965
32976
  }, _callee25, this);
32966
32977
  }));
32967
- function updateArticlesOptionStatesOfActSet(_x87, _x88, _x89, _x90, _x91, _x92) {
32978
+ function updateArticlesOptionStatesOfActSet(_x88, _x89, _x90, _x91, _x92, _x93) {
32968
32979
  return _updateArticlesOptionStatesOfActSet.apply(this, arguments);
32969
32980
  }
32970
32981
  return updateArticlesOptionStatesOfActSet;
@@ -33055,7 +33066,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33055
33066
  break;
33056
33067
  }
33057
33068
  _context28.next = 17;
33058
- return this.addArticleToActSet(set, edoArticlesToLoad[_i5].ArticleCodex, _objectSpread$8(_objectSpread$8({}, edoArticlesToLoad[_i5]), {}, {
33069
+ return this.addArticleToActSet(set, edoArticlesToLoad[_i5].ArticleCodex, _objectSpread$9(_objectSpread$9({}, edoArticlesToLoad[_i5]), {}, {
33059
33070
  basketId: oldBasketIds[_i5]
33060
33071
  }), true);
33061
33072
  case 17:
@@ -33074,7 +33085,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33074
33085
  }
33075
33086
  }, _callee26, this);
33076
33087
  }));
33077
- function updateEdoArticles(_x93, _x94) {
33088
+ function updateEdoArticles(_x94, _x95) {
33078
33089
  return _updateEdoArticles.apply(this, arguments);
33079
33090
  }
33080
33091
  return updateEdoArticles;
@@ -33201,70 +33212,24 @@ var DivaSetHandler = /*#__PURE__*/function () {
33201
33212
  }
33202
33213
  return ret;
33203
33214
  }
33215
+
33216
+ /***********************************************Speichern Prozess / OrderSets******************************************************/
33204
33217
  }, {
33205
- key: "checkVariantData",
33206
- value: function () {
33207
- var _checkVariantData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27(set) {
33208
- var somethingChanged, data;
33209
- return _regeneratorRuntime.wrap(function _callee27$(_context29) {
33210
- while (1) switch (_context29.prev = _context29.next) {
33211
- case 0:
33212
- somethingChanged = false;
33213
- _context29.next = 3;
33214
- return set.api.getDataCache(set.api.getCheckVariantDataQS(set.setHash), undefined, set.getAccountSessionGuid());
33215
- case 3:
33216
- data = _context29.sent;
33217
- if (data.Found) {
33218
- if (set.OverwrittenPrice != data.VkPrice) {
33219
- somethingChanged = true;
33220
- }
33221
- set.OverwrittenPrice = data.VkPrice;
33222
- set.SetArticleNrPrefix = 'SAP';
33223
- set.SetArticleNr = data.SapArticleNr;
33224
- } else {
33225
- if (set.OverwrittenPrice) {
33226
- somethingChanged = true;
33227
- }
33228
- set.SetArticleNr = set.CatalogData.retailArticleNr;
33229
- set.SetArticleNrPrefix = 'ZKAT';
33230
- set.OverwrittenPrice = undefined;
33231
- }
33232
- return _context29.abrupt("return", somethingChanged);
33233
- case 6:
33234
- case "end":
33235
- return _context29.stop();
33236
- }
33237
- }, _callee27);
33238
- }));
33239
- function checkVariantData(_x95) {
33240
- return _checkVariantData.apply(this, arguments);
33241
- }
33242
- return checkVariantData;
33243
- }() /***********************************************Speichern Prozess / OrderSets******************************************************/
33244
- }, {
33245
- key: "getTotalPrice",
33246
- value: function getTotalPrice(sets) {
33247
- var _this$actSet;
33218
+ key: "getTotalViewPrice",
33219
+ value: function getTotalViewPrice(sets) {
33248
33220
  var price = 0;
33249
- 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()) {
33250
- return productHandlerInstance.getPrice();
33251
- }
33252
33221
  for (var key in sets) {
33253
- price = price + sets[key].getSetPrice();
33222
+ price = price + sets[key].getViewSetPrice();
33254
33223
  }
33255
33224
  return price;
33256
33225
  }
33257
33226
  }, {
33258
- key: "getTotalBruttoPrice",
33259
- value: function getTotalBruttoPrice(sets) {
33260
- var _this$actSet2;
33227
+ key: "getTotalViewBruttoPrice",
33228
+ value: function getTotalViewBruttoPrice(sets) {
33261
33229
  var price = 0;
33262
33230
  var bruttoActive = false;
33263
- 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()) {
33264
- return productHandlerInstance.getPrice();
33265
- }
33266
33231
  for (var key in sets) {
33267
- var bruttoSetPrice = sets[key].getBruttoSetPrice(true);
33232
+ var bruttoSetPrice = sets[key].getViewBruttoSetPrice(true);
33268
33233
  if (bruttoSetPrice) bruttoActive = true;
33269
33234
  price = price + (bruttoSetPrice !== null && bruttoSetPrice !== void 0 ? bruttoSetPrice : sets[key].getSetPrice());
33270
33235
  }
@@ -33286,51 +33251,47 @@ var DivaSetHandler = /*#__PURE__*/function () {
33286
33251
  }, {
33287
33252
  key: "fillOrderLinesAndOrderSets",
33288
33253
  value: function () {
33289
- var _fillOrderLinesAndOrderSets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(sets, divaBasketHandler, repairOnly, setPlanner, returnTo) {
33290
- var _set$WebConfig;
33291
- 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;
33292
- return _regeneratorRuntime.wrap(function _callee28$(_context30) {
33293
- while (1) switch (_context30.prev = _context30.next) {
33254
+ var _fillOrderLinesAndOrderSets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27(sets, divaBasketHandler, repairOnly, setPlanner, returnTo) {
33255
+ var _set$getMatchingProdu2, _set$getMatchingProdu3;
33256
+ var orderSets, basketData, set, setPosNr, _set$getMatchingProdu, key, _set$basketConfigVari, _OrderLinesOfActSet$, _set, catalogData, articles, newOrderSet, OrderLinesOfActSet, ret, _key2, i, _basketData$OrderSets, _basketData$SetPlanne, oderSetsIsInActPlanning, setId, j;
33257
+ return _regeneratorRuntime.wrap(function _callee27$(_context29) {
33258
+ while (1) switch (_context29.prev = _context29.next) {
33294
33259
  case 0:
33295
33260
  orderSets = [];
33296
33261
  basketData = divaBasketHandler.actBasket;
33297
33262
  set = this.actSet(sets); //ACHTUNG: Wenn man das nicht zuerst löscht, gibt es beim wiederholten basket Speichern doppelte Einträge
33298
33263
  basketData.setSAPOrderLines([]);
33299
33264
  setPosNr = 0;
33300
- if (set !== null && set !== void 0 && (_set$WebConfig = set.WebConfig) !== null && _set$WebConfig !== void 0 && _set$WebConfig.checkForProductsPrice) {
33301
- price = set.priceForActHash();
33302
- if (!price) {
33303
- basketData.OrigProductId = undefined;
33304
- }
33265
+ if (set !== null && set !== void 0 && set.api.doCheckForProductsPrice()) {
33266
+ // TODO: this need a better solution, to be decided with mathias
33267
+ if (!((_set$getMatchingProdu = set.getMatchingProduct()) !== null && _set$getMatchingProdu !== void 0 && _set$getMatchingProdu._id)) basketData.OrigProductId = undefined;
33305
33268
  }
33306
- _context30.t0 = _regeneratorRuntime.keys(sets);
33307
- case 7:
33308
- if ((_context30.t1 = _context30.t0()).done) {
33309
- _context30.next = 30;
33269
+ basketData.MatchingProductId = set === null || set === void 0 || (_set$getMatchingProdu2 = set.getMatchingProduct()) === null || _set$getMatchingProdu2 === void 0 ? void 0 : _set$getMatchingProdu2._id;
33270
+ basketData.MatchingProductRetailerArticleNr = set === null || set === void 0 || (_set$getMatchingProdu3 = set.getMatchingProduct()) === null || _set$getMatchingProdu3 === void 0 || (_set$getMatchingProdu3 = _set$getMatchingProdu3.retailerArticleNr) === null || _set$getMatchingProdu3 === void 0 ? void 0 : _set$getMatchingProdu3.toString();
33271
+ _context29.t0 = _regeneratorRuntime.keys(sets);
33272
+ case 9:
33273
+ if ((_context29.t1 = _context29.t0()).done) {
33274
+ _context29.next = 31;
33310
33275
  break;
33311
33276
  }
33312
- key = _context30.t1.value;
33277
+ key = _context29.t1.value;
33313
33278
  setPosNr++;
33314
33279
  _set = sets[key];
33315
33280
  catalogData = _set.CatalogData;
33316
33281
  articles = _set.getDivaArticles();
33317
- orderLineInitInfos = {
33318
- setId: _set.getSetId(),
33319
- modelCodex: _set.modelCodex
33320
- };
33321
- _context30.next = 16;
33282
+ _context29.next = 17;
33322
33283
  return this.getOrderSet(_set, catalogData, setPosNr, divaBasketHandler.actDivaNr, repairOnly, returnTo);
33323
- case 16:
33324
- newOrderSet = _context30.sent;
33284
+ case 17:
33285
+ newOrderSet = _context29.sent;
33325
33286
  basketData.setIsPlanning(_set.SetType == 'PLANNING' ? '1' : '0');
33326
- OrderLinesOfActSet = articleHandlerInstance.getOrderLinesOfArticles(articles, orderLineInitInfos, repairOnly, !!((_set$basketConfigVari = _set.basketConfigVariants) !== null && _set$basketConfigVari !== void 0 && _set$basketConfigVari.length));
33287
+ OrderLinesOfActSet = articleHandlerInstance.getOrderLinesOfArticles(articles, repairOnly, !!((_set$basketConfigVari = _set.basketConfigVariants) !== null && _set$basketConfigVari !== void 0 && _set$basketConfigVari.length));
33327
33288
  articleHandlerInstance.checkForRoundingError(OrderLinesOfActSet, _set);
33328
33289
  if (OrderLinesOfActSet.length) {
33329
- _context30.next = 22;
33290
+ _context29.next = 23;
33330
33291
  break;
33331
33292
  }
33332
- return _context30.abrupt("continue", 7);
33333
- case 22:
33293
+ return _context29.abrupt("continue", 9);
33294
+ case 23:
33334
33295
  OrderLinesOfActSet = divaBasketHandler.divaWWSHandler.repairWWSFlags(articles, OrderLinesOfActSet);
33335
33296
  if (newOrderSet.SetImage == '' && (_OrderLinesOfActSet$ = OrderLinesOfActSet[0]) !== null && _OrderLinesOfActSet$ !== void 0 && _OrderLinesOfActSet$.Image && _set.PlannerMode == 'No') {
33336
33297
  newOrderSet.SetImage = OrderLinesOfActSet[0].Image.replace('_low', '');
@@ -33351,56 +33312,56 @@ var DivaSetHandler = /*#__PURE__*/function () {
33351
33312
  }
33352
33313
  newOrderSet.setOrderLines(OrderLinesOfActSet);
33353
33314
  orderSets.push(newOrderSet);
33354
- _context30.next = 7;
33315
+ _context29.next = 9;
33355
33316
  break;
33356
- case 30:
33317
+ case 31:
33357
33318
  //fill diva3DProject for renderings & AR Converter
33358
33319
  basketData.Diva3DProject = DivaUtils.encodeBase64(set === null || set === void 0 ? void 0 : set.plannerHandler.getProject3D());
33359
33320
  i = 0;
33360
- case 32:
33321
+ case 33:
33361
33322
  if (!(i < ((_basketData$OrderSets = basketData.OrderSets) === null || _basketData$OrderSets === void 0 ? void 0 : _basketData$OrderSets.length))) {
33362
- _context30.next = 47;
33323
+ _context29.next = 48;
33363
33324
  break;
33364
33325
  }
33365
33326
  oderSetsIsInActPlanning = false;
33366
33327
  setId = basketData.OrderSets[i].SetID;
33367
33328
  j = 0;
33368
- case 36:
33329
+ case 37:
33369
33330
  if (!(j < orderSets.length)) {
33370
- _context30.next = 43;
33331
+ _context29.next = 44;
33371
33332
  break;
33372
33333
  }
33373
33334
  if (!(orderSets[j].SetID == setId)) {
33374
- _context30.next = 40;
33335
+ _context29.next = 41;
33375
33336
  break;
33376
33337
  }
33377
33338
  oderSetsIsInActPlanning = true;
33378
- return _context30.abrupt("break", 43);
33379
- case 40:
33339
+ return _context29.abrupt("break", 44);
33340
+ case 41:
33380
33341
  j++;
33381
- _context30.next = 36;
33342
+ _context29.next = 37;
33382
33343
  break;
33383
- case 43:
33344
+ case 44:
33384
33345
  if (!oderSetsIsInActPlanning && !((_basketData$SetPlanne = basketData.SetPlannerInfos) !== null && _basketData$SetPlanne !== void 0 && _basketData$SetPlanne.InvolvedSetIds.includes(setId))) {
33385
33346
  orderSets.push(basketData.OrderSets[i]);
33386
33347
  }
33387
- case 44:
33348
+ case 45:
33388
33349
  i++;
33389
- _context30.next = 32;
33350
+ _context29.next = 33;
33390
33351
  break;
33391
- case 47:
33352
+ case 48:
33392
33353
  basketData.SetPlannerInfos = setPlanner ? this.getSetPlannerInfos(Object.keys(sets), orderSets) : undefined;
33393
33354
  if (repairOnly) {
33394
33355
  this.repairOrderSets(basketData, orderSets);
33395
33356
  } else {
33396
33357
  basketData.setOrderSets(orderSets);
33397
33358
  }
33398
- return _context30.abrupt("return", basketData);
33399
- case 50:
33359
+ return _context29.abrupt("return", basketData);
33360
+ case 51:
33400
33361
  case "end":
33401
- return _context30.stop();
33362
+ return _context29.stop();
33402
33363
  }
33403
- }, _callee28, this);
33364
+ }, _callee27, this);
33404
33365
  }));
33405
33366
  function fillOrderLinesAndOrderSets(_x96, _x97, _x98, _x99, _x100) {
33406
33367
  return _fillOrderLinesAndOrderSets.apply(this, arguments);
@@ -33459,7 +33420,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33459
33420
  var _origOrderSet$ConfigV;
33460
33421
  var configVariant = (_origOrderSet$ConfigV = origOrderSet.ConfigVariants) === null || _origOrderSet$ConfigV === void 0 ? void 0 : _origOrderSet$ConfigV[index];
33461
33422
  if (!configVariant) return variant;
33462
- return _objectSpread$8(_objectSpread$8({}, variant), {}, {
33423
+ return _objectSpread$9(_objectSpread$9({}, variant), {}, {
33463
33424
  SetImage: configVariant.SetImage,
33464
33425
  HQRenderScript: configVariant.HQRenderScript,
33465
33426
  Set2DImage: configVariant.Set2DImage,
@@ -33486,11 +33447,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
33486
33447
  }, {
33487
33448
  key: "getOrderSet",
33488
33449
  value: function () {
33489
- var _getOrderSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29(set, catalogData, posNr, divaNr, repairOnly, returnTo) {
33490
- var _hqRenderScript, _set$basketConfigVari2, _set$basketConfigVari3;
33450
+ var _getOrderSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(set, catalogData, posNr, divaNr, repairOnly, returnTo) {
33451
+ var _Object$values$, _set$getDivaArticles, _hqRenderScript, _set$basketConfigVari2, _set$basketConfigVari3;
33491
33452
  var dontGenerateImages, orderSet, GroupType, plannerData, setImage, urlToPlanning2D, alternateSetImages, hqRenderScript, dimensions, promise3D, promise2D, promise3DAlternate, _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, promiseHQRenderScript, _yield$Promise$all3, _yield$Promise$all4, plannerWarnings, bruttoPrice;
33492
- return _regeneratorRuntime.wrap(function _callee29$(_context31) {
33493
- while (1) switch (_context31.prev = _context31.next) {
33453
+ return _regeneratorRuntime.wrap(function _callee28$(_context30) {
33454
+ while (1) switch (_context30.prev = _context30.next) {
33494
33455
  case 0:
33495
33456
  dontGenerateImages = repairOnly || returnTo == 'DONT_SAVE_BASKET' || returnTo == 'TEST_CONFIGURATORLOGIC';
33496
33457
  DivaUtils.startSpanOfApm('GetSet3D und 2D Image');
@@ -33502,7 +33463,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33502
33463
  hqRenderScript = undefined;
33503
33464
  dimensions = {};
33504
33465
  if (dontGenerateImages) {
33505
- _context31.next = 28;
33466
+ _context30.next = 28;
33506
33467
  break;
33507
33468
  }
33508
33469
  promise3D = this.getSetImage(set, typeof window === 'undefined');
@@ -33510,10 +33471,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
33510
33471
  if (!catalogData.dontSaveAlternativeRenderings && set.CatalogData.alternateRenderingsForSummary.length) {
33511
33472
  promise3DAlternate = this.getAlternateSetImages(set);
33512
33473
  }
33513
- _context31.next = 15;
33474
+ _context30.next = 15;
33514
33475
  return Promise.all([promise3D, promise2D, promise3DAlternate]);
33515
33476
  case 15:
33516
- _yield$Promise$all = _context31.sent;
33477
+ _yield$Promise$all = _context30.sent;
33517
33478
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
33518
33479
  _yield$Promise$all2$ = _yield$Promise$all2[0];
33519
33480
  setImage = _yield$Promise$all2$.url;
@@ -33521,10 +33482,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
33521
33482
  urlToPlanning2D = _yield$Promise$all2[1];
33522
33483
  alternateSetImages = _yield$Promise$all2[2];
33523
33484
  promiseHQRenderScript = this.getHQRenderScript(set, divaNr);
33524
- _context31.next = 25;
33485
+ _context30.next = 25;
33525
33486
  return Promise.all([promiseHQRenderScript]);
33526
33487
  case 25:
33527
- _yield$Promise$all3 = _context31.sent;
33488
+ _yield$Promise$all3 = _context30.sent;
33528
33489
  _yield$Promise$all4 = _slicedToArray(_yield$Promise$all3, 1);
33529
33490
  hqRenderScript = _yield$Promise$all4[0];
33530
33491
  case 28:
@@ -33555,7 +33516,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33555
33516
  SetArticleNrPrefix: set.SetArticleNrPrefix,
33556
33517
  BBox: this.getBBoxObject(set, dimensions),
33557
33518
  SetVariantBasketDatas: set.getVariantBasketData(),
33558
- SetImage: setImage,
33519
+ SetImage: set.PlannerMode == 'No' ? (_Object$values$ = Object.values((_set$getDivaArticles = set.getDivaArticles()) !== null && _set$getDivaArticles !== void 0 ? _set$getDivaArticles : {})[0]) === null || _Object$values$ === void 0 ? void 0 : _Object$values$.imageUrl : setImage,
33559
33520
  //Add url string of current rendering.
33560
33521
  HQRenderScript: (_hqRenderScript = hqRenderScript) === null || _hqRenderScript === void 0 ? void 0 : _hqRenderScript._id,
33561
33522
  Set2DImage: urlToPlanning2D,
@@ -33586,12 +33547,12 @@ var DivaSetHandler = /*#__PURE__*/function () {
33586
33547
  MetaData: !((_set$basketConfigVari2 = set.basketConfigVariants) !== null && _set$basketConfigVari2 !== void 0 && _set$basketConfigVari2.length) ? set.MetaData : undefined,
33587
33548
  MetaData_locales: !((_set$basketConfigVari3 = set.basketConfigVariants) !== null && _set$basketConfigVari3 !== void 0 && _set$basketConfigVari3.length) ? set.MetaData_locales : undefined
33588
33549
  });
33589
- return _context31.abrupt("return", orderSet);
33550
+ return _context30.abrupt("return", orderSet);
33590
33551
  case 34:
33591
33552
  case "end":
33592
- return _context31.stop();
33553
+ return _context30.stop();
33593
33554
  }
33594
- }, _callee29, this);
33555
+ }, _callee28, this);
33595
33556
  }));
33596
33557
  function getOrderSet(_x101, _x102, _x103, _x104, _x105, _x106) {
33597
33558
  return _getOrderSet.apply(this, arguments);
@@ -33606,31 +33567,31 @@ var DivaSetHandler = /*#__PURE__*/function () {
33606
33567
  }, {
33607
33568
  key: "getSetImage",
33608
33569
  value: (function () {
33609
- var _getSetImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30(set, overwriteLastSavedRendering) {
33570
+ var _getSetImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29(set, overwriteLastSavedRendering) {
33610
33571
  var is3D, _yield$set$plannerHan, dimensions, url;
33611
- return _regeneratorRuntime.wrap(function _callee30$(_context32) {
33612
- while (1) switch (_context32.prev = _context32.next) {
33572
+ return _regeneratorRuntime.wrap(function _callee29$(_context31) {
33573
+ while (1) switch (_context31.prev = _context31.next) {
33613
33574
  case 0:
33614
33575
  is3D = ['3DImage', '3DCOMB', 'BoxPlanner', 'RTViewer'].includes(set.getPlannerMode());
33615
33576
  if (!is3D) {
33616
- _context32.next = 10;
33577
+ _context31.next = 10;
33617
33578
  break;
33618
33579
  }
33619
- _context32.next = 4;
33580
+ _context31.next = 4;
33620
33581
  return set.plannerHandler.saveSetImage(overwriteLastSavedRendering);
33621
33582
  case 4:
33622
- _context32.next = 6;
33583
+ _context31.next = 6;
33623
33584
  return set.plannerHandler.getSetImageAsUrl(set.getSetId());
33624
33585
  case 6:
33625
- _yield$set$plannerHan = _context32.sent;
33586
+ _yield$set$plannerHan = _context31.sent;
33626
33587
  dimensions = _yield$set$plannerHan.dimensions;
33627
33588
  url = _yield$set$plannerHan.url;
33628
- return _context32.abrupt("return", {
33589
+ return _context31.abrupt("return", {
33629
33590
  dimensions: dimensions,
33630
33591
  url: url
33631
33592
  });
33632
33593
  case 10:
33633
- return _context32.abrupt("return", {
33594
+ return _context31.abrupt("return", {
33634
33595
  dimensions: {
33635
33596
  w: undefined,
33636
33597
  h: undefined,
@@ -33639,9 +33600,9 @@ var DivaSetHandler = /*#__PURE__*/function () {
33639
33600
  });
33640
33601
  case 11:
33641
33602
  case "end":
33642
- return _context32.stop();
33603
+ return _context31.stop();
33643
33604
  }
33644
- }, _callee30);
33605
+ }, _callee29);
33645
33606
  }));
33646
33607
  function getSetImage(_x107, _x108) {
33647
33608
  return _getSetImage.apply(this, arguments);
@@ -33651,43 +33612,43 @@ var DivaSetHandler = /*#__PURE__*/function () {
33651
33612
  }, {
33652
33613
  key: "getHQRenderScript",
33653
33614
  value: function () {
33654
- var _getHQRenderScript = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(set, divaNr) {
33615
+ var _getHQRenderScript = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30(set, divaNr) {
33655
33616
  var is3D, hqRenderScript, createdHQRenderScript;
33656
- return _regeneratorRuntime.wrap(function _callee31$(_context33) {
33657
- while (1) switch (_context33.prev = _context33.next) {
33617
+ return _regeneratorRuntime.wrap(function _callee30$(_context32) {
33618
+ while (1) switch (_context32.prev = _context32.next) {
33658
33619
  case 0:
33659
33620
  //if not 3d
33660
33621
  is3D = ['3DImage', '3DCOMB', 'BoxPlanner', 'RTViewer'].includes(set.getPlannerMode());
33661
33622
  if (is3D) {
33662
- _context33.next = 3;
33623
+ _context32.next = 3;
33663
33624
  break;
33664
33625
  }
33665
- return _context33.abrupt("return");
33626
+ return _context32.abrupt("return");
33666
33627
  case 3:
33667
- _context33.next = 5;
33628
+ _context32.next = 5;
33668
33629
  return set.plannerHandler.saveSetHQRenderScript();
33669
33630
  case 5:
33670
33631
  hqRenderScript = set.plannerHandler.getSetHQRenderScript();
33671
33632
  if (hqRenderScript) {
33672
- _context33.next = 8;
33633
+ _context32.next = 8;
33673
33634
  break;
33674
33635
  }
33675
- return _context33.abrupt("return");
33636
+ return _context32.abrupt("return");
33676
33637
  case 8:
33677
- _context33.next = 10;
33638
+ _context32.next = 10;
33678
33639
  return set.api.postHQRenderScript({
33679
33640
  divaNr: divaNr,
33680
33641
  hqRenderscript: hqRenderScript,
33681
33642
  organization: set.api.OrganizationId
33682
33643
  });
33683
33644
  case 10:
33684
- createdHQRenderScript = _context33.sent;
33685
- return _context33.abrupt("return", createdHQRenderScript);
33645
+ createdHQRenderScript = _context32.sent;
33646
+ return _context32.abrupt("return", createdHQRenderScript);
33686
33647
  case 12:
33687
33648
  case "end":
33688
- return _context33.stop();
33649
+ return _context32.stop();
33689
33650
  }
33690
- }, _callee31);
33651
+ }, _callee30);
33691
33652
  }));
33692
33653
  function getHQRenderScript(_x109, _x110) {
33693
33654
  return _getHQRenderScript.apply(this, arguments);
@@ -33703,32 +33664,32 @@ var DivaSetHandler = /*#__PURE__*/function () {
33703
33664
  }, {
33704
33665
  key: "getAlternateSetImages",
33705
33666
  value: (function () {
33706
- var _getAlternateSetImages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32(set) {
33667
+ var _getAlternateSetImages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(set) {
33707
33668
  var is2D, catalogData, setImages;
33708
- return _regeneratorRuntime.wrap(function _callee32$(_context34) {
33709
- while (1) switch (_context34.prev = _context34.next) {
33669
+ return _regeneratorRuntime.wrap(function _callee31$(_context33) {
33670
+ while (1) switch (_context33.prev = _context33.next) {
33710
33671
  case 0:
33711
33672
  is2D = !['3DImage', '3DCOMB', 'BoxPlanner'].includes(set.getPlannerMode());
33712
33673
  if (!(is2D || set.onlyRunLogic)) {
33713
- _context34.next = 3;
33674
+ _context33.next = 3;
33714
33675
  break;
33715
33676
  }
33716
- return _context34.abrupt("return", []);
33677
+ return _context33.abrupt("return", []);
33717
33678
  case 3:
33718
33679
  catalogData = set.CatalogData;
33719
- _context34.next = 6;
33680
+ _context33.next = 6;
33720
33681
  return set.plannerHandler.saveAlternateSetImages(catalogData.catalogCodex, catalogData.catalogGuid);
33721
33682
  case 6:
33722
- _context34.next = 8;
33683
+ _context33.next = 8;
33723
33684
  return set.plannerHandler.getAlternateSetImagesAsSetImageData(set.getSetId());
33724
33685
  case 8:
33725
- setImages = _context34.sent;
33726
- return _context34.abrupt("return", setImages);
33686
+ setImages = _context33.sent;
33687
+ return _context33.abrupt("return", setImages);
33727
33688
  case 10:
33728
33689
  case "end":
33729
- return _context34.stop();
33690
+ return _context33.stop();
33730
33691
  }
33731
- }, _callee32);
33692
+ }, _callee31);
33732
33693
  }));
33733
33694
  function getAlternateSetImages(_x111) {
33734
33695
  return _getAlternateSetImages.apply(this, arguments);
@@ -33738,28 +33699,28 @@ var DivaSetHandler = /*#__PURE__*/function () {
33738
33699
  }, {
33739
33700
  key: "get2DSetImage",
33740
33701
  value: function () {
33741
- var _get2DSetImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33(set) {
33702
+ var _get2DSetImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32(set) {
33742
33703
  var urlToPlanning2D, catalogData, planning2DAsJPGBase64;
33743
- return _regeneratorRuntime.wrap(function _callee33$(_context35) {
33744
- while (1) switch (_context35.prev = _context35.next) {
33704
+ return _regeneratorRuntime.wrap(function _callee32$(_context34) {
33705
+ while (1) switch (_context34.prev = _context34.next) {
33745
33706
  case 0:
33746
33707
  urlToPlanning2D = undefined, catalogData = set.CatalogData;
33747
33708
  planning2DAsJPGBase64 = set.getPlanning2DAsJpg();
33748
33709
  if (!(planning2DAsJPGBase64 != undefined && planning2DAsJPGBase64 != '' && planning2DAsJPGBase64 != 'data:,')) {
33749
- _context35.next = 6;
33710
+ _context34.next = 6;
33750
33711
  break;
33751
33712
  }
33752
- _context35.next = 5;
33713
+ _context34.next = 5;
33753
33714
  return set.plannerHandler.saveSet2DImage(set.getSetId(), catalogData.catalogCodex, catalogData.catalogGuid, planning2DAsJPGBase64);
33754
33715
  case 5:
33755
- urlToPlanning2D = _context35.sent;
33716
+ urlToPlanning2D = _context34.sent;
33756
33717
  case 6:
33757
- return _context35.abrupt("return", urlToPlanning2D);
33718
+ return _context34.abrupt("return", urlToPlanning2D);
33758
33719
  case 7:
33759
33720
  case "end":
33760
- return _context35.stop();
33721
+ return _context34.stop();
33761
33722
  }
33762
- }, _callee33);
33723
+ }, _callee32);
33763
33724
  }));
33764
33725
  function get2DSetImage(_x112) {
33765
33726
  return _get2DSetImage.apply(this, arguments);
@@ -33776,23 +33737,16 @@ var DivaSetHandler = /*#__PURE__*/function () {
33776
33737
  Y: (_dimensions$d = dimensions === null || dimensions === void 0 ? void 0 : dimensions.d) !== null && _dimensions$d !== void 0 ? _dimensions$d : bbox.depth,
33777
33738
  Z: (_dimensions$h = dimensions === null || dimensions === void 0 ? void 0 : dimensions.h) !== null && _dimensions$h !== void 0 ? _dimensions$h : bbox.height
33778
33739
  };
33779
- return _objectSpread$8(_objectSpread$8({}, dim), {}, {
33780
- 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' : '')
33740
+ if (set.PlannerMode == 'No') {
33741
+ var article = Object.values(set.getDivaArticles())[0];
33742
+ dim.X = article === null || article === void 0 ? void 0 : article.width;
33743
+ dim.Y = article === null || article === void 0 ? void 0 : article.depth;
33744
+ dim.Z = article === null || article === void 0 ? void 0 : article.height;
33745
+ }
33746
+ return _objectSpread$9(_objectSpread$9({}, dim), {}, {
33747
+ 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.Z + ' cm' : '')
33781
33748
  });
33782
33749
  }
33783
- }, {
33784
- key: "getAllProducts",
33785
- value: function getAllProducts(sets) {
33786
- var ret = {};
33787
- for (var key in sets) {
33788
- var productsQuantity = sets[key].getAllProducts();
33789
- for (var _key3 in productsQuantity) {
33790
- if (!ret[_key3]) ret[_key3] = 0;
33791
- ret[_key3] += productsQuantity[_key3];
33792
- }
33793
- }
33794
- return ret;
33795
- }
33796
33750
  }, {
33797
33751
  key: "findLoadedSet",
33798
33752
  value: function findLoadedSet(sets, catalogCodex, accountGUID) {
@@ -33807,23 +33761,23 @@ var DivaSetHandler = /*#__PURE__*/function () {
33807
33761
  }, {
33808
33762
  key: "addOrderSetArticlesToExistingSet",
33809
33763
  value: function () {
33810
- var _addOrderSetArticlesToExistingSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(set, orderSet, lastSetToInitialize) {
33811
- return _regeneratorRuntime.wrap(function _callee34$(_context36) {
33812
- while (1) switch (_context36.prev = _context36.next) {
33764
+ var _addOrderSetArticlesToExistingSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33(set, orderSet, lastSetToInitialize) {
33765
+ return _regeneratorRuntime.wrap(function _callee33$(_context35) {
33766
+ while (1) switch (_context35.prev = _context35.next) {
33813
33767
  case 0:
33814
33768
  //TODO: GLOBAL STUFF
33815
33769
  //this.updateActSet(set);
33816
33770
  orderSet.changeBasketIds();
33817
- _context36.next = 3;
33771
+ _context35.next = 3;
33818
33772
  return this.initOrderLineArticles(set, orderSet);
33819
33773
  case 3:
33820
- _context36.next = 5;
33774
+ _context35.next = 5;
33821
33775
  return set.plannerHandler.extendSet(set, orderSet.SetPlanData, lastSetToInitialize);
33822
33776
  case 5:
33823
33777
  case "end":
33824
- return _context36.stop();
33778
+ return _context35.stop();
33825
33779
  }
33826
- }, _callee34, this);
33780
+ }, _callee33, this);
33827
33781
  }));
33828
33782
  function addOrderSetArticlesToExistingSet(_x113, _x114, _x115) {
33829
33783
  return _addOrderSetArticlesToExistingSet.apply(this, arguments);
@@ -33842,9 +33796,9 @@ var DivaSetHandler = /*#__PURE__*/function () {
33842
33796
  }();
33843
33797
  var setHandlerInstance = new DivaSetHandler();
33844
33798
 
33845
- function ownKeys$7(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; }
33846
- function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
33847
- var LOG$7 = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
33799
+ 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; }
33800
+ 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(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; }
33801
+ var LOG$8 = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
33848
33802
  var DivaBasketHandler = /*#__PURE__*/function () {
33849
33803
  function DivaBasketHandler(plannerConfig) {
33850
33804
  var _this = this,
@@ -33880,7 +33834,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
33880
33834
  this.assignNewDivaNr = !!this.plannerConfig.assignNewDivaNr;
33881
33835
  this._handler = plannerConfig.handler;
33882
33836
  if (this.plannerConfig.divaNr == undefined && this.plannerConfig.basketData == undefined && this.plannerConfig.catalogCodex == undefined && this.plannerConfig.productId == undefined && this.plannerConfig.customProductId == undefined && this.plannerConfig.returnTo != 'TEST_CONFIGURATORLOGIC' && !((_this$plannerConfig$s = this.plannerConfig.settings) !== null && _this$plannerConfig$s !== void 0 && (_this$plannerConfig$s = _this$plannerConfig$s.ViewConfig) !== null && _this$plannerConfig$s !== void 0 && (_this$plannerConfig$s = _this$plannerConfig$s.plannerType) !== null && _this$plannerConfig$s !== void 0 && _this$plannerConfig$s.includes('PRODUCTS') || (_this$plannerConfig$s2 = this.plannerConfig.settings) !== null && _this$plannerConfig$s2 !== void 0 && (_this$plannerConfig$s2 = _this$plannerConfig$s2.ViewConfig) !== null && _this$plannerConfig$s2 !== void 0 && (_this$plannerConfig$s2 = _this$plannerConfig$s2.plannerType) !== null && _this$plannerConfig$s2 !== void 0 && _this$plannerConfig$s2.includes('PROMOTED'))) {
33883
- LOG$7.error(new DivaError('Keine Öffnungsparameter', {
33837
+ LOG$8.error(new DivaError('Keine Öffnungsparameter', {
33884
33838
  code: 'WC_0003'
33885
33839
  }));
33886
33840
  }
@@ -33890,7 +33844,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
33890
33844
  }
33891
33845
  if ((_this$plannerConfig$a = this.plannerConfig.apiConfig) !== null && _this$plannerConfig$a !== void 0 && _this$plannerConfig$a.basketService) {
33892
33846
  var _this$plannerConfig$a2, _this$plannerConfig$a3;
33893
- this._basketHandler = new BasketHandler(LOG$7, (_this$plannerConfig$a2 = this.plannerConfig.apiConfig) === null || _this$plannerConfig$a2 === void 0 ? void 0 : _this$plannerConfig$a2.basketService, (_this$plannerConfig$a3 = this.plannerConfig.apiConfig) === null || _this$plannerConfig$a3 === void 0 ? void 0 : _this$plannerConfig$a3.api2["default"]);
33847
+ this._basketHandler = new BasketHandler(LOG$8, (_this$plannerConfig$a2 = this.plannerConfig.apiConfig) === null || _this$plannerConfig$a2 === void 0 ? void 0 : _this$plannerConfig$a2.basketService, (_this$plannerConfig$a3 = this.plannerConfig.apiConfig) === null || _this$plannerConfig$a3 === void 0 ? void 0 : _this$plannerConfig$a3.api2["default"]);
33894
33848
  }
33895
33849
  }
33896
33850
  return _createClass(DivaBasketHandler, [{
@@ -33959,7 +33913,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
33959
33913
  case 0:
33960
33914
  this.basketWasSavedWithCurrentDocVersion = false;
33961
33915
  this.startProductId = undefined;
33962
- LOG$7.debug("Basket initialising. initObject is: '", this.plannerConfig, "' divaNr to load is: '" + this.loadDivaNr + "'");
33916
+ LOG$8.debug("Basket initialising. initObject is: '", this.plannerConfig, "' divaNr to load is: '" + this.loadDivaNr + "'");
33963
33917
  if (this.ignoreInitObjectWhenInitializing) {
33964
33918
  _context.next = 37;
33965
33919
  break;
@@ -34136,7 +34090,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34136
34090
  title: (_api$getI18n = api.getI18n()) === null || _api$getI18n === void 0 ? void 0 : _api$getI18n.t('configurator.no_startproduct_defined_title'),
34137
34091
  text: (_api$getI18n2 = api.getI18n()) === null || _api$getI18n2 === void 0 ? void 0 : _api$getI18n2.t('configurator.no_startproduct_defined_text')
34138
34092
  });
34139
- LOG$7.error(new DivaError('it is configured to initialize the startProductForOrganizations if there are no other parameters. But no available product was found with organizationId: "' + this.plannerConfig.currentOrganization._id + '" in the field: "startProductForOrganizations"!'));
34093
+ LOG$8.error(new DivaError('it is configured to initialize the startProductForOrganizations if there are no other parameters. But no available product was found with organizationId: "' + this.plannerConfig.currentOrganization._id + '" in the field: "startProductForOrganizations"!'));
34140
34094
  case 84:
34141
34095
  _context.next = 91;
34142
34096
  break;
@@ -34304,12 +34258,12 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34304
34258
  case 0:
34305
34259
  basketFromAPI = (_dataFromApi$basket = dataFromApi.basket) !== null && _dataFromApi$basket !== void 0 ? _dataFromApi$basket : dataFromApi.Basket; //evaluateRopoEffect(basketFromAPI,);
34306
34260
  if (origProductId) basketFromAPI.OrigProductId = origProductId;
34307
- basket = _objectSpread$7({}, basketFromAPI);
34261
+ basket = _objectSpread$8({}, basketFromAPI);
34308
34262
  if (!basketFromAPI) {
34309
34263
  _context5.next = 48;
34310
34264
  break;
34311
34265
  }
34312
- LOG$7.debug('divaNr: ' + divaNr + ' was loaded successfully from server!');
34266
+ LOG$8.debug('divaNr: ' + divaNr + ' was loaded successfully from server!');
34313
34267
  if (basketFromAPI.OrigDivaNr) {
34314
34268
  this.origConfiguration.originDivaNr = basketFromAPI.OrigDivaNr;
34315
34269
  } else if (basketFromAPI.OrigCatalogCodex) {
@@ -34432,8 +34386,9 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34432
34386
  }
34433
34387
  }, {
34434
34388
  key: "getBasketData",
34435
- value: function getBasketData(divaNr) {
34436
- return this.baskets[divaNr];
34389
+ value: function getBasketData(divaNr, variantId) {
34390
+ var _this$baskets;
34391
+ return (_this$baskets = this.baskets[divaNr + '-' + variantId]) !== null && _this$baskets !== void 0 ? _this$baskets : this.baskets[divaNr];
34437
34392
  }
34438
34393
  }, {
34439
34394
  key: "setBasketData",
@@ -34520,7 +34475,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34520
34475
  case 9:
34521
34476
  _context7.prev = 9;
34522
34477
  _context7.t0 = _context7["catch"](0);
34523
- LOG$7.error(new DivaError('DivaNr cannot be found in Database', {
34478
+ LOG$8.error(new DivaError('DivaNr cannot be found in Database', {
34524
34479
  code: 'WC_0004',
34525
34480
  custom: {
34526
34481
  divaNr: divaNr
@@ -34557,7 +34512,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34557
34512
  _context8.next = 9;
34558
34513
  break;
34559
34514
  }
34560
- LOG$7.error(new DivaError('CustomProductId cannot be found in Database', {
34515
+ LOG$8.error(new DivaError('CustomProductId cannot be found in Database', {
34561
34516
  code: 'WC_0005',
34562
34517
  custom: {
34563
34518
  key: key,
@@ -34573,7 +34528,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34573
34528
  case 12:
34574
34529
  _context8.prev = 12;
34575
34530
  _context8.t0 = _context8["catch"](0);
34576
- LOG$7.error(new DivaError('Error while fetching product data', {
34531
+ LOG$8.error(new DivaError('Error while fetching product data', {
34577
34532
  code: 'WC_0005',
34578
34533
  custom: {
34579
34534
  productId: productId
@@ -34607,7 +34562,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34607
34562
  _context9.next = 6;
34608
34563
  break;
34609
34564
  }
34610
- LOG$7.error(new DivaError('ProductId konnte in der Datenbank nicht gefunden werden', {
34565
+ LOG$8.error(new DivaError('ProductId konnte in der Datenbank nicht gefunden werden', {
34611
34566
  code: 'WC_0005',
34612
34567
  custom: {
34613
34568
  productId: productId
@@ -34850,7 +34805,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34850
34805
  if (_loop2()) continue;
34851
34806
  }
34852
34807
  var variantValues = article.VariantValuesParentOption;
34853
- var data = _objectSpread$7(_objectSpread$7({}, this.actBasket), {}, {
34808
+ var data = _objectSpread$8(_objectSpread$8({}, this.actBasket), {}, {
34854
34809
  changedValues: changedValues,
34855
34810
  variantValues: variantValues,
34856
34811
  isInit: isInit,
@@ -34875,7 +34830,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34875
34830
  break;
34876
34831
  case 3:
34877
34832
  _context12.next = 5;
34878
- return import('./PfisterWWSHandler-55960acc.js');
34833
+ return import('./PfisterWWSHandler-327b06c0.js');
34879
34834
  case 5:
34880
34835
  _yield$import = _context12.sent;
34881
34836
  PfisterWWSHandler = _yield$import["default"];
@@ -34883,7 +34838,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34883
34838
  return _context12.abrupt("break", 27);
34884
34839
  case 9:
34885
34840
  _context12.next = 11;
34886
- return import('./LiviqueWWSHandler-36b3f3bf.js');
34841
+ return import('./LiviqueWWSHandler-b01ffddd.js');
34887
34842
  case 11:
34888
34843
  _yield$import2 = _context12.sent;
34889
34844
  LiviqueWWSHandler = _yield$import2["default"];
@@ -34891,7 +34846,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34891
34846
  return _context12.abrupt("break", 27);
34892
34847
  case 15:
34893
34848
  _context12.next = 17;
34894
- return import('./SeriousBasketHandler-6c11ee06.js');
34849
+ return import('./SeriousBasketHandler-36a1b987.js');
34895
34850
  case 17:
34896
34851
  _yield$import3 = _context12.sent;
34897
34852
  SeriousWWSHandler = _yield$import3["default"];
@@ -34899,7 +34854,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34899
34854
  return _context12.abrupt("break", 27);
34900
34855
  case 21:
34901
34856
  _context12.next = 23;
34902
- return import('./StandardWWSHandler-4f44c130.js');
34857
+ return import('./StandardWWSHandler-96622950.js');
34903
34858
  case 23:
34904
34859
  _yield$import4 = _context12.sent;
34905
34860
  StandardWWSHandler = _yield$import4["default"];
@@ -34919,6 +34874,175 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34919
34874
  }]);
34920
34875
  }();
34921
34876
 
34877
+ function ownKeys$7(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; }
34878
+ function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
34879
+ var LOG$7 = DivaUtils.initLog('Products', 'WEB-PLANNER-LOGIC');
34880
+ var DivaProductHandler = /*#__PURE__*/function () {
34881
+ function DivaProductHandler() {
34882
+ _classCallCheck(this, DivaProductHandler);
34883
+ }
34884
+ return _createClass(DivaProductHandler, [{
34885
+ key: "updateProducts",
34886
+ value: function () {
34887
+ var _updateProducts = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(sets, api, wwsHandler, from) {
34888
+ var set, _ref, customProductNrsPair, matchPrefix, data, _ref2, products, customProducts;
34889
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
34890
+ while (1) switch (_context.prev = _context.next) {
34891
+ case 0:
34892
+ if (!(sets.length > 1)) {
34893
+ _context.next = 3;
34894
+ break;
34895
+ }
34896
+ console.error('matching product logic with more than one set needs to implemented');
34897
+ return _context.abrupt("return");
34898
+ case 3:
34899
+ set = sets[0];
34900
+ set.setMatchingProduct();
34901
+ set.SetArticleNr = undefined;
34902
+ set.SetArticleNrPrefix = undefined;
34903
+ this.setCustonProductNrFieldsOnArticles(set, [], []);
34904
+ _ref = wwsHandler.getCustomIdsForProductsMatch(set), customProductNrsPair = _ref.customProductNrsPair, matchPrefix = _ref.matchPrefix;
34905
+ data = {
34906
+ catalogs: sets.map(function (set) {
34907
+ return {
34908
+ articles: Object.values(set.getDivaArticles()).map(function (article) {
34909
+ return {
34910
+ codex: article.articleCodex,
34911
+ hash: article.articleProductHash
34912
+ };
34913
+ }),
34914
+ catalogGuid: set.CatalogData.catalogGuid
34915
+ };
34916
+ }),
34917
+ organizationId: api.OrganizationId,
34918
+ customProductNrs: customProductNrsPair.map(function (c) {
34919
+ return c.customProductNrs;
34920
+ })
34921
+ };
34922
+ _context.next = 12;
34923
+ return api.getDataCache(api.checkMatchingProducts(), md5(JSON.stringify(_objectSpread$7(_objectSpread$7({}, data), {}, {
34924
+ organizationId: api.OrganizationId
34925
+ }))), '', 'catalog', 'POST', data);
34926
+ case 12:
34927
+ _ref2 = _context.sent;
34928
+ products = _ref2.products;
34929
+ customProducts = _ref2.customProducts;
34930
+ LOG$7.debug('matchingProducts triggered by: ' + from, products, customProducts);
34931
+ if (products.length) this.handleFountMatchingProducts(set, products, undefined, matchPrefix);else if (customProducts.length) this.setCustonProductNrFieldsOnArticles(set, customProducts, customProductNrsPair);
34932
+ case 17:
34933
+ case "end":
34934
+ return _context.stop();
34935
+ }
34936
+ }, _callee, this);
34937
+ }));
34938
+ function updateProducts(_x, _x2, _x3, _x4) {
34939
+ return _updateProducts.apply(this, arguments);
34940
+ }
34941
+ return updateProducts;
34942
+ }()
34943
+ }, {
34944
+ key: "handleFountMatchingProducts",
34945
+ value: function handleFountMatchingProducts(set, products, setHash, matchPrefix) {
34946
+ var _product$retailerArti, _product$discountedPr, _product$discountedPr2, _product$discountedPr3;
34947
+ var product = this.cheapestOfMatchingProducts(products);
34948
+ var calculatedPrice = set.getSetPrice(true);
34949
+ set.SetArticleNr = (_product$retailerArti = product.retailerArticleNr) === null || _product$retailerArti === void 0 ? void 0 : _product$retailerArti.toString();
34950
+ set.SetArticleNrPrefix = matchPrefix;
34951
+ if (!product.discountedPrice && product.addedPrice === product.calculatedPrice && calculatedPrice == product.calculatedPrice) {
34952
+ //no discount
34953
+ set.setMatchingProduct({
34954
+ discountPrice: 0,
34955
+ origPrice: product.addedPrice,
34956
+ percentage: 0
34957
+ });
34958
+ return;
34959
+ }
34960
+ var discountExists = !!product.discountedPrice || set.CatalogData.discountPercentage;
34961
+ //hier ist noch zu unterscheide ob der Rabatt nur angeziegt werden soll oder auch in der WWS logic angewendet werden soll
34962
+ var currentProduct = {
34963
+ discountPrice: (_product$discountedPr = product.discountedPrice) !== null && _product$discountedPr !== void 0 ? _product$discountedPr : 0,
34964
+ onlyViewDiscountedPrice: (_product$discountedPr2 = product.discountedPrice) !== null && _product$discountedPr2 !== void 0 ? _product$discountedPr2 : 0,
34965
+ origPrice: product.addedPrice,
34966
+ percentage: (calculatedPrice - ((_product$discountedPr3 = product.discountedPrice) !== null && _product$discountedPr3 !== void 0 ? _product$discountedPr3 : product.addedPrice)) / (calculatedPrice / 100),
34967
+ bruttoPercentage: !!product.addedPrice && discountExists && product.discountedPrice !== product.addedPrice ? (calculatedPrice - product.addedPrice) / (calculatedPrice / 100) : undefined,
34968
+ retailerArticleNr: product.retailerArticleNr,
34969
+ setHash: setHash,
34970
+ _id: product._id
34971
+ };
34972
+ if (setHash) set.setMatchingOrigProduct(currentProduct);
34973
+ set.setMatchingProduct(currentProduct);
34974
+ }
34975
+ }, {
34976
+ key: "setCustonProductNrFieldsOnArticles",
34977
+ value: function setCustonProductNrFieldsOnArticles(set, customProducts, customProductNrsPair) {
34978
+ var articles = set.getDivaArticles(false, true);
34979
+ for (var key in articles) {
34980
+ articles[key].discountPercentage = undefined;
34981
+ }
34982
+ var _loop = function _loop() {
34983
+ var _customProductNrsPair, _customProductNrsPair2;
34984
+ var customNr = customProducts[i];
34985
+ var basketIds = (_customProductNrsPair = (_customProductNrsPair2 = customProductNrsPair.find(function (c) {
34986
+ return c.customProductNrs == customNr.retailerArticleNr.toString();
34987
+ })) === null || _customProductNrsPair2 === void 0 ? void 0 : _customProductNrsPair2.basketIds) !== null && _customProductNrsPair !== void 0 ? _customProductNrsPair : [];
34988
+ for (var j = 0; j < basketIds.length; j++) {
34989
+ articles[basketIds[j]].discountPercentage = customNr.percentageDiscount;
34990
+ }
34991
+ };
34992
+ for (var i = 0; i < customProducts.length; i++) {
34993
+ _loop();
34994
+ }
34995
+ }
34996
+ }, {
34997
+ key: "cheapestOfMatchingProducts",
34998
+ value: function cheapestOfMatchingProducts(products) {
34999
+ var bestIndex = 0;
35000
+ for (var i = 1; i < products.length; i++) {
35001
+ var _currentBestProduct$d, _potencialBetterProdu;
35002
+ var currentBestProduct = products[bestIndex];
35003
+ var potencialBetterProduct = products[i];
35004
+ if (((_currentBestProduct$d = currentBestProduct.discountedPrice) !== null && _currentBestProduct$d !== void 0 ? _currentBestProduct$d : currentBestProduct.addedPrice) > ((_potencialBetterProdu = potencialBetterProduct.discountedPrice) !== null && _potencialBetterProdu !== void 0 ? _potencialBetterProdu : potencialBetterProduct.addedPrice)) {
35005
+ bestIndex = i;
35006
+ }
35007
+ }
35008
+ return products[bestIndex];
35009
+ }
35010
+
35011
+ /**
35012
+ * Schlaraffia specific code
35013
+ */
35014
+ }, {
35015
+ key: "getBestMatch",
35016
+ value: function getBestMatch(articles, products) {
35017
+ var OPTION_CODEX = 'KOPFTEIL';
35018
+ if (!articles) return;
35019
+ for (var key in articles) {
35020
+ var _article$VariantValue;
35021
+ var article = articles[key];
35022
+ var opv = (_article$VariantValue = article.VariantValues['OPT' + OPTION_CODEX]) === null || _article$VariantValue === void 0 ? void 0 : _article$VariantValue.replace('OPV', '');
35023
+ if (!products || !opv) continue;
35024
+ for (var i = 0; i < products.length; i++) {
35025
+ var _products$i$affiliate;
35026
+ if ((_products$i$affiliate = products[i].affiliate) !== null && _products$i$affiliate !== void 0 && _products$i$affiliate.length) if (this.findOPVCodexInVariantValues(products[i], OPTION_CODEX, opv)) {
35027
+ return products[i];
35028
+ }
35029
+ }
35030
+ }
35031
+ return undefined;
35032
+ }
35033
+ }, {
35034
+ key: "findOPVCodexInVariantValues",
35035
+ value: function findOPVCodexInVariantValues(product, opt, opv) {
35036
+ return product.articles.find(function (article) {
35037
+ return article.variantValues.find(function (variant) {
35038
+ return variant.OPT === opt && variant.OPV === opv;
35039
+ });
35040
+ });
35041
+ }
35042
+ }]);
35043
+ }();
35044
+ var productHandlerInstance = new DivaProductHandler();
35045
+
34922
35046
  var LOG$6 = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
34923
35047
  var ViewPointHandler = /*#__PURE__*/function () {
34924
35048
  function ViewPointHandler() {
@@ -35551,6 +35675,14 @@ var Rendering = /*#__PURE__*/function () {
35551
35675
  return this.uiInfo[setId] != undefined && this.uiInfo[setId]['E' + elementid] != undefined;
35552
35676
  }
35553
35677
  }
35678
+
35679
+ /**This function returns the entry of the BBOXGEO from the UIPolygon Information in order to process when working with hybrid3D Viewer */
35680
+ }, {
35681
+ key: "getBBoxGeoFromUnity",
35682
+ value: function getBBoxGeoFromUnity() {
35683
+ if (this.uiInfo && this.uiInfo['BBOXGEO']) return this.uiInfo['BBOXGEO'];
35684
+ return null;
35685
+ }
35554
35686
  }, {
35555
35687
  key: "getOutlinePolygonForSVG",
35556
35688
  value: function getOutlinePolygonForSVG(setId, elementId, viewPortSize) {
@@ -36027,8 +36159,9 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36027
36159
  //function called when no render client is found when only updating view
36028
36160
  _defineProperty(this, "renderSettings", void 0);
36029
36161
  _defineProperty(this, "todoAfterLogin", void 0);
36162
+ _defineProperty(this, "currentCamera", void 0);
36030
36163
  _defineProperty(this, "jwt", void 0);
36031
- _defineProperty(this, "latestCamera", void 0);
36164
+ _defineProperty(this, "latestHybridInfo", void 0);
36032
36165
  /**
36033
36166
  * This function is called from the connectionHandler when something happens during requesting rendering.
36034
36167
  * Eg. there is no free renderClient
@@ -36234,7 +36367,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36234
36367
  while (1) switch (_context3.prev = _context3.next) {
36235
36368
  case 0:
36236
36369
  _context3.next = 2;
36237
- return import('./Host3DSignalR-cc8579c6.js');
36370
+ return import('./Host3DSignalR-9222f4e5.js');
36238
36371
  case 2:
36239
36372
  _yield$import = _context3.sent;
36240
36373
  Host3DSignalR = _yield$import["default"];
@@ -36326,7 +36459,8 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36326
36459
  value: function onReceiveHQRenderScript(planningHash, hqRenderScriptString) {
36327
36460
  if (!this.waitForHQRenderScript.has(planningHash)) return;
36328
36461
  var hqRenderScript = this.waitForHQRenderScript.get(planningHash);
36329
- this.lastSavedHQRenderScript = JSON.parse(hqRenderScriptString);
36462
+ var hqr = JSON.parse(hqRenderScriptString);
36463
+ this.lastSavedHQRenderScript = hqr;
36330
36464
  hqRenderScript.HqRenderScript = hqRenderScriptString;
36331
36465
  this.hqRenderScriptCache.set(planningHash, hqRenderScript);
36332
36466
  this.waitForHQRenderScript["delete"](planningHash);
@@ -36336,9 +36470,9 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36336
36470
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
36337
36471
  var _step$value = _slicedToArray(_step.value, 2),
36338
36472
  key = _step$value[0],
36339
- hqr = _step$value[1];
36340
- if (!(hqr !== null && hqr !== void 0 && hqr.CreationTime)) continue;
36341
- if (hqr.CreationTime < hqRenderScript.CreationTime) this.waitForHQRenderScript["delete"](key);
36473
+ _hqr = _step$value[1];
36474
+ if (!(_hqr !== null && _hqr !== void 0 && _hqr.CreationTime)) continue;
36475
+ if (_hqr.CreationTime < hqRenderScript.CreationTime) this.waitForHQRenderScript["delete"](key);
36342
36476
  }
36343
36477
  } catch (err) {
36344
36478
  _iterator.e(err);
@@ -36687,7 +36821,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36687
36821
  value: (function () {
36688
36822
  var _request3D = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(params) {
36689
36823
  var _params$renderRequest, _params$renderRequest2, _params$renderRequest3, _params$renderRequest4, _params$renderRequest5, _params$renderRequest6, _this$viewPointHandle;
36690
- var room, newRenderSize, doReloadWholePlanning, camera, planningHash, requestRenderingFrom3DHost, requestHqRenderScriptFrom3DHost, rendering, renderHash, viewPointName, functionType, sizeInfo, _rendering, fullscreenRendering, renderingInCacheFound, _this$connectionHandl6, _plannerMeasureDigits, returnRequest;
36824
+ var room, newRenderSize, doReloadWholePlanning, hybridInfo, planningHash, requestRenderingFrom3DHost, requestHqRenderScriptFrom3DHost, rendering, renderHash, viewPointName, functionType, sizeInfo, _rendering, fullscreenRendering, renderingInCacheFound, _this$connectionHandl6, _plannerMeasureDigits, returnRequest;
36691
36825
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
36692
36826
  while (1) switch (_context7.prev = _context7.next) {
36693
36827
  case 0:
@@ -36700,23 +36834,32 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36700
36834
  this.todoAfterLogin.request3D.doRequest3D = true;
36701
36835
  return _context7.abrupt("return");
36702
36836
  case 5:
36703
- LOG$4.debug('Request New 3D rendering: ' + (params === null || params === void 0 ? void 0 : params.doRequestRendering) + ', hqRenderScript: ' + (params === null || params === void 0 ? void 0 : params.doRequestHqRenderScript), 'PlannerHandler3D');
36704
36837
  room = this.viewPointHandler.getCurRoomCodex();
36705
36838
  newRenderSize = this.setRoomInfoInPlanningData(params.planningData, (_params$renderRequest = (_params$renderRequest2 = params.renderRequestInfos) === null || _params$renderRequest2 === void 0 ? void 0 : _params$renderRequest2.width) !== null && _params$renderRequest !== void 0 ? _params$renderRequest : 500, (_params$renderRequest3 = (_params$renderRequest4 = params.renderRequestInfos) === null || _params$renderRequest4 === void 0 ? void 0 : _params$renderRequest4.height) !== null && _params$renderRequest3 !== void 0 ? _params$renderRequest3 : 500, (_params$renderRequest5 = (_params$renderRequest6 = params.renderRequestInfos) === null || _params$renderRequest6 === void 0 ? void 0 : _params$renderRequest6.mediaServiceSaveMode) !== null && _params$renderRequest5 !== void 0 ? _params$renderRequest5 : undefined);
36706
36839
  doReloadWholePlanning = true;
36707
36840
  if (params.doRequestRendering) {
36708
36841
  params.renderRequestInfos.width = newRenderSize.newRenderWidth;
36709
36842
  params.renderRequestInfos.height = newRenderSize.newRenderHeight;
36710
- if (params.renderRequestInfos.mediaServiceSaveMode == 'PERMANENT') doReloadWholePlanning = true;
36711
36843
  }
36712
36844
 
36713
36845
  //Check if viewPoint is changed based on alternateRendering
36714
36846
  //Do check if viewpoint has to be changed
36715
36847
  if (params.alternateRenderInfo && (params.alternateRenderInfo.overwrittenViewPointName || params.alternateRenderInfo.viewPointName)) this.handleStaticVP(params.alternateRenderInfo.overwrittenViewPointName ? params.alternateRenderInfo.overwrittenViewPointName : params.alternateRenderInfo.viewPointName);
36716
- camera = params.camera ? params.camera : params.useLatestCamera ? this.latestCamera : undefined;
36717
- planningHash = md5(JSON.stringify(params.planningData) + JSON.stringify(camera));
36848
+ hybridInfo = params.hybrid3DInfo || !this.latestHybridInfo ? params.hybrid3DInfo : _objectSpread$6(_objectSpread$6({}, this.latestHybridInfo), {}, {
36849
+ focus: _objectSpread$6(_objectSpread$6({}, this.latestHybridInfo.focus), {}, {
36850
+ rotationCenter: this.currentCamera.targetPos,
36851
+ adjustZoomInUnity: true,
36852
+ onlyAdjustZoomBBChanged: true
36853
+ }),
36854
+ currentCamera: this.currentCamera
36855
+ }); //When we do need to adjust the zoom in unity based on Bbox changed - send last bboxinformation
36856
+ if (this.currRendering && hybridInfo && hybridInfo.focus.adjustZoomInUnity && hybridInfo.focus.onlyAdjustZoomBBChanged) {
36857
+ hybridInfo.bboxgeoInfoLastFrame = this.currRendering.getBBoxGeoFromUnity();
36858
+ }
36859
+ planningHash = md5(JSON.stringify(params.planningData));
36718
36860
  if (planningHash == this.lastFramePlanningHash) doReloadWholePlanning = false;
36719
36861
  if (params.forceReloadPlanning || (_this$viewPointHandle = this.viewPointHandler.getCurRoomlistVP()) !== null && _this$viewPointHandle !== void 0 && _this$viewPointHandle.isStatic) doReloadWholePlanning = true;
36862
+ if (params.renderRequestInfos && params.renderRequestInfos.mediaServiceSaveMode == 'PERMANENT') doReloadWholePlanning = true;
36720
36863
  this.lastFramePlanningHash = planningHash;
36721
36864
  requestRenderingFrom3DHost = false;
36722
36865
  requestHqRenderScriptFrom3DHost = false;
@@ -36743,7 +36886,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36743
36886
  if (params.doRequestRendering) {
36744
36887
  viewPointName = this.viewPointHandler.getCurViewPointToRender();
36745
36888
  sizeInfo = params.renderRequestInfos.width + ':' + params.renderRequestInfos.height;
36746
- renderHash = md5(JSON.stringify(params.planningData) + '#' + room + '#' + viewPointName + '#' + sizeInfo + '#' + JSON.stringify(camera));
36889
+ renderHash = md5(JSON.stringify(params.planningData) + '#' + room + '#' + viewPointName + '#' + sizeInfo + '#' + JSON.stringify(hybridInfo === null || hybridInfo === void 0 ? void 0 : hybridInfo.currentCamera));
36747
36890
  this.lastRequestedRenderHash = renderHash;
36748
36891
  LOG$4.debug('Request New Rendering with hash ' + renderHash + '; and planningHash: ' + planningHash, 'PlannerHandler3D');
36749
36892
  if (this.checkIsRenderingCached(renderHash, params.renderRequestInfos.planner3DGridEnabled, params.renderRequestInfos.mediaServiceSaveMode)) {
@@ -36776,7 +36919,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36776
36919
  }
36777
36920
  }
36778
36921
  if (!(requestHqRenderScriptFrom3DHost || requestRenderingFrom3DHost)) {
36779
- _context7.next = 32;
36922
+ _context7.next = 34;
36780
36923
  break;
36781
36924
  }
36782
36925
  if (params.catalogData.lang) params.planningData.SCE.Lang = params.catalogData.lang;
@@ -36803,20 +36946,20 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36803
36946
  viewPointInfo: this.viewPointHandler.getCurRoomlistVP(),
36804
36947
  alternateRenderingsExist: params.alternateRenderingsExist,
36805
36948
  alternateRenderInfo: params.alternateRenderInfo,
36806
- camera: camera,
36807
- forceUseCam: !!camera
36949
+ hybrid3DInfo: hybridInfo
36808
36950
  } : undefined
36809
36951
  });
36810
- if (params.camera) this.latestCamera = params.camera;
36952
+ if (hybridInfo !== null && hybridInfo !== void 0 && hybridInfo.currentCamera) this.currentCamera = hybridInfo === null || hybridInfo === void 0 ? void 0 : hybridInfo.currentCamera;
36953
+ if (hybridInfo) this.latestHybridInfo = hybridInfo;
36811
36954
  if (!(returnRequest === undefined || requestHqRenderScriptFrom3DHost && returnRequest.hqRenderScript == undefined || requestRenderingFrom3DHost && returnRequest.rendering == undefined)) {
36812
- _context7.next = 30;
36955
+ _context7.next = 32;
36813
36956
  break;
36814
36957
  }
36815
36958
  LOG$4.error(new DivaError('Error requesting the 3D from host. RequestHqRenderScript: ' + requestHqRenderScriptFrom3DHost + '; RequestRendering: ' + requestRenderingFrom3DHost, {
36816
36959
  code: 'WC_0013'
36817
36960
  }));
36818
36961
  return _context7.abrupt("return");
36819
- case 30:
36962
+ case 32:
36820
36963
  if (requestHqRenderScriptFrom3DHost) {
36821
36964
  if (this.waitForHQRenderScript.has(planningHash)) this.waitForHQRenderScript["delete"](planningHash);
36822
36965
  this.waitForHQRenderScript.set(planningHash, returnRequest.hqRenderScript);
@@ -36828,12 +36971,12 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36828
36971
  if (returnRequest.rendering.getIsAlternateRendering()) this.addAlternateRenderingToSavedAlternateRenderings(returnRequest.rendering);else this.lastSavedRendering = returnRequest.rendering;
36829
36972
  }
36830
36973
  }
36831
- case 32:
36974
+ case 34:
36832
36975
  return _context7.abrupt("return", {
36833
36976
  planningHash: planningHash,
36834
36977
  renderHash: renderHash
36835
36978
  });
36836
- case 33:
36979
+ case 35:
36837
36980
  case "end":
36838
36981
  return _context7.stop();
36839
36982
  }
@@ -37017,6 +37160,11 @@ var PlannerHandler3D = /*#__PURE__*/function () {
37017
37160
  value: function setOrigConfigurationCallback(callback) {
37018
37161
  this.getOrigConfiguration = callback;
37019
37162
  }
37163
+ }, {
37164
+ key: "updateCamPosition",
37165
+ value: function updateCamPosition(cam) {
37166
+ this.currentCamera = cam;
37167
+ }
37020
37168
  }, {
37021
37169
  key: "getLastSavedHQRenderScript",
37022
37170
  value: function getLastSavedHQRenderScript() {
@@ -37076,7 +37224,8 @@ var PlannerHandler3D = /*#__PURE__*/function () {
37076
37224
  _this2.liveArSocket.auth = _objectSpread$6(_objectSpread$6({}, _this2.liveArSocket.auth), {}, {
37077
37225
  connectionId: data.connectionId
37078
37226
  });
37079
- resolve(_this2.liveArViewerUrl + '?liveArConnectionId=' + data.connectionId + '&organizationId=' + _this2.renderSettings.OrganizationId + '&divaSessionId=' + DivaUtils.SessionId + DivaUtils.ConfigurationId ? '&configurationId=' + DivaUtils.ConfigurationId : '');
37227
+ var apllyConfiguratorSessionId = DivaUtils.ConfigurationId ? '&configurationId=' + DivaUtils.ConfigurationId : '';
37228
+ resolve(_this2.liveArViewerUrl + '?liveArConnectionId=' + data.connectionId + '&organizationId=' + _this2.renderSettings.OrganizationId + '&divaSessionId=' + DivaUtils.SessionId + apllyConfiguratorSessionId);
37080
37229
  });
37081
37230
  _this2.liveArSocket.on('connect_error', function (err) {
37082
37231
  return reject(err);
@@ -37549,7 +37698,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
37549
37698
  */
37550
37699
  _defineProperty(this, "noRenderClientFound", function (doMakeRendering, doMakeHQRenderScript, width, height, isFullscreenRendering, planner3DGridEnabled, doShow3DDimensionLines, plannerMeasureDigits, alternateRendererInfo, alternateRenderingsExist) {
37551
37700
  LOG$2.debug('noRenderClientFound - Request rendering again by sending all planningData');
37552
- _this.request3D(doMakeRendering, doMakeHQRenderScript, !!alternateRenderingsExist, alternateRendererInfo, true, {
37701
+ _this.request3D(doMakeRendering, doMakeHQRenderScript, true, !!alternateRenderingsExist, alternateRendererInfo, true, {
37553
37702
  width: width,
37554
37703
  height: height,
37555
37704
  isFullscreenRendering: isFullscreenRendering,
@@ -37581,7 +37730,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
37581
37730
  renderGroup = initSetState.api.get3DRenderGroup();
37582
37731
  this.plannerHandlerFunctions = plannerHandlerFunctions;
37583
37732
  diva3dServerUrl = initSetState.api.get3DServerUrl();
37584
- divaMediaServiceUrl = initSetState.api.getDivaMediaServiceUrl(); // renderGroup = 'LeaTest';
37733
+ divaMediaServiceUrl = initSetState.api.getDivaMediaServiceUrl(); //renderGroup = 'LeaTest';
37585
37734
  //diva3dServerUrl = "https://test-einkauf-onboarding.pfister.ch/diva3d/diva3dhost2/";
37586
37735
  // diva3dServerUrl = "https://diva3dhost.diva-portal.com/diva3d/diva3dhost2/";
37587
37736
  //diva3dServerUrl = 'https://localhost:44315/';
@@ -37777,18 +37926,18 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
37777
37926
  break;
37778
37927
  case 8:
37779
37928
  _context4.next = 10;
37780
- return import('./DivaStandardPlanner-7b4a2363.js');
37929
+ return import('./DivaStandardPlanner-fcc8d692.js');
37781
37930
  case 10:
37782
37931
  _yield$import = _context4.sent;
37783
37932
  DivaStandardPlanner = _yield$import["default"];
37784
- planner = new DivaStandardPlanner(set, this.plannerHandlerFunctions.updatePlannerMsgContainer, this.plannerIDCount, this.setPlannerHandler.getGlobalBoundingBox(), set.api.getHidePlanner(), !!set.api.getDoShowAR(), set.api.getDoDisablePlanner2D(), hasStaticBackground);
37933
+ planner = new DivaStandardPlanner(set, this.plannerHandlerFunctions.updatePlannerMsgContainer, this.plannerIDCount, this.setPlannerHandler.getGlobalBoundingBox(), set.api.getHidePlanner(), !!set.api.enableAR, set.api.getDoDisablePlanner2D(), hasStaticBackground);
37785
37934
  if (catalogData.isIDM3DCat) {
37786
37935
  planner.initIDM3DMeta(catalogData.IDM3DCatCodex);
37787
37936
  }
37788
37937
  return _context4.abrupt("break", 21);
37789
37938
  case 15:
37790
37939
  _context4.next = 17;
37791
- return import('./DivaBoxPlanner-d5cb2761.js');
37940
+ return import('./DivaBoxPlanner-11ab03fc.js');
37792
37941
  case 17:
37793
37942
  _yield$import2 = _context4.sent;
37794
37943
  DivaBoxPlanner = _yield$import2["default"];
@@ -38061,7 +38210,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38061
38210
  case 0:
38062
38211
  DivaUtils.startSpanOfApm('DivaPlannerHandler saveSetHQRenderScript');
38063
38212
  _context9.next = 3;
38064
- return this.request3D(false, true);
38213
+ return this.request3D(false, true, true);
38065
38214
  case 3:
38066
38215
  hashes = _context9.sent;
38067
38216
  if (hashes) {
@@ -38118,7 +38267,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38118
38267
  break;
38119
38268
  }
38120
38269
  _context10.next = 4;
38121
- return this.request3D(true, false, false, undefined, true, {
38270
+ return this.request3D(true, false, true, false, undefined, true, {
38122
38271
  width: 100,
38123
38272
  height: 100,
38124
38273
  isFullscreenRendering: false,
@@ -38531,14 +38680,14 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38531
38680
  key: "handle3DVisualizationChanged",
38532
38681
  value: function handle3DVisualizationChanged(mode, params, doShow3DDimensionLines, alternateRenderingsExist) {
38533
38682
  if (mode == 'Nav3DFullScreen') {
38534
- this.request3D(true, false, alternateRenderingsExist, undefined, false, {
38683
+ this.request3D(true, false, true, alternateRenderingsExist, undefined, false, {
38535
38684
  width: params.nav3DFullScreen.renderWidth,
38536
38685
  height: params.nav3DFullScreen.renderHeight,
38537
38686
  isFullscreenRendering: true,
38538
38687
  planner3DGridEnabled: false,
38539
38688
  mediaServiceSaveMode: 'STREAM',
38540
38689
  doShow3DDimensionLines: !!doShow3DDimensionLines
38541
- }, undefined, true);
38690
+ }, undefined);
38542
38691
  } else {
38543
38692
  this.handler3D.handle3DVisualizationChanged(mode, params);
38544
38693
  }
@@ -38571,7 +38720,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38571
38720
  }, {
38572
38721
  key: "request3D",
38573
38722
  value: function () {
38574
- var _request3D = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(doRequestRendering, doRequestHqRenderScript, alternateRenderingsExist, alternateRenderInfo, forceReloadPlanning, renderRequestInfos, viewpoint, useLatestCamera) {
38723
+ var _request3D = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(doRequestRendering, doRequestHqRenderScript, useLatestCamera, alternateRenderingsExist, alternateRenderInfo, forceReloadPlanning, renderRequestInfos, hybrid3DInfo) {
38575
38724
  var _this3 = this;
38576
38725
  var plannerData, loadedCatData, plannerExists, savedSetId;
38577
38726
  return _regeneratorRuntime.wrap(function _callee16$(_context16) {
@@ -38642,7 +38791,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38642
38791
  forceReloadPlanning: forceReloadPlanning,
38643
38792
  alternateRenderInfo: alternateRenderInfo,
38644
38793
  alternateRenderingsExist: alternateRenderingsExist,
38645
- camera: viewpoint,
38794
+ hybrid3DInfo: hybrid3DInfo,
38646
38795
  useLatestCamera: useLatestCamera
38647
38796
  });
38648
38797
  case 18:
@@ -38724,6 +38873,11 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38724
38873
  value: function openARObserverConnection(handleNoHqrs) {
38725
38874
  return this.handler3D.openARObserverConnection(handleNoHqrs);
38726
38875
  }
38876
+ }, {
38877
+ key: "updateCamPosition",
38878
+ value: function updateCamPosition(cam) {
38879
+ return this.handler3D.updateCamPosition(cam);
38880
+ }
38727
38881
  }]);
38728
38882
  }();
38729
38883
 
@@ -39033,13 +39187,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39033
39187
  _this.updateViewButtonsDependigOnConfigStructure();
39034
39188
  baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newArticle.basketId);
39035
39189
  if (!dontUpdateView) (_this$updateElementSe = _this.updateElementSelectionPlanner) === null || _this$updateElementSe === void 0 || _this$updateElementSe.call(_this, [baseArticle.setId], [baseArticle.elementId], true);
39036
- productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAdd');
39037
- _context3.next = 29;
39038
- return _this.checkVariantData();
39039
- case 29:
39190
+ _this.checkMatchingProducts('onAdd');
39040
39191
  _this.plannerChangeLog('onAddPlanner');
39041
39192
  return _context3.abrupt("return", 'ElementAdded');
39042
- case 31:
39193
+ case 29:
39043
39194
  case "end":
39044
39195
  return _context3.stop();
39045
39196
  }
@@ -39087,8 +39238,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39087
39238
  (_this$updateElementSe2 = _this.updateElementSelectionPlanner) === null || _this$updateElementSe2 === void 0 || _this$updateElementSe2.call(_this, [article.setId], [article.elementId], true);
39088
39239
  _this.updatePriceInView();
39089
39240
  _this.updateViewButtonsDependigOnConfigStructure();
39241
+ _this.checkMatchingProducts('onSwitch');
39090
39242
  _this.plannerChangeLog('onSwitchPlanner');
39091
- case 23:
39243
+ case 24:
39092
39244
  case "end":
39093
39245
  return _context4.stop();
39094
39246
  }
@@ -39120,11 +39272,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39120
39272
  (_this$updateViewPlann3 = _this.updateViewPlannerElements) === null || _this$updateViewPlann3 === void 0 || _this$updateViewPlann3.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
39121
39273
  _this.updatePlannerView('ADD_ACC_ON_SHELF_PLANNER');
39122
39274
  }
39275
+ _this.checkMatchingProducts('onShelfAdd');
39123
39276
  _this.plannerChangeLog('onAddPlanner');
39124
- productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfAdd');
39125
- _this.checkVariantData();
39126
39277
  return _context5.abrupt("return", retVal);
39127
- case 11:
39278
+ case 10:
39128
39279
  case "end":
39129
39280
  return _context5.stop();
39130
39281
  }
@@ -39168,10 +39319,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39168
39319
  _this.updateViewButtonsDependigOnConfigStructure();
39169
39320
  (_this$updateViewPlann5 = _this.updateViewPlannerElements) === null || _this$updateViewPlann5 === void 0 || _this$updateViewPlann5.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
39170
39321
  _this.updatePlannerView('DELETE_ACC_ON_SHELF_PLANNER');
39322
+ _this.checkMatchingProducts('onShelfDelete');
39171
39323
  _this.plannerChangeLog('onDeletePlanner');
39172
- productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfDelete');
39173
- _this.checkVariantData();
39174
- case 12:
39324
+ case 11:
39175
39325
  case "end":
39176
39326
  return _context6.stop();
39177
39327
  }
@@ -39244,10 +39394,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39244
39394
  _this.updatePlannerView('UPDATE_ACC_QUANTITY');
39245
39395
  _this.updatePriceInView();
39246
39396
  _this.updateViewButtonsDependigOnConfigStructure();
39247
- productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireUpdate');
39248
- _this.checkVariantData();
39397
+ _this.checkMatchingProducts('onAccessoireUpdate');
39249
39398
  _this.plannerChangeLog('onUpdateAccessoireQuantity');
39250
- case 13:
39399
+ case 12:
39251
39400
  case "end":
39252
39401
  return _context8.stop();
39253
39402
  }
@@ -39275,11 +39424,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39275
39424
  _this.updatePriceInView();
39276
39425
  _this.updateViewButtonsDependigOnConfigStructure();
39277
39426
  }
39278
- productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireDelete');
39279
- _this.checkVariantData();
39427
+ _this.checkMatchingProducts('onAccessoireDelete');
39280
39428
  _this.plannerChangeLog('onDeletePlanner');
39281
39429
  return _context9.abrupt("return", wasDeleted);
39282
- case 9:
39430
+ case 8:
39283
39431
  case "end":
39284
39432
  return _context9.stop();
39285
39433
  }
@@ -39361,10 +39509,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39361
39509
  returnValues = _context11.sent;
39362
39510
  (_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);
39363
39511
  structure = setHandlerInstance.loadConfigStructureOfActSet(set, _this.getCurPlannerType());
39364
- productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onConfig');
39365
- _this.checkVariantData();
39512
+ _this.checkMatchingProducts('onConfig');
39366
39513
  if (dontUpdatePlannerView) {
39367
- _context11.next = 19;
39514
+ _context11.next = 18;
39368
39515
  break;
39369
39516
  }
39370
39517
  _this.updateConfiguratorStructure(structure);
@@ -39378,18 +39525,18 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39378
39525
  _this.updateViewButtonsDependigOnConfigStructure();
39379
39526
  _this.updatePlannerView('DO_CONFIGURE', myValues);
39380
39527
  _this.updateWebConfiguratorTitle();
39381
- _context11.next = 19;
39528
+ _context11.next = 18;
39382
39529
  return _this.getFreePlacesOnGrids(undefined, 'doConfigure');
39383
- case 19:
39530
+ case 18:
39384
39531
  if (dontCallEvents) {
39385
- _context11.next = 22;
39532
+ _context11.next = 21;
39386
39533
  break;
39387
39534
  }
39388
- _context11.next = 22;
39535
+ _context11.next = 21;
39389
39536
  return _this.fillBaksetforOnWebPlanerConfigChange(myValues);
39537
+ case 21:
39538
+ _this.configuratorChangeLog('onConfiguratorStep', myValues);
39390
39539
  case 22:
39391
- _this.configuratorChangeLog('onConfiguratorStep');
39392
- case 23:
39393
39540
  case "end":
39394
39541
  return _context11.stop();
39395
39542
  }
@@ -39489,7 +39636,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39489
39636
  key: "initialize",
39490
39637
  value: function () {
39491
39638
  var _initialize = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
39492
- var viewReadyPromise, loadSuccessful, _initSetState$api$web, _this$actions16, _set$getDivaArticles, _this$actions15, _this$actions15$toggl, initSetState, set, products, result, _this$actions17, catalogData, initializationId, _this$plannerConfig$a;
39639
+ var viewReadyPromise, loadSuccessful, _this$actions16, _set$getDivaArticles, _this$actions15, _this$actions15$toggl, initSetState, set, oldProductId, result, _this$actions17, catalogData, initializationId, _this$plannerConfig$a;
39493
39640
  return _regeneratorRuntime.wrap(function _callee13$(_context13) {
39494
39641
  while (1) switch (_context13.prev = _context13.next) {
39495
39642
  case 0:
@@ -39514,71 +39661,63 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39514
39661
  return this.divaBasketHandler.initializeBasket(this.api);
39515
39662
  case 12:
39516
39663
  loadSuccessful = _context13.sent;
39664
+ if (!this.divaBasketHandler.hasConfiguratorSessionIdGetter || DivaUtils.businessMetrics.getConfiguratorSessionId() == undefined) {
39665
+ DivaUtils.businessMetrics.setConfiguratorSessionId();
39666
+ }
39517
39667
  if (!loadSuccessful) {
39518
- _context13.next = 61;
39668
+ _context13.next = 56;
39519
39669
  break;
39520
39670
  }
39521
39671
  if (!(typeof loadSuccessful != 'boolean')) {
39522
- _context13.next = 25;
39672
+ _context13.next = 24;
39523
39673
  break;
39524
39674
  }
39525
39675
  if (!(loadSuccessful.type == 'ProductList')) {
39526
- _context13.next = 23;
39676
+ _context13.next = 24;
39527
39677
  break;
39528
39678
  }
39529
- _context13.next = 18;
39679
+ _context13.next = 19;
39530
39680
  return viewReadyPromise;
39531
- case 18:
39532
- _context13.next = 20;
39681
+ case 19:
39682
+ _context13.next = 21;
39533
39683
  return this.initView();
39534
- case 20:
39684
+ case 21:
39535
39685
  this.subscribeToWebPlannerEvents();
39536
39686
  (_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);
39537
39687
  return _context13.abrupt("return", true);
39538
- case 23:
39539
- _context13.next = 26;
39540
- break;
39541
- case 25:
39542
- if (this.api.doCheckForProductsPrice()) ;
39543
- case 26:
39688
+ case 24:
39544
39689
  this.divaNr = this.divaBasketHandler.actDivaNr;
39545
39690
  initSetState = this.getInitStateForSet();
39546
39691
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
39547
- _context13.next = 31;
39692
+ _context13.next = 29;
39548
39693
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
39549
- case 31:
39694
+ case 29:
39550
39695
  set = this.actSet();
39551
- if (!((_initSetState$api$web = initSetState.api.webConfig) !== null && _initSetState$api$web !== void 0 && _initSetState$api$web.checkForProductsPrice)) {
39552
- _context13.next = 43;
39553
- break;
39554
- }
39555
- if (!(typeof loadSuccessful != 'boolean' && loadSuccessful.type == 'ProductId')) {
39696
+ oldProductId = this.divaBasketHandler.actBasket.MatchingProductId || this.divaBasketHandler.actBasket.OrigProductId;
39697
+ if (!(oldProductId && set)) {
39556
39698
  _context13.next = 38;
39557
39699
  break;
39558
39700
  }
39559
- products = loadSuccessful;
39560
- set === null || set === void 0 || set.remindPriceForHash(products);
39561
- _context13.next = 43;
39701
+ _context13.next = 34;
39702
+ return this.divaBasketHandler.getProduct(this.api, oldProductId);
39703
+ case 34:
39704
+ result = _context13.sent;
39705
+ if (result) productHandlerInstance.handleFountMatchingProducts(set, [result], set.setHash);
39706
+ _context13.next = 39;
39562
39707
  break;
39563
39708
  case 38:
39564
- if (!this.divaBasketHandler.actBasket.OrigProductId) {
39565
- _context13.next = 43;
39566
- break;
39709
+ if (typeof loadSuccessful != 'boolean' && set !== null && set !== void 0 && set.api.doCheckForProductsPrice()) {
39710
+ if (loadSuccessful.type != 'ProductList') {
39711
+ productHandlerInstance.handleFountMatchingProducts(set, [loadSuccessful], set.setHash);
39712
+ }
39567
39713
  }
39714
+ case 39:
39568
39715
  _context13.next = 41;
39569
- return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
39570
- case 41:
39571
- result = _context13.sent;
39572
- if (result) {
39573
- set === null || set === void 0 || set.remindPriceForHash(result);
39574
- }
39575
- case 43:
39576
- _context13.next = 45;
39577
39716
  return viewReadyPromise;
39578
- case 45:
39579
- _context13.next = 47;
39717
+ case 41:
39718
+ _context13.next = 43;
39580
39719
  return this.initView();
39581
- case 47:
39720
+ case 43:
39582
39721
  (_this$actions16 = this.actions) === null || _this$actions16 === void 0 || _this$actions16.onEvent({
39583
39722
  type: 'onConfiguratorReady'
39584
39723
  });
@@ -39590,9 +39729,6 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39590
39729
  this.subscribeToWebPlannerEvents();
39591
39730
  this.divaBasketHandler.actBasket;
39592
39731
  catalogData = set === null || set === void 0 ? void 0 : set.CatalogData;
39593
- if (!this.divaBasketHandler.hasConfiguratorSessionIdGetter || DivaUtils.businessMetrics.getConfiguratorSessionId() == undefined) {
39594
- DivaUtils.businessMetrics.setConfiguratorSessionId();
39595
- }
39596
39732
  initializationId = undefined;
39597
39733
  if (this.divaBasketHandler.initializationTypeGetter == 'PRODUCT_ID') {
39598
39734
  //KONFIGURATOR LOADED BY PRODUCT. LOG THIS HERE! WITH PRODUCT NAME AND PRODUCT ID
@@ -39609,23 +39745,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39609
39745
  catalogCodex: catalogData === null || catalogData === void 0 ? void 0 : catalogData.catalogCodex,
39610
39746
  catalogName: catalogData === null || catalogData === void 0 ? void 0 : catalogData.catalogName,
39611
39747
  accountName: catalogData === null || catalogData === void 0 ? void 0 : catalogData.accountName,
39612
- supplierId: catalogData === null || catalogData === void 0 ? void 0 : catalogData.supplierGuid,
39748
+ supplierId: catalogData === null || catalogData === void 0 ? void 0 : catalogData.accountGuid,
39613
39749
  plannerInitialization: this.divaBasketHandler.initializationTypeGetter,
39614
39750
  productGroup: catalogData === null || catalogData === void 0 ? void 0 : catalogData.mainCategory,
39615
39751
  hasPlannerInitialization: this.initMode ? false : true,
39616
39752
  initializationType: this.divaBasketHandler.initializationTypeGetter,
39617
39753
  initializationId: initializationId
39618
39754
  }, false);
39619
- _context13.next = 58;
39755
+ _context13.next = 53;
39620
39756
  return this.fillBaksetforOnWebPlanerConfigChange(undefined, true);
39621
- case 58:
39757
+ case 53:
39622
39758
  return _context13.abrupt("return", true);
39623
- case 61:
39759
+ case 56:
39624
39760
  this.onInitializationError();
39625
39761
  //fehler beim laden vom basket..
39626
39762
  LOG$1.errorTransaction('LOADING_BASKET', 'BASKET_0002', 'Fehler beim Laden des Baskets', {}, true);
39627
39763
  return _context13.abrupt("return", false);
39628
- case 64:
39764
+ case 59:
39629
39765
  case "end":
39630
39766
  return _context13.stop();
39631
39767
  }
@@ -39787,7 +39923,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39787
39923
  break;
39788
39924
  }
39789
39925
  (_this$initConfigurato = this.initConfiguratorStructure) === null || _this$initConfigurato === void 0 || _this$initConfigurato.call(this, setHandlerInstance.loadConfigStructureForOnlyProductsList());
39790
- _context15.next = 18;
39926
+ _context15.next = 17;
39791
39927
  break;
39792
39928
  case 7:
39793
39929
  _context15.next = 9;
@@ -39802,12 +39938,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39802
39938
  (_this$updateViewPlann9 = this.updateViewPlannerElements) === null || _this$updateViewPlann9 === void 0 || _this$updateViewPlann9.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set), set.getSetId(), set.firstElementId);
39803
39939
  this.updatePlannerView('INIT_VIEW');
39804
39940
  this.onBasketInitialized();
39805
- productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onInit');
39806
- this.checkVariantData();
39807
- case 18:
39808
- _context15.next = 20;
39941
+ this.checkMatchingProducts('onInit');
39942
+ case 17:
39943
+ _context15.next = 19;
39809
39944
  return this.runInitMode(plannerMode);
39810
- case 20:
39945
+ case 19:
39811
39946
  case "end":
39812
39947
  return _context15.stop();
39813
39948
  }
@@ -39833,39 +39968,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39833
39968
  key: "runInitMode",
39834
39969
  value: function () {
39835
39970
  var _runInitMode = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(plannerMode) {
39836
- var _this$navigateToTabGr2;
39837
- var doDefault, configStepKey, _this$actSet6, _this$navigateToTabGr3, _this$navigateToTabGr4, _this$navigateToTabGr5;
39971
+ var doDefault, _this$navigateToTabGr2, configStepKey, _this$actSet6, _this$navigateToTabGr3, _this$navigateToTabGr4, _this$navigateToTabGr5;
39838
39972
  return _regeneratorRuntime.wrap(function _callee16$(_context16) {
39839
39973
  while (1) switch (_context16.prev = _context16.next) {
39840
39974
  case 0:
39841
39975
  doDefault = true;
39842
- if (!this.plannerConfig.initMode) {
39843
- _context16.next = 15;
39976
+ if (!(this.plannerConfig.initMode == 'OPEN_LEAFLET_BARRIER' || this.plannerConfig.initMode == 'SHOW_PDF')) {
39977
+ _context16.next = 10;
39844
39978
  break;
39845
39979
  }
39846
- _context16.t0 = this.plannerConfig.initMode;
39847
- _context16.next = _context16.t0 === 'OPEN_LEAFLET_BARRIER' ? 5 : _context16.t0 === 'SHOW_PDF' ? 5 : _context16.t0 === 'OPENCONFIGTABGROUP' ? 12 : 15;
39848
- break;
39849
- case 5:
39850
39980
  if (this.plannerConfig.initMode == 'OPEN_LEAFLET_BARRIER') this.ReturnTo = 'OPEN_LEAFLET_BARRIER';
39851
39981
  if (this.plannerConfig.initMode == 'SHOW_PDF') this.ReturnTo = 'OPEN_PDF';
39852
39982
  (_this$navigateToTabGr2 = this.navigateToTabGroup) === null || _this$navigateToTabGr2 === void 0 || _this$navigateToTabGr2.call(this, 'SUMMARY', undefined, true);
39853
39983
  //TODO lea bug das hier ist nur ein temporäre lößung https://app.asana.com/0/1200869909950432/1200998848659806
39854
- _context16.next = 10;
39984
+ _context16.next = 7;
39855
39985
  return this.saveToBasketWrapper();
39856
- case 10:
39986
+ case 7:
39857
39987
  doDefault = false;
39858
- return _context16.abrupt("break", 15);
39859
- case 12:
39860
- configStepKey = this.plannerConfig.opt ? setHandlerInstance.getConfigStepKeyOfOption(this.actSet(), this.plannerConfig.opt) : setHandlerInstance.getFirstConfigStep(this.actSet());
39861
- if (configStepKey) {
39862
- this.navigateToConfigStep(configStepKey, !this.plannerConfig.opt, true);
39863
- doDefault = false;
39864
- } else {
39865
- LOG$1.warn('Option: ' + this.plannerConfig.opt + ' could not be found');
39988
+ _context16.next = 11;
39989
+ break;
39990
+ case 10:
39991
+ if (this.plannerConfig.initMode == 'OPENCONFIGTABGROUP' || this.api.getPlannerType() == 'JUMP_OVER_PLANNER') {
39992
+ configStepKey = this.plannerConfig.opt ? setHandlerInstance.getConfigStepKeyOfOption(this.actSet(), this.plannerConfig.opt) : setHandlerInstance.getFirstConfigStep(this.actSet());
39993
+ if (configStepKey) {
39994
+ this.navigateToConfigStep(configStepKey, !this.plannerConfig.opt, true);
39995
+ doDefault = false;
39996
+ } else {
39997
+ LOG$1.warn('Option: ' + this.plannerConfig.opt + ' could not be found');
39998
+ }
39866
39999
  }
39867
- return _context16.abrupt("break", 15);
39868
- case 15:
40000
+ case 11:
39869
40001
  if (doDefault) {
39870
40002
  if (plannerMode == 'ProductList') {
39871
40003
  (_this$navigateToTabGr3 = this.navigateToTabGroup) === null || _this$navigateToTabGr3 === void 0 || _this$navigateToTabGr3.call(this, 'PRODUCTS');
@@ -39875,7 +40007,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39875
40007
  (_this$navigateToTabGr5 = this.navigateToTabGroup) === null || _this$navigateToTabGr5 === void 0 || _this$navigateToTabGr5.call(this, this.getCurPlannerType(true), true);
39876
40008
  }
39877
40009
  }
39878
- case 16:
40010
+ case 12:
39879
40011
  case "end":
39880
40012
  return _context16.stop();
39881
40013
  }
@@ -39919,7 +40051,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39919
40051
  _context17.next = 15;
39920
40052
  return setHandlerInstance.addOrderSetArticlesToExistingSet(loadedSet, orderset, lastSetToInitialize);
39921
40053
  case 15:
39922
- productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onAdd');
40054
+ this.checkMatchingProducts('onAdd');
39923
40055
  _context17.next = 20;
39924
40056
  break;
39925
40057
  case 18:
@@ -40027,7 +40159,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40027
40159
  */
40028
40160
  }, {
40029
40161
  key: "updatePlannerView",
40030
- value: function updatePlannerView(callingFrom, onDoConfigureValues, viewpoint) {
40162
+ value: function updatePlannerView(callingFrom, onDoConfigureValues, hybridInfo) {
40031
40163
  var _this$getCurrentAlter, _set$getAlternateRend, _this$getDoShow3DDime2, _this$getDoShow3DDime3, _this$getDoShow3DDime4;
40032
40164
  var set = this.actSet();
40033
40165
  if (!set) return;
@@ -40064,12 +40196,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40064
40196
  LOG$1.debug('lvl 1: ', this.getCurPlannerViewMode());
40065
40197
  switch (this.getCurPlannerViewMode()) {
40066
40198
  case '3DCOMB':
40067
- setHandlerInstance.update3DPlannerView(true, true, set, this.getPlannerRenderingSize(), this.getPlanner3DGridEnabled(), 'STREAM', (_this$getDoShow3DDime2 = this.getDoShow3DDimensionLines) === null || _this$getDoShow3DDime2 === void 0 ? void 0 : _this$getDoShow3DDime2.call(this), alternateRenderInfo, viewpoint, callingFrom != 'HANDLE_3D_VIS_CHANGED');
40199
+ setHandlerInstance.update3DPlannerView(true, !hybridInfo || hybridInfo && hybridInfo.focus.adjustZoomInUnity, set, this.getPlannerRenderingSize(), this.getPlanner3DGridEnabled(), 'STREAM', (_this$getDoShow3DDime2 = this.getDoShow3DDimensionLines) === null || _this$getDoShow3DDime2 === void 0 ? void 0 : _this$getDoShow3DDime2.call(this), alternateRenderInfo, hybridInfo ? {
40200
+ focus: hybridInfo.focus,
40201
+ forceRTCam: true,
40202
+ currentCamera: hybridInfo.currentCamera
40203
+ } : undefined);
40068
40204
  break;
40069
40205
  case 'RTViewer':
40070
40206
  //Request HQRenderscript + rendering
40071
40207
  //Request new Rendering
40072
- setHandlerInstance.update3DPlannerView(true, true, set, this.getPlannerRenderingSize(), this.getPlanner3DGridEnabled(), 'STREAM', (_this$getDoShow3DDime3 = this.getDoShow3DDimensionLines) === null || _this$getDoShow3DDime3 === void 0 ? void 0 : _this$getDoShow3DDime3.call(this), alternateRenderInfo, viewpoint);
40208
+ setHandlerInstance.update3DPlannerView(true, true, set, this.getPlannerRenderingSize(), this.getPlanner3DGridEnabled(), 'STREAM', (_this$getDoShow3DDime3 = this.getDoShow3DDimensionLines) === null || _this$getDoShow3DDime3 === void 0 ? void 0 : _this$getDoShow3DDime3.call(this), alternateRenderInfo, undefined);
40073
40209
  break;
40074
40210
  case '3DImage':
40075
40211
  //Request new Rendering
@@ -40158,13 +40294,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40158
40294
  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);
40159
40295
  }
40160
40296
  this.updatePriceInView();
40161
- productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onDelete');
40162
- this.checkVariantData();
40163
- _context19.next = 15;
40297
+ this.checkMatchingProducts('onDelete');
40298
+ _context19.next = 14;
40164
40299
  return this.getFreePlacesOnGrids(undefined, 'deleteElement');
40165
- case 15:
40300
+ case 14:
40166
40301
  this.plannerChangeLog('onDeletePlanner');
40167
- case 16:
40302
+ case 15:
40168
40303
  case "end":
40169
40304
  return _context19.stop();
40170
40305
  }
@@ -40207,12 +40342,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40207
40342
  baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newSelectedArticle.basketId);
40208
40343
  (_this$updateElementSe7 = this.updateElementSelectionPlanner) === null || _this$updateElementSe7 === void 0 || _this$updateElementSe7.call(this, [baseArticle.setId], [baseArticle.elementId], true);
40209
40344
  }
40210
- productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onCopy');
40211
- _context20.next = 14;
40212
- return this.checkVariantData();
40213
- case 14:
40345
+ this.checkMatchingProducts('onCopy');
40214
40346
  return _context20.abrupt("return", newConfigStepKey);
40215
- case 15:
40347
+ case 13:
40216
40348
  case "end":
40217
40349
  return _context20.stop();
40218
40350
  }
@@ -40370,36 +40502,6 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40370
40502
  }
40371
40503
  return resetArticle;
40372
40504
  }()
40373
- }, {
40374
- key: "checkVariantData",
40375
- value: function () {
40376
- var _checkVariantData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
40377
- var somethingChanged;
40378
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
40379
- while (1) switch (_context24.prev = _context24.next) {
40380
- case 0:
40381
- if (!this.api.getDoCheckVariantData()) {
40382
- _context24.next = 5;
40383
- break;
40384
- }
40385
- _context24.next = 3;
40386
- return setHandlerInstance.checkVariantData(this.actSet());
40387
- case 3:
40388
- somethingChanged = _context24.sent;
40389
- if (somethingChanged) {
40390
- this.updatePriceInView();
40391
- }
40392
- case 5:
40393
- case "end":
40394
- return _context24.stop();
40395
- }
40396
- }, _callee24, this);
40397
- }));
40398
- function checkVariantData() {
40399
- return _checkVariantData.apply(this, arguments);
40400
- }
40401
- return checkVariantData;
40402
- }()
40403
40505
  }, {
40404
40506
  key: "defineArticlesOnOptions",
40405
40507
  value: function defineArticlesOnOptions(basketIdsOnOptions) {
@@ -40422,7 +40524,44 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40422
40524
  var _this$actSet8;
40423
40525
  (_this$actSet8 = this.actSet()) === null || _this$actSet8 === void 0 || _this$actSet8.setDifferentOptions(options);
40424
40526
  }
40425
-
40527
+ }, {
40528
+ key: "checkMatchingProducts",
40529
+ value: function () {
40530
+ var _checkMatchingProducts = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24(from) {
40531
+ var set, _set$getMatchingProdu, _set$getMatchingOrigP, _set$getMatchingOrigP2, _set$getMatchingProdu2;
40532
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
40533
+ while (1) switch (_context24.prev = _context24.next) {
40534
+ case 0:
40535
+ set = this.actSet();
40536
+ if (set !== null && set !== void 0 && set.api.doCheckForProductsPrice()) {
40537
+ if (((_set$getMatchingProdu = set.getMatchingProduct()) === null || _set$getMatchingProdu === void 0 ? void 0 : _set$getMatchingProdu.setHash) !== set.setHash) {
40538
+ set.setMatchingProduct();
40539
+ this.updatePriceInView();
40540
+ }
40541
+ if (set.getMatchingOrigProduct() && ((_set$getMatchingOrigP = set.getMatchingOrigProduct()) === null || _set$getMatchingOrigP === void 0 ? void 0 : _set$getMatchingOrigP.setHash) === set.setHash && ((_set$getMatchingOrigP2 = set.getMatchingOrigProduct()) === null || _set$getMatchingOrigP2 === void 0 ? void 0 : _set$getMatchingOrigP2.setHash) !== ((_set$getMatchingProdu2 = set.getMatchingProduct()) === null || _set$getMatchingProdu2 === void 0 ? void 0 : _set$getMatchingProdu2.setHash)) {
40542
+ set.setMatchingProduct(set.getMatchingOrigProduct());
40543
+ this.updatePriceInView();
40544
+ }
40545
+ }
40546
+ if (!(set !== null && set !== void 0 && set.api.doCheckForProductsMatch())) {
40547
+ _context24.next = 6;
40548
+ break;
40549
+ }
40550
+ _context24.next = 5;
40551
+ return productHandlerInstance.updateProducts(this.setsAsArray, this.api, this.divaBasketHandler.divaWWSHandler, from);
40552
+ case 5:
40553
+ this.updatePriceInView();
40554
+ case 6:
40555
+ case "end":
40556
+ return _context24.stop();
40557
+ }
40558
+ }, _callee24, this);
40559
+ }));
40560
+ function checkMatchingProducts(_x64) {
40561
+ return _checkMatchingProducts.apply(this, arguments);
40562
+ }
40563
+ return checkMatchingProducts;
40564
+ }()
40426
40565
  /**
40427
40566
  * Updated the Price in the View.
40428
40567
  * Should always be called after something was changed!
@@ -40432,7 +40571,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40432
40571
  value: function updatePriceInView() {
40433
40572
  var _this$updatePrice;
40434
40573
  setHandlerInstance.getActSetPriceFormat(this.actSet());
40435
- (_this$updatePrice = this.updatePrice) === null || _this$updatePrice === void 0 || _this$updatePrice.call(this, setHandlerInstance.getTotalPrice(this.sets), this.actSet().getSetPrice(), setHandlerInstance.getTotalBruttoPrice(this.sets));
40574
+ (_this$updatePrice = this.updatePrice) === null || _this$updatePrice === void 0 || _this$updatePrice.call(this, setHandlerInstance.getTotalViewPrice(this.sets), this.actSet().getViewSetPrice(), setHandlerInstance.getTotalViewBruttoPrice(this.sets));
40436
40575
  }
40437
40576
 
40438
40577
  /**
@@ -40602,7 +40741,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40602
40741
  }
40603
40742
  }, _callee25, this);
40604
40743
  }));
40605
- function saveToBasketWrapper(_x64, _x65, _x66) {
40744
+ function saveToBasketWrapper(_x65, _x66, _x67) {
40606
40745
  return _saveToBasketWrapper.apply(this, arguments);
40607
40746
  }
40608
40747
  return saveToBasketWrapper;
@@ -40611,7 +40750,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40611
40750
  key: "saveToBasket",
40612
40751
  value: function () {
40613
40752
  var _saveToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26(event, repairOnly, force) {
40614
- var _returnTo, _returnTo2, _returnTo3, _this$actions32, _this$actions33, _this$actions34;
40753
+ var _returnTo, _returnTo2, _returnTo3, _this$actions32, _this$actions33, _this$actions34, _this$divaBasketHandl2;
40615
40754
  var set, actBasket, returnTo, oldReturnTo, result, newDivaNr, _result2, product;
40616
40755
  return _regeneratorRuntime.wrap(function _callee26$(_context26) {
40617
40756
  while (1) switch (_context26.prev = _context26.next) {
@@ -40729,7 +40868,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40729
40868
  return _context26.abrupt("break", 52);
40730
40869
  case 52:
40731
40870
  if (returnTo == 'DONT_SAVE_BASKET') event = 'dontSaveBasket';
40732
- actBasket = this.divaBasketHandler.getBasketData(actBasket.DivaNr); //get pdf documenturl from saved basket
40871
+ actBasket = (_this$divaBasketHandl2 = this.divaBasketHandler.getBasketData(actBasket.DivaNr, actBasket.DocumentVersion)) !== null && _this$divaBasketHandl2 !== void 0 ? _this$divaBasketHandl2 : actBasket; //get pdf documenturl from saved basket
40733
40872
  _context26.next = 56;
40734
40873
  return this.addToBasket(actBasket, event);
40735
40874
  case 56:
@@ -40741,7 +40880,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40741
40880
  }
40742
40881
  }, _callee26, this);
40743
40882
  }));
40744
- function saveToBasket(_x67, _x68, _x69) {
40883
+ function saveToBasket(_x68, _x69, _x70) {
40745
40884
  return _saveToBasket.apply(this, arguments);
40746
40885
  }
40747
40886
  return saveToBasket;
@@ -40794,6 +40933,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40794
40933
  plannerType = 'PLANNER';
40795
40934
  }
40796
40935
  }
40936
+ if (plannerType === 'JUMP_OVER_PLANNER') {
40937
+ ret = 'PLANNER';
40938
+ plannerType = undefined;
40939
+ }
40797
40940
  if (plannerType === 'CUSTOMER_OPTIMIZED_PLANNER') {
40798
40941
  var _set$CatalogData$allC;
40799
40942
  var optimizationReason = undefined;
@@ -40879,8 +41022,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40879
41022
  }, {
40880
41023
  key: "doAllowSetPlanner",
40881
41024
  value: function doAllowSetPlanner() {
40882
- var _this$returnTo, _this$divaBasketHandl2;
40883
- return this.api.doAllowSetPlanner() || ((_this$returnTo = this.returnTo) === null || _this$returnTo === void 0 ? void 0 : _this$returnTo.startsWith('SETPLANNER')) || !!((_this$divaBasketHandl2 = this.divaBasketHandler) !== null && _this$divaBasketHandl2 !== void 0 && (_this$divaBasketHandl2 = _this$divaBasketHandl2.actBasket) !== null && _this$divaBasketHandl2 !== void 0 && _this$divaBasketHandl2.SetPlannerInfos);
41025
+ var _this$returnTo, _this$divaBasketHandl3;
41026
+ return this.api.doAllowSetPlanner() || ((_this$returnTo = this.returnTo) === null || _this$returnTo === void 0 ? void 0 : _this$returnTo.startsWith('SETPLANNER')) || !!((_this$divaBasketHandl3 = this.divaBasketHandler) !== null && _this$divaBasketHandl3 !== void 0 && (_this$divaBasketHandl3 = _this$divaBasketHandl3.actBasket) !== null && _this$divaBasketHandl3 !== void 0 && _this$divaBasketHandl3.SetPlannerInfos);
40884
41027
  }
40885
41028
  }, {
40886
41029
  key: "doShow3DDimensionLines",
@@ -40917,18 +41060,18 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40917
41060
  }, {
40918
41061
  key: "getAllowRTV",
40919
41062
  value: function getAllowRTV() {
40920
- var _this$actSet22, _this$actSet23;
41063
+ var _this$state3, _this$actSet22, _this$state4, _this$actSet23;
40921
41064
  if (this.getEnableUnityRtvKombi()) return false;
40922
- if (this.api.forceShowRTV()) return true;
41065
+ if ((_this$state3 = this.state) !== null && _this$state3 !== void 0 && _this$state3.organization.settings.forceRTV) return true;
40923
41066
  if ((_this$actSet22 = this.actSet()) !== null && _this$actSet22 !== void 0 && _this$actSet22.CatalogData.divaForceRTV) return true;
40924
- if (this.api.getDoShowRTV() && (_this$actSet23 = this.actSet()) !== null && _this$actSet23 !== void 0 && _this$actSet23.CatalogData.divaArReady) return true;
41067
+ if ((_this$state4 = this.state) !== null && _this$state4 !== void 0 && _this$state4.organization.settings.enableRTV && (_this$actSet23 = this.actSet()) !== null && _this$actSet23 !== void 0 && _this$actSet23.CatalogData.divaArReady) return true;
40925
41068
  return false;
40926
41069
  }
40927
41070
  }, {
40928
- key: "geAllowQRCodeAR",
40929
- value: function geAllowQRCodeAR() {
41071
+ key: "getAllowQRCodeAR",
41072
+ value: function getAllowQRCodeAR() {
40930
41073
  var _this$actSet24;
40931
- if (this.api.getDoShowAR() && (_this$actSet24 = this.actSet()) !== null && _this$actSet24 !== void 0 && _this$actSet24.CatalogData.divaArReady) return true;
41074
+ if (this.api.enableAR && (_this$actSet24 = this.actSet()) !== null && _this$actSet24 !== void 0 && _this$actSet24.CatalogData.divaArReady) return true;
40932
41075
  return false;
40933
41076
  }
40934
41077
  }, {
@@ -41006,7 +41149,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41006
41149
  _this$actions37,
41007
41150
  _this$actions38,
41008
41151
  _this$actions39,
41009
- _this$divaBasketHandl3,
41152
+ _this$divaBasketHandl4,
41010
41153
  _this3 = this,
41011
41154
  _this$actions40,
41012
41155
  _this$actions41,
@@ -41058,7 +41201,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41058
41201
  });
41059
41202
  return _context28.abrupt("break", 32);
41060
41203
  case 15:
41061
- emailConfig = (_this$divaBasketHandl3 = this.divaBasketHandler.emailConfig) !== null && _this$divaBasketHandl3 !== void 0 ? _this$divaBasketHandl3 : this.getEmailConfig(); //reset the emailConfig
41204
+ emailConfig = (_this$divaBasketHandl4 = this.divaBasketHandler.emailConfig) !== null && _this$divaBasketHandl4 !== void 0 ? _this$divaBasketHandl4 : this.getEmailConfig(); //reset the emailConfig
41062
41205
  this.divaBasketHandler.emailConfig = undefined;
41063
41206
  if (emailConfig) {
41064
41207
  to = (_emailConfig$to$split = (_emailConfig$to = emailConfig.to) === null || _emailConfig$to === void 0 ? void 0 : _emailConfig$to.split(',').map(function (mail) {
@@ -41128,7 +41271,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41128
41271
  }
41129
41272
  }, _callee28, this);
41130
41273
  }));
41131
- function addToBasket(_x70) {
41274
+ function addToBasket(_x71) {
41132
41275
  return _addToBasket.apply(this, arguments);
41133
41276
  }
41134
41277
  return addToBasket;
@@ -41423,7 +41566,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41423
41566
  }
41424
41567
  }, _callee29, this);
41425
41568
  }));
41426
- function initApiForLogicOnly(_x71, _x72, _x73, _x74, _x75, _x76, _x77) {
41569
+ function initApiForLogicOnly(_x72, _x73, _x74, _x75, _x76, _x77, _x78) {
41427
41570
  return _initApiForLogicOnly.apply(this, arguments);
41428
41571
  }
41429
41572
  return initApiForLogicOnly;
@@ -41461,8 +41604,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41461
41604
  key: "initBasket",
41462
41605
  value: function () {
41463
41606
  var _initBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(init3D, ignoreFavorites, onlyCalcVariants) {
41464
- var _initSetState$api$web2;
41465
- var initSetState, sets, result, _sets$, set, basket;
41607
+ var initSetState, set, basket;
41466
41608
  return _regeneratorRuntime.wrap(function _callee31$(_context31) {
41467
41609
  while (1) switch (_context31.prev = _context31.next) {
41468
41610
  case 0:
@@ -41472,45 +41614,29 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41472
41614
  _context31.next = 5;
41473
41615
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
41474
41616
  case 5:
41475
- sets = _context31.sent;
41476
- if (!((_initSetState$api$web2 = initSetState.api.webConfig) !== null && _initSetState$api$web2 !== void 0 && _initSetState$api$web2.checkForProductsPrice)) {
41477
- _context31.next = 12;
41478
- break;
41479
- }
41480
- if (!this.divaBasketHandler.actBasket.OrigProductId) {
41481
- _context31.next = 12;
41482
- break;
41483
- }
41484
- _context31.next = 10;
41485
- return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
41486
- case 10:
41487
- result = _context31.sent;
41488
- if (result) {
41489
- (_sets$ = sets[0]) === null || _sets$ === void 0 || _sets$.remindPriceForHash(result);
41490
- }
41491
- case 12:
41617
+ //TODO check if when basket gets repaired the product match gets called
41492
41618
  set = this.actSet();
41493
41619
  if (set) set.onlyCalcVariants = onlyCalcVariants;
41494
41620
  setHandlerInstance.loadConfigStructureOfActSet(set, this.getCurPlannerType());
41495
41621
  if (!(favoritesHandlerInstance.FavoritesDefined(set) && !ignoreFavorites)) {
41496
- _context31.next = 18;
41622
+ _context31.next = 11;
41497
41623
  break;
41498
41624
  }
41499
- _context31.next = 18;
41625
+ _context31.next = 11;
41500
41626
  return this.handleFavorites(init3D ? 'CALC' : 'REPAIR');
41501
- case 18:
41502
- _context31.next = 20;
41627
+ case 11:
41628
+ _context31.next = 13;
41503
41629
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !init3D, this.doAllowSetPlanner(), this.ReturnTo);
41504
- case 20:
41630
+ case 13:
41505
41631
  basket = _context31.sent;
41506
41632
  return _context31.abrupt("return", basket);
41507
- case 22:
41633
+ case 15:
41508
41634
  case "end":
41509
41635
  return _context31.stop();
41510
41636
  }
41511
41637
  }, _callee31, this);
41512
41638
  }));
41513
- function initBasket(_x78, _x79, _x80) {
41639
+ function initBasket(_x79, _x80, _x81) {
41514
41640
  return _initBasket.apply(this, arguments);
41515
41641
  }
41516
41642
  return initBasket;
@@ -41587,7 +41713,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41587
41713
  }
41588
41714
  }, _callee33, this);
41589
41715
  }));
41590
- function handleFavorites(_x81) {
41716
+ function handleFavorites(_x82) {
41591
41717
  return _handleFavorites.apply(this, arguments);
41592
41718
  }
41593
41719
  return handleFavorites;
@@ -41641,7 +41767,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41641
41767
  }
41642
41768
  }, _callee34, this);
41643
41769
  }));
41644
- function initSapOrderLinesFromBasket(_x82, _x83, _x84) {
41770
+ function initSapOrderLinesFromBasket(_x83, _x84, _x85) {
41645
41771
  return _initSapOrderLinesFromBasket.apply(this, arguments);
41646
41772
  }
41647
41773
  return initSapOrderLinesFromBasket;
@@ -41688,6 +41814,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41688
41814
  value: function openARObserverConnection(handleNoHqrs) {
41689
41815
  return this.getPlannerHandler().openARObserverConnection(handleNoHqrs);
41690
41816
  }
41817
+ }, {
41818
+ key: "updateCameraInformation",
41819
+ value: function updateCameraInformation(cam) {
41820
+ return this.getPlannerHandler().updateCamPosition(cam);
41821
+ }
41691
41822
  }, {
41692
41823
  key: "doLoadHQR",
41693
41824
  get: function get() {
@@ -41700,13 +41831,15 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41700
41831
  key: "plannerChangeLog",
41701
41832
  value: function plannerChangeLog(action) {
41702
41833
  var set = this.actSet();
41834
+ var articleCodex = [];
41835
+ var accesoriesCodex = [];
41703
41836
  var articles = [];
41704
41837
  if (set) {
41705
41838
  for (var _i = 0, _Object$values = Object.values(set.getDivaArticles()); _i < _Object$values.length; _i++) {
41706
41839
  var article = _Object$values[_i];
41707
41840
  if (article.relatedToBasketId) {
41708
41841
  var toAdd = {
41709
- articleCodex: article.configArticleCodex,
41842
+ codex: article.configArticleCodex,
41710
41843
  basketId: article.basketId,
41711
41844
  relatedBasektId: article.relatedToBasketId,
41712
41845
  type: 'ACCESSORIE'
@@ -41716,9 +41849,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41716
41849
  } else {
41717
41850
  articles.push(toAdd);
41718
41851
  }
41852
+ if (article.configArticleCodex) accesoriesCodex.push(article.configArticleCodex);
41719
41853
  } else {
41720
41854
  var _toAdd = {
41721
- articleCodex: article.configArticleCodex,
41855
+ codex: article.configArticleCodex,
41722
41856
  basketId: article.basketId,
41723
41857
  type: 'ARTICLE'
41724
41858
  };
@@ -41727,36 +41861,112 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41727
41861
  } else {
41728
41862
  articles.push(_toAdd);
41729
41863
  }
41864
+ if (article.configArticleCodex) articleCodex.push(article.configArticleCodex);
41730
41865
  }
41731
41866
  }
41732
41867
  }
41733
41868
  LOG$1.businessEvent(action, 'Planner', 'Planner wurde verändert', {
41734
- articles: articles
41869
+ article: {
41870
+ articleCodex: articleCodex,
41871
+ accesoriesCodex: accesoriesCodex,
41872
+ article_nested: articles
41873
+ }
41874
+ });
41875
+ LOG$1.businessEvent('onActualBasketValue', 'Planner', 'Aktueller Basket Value:' + this.getCurSetPrice(), {
41876
+ basketValue: this.getCurSetPrice()
41735
41877
  });
41736
41878
  }
41737
41879
  }, {
41738
41880
  key: "configuratorChangeLog",
41739
- value: function configuratorChangeLog(action) {
41881
+ value: function configuratorChangeLog(action, myValues) {
41740
41882
  var set = this.actSet();
41741
41883
  var configuration = [];
41884
+ var allOpt = [];
41885
+ var allOpv = [];
41886
+ var latestOpv = {};
41887
+ var latestOpt = {};
41742
41888
  if (set) {
41889
+ if (myValues) {
41890
+ var _set$CatalogData$getO, _set$CatalogData$getO2;
41891
+ latestOpt = {
41892
+ codex: Object.keys(myValues)[0],
41893
+ name: (_set$CatalogData$getO = set.CatalogData.getOption(Object.keys(myValues)[0])) === null || _set$CatalogData$getO === void 0 ? void 0 : _set$CatalogData$getO.name
41894
+ };
41895
+ latestOpv = {
41896
+ codex: Object.values(myValues)[0],
41897
+ name: (_set$CatalogData$getO2 = set.CatalogData.getOptionValue(Object.values(myValues)[0])) === null || _set$CatalogData$getO2 === void 0 ? void 0 : _set$CatalogData$getO2.name
41898
+ };
41899
+ }
41743
41900
  for (var _i2 = 0, _Object$values2 = Object.values(set.getDivaArticles()); _i2 < _Object$values2.length; _i2++) {
41744
41901
  var article = _Object$values2[_i2];
41745
41902
  if (!configuration) {
41746
41903
  configuration = [{
41747
41904
  varientValues: article.VariantValues,
41748
- basketId: article.basketId
41905
+ basketId: article.basketId,
41906
+ opt: Object.keys(article.VariantValues).map(function (key) {
41907
+ var _set$CatalogData$getO3;
41908
+ return {
41909
+ codex: key,
41910
+ name: (_set$CatalogData$getO3 = set.CatalogData.getOption(key)) === null || _set$CatalogData$getO3 === void 0 ? void 0 : _set$CatalogData$getO3.name
41911
+ };
41912
+ }),
41913
+ opv: Object.values(article.VariantValues).map(function (value) {
41914
+ var _set$CatalogData$getO4;
41915
+ return {
41916
+ codex: value,
41917
+ name: (_set$CatalogData$getO4 = set.CatalogData.getOption(value)) === null || _set$CatalogData$getO4 === void 0 ? void 0 : _set$CatalogData$getO4.name
41918
+ };
41919
+ })
41749
41920
  }];
41750
41921
  } else {
41751
41922
  configuration.push({
41752
41923
  varientValues: article.VariantValues,
41753
- basketId: article.basketId
41924
+ basketId: article.basketId,
41925
+ opt: Object.keys(article.VariantValues).map(function (key) {
41926
+ var _set$CatalogData$getO5;
41927
+ return {
41928
+ codex: key,
41929
+ name: (_set$CatalogData$getO5 = set.CatalogData.getOption(key)) === null || _set$CatalogData$getO5 === void 0 ? void 0 : _set$CatalogData$getO5.name
41930
+ };
41931
+ }),
41932
+ opv: Object.values(article.VariantValues).map(function (value) {
41933
+ var _set$CatalogData$getO6;
41934
+ return {
41935
+ codex: value,
41936
+ name: (_set$CatalogData$getO6 = set.CatalogData.getOptionValue(value)) === null || _set$CatalogData$getO6 === void 0 ? void 0 : _set$CatalogData$getO6.name
41937
+ };
41938
+ })
41939
+ });
41940
+ }
41941
+ for (var _i3 = 0, _Object$entries = Object.entries(article.VariantValues); _i3 < _Object$entries.length; _i3++) {
41942
+ var _set$CatalogData$getO7, _set$CatalogData$getO8;
41943
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
41944
+ opt = _Object$entries$_i[0],
41945
+ opv = _Object$entries$_i[1];
41946
+ allOpt.push({
41947
+ codex: opt,
41948
+ name: (_set$CatalogData$getO7 = set.CatalogData.getOption(opt)) === null || _set$CatalogData$getO7 === void 0 ? void 0 : _set$CatalogData$getO7.name
41949
+ });
41950
+ allOpv.push({
41951
+ codex: opv,
41952
+ name: (_set$CatalogData$getO8 = set.CatalogData.getOptionValue(opv)) === null || _set$CatalogData$getO8 === void 0 ? void 0 : _set$CatalogData$getO8.name
41754
41953
  });
41755
41954
  }
41756
41955
  }
41757
41956
  }
41758
41957
  LOG$1.businessEvent(action, 'Planner', 'Configurator wurde verändert', {
41759
- configuration: configuration
41958
+ configuration: {
41959
+ latest: {
41960
+ opv: latestOpv,
41961
+ opt: latestOpt
41962
+ },
41963
+ opt: allOpt,
41964
+ opv: allOpv,
41965
+ configuration_nested: configuration
41966
+ }
41967
+ });
41968
+ LOG$1.businessEvent('onActualBasketValue', 'Planner', 'Aktueller Basket Value:' + this.getCurSetPrice(), {
41969
+ basketValue: this.getCurSetPrice()
41760
41970
  });
41761
41971
  }
41762
41972
  }, {
@@ -42254,7 +42464,7 @@ var Grid = /*#__PURE__*/function () {
42254
42464
  if (this.heightGridCellCountOnRule) {
42255
42465
  for (var i = 0; i < this.heightGridCellCountOnRule.length; i++) {
42256
42466
  var gridOnRule = this.heightGridCellCountOnRule[i];
42257
- if (this.article.evalRule(DivaUtils.getRuleByFormula(gridOnRule.Rule))) {
42467
+ if (this.article.evalRule(DivaUtils.getRuleByFormula(gridOnRule.Rule, article.catalogCodex, article.CatalogData.multiselectOptions))) {
42258
42468
  var _gridOnRule$HeightGri, _gridOnRule$ArticleRe;
42259
42469
  cellCount = (_gridOnRule$HeightGri = gridOnRule.HeightGridCellCount) !== null && _gridOnRule$HeightGri !== void 0 ? _gridOnRule$HeightGri : grid.HeightGridCellCount;
42260
42470
  this.articleRelations = (_gridOnRule$ArticleRe = gridOnRule.ArticleRelations) !== null && _gridOnRule$ArticleRe !== void 0 ? _gridOnRule$ArticleRe : grid.ArticleRelations;
@@ -60238,4 +60448,4 @@ var getOrigProductId = /*#__PURE__*/function () {
60238
60448
  };
60239
60449
  }();
60240
60450
 
60241
- export { BoundingBox as B, Cell as C, DockingPoint as D, Grid as G, HQRenderScript as H, OptionCatalogData as O, Rendering as R, Vector3 as V, setHandlerInstance as a, articleHandlerInstance as b, Vector2 as c, DivaWebPlanner as d, DivaArticle as e, DivaCatalogData as f, DivaBasketHandler as g, CatalogPlannerArticleData as h, Vector4 as i, creatRenderOrders as j, getOrigProductId as k, loadAndRepairBasket as l, summaryHandlerInstance as s };
60451
+ export { BoundingBox as B, Cell as C, DockingPoint as D, Grid as G, HQRenderScript as H, OptionCatalogData as O, Rendering as R, Vector3 as V, articleHandlerInstance as a, setHandlerInstance as b, Vector2 as c, DivaWebPlanner as d, DivaArticle as e, DivaCatalogData as f, DivaBasketHandler as g, CatalogPlannerArticleData as h, Vector4 as i, creatRenderOrders as j, getOrigProductId as k, loadAndRepairBasket as l, summaryHandlerInstance as s };