@crystaldesign/web-planner-logic 26.12.0-beta.6 → 26.12.0-beta.8

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-e772f6a3.js → DivaBoxPlanner-143d6027.js} +12 -9
  2. package/build/cjs/{DivaStandardPlanner-d6cb5f39.js → DivaStandardPlanner-85b2b3ec.js} +2 -2
  3. package/build/cjs/{DoorPlanner-9ea7a6aa.js → DoorPlanner-2350aacc.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-9710fc4e.js → Host3DSignalR-dad3c3fd.js} +1 -1
  5. package/build/cjs/{LiviqueWWSHandler-fbc83326.js → LiviqueWWSHandler-1efa9da7.js} +1 -1
  6. package/build/cjs/{PfisterWWSHandler-1a240ebf.js → PfisterWWSHandler-be3ebeaa.js} +1 -1
  7. package/build/cjs/{PlannerHandler2D-1d75a95f.js → PlannerHandler2D-1b4b06b0.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-f492ea60.js → SeriousBasketHandler-6d4d921a.js} +1 -1
  9. package/build/cjs/{ShelfPlanner-65f4da8e.js → ShelfPlanner-8fa17486.js} +7 -7
  10. package/build/cjs/{StandardWWSHandler-6187c7c9.js → StandardWWSHandler-c84a70a7.js} +1 -1
  11. package/build/cjs/{index-34ea53f6.js → index-9358200e.js} +2189 -756
  12. package/build/cjs/index.js +8 -1
  13. package/build/esm/{DivaBoxPlanner-2ba492c3.js → DivaBoxPlanner-8c20358a.js} +12 -9
  14. package/build/esm/{DivaStandardPlanner-19e1f3d9.js → DivaStandardPlanner-75808b6c.js} +2 -2
  15. package/build/esm/{DoorPlanner-dd3a1b18.js → DoorPlanner-b74f2c6a.js} +1 -1
  16. package/build/esm/{Host3DSignalR-d5d5d7f3.js → Host3DSignalR-5af3fdc7.js} +1 -1
  17. package/build/esm/{LiviqueWWSHandler-1634b15e.js → LiviqueWWSHandler-12e6cecf.js} +1 -1
  18. package/build/esm/{PfisterWWSHandler-1ba9df74.js → PfisterWWSHandler-670a6f34.js} +1 -1
  19. package/build/esm/{PlannerHandler2D-8b9dbf35.js → PlannerHandler2D-24994f37.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-f0ccbf97.js → SeriousBasketHandler-dbf84292.js} +1 -1
  21. package/build/esm/{ShelfPlanner-b7d908ec.js → ShelfPlanner-c3b5b34f.js} +7 -7
  22. package/build/esm/{StandardWWSHandler-2a205527.js → StandardWWSHandler-2193dbc6.js} +1 -1
  23. package/build/esm/{index-0e729418.js → index-a2f44a31.js} +2183 -757
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/index.d.ts +9 -0
  26. package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts +1 -0
  28. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/Articles/PartListArticleToLoadType.d.ts +3 -0
  30. package/build/types/web-planner-logic/src/interface/Articles/PartListArticleToLoadType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts +1 -0
  32. package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/IDM/ArticleApi.d.ts +2 -1
  34. package/build/types/web-planner-logic/src/interface/IDM/ArticleApi.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts +5 -0
  36. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +40 -0
  38. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts +4 -0
  40. package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/logic/Article/Engine/ArticleEngine.d.ts +2 -0
  42. package/build/types/web-planner-logic/src/logic/Article/Engine/ArticleEngine.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts +17 -1
  44. package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts.map +1 -1
  45. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTree.d.ts +10 -0
  46. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTree.d.ts.map +1 -1
  47. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts +31 -0
  48. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts.map +1 -1
  49. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +2 -2
  50. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts.map +1 -1
  51. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +7 -0
  52. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  53. package/build/types/web-planner-logic/src/logic/DivaCatalogHandler.d.ts +2 -0
  54. package/build/types/web-planner-logic/src/logic/DivaCatalogHandler.d.ts.map +1 -1
  55. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +22 -6
  56. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  57. package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/ConstructionRulesHandler.d.ts.map +1 -1
  58. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  59. package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts +9 -2
  60. package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts.map +1 -1
  61. package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts.map +1 -1
  62. package/build/types/web-planner-logic/src/model/Options/ArticleOptionValueData.d.ts.map +1 -1
  63. package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts +31 -0
  64. package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts.map +1 -0
  65. package/build/types/web-planner-logic/src/model/Properties/propertyValueCodec.d.ts +34 -0
  66. package/build/types/web-planner-logic/src/model/Properties/propertyValueCodec.d.ts.map +1 -0
  67. package/build/types/web-planner-logic/src/test/cloneArticle.test.d.ts +2 -0
  68. package/build/types/web-planner-logic/src/test/cloneArticle.test.d.ts.map +1 -0
  69. package/build/types/web-planner-logic/src/test/configTreeStepArticle.test.d.ts +2 -0
  70. package/build/types/web-planner-logic/src/test/configTreeStepArticle.test.d.ts.map +1 -0
  71. package/build/types/web-planner-logic/src/test/eanFormula.test.d.ts +2 -0
  72. package/build/types/web-planner-logic/src/test/eanFormula.test.d.ts.map +1 -0
  73. package/build/types/web-planner-logic/src/test/fallbackRowWarning.test.d.ts +2 -0
  74. package/build/types/web-planner-logic/src/test/fallbackRowWarning.test.d.ts.map +1 -0
  75. package/build/types/web-planner-logic/src/test/idmOpgParentNames.test.d.ts +2 -0
  76. package/build/types/web-planner-logic/src/test/idmOpgParentNames.test.d.ts.map +1 -0
  77. package/build/types/web-planner-logic/src/test/idmSerieStaleId.test.d.ts +2 -0
  78. package/build/types/web-planner-logic/src/test/idmSerieStaleId.test.d.ts.map +1 -0
  79. package/build/types/web-planner-logic/src/test/mergeOptionGroupConnectedSteps.test.d.ts +2 -0
  80. package/build/types/web-planner-logic/src/test/mergeOptionGroupConnectedSteps.test.d.ts.map +1 -0
  81. package/build/types/web-planner-logic/src/test/partlistChildInit.test.d.ts +2 -0
  82. package/build/types/web-planner-logic/src/test/partlistChildInit.test.d.ts.map +1 -0
  83. package/build/types/web-planner-logic/src/test/propertyEncodingsKnowhow.test.d.ts +2 -0
  84. package/build/types/web-planner-logic/src/test/propertyEncodingsKnowhow.test.d.ts.map +1 -0
  85. package/build/types/web-planner-logic/src/test/propertyValueCodec.test.d.ts +2 -0
  86. package/build/types/web-planner-logic/src/test/propertyValueCodec.test.d.ts.map +1 -0
  87. package/build/types/web-planner-logic/src/test/staticVisibleOptionValues.test.d.ts +2 -0
  88. package/build/types/web-planner-logic/src/test/staticVisibleOptionValues.test.d.ts.map +1 -0
  89. package/package.json +3 -3
@@ -264,6 +264,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
264
264
  data,
265
265
  _response$headers,
266
266
  _e$response,
267
+ _e$response2,
267
268
  _args = arguments;
268
269
  return _regeneratorRuntime.wrap(function _callee$(_context) {
269
270
  while (1) switch (_context.prev = _context.next) {
@@ -345,8 +346,11 @@ var DivaApiHandler = /*#__PURE__*/function () {
345
346
  _context.t5 = _context["catch"](6);
346
347
  // Check if this is a rate limiting error (429)
347
348
  this.notifyEnricherError(url, dontLogError);
348
- throw Error('fetch failed! ' + url + ' Error: ' + _context.t5, {
349
+ // The status rides along: callers that recover from ONE status (a stale id 404) cannot parse it back out of the message.
350
+ throw Object.assign(Error('fetch failed! ' + url + ' Error: ' + _context.t5, {
349
351
  cause: _context.t5 === null || _context.t5 === void 0 || (_e$response = _context.t5.response) === null || _e$response === void 0 || (_e$response = _e$response.data) === null || _e$response === void 0 ? void 0 : _e$response.error
352
+ }), {
353
+ status: _context.t5 === null || _context.t5 === void 0 || (_e$response2 = _context.t5.response) === null || _e$response2 === void 0 ? void 0 : _e$response2.status
350
354
  });
351
355
  case 43:
352
356
  _context.prev = 43;
@@ -373,6 +377,15 @@ var DivaApiHandler = /*#__PURE__*/function () {
373
377
  * feedback instead of a silently broken UI. Optional enricher calls (e.g. the catalog mask) pass
374
378
  * `dontLogError` and are skipped. Only one modal is shown at a time to avoid stacking on parallel failures.
375
379
  */
380
+ /**
381
+ * Same as the failure path of `getDataCache`, for a caller that fetched with `dontLogError` to recover from
382
+ * ONE status itself (a stale-id 404) and found the failure to be something else.
383
+ */
384
+ }, {
385
+ key: "notifyEnricherErrorForQuery",
386
+ value: function notifyEnricherErrorForQuery(queryString, useWebServiceApi) {
387
+ this.notifyEnricherError(this.apiUrl(queryString, useWebServiceApi));
388
+ }
376
389
  }, {
377
390
  key: "notifyEnricherError",
378
391
  value: function notifyEnricherError(url, dontLogError) {
@@ -1341,6 +1354,13 @@ var DivaApiHandler = /*#__PURE__*/function () {
1341
1354
  value: function getIDMSerieByNo(packageId, serieId, serieNo) {
1342
1355
  return this.idmPrefix + (this.isSeller ? '/packages/' : '/catalogs/') + packageId + '/series/' + (this.useIDMService ? serieId : serieNo);
1343
1356
  }
1357
+
1358
+ /** Series list of a catalog or package, trimmed to the ids a stale-serieId lookup needs. */
1359
+ }, {
1360
+ key: "getIDMSeriesList",
1361
+ value: function getIDMSeriesList(packageId) {
1362
+ return this.idmPrefix + (this.isSeller ? '/packages/' : '/catalogs/') + packageId + '/series?fields=_id;serieNo';
1363
+ }
1344
1364
  }, {
1345
1365
  key: "getIDMItems",
1346
1366
  value: function getIDMItems(packageId, serieId, serieNo, typeNos) {
@@ -1589,7 +1609,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1589
1609
  key: "createLeadKey",
1590
1610
  value: function () {
1591
1611
  var _createLeadKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(email) {
1592
- var url, headers, response, _e$response2, _e$response3, status, body, apiMessage;
1612
+ var url, headers, response, _e$response3, _e$response4, status, body, apiMessage;
1593
1613
  return _regeneratorRuntime.wrap(function _callee12$(_context12) {
1594
1614
  while (1) switch (_context12.prev = _context12.next) {
1595
1615
  case 0:
@@ -1608,8 +1628,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
1608
1628
  case 9:
1609
1629
  _context12.prev = 9;
1610
1630
  _context12.t0 = _context12["catch"](2);
1611
- status = _context12.t0 === null || _context12.t0 === void 0 || (_e$response2 = _context12.t0.response) === null || _e$response2 === void 0 ? void 0 : _e$response2.status;
1612
- body = _context12.t0 === null || _context12.t0 === void 0 || (_e$response3 = _context12.t0.response) === null || _e$response3 === void 0 ? void 0 : _e$response3.data;
1631
+ status = _context12.t0 === null || _context12.t0 === void 0 || (_e$response3 = _context12.t0.response) === null || _e$response3 === void 0 ? void 0 : _e$response3.status;
1632
+ body = _context12.t0 === null || _context12.t0 === void 0 || (_e$response4 = _context12.t0.response) === null || _e$response4 === void 0 ? void 0 : _e$response4.data;
1613
1633
  apiMessage = typeof (body === null || body === void 0 ? void 0 : body.error) === 'string' ? body.error : _context12.t0 === null || _context12.t0 === void 0 ? void 0 : _context12.t0.message;
1614
1634
  LOG$q.error(new Error("Failed to create lead key for email ".concat(email, ": ").concat(apiMessage)));
1615
1635
  throw new DivaError(apiMessage || 'Failed to create lead key', {
@@ -18701,7 +18721,8 @@ var ArticleOptionValueData = /*#__PURE__*/function () {
18701
18721
  var _this$opv$catalogOPV$,
18702
18722
  _this = this;
18703
18723
  if (this.opv.propertyObj.isNotRelevant !== undefined) return this.opv.propertyObj.isNotRelevant;
18704
- return (_this$opv$catalogOPV$ = this.opv.catalogOPV.isNotRelevant) !== null && _this$opv$catalogOPV$ !== void 0 ? _this$opv$catalogOPV$ : ['OPV_NICHT_RELEVANT', 'OPV_NICHT_RELEVANT', 'OPVNR', 'OPVNRR', 'OPVNR_0'].find(function (codex) {
18724
+ // Legacy codices are OPV-prefixed; IDM optionKeys are bare — NICHT_RELEVANT is the standardized IDM key.
18725
+ return (_this$opv$catalogOPV$ = this.opv.catalogOPV.isNotRelevant) !== null && _this$opv$catalogOPV$ !== void 0 ? _this$opv$catalogOPV$ : ['NICHT_RELEVANT', 'OPVNR'].find(function (codex) {
18705
18726
  var _this$ocd;
18706
18727
  return ((_this$ocd = _this.ocd) !== null && _this$ocd !== void 0 ? _this$ocd : _this.codex).includes(codex);
18707
18728
  });
@@ -20041,7 +20062,14 @@ var LOG$l = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
20041
20062
  //a decision enabled by an action may itself enable further ones; the cap keeps a cyclic catalog from looping
20042
20063
  var MAX_DECISION_REFERENCE_ROUNDS = 5;
20043
20064
 
20044
- /** Loads the IDM data these articles need; missing price feature groups, features and decisions are reported, never fatal. */
20065
+ /**
20066
+ * Loads the IDM data these articles need; missing price feature groups, features and decisions are reported, never fatal.
20067
+ *
20068
+ * @param catalogData the catalog the articles BELONG to. Everything loaded here (items, decisions,
20069
+ * price feature groups, feature classes, features, options) is stored on AND read from this instance —
20070
+ * a partlist may load components from another serie (serie-0 component library), and those live in
20071
+ * their own catalog data. Defaults to the set's catalog, so same-serie articles behave unchanged.
20072
+ */
20045
20073
  function loadMoreFromIDMArticles(_x, _x2) {
20046
20074
  return _loadMoreFromIDMArticles.apply(this, arguments);
20047
20075
  }
@@ -20049,15 +20077,49 @@ function loadMoreFromIDMArticles(_x, _x2) {
20049
20077
  /** One additional-item reference of an item - the mandatory and optional sides of the same accessory merged. */
20050
20078
  function _loadMoreFromIDMArticles() {
20051
20079
  _loadMoreFromIDMArticles = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(catalogArticleDatas, set) {
20052
- var items, _loop3, i, toLoadDecisionIds, toLoadPFGroups, toLoadFeatureClassRefNo, promises, _yield$Promise$all, _yield$Promise$all2, featureClasses, priceFeatureGroups, decisions, _i5, _decisions$map, loadedIds, missingIds, _i6, _iterator6, _step6, _loop7, _i7, _catalogArticleData$d2, catalogArticleData, toLoadFeatures, features, _loop4, _i8, _iterator7, _step7, _loop8, _loop6, _i9;
20080
+ var catalogData,
20081
+ items,
20082
+ _loop3,
20083
+ i,
20084
+ toLoadDecisionIds,
20085
+ toLoadPFGroups,
20086
+ toLoadFeatureClassRefNo,
20087
+ promises,
20088
+ _yield$Promise$all,
20089
+ _yield$Promise$all2,
20090
+ featureClasses,
20091
+ priceFeatureGroups,
20092
+ decisions,
20093
+ _i5,
20094
+ _decisions$map,
20095
+ loadedIds,
20096
+ missingIds,
20097
+ _i6,
20098
+ _iterator6,
20099
+ _step6,
20100
+ _loop7,
20101
+ _i7,
20102
+ _catalogArticleData$d2,
20103
+ catalogArticleData,
20104
+ toLoadFeatures,
20105
+ features,
20106
+ _loop4,
20107
+ _i8,
20108
+ _iterator7,
20109
+ _step7,
20110
+ _loop8,
20111
+ _loop6,
20112
+ _i9,
20113
+ _args8 = arguments;
20053
20114
  return _regeneratorRuntime.wrap(function _callee2$(_context8) {
20054
20115
  while (1) switch (_context8.prev = _context8.next) {
20055
20116
  case 0:
20056
- _context8.next = 2;
20057
- return set.api.getDataCache(set.api.getIDMItems(set.CatalogData.accountGuid, set.CatalogData.serieId, set.CatalogData.catalogCodex, catalogArticleDatas.map(function (a) {
20117
+ catalogData = _args8.length > 2 && _args8[2] !== undefined ? _args8[2] : set.CatalogData;
20118
+ _context8.next = 3;
20119
+ return set.api.getDataCache(set.api.getIDMItems(catalogData.accountGuid, catalogData.serieId, catalogData.catalogCodex, catalogArticleDatas.map(function (a) {
20058
20120
  return a.articleCodex;
20059
20121
  })), undefined, undefined, 'enricher');
20060
- case 2:
20122
+ case 3:
20061
20123
  items = _context8.sent;
20062
20124
  _loop3 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop3() {
20063
20125
  var catalogArticleData, item;
@@ -20077,7 +20139,7 @@ function _loadMoreFromIDMArticles() {
20077
20139
  catalogArticleData.decisionsRefs = item.decisionRefs;
20078
20140
  catalogArticleData.idmPartlist = item.partlist;
20079
20141
  catalogArticleData.idmPrices = item.prices;
20080
- initIDMArticleRelations(item, catalogArticleData, set.CatalogData);
20142
+ initIDMArticleRelations(item, catalogArticleData, catalogData);
20081
20143
  case 8:
20082
20144
  case "end":
20083
20145
  return _context4.stop();
@@ -20085,28 +20147,28 @@ function _loadMoreFromIDMArticles() {
20085
20147
  }, _loop3);
20086
20148
  });
20087
20149
  i = 0;
20088
- case 5:
20150
+ case 6:
20089
20151
  if (!(i < catalogArticleDatas.length)) {
20090
- _context8.next = 10;
20152
+ _context8.next = 11;
20091
20153
  break;
20092
20154
  }
20093
- return _context8.delegateYield(_loop3(), "t0", 7);
20094
- case 7:
20155
+ return _context8.delegateYield(_loop3(), "t0", 8);
20156
+ case 8:
20095
20157
  i++;
20096
- _context8.next = 5;
20158
+ _context8.next = 6;
20097
20159
  break;
20098
- case 10:
20099
- toLoadDecisionIds = getToLoadDecisionIds(catalogArticleDatas, set);
20100
- toLoadPFGroups = getPriceFeatureGroups(catalogArticleDatas, set);
20160
+ case 11:
20161
+ toLoadDecisionIds = getToLoadDecisionIds(catalogArticleDatas, catalogData);
20162
+ toLoadPFGroups = getPriceFeatureGroups(catalogArticleDatas, catalogData);
20101
20163
  toLoadFeatureClassRefNo = _toConsumableArray(new Set(catalogArticleDatas.filter(function (a) {
20102
20164
  return a.featureClassRefNo !== undefined;
20103
20165
  }).map(function (a) {
20104
20166
  return a.featureClassRefNo;
20105
20167
  })));
20106
- promises = [set.api.getDataCache(set.api.getIDMFeatureClass(set.CatalogData.accountGuid, toLoadFeatureClassRefNo), undefined, undefined, 'enricher'), toLoadPFGroups.length ? set.api.getDataCache(set.api.getIDMPriceFeatureGroups(set.CatalogData.accountGuid, toLoadPFGroups), undefined, undefined, 'enricher') : undefined, toLoadDecisionIds.length ? fetchDecisions(set, toLoadDecisionIds) : undefined];
20107
- _context8.next = 16;
20168
+ promises = [set.api.getDataCache(set.api.getIDMFeatureClass(catalogData.accountGuid, toLoadFeatureClassRefNo), undefined, undefined, 'enricher'), toLoadPFGroups.length ? set.api.getDataCache(set.api.getIDMPriceFeatureGroups(catalogData.accountGuid, toLoadPFGroups), undefined, undefined, 'enricher') : undefined, toLoadDecisionIds.length ? fetchDecisions(set, catalogData, toLoadDecisionIds) : undefined];
20169
+ _context8.next = 17;
20108
20170
  return Promise.all(promises);
20109
- case 16:
20171
+ case 17:
20110
20172
  _yield$Promise$all = _context8.sent;
20111
20173
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
20112
20174
  featureClasses = _yield$Promise$all2[0];
@@ -20114,11 +20176,11 @@ function _loadMoreFromIDMArticles() {
20114
20176
  decisions = _yield$Promise$all2[2];
20115
20177
  if (decisions) {
20116
20178
  for (_i5 = 0; _i5 < decisions.length; _i5++) {
20117
- set.CatalogData.loadedDecisions.push(initializeDecision(decisions[_i5], set.CatalogData.idmOptionGroups));
20179
+ catalogData.loadedDecisions.push(initializeDecision(decisions[_i5], catalogData.idmOptionGroups));
20118
20180
  }
20119
20181
  }
20120
20182
  if (!(toLoadDecisionIds.length !== 0 && toLoadDecisionIds.length != (decisions === null || decisions === void 0 ? void 0 : decisions.length))) {
20121
- _context8.next = 26;
20183
+ _context8.next = 27;
20122
20184
  break;
20123
20185
  }
20124
20186
  loadedIds = new Set((_decisions$map = decisions === null || decisions === void 0 ? void 0 : decisions.map(function (d) {
@@ -20128,17 +20190,17 @@ function _loadMoreFromIDMArticles() {
20128
20190
  return !loadedIds.has(id);
20129
20191
  });
20130
20192
  throw new Error("loading decisions failed \u2013 missing: [".concat(missingIds.join(', '), "]"));
20131
- case 26:
20132
- _context8.next = 28;
20133
- return loadDecisionsReferencedByActions(set);
20134
- case 28:
20193
+ case 27:
20194
+ _context8.next = 29;
20195
+ return loadDecisionsReferencedByActions(set, catalogData);
20196
+ case 29:
20135
20197
  if (priceFeatureGroups) {
20136
20198
  for (_i6 = 0; _i6 < priceFeatureGroups.length; _i6++) {
20137
- set.CatalogData.loadedPriceFeaturegroups.push(initializePriceFeatureGroups(priceFeatureGroups[_i6], set.CatalogData.idmOptionGroups));
20199
+ catalogData.loadedPriceFeaturegroups.push(initializePriceFeatureGroups(priceFeatureGroups[_i6], catalogData.idmOptionGroups));
20138
20200
  }
20139
20201
  }
20140
20202
  _iterator6 = _createForOfIteratorHelper$j(toLoadPFGroups);
20141
- _context8.prev = 30;
20203
+ _context8.prev = 31;
20142
20204
  _loop7 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop7() {
20143
20205
  var prfgNo, askedBy;
20144
20206
  return _regeneratorRuntime.wrap(function _loop7$(_context5) {
@@ -20167,50 +20229,50 @@ function _loadMoreFromIDMArticles() {
20167
20229
  }, _loop7);
20168
20230
  });
20169
20231
  _iterator6.s();
20170
- case 33:
20232
+ case 34:
20171
20233
  if ((_step6 = _iterator6.n()).done) {
20172
- _context8.next = 39;
20234
+ _context8.next = 40;
20173
20235
  break;
20174
20236
  }
20175
- return _context8.delegateYield(_loop7(), "t1", 35);
20176
- case 35:
20237
+ return _context8.delegateYield(_loop7(), "t1", 36);
20238
+ case 36:
20177
20239
  if (!_context8.t1) {
20178
- _context8.next = 37;
20240
+ _context8.next = 38;
20179
20241
  break;
20180
20242
  }
20181
- return _context8.abrupt("continue", 37);
20182
- case 37:
20183
- _context8.next = 33;
20243
+ return _context8.abrupt("continue", 38);
20244
+ case 38:
20245
+ _context8.next = 34;
20184
20246
  break;
20185
- case 39:
20186
- _context8.next = 44;
20247
+ case 40:
20248
+ _context8.next = 45;
20187
20249
  break;
20188
- case 41:
20189
- _context8.prev = 41;
20190
- _context8.t2 = _context8["catch"](30);
20250
+ case 42:
20251
+ _context8.prev = 42;
20252
+ _context8.t2 = _context8["catch"](31);
20191
20253
  _iterator6.e(_context8.t2);
20192
- case 44:
20193
- _context8.prev = 44;
20254
+ case 45:
20255
+ _context8.prev = 45;
20194
20256
  _iterator6.f();
20195
- return _context8.finish(44);
20196
- case 47:
20257
+ return _context8.finish(45);
20258
+ case 48:
20197
20259
  for (_i7 = 0; _i7 < catalogArticleDatas.length; _i7++) {
20198
20260
  catalogArticleData = catalogArticleDatas[_i7];
20199
- catalogArticleData.articleIDMDecisions = sortDecisions(set.CatalogData.getDecisionsByNo(_toConsumableArray(new Set([].concat(_toConsumableArray(set.CatalogData.globalDecisions.map(function (g) {
20261
+ catalogArticleData.articleIDMDecisions = sortDecisions(catalogData.getDecisionsByNo(_toConsumableArray(new Set([].concat(_toConsumableArray(catalogData.globalDecisions.map(function (g) {
20200
20262
  return g.decisionNo;
20201
- })), _toConsumableArray(set.CatalogData.serieDecisionRefs), _toConsumableArray((_catalogArticleData$d2 = catalogArticleData.decisionsRefs) !== null && _catalogArticleData$d2 !== void 0 ? _catalogArticleData$d2 : []))))));
20263
+ })), _toConsumableArray(catalogData.serieDecisionRefs), _toConsumableArray((_catalogArticleData$d2 = catalogArticleData.decisionsRefs) !== null && _catalogArticleData$d2 !== void 0 ? _catalogArticleData$d2 : []))))));
20202
20264
  }
20203
20265
  featureClasses.map(function (fc) {
20204
- return set.CatalogData.loadedFeatureClasses.push(fc);
20266
+ return catalogData.loadedFeatureClasses.push(fc);
20205
20267
  });
20206
- toLoadFeatures = getFeatures(set, featureClasses);
20268
+ toLoadFeatures = getFeatures(catalogData, featureClasses);
20207
20269
  if (!toLoadFeatures.length) {
20208
- _context8.next = 61;
20270
+ _context8.next = 62;
20209
20271
  break;
20210
20272
  }
20211
- _context8.next = 53;
20212
- return set.api.getDataCache(set.api.getIDMFeatures(set.CatalogData.accountGuid, toLoadFeatures), undefined, undefined, 'enricher');
20213
- case 53:
20273
+ _context8.next = 54;
20274
+ return set.api.getDataCache(set.api.getIDMFeatures(catalogData.accountGuid, toLoadFeatures), undefined, undefined, 'enricher');
20275
+ case 54:
20214
20276
  features = _context8.sent;
20215
20277
  _loop4 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop4() {
20216
20278
  var feature, insertIndex, k, _loop5, j;
@@ -20218,14 +20280,14 @@ function _loadMoreFromIDMArticles() {
20218
20280
  while (1) switch (_context3.prev = _context3.next) {
20219
20281
  case 0:
20220
20282
  feature = features[_i8];
20221
- insertIndex = set.CatalogData.loadedFeatures.length;
20283
+ insertIndex = catalogData.loadedFeatures.length;
20222
20284
  k = 0;
20223
20285
  case 3:
20224
- if (!(k < set.CatalogData.loadedFeatures.length)) {
20286
+ if (!(k < catalogData.loadedFeatures.length)) {
20225
20287
  _context3.next = 10;
20226
20288
  break;
20227
20289
  }
20228
- if (!(set.CatalogData.loadedFeatures[k].sequenceNo > feature.sequenceNo)) {
20290
+ if (!(catalogData.loadedFeatures[k].sequenceNo > feature.sequenceNo)) {
20229
20291
  _context3.next = 7;
20230
20292
  break;
20231
20293
  }
@@ -20236,27 +20298,27 @@ function _loadMoreFromIDMArticles() {
20236
20298
  _context3.next = 3;
20237
20299
  break;
20238
20300
  case 10:
20239
- set.CatalogData.loadedFeatures.splice(insertIndex, 0, feature);
20301
+ catalogData.loadedFeatures.splice(insertIndex, 0, feature);
20240
20302
  _loop5 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop5(j) {
20241
20303
  var option, _insertIndex, _k;
20242
20304
  return _regeneratorRuntime.wrap(function _loop5$(_context2) {
20243
20305
  while (1) switch (_context2.prev = _context2.next) {
20244
20306
  case 0:
20245
- if (set.CatalogData.loadedOptions.find(function (o) {
20307
+ if (catalogData.loadedOptions.find(function (o) {
20246
20308
  return o.optionKey == feature.options[j].optionKey;
20247
20309
  })) {
20248
20310
  _context2.next = 12;
20249
20311
  break;
20250
20312
  }
20251
20313
  option = feature.options[j];
20252
- _insertIndex = set.CatalogData.loadedOptions.length;
20314
+ _insertIndex = catalogData.loadedOptions.length;
20253
20315
  _k = 0;
20254
20316
  case 4:
20255
- if (!(_k < set.CatalogData.loadedOptions.length)) {
20317
+ if (!(_k < catalogData.loadedOptions.length)) {
20256
20318
  _context2.next = 11;
20257
20319
  break;
20258
20320
  }
20259
- if (!(set.CatalogData.loadedOptions[_k].sequenceNo > option.sequenceNo)) {
20321
+ if (!(catalogData.loadedOptions[_k].sequenceNo > option.sequenceNo)) {
20260
20322
  _context2.next = 8;
20261
20323
  break;
20262
20324
  }
@@ -20267,7 +20329,7 @@ function _loadMoreFromIDMArticles() {
20267
20329
  _context2.next = 4;
20268
20330
  break;
20269
20331
  case 11:
20270
- set.CatalogData.loadedOptions.splice(_insertIndex, 0, option);
20332
+ catalogData.loadedOptions.splice(_insertIndex, 0, option);
20271
20333
  case 12:
20272
20334
  case "end":
20273
20335
  return _context2.stop();
@@ -20292,19 +20354,19 @@ function _loadMoreFromIDMArticles() {
20292
20354
  }, _loop4);
20293
20355
  });
20294
20356
  _i8 = 0;
20295
- case 56:
20357
+ case 57:
20296
20358
  if (!(_i8 < features.length)) {
20297
- _context8.next = 61;
20359
+ _context8.next = 62;
20298
20360
  break;
20299
20361
  }
20300
- return _context8.delegateYield(_loop4(), "t3", 58);
20301
- case 58:
20362
+ return _context8.delegateYield(_loop4(), "t3", 59);
20363
+ case 59:
20302
20364
  _i8++;
20303
- _context8.next = 56;
20365
+ _context8.next = 57;
20304
20366
  break;
20305
- case 61:
20367
+ case 62:
20306
20368
  _iterator7 = _createForOfIteratorHelper$j(toLoadFeatures);
20307
- _context8.prev = 62;
20369
+ _context8.prev = 63;
20308
20370
  _loop8 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop8() {
20309
20371
  var featureNo, askedBy;
20310
20372
  return _regeneratorRuntime.wrap(function _loop8$(_context6) {
@@ -20334,33 +20396,33 @@ function _loadMoreFromIDMArticles() {
20334
20396
  }, _loop8);
20335
20397
  });
20336
20398
  _iterator7.s();
20337
- case 65:
20399
+ case 66:
20338
20400
  if ((_step7 = _iterator7.n()).done) {
20339
- _context8.next = 71;
20401
+ _context8.next = 72;
20340
20402
  break;
20341
20403
  }
20342
- return _context8.delegateYield(_loop8(), "t4", 67);
20343
- case 67:
20404
+ return _context8.delegateYield(_loop8(), "t4", 68);
20405
+ case 68:
20344
20406
  if (!_context8.t4) {
20345
- _context8.next = 69;
20407
+ _context8.next = 70;
20346
20408
  break;
20347
20409
  }
20348
- return _context8.abrupt("continue", 69);
20349
- case 69:
20350
- _context8.next = 65;
20410
+ return _context8.abrupt("continue", 70);
20411
+ case 70:
20412
+ _context8.next = 66;
20351
20413
  break;
20352
- case 71:
20353
- _context8.next = 76;
20414
+ case 72:
20415
+ _context8.next = 77;
20354
20416
  break;
20355
- case 73:
20356
- _context8.prev = 73;
20357
- _context8.t5 = _context8["catch"](62);
20417
+ case 74:
20418
+ _context8.prev = 74;
20419
+ _context8.t5 = _context8["catch"](63);
20358
20420
  _iterator7.e(_context8.t5);
20359
- case 76:
20360
- _context8.prev = 76;
20421
+ case 77:
20422
+ _context8.prev = 77;
20361
20423
  _iterator7.f();
20362
- return _context8.finish(76);
20363
- case 79:
20424
+ return _context8.finish(77);
20425
+ case 80:
20364
20426
  _loop6 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop6() {
20365
20427
  var catalogArticleData, featureClass, features, j;
20366
20428
  return _regeneratorRuntime.wrap(function _loop6$(_context7) {
@@ -20376,9 +20438,9 @@ function _loadMoreFromIDMArticles() {
20376
20438
  }
20377
20439
  throw new Error('featureClassRefNo ' + catalogArticleData.featureClassRefNo + ' not found');
20378
20440
  case 4:
20379
- features = set.CatalogData.getFeatures(getFeaturesByFeatureClass(featureClass));
20441
+ features = catalogData.getFeatures(getFeaturesByFeatureClass(featureClass));
20380
20442
  for (j = 0; j < features.length; j++) {
20381
- initFeature(features[j], catalogArticleData, set);
20443
+ initFeature(features[j], catalogArticleData, set, catalogData);
20382
20444
  }
20383
20445
  case 6:
20384
20446
  case "end":
@@ -20387,25 +20449,25 @@ function _loadMoreFromIDMArticles() {
20387
20449
  }, _loop6);
20388
20450
  });
20389
20451
  _i9 = 0;
20390
- case 81:
20452
+ case 82:
20391
20453
  if (!(_i9 < catalogArticleDatas.length)) {
20392
- _context8.next = 86;
20454
+ _context8.next = 87;
20393
20455
  break;
20394
20456
  }
20395
- return _context8.delegateYield(_loop6(), "t6", 83);
20396
- case 83:
20457
+ return _context8.delegateYield(_loop6(), "t6", 84);
20458
+ case 84:
20397
20459
  _i9++;
20398
- _context8.next = 81;
20460
+ _context8.next = 82;
20399
20461
  break;
20400
- case 86:
20462
+ case 87:
20401
20463
  catalogArticleDatas.map(function (c) {
20402
20464
  return c.areOptionsLoaded = true;
20403
20465
  });
20404
- case 87:
20466
+ case 88:
20405
20467
  case "end":
20406
20468
  return _context8.stop();
20407
20469
  }
20408
- }, _callee2, null, [[30, 41, 44, 47], [62, 73, 76, 79]]);
20470
+ }, _callee2, null, [[31, 42, 45, 48], [63, 74, 77, 80]]);
20409
20471
  }));
20410
20472
  return _loadMoreFromIDMArticles.apply(this, arguments);
20411
20473
  }
@@ -20528,10 +20590,12 @@ function initIDMArticleRelations(item, catalogArticleData, catalog) {
20528
20590
  }
20529
20591
  catalogArticle.hasArticleRelations = catalogArticle.articleRelations.length > 0;
20530
20592
  }
20531
- var fetchDecisions = function fetchDecisions(set, decisionNos) {
20532
- var getUrl = set.api.getIDMDecisions(set.CatalogData.accountGuid, decisionNos);
20593
+
20594
+ /** Load IDM decisions by number; a list too long for one GET url goes through the POST query endpoint. */
20595
+ var fetchDecisions = function fetchDecisions(set, catalogData, decisionNos) {
20596
+ var getUrl = set.api.getIDMDecisions(catalogData.accountGuid, decisionNos);
20533
20597
  if (getUrl.length > 2000) {
20534
- return set.api.getDataCache(set.api.getIDMDecisionsQueryUrl(set.CatalogData.accountGuid), undefined, undefined, 'enricher', 'POST', {
20598
+ return set.api.getDataCache(set.api.getIDMDecisionsQueryUrl(catalogData.accountGuid), undefined, undefined, 'enricher', 'POST', {
20535
20599
  decisionNos: decisionNos.join(';')
20536
20600
  });
20537
20601
  }
@@ -20546,7 +20610,7 @@ var fetchDecisions = function fetchDecisions(set, decisionNos) {
20546
20610
  * apply while that action matches. References are followed transitively.
20547
20611
  */
20548
20612
  var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20549
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(set) {
20613
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(set, catalogData) {
20550
20614
  var round, toLoad, _iterator3, _step3, _decision$optionCombi, decision, _iterator4, _step4, _combination$projectA, _combination$projectA2, _combination$projectA3, _combination$projectA4, combination, refs, _iterator5, _step5, ref, decisionNo, decisions, i, _decisions$length, stillMissing;
20551
20615
  return _regeneratorRuntime.wrap(function _callee$(_context) {
20552
20616
  while (1) switch (_context.prev = _context.next) {
@@ -20558,7 +20622,7 @@ var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20558
20622
  break;
20559
20623
  }
20560
20624
  toLoad = new Set();
20561
- _iterator3 = _createForOfIteratorHelper$j(set.CatalogData.loadedDecisions);
20625
+ _iterator3 = _createForOfIteratorHelper$j(catalogData.loadedDecisions);
20562
20626
  try {
20563
20627
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
20564
20628
  decision = _step3.value;
@@ -20572,7 +20636,7 @@ var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20572
20636
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
20573
20637
  ref = _step5.value;
20574
20638
  decisionNo = Number(ref.decisionNo);
20575
- if (!isNaN(decisionNo) && !set.CatalogData.getDecisionByNo(decisionNo)) toLoad.add(decisionNo);
20639
+ if (!isNaN(decisionNo) && !catalogData.getDecisionByNo(decisionNo)) toLoad.add(decisionNo);
20576
20640
  }
20577
20641
  } catch (err) {
20578
20642
  _iterator5.e(err);
@@ -20598,14 +20662,14 @@ var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20598
20662
  return _context.abrupt("return");
20599
20663
  case 7:
20600
20664
  _context.next = 9;
20601
- return fetchDecisions(set, _toConsumableArray(toLoad));
20665
+ return fetchDecisions(set, catalogData, _toConsumableArray(toLoad));
20602
20666
  case 9:
20603
20667
  decisions = _context.sent;
20604
20668
  for (i = 0; i < ((_decisions$length = decisions === null || decisions === void 0 ? void 0 : decisions.length) !== null && _decisions$length !== void 0 ? _decisions$length : 0); i++) {
20605
- set.CatalogData.loadedDecisions.push(initializeDecision(decisions[i], set.CatalogData.idmOptionGroups));
20669
+ catalogData.loadedDecisions.push(initializeDecision(decisions[i], catalogData.idmOptionGroups));
20606
20670
  }
20607
20671
  stillMissing = _toConsumableArray(toLoad).filter(function (decisionNo) {
20608
- return !set.CatalogData.getDecisionByNo(decisionNo);
20672
+ return !catalogData.getDecisionByNo(decisionNo);
20609
20673
  });
20610
20674
  if (!stillMissing.length) {
20611
20675
  _context.next = 15;
@@ -20624,11 +20688,13 @@ var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20624
20688
  }
20625
20689
  }, _callee);
20626
20690
  }));
20627
- return function loadDecisionsReferencedByActions(_x3) {
20691
+ return function loadDecisionsReferencedByActions(_x3, _x4) {
20628
20692
  return _ref3.apply(this, arguments);
20629
20693
  };
20630
20694
  }();
20631
- var getToLoadDecisionIds = function getToLoadDecisionIds(catalogArticleDatas, set) {
20695
+
20696
+ /** Decision numbers the articles, their media items, the serie and the globals reference that the catalog has not loaded yet. */
20697
+ var getToLoadDecisionIds = function getToLoadDecisionIds(catalogArticleDatas, catalogData) {
20632
20698
  var allArticleDecisions = [];
20633
20699
  for (var i = 0; i < catalogArticleDatas.length; i++) {
20634
20700
  var _catalogArticleData$s, _catalogArticleData$s2, _catalogArticleData$i, _catalogArticleData$i2, _catalogArticleData$i3, _catalogArticleData$d;
@@ -20642,26 +20708,28 @@ var getToLoadDecisionIds = function getToLoadDecisionIds(catalogArticleDatas, se
20642
20708
  })) !== null && _catalogArticleData$i !== void 0 ? _catalogArticleData$i : []));
20643
20709
  allArticleDecisions = [].concat(_toConsumableArray(allArticleDecisions), _toConsumableArray((_catalogArticleData$i3 = catalogArticleData.idmPartlistDecisions) !== null && _catalogArticleData$i3 !== void 0 ? _catalogArticleData$i3 : []), _toConsumableArray((_catalogArticleData$d = catalogArticleData.decisionsRefs) !== null && _catalogArticleData$d !== void 0 ? _catalogArticleData$d : []), _toConsumableArray(decisionsOfMediaItems));
20644
20710
  }
20645
- var neededDecisionsIds = _toConsumableArray(new Set([].concat(_toConsumableArray(set.CatalogData.globalDecisions.map(function (g) {
20711
+ var neededDecisionsIds = _toConsumableArray(new Set([].concat(_toConsumableArray(catalogData.globalDecisions.map(function (g) {
20646
20712
  return g.decisionNo;
20647
- })), _toConsumableArray(set.CatalogData.serieDecisionRefs), _toConsumableArray(allArticleDecisions))));
20713
+ })), _toConsumableArray(catalogData.serieDecisionRefs), _toConsumableArray(allArticleDecisions))));
20648
20714
  var toLoadDecisionIds = [];
20649
20715
  for (var _i2 = 0; _i2 < neededDecisionsIds.length; _i2++) {
20650
- var found = set.CatalogData.getDecisionByNo(neededDecisionsIds[_i2]);
20716
+ var found = catalogData.getDecisionByNo(neededDecisionsIds[_i2]);
20651
20717
  if (found) ; else {
20652
20718
  toLoadDecisionIds.push(neededDecisionsIds[_i2]);
20653
20719
  }
20654
20720
  }
20655
20721
  return toLoadDecisionIds;
20656
20722
  };
20657
- var getFeatures = function getFeatures(set, featureClasses) {
20723
+
20724
+ /** Feature numbers the feature classes reference that the catalog has not loaded yet. */
20725
+ var getFeatures = function getFeatures(catalogData, featureClasses) {
20658
20726
  var neededFeatures = [];
20659
20727
  for (var i = 0; i < featureClasses.length; i++) {
20660
20728
  var featureClass = featureClasses[i];
20661
20729
  neededFeatures = [].concat(_toConsumableArray(neededFeatures), _toConsumableArray(getFeaturesByFeatureClass(featureClass)));
20662
20730
  }
20663
20731
  neededFeatures = _toConsumableArray(new Set(neededFeatures)); // remove duplicates
20664
- var alreadyLoadedFeatures = set.CatalogData.loadedFeatures;
20732
+ var alreadyLoadedFeatures = catalogData.loadedFeatures;
20665
20733
  var toLoadFeatures = [];
20666
20734
  var loadedFeatures = [];
20667
20735
  var _loop = function _loop(_i3) {
@@ -20689,7 +20757,9 @@ var getFeaturesByFeatureClass = function getFeaturesByFeatureClass(featureClass)
20689
20757
  }
20690
20758
  return neededFeatures;
20691
20759
  };
20692
- var getPriceFeatureGroups = function getPriceFeatureGroups(catalogArticleDatas, set) {
20760
+
20761
+ /** Price feature group numbers the articles reference that the catalog has not loaded yet. */
20762
+ var getPriceFeatureGroups = function getPriceFeatureGroups(catalogArticleDatas, catalogData) {
20693
20763
  var neededPriceFeatureGroupNos = [];
20694
20764
  for (var i = 0; i < catalogArticleDatas.length; i++) {
20695
20765
  var _catalogArticleDatas$;
@@ -20698,7 +20768,7 @@ var getPriceFeatureGroups = function getPriceFeatureGroups(catalogArticleDatas,
20698
20768
  var toLoadPriceFeatureGroups = [];
20699
20769
  neededPriceFeatureGroupNos = _toConsumableArray(new Set(neededPriceFeatureGroupNos));
20700
20770
  for (var _i4 = 0; _i4 < neededPriceFeatureGroupNos.length; _i4++) {
20701
- var found = set.CatalogData.getPricefeaturegroup(neededPriceFeatureGroupNos[_i4]);
20771
+ var found = catalogData.getPricefeaturegroup(neededPriceFeatureGroupNos[_i4]);
20702
20772
  if (found) ; else {
20703
20773
  toLoadPriceFeatureGroups.push(neededPriceFeatureGroupNos[_i4]);
20704
20774
  }
@@ -20802,21 +20872,25 @@ var sortDecisions = function sortDecisions(decisions) {
20802
20872
  }
20803
20873
  return sortedDecisions;
20804
20874
  };
20805
- var initFeature = function initFeature(feature, catalogArticleData, set) {
20806
- var catFeature = set.CatalogData.getOption(feature.featureNo);
20875
+
20876
+ /** Register the feature once as a catalog option and attach it to the article as an article option. */
20877
+ var initFeature = function initFeature(feature, catalogArticleData, set, catalogData) {
20878
+ var catFeature = catalogData.getOption(feature.featureNo);
20807
20879
  if (!catFeature) {
20808
- catFeature = new OptionCatalogData(getCatalogFeatureType(feature, catalogArticleData, set), set.CatalogData);
20809
- set.CatalogData.setOption(catFeature);
20880
+ catFeature = new OptionCatalogData(getCatalogFeatureType(feature, catalogArticleData, set, catalogData), catalogData);
20881
+ catalogData.setOption(catFeature);
20810
20882
  }
20811
- var newArticleFeature = new ArticleOptionData(getArticleFeatureType(feature, catalogArticleData, catFeature, set), set.CatalogData);
20812
- initOption(feature, newArticleFeature, catalogArticleData, set);
20883
+ var newArticleFeature = new ArticleOptionData(getArticleFeatureType(feature, catalogArticleData, catFeature, set, catalogData), catalogData);
20884
+ initOption(feature, newArticleFeature, catalogArticleData, set, catalogData);
20813
20885
  catalogArticleData.articleOptions[newArticleFeature.codex] = newArticleFeature;
20814
20886
  };
20815
- function getCatalogFeatureType(feature, catalogArticleData, set) {
20816
- var _set$CatalogData$cata, _set$CatalogData$cata2, _set$CatalogData$cata3, _feature$detailInfos, _optionMask$hidden;
20817
- var featureClass = set.CatalogData.getFeatureClass(catalogArticleData.featureClassRefNo);
20818
- var optionMask = (_set$CatalogData$cata = set.CatalogData.catalogMask) === null || _set$CatalogData$cata === void 0 || (_set$CatalogData$cata = _set$CatalogData$cata.options) === null || _set$CatalogData$cata === void 0 ? void 0 : _set$CatalogData$cata[feature.featureNo];
20819
- var maskProperties = getPropertiesForFeatureNo((_set$CatalogData$cata2 = (_set$CatalogData$cata3 = set.CatalogData.catalogMask) === null || _set$CatalogData$cata3 === void 0 ? void 0 : _set$CatalogData$cata3.properties) !== null && _set$CatalogData$cata2 !== void 0 ? _set$CatalogData$cata2 : [], undefined, feature.featureNo, set.CatalogData.api.getLanguage());
20887
+
20888
+ /** Catalog-level option data of an IDM feature: localized texts plus the feature's and the mask's properties. */
20889
+ function getCatalogFeatureType(feature, catalogArticleData, set, catalogData) {
20890
+ var _catalogData$catalogM, _catalogData$catalogM2, _catalogData$catalogM3, _feature$detailInfos, _optionMask$hidden;
20891
+ var featureClass = catalogData.getFeatureClass(catalogArticleData.featureClassRefNo);
20892
+ var optionMask = (_catalogData$catalogM = catalogData.catalogMask) === null || _catalogData$catalogM === void 0 || (_catalogData$catalogM = _catalogData$catalogM.options) === null || _catalogData$catalogM === void 0 ? void 0 : _catalogData$catalogM[feature.featureNo];
20893
+ var maskProperties = getPropertiesForFeatureNo((_catalogData$catalogM2 = (_catalogData$catalogM3 = catalogData.catalogMask) === null || _catalogData$catalogM3 === void 0 ? void 0 : _catalogData$catalogM3.properties) !== null && _catalogData$catalogM2 !== void 0 ? _catalogData$catalogM2 : [], undefined, feature.featureNo, catalogData.api.getLanguage());
20820
20894
  var properties = [].concat(_toConsumableArray(convertProperties(feature.properties, set.api.getLanguageLowercase())), _toConsumableArray(maskProperties !== null && maskProperties !== void 0 ? maskProperties : []));
20821
20895
  return {
20822
20896
  name: DivaUtils.getLocals(feature.featureText, set.api.getLanguageLowercase()),
@@ -20838,16 +20912,16 @@ function getCatalogFeatureType(feature, catalogArticleData, set) {
20838
20912
  propertyObj: {}
20839
20913
  };
20840
20914
  }
20841
- function getArticleFeatureType(feature, catalogArticleData, catOPT, set) {
20842
- var _catalogArticleData$f, _catalogArticleData$f2, _set$CatalogData$tabG, _set$CatalogData$cata4, _set$CatalogData$cata5;
20915
+ function getArticleFeatureType(feature, catalogArticleData, catOPT, set, catalogData) {
20916
+ var _catalogArticleData$f, _catalogArticleData$f2, _catalogData$tabGroup, _catalogData$catalogM4, _catalogData$catalogM5;
20843
20917
  var props = (_catalogArticleData$f = (_catalogArticleData$f2 = catalogArticleData.featureProperties) === null || _catalogArticleData$f2 === void 0 ? void 0 : _catalogArticleData$f2.filter(function (p) {
20844
20918
  return p.FeatureNos.includes(feature.featureNo);
20845
20919
  })) !== null && _catalogArticleData$f !== void 0 ? _catalogArticleData$f : [];
20846
- var featureClass = set.CatalogData.getFeatureClass(catalogArticleData.featureClassRefNo);
20847
- var tabgroup = (_set$CatalogData$tabG = set.CatalogData.tabGroups) === null || _set$CatalogData$tabG === void 0 ? void 0 : _set$CatalogData$tabG.find(function (t) {
20920
+ var featureClass = catalogData.getFeatureClass(catalogArticleData.featureClassRefNo);
20921
+ var tabgroup = (_catalogData$tabGroup = catalogData.tabGroups) === null || _catalogData$tabGroup === void 0 ? void 0 : _catalogData$tabGroup.find(function (t) {
20848
20922
  return t.featureNos.includes(feature.featureNo);
20849
20923
  });
20850
- var maskProperties = getPropertiesForFeatureNo((_set$CatalogData$cata4 = (_set$CatalogData$cata5 = set.CatalogData.catalogMask) === null || _set$CatalogData$cata5 === void 0 ? void 0 : _set$CatalogData$cata5.properties) !== null && _set$CatalogData$cata4 !== void 0 ? _set$CatalogData$cata4 : [], catalogArticleData.articleCodex, feature.featureNo, set.CatalogData.api.getLanguage());
20924
+ var maskProperties = getPropertiesForFeatureNo((_catalogData$catalogM4 = (_catalogData$catalogM5 = catalogData.catalogMask) === null || _catalogData$catalogM5 === void 0 ? void 0 : _catalogData$catalogM5.properties) !== null && _catalogData$catalogM4 !== void 0 ? _catalogData$catalogM4 : [], catalogArticleData.articleCodex, feature.featureNo, catalogData.api.getLanguage());
20851
20925
  var opt = {
20852
20926
  codex: feature.featureNo,
20853
20927
  catalogOPT: catOPT,
@@ -20865,17 +20939,17 @@ function getArticleFeatureType(feature, catalogArticleData, catOPT, set) {
20865
20939
  }
20866
20940
 
20867
20941
  //option in IDM language so in Diva World its OptionValue
20868
- function initOption(feature, articleFeature, catalogArticle, set) {
20942
+ function initOption(feature, articleFeature, catalogArticle, set, catalogData) {
20869
20943
  var options = feature.options;
20870
20944
  var allOptionsOfFeature = new Map();
20871
20945
  //Items initalisieren
20872
20946
  var _loop2 = function _loop2() {
20873
20947
  var option = options[j];
20874
- var catOption = set.CatalogData.getOptionValues().find(function (o) {
20948
+ var catOption = catalogData.getOptionValues().find(function (o) {
20875
20949
  return o.codex == option.optionKey;
20876
20950
  });
20877
- if (!catOption) catOption = getCatalogOptionType(option, set);
20878
- var articleIDMOption = new ArticleOptionValueData(getArticleOption(set, option, catOption, articleFeature, catalogArticle), set.CatalogData);
20951
+ if (!catOption) catOption = getCatalogOptionType(option, set, catalogData);
20952
+ var articleIDMOption = new ArticleOptionValueData(getArticleOption(set, option, catOption, articleFeature, catalogArticle, catalogData), catalogData);
20879
20953
  allOptionsOfFeature.set(articleIDMOption.codex, articleIDMOption);
20880
20954
  };
20881
20955
  for (var j = 0; j < options.length; j++) {
@@ -20884,12 +20958,13 @@ function initOption(feature, articleFeature, catalogArticle, set) {
20884
20958
  articleFeature.initOPVsInOPT(allOptionsOfFeature);
20885
20959
  catalogArticle.articleOptions[articleFeature.codex];
20886
20960
  }
20887
- function getCatalogOptionType(option, set) {
20888
- var _catalogData$catalogM, _catalogData$catalogM2, _option$detailInfos, _option$detailInfos2, _option$measureValue;
20889
- var catalogData = set.CatalogData;
20961
+
20962
+ /** Catalog-level option-value data of an IDM option: localized texts, properties from option and mask, media. */
20963
+ function getCatalogOptionType(option, set, catalogData) {
20964
+ var _catalogData$catalogM6, _catalogData$catalogM7, _option$detailInfos, _option$detailInfos2, _option$measureValue;
20890
20965
  var name = DivaUtils.getLocals(option.optionText, set.api.getLanguageLowercase());
20891
- var maskProperties = getPropertiesForOptionKey((_catalogData$catalogM = (_catalogData$catalogM2 = catalogData.catalogMask) === null || _catalogData$catalogM2 === void 0 ? void 0 : _catalogData$catalogM2.properties) !== null && _catalogData$catalogM !== void 0 ? _catalogData$catalogM : [], undefined, option.optionKey, set.CatalogData.api.getLanguage());
20892
- var properties = [].concat(_toConsumableArray(convertProperties(option.properties, set.CatalogData.api.getLanguageLowercase())), _toConsumableArray(maskProperties !== null && maskProperties !== void 0 ? maskProperties : []));
20966
+ var maskProperties = getPropertiesForOptionKey((_catalogData$catalogM6 = (_catalogData$catalogM7 = catalogData.catalogMask) === null || _catalogData$catalogM7 === void 0 ? void 0 : _catalogData$catalogM7.properties) !== null && _catalogData$catalogM6 !== void 0 ? _catalogData$catalogM6 : [], undefined, option.optionKey, catalogData.api.getLanguage());
20967
+ var properties = [].concat(_toConsumableArray(convertProperties(option.properties, catalogData.api.getLanguageLowercase())), _toConsumableArray(maskProperties !== null && maskProperties !== void 0 ? maskProperties : []));
20893
20968
  var opiton = {
20894
20969
  codex: option.optionKey,
20895
20970
  name: name,
@@ -20959,12 +21034,12 @@ function getCatalogOptionType(option, set) {
20959
21034
  }
20960
21035
  return new OptionValueCatalogData(opiton, catalogData);
20961
21036
  }
20962
- function getArticleOption(set, option, catalogOption, feature, catalogArticleData) {
20963
- var _catalogArticleData$o, _set$CatalogData$cata6, _set$CatalogData$cata7;
21037
+ function getArticleOption(set, option, catalogOption, feature, catalogArticleData, catalogData) {
21038
+ var _catalogArticleData$o, _catalogData$catalogM8, _catalogData$catalogM9;
20964
21039
  var props = (_catalogArticleData$o = catalogArticleData.optionProperties) === null || _catalogArticleData$o === void 0 ? void 0 : _catalogArticleData$o.filter(function (p) {
20965
21040
  return p.OptionKeys.includes(option.optionKey);
20966
21041
  });
20967
- var maskProperties = getPropertiesForOptionKey((_set$CatalogData$cata6 = (_set$CatalogData$cata7 = set.CatalogData.catalogMask) === null || _set$CatalogData$cata7 === void 0 ? void 0 : _set$CatalogData$cata7.properties) !== null && _set$CatalogData$cata6 !== void 0 ? _set$CatalogData$cata6 : [], undefined, option.optionKey, set.api.getLanguage());
21042
+ var maskProperties = getPropertiesForOptionKey((_catalogData$catalogM8 = (_catalogData$catalogM9 = catalogData.catalogMask) === null || _catalogData$catalogM9 === void 0 ? void 0 : _catalogData$catalogM9.properties) !== null && _catalogData$catalogM8 !== void 0 ? _catalogData$catalogM8 : [], undefined, option.optionKey, set.api.getLanguage());
20968
21043
  //TODO add these props that are articleSpecific
20969
21044
  var opv = {
20970
21045
  codex: option.optionKey,
@@ -21578,7 +21653,7 @@ var DivaCatalogData = /*#__PURE__*/function () {
21578
21653
  break;
21579
21654
  }
21580
21655
  _context.next = 3;
21581
- return loadMoreFromIDMArticles(catalogArticles, set);
21656
+ return loadMoreFromIDMArticles(catalogArticles, set, this);
21582
21657
  case 3:
21583
21658
  _context.next = 9;
21584
21659
  break;
@@ -23096,7 +23171,12 @@ var DivaCatalogData = /*#__PURE__*/function () {
23096
23171
  }, {
23097
23172
  key: "checkIfArticleCodexExists",
23098
23173
  value: function checkIfArticleCodexExists(articleCodex) {
23099
- return !!this.catalogArticles[articleCodex];
23174
+ if (this.catalogArticles[articleCodex]) return true;
23175
+ // same resolution as getCatalogArticleByArticleCodex, but without logging WC_0006
23176
+ if (this.isIDMFormat) return Object.values(this.catalogArticles).some(function (a) {
23177
+ return a.configArticleCodex === articleCodex;
23178
+ });
23179
+ return false;
23100
23180
  }
23101
23181
  }, {
23102
23182
  key: "getCatalogArticleByArticleCodex",
@@ -23409,35 +23489,67 @@ var DivaCatalogHandler = /*#__PURE__*/function () {
23409
23489
  key: "loadIDMCatalog",
23410
23490
  value: function () {
23411
23491
  var _loadIDMCatalog = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(state, serieNo, serieId, accountId, orderSet) {
23412
- var promises, _yield$Promise$all3, _yield$Promise$all4, catalogApiData, serieData, itemsList, catalogData;
23492
+ var staleSafe, promises, _yield$Promise$all3, _yield$Promise$all4, catalogApiData, serieData, itemsList, resolvedSerieId, _yield$Promise$all5, _yield$Promise$all6, catalogData;
23413
23493
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
23414
23494
  while (1) switch (_context4.prev = _context4.next) {
23415
23495
  case 0:
23416
- promises = [state.api.getDataCache(state.api.getIDMCatalog(accountId), undefined, undefined, 'enricher'), state.api.getDataCache(state.api.getIDMSerieByNo(accountId, serieId, serieNo), undefined, undefined, 'enricher'), state.api.getDataCache(state.api.getIDMItems(accountId, serieId, serieNo), undefined, undefined, 'enricher')
23496
+ // A stale serieId 404s these fetches (fetchData THROWS) — swallow ONLY that, so the re-resolve below gets its
23497
+ // chance; every other failure (500, timeout, auth) stays an error instead of passing as 'serie not found', and
23498
+ // still surfaces the enricher error modal that `dontLogError` skipped for the 404's sake.
23499
+ staleSafe = function staleSafe(queryString) {
23500
+ return state.api.useIDMService ? state.api.getDataCache(queryString, undefined, undefined, 'enricher', undefined, undefined, true)["catch"](function (error) {
23501
+ if ((error === null || error === void 0 ? void 0 : error.status) === 404) return undefined;
23502
+ state.api.notifyEnricherErrorForQuery(queryString, 'enricher');
23503
+ throw error;
23504
+ }) : state.api.getDataCache(queryString, undefined, undefined, 'enricher');
23505
+ };
23506
+ promises = [state.api.getDataCache(state.api.getIDMCatalog(accountId), undefined, undefined, 'enricher'), staleSafe(state.api.getIDMSerieByNo(accountId, serieId, serieNo)), staleSafe(state.api.getIDMItems(accountId, serieId, serieNo))
23417
23507
  //!state.api.dontLoadAdditionalModelInfos ? this.getAdditionalModeInfos(state, serieId, accountId) : undefined,
23418
23508
  ];
23419
- _context4.next = 3;
23509
+ _context4.next = 4;
23420
23510
  return Promise.all(promises);
23421
- case 3:
23511
+ case 4:
23422
23512
  _yield$Promise$all3 = _context4.sent;
23423
23513
  _yield$Promise$all4 = _slicedToArray(_yield$Promise$all3, 3);
23424
23514
  catalogApiData = _yield$Promise$all4[0];
23425
23515
  serieData = _yield$Promise$all4[1];
23426
23516
  itemsList /*additionalModelInfos*/ = _yield$Promise$all4[2];
23517
+ if (!(state.api.useIDMService && (!serieData || !itemsList || "".concat(serieData.serieNo) !== "".concat(serieNo)))) {
23518
+ _context4.next = 21;
23519
+ break;
23520
+ }
23521
+ _context4.next = 12;
23522
+ return this.resolveIDMSerieIdByNo(state, accountId, serieNo);
23523
+ case 12:
23524
+ resolvedSerieId = _context4.sent;
23525
+ if (resolvedSerieId) {
23526
+ _context4.next = 15;
23527
+ break;
23528
+ }
23529
+ throw new Error('Serie not found: ' + serieNo);
23530
+ case 15:
23531
+ _context4.next = 17;
23532
+ return Promise.all([state.api.getDataCache(state.api.getIDMSerieByNo(accountId, resolvedSerieId, serieNo), undefined, undefined, 'enricher'), state.api.getDataCache(state.api.getIDMItems(accountId, resolvedSerieId, serieNo), undefined, undefined, 'enricher')]);
23533
+ case 17:
23534
+ _yield$Promise$all5 = _context4.sent;
23535
+ _yield$Promise$all6 = _slicedToArray(_yield$Promise$all5, 2);
23536
+ serieData = _yield$Promise$all6[0];
23537
+ itemsList = _yield$Promise$all6[1];
23538
+ case 21:
23427
23539
  if (serieData) {
23428
- _context4.next = 10;
23540
+ _context4.next = 23;
23429
23541
  break;
23430
23542
  }
23431
23543
  throw new Error('Serie not found: ' + serieNo);
23432
- case 10:
23544
+ case 23:
23433
23545
  catalogData = new DivaCatalogData(_objectSpread$m(_objectSpread$m({}, serieData), {}, {
23434
23546
  catalogData: catalogApiData
23435
23547
  }), serieNo, orderSet, state.api, itemsList, undefined, true, undefined /*additionalModelInfos*/);
23436
- _context4.next = 13;
23548
+ _context4.next = 26;
23437
23549
  return this.loadCatalogXml(state, catalogData);
23438
- case 13:
23550
+ case 26:
23439
23551
  return _context4.abrupt("return", catalogData);
23440
- case 14:
23552
+ case 27:
23441
23553
  case "end":
23442
23554
  return _context4.stop();
23443
23555
  }
@@ -23447,48 +23559,77 @@ var DivaCatalogHandler = /*#__PURE__*/function () {
23447
23559
  return _loadIDMCatalog.apply(this, arguments);
23448
23560
  }
23449
23561
  return loadIDMCatalog;
23450
- }()
23562
+ }() /** Resolves a serieNo to the serie's `_id` via the catalog's series list; undefined when no serie carries that number. */
23563
+ }, {
23564
+ key: "resolveIDMSerieIdByNo",
23565
+ value: (function () {
23566
+ var _resolveIDMSerieIdByNo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(state, accountId, serieNo) {
23567
+ var _response$data, _series$find;
23568
+ var response, payload, series;
23569
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
23570
+ while (1) switch (_context5.prev = _context5.next) {
23571
+ case 0:
23572
+ _context5.next = 2;
23573
+ return state.api.getDataCache(state.api.getIDMSeriesList(accountId), undefined, undefined, 'enricher');
23574
+ case 2:
23575
+ response = _context5.sent;
23576
+ payload = (_response$data = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data !== void 0 ? _response$data : response;
23577
+ series = Array.isArray(payload) ? payload : [];
23578
+ return _context5.abrupt("return", (_series$find = series.find(function (serie) {
23579
+ return "".concat(serie.serieNo) === "".concat(serieNo);
23580
+ })) === null || _series$find === void 0 ? void 0 : _series$find._id);
23581
+ case 6:
23582
+ case "end":
23583
+ return _context5.stop();
23584
+ }
23585
+ }, _callee5);
23586
+ }));
23587
+ function resolveIDMSerieIdByNo(_x15, _x16, _x17) {
23588
+ return _resolveIDMSerieIdByNo.apply(this, arguments);
23589
+ }
23590
+ return resolveIDMSerieIdByNo;
23591
+ }())
23451
23592
  }, {
23452
23593
  key: "loadCatalogXml",
23453
23594
  value: function () {
23454
- var _loadCatalogXml = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(state, catalogData) {
23595
+ var _loadCatalogXml = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(state, catalogData) {
23455
23596
  var constructorServiceUrl, iln, xml;
23456
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
23457
- while (1) switch (_context5.prev = _context5.next) {
23597
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
23598
+ while (1) switch (_context6.prev = _context6.next) {
23458
23599
  case 0:
23459
23600
  // Loaded even when the HQS is assembled remotely: the catalog XML's GEO names are needed for the
23460
23601
  // accessory variant-family mesh swap (FreePlacesOnGrids.geo3DName), not just for local assembly.
23461
23602
  constructorServiceUrl = state.api.getConstructorServiceUrl();
23462
23603
  iln = catalogData.supplierILN;
23463
23604
  if (!(!constructorServiceUrl || !iln)) {
23464
- _context5.next = 4;
23605
+ _context6.next = 4;
23465
23606
  break;
23466
23607
  }
23467
- return _context5.abrupt("return");
23608
+ return _context6.abrupt("return");
23468
23609
  case 4:
23469
23610
  bootMark('catalog-xml start');
23470
- _context5.prev = 5;
23471
- _context5.next = 8;
23611
+ _context6.prev = 5;
23612
+ _context6.next = 8;
23472
23613
  return state.api.getCatalogXml(iln, catalogData.catalogCodex);
23473
23614
  case 8:
23474
- xml = _context5.sent;
23615
+ xml = _context6.sent;
23475
23616
  if (xml) catalogData.catalogXml = xml;
23476
23617
  bootMark('catalog-xml done', {
23477
23618
  chars: xml ? xml.length : 0
23478
23619
  });
23479
- _context5.next = 16;
23620
+ _context6.next = 16;
23480
23621
  break;
23481
23622
  case 13:
23482
- _context5.prev = 13;
23483
- _context5.t0 = _context5["catch"](5);
23484
- LOG$i.debug('Failed to pre-load catalogXml: ' + _context5.t0);
23623
+ _context6.prev = 13;
23624
+ _context6.t0 = _context6["catch"](5);
23625
+ LOG$i.debug('Failed to pre-load catalogXml: ' + _context6.t0);
23485
23626
  case 16:
23486
23627
  case "end":
23487
- return _context5.stop();
23628
+ return _context6.stop();
23488
23629
  }
23489
- }, _callee5, null, [[5, 13]]);
23630
+ }, _callee6, null, [[5, 13]]);
23490
23631
  }));
23491
- function loadCatalogXml(_x15, _x16) {
23632
+ function loadCatalogXml(_x18, _x19) {
23492
23633
  return _loadCatalogXml.apply(this, arguments);
23493
23634
  }
23494
23635
  return loadCatalogXml;
@@ -23496,27 +23637,27 @@ var DivaCatalogHandler = /*#__PURE__*/function () {
23496
23637
  }, {
23497
23638
  key: "getAdditionalModeInfos",
23498
23639
  value: function () {
23499
- var _getAdditionalModeInfos = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(state, serieId, accountId) {
23500
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
23501
- while (1) switch (_context6.prev = _context6.next) {
23640
+ var _getAdditionalModeInfos = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(state, serieId, accountId) {
23641
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
23642
+ while (1) switch (_context7.prev = _context7.next) {
23502
23643
  case 0:
23503
- _context6.prev = 0;
23504
- _context6.next = 3;
23644
+ _context7.prev = 0;
23645
+ _context7.next = 3;
23505
23646
  return state.api.getDataCache(state.api.getAdditionalModelInfosQS(accountId, serieId, state.api.OrganizationId), undefined, undefined, 'catalog');
23506
23647
  case 3:
23507
- return _context6.abrupt("return", _context6.sent);
23648
+ return _context7.abrupt("return", _context7.sent);
23508
23649
  case 6:
23509
- _context6.prev = 6;
23510
- _context6.t0 = _context6["catch"](0);
23650
+ _context7.prev = 6;
23651
+ _context7.t0 = _context7["catch"](0);
23511
23652
  LOG$i.debug('additional ModelInfo not found');
23512
- return _context6.abrupt("return", undefined);
23653
+ return _context7.abrupt("return", undefined);
23513
23654
  case 10:
23514
23655
  case "end":
23515
- return _context6.stop();
23656
+ return _context7.stop();
23516
23657
  }
23517
- }, _callee6, null, [[0, 6]]);
23658
+ }, _callee7, null, [[0, 6]]);
23518
23659
  }));
23519
- function getAdditionalModeInfos(_x17, _x18, _x19) {
23660
+ function getAdditionalModeInfos(_x20, _x21, _x22) {
23520
23661
  return _getAdditionalModeInfos.apply(this, arguments);
23521
23662
  }
23522
23663
  return getAdditionalModeInfos;
@@ -23875,11 +24016,21 @@ var ArticleOptionStateData = /*#__PURE__*/function () {
23875
24016
  key: "isInvisible",
23876
24017
  get: function get() {
23877
24018
  return this.articleOptionState.invisible;
23878
- },
24019
+ }
24020
+ /**
24021
+ * Restore the load-time visibility defaults (catalog + mask). IDM visibility is re-derived on
24022
+ * every decision evaluation — a SET_FEATURE_INVISIBLE only holds while its condition matches.
24023
+ */,
23879
24024
  set: function set(isInvisible) {
23880
24025
  this.articleOptionState.invisible = isInvisible;
23881
24026
  this.articleOptionState.invisibleWithoutMaskeInfluence = isInvisible;
23882
24027
  }
24028
+ }, {
24029
+ key: "resetVisibilityToOptionDefaults",
24030
+ value: function resetVisibilityToOptionDefaults() {
24031
+ this.articleOptionState.invisible = this.option.isInvisible;
24032
+ this.articleOptionState.invisibleWithoutMaskeInfluence = this.option.isInvisibleWithoutMaskeInfluence;
24033
+ }
23883
24034
  }, {
23884
24035
  key: "invisibleWithoutMaskeInfluence",
23885
24036
  get: function get() {
@@ -26428,7 +26579,9 @@ var IDMEngine = /*#__PURE__*/function () {
26428
26579
  var beforeHash = undefined;
26429
26580
  var afterHash = undefined;
26430
26581
  var count = 0;
26431
- var startTime = Date.now();
26582
+ // Same gate as the per-decision line below: the string is built before LOG.debug is called.
26583
+ var timeEval = this.article.set.logDecisions;
26584
+ var startTime = timeEval ? Date.now() : 0;
26432
26585
  this.article.decisionDebugStacks = [];
26433
26586
  if (this.article.set.logDecisions) this.article.dataCreationErrors = [];
26434
26587
  do {
@@ -26438,8 +26591,7 @@ var IDMEngine = /*#__PURE__*/function () {
26438
26591
  afterHash = JSON.stringify(this.article.snapshot);
26439
26592
  count++;
26440
26593
  } while (afterHash !== beforeHash && count < 50 && !onlyUpdateOnce);
26441
- var endTime = Date.now();
26442
- LOG$g.debug('eval Decisions total time in ' + (endTime - startTime) + ' of ' + count);
26594
+ if (timeEval) LOG$g.debug('eval Decisions total time in ' + (Date.now() - startTime) + ' of ' + count);
26443
26595
  }
26444
26596
  }, {
26445
26597
  key: "decisions",
@@ -26543,6 +26695,7 @@ var IDMEngine = /*#__PURE__*/function () {
26543
26695
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
26544
26696
  var ops = _step4.value;
26545
26697
  ops.updateVisibleOptionValues(ops.option.articleOptionValues);
26698
+ ops.resetVisibilityToOptionDefaults();
26546
26699
  if (!ops.val) this.updateArtOPV(this.article.getDefaultOpv(ops.visibleOptionValues), ops.optionCodex, ops, undefined);
26547
26700
  ops.definedBySetFeatureFixed = false;
26548
26701
  }
@@ -26565,6 +26718,7 @@ var IDMEngine = /*#__PURE__*/function () {
26565
26718
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
26566
26719
  var _ops = _step5.value;
26567
26720
  _ops.updateVisibleOptionValues(_ops.option.articleOptionValues);
26721
+ _ops.resetVisibilityToOptionDefaults();
26568
26722
  if (!_ops.val) this.updateArtOPV(this.article.getDefaultOpv(_ops.visibleOptionValues), _ops.optionCodex, _ops, undefined);
26569
26723
  _ops.definedBySetFeatureFixed = false;
26570
26724
  }
@@ -26576,8 +26730,10 @@ var IDMEngine = /*#__PURE__*/function () {
26576
26730
  this.decisionDebugStack = [];
26577
26731
  var beforeSnapshot = this.article.set.logDecisions ? this.article.snapshot : undefined;
26578
26732
  var beforeDecisionState = this.article.set.logDecisions ? this.decisionStateSnapshot(decisions) : undefined;
26733
+ // Gated on the same flag as the snapshots above — the Date.now() calls and string concatenation must not run with logging off.
26734
+ var timeDecisions = this.article.set.logDecisions;
26579
26735
  for (var m = 0; m < decisions.length; m++) {
26580
- var startTime = Date.now();
26736
+ var startTime = timeDecisions ? Date.now() : 0;
26581
26737
  //Alle Optionen Mit DOC Type 1 ermitten - diese zunächst alle ausblenden, werden dann später über Formeln wieder eingeschaltets
26582
26738
  var decision = decisions[m];
26583
26739
  if (decision.enabled && decision.optionCombinations.length) {
@@ -26601,8 +26757,7 @@ var IDMEngine = /*#__PURE__*/function () {
26601
26757
  var pushed = this.pushDecisionDebug(decision, decisions, beforeSnapshot, beforeDecisionState);
26602
26758
  beforeSnapshot = pushed === null || pushed === void 0 ? void 0 : pushed.afterSnapshot;
26603
26759
  beforeDecisionState = pushed === null || pushed === void 0 ? void 0 : pushed.afterDecisionState;
26604
- var endTime = Date.now();
26605
- LOG$g.debug('decision ' + decision.decisionNo + ' time ' + (endTime - startTime));
26760
+ if (timeDecisions) LOG$g.debug('decision ' + decision.decisionNo + ' time ' + (Date.now() - startTime));
26606
26761
  }
26607
26762
  this.article.decisionDebugStacks.push({
26608
26763
  stack: this.decisionDebugStack,
@@ -26773,6 +26928,145 @@ var IDMEngine = /*#__PURE__*/function () {
26773
26928
  }
26774
26929
  return (_this$article$getArti = this.article.getArticleOptionStateFlat(targetFeatureNo)) === null || _this$article$getArti === void 0 ? void 0 : _this$article$getArti.visibleOptionValues;
26775
26930
  }
26931
+
26932
+ /**
26933
+ * Statically derives the visible option values of `targetFeatureNo` under the hypothetical selection
26934
+ * `groupFeatureNo = groupValueCodex` from the type-1 decision ROWS (no clone, no mutation) — exact only for
26935
+ * the two-group-families standard shape; any other shape returns undefined and the caller falls back.
26936
+ */
26937
+ }, {
26938
+ key: "staticVisibleOptionValuesForFeature",
26939
+ value: function staticVisibleOptionValuesForFeature(targetFeatureNo, groupFeatureNo, groupValueCodex) {
26940
+ var targetOps = this.article.getArticleOptionStateFlat(targetFeatureNo);
26941
+ if (!targetOps || !this.article.getArticleOptionStateFlat(groupFeatureNo)) return undefined;
26942
+ var decisions = this.decisions;
26943
+ // type 0/1 decisions restrict every feature in their featureRefs — only the pure group→target shape is derivable
26944
+ var influencing = decisions.filter(function (decision) {
26945
+ var _decision$featureRefs3;
26946
+ return decision.decisionType != 2 && ((_decision$featureRefs3 = decision.featureRefs) === null || _decision$featureRefs3 === void 0 ? void 0 : _decision$featureRefs3.includes(targetFeatureNo));
26947
+ });
26948
+ var _iterator11 = _createForOfIteratorHelper$e(influencing),
26949
+ _step11;
26950
+ try {
26951
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
26952
+ var decision = _step11.value;
26953
+ if (decision.decisionType != 1) return undefined;
26954
+ if (decision.featureRefs.some(function (featureNo) {
26955
+ return featureNo != targetFeatureNo && featureNo != groupFeatureNo;
26956
+ })) return undefined;
26957
+ if (this.sortFeatures(_toConsumableArray(decision.featureRefs))[0] != groupFeatureNo) return undefined;
26958
+ }
26959
+ // A type-2 is judged by its ACTIONS: it interferes only when one SETS/FIXES/HIDES the target or toggles an influencing decision.
26960
+ } catch (err) {
26961
+ _iterator11.e(err);
26962
+ } finally {
26963
+ _iterator11.f();
26964
+ }
26965
+ var influencingNos = influencing.map(function (decision) {
26966
+ return decision.decisionNo;
26967
+ });
26968
+ var targetNo = Number(targetFeatureNo);
26969
+ var groupNo = Number(groupFeatureNo);
26970
+ var type2Interferes = decisions.some(function (decision) {
26971
+ var _decision$optionCombi3;
26972
+ return decision.decisionType == 2 && ((_decision$optionCombi3 = decision.optionCombinations) === null || _decision$optionCombi3 === void 0 ? void 0 : _decision$optionCombi3.some(function (combination) {
26973
+ var _actions$disableDecis, _actions$enableDecisi, _actions$setFeature, _actions$setFeatureDe, _actions$setFeatureDe2, _actions$setFeatureFi, _actions$setFeatureIn, _actions$setFeatureVi;
26974
+ var actions = combination.projectActions;
26975
+ var togglesInfluencing = [].concat(_toConsumableArray((_actions$disableDecis = actions === null || actions === void 0 ? void 0 : actions.disableDecision) !== null && _actions$disableDecis !== void 0 ? _actions$disableDecis : []), _toConsumableArray((_actions$enableDecisi = actions === null || actions === void 0 ? void 0 : actions.enableDecision) !== null && _actions$enableDecisi !== void 0 ? _actions$enableDecisi : [])).some(function (ref) {
26976
+ return influencingNos.includes(Number(ref.decisionNo));
26977
+ });
26978
+ // An action on the GROUP feature overrides the hypothesized value — bail to the full-reconfiguration fallback.
26979
+ var touchesTargetOrGroup = [].concat(_toConsumableArray((_actions$setFeature = actions === null || actions === void 0 ? void 0 : actions.setFeature) !== null && _actions$setFeature !== void 0 ? _actions$setFeature : []), _toConsumableArray((_actions$setFeatureDe = actions === null || actions === void 0 ? void 0 : actions.setFeatureDefault) !== null && _actions$setFeatureDe !== void 0 ? _actions$setFeatureDe : []), _toConsumableArray((_actions$setFeatureDe2 = actions === null || actions === void 0 ? void 0 : actions.setFeatureDefaultNull) !== null && _actions$setFeatureDe2 !== void 0 ? _actions$setFeatureDe2 : []), _toConsumableArray((_actions$setFeatureFi = actions === null || actions === void 0 ? void 0 : actions.setFeatureFixed) !== null && _actions$setFeatureFi !== void 0 ? _actions$setFeatureFi : []), _toConsumableArray((_actions$setFeatureIn = actions === null || actions === void 0 ? void 0 : actions.setFeatureInvisible) !== null && _actions$setFeatureIn !== void 0 ? _actions$setFeatureIn : []), _toConsumableArray((_actions$setFeatureVi = actions === null || actions === void 0 ? void 0 : actions.setFeatureVisible) !== null && _actions$setFeatureVi !== void 0 ? _actions$setFeatureVi : [])).some(function (action) {
26980
+ return Number(action.featureNo) == targetNo || Number(action.featureNo) == groupNo;
26981
+ });
26982
+ return togglesInfluencing || touchesTargetOrGroup;
26983
+ }));
26984
+ });
26985
+ if (type2Interferes) return undefined;
26986
+
26987
+ // Pool per decision = UNION of matching rows' target options; successive decisions INTERSECT (mirrors evalType1Decision).
26988
+ var pool = undefined;
26989
+ var _iterator12 = _createForOfIteratorHelper$e(influencing),
26990
+ _step12;
26991
+ try {
26992
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
26993
+ var _decision3$optionComb;
26994
+ var _decision3 = _step12.value;
26995
+ var decisionPool = new Set();
26996
+ var anyRowMatched = false;
26997
+ var _iterator14 = _createForOfIteratorHelper$e((_decision3$optionComb = _decision3.optionCombinations) !== null && _decision3$optionComb !== void 0 ? _decision3$optionComb : []),
26998
+ _step14;
26999
+ try {
27000
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
27001
+ var _combination$projectO, _combination$projectO2, _groupRef$options, _targetRef$options;
27002
+ var combination = _step14.value;
27003
+ var groupRef = this.getOptionListOfRef((_combination$projectO = combination.projectOptionsSetRefs) === null || _combination$projectO === void 0 ? void 0 : _combination$projectO.find(function (ref) {
27004
+ return ref.featureNo == Number(groupFeatureNo);
27005
+ }));
27006
+ var targetRef = this.getOptionListOfRef((_combination$projectO2 = combination.projectOptionsSetRefs) === null || _combination$projectO2 === void 0 ? void 0 : _combination$projectO2.find(function (ref) {
27007
+ return ref.featureNo == Number(targetFeatureNo);
27008
+ }));
27009
+ if (!groupRef || !targetRef) return undefined;
27010
+ if (![0, 2].includes(groupRef.operator) || ![0, 2].includes(targetRef.operator)) return undefined;
27011
+ if (!((_groupRef$options = groupRef.options) !== null && _groupRef$options !== void 0 && _groupRef$options.includes(groupValueCodex))) continue;
27012
+ // evalType1Decision treats a matching row with NO target options as "unrestricted", not as "nothing allowed" -
27013
+ // the static pool cannot express that, so leave this feature to the reconfiguration fallback.
27014
+ if (!((_targetRef$options = targetRef.options) !== null && _targetRef$options !== void 0 && _targetRef$options.length)) return undefined;
27015
+ anyRowMatched = true;
27016
+ var _iterator15 = _createForOfIteratorHelper$e(targetRef.options),
27017
+ _step15;
27018
+ try {
27019
+ for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
27020
+ var option = _step15.value;
27021
+ decisionPool.add(option);
27022
+ }
27023
+ } catch (err) {
27024
+ _iterator15.e(err);
27025
+ } finally {
27026
+ _iterator15.f();
27027
+ }
27028
+ }
27029
+ } catch (err) {
27030
+ _iterator14.e(err);
27031
+ } finally {
27032
+ _iterator14.f();
27033
+ }
27034
+ if (!anyRowMatched) continue;
27035
+ pool = pool == undefined ? decisionPool : new Set(_toConsumableArray(decisionPool).filter(function (key) {
27036
+ var _pool;
27037
+ return (_pool = pool) === null || _pool === void 0 ? void 0 : _pool.has(key);
27038
+ }));
27039
+ }
27040
+ } catch (err) {
27041
+ _iterator12.e(err);
27042
+ } finally {
27043
+ _iterator12.f();
27044
+ }
27045
+ var allValues = targetOps.option.articleOptionValues;
27046
+ if (pool == undefined) return new Map(allValues);
27047
+ // A grouped target keys `articleOptionValues` by its OPG codices and nests the values inside them, while the
27048
+ // decision rows name the nested values — filtering by key would silently yield an empty pool, and the caller
27049
+ // reads an empty map as "nothing selectable" instead of falling back. Leave that shape to the reconfiguration.
27050
+ if (targetOps.option.hasOPG && _toConsumableArray(pool).some(function (key) {
27051
+ return !allValues.has(key);
27052
+ })) return undefined;
27053
+ var result = new Map();
27054
+ var _iterator13 = _createForOfIteratorHelper$e(allValues),
27055
+ _step13;
27056
+ try {
27057
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
27058
+ var _step13$value = _slicedToArray(_step13.value, 2),
27059
+ key = _step13$value[0],
27060
+ value = _step13$value[1];
27061
+ if (pool.has(key)) result.set(key, value);
27062
+ }
27063
+ } catch (err) {
27064
+ _iterator13.e(err);
27065
+ } finally {
27066
+ _iterator13.f();
27067
+ }
27068
+ return result;
27069
+ }
26776
27070
  }, {
26777
27071
  key: "presetFeatureValues",
26778
27072
  value: function presetFeatureValues(presetValues) {
@@ -26805,11 +27099,11 @@ var IDMEngine = /*#__PURE__*/function () {
26805
27099
  }, {
26806
27100
  key: "evalType1Decision",
26807
27101
  value: function evalType1Decision(decision) {
26808
- var _decision$featureRefs3,
27102
+ var _decision$featureRefs4,
26809
27103
  _this4 = this;
26810
27104
  var validOptions = {};
26811
27105
  var doAlsoCheckFeatureNos = [];
26812
- if (!decision.optionCombinations.length || !((_decision$featureRefs3 = decision.featureRefs) !== null && _decision$featureRefs3 !== void 0 && _decision$featureRefs3.length)) return;
27106
+ if (!decision.optionCombinations.length || !((_decision$featureRefs4 = decision.featureRefs) !== null && _decision$featureRefs4 !== void 0 && _decision$featureRefs4.length)) return;
26813
27107
  var sortedDeatureRefs = this.sortFeatures(decision.featureRefs);
26814
27108
  var _loop2 = function _loop2() {
26815
27109
  var featureNo = sortedDeatureRefs[p];
@@ -26921,13 +27215,13 @@ var IDMEngine = /*#__PURE__*/function () {
26921
27215
  }, {
26922
27216
  key: "evalType0Decision",
26923
27217
  value: function evalType0Decision(decision) {
26924
- var _decision$optionCombi3,
26925
- _decision$featureRefs4,
27218
+ var _decision$optionCombi4,
26926
27219
  _decision$featureRefs5,
27220
+ _decision$featureRefs6,
26927
27221
  _this5 = this;
26928
27222
  var invalidOptions = {},
26929
27223
  doAlsoCheckFeature = [];
26930
- if (!((_decision$optionCombi3 = decision.optionCombinations) !== null && _decision$optionCombi3 !== void 0 && _decision$optionCombi3.length) || ((_decision$featureRefs4 = (_decision$featureRefs5 = decision.featureRefs) === null || _decision$featureRefs5 === void 0 ? void 0 : _decision$featureRefs5.length) !== null && _decision$featureRefs4 !== void 0 ? _decision$featureRefs4 : 0) <= 1) return;
27224
+ if (!((_decision$optionCombi4 = decision.optionCombinations) !== null && _decision$optionCombi4 !== void 0 && _decision$optionCombi4.length) || ((_decision$featureRefs5 = (_decision$featureRefs6 = decision.featureRefs) === null || _decision$featureRefs6 === void 0 ? void 0 : _decision$featureRefs6.length) !== null && _decision$featureRefs5 !== void 0 ? _decision$featureRefs5 : 0) <= 1) return;
26931
27225
  var sortedDeatureRefs = this.sortFeatures(decision.featureRefs);
26932
27226
  var _loop4 = function _loop4() {
26933
27227
  var featureNo = sortedDeatureRefs[p];
@@ -27044,9 +27338,9 @@ var IDMEngine = /*#__PURE__*/function () {
27044
27338
  }, {
27045
27339
  key: "evalType2Decision",
27046
27340
  value: function evalType2Decision(decision, allDecisions) {
27047
- var _decision$optionCombi4;
27341
+ var _decision$optionCombi5;
27048
27342
  var hasSetFeatureInvisible = {};
27049
- if (!((_decision$optionCombi4 = decision.optionCombinations) !== null && _decision$optionCombi4 !== void 0 && _decision$optionCombi4.length)) return;
27343
+ if (!((_decision$optionCombi5 = decision.optionCombinations) !== null && _decision$optionCombi5 !== void 0 && _decision$optionCombi5.length)) return;
27050
27344
  var _ref5 = this.getMatchingOptionCombination(decision.optionCombinations, decision.decisionNo),
27051
27345
  _ref6 = _slicedToArray(_ref5, 1),
27052
27346
  combination = _ref6[0];
@@ -27066,12 +27360,12 @@ var IDMEngine = /*#__PURE__*/function () {
27066
27360
  key: "evalDisableDecision",
27067
27361
  value: function evalDisableDecision(actions, decision, allDecisions, disable) {
27068
27362
  var verb = disable ? 'disabled' : 'enabled';
27069
- var _iterator11 = _createForOfIteratorHelper$e(actions),
27070
- _step11;
27363
+ var _iterator16 = _createForOfIteratorHelper$e(actions),
27364
+ _step16;
27071
27365
  try {
27072
27366
  var _loop6 = function _loop6() {
27073
27367
  var _dec$disableHistory;
27074
- var action = _step11.value;
27368
+ var action = _step16.value;
27075
27369
  var dec = allDecisions.find(function (d) {
27076
27370
  return d.decisionNo == Number(action.decisionNo);
27077
27371
  });
@@ -27082,42 +27376,42 @@ var IDMEngine = /*#__PURE__*/function () {
27082
27376
  dec.enabled = !disable;
27083
27377
  (_dec$disableHistory = dec.disableHistory) === null || _dec$disableHistory === void 0 || _dec$disableHistory.push(verb + ' By ' + decision.decisionNo);
27084
27378
  };
27085
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
27379
+ for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
27086
27380
  if (_loop6()) continue;
27087
27381
  }
27088
27382
  } catch (err) {
27089
- _iterator11.e(err);
27383
+ _iterator16.e(err);
27090
27384
  } finally {
27091
- _iterator11.f();
27385
+ _iterator16.f();
27092
27386
  }
27093
27387
  }
27094
27388
  }, {
27095
27389
  key: "evalSetFeatureVisible",
27096
27390
  value: function evalSetFeatureVisible(actions, hasSetFeatureInvisible, invisible) {
27097
- var _iterator12 = _createForOfIteratorHelper$e(actions),
27098
- _step12;
27391
+ var _iterator17 = _createForOfIteratorHelper$e(actions),
27392
+ _step17;
27099
27393
  try {
27100
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
27101
- var action = _step12.value;
27394
+ for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
27395
+ var action = _step17.value;
27102
27396
  if (!this.article.getArticleOptionState(action.featureNo.toString()) || !action.featureNo) continue;
27103
27397
  var ops = this.article.getArticleOptionState(action.featureNo.toString());
27104
27398
  if (invisible) hasSetFeatureInvisible[action.featureNo.toString()] = invisible;
27105
27399
  if (ops) ops.isInvisible = invisible;
27106
27400
  }
27107
27401
  } catch (err) {
27108
- _iterator12.e(err);
27402
+ _iterator17.e(err);
27109
27403
  } finally {
27110
- _iterator12.f();
27404
+ _iterator17.f();
27111
27405
  }
27112
27406
  }
27113
27407
  }, {
27114
27408
  key: "evalSetFeatureDefault",
27115
27409
  value: function evalSetFeatureDefault(actions, decision, isNull) {
27116
- var _iterator13 = _createForOfIteratorHelper$e(actions),
27117
- _step13;
27410
+ var _iterator18 = _createForOfIteratorHelper$e(actions),
27411
+ _step18;
27118
27412
  try {
27119
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
27120
- var action = _step13.value;
27413
+ for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
27414
+ var action = _step18.value;
27121
27415
  var ops = this.article.getArticleOptionState(action.featureNo.toString());
27122
27416
  if (ops && (isNull && ops.val === undefined || !isNull && (ops.val === undefined || !ops.valueWasSet))) {
27123
27417
  if (action.formulaRef) {
@@ -27142,20 +27436,20 @@ var IDMEngine = /*#__PURE__*/function () {
27142
27436
  break;
27143
27437
  }
27144
27438
  } catch (err) {
27145
- _iterator13.e(err);
27439
+ _iterator18.e(err);
27146
27440
  } finally {
27147
- _iterator13.f();
27441
+ _iterator18.f();
27148
27442
  }
27149
27443
  }
27150
27444
  }, {
27151
27445
  key: "evalSetFeature",
27152
27446
  value: function evalSetFeature(actions, decision, isFixed) {
27153
- var _iterator14 = _createForOfIteratorHelper$e(actions),
27154
- _step14;
27447
+ var _iterator19 = _createForOfIteratorHelper$e(actions),
27448
+ _step19;
27155
27449
  try {
27156
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
27450
+ for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
27157
27451
  var _action$featureNo2;
27158
- var action = _step14.value;
27452
+ var action = _step19.value;
27159
27453
  if (!this.article.getArticleOptionState((_action$featureNo2 = action.featureNo) === null || _action$featureNo2 === void 0 ? void 0 : _action$featureNo2.toString()) || !action.featureNo) {
27160
27454
  //usecase is that it want to be set on partlistarticle that is not currently loaded so its not found
27161
27455
  LOG$g.debug('evalSetFeature decision ' + decision.decisionNo + ' (isFixed=' + isFixed + '): target feature ' + action.featureNo + ' has no option state on article ' + this.article.articleCodex + ' - action skipped');
@@ -27200,9 +27494,9 @@ var IDMEngine = /*#__PURE__*/function () {
27200
27494
  }
27201
27495
  }
27202
27496
  } catch (err) {
27203
- _iterator14.e(err);
27497
+ _iterator19.e(err);
27204
27498
  } finally {
27205
- _iterator14.f();
27499
+ _iterator19.f();
27206
27500
  }
27207
27501
  }
27208
27502
  }, {
@@ -27281,7 +27575,7 @@ var IDMEngine = /*#__PURE__*/function () {
27281
27575
  for (var i = 0; i < priceFeatureGroups.length; i++) {
27282
27576
  var priceFeatureGroup = priceFeatureGroups[i];
27283
27577
  this.checkPriceGroupAllZeros(priceFeatureGroup);
27284
- var _this$getMatchingOpti = this.getMatchingOptionCombination(priceFeatureGroup.projectFinishes),
27578
+ var _this$getMatchingOpti = this.getMatchingOptionCombination(priceFeatureGroup.projectFinishes, undefined, "price feature group ".concat(priceFeatureGroup.priceFeatureGroupNo, " finishes")),
27285
27579
  _this$getMatchingOpti2 = _slicedToArray(_this$getMatchingOpti, 2);
27286
27580
  _this$getMatchingOpti2[0];
27287
27581
  var index = _this$getMatchingOpti2[1];
@@ -27314,7 +27608,7 @@ var IDMEngine = /*#__PURE__*/function () {
27314
27608
  var _priceFeatureGroup$pr;
27315
27609
  var _priceFeatureGroup = priceFeatureGroups[_i];
27316
27610
  if ((_priceFeatureGroup$pr = _priceFeatureGroup.projectPercentageSurcharges) !== null && _priceFeatureGroup$pr !== void 0 && _priceFeatureGroup$pr.length) {
27317
- var _this$getMatchingOpti3 = this.getMatchingOptionCombination(_priceFeatureGroup.projectPercentageSurcharges),
27611
+ var _this$getMatchingOpti3 = this.getMatchingOptionCombination(_priceFeatureGroup.projectPercentageSurcharges, undefined, "price feature group ".concat(_priceFeatureGroup.priceFeatureGroupNo, " percentage surcharges")),
27318
27612
  _this$getMatchingOpti4 = _slicedToArray(_this$getMatchingOpti3, 2),
27319
27613
  ps = _this$getMatchingOpti4[0],
27320
27614
  indexPs = _this$getMatchingOpti4[1];
@@ -27364,7 +27658,7 @@ var IDMEngine = /*#__PURE__*/function () {
27364
27658
  var _priceFeatureGroup2$p;
27365
27659
  var _priceFeatureGroup2 = priceFeatureGroups[_i2];
27366
27660
  if ((_priceFeatureGroup2$p = _priceFeatureGroup2.projectPercentageSurcharges) !== null && _priceFeatureGroup2$p !== void 0 && _priceFeatureGroup2$p.length) {
27367
- var _this$getMatchingOpti5 = this.getMatchingOptionCombination(_priceFeatureGroup2.projectPercentageSurcharges),
27661
+ var _this$getMatchingOpti5 = this.getMatchingOptionCombination(_priceFeatureGroup2.projectPercentageSurcharges, undefined, "price feature group ".concat(_priceFeatureGroup2.priceFeatureGroupNo, " percentage surcharges")),
27368
27662
  _this$getMatchingOpti6 = _slicedToArray(_this$getMatchingOpti5, 2),
27369
27663
  _ps = _this$getMatchingOpti6[0],
27370
27664
  _indexPs = _this$getMatchingOpti6[1];
@@ -27579,18 +27873,18 @@ var IDMEngine = /*#__PURE__*/function () {
27579
27873
  for (var c = 0; c < decisions.length; c++) {
27580
27874
  var decision = decisions[c];
27581
27875
  lastTriedDecisionNo = decision.decisionNo;
27582
- var relationTypeNone = myPartListPos.decisionPosCount !== decision.decisionNo;
27583
- var isValidDOC = relationTypeNone ? undefined : this.checkDecisionNumber(decision.decisionNo);
27584
- if (!isValidDOC && !relationTypeNone) {
27585
- continue;
27586
- }
27876
+ // Only the position's COUNT decision gates loading; the other attached decisions are pass-down payload.
27877
+ if (myPartListPos.decisionPosCount !== decision.decisionNo) continue;
27878
+ if (!this.checkDecisionNumber(decision.decisionNo)) continue;
27587
27879
  partlistAdded = true;
27588
- partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, partlistGroup, newConfigValues, undefined, !relationTypeNone ? decision.decisionNo : undefined, 'Decision matched');
27880
+ partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, partlistGroup, newConfigValues, undefined, decision.decisionNo, 'Decision matched');
27589
27881
  break;
27590
27882
  }
27591
- if (decisions.length === 0 && !partlistAdded) {
27592
- LOG$g.log('partlistarticle loaded for haveing 0 decisions: ', myPartListPos.itemRefTypeNo);
27593
- partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, partlistGroup, newConfigValues, undefined, undefined, 'No decisions');
27883
+ // Without a COUNT decision nothing gates the position: attached pass-down decisions are payload, so such a
27884
+ // position loads like one with no decisions at all (it did before the pass-down decisions stopped gating).
27885
+ if (!myPartListPos.decisionPosCount && !partlistAdded) {
27886
+ LOG$g.log('partlistarticle loaded for having no count decision: ', myPartListPos.itemRefTypeNo);
27887
+ partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, partlistGroup, newConfigValues, undefined, undefined, decisions.length ? 'No count decision' : 'No decisions');
27594
27888
  } else if (!partlistAdded && myPartListPos.posCountValue > 0) {
27595
27889
  LOG$g.log('partlistarticle loaded for having default PosCountValue ', myPartListPos.itemRefTypeNo);
27596
27890
  partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, partlistGroup, newConfigValues, undefined, undefined, 'Default posCountValue');
@@ -27676,9 +27970,9 @@ var IDMEngine = /*#__PURE__*/function () {
27676
27970
  _loop8(i);
27677
27971
  }
27678
27972
  if (quanitity >= 1) {
27679
- var _catalogCodex$toStrin, _ref7;
27973
+ var _ref7;
27680
27974
  partlistArticlesToLoad.push({
27681
- CatalogCodex: (_catalogCodex$toStrin = catalogCodex.toString()) !== null && _catalogCodex$toStrin !== void 0 ? _catalogCodex$toStrin : this.article.catalogCodex,
27975
+ CatalogCodex: catalogCodex != null ? catalogCodex.toString() : this.article.catalogCodex,
27682
27976
  BasketID: previousPartlistArticle === null || previousPartlistArticle === void 0 ? void 0 : previousPartlistArticle.basketId,
27683
27977
  ArticleCodex: articleCodex,
27684
27978
  Quantity: quanitity,
@@ -27692,6 +27986,9 @@ var IDMEngine = /*#__PURE__*/function () {
27692
27986
  ConfigurationMode: myPartListPos.configurationMode,
27693
27987
  VariantValues: this.article.variantValuesForPla(myPartListPos.configurationMode, previousPartlistArticle === null || previousPartlistArticle === void 0 ? void 0 : previousPartlistArticle.VariantValues, newConfigValues),
27694
27988
  VariantItemData: previousPartlistArticle === null || previousPartlistArticle === void 0 ? void 0 : previousPartlistArticle.VariantItemData,
27989
+ // the replaced instance's own children seed the new instance's previous-map, so selections
27990
+ // deeper than one level survive a parent reload (same contract as the order-restore seed)
27991
+ PreviousPartlistArticles: previousPartlistArticle !== null && previousPartlistArticle !== void 0 && previousPartlistArticle.partlistArticles && Object.keys(previousPartlistArticle.partlistArticles).length ? previousPartlistArticle.partlistArticles : undefined,
27695
27992
  optionsForPrint: featuresForPrint,
27696
27993
  RetailArticleNr: myPartListPos.retailArticleNr && myPartListPos.retailArticleNr !== '' ? myPartListPos.retailArticleNr : undefined,
27697
27994
  RetailPrefix: (_ref7 = myPartListPos.retailPrefix) !== null && _ref7 !== void 0 ? _ref7 : undefined
@@ -27703,22 +28000,33 @@ var IDMEngine = /*#__PURE__*/function () {
27703
28000
  }
27704
28001
  return partlistArticlesToLoad;
27705
28002
  }
28003
+
28004
+ /**
28005
+ * The first rule row whose conditions hold, with its index - a conditionless row matches unconditionally, which
28006
+ * makes it the documented fallback when it is the LAST row and a fault when rows follow it. That fault is reported
28007
+ * as WC_0012 for decisions and price rule sets alike; `ruleSet` names the set in the message where no decisionNo does.
28008
+ */
27706
28009
  }, {
27707
28010
  key: "getMatchingOptionCombination",
27708
- value: function getMatchingOptionCombination(combinations, decisionNo) {
28011
+ value: function getMatchingOptionCombination(combinations, decisionNo, ruleSet) {
27709
28012
  for (var i = 0; i < combinations.length; i++) {
27710
28013
  var _ref8, _ref9, _projectOptionsSetRef;
27711
28014
  var combination = combinations[i];
27712
28015
  var optionSetRefs = (_ref8 = (_ref9 = (_projectOptionsSetRef = combination.projectOptionsSetRefs) !== null && _projectOptionsSetRef !== void 0 ? _projectOptionsSetRef : combination.optionsSetRef) !== null && _ref9 !== void 0 ? _ref9 : combination.optionsSetRef) !== null && _ref8 !== void 0 ? _ref8 : [];
27713
28016
  if (optionSetRefs.length === 0) {
27714
- if (decisionNo !== undefined) {
28017
+ // A conditionless LAST row is the documented fallback; a conditionless row with rows AFTER it is the fault (first match wins).
28018
+ var shadowsLaterRows = i < combinations.length - 1;
28019
+ if ((decisionNo !== undefined || ruleSet !== undefined) && shadowsLaterRows && !this.isShadowedRowReported(decisionNo, ruleSet, i)) {
28020
+ var where = ruleSet !== null && ruleSet !== void 0 ? ruleSet : "decision ".concat(decisionNo);
27715
28021
  this.article.pushDataCreationError({
27716
28022
  code: 'WC_0012',
27717
- message: 'Rule with no conditions - always true, not useful',
28023
+ message: "Rule row ".concat(i + 1, " of ").concat(where, " has no conditions but is not the last row - it always matches, so the ").concat(combinations.length - i - 1, " row(s) after it can never be reached"),
27718
28024
  severity: 'warning',
27719
28025
  custom: {
27720
28026
  decisionNo: decisionNo,
28027
+ ruleSet: ruleSet,
27721
28028
  combinationIndex: i,
28029
+ shadowedRows: combinations.length - i - 1,
27722
28030
  catalogCodex: this.article.catalogCodex,
27723
28031
  articleCodex: this.article.articleCodex
27724
28032
  }
@@ -27730,6 +28038,19 @@ var IDMEngine = /*#__PURE__*/function () {
27730
28038
  }
27731
28039
  return [undefined, undefined];
27732
28040
  }
28041
+
28042
+ /**
28043
+ * Whether WC_0012 was already recorded for this row: evalDecisions clears the errors once and then converges over
28044
+ * several passes, so the same matching row would otherwise report the same fault once per pass.
28045
+ */
28046
+ }, {
28047
+ key: "isShadowedRowReported",
28048
+ value: function isShadowedRowReported(decisionNo, ruleSet, combinationIndex) {
28049
+ return this.article.dataCreationErrors.some(function (error) {
28050
+ var _error$custom, _error$custom2, _error$custom3;
28051
+ return error.code === 'WC_0012' && ((_error$custom = error.custom) === null || _error$custom === void 0 ? void 0 : _error$custom.decisionNo) === decisionNo && ((_error$custom2 = error.custom) === null || _error$custom2 === void 0 ? void 0 : _error$custom2.ruleSet) === ruleSet && ((_error$custom3 = error.custom) === null || _error$custom3 === void 0 ? void 0 : _error$custom3.combinationIndex) === combinationIndex;
28052
+ });
28053
+ }
27733
28054
  }, {
27734
28055
  key: "evalCombi",
27735
28056
  value: function evalCombi(optionSetRefs) {
@@ -27789,25 +28110,25 @@ var IDMEngine = /*#__PURE__*/function () {
27789
28110
  var cached = this.featureDefaultIndex;
27790
28111
  if (cached && cached.sources[0] === sources[0] && cached.sources[1] === sources[1]) return cached.byFeature;
27791
28112
  var byFeature = new Map();
27792
- var _iterator15 = _createForOfIteratorHelper$e(this.decisions),
27793
- _step15;
28113
+ var _iterator20 = _createForOfIteratorHelper$e(this.decisions),
28114
+ _step20;
27794
28115
  try {
27795
- for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
27796
- var _decision$optionCombi5;
27797
- var decision = _step15.value;
28116
+ for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
28117
+ var _decision$optionCombi6;
28118
+ var decision = _step20.value;
27798
28119
  if (decision.decisionType !== 2) continue;
27799
- var _iterator16 = _createForOfIteratorHelper$e((_decision$optionCombi5 = decision.optionCombinations) !== null && _decision$optionCombi5 !== void 0 ? _decision$optionCombi5 : []),
27800
- _step16;
28120
+ var _iterator21 = _createForOfIteratorHelper$e((_decision$optionCombi6 = decision.optionCombinations) !== null && _decision$optionCombi6 !== void 0 ? _decision$optionCombi6 : []),
28121
+ _step21;
27801
28122
  try {
27802
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
28123
+ for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {
27803
28124
  var _combination$projectA10, _combination$projectA11;
27804
- var combination = _step16.value;
27805
- var _iterator17 = _createForOfIteratorHelper$e((_combination$projectA10 = (_combination$projectA11 = combination.projectActions) === null || _combination$projectA11 === void 0 ? void 0 : _combination$projectA11.setFeatureDefault) !== null && _combination$projectA10 !== void 0 ? _combination$projectA10 : []),
27806
- _step17;
28125
+ var combination = _step21.value;
28126
+ var _iterator22 = _createForOfIteratorHelper$e((_combination$projectA10 = (_combination$projectA11 = combination.projectActions) === null || _combination$projectA11 === void 0 ? void 0 : _combination$projectA11.setFeatureDefault) !== null && _combination$projectA10 !== void 0 ? _combination$projectA10 : []),
28127
+ _step22;
27807
28128
  try {
27808
- for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
28129
+ for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
27809
28130
  var _action$featureNo4, _byFeature$get;
27810
- var action = _step17.value;
28131
+ var action = _step22.value;
27811
28132
  var featureNo = (_action$featureNo4 = action.featureNo) === null || _action$featureNo4 === void 0 ? void 0 : _action$featureNo4.toString();
27812
28133
  if (!featureNo) continue;
27813
28134
  var list = (_byFeature$get = byFeature.get(featureNo)) !== null && _byFeature$get !== void 0 ? _byFeature$get : [];
@@ -27815,21 +28136,21 @@ var IDMEngine = /*#__PURE__*/function () {
27815
28136
  byFeature.set(featureNo, list);
27816
28137
  }
27817
28138
  } catch (err) {
27818
- _iterator17.e(err);
28139
+ _iterator22.e(err);
27819
28140
  } finally {
27820
- _iterator17.f();
28141
+ _iterator22.f();
27821
28142
  }
27822
28143
  }
27823
28144
  } catch (err) {
27824
- _iterator16.e(err);
28145
+ _iterator21.e(err);
27825
28146
  } finally {
27826
- _iterator16.f();
28147
+ _iterator21.f();
27827
28148
  }
27828
28149
  }
27829
28150
  } catch (err) {
27830
- _iterator15.e(err);
28151
+ _iterator20.e(err);
27831
28152
  } finally {
27832
- _iterator15.f();
28153
+ _iterator20.f();
27833
28154
  }
27834
28155
  this.featureDefaultIndex = {
27835
28156
  sources: sources,
@@ -27844,13 +28165,15 @@ var IDMEngine = /*#__PURE__*/function () {
27844
28165
  value: function setFeatureDefaultKey(featureNo) {
27845
28166
  var decisions = this.type2DefaultsByFeature().get(featureNo);
27846
28167
  if (!decisions) return undefined;
27847
- var _iterator18 = _createForOfIteratorHelper$e(decisions),
27848
- _step18;
28168
+ var _iterator23 = _createForOfIteratorHelper$e(decisions),
28169
+ _step23;
27849
28170
  try {
27850
- for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
28171
+ for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
27851
28172
  var _combination$projectA12;
27852
- var decision = _step18.value;
27853
- var _ref12 = this.getMatchingOptionCombination(decision.optionCombinations, decision.decisionNo),
28173
+ var decision = _step23.value;
28174
+ // A decision evalType2Decision also visits would report WC_0012 twice per convergence pass — a DISABLED one it skips
28175
+ // entirely, so there the warning has to come from here.
28176
+ var _ref12 = this.getMatchingOptionCombination(decision.optionCombinations, decision.enabled === false ? decision.decisionNo : undefined),
27854
28177
  _ref13 = _slicedToArray(_ref12, 1),
27855
28178
  combination = _ref13[0];
27856
28179
  var key = combination === null || combination === void 0 || (_combination$projectA12 = combination.projectActions) === null || _combination$projectA12 === void 0 || (_combination$projectA12 = _combination$projectA12.setFeatureDefault) === null || _combination$projectA12 === void 0 || (_combination$projectA12 = _combination$projectA12.find(function (a) {
@@ -27860,9 +28183,9 @@ var IDMEngine = /*#__PURE__*/function () {
27860
28183
  if (key) return key;
27861
28184
  }
27862
28185
  } catch (err) {
27863
- _iterator18.e(err);
28186
+ _iterator23.e(err);
27864
28187
  } finally {
27865
- _iterator18.f();
28188
+ _iterator23.f();
27866
28189
  }
27867
28190
  return undefined;
27868
28191
  }
@@ -27883,11 +28206,11 @@ var IDMEngine = /*#__PURE__*/function () {
27883
28206
  key: "updateIDMSpecificFeatures",
27884
28207
  value: function updateIDMSpecificFeatures() {
27885
28208
  //updaten idm planner specific options
27886
- var _iterator19 = _createForOfIteratorHelper$e(this.article.articleOptionStates.values()),
27887
- _step19;
28209
+ var _iterator24 = _createForOfIteratorHelper$e(this.article.articleOptionStates.values()),
28210
+ _step24;
27888
28211
  try {
27889
- for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
27890
- var ops = _step19.value;
28212
+ for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
28213
+ var ops = _step24.value;
27891
28214
  //when an option has no decisions the first visible optionValue has to be selected per default
27892
28215
  if (ops.val === undefined && ops.visibleCount) {
27893
28216
  // Prefer an authored type-2 default (when visible) over the arbitrary first-visible pick.
@@ -27910,9 +28233,9 @@ var IDMEngine = /*#__PURE__*/function () {
27910
28233
  }
27911
28234
  }
27912
28235
  } catch (err) {
27913
- _iterator19.e(err);
28236
+ _iterator24.e(err);
27914
28237
  } finally {
27915
- _iterator19.f();
28238
+ _iterator24.f();
27916
28239
  }
27917
28240
  }
27918
28241
  }, {
@@ -27999,11 +28322,11 @@ var IDMEngine = /*#__PURE__*/function () {
27999
28322
  key: "getConditionValuesOfCombination",
28000
28323
  value: function getConditionValuesOfCombination(combination, featureNo, optionKey) {
28001
28324
  var variantValues = {};
28002
- var _iterator20 = _createForOfIteratorHelper$e(combination.projectOptionsSetRefs),
28003
- _step20;
28325
+ var _iterator25 = _createForOfIteratorHelper$e(combination.projectOptionsSetRefs),
28326
+ _step25;
28004
28327
  try {
28005
- for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
28006
- var optionSetRef = _step20.value;
28328
+ for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
28329
+ var optionSetRef = _step25.value;
28007
28330
  var optionList = this.getOptionListOfRef(optionSetRef);
28008
28331
  if (optionSetRef.featureNo.toString() == featureNo) {
28009
28332
  return optionKey && !(optionList !== null && optionList !== void 0 && optionList.options.includes(optionKey)) ? undefined : variantValues;
@@ -28012,9 +28335,9 @@ var IDMEngine = /*#__PURE__*/function () {
28012
28335
  variantValues[optionSetRef.featureNo.toString()] = optionList.options[0];
28013
28336
  }
28014
28337
  } catch (err) {
28015
- _iterator20.e(err);
28338
+ _iterator25.e(err);
28016
28339
  } finally {
28017
- _iterator20.f();
28340
+ _iterator25.f();
28018
28341
  }
28019
28342
  return variantValues;
28020
28343
  }
@@ -28040,18 +28363,18 @@ var IDMEngine = /*#__PURE__*/function () {
28040
28363
  })) return false;
28041
28364
  return _this8.decisionRemovesOption(restriction, featureNo, optionKey);
28042
28365
  };
28043
- var _iterator21 = _createForOfIteratorHelper$e(articleDecisions),
28044
- _step21;
28366
+ var _iterator26 = _createForOfIteratorHelper$e(articleDecisions),
28367
+ _step26;
28045
28368
  try {
28046
- for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {
28047
- var gate = _step21.value;
28369
+ for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {
28370
+ var gate = _step26.value;
28048
28371
  if (gate.decisionType != 2) continue;
28049
- var _iterator22 = _createForOfIteratorHelper$e(gate.optionCombinations),
28050
- _step22;
28372
+ var _iterator27 = _createForOfIteratorHelper$e(gate.optionCombinations),
28373
+ _step27;
28051
28374
  try {
28052
- for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
28375
+ for (_iterator27.s(); !(_step27 = _iterator27.n()).done;) {
28053
28376
  var _combination$projectA13, _combination$projectA14;
28054
- var combination = _step22.value;
28377
+ var combination = _step27.value;
28055
28378
  var enabled = (_combination$projectA13 = (_combination$projectA14 = combination.projectActions) === null || _combination$projectA14 === void 0 ? void 0 : _combination$projectA14.enableDecision) !== null && _combination$projectA13 !== void 0 ? _combination$projectA13 : [];
28056
28379
  if (!enabled.some(function (ref) {
28057
28380
  return isGatedRestriction(Number(ref.decisionNo));
@@ -28059,15 +28382,15 @@ var IDMEngine = /*#__PURE__*/function () {
28059
28382
  variantValuesArr.push.apply(variantValuesArr, _toConsumableArray(this.getValuesNotMatchingCombination(combination)));
28060
28383
  }
28061
28384
  } catch (err) {
28062
- _iterator22.e(err);
28385
+ _iterator27.e(err);
28063
28386
  } finally {
28064
- _iterator22.f();
28387
+ _iterator27.f();
28065
28388
  }
28066
28389
  }
28067
28390
  } catch (err) {
28068
- _iterator21.e(err);
28391
+ _iterator26.e(err);
28069
28392
  } finally {
28070
- _iterator21.f();
28393
+ _iterator26.f();
28071
28394
  }
28072
28395
  return variantValuesArr;
28073
28396
  }
@@ -28092,34 +28415,34 @@ var IDMEngine = /*#__PURE__*/function () {
28092
28415
  key: "getValuesNotMatchingCombination",
28093
28416
  value: function getValuesNotMatchingCombination(combination) {
28094
28417
  var variantValuesArr = [];
28095
- var _iterator23 = _createForOfIteratorHelper$e(combination.projectOptionsSetRefs),
28096
- _step23;
28418
+ var _iterator28 = _createForOfIteratorHelper$e(combination.projectOptionsSetRefs),
28419
+ _step28;
28097
28420
  try {
28098
- for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
28099
- var optionSetRef = _step23.value;
28421
+ for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) {
28422
+ var optionSetRef = _step28.value;
28100
28423
  var optionList = this.getOptionListOfRef(optionSetRef);
28101
28424
  if (!(optionList !== null && optionList !== void 0 && optionList.options.length) || ![0, 1, 2, 3].includes(optionList.operator)) continue;
28102
28425
  var conditionFeatureNo = optionSetRef.featureNo.toString();
28103
28426
  var ops = this.article.getArticleOptionState(conditionFeatureNo);
28104
28427
  if (!ops) continue;
28105
- var _iterator24 = _createForOfIteratorHelper$e(ops.visibleOPVKeys),
28106
- _step24;
28428
+ var _iterator29 = _createForOfIteratorHelper$e(ops.visibleOPVKeys),
28429
+ _step29;
28107
28430
  try {
28108
- for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
28109
- var candidate = _step24.value;
28431
+ for (_iterator29.s(); !(_step29 = _iterator29.n()).done;) {
28432
+ var candidate = _step29.value;
28110
28433
  if (this.evalValueWithOperator(optionList.operator, optionList.options, candidate)) continue;
28111
28434
  variantValuesArr.push(_defineProperty({}, conditionFeatureNo, candidate));
28112
28435
  }
28113
28436
  } catch (err) {
28114
- _iterator24.e(err);
28437
+ _iterator29.e(err);
28115
28438
  } finally {
28116
- _iterator24.f();
28439
+ _iterator29.f();
28117
28440
  }
28118
28441
  }
28119
28442
  } catch (err) {
28120
- _iterator23.e(err);
28443
+ _iterator28.e(err);
28121
28444
  } finally {
28122
- _iterator23.f();
28445
+ _iterator28.f();
28123
28446
  }
28124
28447
  return variantValuesArr;
28125
28448
  }
@@ -28219,18 +28542,18 @@ var IDMEngine = /*#__PURE__*/function () {
28219
28542
  }
28220
28543
 
28221
28544
  // this functions updates the images of OPVs that depend on rules
28222
- var _iterator25 = _createForOfIteratorHelper$e(this.article.articleOptionStates.values()),
28223
- _step25;
28545
+ var _iterator30 = _createForOfIteratorHelper$e(this.article.articleOptionStates.values()),
28546
+ _step30;
28224
28547
  try {
28225
- for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
28226
- var ops = _step25.value;
28227
- var _iterator26 = _createForOfIteratorHelper$e(ops.visibleOptionValues),
28228
- _step26;
28548
+ for (_iterator30.s(); !(_step30 = _iterator30.n()).done;) {
28549
+ var ops = _step30.value;
28550
+ var _iterator31 = _createForOfIteratorHelper$e(ops.visibleOptionValues),
28551
+ _step31;
28229
28552
  try {
28230
- for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {
28231
- var _step26$value = _slicedToArray(_step26.value, 2),
28232
- jKey = _step26$value[0],
28233
- opv = _step26$value[1];
28553
+ for (_iterator31.s(); !(_step31 = _iterator31.n()).done;) {
28554
+ var _step31$value = _slicedToArray(_step31.value, 2),
28555
+ jKey = _step31$value[0],
28556
+ opv = _step31$value[1];
28234
28557
  if (opv.images) {
28235
28558
  var imageFound = false;
28236
28559
  for (var _i5 = 0; _i5 < opv.images.length; _i5++) {
@@ -28239,9 +28562,9 @@ var IDMEngine = /*#__PURE__*/function () {
28239
28562
  var _doUse = !((_image$decisionNos2 = _image.decisionNos) !== null && _image$decisionNos2 !== void 0 && _image$decisionNos2.length);
28240
28563
  if ((_image$decisionNos3 = _image.decisionNos) !== null && _image$decisionNos3 !== void 0 && _image$decisionNos3.length) {
28241
28564
  for (var _j2 = 0; _j2 < _image.decisionNos.length; _j2++) {
28242
- var _decision4 = catalogData.getDecisionsByNo([_image.decisionNos[_j2]])[0];
28243
- if (!_decision4) continue;
28244
- var _ref25 = this.getMatchingOptionCombination(_decision4.optionCombinations, _decision4.decisionNo),
28565
+ var _decision5 = catalogData.getDecisionsByNo([_image.decisionNos[_j2]])[0];
28566
+ if (!_decision5) continue;
28567
+ var _ref25 = this.getMatchingOptionCombination(_decision5.optionCombinations, _decision5.decisionNo),
28245
28568
  _ref26 = _slicedToArray(_ref25, 1),
28246
28569
  _combination2 = _ref26[0];
28247
28570
  if (_combination2) {
@@ -28260,18 +28583,18 @@ var IDMEngine = /*#__PURE__*/function () {
28260
28583
  }
28261
28584
  }
28262
28585
  } catch (err) {
28263
- _iterator26.e(err);
28586
+ _iterator31.e(err);
28264
28587
  } finally {
28265
- _iterator26.f();
28588
+ _iterator31.f();
28266
28589
  }
28267
28590
  }
28268
28591
 
28269
28592
  // this function calculates an Svg to the current configuration if neccessary (SVG Tausch)
28270
28593
  // if the Article has no SVG Tausch nothing is done
28271
28594
  } catch (err) {
28272
- _iterator25.e(err);
28595
+ _iterator30.e(err);
28273
28596
  } finally {
28274
- _iterator25.f();
28597
+ _iterator30.f();
28275
28598
  }
28276
28599
  var newSVGFile = null;
28277
28600
  var svgChangedViaSvgTausch = false;
@@ -28286,6 +28609,9 @@ var IDMEngine = /*#__PURE__*/function () {
28286
28609
  }
28287
28610
  }
28288
28611
  return;
28612
+ } else if (!this.article.actPlannerData) {
28613
+ // An item with SVGs that is NOT a planner article has no actPlannerData — legal data (e.g. a partlist component), nothing to swap.
28614
+ return;
28289
28615
  } else {
28290
28616
  var plannerCatArt = this.article.catalogArticle.catalogPlannerArticle;
28291
28617
  var svgs = this.article.catalogArticle.svgs;
@@ -28296,13 +28622,13 @@ var IDMEngine = /*#__PURE__*/function () {
28296
28622
  var svgValid = !((_svg$decisionNos = svg.decisionNos) !== null && _svg$decisionNos !== void 0 && _svg$decisionNos.length);
28297
28623
  if ((_svg$decisionNos2 = svg.decisionNos) !== null && _svg$decisionNos2 !== void 0 && _svg$decisionNos2.length) {
28298
28624
  for (var _j = 0; _j < svg.decisionNos.length; _j++) {
28299
- var _decision3 = catalogData.getDecisionsByNo([svg.decisionNos[_j]])[0];
28300
- if (!_decision3) continue;
28301
- var _ref23 = this.getMatchingOptionCombination(_decision3.optionCombinations, _decision3.decisionNo),
28625
+ var _decision4 = catalogData.getDecisionsByNo([svg.decisionNos[_j]])[0];
28626
+ if (!_decision4) continue;
28627
+ var _ref23 = this.getMatchingOptionCombination(_decision4.optionCombinations, _decision4.decisionNo),
28302
28628
  _ref24 = _slicedToArray(_ref23, 1),
28303
28629
  _combination = _ref24[0];
28304
28630
  if (_combination) {
28305
- svgValid = _decision3;
28631
+ svgValid = _decision4;
28306
28632
  break;
28307
28633
  }
28308
28634
  }
@@ -28378,6 +28704,138 @@ function _arrayLikeToArray$d(r, a) { (null == a || a > r.length) && (a = r.lengt
28378
28704
  function ownKeys$i(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; }
28379
28705
  function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
28380
28706
  var LOG$f = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
28707
+
28708
+ /**
28709
+ * Output formats a COMPUTED NUMBER field can request through its prefix. The computation itself is
28710
+ * generic (placeholder substitution + integer arithmetic, see evaluateComputedNumber); a format only
28711
+ * decides how the resulting number is rendered. Add a prefix here to support another number scheme.
28712
+ */
28713
+ var COMPUTED_NUMBER_FORMATS = {
28714
+ // EAN-14: 12-digit body, GS1 check digit, leading packaging indicator '0'.
28715
+ 'EAN14:': function EAN14(value) {
28716
+ var body = String(value).padStart(12, '0');
28717
+ return '0' + body + gs1CheckDigit(body);
28718
+ }
28719
+ };
28720
+
28721
+ /** The format prefix this value carries, or undefined when it is a literal rather than a formula. */
28722
+ function computedNumberFormatOf(value) {
28723
+ if (typeof value !== 'string') return undefined;
28724
+ return Object.keys(COMPUTED_NUMBER_FORMATS).find(function (prefix) {
28725
+ return value.startsWith(prefix);
28726
+ });
28727
+ }
28728
+
28729
+ /** True when this field holds a computed-number FORMULA instead of a literal number. */
28730
+ function isComputedNumber(value) {
28731
+ return computedNumberFormatOf(value) !== undefined;
28732
+ }
28733
+
28734
+ /**
28735
+ * Reads a property the CATALOG names (template placeholders like `{article.typeNr}`) off an object — the one
28736
+ * place where a runtime string indexes typed instances, so the dynamic access is not scattered as casts.
28737
+ */
28738
+ function dynamicProperty(source, key) {
28739
+ return Reflect.get(source, key);
28740
+ }
28741
+
28742
+ /** The option key of a group member, which may carry an assigned number as `<optionKey>=<number>`. */
28743
+ function optionGroupMemberKey(member) {
28744
+ return member.split('=')[0].trim();
28745
+ }
28746
+
28747
+ /** GS1 check digit over a 12/13-digit body: weights 3 and 1 from the left, complement to the next ten. */
28748
+ function gs1CheckDigit(body) {
28749
+ var digits = body.padStart(13, '0');
28750
+ var sum = 0;
28751
+ for (var i = 0; i < digits.length; i++) sum += Number(digits[i]) * (i % 2 === 0 ? 3 : 1);
28752
+ return (10 - sum % 10) % 10;
28753
+ }
28754
+
28755
+ /**
28756
+ * Evaluates `+`, `-`, `*` and parentheses over integers — no identifiers, no properties, no function calls,
28757
+ * so a catalog-authored expression can only ever produce a number. Undefined on anything unparseable.
28758
+ */
28759
+ function evaluateIntegerExpression(expression) {
28760
+ var tokens = expression.match(/\d+|[+\-*()]/g);
28761
+ if (!tokens || tokens.join('') !== expression.replace(/\s+/g, '')) return undefined;
28762
+ var position = 0;
28763
+ /** The next token without consuming it. */
28764
+ var peek = function peek() {
28765
+ return tokens[position];
28766
+ };
28767
+ /** sum := product (('+' | '-') product)* */
28768
+ var parseSum = function parseSum() {
28769
+ var left = parseProduct();
28770
+ if (left === undefined) return undefined;
28771
+ while (peek() === '+' || peek() === '-') {
28772
+ var operator = tokens[position++];
28773
+ var right = parseProduct();
28774
+ if (right === undefined) return undefined;
28775
+ left = operator === '+' ? left + right : left - right;
28776
+ // Past 2^53 the arithmetic silently loses precision — a wrong EAN is worse than none.
28777
+ if (!Number.isSafeInteger(left)) return undefined;
28778
+ }
28779
+ return left;
28780
+ };
28781
+ /** product := atom ('*' atom)* */
28782
+ var parseProduct = function parseProduct() {
28783
+ var left = parseAtom();
28784
+ if (left === undefined) return undefined;
28785
+ while (peek() === '*') {
28786
+ position++;
28787
+ var right = parseAtom();
28788
+ if (right === undefined) return undefined;
28789
+ left *= right;
28790
+ if (!Number.isSafeInteger(left)) return undefined;
28791
+ }
28792
+ return left;
28793
+ };
28794
+ /** atom := integer | '(' sum ')' */
28795
+ var parseAtom = function parseAtom() {
28796
+ var token = tokens[position];
28797
+ if (token === undefined) return undefined;
28798
+ if (token === '(') {
28799
+ position++;
28800
+ var inner = parseSum();
28801
+ if (inner === undefined || tokens[position] !== ')') return undefined;
28802
+ position++;
28803
+ return inner;
28804
+ }
28805
+ if (!/^\d+$/.test(token)) return undefined;
28806
+ position++;
28807
+ var literal = Number(token);
28808
+ // An oversized literal would already be rounded here (and print as 1e+21 downstream).
28809
+ return Number.isSafeInteger(literal) ? literal : undefined;
28810
+ };
28811
+ var result = parseSum();
28812
+ return result === undefined || position !== tokens.length || !Number.isFinite(result) ? undefined : result;
28813
+ }
28814
+
28815
+ /** Comparison for a template token's optional operator: numeric when both sides are numeric, else by string. */
28816
+ function compareTemplateValues(left, right, operator) {
28817
+ var leftNumber = Number(left);
28818
+ var rightNumber = Number(right);
28819
+ var numeric = right !== undefined && left !== null && left !== '' && Number.isFinite(leftNumber) && Number.isFinite(rightNumber);
28820
+ var a = numeric ? leftNumber : String(left !== null && left !== void 0 ? left : '');
28821
+ var b = numeric ? rightNumber : String(right !== null && right !== void 0 ? right : '');
28822
+ switch (operator) {
28823
+ case '==':
28824
+ return a === b;
28825
+ case '!=':
28826
+ return a !== b;
28827
+ case '>=':
28828
+ return a >= b;
28829
+ case '<=':
28830
+ return a <= b;
28831
+ case '>':
28832
+ return a > b;
28833
+ case '<':
28834
+ return a < b;
28835
+ default:
28836
+ return false;
28837
+ }
28838
+ }
28381
28839
  var DivaArticle = /*#__PURE__*/function () {
28382
28840
  function DivaArticle(set, _basketId, initParams, articleData, catalogData) {
28383
28841
  var _this = this,
@@ -28412,6 +28870,8 @@ var DivaArticle = /*#__PURE__*/function () {
28412
28870
  }
28413
28871
  return undefined;
28414
28872
  });
28873
+ /** `{article.x}` reads currently being resolved — a template-evaluating getter (articleEAN, typeNr) must not re-enter itself. */
28874
+ _defineProperty(this, "resolvingTemplateKeys", void 0);
28415
28875
  this.article = {
28416
28876
  set: set,
28417
28877
  basketId: _basketId,
@@ -28724,10 +29184,21 @@ var DivaArticle = /*#__PURE__*/function () {
28724
29184
  key: "deleted",
28725
29185
  get: function get() {
28726
29186
  return !!this.article.deleted;
28727
- },
29187
+ }
29188
+
29189
+ /** True only while this article runs its after-load init — see loadPartlistArticle. */,
28728
29190
  set: function set(deleted) {
28729
29191
  this.article.deleted = deleted;
28730
29192
  }
29193
+ }, {
29194
+ key: "loadingPartlistChild",
29195
+ get: /** Whether this article is still running its after-load init as a partlist child. */
29196
+ function get() {
29197
+ return !!this.article.loadingPartlistChild;
29198
+ },
29199
+ set: function set(loading) {
29200
+ this.article.loadingPartlistChild = loading;
29201
+ }
28731
29202
  }, {
28732
29203
  key: "toDeleteAfterInit",
28733
29204
  get: function get() {
@@ -29293,7 +29764,28 @@ var DivaArticle = /*#__PURE__*/function () {
29293
29764
  }, {
29294
29765
  key: "articleEAN",
29295
29766
  get: function get() {
29296
- return this.article.catalogArticle.articleEAN;
29767
+ var ean = this.article.catalogArticle.articleEAN;
29768
+ // A variant article's EAN is a function of the selected axes — such articles hold a FORMULA instead; plain EANs pass untouched.
29769
+ return isComputedNumber(ean) ? this.evaluateComputedNumber(ean) : ean;
29770
+ }
29771
+
29772
+ /**
29773
+ * Evaluates a computed-number formula `<FORMAT>:<integer arithmetic over {token} placeholders>`, e.g.
29774
+ * `EAN14:407142261118 + {1095.indexIn:EAN_S1_W}*1` — a counter over the variant axes; the FORMAT prefix only
29775
+ * renders the number (EAN14: zero-pad + GS1 check digit). Unresolvable parts return a visible `___…___` marker.
29776
+ */
29777
+ }, {
29778
+ key: "evaluateComputedNumber",
29779
+ value: function evaluateComputedNumber(formula) {
29780
+ var prefix = computedNumberFormatOf(formula);
29781
+ if (!prefix) return formula;
29782
+ var body = formula.slice(prefix.length);
29783
+ var resolved = this.convertTemplateToCodex(body);
29784
+ var value = evaluateIntegerExpression(resolved);
29785
+ if (value === undefined || value < 0) return '___' + prefix + ' not computable: "' + body.trim() + '" -> "' + resolved.trim() + '"___';
29786
+ var digits = Math.trunc(value).toString();
29787
+ if (digits.length > 12) return '___' + prefix + ' overflow: ' + digits + ' exceeds 12 digits___';
29788
+ return COMPUTED_NUMBER_FORMATS[prefix](value);
29297
29789
  }
29298
29790
  }, {
29299
29791
  key: "getArticleOptionStateFlat",
@@ -29473,7 +29965,13 @@ var DivaArticle = /*#__PURE__*/function () {
29473
29965
  } finally {
29474
29966
  _iterator7.f();
29475
29967
  }
29476
- return this.article.typeNr;
29968
+ return this.evaluatedArticleTypeNr;
29969
+ }
29970
+ /** The record's typeNr — on IDM it falls back to eanNumber, which may hold a computed-number FORMULA, evaluated here. */
29971
+ }, {
29972
+ key: "evaluatedArticleTypeNr",
29973
+ get: function get() {
29974
+ return isComputedNumber(this.article.typeNr) ? this.evaluateComputedNumber(this.article.typeNr) : this.article.typeNr;
29477
29975
  }
29478
29976
  }, {
29479
29977
  key: "articlePrices",
@@ -30001,6 +30499,8 @@ var DivaArticle = /*#__PURE__*/function () {
30001
30499
  }, {
30002
30500
  key: "configArticleCodex",
30003
30501
  get: function get() {
30502
+ var _this$article$configA;
30503
+ if ((_this$article$configA = this.article.configArticleCodex) !== null && _this$article$configA !== void 0 && _this$article$configA.includes('{')) return this.convertTemplateToCodex(this.article.configArticleCodex);
30004
30504
  return this.article.configArticleCodex;
30005
30505
  },
30006
30506
  set: function set(codex) {
@@ -30416,6 +30916,15 @@ var DivaArticle = /*#__PURE__*/function () {
30416
30916
  newPartlistArticle.hasPartlistArticleInitialized = this.hasPartlistArticleInitialized;
30417
30917
  this.article.partlistArticles[newPartlistArticle.basketId] = newPartlistArticle;
30418
30918
  }
30919
+ /**
30920
+ * Drops one partlist child (and with it its own subtree) from this article again — used when the child's
30921
+ * after-load init fails after it was registered, so no half-initialized child stays in the tree.
30922
+ */
30923
+ }, {
30924
+ key: "removePartlistArticle",
30925
+ value: function removePartlistArticle(basketId) {
30926
+ delete this.article.partlistArticles[basketId];
30927
+ }
30419
30928
  }, {
30420
30929
  key: "deletePartlistArticles",
30421
30930
  value: function deletePartlistArticles() {
@@ -31171,7 +31680,7 @@ var DivaArticle = /*#__PURE__*/function () {
31171
31680
  break;
31172
31681
  }
31173
31682
  _context.next = 4;
31174
- return import('./ShelfPlanner-b7d908ec.js');
31683
+ return import('./ShelfPlanner-c3b5b34f.js');
31175
31684
  case 4:
31176
31685
  _yield$import = _context.sent;
31177
31686
  ShelfPlanner = _yield$import["default"];
@@ -31523,7 +32032,7 @@ var DivaArticle = /*#__PURE__*/function () {
31523
32032
  codex: this.articleCodex,
31524
32033
  singlePrice: this.price,
31525
32034
  image: this.image ? catalogData.getCatImageURL(this.image, '') : undefined,
31526
- typeNr: this.article.typeNr,
32035
+ typeNr: this.evaluatedArticleTypeNr,
31527
32036
  width: this.calcWidth,
31528
32037
  height: this.calcHeight,
31529
32038
  depth: this.calcDepth,
@@ -31793,39 +32302,97 @@ var DivaArticle = /*#__PURE__*/function () {
31793
32302
  get: function get() {
31794
32303
  return this._engine;
31795
32304
  }
32305
+
32306
+ /**
32307
+ * Substitutes `{identifier.accessor}` placeholders in a catalog-authored template (order codices, retail
32308
+ * article numbers, EAN formulas). `identifier` is `article`, `parent` or a featureNo; `accessor` is a property
32309
+ * name, optionally with a comparison (`==`, `!=`, …) that substitutes the comparison RESULT instead.
32310
+ */
31796
32311
  }, {
31797
32312
  key: "convertTemplateToCodex",
31798
32313
  value: function convertTemplateToCodex(codex) {
31799
- var evaluatedOrderCodex = codex;
31800
- var array = _toConsumableArray(evaluatedOrderCodex.matchAll(/\{(.*?)\}/g));
31801
- var toRepace = [];
31802
- for (var i = 0; i < array.length; i++) {
31803
- var expressions = array[i][1].split('.');
31804
- var identifier = expressions[0];
31805
- var _this$parseOperator = this.parseOperator(expressions[1]),
31806
- operator = _this$parseOperator.operator;
31807
- _this$parseOperator.key;
31808
- var value = _this$parseOperator.value;
31809
- var ruleExtension = operator ? ' ' + operator + ' ' + value : '';
31810
- if (identifier === 'article') {
31811
- toRepace.push(eval('this[key]' + ruleExtension));
31812
- } else if (identifier === 'parent') {
31813
- toRepace.push(eval('this[key]' + ruleExtension));
31814
- } else {
31815
- // IDM option codexes carry no 'OPT' prefix — the eval must look up the same codex the guard checked.
31816
- var optionStateCodex = (!this.CatalogData.isIDMFormat ? 'OPT' : '') + identifier;
31817
- if (this.getArticleOptionState(optionStateCodex)) {
31818
- toRepace.push(eval('this.getArticleOptionState(optionStateCodex)[key]' + ruleExtension));
31819
- } else {
31820
- toRepace.push('___Option: "' + identifier + '" not found!___');
31821
- }
32314
+ var _this5 = this;
32315
+ return codex.replace(/\{(.*?)\}/g, function (_match, expression) {
32316
+ return _this5.resolveTemplateToken(String(expression));
32317
+ });
32318
+ }
32319
+ }, {
32320
+ key: "resolveTemplateToken",
32321
+ value: /** Resolves ONE `{…}` template token to its replacement text ('' when the value is absent). */
32322
+ function resolveTemplateToken(expression) {
32323
+ var _expressions$;
32324
+ var expressions = expression.split('.');
32325
+ var identifier = expressions[0];
32326
+ var _this$parseOperator = this.parseOperator((_expressions$ = expressions[1]) !== null && _expressions$ !== void 0 ? _expressions$ : ''),
32327
+ operator = _this$parseOperator.operator,
32328
+ key = _this$parseOperator.key,
32329
+ value = _this$parseOperator.value;
32330
+ var resolved;
32331
+ if (identifier === 'article') {
32332
+ var _this$resolvingTempla;
32333
+ // Lazily built: prototype-only instances (tests, clones) never run the field initializers.
32334
+ var resolving = (_this$resolvingTempla = this.resolvingTemplateKeys) !== null && _this$resolvingTempla !== void 0 ? _this$resolvingTempla : this.resolvingTemplateKeys = new Set();
32335
+ if (resolving.has(key)) return '___article: "' + key + '" refers to itself!___';
32336
+ resolving.add(key);
32337
+ try {
32338
+ resolved = dynamicProperty(this, key);
32339
+ } finally {
32340
+ resolving["delete"](key);
31822
32341
  }
31823
- }
31824
- for (var _i7 = 0; _i7 < toRepace.length; _i7++) {
31825
- var _toRepace$_i;
31826
- evaluatedOrderCodex = evaluatedOrderCodex.replace(/\{(.*?)\}/, (_toRepace$_i = toRepace[_i7]) !== null && _toRepace$_i !== void 0 ? _toRepace$_i : '');
31827
- }
31828
- return evaluatedOrderCodex;
32342
+ } else if (identifier === 'parent') {
32343
+ // The EMBEDDING article of a partlist component.
32344
+ var parent = this.partListParentArticle;
32345
+ if (!parent) return '___parent: "' + key + '" — this article has no partlist parent!___';
32346
+ resolved = dynamicProperty(parent, key);
32347
+ } else {
32348
+ var optionStateKey = (!this.CatalogData.isIDMFormat ? 'OPT' : '') + identifier;
32349
+ var optionState = this.getArticleOptionState(optionStateKey);
32350
+ if (!optionState) return '___Option: "' + identifier + '" not found!___';
32351
+ var _key$split = key.split(':'),
32352
+ _key$split2 = _slicedToArray(_key$split, 2),
32353
+ accessor = _key$split2[0],
32354
+ groupKey = _key$split2[1];
32355
+ if (accessor.trim() === 'indexIn') resolved = this.resolveIndexInOptionGroup(optionState.valCodex, groupKey === null || groupKey === void 0 ? void 0 : groupKey.trim());else if (accessor.trim() === 'valueIn') resolved = this.resolveValueInOptionGroup(optionState.valCodex, groupKey === null || groupKey === void 0 ? void 0 : groupKey.trim());else resolved = dynamicProperty(optionState, accessor.trim());
32356
+ }
32357
+ if (operator === undefined) return resolved === undefined || resolved === null ? '' : String(resolved);
32358
+ return String(compareTemplateValues(resolved, value, operator));
32359
+ }
32360
+
32361
+ /**
32362
+ * Position of `optionKey` within the ordered option group `groupKey`. The GROUP — not the feature's own
32363
+ * value list — is the source of truth: positions differ per article family, and dependency decisions
32364
+ * narrow the visible list at runtime.
32365
+ */
32366
+ }, {
32367
+ key: "resolveIndexInOptionGroup",
32368
+ value: function resolveIndexInOptionGroup(optionKey, groupKey) {
32369
+ var _this$CatalogData$idm, _members$findIndex;
32370
+ if (!optionKey || !groupKey) return undefined;
32371
+ var members = (_this$CatalogData$idm = this.CatalogData.idmOptionGroups) === null || _this$CatalogData$idm === void 0 ? void 0 : _this$CatalogData$idm[groupKey];
32372
+ var index = (_members$findIndex = members === null || members === void 0 ? void 0 : members.findIndex(function (member) {
32373
+ return optionGroupMemberKey(member) === optionKey;
32374
+ })) !== null && _members$findIndex !== void 0 ? _members$findIndex : -1;
32375
+ return index < 0 ? undefined : index;
32376
+ }
32377
+
32378
+ /**
32379
+ * The NUMBER a group assigns to `optionKey` (`<optionKey>=<number>` on the member) — supplier numbering has
32380
+ * holes no single stride reproduces; a member without `=` falls back to its position. Returned as the
32381
+ * WRITTEN string because codex digits may carry leading zeros ('06').
32382
+ */
32383
+ }, {
32384
+ key: "resolveValueInOptionGroup",
32385
+ value: function resolveValueInOptionGroup(optionKey, groupKey) {
32386
+ var _this$CatalogData$idm2, _members$findIndex2, _members$index$split$;
32387
+ if (!optionKey || !groupKey) return undefined;
32388
+ var members = (_this$CatalogData$idm2 = this.CatalogData.idmOptionGroups) === null || _this$CatalogData$idm2 === void 0 ? void 0 : _this$CatalogData$idm2[groupKey];
32389
+ var index = (_members$findIndex2 = members === null || members === void 0 ? void 0 : members.findIndex(function (member) {
32390
+ return optionGroupMemberKey(member) === optionKey;
32391
+ })) !== null && _members$findIndex2 !== void 0 ? _members$findIndex2 : -1;
32392
+ if (!members || index < 0) return undefined;
32393
+ var assigned = (_members$index$split$ = members[index].split('=')[1]) === null || _members$index$split$ === void 0 ? void 0 : _members$index$split$.trim();
32394
+ if (assigned === undefined) return index;
32395
+ return assigned !== '' && Number.isFinite(Number(assigned)) ? assigned : undefined;
31829
32396
  }
31830
32397
  }, {
31831
32398
  key: "parseOperator",
@@ -31840,16 +32407,6 @@ var DivaArticle = /*#__PURE__*/function () {
31840
32407
  key: expression.split('!=')[0].trim(),
31841
32408
  value: expression.split('!=')[1].trim()
31842
32409
  };
31843
- if (expression.includes('>')) return {
31844
- operator: '>',
31845
- key: expression.split('>')[0].trim(),
31846
- value: expression.split('>')[1].trim()
31847
- };
31848
- if (expression.includes('<')) return {
31849
- operator: '<',
31850
- key: expression.split('<')[0].trim(),
31851
- value: expression.split('<')[1].trim()
31852
- };
31853
32410
  if (expression.includes('>=')) return {
31854
32411
  operator: '>=',
31855
32412
  key: expression.split('>=')[0].trim(),
@@ -31860,6 +32417,16 @@ var DivaArticle = /*#__PURE__*/function () {
31860
32417
  key: expression.split('<=')[0].trim(),
31861
32418
  value: expression.split('<=')[1].trim()
31862
32419
  };
32420
+ if (expression.includes('>')) return {
32421
+ operator: '>',
32422
+ key: expression.split('>')[0].trim(),
32423
+ value: expression.split('>')[1].trim()
32424
+ };
32425
+ if (expression.includes('<')) return {
32426
+ operator: '<',
32427
+ key: expression.split('<')[0].trim(),
32428
+ value: expression.split('<')[1].trim()
32429
+ };
31863
32430
  return {
31864
32431
  operator: undefined,
31865
32432
  key: expression.trim(),
@@ -31890,7 +32457,11 @@ var DivaArticle = /*#__PURE__*/function () {
31890
32457
  clonedArticle.article.partlistArticles = {};
31891
32458
  clonedArticle.article.previousPartlistArticles = {};
31892
32459
  for (var key in this.partlistArticles) {
31893
- clonedArticle.article.partlistArticles[key] = this.partlistArticles[key].cloneArticle(set);
32460
+ var clonedChild = this.partlistArticles[key].cloneArticle(set);
32461
+ // `{ ...this.article }` copied the LIVE parent reference — a sandbox that reconfigures the clone's parent
32462
+ // (merged option groups, variant sweeps) would otherwise write into the user's real configuration.
32463
+ clonedChild.article.partListParentArticle = clonedArticle;
32464
+ clonedArticle.article.partlistArticles[key] = clonedChild;
31894
32465
  }
31895
32466
  return clonedArticle;
31896
32467
  }
@@ -32001,7 +32572,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32001
32572
  break;
32002
32573
  case 20:
32003
32574
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
32004
- var articlesObj, catalog, articles, _i, _set$actions, _set$actions$openModa, index, articleCodex, articlesToLoadMore;
32575
+ var articlesObj, catalog, articles, _i, _set$actions, _set$actions$openModa, _set$api$getI18n$t, _set$api$getI18n, index, articleCodex, articlesToLoadMore;
32005
32576
  return _regeneratorRuntime.wrap(function _loop$(_context2) {
32006
32577
  while (1) switch (_context2.prev = _context2.next) {
32007
32578
  case 0:
@@ -32035,7 +32606,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32035
32606
  });
32036
32607
  articleCodex = articles[index].articleCodex;
32037
32608
  (_set$actions = set.actions) === null || _set$actions === void 0 || (_set$actions$openModa = _set$actions.openModal) === null || _set$actions$openModa === void 0 || _set$actions$openModa.call(_set$actions, {
32038
- title: set.api.getI18n().t('configurator.article_not_found'),
32609
+ title: (_set$api$getI18n$t = (_set$api$getI18n = set.api.getI18n()) === null || _set$api$getI18n === void 0 ? void 0 : _set$api$getI18n.t('configurator.article_not_found')) !== null && _set$api$getI18n$t !== void 0 ? _set$api$getI18n$t : 'configurator.article_not_found',
32039
32610
  content: articleCodex,
32040
32611
  accept: true
32041
32612
  });
@@ -32170,11 +32741,26 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32170
32741
  case 0:
32171
32742
  newEDOExtraArticles = [];
32172
32743
  partlistArticlesToLoad = [];
32173
- valuesArray = [];
32744
+ valuesArray = []; // A partlist child's after-load init (toDoAfterArticleLoaded) has already initialized its config, evaluated
32745
+ // its own partlist and filled its empty options while registered in the tree - there is nothing left for
32746
+ // this pass to do for it. It MUST NOT run the set-wide sibling update from inside a child init either: with
32747
+ // two top-level articles that each own visible partlist children, that pass reloads the OTHER parent, whose
32748
+ // children's inits reload this parent again, and so on without end. Before the child was registered ahead
32749
+ // of its init this call was a no-op for it (an unregistered target was dropped above); keep it that way.
32750
+ if (!(from === 'initializingPartlist')) {
32751
+ _context6.next = 5;
32752
+ break;
32753
+ }
32754
+ return _context6.abrupt("return", {
32755
+ newEDOExtraArticles: newEDOExtraArticles,
32756
+ targetArticlesToUpdate: [],
32757
+ partlistArticlesToLoad: partlistArticlesToLoad
32758
+ });
32759
+ case 5:
32174
32760
  i = 0;
32175
- case 4:
32761
+ case 6:
32176
32762
  if (!(i < targetArticlesToUpdate.length)) {
32177
- _context6.next = 40;
32763
+ _context6.next = 42;
32178
32764
  break;
32179
32765
  }
32180
32766
  valuesArray[i] = {};
@@ -32183,13 +32769,13 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32183
32769
  actArticle = actArticle.partListParentArticle.partlistArticles[actArticle.basketId];
32184
32770
  }
32185
32771
  if (!(!actArticle || actArticle.deleted)) {
32186
- _context6.next = 12;
32772
+ _context6.next = 14;
32187
32773
  break;
32188
32774
  }
32189
32775
  targetArticlesToUpdate.splice(i, 1);
32190
32776
  i--;
32191
- return _context6.abrupt("continue", 37);
32192
- case 12:
32777
+ return _context6.abrupt("continue", 39);
32778
+ case 14:
32193
32779
  if (targetArticlesWithNewValues.includes(targetArticlesToUpdate[i])) {
32194
32780
  valuesArray[i] = actArticle.getValidValues(_objectSpread$h({}, myValues), actArticle.CatalogData.mergeOptionsToSameOption);
32195
32781
  // Remember what the USER picked: a rule may hide that value for a while, and it has to come back when the rule frees it again.
@@ -32207,56 +32793,56 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32207
32793
  //only set config if valuesArray are not empty or the article is initializing
32208
32794
  newPLATL = void 0; // partlistarticle to load
32209
32795
  if (!(Object.entries(valuesArray[i]).length > 0 || from !== null && from !== void 0 && from.startsWith('initializing'))) {
32210
- _context6.next = 29;
32796
+ _context6.next = 31;
32211
32797
  break;
32212
32798
  }
32213
- _context6.next = 17;
32799
+ _context6.next = 19;
32214
32800
  return this.updateCfgValues(actArticle, valuesArray[i], {}, undefined, undefined, from == 'calcVariant');
32215
- case 17:
32801
+ case 19:
32216
32802
  newPLATL = _context6.sent;
32217
32803
  _actArticle$checkDefa = actArticle.checkDefaultGlobalOpt(valuesArray[i]), variantValues = _actArticle$checkDefa.variantValues, triggerUpdate = _actArticle$checkDefa.triggerUpdate;
32218
32804
  valuesArray[i] = variantValues;
32219
- _context6.next = 22;
32805
+ _context6.next = 24;
32220
32806
  return this.updateAccessoriesFromGlobalOption(valuesArray[i], actArticle);
32221
- case 22:
32807
+ case 24:
32222
32808
  if (!triggerUpdate) {
32223
- _context6.next = 26;
32809
+ _context6.next = 28;
32224
32810
  break;
32225
32811
  }
32226
- _context6.next = 25;
32812
+ _context6.next = 27;
32227
32813
  return this.updateCfgValues(actArticle, valuesArray[i], {}, undefined, undefined, from == 'calcVariant');
32228
- case 25:
32814
+ case 27:
32229
32815
  newPLATL = _context6.sent;
32230
- case 26:
32816
+ case 28:
32231
32817
  newEDOExtraArticles = this.checkEDOArticles(articles);
32232
- _context6.next = 32;
32818
+ _context6.next = 34;
32233
32819
  break;
32234
- case 29:
32235
- _context6.next = 31;
32236
- return this.updateCfgValues(actArticle, {}, {}, undefined, undefined, from == 'calcVariant');
32237
32820
  case 31:
32821
+ _context6.next = 33;
32822
+ return this.updateCfgValues(actArticle, {}, {}, undefined, undefined, from == 'calcVariant');
32823
+ case 33:
32238
32824
  newPLATL = _context6.sent;
32239
- case 32:
32240
- _context6.next = 34;
32241
- return this.updateEmptyOption(actArticle);
32242
32825
  case 34:
32826
+ _context6.next = 36;
32827
+ return this.updateEmptyOption(actArticle);
32828
+ case 36:
32243
32829
  pla = _context6.sent;
32244
32830
  if (pla !== undefined) newPLATL = pla;
32245
32831
  partlistArticlesToLoad = partlistArticlesToLoad.concat(newPLATL);
32246
- case 37:
32832
+ case 39:
32247
32833
  i++;
32248
- _context6.next = 4;
32834
+ _context6.next = 6;
32249
32835
  break;
32250
- case 40:
32251
- _context6.next = 42;
32252
- return this.triggerUpdateOnVisiblePartilstArticles(targetArticlesToUpdate, articles);
32253
32836
  case 42:
32837
+ _context6.next = 44;
32838
+ return this.triggerUpdateOnVisiblePartilstArticles(targetArticlesToUpdate, articles);
32839
+ case 44:
32254
32840
  return _context6.abrupt("return", {
32255
32841
  newEDOExtraArticles: newEDOExtraArticles,
32256
32842
  targetArticlesToUpdate: targetArticlesToUpdate,
32257
32843
  partlistArticlesToLoad: partlistArticlesToLoad
32258
32844
  });
32259
- case 43:
32845
+ case 45:
32260
32846
  case "end":
32261
32847
  return _context6.stop();
32262
32848
  }
@@ -32277,13 +32863,13 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32277
32863
  while (1) switch (_context7.prev = _context7.next) {
32278
32864
  case 0:
32279
32865
  if (!((_articles$targetArtic = articles[targetArticlesToUpdate[0]]) !== null && _articles$targetArtic !== void 0 && _articles$targetArtic.hasPartlistArticleVisibleInTree)) {
32280
- _context7.next = 13;
32866
+ _context7.next = 15;
32281
32867
  break;
32282
32868
  }
32283
32869
  _context7.t0 = _regeneratorRuntime.keys(articles);
32284
32870
  case 2:
32285
32871
  if ((_context7.t1 = _context7.t0()).done) {
32286
- _context7.next = 13;
32872
+ _context7.next = 15;
32287
32873
  break;
32288
32874
  }
32289
32875
  key = _context7.t1.value;
@@ -32295,13 +32881,21 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32295
32881
  }
32296
32882
  return _context7.abrupt("continue", 2);
32297
32883
  case 8:
32298
- actArticle = articles[key];
32299
- _context7.next = 11;
32300
- return this.updateCfgValues(actArticle, {}, {});
32884
+ actArticle = articles[key]; // A reload has replaced this instance; updating the dead one loads articles into a detached branch.
32885
+ // An article still running its own after-load init must be skipped too — re-entering it here
32886
+ // restarts its partlist load and never terminates.
32887
+ if (!(actArticle.deleted || actArticle.loadingPartlistChild)) {
32888
+ _context7.next = 11;
32889
+ break;
32890
+ }
32891
+ return _context7.abrupt("continue", 2);
32301
32892
  case 11:
32893
+ _context7.next = 13;
32894
+ return this.updateCfgValues(actArticle, {}, {});
32895
+ case 13:
32302
32896
  _context7.next = 2;
32303
32897
  break;
32304
- case 13:
32898
+ case 15:
32305
32899
  case "end":
32306
32900
  return _context7.stop();
32307
32901
  }
@@ -32884,32 +33478,63 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32884
33478
  return _regeneratorRuntime.wrap(function _callee15$(_context16) {
32885
33479
  while (1) switch (_context16.prev = _context16.next) {
32886
33480
  case 0:
32887
- this.checkPartlistDepth(article, doLoadItem);
32888
- //jeder neue Artikel sollte im Warenkorb als Zubehörartikel gelistet werden - es können auch mehrere sein
32889
- _context16.next = 3;
33481
+ if (this.checkPartlistDepth(article, doLoadItem)) {
33482
+ _context16.next = 2;
33483
+ break;
33484
+ }
33485
+ return _context16.abrupt("return");
33486
+ case 2:
33487
+ _context16.next = 4;
32890
33488
  return this.loadArticle(article.set, doLoadItem.ArticleCodex, this.partlistArticleInitData(article, doLoadItem));
32891
- case 3:
33489
+ case 4:
32892
33490
  nArticle = _context16.sent;
32893
33491
  if (!nArticle) {
32894
- _context16.next = 9;
33492
+ _context16.next = 21;
32895
33493
  break;
32896
33494
  }
32897
33495
  doLoadItem.BasketID = nArticle.basketId;
32898
- _context16.next = 8;
32899
- return this.toDoAfterArticleLoaded(nArticle, {}, nArticle.variantValuesForPla(nArticle.partlistArticleStandalone, (_doLoadItem$VariantVa = doLoadItem.VariantValues) !== null && _doLoadItem$VariantVa !== void 0 ? _doLoadItem$VariantVa : {}, newConfigValues !== null && newConfigValues !== void 0 ? newConfigValues : {}), 'initializingPartlist', doLoadItem.VariantItemData, true);
32900
- case 8:
33496
+
33497
+ // Register the child BEFORE its after-load init: the init evaluates the child's OWN partlist,
33498
+ // and those position gates resolve their condition through the article tree — an unregistered
33499
+ // child is invisible there, so every conditioned grandchild dropped on each parent reload.
33500
+ // The `loadingPartlistChild` flag keeps it out of the set-wide pass in
33501
+ // triggerUpdateOnVisiblePartilstArticles for exactly that window: without it, that pass walks
33502
+ // into the in-flight child, re-evaluates its partlist and re-enters this method — an endless
33503
+ // load loop (both measured 2026-09-03).
32901
33504
  article.addPartlistArticle(nArticle);
32902
- case 9:
33505
+ nArticle.loadingPartlistChild = true;
33506
+ _context16.prev = 9;
33507
+ _context16.next = 12;
33508
+ return this.toDoAfterArticleLoaded(nArticle, {}, nArticle.variantValuesForPla(nArticle.partlistArticleStandalone, (_doLoadItem$VariantVa = doLoadItem.VariantValues) !== null && _doLoadItem$VariantVa !== void 0 ? _doLoadItem$VariantVa : {}, newConfigValues !== null && newConfigValues !== void 0 ? newConfigValues : {}), 'initializingPartlist', doLoadItem.VariantItemData, true);
33509
+ case 12:
33510
+ _context16.next = 18;
33511
+ break;
33512
+ case 14:
33513
+ _context16.prev = 14;
33514
+ _context16.t0 = _context16["catch"](9);
33515
+ // Registered early only for the init's sake — a child whose init failed must not stay in the tree,
33516
+ // where tree evaluation and order lines would pick up its half-initialized state.
33517
+ article.removePartlistArticle(nArticle.basketId);
33518
+ throw _context16.t0;
33519
+ case 18:
33520
+ _context16.prev = 18;
33521
+ nArticle.loadingPartlistChild = false;
33522
+ return _context16.finish(18);
33523
+ case 21:
32903
33524
  case "end":
32904
33525
  return _context16.stop();
32905
33526
  }
32906
- }, _callee15, this);
33527
+ }, _callee15, this, [[9, 14, 18, 21]]);
32907
33528
  }));
32908
33529
  function loadPartlistArticle(_x47, _x48, _x49) {
32909
33530
  return _loadPartlistArticle.apply(this, arguments);
32910
33531
  }
32911
33532
  return loadPartlistArticle;
32912
33533
  }()
33534
+ /**
33535
+ * Whether the child may still be loaded. FALSE means the nesting limit is reached — the caller must stop, because
33536
+ * a cyclic partlist re-enters `loadPartlistArticle` and this is the only thing that ends the recursion.
33537
+ */
32913
33538
  }, {
32914
33539
  key: "checkPartlistDepth",
32915
33540
  value: function checkPartlistDepth(article, doLoadItem) {
@@ -32942,12 +33567,13 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32942
33567
  text: "Aborted loading partlist article \"".concat(doLoadItem.ArticleCodex, "\" because the partlist nesting exceeded the maximum allowed depth of ").concat(PARTLIST_MAX_DEPTH, ". ") + "This usually means an article references itself or an ancestor as a partlist child. " + "Parent article: ".concat(article.articleCodex, ". Ancestor chain: ").concat(ancestorChain.join(' -> '), "."),
32943
33568
  accept: true
32944
33569
  });
32945
- return;
33570
+ return false;
32946
33571
  } else {
32947
33572
  article.set.getSetState.errorHandler(new DivaError('Partlist nesting exceeded the maximum allowed depth – aborting load'));
32948
- return;
33573
+ return false;
32949
33574
  }
32950
33575
  }
33576
+ return true;
32951
33577
  }
32952
33578
  }, {
32953
33579
  key: "collectAncestorChain",
@@ -32990,7 +33616,8 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32990
33616
  partlistGroupPrefix: doLoadItem.partlistGroupPrefix,
32991
33617
  optionsForPrint: doLoadItem.optionsForPrint,
32992
33618
  optionImgForPrint: doLoadItem.optionImgForPrint,
32993
- catalogCodex: doLoadItem.CatalogCodex
33619
+ catalogCodex: doLoadItem.CatalogCodex,
33620
+ PreviousPartlistArticles: doLoadItem.PreviousPartlistArticles
32994
33621
  };
32995
33622
  }
32996
33623
  /**************************************** Querkontrollen über mehrere Article deshalb hier im ArticleHandler ********************************************************************************/
@@ -34561,6 +35188,7 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34561
35188
  } finally {
34562
35189
  _iterator20.f();
34563
35190
  }
35191
+ this.mergeOptionGroupConnectedSteps(myTabGroup, catalog);
34564
35192
  }
34565
35193
  } catch (err) {
34566
35194
  _iterator19.e(err);
@@ -34569,36 +35197,131 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34569
35197
  }
34570
35198
  }
34571
35199
 
34572
- /** Returns the codex of the OPG option a merged option's step was merged into by mergeIDMToOPG, or undefined when it is not merged. */
35200
+ /**
35201
+ * Auto-merges two visible option steps that are CONNECTED VIA IDM OPTION GROUPS, so a
35202
+ * group feature + value feature pair (e.g. Bezugsgruppe + Bezug) collapses into one OPG-style
35203
+ * step without variantenArt pairs or a mergeIDMToOPG property. Connection convention: EVERY
35204
+ * option value codex of the group step is the key of an option group whose members are all
35205
+ * option values of the value step. Steps already merged (explicitly or by variantenArt) are
35206
+ * left untouched, and any ambiguity — a group step matching several value steps, a value step
35207
+ * claimed by several group steps, or a mutual match — suppresses the merge instead of guessing.
35208
+ */
34573
35209
  }, {
34574
- key: "getMergesToOPGParentCodex",
34575
- value: function getMergesToOPGParentCodex(optionCodex) {
34576
- var _iterator22 = _createForOfIteratorHelper$b(this.tabGroups),
35210
+ key: "mergeOptionGroupConnectedSteps",
35211
+ value: function mergeOptionGroupConnectedSteps(myTabGroup, catalog) {
35212
+ var optionGroups = catalog.idmOptionGroups;
35213
+ if (!optionGroups) return;
35214
+ var candidates = [];
35215
+ var _iterator22 = _createForOfIteratorHelper$b(myTabGroup.options),
34577
35216
  _step22;
34578
35217
  try {
34579
35218
  for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
34580
- var _myTabGroup$options$g;
35219
+ var _step$configSteps$val;
34581
35220
  var _step22$value = _slicedToArray(_step22.value, 2),
34582
- myTabGroup = _step22$value[1];
34583
- if (((_myTabGroup$options$g = myTabGroup.options.get(optionCodex)) === null || _myTabGroup$options$g === void 0 ? void 0 : _myTabGroup$options$g.mergesToOPG) !== true) continue;
34584
- var _iterator23 = _createForOfIteratorHelper$b(myTabGroup.options),
35221
+ step = _step22$value[1];
35222
+ if (step.mergesToOPG !== undefined) continue;
35223
+ var ops = (_step$configSteps$val = step.configSteps.values().next().value) === null || _step$configSteps$val === void 0 ? void 0 : _step$configSteps$val.optionstate;
35224
+ // invisible steps only exist in inspect mode — the raw structure stays unmerged there
35225
+ if (!ops || ops.isInvisible) continue;
35226
+ var values = ops.option.articleOptionValues;
35227
+ if (!(values !== null && values !== void 0 && values.size)) continue;
35228
+ candidates.push({
35229
+ step: step,
35230
+ keys: new Set(values.keys())
35231
+ });
35232
+ }
35233
+ } catch (err) {
35234
+ _iterator22.e(err);
35235
+ } finally {
35236
+ _iterator22.f();
35237
+ }
35238
+ var connections = [];
35239
+ var _loop = function _loop() {
35240
+ var candidate = _candidates[_i];
35241
+ var everyOpvIsAGroup = true;
35242
+ var memberKeys = [];
35243
+ var _iterator23 = _createForOfIteratorHelper$b(candidate.keys),
34585
35244
  _step23;
34586
35245
  try {
34587
35246
  for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
34588
- var _step23$value = _slicedToArray(_step23.value, 2),
34589
- myOption = _step23$value[1];
34590
- if (myOption.mergesToOPG === optionCodex) return myOption.codex;
35247
+ var opvCodex = _step23.value;
35248
+ var members = optionGroups[opvCodex];
35249
+ if (!(members !== null && members !== void 0 && members.length)) {
35250
+ everyOpvIsAGroup = false;
35251
+ break;
35252
+ }
35253
+ memberKeys.push.apply(memberKeys, _toConsumableArray(members.map(optionGroupMemberKey)));
34591
35254
  }
34592
35255
  } catch (err) {
34593
35256
  _iterator23.e(err);
34594
35257
  } finally {
34595
35258
  _iterator23.f();
34596
35259
  }
35260
+ if (!everyOpvIsAGroup) return 0; // continue
35261
+ var targets = candidates.filter(function (other) {
35262
+ return other.step !== candidate.step && memberKeys.every(function (key) {
35263
+ return other.keys.has(key);
35264
+ });
35265
+ });
35266
+ if (targets.length !== 1) return 0; // continue
35267
+ connections.push({
35268
+ group: candidate.step,
35269
+ target: targets[0].step
35270
+ });
35271
+ },
35272
+ _ret;
35273
+ for (var _i = 0, _candidates = candidates; _i < _candidates.length; _i++) {
35274
+ _ret = _loop();
35275
+ if (_ret === 0) continue;
35276
+ }
35277
+ var _loop2 = function _loop2() {
35278
+ var connection = _connections[_i2];
35279
+ var claims = connections.filter(function (other) {
35280
+ return other.target === connection.target;
35281
+ });
35282
+ // a step that is group and target at once (chain or mutual match) would overwrite its own merge state
35283
+ var chained = connections.some(function (other) {
35284
+ return other !== connection && (other.group === connection.target || other.target === connection.group);
35285
+ });
35286
+ if (claims.length !== 1 || chained) return 1; // continue
35287
+ connection.group.mergesToOPG = connection.target.codex;
35288
+ connection.target.mergesToOPG = true;
35289
+ };
35290
+ for (var _i2 = 0, _connections = connections; _i2 < _connections.length; _i2++) {
35291
+ if (_loop2()) continue;
35292
+ }
35293
+ }
35294
+
35295
+ /** Returns the codex of the OPG option a merged option's step was merged into by mergeIDMToOPG, or undefined when it is not merged. */
35296
+ }, {
35297
+ key: "getMergesToOPGParentCodex",
35298
+ value: function getMergesToOPGParentCodex(optionCodex) {
35299
+ var _iterator24 = _createForOfIteratorHelper$b(this.tabGroups),
35300
+ _step24;
35301
+ try {
35302
+ for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
35303
+ var _myTabGroup$options$g;
35304
+ var _step24$value = _slicedToArray(_step24.value, 2),
35305
+ myTabGroup = _step24$value[1];
35306
+ if (((_myTabGroup$options$g = myTabGroup.options.get(optionCodex)) === null || _myTabGroup$options$g === void 0 ? void 0 : _myTabGroup$options$g.mergesToOPG) !== true) continue;
35307
+ var _iterator25 = _createForOfIteratorHelper$b(myTabGroup.options),
35308
+ _step25;
35309
+ try {
35310
+ for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
35311
+ var _step25$value = _slicedToArray(_step25.value, 2),
35312
+ myOption = _step25$value[1];
35313
+ if (myOption.mergesToOPG === optionCodex) return myOption.codex;
35314
+ }
35315
+ } catch (err) {
35316
+ _iterator25.e(err);
35317
+ } finally {
35318
+ _iterator25.f();
35319
+ }
34597
35320
  }
34598
35321
  } catch (err) {
34599
- _iterator22.e(err);
35322
+ _iterator24.e(err);
34600
35323
  } finally {
34601
- _iterator22.f();
35324
+ _iterator24.f();
34602
35325
  }
34603
35326
  return undefined;
34604
35327
  }
@@ -34607,20 +35330,20 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34607
35330
  value: function getOptionWhereIDMVariantIs(tabKey, variant) {
34608
35331
  var myTabGroup = this.tabGroups.get(tabKey);
34609
35332
  if (!myTabGroup) return false;
34610
- var _iterator24 = _createForOfIteratorHelper$b(myTabGroup.options),
34611
- _step24;
35333
+ var _iterator26 = _createForOfIteratorHelper$b(myTabGroup.options),
35334
+ _step26;
34612
35335
  try {
34613
- for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
34614
- var _step24$value = _slicedToArray(_step24.value, 2),
34615
- option = _step24$value[1];
35336
+ for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {
35337
+ var _step26$value = _slicedToArray(_step26.value, 2),
35338
+ option = _step26$value[1];
34616
35339
  if (option.idmVariantType == variant) {
34617
35340
  return option;
34618
35341
  }
34619
35342
  }
34620
35343
  } catch (err) {
34621
- _iterator24.e(err);
35344
+ _iterator26.e(err);
34622
35345
  } finally {
34623
- _iterator24.f();
35346
+ _iterator26.f();
34624
35347
  }
34625
35348
  return false;
34626
35349
  }
@@ -34629,13 +35352,13 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34629
35352
  value: function sortConfigStepsInConfigTree(targetArticlesSorted) {
34630
35353
  var configStepCounter = 1;
34631
35354
  var configStepKeysPos = {};
34632
- var _iterator25 = _createForOfIteratorHelper$b(this.tabGroups),
34633
- _step25;
35355
+ var _iterator27 = _createForOfIteratorHelper$b(this.tabGroups),
35356
+ _step27;
34634
35357
  try {
34635
- for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
34636
- var _step25$value = _slicedToArray(_step25.value, 2),
34637
- iKey = _step25$value[0],
34638
- myTabGroup = _step25$value[1];
35358
+ for (_iterator27.s(); !(_step27 = _iterator27.n()).done;) {
35359
+ var _step27$value = _slicedToArray(_step27.value, 2),
35360
+ iKey = _step27$value[0],
35361
+ myTabGroup = _step27$value[1];
34639
35362
  var tabSingleOPVOnly = true;
34640
35363
  var tabhidden = true;
34641
35364
  if (iKey == 'Summary') {
@@ -34659,18 +35382,18 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34659
35382
  } else {
34660
35383
  var articlesInTabGroup = this.getTargetArticlesInTabGroup(myTabGroup, targetArticlesSorted);
34661
35384
  for (var i = 0; i < articlesInTabGroup.length; i++) {
34662
- var _iterator26 = _createForOfIteratorHelper$b(myTabGroup.options),
34663
- _step26;
35385
+ var _iterator28 = _createForOfIteratorHelper$b(myTabGroup.options),
35386
+ _step28;
34664
35387
  try {
34665
- for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {
34666
- var _step26$value = _slicedToArray(_step26.value, 2),
34667
- myOption = _step26$value[1];
34668
- var _iterator27 = _createForOfIteratorHelper$b(myOption.configSteps),
34669
- _step27;
35388
+ for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) {
35389
+ var _step28$value = _slicedToArray(_step28.value, 2),
35390
+ myOption = _step28$value[1];
35391
+ var _iterator29 = _createForOfIteratorHelper$b(myOption.configSteps),
35392
+ _step29;
34670
35393
  try {
34671
- for (_iterator27.s(); !(_step27 = _iterator27.n()).done;) {
34672
- var _step27$value = _slicedToArray(_step27.value, 2),
34673
- myConfigStep = _step27$value[1];
35394
+ for (_iterator29.s(); !(_step29 = _iterator29.n()).done;) {
35395
+ var _step29$value = _slicedToArray(_step29.value, 2),
35396
+ myConfigStep = _step29$value[1];
34674
35397
  if (!myConfigStep.singleOPVOnly) {
34675
35398
  tabSingleOPVOnly = false;
34676
35399
  }
@@ -34683,24 +35406,24 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34683
35406
  configStepCounter++;
34684
35407
  if (myConfigStep.key.startsWith('SHELFARTICLE_')) {
34685
35408
  var steps = this.getChildsOfShelfStep(myTabGroup, myConfigStep.key);
34686
- for (var _i = 0; _i < steps.length; _i++) {
34687
- steps[_i].posNr = configStepCounter;
34688
- configStepKeysPos[steps[_i].key] = configStepCounter;
35409
+ for (var _i3 = 0; _i3 < steps.length; _i3++) {
35410
+ steps[_i3].posNr = configStepCounter;
35411
+ configStepKeysPos[steps[_i3].key] = configStepCounter;
34689
35412
  configStepCounter++;
34690
35413
  }
34691
35414
  }
34692
35415
  }
34693
35416
  }
34694
35417
  } catch (err) {
34695
- _iterator27.e(err);
35418
+ _iterator29.e(err);
34696
35419
  } finally {
34697
- _iterator27.f();
35420
+ _iterator29.f();
34698
35421
  }
34699
35422
  }
34700
35423
  } catch (err) {
34701
- _iterator26.e(err);
35424
+ _iterator28.e(err);
34702
35425
  } finally {
34703
- _iterator26.f();
35426
+ _iterator28.f();
34704
35427
  }
34705
35428
  }
34706
35429
  if (tabSingleOPVOnly) {
@@ -34712,41 +35435,41 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34712
35435
  }
34713
35436
  }
34714
35437
  } catch (err) {
34715
- _iterator25.e(err);
35438
+ _iterator27.e(err);
34716
35439
  } finally {
34717
- _iterator25.f();
35440
+ _iterator27.f();
34718
35441
  }
34719
35442
  }
34720
35443
  }, {
34721
35444
  key: "getChildsOfShelfStep",
34722
35445
  value: function getChildsOfShelfStep(tabGroup, shelfId) {
34723
35446
  var ret = [];
34724
- var _iterator28 = _createForOfIteratorHelper$b(tabGroup.options),
34725
- _step28;
35447
+ var _iterator30 = _createForOfIteratorHelper$b(tabGroup.options),
35448
+ _step30;
34726
35449
  try {
34727
- for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) {
34728
- var _step28$value = _slicedToArray(_step28.value, 2),
34729
- option = _step28$value[1];
34730
- var _iterator29 = _createForOfIteratorHelper$b(option.configSteps),
34731
- _step29;
35450
+ for (_iterator30.s(); !(_step30 = _iterator30.n()).done;) {
35451
+ var _step30$value = _slicedToArray(_step30.value, 2),
35452
+ option = _step30$value[1];
35453
+ var _iterator31 = _createForOfIteratorHelper$b(option.configSteps),
35454
+ _step31;
34732
35455
  try {
34733
- for (_iterator29.s(); !(_step29 = _iterator29.n()).done;) {
34734
- var _step29$value = _slicedToArray(_step29.value, 2),
34735
- configStep = _step29$value[1];
35456
+ for (_iterator31.s(); !(_step31 = _iterator31.n()).done;) {
35457
+ var _step31$value = _slicedToArray(_step31.value, 2),
35458
+ configStep = _step31$value[1];
34736
35459
  if (configStep.parentShelfId == shelfId) {
34737
35460
  ret.push(configStep);
34738
35461
  }
34739
35462
  }
34740
35463
  } catch (err) {
34741
- _iterator29.e(err);
35464
+ _iterator31.e(err);
34742
35465
  } finally {
34743
- _iterator29.f();
35466
+ _iterator31.f();
34744
35467
  }
34745
35468
  }
34746
35469
  } catch (err) {
34747
- _iterator28.e(err);
35470
+ _iterator30.e(err);
34748
35471
  } finally {
34749
- _iterator28.f();
35472
+ _iterator30.f();
34750
35473
  }
34751
35474
  return ret;
34752
35475
  }
@@ -34756,12 +35479,12 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34756
35479
  if (catalogData.hasAlternateRenderings) {
34757
35480
  for (var i = 0; i < catalogData.alternateRenderings.length; i++) {
34758
35481
  var onOptions = catalogData.alternateRenderings[i].onOptions;
34759
- var _iterator30 = _createForOfIteratorHelper$b(this.tabGroups),
34760
- _step30;
35482
+ var _iterator32 = _createForOfIteratorHelper$b(this.tabGroups),
35483
+ _step32;
34761
35484
  try {
34762
- var _loop = function _loop() {
34763
- var _step30$value = _slicedToArray(_step30.value, 2),
34764
- tabGroup = _step30$value[1];
35485
+ var _loop3 = function _loop3() {
35486
+ var _step32$value = _slicedToArray(_step32.value, 2),
35487
+ tabGroup = _step32$value[1];
34765
35488
  var matched = onOptions.some(function (onOption) {
34766
35489
  return onOption.startsWith('SHELFARTICLE_') ? _toConsumableArray(tabGroup.options.keys()).some(function (key) {
34767
35490
  return key.startsWith(onOption);
@@ -34771,13 +35494,13 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34771
35494
  tabGroup.alternateRenderings.push(catalogData.alternateRenderings[i]);
34772
35495
  }
34773
35496
  };
34774
- for (_iterator30.s(); !(_step30 = _iterator30.n()).done;) {
34775
- _loop();
35497
+ for (_iterator32.s(); !(_step32 = _iterator32.n()).done;) {
35498
+ _loop3();
34776
35499
  }
34777
35500
  } catch (err) {
34778
- _iterator30.e(err);
35501
+ _iterator32.e(err);
34779
35502
  } finally {
34780
- _iterator30.f();
35503
+ _iterator32.f();
34781
35504
  }
34782
35505
  }
34783
35506
  }
@@ -34786,30 +35509,30 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34786
35509
  key: "getTargetArticlesInTabGroup",
34787
35510
  value: function getTargetArticlesInTabGroup(myTabGroup, allTargetArticlesSorted) {
34788
35511
  var articlesInTabGroup = [];
34789
- var _iterator31 = _createForOfIteratorHelper$b(myTabGroup.options),
34790
- _step31;
35512
+ var _iterator33 = _createForOfIteratorHelper$b(myTabGroup.options),
35513
+ _step33;
34791
35514
  try {
34792
- for (_iterator31.s(); !(_step31 = _iterator31.n()).done;) {
34793
- var _step31$value = _slicedToArray(_step31.value, 2),
34794
- myOption = _step31$value[1];
34795
- var _iterator32 = _createForOfIteratorHelper$b(myOption.configSteps),
34796
- _step32;
35515
+ for (_iterator33.s(); !(_step33 = _iterator33.n()).done;) {
35516
+ var _step33$value = _slicedToArray(_step33.value, 2),
35517
+ myOption = _step33$value[1];
35518
+ var _iterator34 = _createForOfIteratorHelper$b(myOption.configSteps),
35519
+ _step34;
34797
35520
  try {
34798
- for (_iterator32.s(); !(_step32 = _iterator32.n()).done;) {
34799
- var _step32$value = _slicedToArray(_step32.value, 2),
34800
- configStep = _step32$value[1];
35521
+ for (_iterator34.s(); !(_step34 = _iterator34.n()).done;) {
35522
+ var _step34$value = _slicedToArray(_step34.value, 2),
35523
+ configStep = _step34$value[1];
34801
35524
  articlesInTabGroup = articlesInTabGroup.concat(configStep.targetArticles);
34802
35525
  }
34803
35526
  } catch (err) {
34804
- _iterator32.e(err);
35527
+ _iterator34.e(err);
34805
35528
  } finally {
34806
- _iterator32.f();
35529
+ _iterator34.f();
34807
35530
  }
34808
35531
  }
34809
35532
  } catch (err) {
34810
- _iterator31.e(err);
35533
+ _iterator33.e(err);
34811
35534
  } finally {
34812
- _iterator31.f();
35535
+ _iterator33.f();
34813
35536
  }
34814
35537
  var basketIds = _toConsumableArray(new Set(articlesInTabGroup));
34815
35538
  var basketIdsSorted = [];
@@ -34827,44 +35550,44 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34827
35550
  key: "getConfigStepKeyOfAccessoire",
34828
35551
  value: function getConfigStepKeyOfAccessoire(articleCodex, targetArticle) {
34829
35552
  var configStepKeys = [];
34830
- var _iterator33 = _createForOfIteratorHelper$b(this.tabGroups),
34831
- _step33;
35553
+ var _iterator35 = _createForOfIteratorHelper$b(this.tabGroups),
35554
+ _step35;
34832
35555
  try {
34833
- for (_iterator33.s(); !(_step33 = _iterator33.n()).done;) {
34834
- var _step33$value = _slicedToArray(_step33.value, 2),
34835
- tabGroup = _step33$value[1];
34836
- var _iterator34 = _createForOfIteratorHelper$b(tabGroup.options),
34837
- _step34;
35556
+ for (_iterator35.s(); !(_step35 = _iterator35.n()).done;) {
35557
+ var _step35$value = _slicedToArray(_step35.value, 2),
35558
+ tabGroup = _step35$value[1];
35559
+ var _iterator36 = _createForOfIteratorHelper$b(tabGroup.options),
35560
+ _step36;
34838
35561
  try {
34839
- for (_iterator34.s(); !(_step34 = _iterator34.n()).done;) {
34840
- var _step34$value = _slicedToArray(_step34.value, 2),
34841
- option = _step34$value[1];
34842
- var _iterator35 = _createForOfIteratorHelper$b(option.configSteps),
34843
- _step35;
35562
+ for (_iterator36.s(); !(_step36 = _iterator36.n()).done;) {
35563
+ var _step36$value = _slicedToArray(_step36.value, 2),
35564
+ option = _step36$value[1];
35565
+ var _iterator37 = _createForOfIteratorHelper$b(option.configSteps),
35566
+ _step37;
34844
35567
  try {
34845
- for (_iterator35.s(); !(_step35 = _iterator35.n()).done;) {
34846
- var _step35$value = _slicedToArray(_step35.value, 2),
34847
- configStep = _step35$value[1];
35568
+ for (_iterator37.s(); !(_step37 = _iterator37.n()).done;) {
35569
+ var _step37$value = _slicedToArray(_step37.value, 2),
35570
+ configStep = _step37$value[1];
34848
35571
  if (configStep.accessoireArticleCodex == articleCodex && configStep.targetArticles.includes(targetArticle)) {
34849
35572
  configStepKeys.push(configStep.key);
34850
35573
  }
34851
35574
  }
34852
35575
  } catch (err) {
34853
- _iterator35.e(err);
35576
+ _iterator37.e(err);
34854
35577
  } finally {
34855
- _iterator35.f();
35578
+ _iterator37.f();
34856
35579
  }
34857
35580
  }
34858
35581
  } catch (err) {
34859
- _iterator34.e(err);
35582
+ _iterator36.e(err);
34860
35583
  } finally {
34861
- _iterator34.f();
35584
+ _iterator36.f();
34862
35585
  }
34863
35586
  }
34864
35587
  } catch (err) {
34865
- _iterator33.e(err);
35588
+ _iterator35.e(err);
34866
35589
  } finally {
34867
- _iterator33.f();
35590
+ _iterator35.f();
34868
35591
  }
34869
35592
  return configStepKeys;
34870
35593
  }
@@ -34889,12 +35612,12 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34889
35612
  }, {
34890
35613
  key: "getFirstConfigStepKey",
34891
35614
  value: function getFirstConfigStepKey() {
34892
- var _iterator36 = _createForOfIteratorHelper$b(this.tabGroups),
34893
- _step36;
35615
+ var _iterator38 = _createForOfIteratorHelper$b(this.tabGroups),
35616
+ _step38;
34894
35617
  try {
34895
- for (_iterator36.s(); !(_step36 = _iterator36.n()).done;) {
34896
- var _step36$value = _slicedToArray(_step36.value, 2),
34897
- tabGroup = _step36$value[1];
35618
+ for (_iterator38.s(); !(_step38 = _iterator38.n()).done;) {
35619
+ var _step38$value = _slicedToArray(_step38.value, 2),
35620
+ tabGroup = _step38$value[1];
34898
35621
  if (['ACC', 'OPTION', 'ACC_PLANNER'].includes(tabGroup.type)) {
34899
35622
  var firstOption = tabGroup.options.values().next().value;
34900
35623
  var firstConfigStep = firstOption === null || firstOption === void 0 ? void 0 : firstOption.configSteps.values().next().value;
@@ -34902,9 +35625,9 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34902
35625
  }
34903
35626
  }
34904
35627
  } catch (err) {
34905
- _iterator36.e(err);
35628
+ _iterator38.e(err);
34906
35629
  } finally {
34907
- _iterator36.f();
35630
+ _iterator38.f();
34908
35631
  }
34909
35632
  return undefined;
34910
35633
  }
@@ -36543,17 +37266,42 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
36543
37266
  }();
36544
37267
  var favoritesHandlerInstance = new DivaFavoritesHandler();
36545
37268
 
36546
- 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; }
36547
- 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; }
36548
37269
  function _createForOfIteratorHelper$9(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$9(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; } } }; }
36549
37270
  function _unsupportedIterableToArray$9(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$9(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$9(r, a) : void 0; } }
36550
37271
  function _arrayLikeToArray$9(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; }
37272
+ 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; }
37273
+ 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; }
36551
37274
 
36552
37275
  //Diese Klasse beinhaltet die Logik wie eine aktuelle Konfiguration mit allen möglicheen Ausprägungen mit Preisen in einem Set aussieht.
36553
37276
  //Der in einem Set gemergte Optionsbaum
36554
37277
  //er ist die logik welche sich beim alten Code im oberen Teil vom plArticleConfigWeb befindet
36555
37278
  //dort ist es die Funktionen: InitSetConfigOptionsData -> bauen des Configbaums
36556
37279
  var LOG$c = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
37280
+ /**
37281
+ * The article a config STEP belongs to: a partlist child that shows its options in the MAIN tree contributes
37282
+ * them to its PARENT's step, everything else stands for itself. Returns the parent OBJECT — never a lookup in
37283
+ * the caller's `articles` map, which holds only VISIBLE articles (an invisible shell with visible children is
37284
+ * not a key of it); a child whose parent is missing falls back to itself.
37285
+ */
37286
+ function resolveStepArticle(article) {
37287
+ var _ref;
37288
+ return (_ref = article.partlistArticleVisibleInTree ? article.partListParentArticle : undefined) !== null && _ref !== void 0 ? _ref : article;
37289
+ }
37290
+
37291
+ /**
37292
+ * `articles` plus every step article one of its members resolves to. A config step's `targetArticles` carry the
37293
+ * basketId of `resolveStepArticle`, which may be an INVISIBLE parent the visible map does not hold — code that
37294
+ * looks target articles up by basketId needs this map, code that iterates the visible articles does not.
37295
+ */
37296
+ function withStepArticles(articles) {
37297
+ var extended = _objectSpread$f({}, articles);
37298
+ for (var _i = 0, _Object$values = Object.values(articles); _i < _Object$values.length; _i++) {
37299
+ var article = _Object$values[_i];
37300
+ var stepArticle = resolveStepArticle(article);
37301
+ if (!extended[stepArticle.basketId]) extended[stepArticle.basketId] = stepArticle;
37302
+ }
37303
+ return extended;
37304
+ }
36557
37305
  var DivaConfigTreeHandler = /*#__PURE__*/function () {
36558
37306
  function DivaConfigTreeHandler() {
36559
37307
  _classCallCheck(this, DivaConfigTreeHandler);
@@ -36869,9 +37617,10 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
36869
37617
  }, {
36870
37618
  key: "addOptionsStateToConfigTree",
36871
37619
  value: function addOptionsStateToConfigTree(set, configTree, articles, b, ops, optionCodex, selectionmode, visible, addToTabGroup) {
36872
- var _article$partListPare, _set$ViewConfig4;
37620
+ var _set$ViewConfig4;
36873
37621
  var article = articles[b];
36874
- var basketId = article.partlistArticleVisibleInTree ? (_article$partListPare = article.partListParentArticle) === null || _article$partListPare === void 0 ? void 0 : _article$partListPare.basketId : article.basketId;
37622
+ var stepArticle = resolveStepArticle(article);
37623
+ var basketId = stepArticle.basketId;
36875
37624
  var tabGroupCodex;
36876
37625
  var tabGroupTitel;
36877
37626
  if (ops.optionTabGroup) {
@@ -36909,7 +37658,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
36909
37658
  }
36910
37659
  configStepKey = configStepKey + '_' + 'acc' + (set.CatalogData.forceConfigAllAccessoires ? article.articleCodex : basketId);
36911
37660
  }
36912
- var plaBasketIds = Object.keys(articles[basketId].getRecursivePartlistArticles(true, true));
37661
+ var plaBasketIds = Object.keys(stepArticle.getRecursivePartlistArticles(true, true));
36913
37662
  var singleOPVOnly = ops.visibleCount == 1 && !ops.isFreeText && !set.CatalogData.dontHideOption.includes(ops.option.codex) && !((_set$ViewConfig4 = set.ViewConfig) !== null && _set$ViewConfig4 !== void 0 && _set$ViewConfig4.showSingleOPVOnly);
36914
37663
  var isAccessoire = isRelatedAccessoire ? article.articleCodex : false;
36915
37664
  if (!configTree.getTabGroupByCodex(tabGroupCodex)) {
@@ -37163,44 +37912,44 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37163
37912
  key: "getConifgItemsForView",
37164
37913
  value: function () {
37165
37914
  var _getConifgItemsForView = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(set, configStepKey) {
37166
- var articles, step, retValues, optionCodex, configItems, selectedItems, optionState, _iterator12, _step12, _configItem$parent$oc, key, configItem, configItemsInOPG, retVal, _retVal, clonedSet, clonedArticles, configStepOPG, configStepOPV, targetArticle, opg, ops, selectedOpv, originalVariantValues, mergedOptionOnPartlistArticle, useFastPath, fastPathValidated, variantValues, _iterator13, _step13, _clonedSet$favorites$, _clonedSet$favorites, _step13$value, opgValue, alreadyCalcedVisibleOPVs, _loop5, _i, _targetArticle$engine, _targetArticle$engine2, _ops$optionOcd2, visibleOptionValues, updatedOps, fastPathKeys, fullKeys, _retVal2, clonedConfigItemsForView, _loop4, i;
37167
- return _regeneratorRuntime.wrap(function _callee$(_context3) {
37168
- while (1) switch (_context3.prev = _context3.next) {
37915
+ var articles, step, retValues, optionCodex, configItems, selectedItems, optionState, _iterator12, _step12, _configItem$parent$oc, key, configItem, configItemsInOPG, retVal, _retVal, configStepOPG, configStepOPV, staticItems;
37916
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
37917
+ while (1) switch (_context.prev = _context.next) {
37169
37918
  case 0:
37170
- articles = set.getDivaArticles(true);
37919
+ articles = withStepArticles(set.getDivaArticles(true));
37171
37920
  step = set.configTree.getAllByKey(configStepKey);
37172
37921
  retValues = this.getConfigItems(configStepKey, articles, set.configTree);
37173
37922
  optionCodex = undefined;
37174
37923
  if (!(retValues && step != null)) {
37175
- _context3.next = 111;
37924
+ _context.next = 55;
37176
37925
  break;
37177
37926
  }
37178
37927
  configItems = [];
37179
37928
  selectedItems = retValues.selectedVals;
37180
37929
  optionState = articles[retValues.targetArticles[0]].getArticleOptionState(retValues.optionCodex);
37181
37930
  if (optionState) {
37182
- _context3.next = 10;
37931
+ _context.next = 10;
37183
37932
  break;
37184
37933
  }
37185
37934
  throw new Error('myOptionState ' + retValues.optionCodex + ' is undefined');
37186
37935
  case 10:
37187
37936
  optionCodex = optionState.optionCodex;
37188
37937
  if (!retValues.isOPG) {
37189
- _context3.next = 36;
37938
+ _context.next = 36;
37190
37939
  break;
37191
37940
  }
37192
37941
  _iterator12 = _createForOfIteratorHelper$9(retValues.configItems.keys());
37193
- _context3.prev = 13;
37942
+ _context.prev = 13;
37194
37943
  _iterator12.s();
37195
37944
  case 15:
37196
37945
  if ((_step12 = _iterator12.n()).done) {
37197
- _context3.next = 26;
37946
+ _context.next = 26;
37198
37947
  break;
37199
37948
  }
37200
37949
  key = _step12.value;
37201
37950
  configItem = retValues.configItems.get(key);
37202
37951
  if (configItem) {
37203
- _context3.next = 20;
37952
+ _context.next = 20;
37204
37953
  break;
37205
37954
  }
37206
37955
  throw new Error('configItem ' + key + ' not found in retValues.configItems');
@@ -37218,132 +37967,318 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37218
37967
  });
37219
37968
  }
37220
37969
  case 24:
37221
- _context3.next = 15;
37970
+ _context.next = 15;
37222
37971
  break;
37223
37972
  case 26:
37224
- _context3.next = 31;
37973
+ _context.next = 31;
37225
37974
  break;
37226
37975
  case 28:
37227
- _context3.prev = 28;
37228
- _context3.t0 = _context3["catch"](13);
37229
- _iterator12.e(_context3.t0);
37976
+ _context.prev = 28;
37977
+ _context.t0 = _context["catch"](13);
37978
+ _iterator12.e(_context.t0);
37230
37979
  case 31:
37231
- _context3.prev = 31;
37980
+ _context.prev = 31;
37232
37981
  _iterator12.f();
37233
- return _context3.finish(31);
37982
+ return _context.finish(31);
37234
37983
  case 34:
37235
- _context3.next = 108;
37984
+ _context.next = 52;
37236
37985
  break;
37237
37986
  case 36:
37238
37987
  if (!(step.optionStep.mergesToOPG == undefined)) {
37239
- _context3.next = 41;
37988
+ _context.next = 41;
37240
37989
  break;
37241
37990
  }
37242
- _retVal = this.prepareConfigItemsForView(set, optionState, retValues.configItems, retValues.constructionRules, selectedItems, step.configStep.targetArticles, undefined, undefined, undefined, undefined, retValues.freeTextValue, retValues.freeTextLang);
37991
+ _retVal = this.prepareConfigItemsForView(set, optionState, retValues.configItems, retValues.constructionRules, selectedItems, step.configStep.targetArticles, undefined, undefined, undefined, undefined, undefined, retValues.freeTextValue, retValues.freeTextLang);
37243
37992
  configItems = _retVal.myConfigItemsForView;
37244
- _context3.next = 108;
37993
+ _context.next = 52;
37245
37994
  break;
37246
37995
  case 41:
37247
37996
  if (!(typeof step.optionStep.mergesToOPG == 'string' && step.tabGroup.options.has(step.optionStep.mergesToOPG))) {
37248
- _context3.next = 108;
37997
+ _context.next = 52;
37249
37998
  break;
37250
37999
  }
37251
- clonedSet = set.cloneSet();
37252
- clonedArticles = clonedSet.getDivaArticles(true); //IDM Bezugschritte werden zusammengefasst zu OPG und OPV
38000
+ //IDM Bezugschritte werden zusammengefasst zu OPG und OPV
37253
38001
  configStepOPG = step.configStep, configStepOPV = set.configTree.getConfigStepBasketIdAndOptionCodex(configStepOPG.targetArticles[0], step.optionStep.mergesToOPG); //falls mehrere Artikel im Schritt sind werden trotzdem nur die Values des erster verwendet um die z.B. OPT2 und OPT3 zu vereinen
37254
38002
  if (!configStepOPV) {
37255
- _context3.next = 108;
38003
+ _context.next = 52;
38004
+ break;
38005
+ }
38006
+ // Two-group-families standard: pools come from the type-1 decision rows alone — no clone, no reconfiguration per group.
38007
+ staticItems = this.mergeOPGItemsFromDecisionRows(set, articles, configStepOPG, configStepOPV, optionState, retValues.constructionRules, selectedItems);
38008
+ if (!staticItems) {
38009
+ _context.next = 49;
38010
+ break;
38011
+ }
38012
+ configItems = staticItems;
38013
+ _context.next = 52;
38014
+ break;
38015
+ case 49:
38016
+ _context.next = 51;
38017
+ return this.mergeOPGItemsByReconfiguration(set, step, configStepOPG, configStepOPV, optionState, retValues.constructionRules, selectedItems);
38018
+ case 51:
38019
+ configItems = _context.sent;
38020
+ case 52:
38021
+ return _context.abrupt("return", {
38022
+ configItems: configItems,
38023
+ option: optionCodex ? optionState.option : undefined,
38024
+ selectedItems: selectedItems.map(function (sel) {
38025
+ return configItems.find(function (c) {
38026
+ return c.codex === sel;
38027
+ });
38028
+ }),
38029
+ notTotallyMatichingOPVs: !set.CatalogData.articleConfigAll ? retValues.notTotallyMatichingOPVs : undefined
38030
+ });
38031
+ case 55:
38032
+ return _context.abrupt("return", {
38033
+ configItems: [],
38034
+ selectedItems: []
38035
+ });
38036
+ case 56:
38037
+ case "end":
38038
+ return _context.stop();
38039
+ }
38040
+ }, _callee, this, [[13, 28, 31, 34]]);
38041
+ }));
38042
+ function getConifgItemsForView(_x, _x2) {
38043
+ return _getConifgItemsForView.apply(this, arguments);
38044
+ }
38045
+ return getConifgItemsForView;
38046
+ }()
38047
+ /**
38048
+ * The dropdown headers of a merged OPG step: when an INVISIBLE second group family spans the same value
38049
+ * feature via option groups, every visible group maps to the parent whose option group contains all its
38050
+ * members (the parent OPV's name becomes parentName). Undefined when no such family exists; an ambiguous
38051
+ * group gets no header rather than a wrong one.
38052
+ */
38053
+ }, {
38054
+ key: "idmOpgParentNames",
38055
+ value: function idmOpgParentNames(targetArticle, opg, ops) {
38056
+ var optionGroups = targetArticle.CatalogData.idmOptionGroups;
38057
+ if (!optionGroups) return undefined;
38058
+ var valueKeys = new Set(ops.option.articleOptionValues.keys());
38059
+ var _iterator13 = _createForOfIteratorHelper$9(targetArticle.articleOptionStates.values()),
38060
+ _step13;
38061
+ try {
38062
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
38063
+ var state = _step13.value;
38064
+ if (state.optionCodex === opg.optionCodex || state.optionCodex === ops.optionCodex || !state.isInvisible) continue;
38065
+ var parentValues = state.option.articleOptionValues;
38066
+ if (!(parentValues !== null && parentValues !== void 0 && parentValues.size)) continue;
38067
+
38068
+ // a parent family: EVERY option value of the invisible feature is an option group over the value feature
38069
+ var parentMembers = new Map();
38070
+ var isFamily = true;
38071
+ var _iterator14 = _createForOfIteratorHelper$9(parentValues.keys()),
38072
+ _step14;
38073
+ try {
38074
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
38075
+ var _optionGroups$parentC;
38076
+ var parentCodex = _step14.value;
38077
+ var members = (_optionGroups$parentC = optionGroups[parentCodex]) === null || _optionGroups$parentC === void 0 ? void 0 : _optionGroups$parentC.map(optionGroupMemberKey);
38078
+ if (!(members !== null && members !== void 0 && members.length) || !members.every(function (key) {
38079
+ return valueKeys.has(key);
38080
+ })) {
38081
+ isFamily = false;
37256
38082
  break;
37257
38083
  }
38084
+ parentMembers.set(parentCodex, new Set(members));
38085
+ }
38086
+ } catch (err) {
38087
+ _iterator14.e(err);
38088
+ } finally {
38089
+ _iterator14.f();
38090
+ }
38091
+ if (!isFamily) continue;
38092
+ var parentNames = new Map();
38093
+ var _iterator15 = _createForOfIteratorHelper$9(opg.visibleOptionValues),
38094
+ _step15;
38095
+ try {
38096
+ var _loop4 = function _loop4() {
38097
+ var _optionGroups$opgValu, _parentValues$get;
38098
+ var _step15$value = _slicedToArray(_step15.value, 2),
38099
+ opgValue = _step15$value[1];
38100
+ var groupMembers = (_optionGroups$opgValu = optionGroups[opgValue.codex]) === null || _optionGroups$opgValu === void 0 ? void 0 : _optionGroups$opgValu.map(optionGroupMemberKey);
38101
+ if (!(groupMembers !== null && groupMembers !== void 0 && groupMembers.length)) return 0; // continue
38102
+ var parent = _toConsumableArray(parentMembers.entries()).find(function (_ref2) {
38103
+ var _ref3 = _slicedToArray(_ref2, 2),
38104
+ memberSet = _ref3[1];
38105
+ return groupMembers.every(function (key) {
38106
+ return memberSet.has(key);
38107
+ });
38108
+ });
38109
+ if (!parent) return 0; // continue
38110
+ var parentName = (_parentValues$get = parentValues.get(parent[0])) === null || _parentValues$get === void 0 ? void 0 : _parentValues$get.name;
38111
+ if (parentName) parentNames.set(opgValue.codex, parentName);
38112
+ },
38113
+ _ret;
38114
+ for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
38115
+ _ret = _loop4();
38116
+ if (_ret === 0) continue;
38117
+ }
38118
+ } catch (err) {
38119
+ _iterator15.e(err);
38120
+ } finally {
38121
+ _iterator15.f();
38122
+ }
38123
+ if (parentNames.size) return parentNames;
38124
+ }
38125
+ } catch (err) {
38126
+ _iterator13.e(err);
38127
+ } finally {
38128
+ _iterator13.f();
38129
+ }
38130
+ return undefined;
38131
+ }
38132
+
38133
+ /**
38134
+ * Merged-OPG view via the static decision-row path — a read-only lookup on the original set. Undefined as
38135
+ * soon as one pool is not statically derivable; the caller then falls back to the clone-based flow.
38136
+ */
38137
+ }, {
38138
+ key: "mergeOPGItemsFromDecisionRows",
38139
+ value: function mergeOPGItemsFromDecisionRows(set, articles, configStepOPG, configStepOPV, optionState, constructionRules, selectedItems) {
38140
+ var targetArticle = articles[configStepOPG.targetArticles[0]];
38141
+ var opg = targetArticle === null || targetArticle === void 0 ? void 0 : targetArticle.getArticleOptionState(configStepOPG.option);
38142
+ var ops = targetArticle === null || targetArticle === void 0 ? void 0 : targetArticle.getArticleOptionState(configStepOPV.option);
38143
+ if (!opg || !ops) return undefined;
38144
+ var parentNames = this.idmOpgParentNames(targetArticle, opg, ops);
38145
+ var configItems = [];
38146
+ var _iterator16 = _createForOfIteratorHelper$9(opg.visibleOptionValues),
38147
+ _step16;
38148
+ try {
38149
+ for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
38150
+ var _targetArticle$engine, _targetArticle$engine2, _ops$optionOcd2;
38151
+ var _step16$value = _slicedToArray(_step16.value, 2),
38152
+ opgValue = _step16$value[1];
38153
+ var pool = (_targetArticle$engine = (_targetArticle$engine2 = targetArticle.engine).staticVisibleOptionValuesForFeature) === null || _targetArticle$engine === void 0 ? void 0 : _targetArticle$engine.call(_targetArticle$engine2, ops.optionCodex, opg.optionCodex, opgValue.codex);
38154
+ if (!pool) return undefined;
38155
+ var retVal = this.prepareConfigItemsForView(set, optionState, pool, constructionRules, [], configStepOPG.targetArticles, (_ops$optionOcd2 = ops.optionOcd) !== null && _ops$optionOcd2 !== void 0 ? _ops$optionOcd2 : ops.optionCodex, opgValue.name, opgValue.codex, opg.optionCodex, parentNames === null || parentNames === void 0 ? void 0 : parentNames.get(opgValue.codex));
38156
+ configItems = configItems.concat(retVal.myConfigItemsForView);
38157
+ }
38158
+ } catch (err) {
38159
+ _iterator16.e(err);
38160
+ } finally {
38161
+ _iterator16.f();
38162
+ }
38163
+ var _loop5 = function _loop5() {
38164
+ var _articles$configStepO;
38165
+ var valCodex = (_articles$configStepO = articles[configStepOPG.targetArticles[i]]) === null || _articles$configStepO === void 0 || (_articles$configStepO = _articles$configStepO.getArticleOptionState(configStepOPV.option)) === null || _articles$configStepO === void 0 ? void 0 : _articles$configStepO.valCodex;
38166
+ var sel = configItems.find(function (c) {
38167
+ return c.codex == valCodex;
38168
+ });
38169
+ if (sel) {
38170
+ sel.sel = true;
38171
+ if (!selectedItems.includes(sel.codex)) selectedItems.push(sel.codex);
38172
+ }
38173
+ };
38174
+ for (var i = 0; i < configStepOPG.targetArticles.length; i++) {
38175
+ _loop5();
38176
+ }
38177
+ return configItems;
38178
+ }
38179
+
38180
+ /** Merged-OPG view via per-group reconfiguration on a cloned set — the pre-existing flow, used when the static decision-row path does not apply. */
38181
+ }, {
38182
+ key: "mergeOPGItemsByReconfiguration",
38183
+ value: (function () {
38184
+ var _mergeOPGItemsByReconfiguration = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(set, step, configStepOPG, configStepOPV, optionState, constructionRules, selectedItems) {
38185
+ var configItems, clonedSet, clonedArticles, targetArticle, opg, ops, selectedOpv, originalVariantValues, parentNames, mergedOptionOnPartlistArticle, useFastPath, fastPathValidated, variantValues, _iterator17, _step17, _clonedSet$favorites$, _clonedSet$favorites, _step17$value, opgValue, alreadyCalcedVisibleOPVs, _loop7, _i2, _targetArticle$engine3, _targetArticle$engine4, _ops$optionOcd3, visibleOptionValues, updatedOps, fastPathKeys, fullKeys, retVal, clonedConfigItemsForView, _loop6, i;
38186
+ return _regeneratorRuntime.wrap(function _callee2$(_context4) {
38187
+ while (1) switch (_context4.prev = _context4.next) {
38188
+ case 0:
38189
+ configItems = [];
38190
+ clonedSet = set.cloneSet(); // Same lookup contract as the static path: a step may target an INVISIBLE parent the visible map does not hold.
38191
+ clonedArticles = withStepArticles(clonedSet.getDivaArticles(true));
37258
38192
  targetArticle = clonedArticles[configStepOPG.targetArticles[0]];
37259
38193
  opg = targetArticle.getArticleOptionState(configStepOPG.option);
37260
38194
  ops = targetArticle.getArticleOptionState(configStepOPV.option);
37261
38195
  if (opg) {
37262
- _context3.next = 51;
38196
+ _context4.next = 8;
37263
38197
  break;
37264
38198
  }
37265
38199
  throw new Error('myOptionState ' + configStepOPG.option + ' is undefined');
37266
- case 51:
38200
+ case 8:
37267
38201
  if (ops) {
37268
- _context3.next = 53;
38202
+ _context4.next = 10;
37269
38203
  break;
37270
38204
  }
37271
38205
  throw new Error('myOptionState ' + configStepOPV.option + ' is undefined');
37272
- case 53:
38206
+ case 10:
37273
38207
  selectedOpv = ops.valCodex;
37274
38208
  originalVariantValues = targetArticle.VariantValues;
38209
+ parentNames = this.idmOpgParentNames(targetArticle, opg, ops);
37275
38210
  mergedOptionOnPartlistArticle = !targetArticle.getArticleOptionStateFlat(ops.optionCodex);
37276
38211
  useFastPath = true, fastPathValidated = false;
37277
38212
  variantValues = {};
37278
- _iterator13 = _createForOfIteratorHelper$9(opg.visibleOptionValues);
37279
- _context3.prev = 59;
37280
- _iterator13.s();
37281
- case 61:
37282
- if ((_step13 = _iterator13.n()).done) {
37283
- _context3.next = 93;
38213
+ _iterator17 = _createForOfIteratorHelper$9(opg.visibleOptionValues);
38214
+ _context4.prev = 17;
38215
+ _iterator17.s();
38216
+ case 19:
38217
+ if ((_step17 = _iterator17.n()).done) {
38218
+ _context4.next = 51;
37284
38219
  break;
37285
38220
  }
37286
- _step13$value = _slicedToArray(_step13.value, 2), opgValue = _step13$value[1];
37287
- //die sichtbaren gruppen werden nun nacheinander beim Artikel gesetzt und die Validen bezüge jeder gruppe geholt -> visibleOptionValues;
38221
+ _step17$value = _slicedToArray(_step17.value, 2), opgValue = _step17$value[1];
38222
+ // The visible groups are set on the article one after another and each group's valid values fetched -> visibleOptionValues.
37288
38223
  variantValues[opg.optionCodex] = opgValue.codex;
37289
38224
  alreadyCalcedVisibleOPVs = targetArticle.getMergesToOPG(opg.optionCodex + '_' + opgValue.codex, JSON.stringify(targetArticle.getVariantValuesTillOPT(opg.optionCodex)));
37290
38225
  if (!(alreadyCalcedVisibleOPVs != undefined && Object.keys((_clonedSet$favorites$ = (_clonedSet$favorites = clonedSet.favorites) === null || _clonedSet$favorites === void 0 ? void 0 : _clonedSet$favorites.VariantValues) !== null && _clonedSet$favorites$ !== void 0 ? _clonedSet$favorites$ : {}).length == 0)) {
37291
- _context3.next = 77;
38226
+ _context4.next = 35;
37292
38227
  break;
37293
38228
  }
37294
38229
  if (!((originalVariantValues === null || originalVariantValues === void 0 ? void 0 : originalVariantValues[opg.optionCodex]) == opgValue.codex)) {
37295
- _context3.next = 74;
38230
+ _context4.next = 32;
37296
38231
  break;
37297
38232
  }
37298
- _loop5 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop5() {
38233
+ _loop7 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop7() {
37299
38234
  var _clonedArticles$confi;
37300
38235
  var valCodex, sel;
37301
- return _regeneratorRuntime.wrap(function _loop5$(_context) {
37302
- while (1) switch (_context.prev = _context.next) {
38236
+ return _regeneratorRuntime.wrap(function _loop7$(_context2) {
38237
+ while (1) switch (_context2.prev = _context2.next) {
37303
38238
  case 0:
37304
- valCodex = (_clonedArticles$confi = clonedArticles[configStepOPG.targetArticles[_i]].getArticleOptionState(configStepOPV.option)) === null || _clonedArticles$confi === void 0 ? void 0 : _clonedArticles$confi.valCodex;
38239
+ valCodex = (_clonedArticles$confi = clonedArticles[configStepOPG.targetArticles[_i2]].getArticleOptionState(configStepOPV.option)) === null || _clonedArticles$confi === void 0 ? void 0 : _clonedArticles$confi.valCodex;
37305
38240
  sel = alreadyCalcedVisibleOPVs.find(function (c) {
37306
38241
  return c.codex == valCodex;
37307
38242
  });
37308
38243
  if (sel) sel.sel = true;
37309
38244
  case 3:
37310
38245
  case "end":
37311
- return _context.stop();
38246
+ return _context2.stop();
37312
38247
  }
37313
- }, _loop5);
38248
+ }, _loop7);
37314
38249
  });
37315
- _i = 0;
37316
- case 69:
37317
- if (!(_i < configStepOPG.targetArticles.length)) {
37318
- _context3.next = 74;
38250
+ _i2 = 0;
38251
+ case 27:
38252
+ if (!(_i2 < configStepOPG.targetArticles.length)) {
38253
+ _context4.next = 32;
37319
38254
  break;
37320
38255
  }
37321
- return _context3.delegateYield(_loop5(), "t1", 71);
37322
- case 71:
37323
- _i++;
37324
- _context3.next = 69;
38256
+ return _context4.delegateYield(_loop7(), "t0", 29);
38257
+ case 29:
38258
+ _i2++;
38259
+ _context4.next = 27;
37325
38260
  break;
37326
- case 74:
38261
+ case 32:
37327
38262
  configItems = configItems.concat(alreadyCalcedVisibleOPVs);
37328
- _context3.next = 91;
38263
+ _context4.next = 49;
37329
38264
  break;
37330
- case 77:
37331
- visibleOptionValues = useFastPath ? (_targetArticle$engine = (_targetArticle$engine2 = targetArticle.engine).evalVisibleOptionValuesForFeature) === null || _targetArticle$engine === void 0 ? void 0 : _targetArticle$engine.call(_targetArticle$engine2, ops.optionCodex, _defineProperty({}, opg.optionCodex, opgValue.codex)) : undefined;
38265
+ case 35:
38266
+ visibleOptionValues = useFastPath ? (_targetArticle$engine3 = (_targetArticle$engine4 = targetArticle.engine).evalVisibleOptionValuesForFeature) === null || _targetArticle$engine3 === void 0 ? void 0 : _targetArticle$engine3.call(_targetArticle$engine4, ops.optionCodex, _defineProperty({}, opg.optionCodex, opgValue.codex)) : undefined;
37332
38267
  if (!(!visibleOptionValues || !fastPathValidated)) {
37333
- _context3.next = 87;
38268
+ _context4.next = 45;
37334
38269
  break;
37335
38270
  }
37336
- _context3.next = 81;
38271
+ _context4.next = 39;
37337
38272
  return articleHandlerInstance.updateCfgValues(targetArticle, variantValues, {}, true, !mergedOptionOnPartlistArticle, true, true);
37338
- case 81:
38273
+ case 39:
37339
38274
  updatedOps = targetArticle.getArticleOptionState(ops.optionCodex);
37340
38275
  if (updatedOps) {
37341
- _context3.next = 85;
38276
+ _context4.next = 43;
37342
38277
  break;
37343
38278
  }
37344
38279
  LOG$c.warn('[mergesToOPG] option state ' + ops.optionCodex + ' not found after setting ' + opg.optionCodex + '=' + opgValue.codex);
37345
- return _context3.abrupt("continue", 91);
37346
- case 85:
38280
+ return _context4.abrupt("continue", 49);
38281
+ case 43:
37347
38282
  if (visibleOptionValues) {
37348
38283
  fastPathKeys = JSON.stringify(Array.from(visibleOptionValues.keys()));
37349
38284
  fullKeys = JSON.stringify(Array.from(updatedOps.visibleOptionValues.keys()));
@@ -37354,31 +38289,31 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37354
38289
  }
37355
38290
  }
37356
38291
  visibleOptionValues = updatedOps.visibleOptionValues;
37357
- case 87:
37358
- _retVal2 = this.prepareConfigItemsForView(clonedSet, optionState, visibleOptionValues, retValues.constructionRules, [], step.configStep.targetArticles, (_ops$optionOcd2 = ops.optionOcd) !== null && _ops$optionOcd2 !== void 0 ? _ops$optionOcd2 : ops.optionCodex, opgValue.name, opgValue.codex, opg.optionCodex);
37359
- configItems = configItems.concat(_retVal2.myConfigItemsForView);
37360
- clonedConfigItemsForView = JSON.parse(JSON.stringify(_retVal2.myConfigItemsForView));
38292
+ case 45:
38293
+ retVal = this.prepareConfigItemsForView(clonedSet, optionState, visibleOptionValues, constructionRules, [], step.configStep.targetArticles, (_ops$optionOcd3 = ops.optionOcd) !== null && _ops$optionOcd3 !== void 0 ? _ops$optionOcd3 : ops.optionCodex, opgValue.name, opgValue.codex, opg.optionCodex, parentNames === null || parentNames === void 0 ? void 0 : parentNames.get(opgValue.codex));
38294
+ configItems = configItems.concat(retVal.myConfigItemsForView);
38295
+ clonedConfigItemsForView = JSON.parse(JSON.stringify(retVal.myConfigItemsForView));
37361
38296
  targetArticle.addMergesToOPG(opg.optionCodex + '_' + opgValue.codex, JSON.stringify(targetArticle.getVariantValuesTillOPT(opg.optionCodex)), clonedConfigItemsForView);
37362
- case 91:
37363
- _context3.next = 61;
38297
+ case 49:
38298
+ _context4.next = 19;
37364
38299
  break;
37365
- case 93:
37366
- _context3.next = 98;
38300
+ case 51:
38301
+ _context4.next = 56;
37367
38302
  break;
37368
- case 95:
37369
- _context3.prev = 95;
37370
- _context3.t2 = _context3["catch"](59);
37371
- _iterator13.e(_context3.t2);
37372
- case 98:
37373
- _context3.prev = 98;
37374
- _iterator13.f();
37375
- return _context3.finish(98);
37376
- case 101:
37377
- _loop4 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop4() {
38303
+ case 53:
38304
+ _context4.prev = 53;
38305
+ _context4.t1 = _context4["catch"](17);
38306
+ _iterator17.e(_context4.t1);
38307
+ case 56:
38308
+ _context4.prev = 56;
38309
+ _iterator17.f();
38310
+ return _context4.finish(56);
38311
+ case 59:
38312
+ _loop6 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop6() {
37378
38313
  var _clonedArticles$confi2;
37379
38314
  var valCodex, sel;
37380
- return _regeneratorRuntime.wrap(function _loop4$(_context2) {
37381
- while (1) switch (_context2.prev = _context2.next) {
38315
+ return _regeneratorRuntime.wrap(function _loop6$(_context3) {
38316
+ while (1) switch (_context3.prev = _context3.next) {
37382
38317
  case 0:
37383
38318
  valCodex = i == 0 ? selectedOpv : (_clonedArticles$confi2 = clonedArticles[configStepOPG.targetArticles[i]].getArticleOptionState(configStepOPV.option)) === null || _clonedArticles$confi2 === void 0 ? void 0 : _clonedArticles$confi2.valCodex;
37384
38319
  sel = configItems.find(function (c) {
@@ -37390,48 +38325,34 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37390
38325
  }
37391
38326
  case 3:
37392
38327
  case "end":
37393
- return _context2.stop();
38328
+ return _context3.stop();
37394
38329
  }
37395
- }, _loop4);
38330
+ }, _loop6);
37396
38331
  });
37397
38332
  i = 0;
37398
- case 103:
38333
+ case 61:
37399
38334
  if (!(i < configStepOPG.targetArticles.length)) {
37400
- _context3.next = 108;
38335
+ _context4.next = 66;
37401
38336
  break;
37402
38337
  }
37403
- return _context3.delegateYield(_loop4(), "t3", 105);
37404
- case 105:
38338
+ return _context4.delegateYield(_loop6(), "t2", 63);
38339
+ case 63:
37405
38340
  i++;
37406
- _context3.next = 103;
38341
+ _context4.next = 61;
37407
38342
  break;
37408
- case 108:
37409
- return _context3.abrupt("return", {
37410
- configItems: configItems,
37411
- option: optionCodex ? optionState.option : undefined,
37412
- selectedItems: selectedItems.map(function (sel) {
37413
- return configItems.find(function (c) {
37414
- return c.codex === sel;
37415
- });
37416
- }),
37417
- notTotallyMatichingOPVs: !set.CatalogData.articleConfigAll ? retValues.notTotallyMatichingOPVs : undefined
37418
- });
37419
- case 111:
37420
- return _context3.abrupt("return", {
37421
- configItems: [],
37422
- selectedItems: []
37423
- });
37424
- case 112:
38343
+ case 66:
38344
+ return _context4.abrupt("return", configItems);
38345
+ case 67:
37425
38346
  case "end":
37426
- return _context3.stop();
38347
+ return _context4.stop();
37427
38348
  }
37428
- }, _callee, this, [[13, 28, 31, 34], [59, 95, 98, 101]]);
38349
+ }, _callee2, this, [[17, 53, 56, 59]]);
37429
38350
  }));
37430
- function getConifgItemsForView(_x, _x2) {
37431
- return _getConifgItemsForView.apply(this, arguments);
38351
+ function mergeOPGItemsByReconfiguration(_x3, _x4, _x5, _x6, _x7, _x8, _x9) {
38352
+ return _mergeOPGItemsByReconfiguration.apply(this, arguments);
37432
38353
  }
37433
- return getConifgItemsForView;
37434
- }()
38354
+ return mergeOPGItemsByReconfiguration;
38355
+ }())
37435
38356
  }, {
37436
38357
  key: "getConfigItems",
37437
38358
  value: function getConfigItems(key, articles, configTree) {
@@ -37469,11 +38390,11 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37469
38390
  constructionRules = myOptionState.constructionRules;
37470
38391
  configItems = new Map(myOptionState.visibleOptionValues);
37471
38392
  } else {
37472
- var _iterator14 = _createForOfIteratorHelper$9(configItems.keys()),
37473
- _step14;
38393
+ var _iterator18 = _createForOfIteratorHelper$9(configItems.keys()),
38394
+ _step18;
37474
38395
  try {
37475
- var _loop6 = function _loop6() {
37476
- var key = _step14.value;
38396
+ var _loop8 = function _loop8() {
38397
+ var key = _step18.value;
37477
38398
  if (!myOptionState.visibleOptionValues.get(key) && !myOptionState.visibleOptionValues.values().find(function (v) {
37478
38399
  var _configItems$get;
37479
38400
  return v.sameopv && v.sameopv == ((_configItems$get = configItems.get(key)) === null || _configItems$get === void 0 ? void 0 : _configItems$get.sameopv);
@@ -37481,13 +38402,13 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37481
38402
  configItems["delete"](key);
37482
38403
  }
37483
38404
  };
37484
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
37485
- _loop6();
38405
+ for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
38406
+ _loop8();
37486
38407
  }
37487
38408
  } catch (err) {
37488
- _iterator14.e(err);
38409
+ _iterator18.e(err);
37489
38410
  } finally {
37490
- _iterator14.f();
38411
+ _iterator18.f();
37491
38412
  }
37492
38413
  }
37493
38414
  } else if (i == 0 && configStep.targetArticles.length == 1) {
@@ -37509,12 +38430,12 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37509
38430
  }
37510
38431
  if (visibleOptionValuesOfArticles.length > 0) {
37511
38432
  configItems = new Map(visibleOptionValuesOfArticles[0]);
37512
- var _loop7 = function _loop7(_i2) {
38433
+ var _loop9 = function _loop9(_i3) {
37513
38434
  var _article$getArticleOp2;
37514
- var article = articles[configStep.targetArticles[_i2]];
38435
+ var article = articles[configStep.targetArticles[_i3]];
37515
38436
  if ((_article$getArticleOp2 = article.getArticleOptionStateFlat(configStep.option)) !== null && _article$getArticleOp2 !== void 0 && _article$getArticleOp2.definedBySetFeatureFixed) return 1; // continue
37516
38437
  var keys = Array.from(configItems.keys());
37517
- var newKeys = Array.from(visibleOptionValuesOfArticles[_i2].keys());
38438
+ var newKeys = Array.from(visibleOptionValuesOfArticles[_i3].keys());
37518
38439
  var opvsOnlyInA = keys.filter(function (x) {
37519
38440
  return !newKeys.includes(x);
37520
38441
  });
@@ -37522,12 +38443,12 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37522
38443
  return !keys.includes(x);
37523
38444
  });
37524
38445
  if (opvsOnlyInA.length && opvsOnlyInB.length) {
37525
- var _loop8 = function _loop8() {
38446
+ var _loop10 = function _loop10() {
37526
38447
  var opva = configItems.get(opvsOnlyInA[j]);
37527
38448
  if (!opva) return 1; // continue
37528
38449
  var sameOPVExists = opvsOnlyInB.find(function (opvb) {
37529
38450
  var _visibleOptionValuesO;
37530
- return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO = visibleOptionValuesOfArticles[_i2].get(opvb)) === null || _visibleOptionValuesO === void 0 ? void 0 : _visibleOptionValuesO.sameopv);
38451
+ return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO = visibleOptionValuesOfArticles[_i3].get(opvb)) === null || _visibleOptionValuesO === void 0 ? void 0 : _visibleOptionValuesO.sameopv);
37531
38452
  });
37532
38453
  if (sameOPVExists) {
37533
38454
  opvsOnlyInA.splice(j, 1);
@@ -37535,37 +38456,37 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37535
38456
  }
37536
38457
  };
37537
38458
  for (var j = opvsOnlyInA.length - 1; j >= 0; j--) {
37538
- if (_loop8()) continue;
38459
+ if (_loop10()) continue;
37539
38460
  }
37540
38461
  } else if (opvsOnlyInA.length) {
37541
- var _loop9 = function _loop9() {
38462
+ var _loop11 = function _loop11() {
37542
38463
  var opva = configItems.get(opvsOnlyInA[_j]);
37543
38464
  if (!opva) return 1; // continue
37544
38465
  var sameOPVExists = newKeys.find(function (opvb) {
37545
38466
  var _visibleOptionValuesO2;
37546
- return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO2 = visibleOptionValuesOfArticles[_i2].get(opvb)) === null || _visibleOptionValuesO2 === void 0 ? void 0 : _visibleOptionValuesO2.sameopv);
38467
+ return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO2 = visibleOptionValuesOfArticles[_i3].get(opvb)) === null || _visibleOptionValuesO2 === void 0 ? void 0 : _visibleOptionValuesO2.sameopv);
37547
38468
  });
37548
38469
  if (sameOPVExists) {
37549
38470
  opvsOnlyInA.splice(_j, 1);
37550
38471
  }
37551
38472
  };
37552
38473
  for (var _j = opvsOnlyInA.length - 1; _j >= 0; _j--) {
37553
- if (_loop9()) continue;
38474
+ if (_loop11()) continue;
37554
38475
  }
37555
38476
  } else if (opvsOnlyInB.length) {
37556
- var _loop10 = function _loop10() {
38477
+ var _loop12 = function _loop12() {
37557
38478
  var opva = configItems.get(opvsOnlyInB[_j2]);
37558
38479
  if (!opva) return 1; // continue
37559
38480
  var sameOPVExists = keys.find(function (opvb) {
37560
38481
  var _visibleOptionValuesO3;
37561
- return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO3 = visibleOptionValuesOfArticles[_i2].get(opvb)) === null || _visibleOptionValuesO3 === void 0 ? void 0 : _visibleOptionValuesO3.sameopv);
38482
+ return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO3 = visibleOptionValuesOfArticles[_i3].get(opvb)) === null || _visibleOptionValuesO3 === void 0 ? void 0 : _visibleOptionValuesO3.sameopv);
37562
38483
  });
37563
38484
  if (sameOPVExists) {
37564
38485
  opvsOnlyInB.splice(_j2, 1);
37565
38486
  }
37566
38487
  };
37567
38488
  for (var _j2 = opvsOnlyInB.length - 1; _j2 >= 0; _j2--) {
37568
- if (_loop10()) continue;
38489
+ if (_loop12()) continue;
37569
38490
  }
37570
38491
  }
37571
38492
  var differentOPVs = opvsOnlyInA.concat(opvsOnlyInB);
@@ -37573,8 +38494,8 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37573
38494
  notTotallyMatichingOPVs = true;
37574
38495
  }
37575
38496
  };
37576
- for (var _i2 = 1; _i2 < visibleOptionValuesOfArticles.length; _i2++) {
37577
- if (_loop7(_i2)) continue;
38497
+ for (var _i3 = 1; _i3 < visibleOptionValuesOfArticles.length; _i3++) {
38498
+ if (_loop9(_i3)) continue;
37578
38499
  }
37579
38500
  }
37580
38501
  return {
@@ -37603,11 +38524,11 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37603
38524
  ret = false;
37604
38525
  var articles = set.getDivaArticles();
37605
38526
  for (var basketId in articles) {
37606
- var _iterator15 = _createForOfIteratorHelper$9(articles[basketId].articleOptionStates.values()),
37607
- _step15;
38527
+ var _iterator19 = _createForOfIteratorHelper$9(articles[basketId].articleOptionStates.values()),
38528
+ _step19;
37608
38529
  try {
37609
- for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
37610
- var ops = _step15.value;
38530
+ for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
38531
+ var ops = _step19.value;
37611
38532
  if (ops.headerPosVariationType == 'K') {
37612
38533
  if (optionValues[ops.optionCodex] == undefined) {
37613
38534
  optionValues[ops.optionCodex] = ops.valCodex ? ops.valCodex : null;
@@ -37620,9 +38541,9 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37620
38541
  }
37621
38542
  }
37622
38543
  } catch (err) {
37623
- _iterator15.e(err);
38544
+ _iterator19.e(err);
37624
38545
  } finally {
37625
- _iterator15.f();
38546
+ _iterator19.f();
37626
38547
  }
37627
38548
  if (ret == true) break;
37628
38549
  }
@@ -37646,8 +38567,8 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37646
38567
  var visibleHistory = [];
37647
38568
  var lastVisible = !((_this$getSnapshotOpt$ = (_this$getSnapshotOpt = this.getSnapshotOpt(stack[0].snapshots.before, ops.optionCodex)) === null || _this$getSnapshotOpt === void 0 ? void 0 : _this$getSnapshotOpt.invisible) !== null && _this$getSnapshotOpt$ !== void 0 ? _this$getSnapshotOpt$ : true);
37648
38569
  var toDecisionNo = function toDecisionNo(entry) {
37649
- var _ref, _Number, _entry$decision, _entry$decision2;
37650
- var nr = (_ref = (_Number = (_entry$decision = entry.decision) === null || _entry$decision === void 0 ? void 0 : _entry$decision.Number) !== null && _Number !== void 0 ? _Number : (_entry$decision2 = entry.decision) === null || _entry$decision2 === void 0 ? void 0 : _entry$decision2.decisionNo) !== null && _ref !== void 0 ? _ref : entry.nr;
38570
+ var _ref4, _Number, _entry$decision, _entry$decision2;
38571
+ var nr = (_ref4 = (_Number = (_entry$decision = entry.decision) === null || _entry$decision === void 0 ? void 0 : _entry$decision.Number) !== null && _Number !== void 0 ? _Number : (_entry$decision2 = entry.decision) === null || _entry$decision2 === void 0 ? void 0 : _entry$decision2.decisionNo) !== null && _ref4 !== void 0 ? _ref4 : entry.nr;
37651
38572
  return typeof nr === 'number' ? nr : Number(nr) || 0;
37652
38573
  };
37653
38574
  for (var i = 0; i < stack.length; i++) {
@@ -37716,11 +38637,11 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37716
38637
  var lastVisible = (_this$getSnapshotOpt$2 = (_this$getSnapshotOpt2 = this.getSnapshotOpt(stack[0].snapshots.before, optionCodex)) === null || _this$getSnapshotOpt2 === void 0 || (_this$getSnapshotOpt2 = _this$getSnapshotOpt2.visibleOPVs) === null || _this$getSnapshotOpt2 === void 0 ? void 0 : _this$getSnapshotOpt2.includes(opvCodex)) !== null && _this$getSnapshotOpt$2 !== void 0 ? _this$getSnapshotOpt$2 : false;
37717
38638
  var lastSel = (_this$getSnapshotOpt$3 = (_this$getSnapshotOpt3 = this.getSnapshotOpt(stack[0].snapshots.before, optionCodex)) === null || _this$getSnapshotOpt3 === void 0 ? void 0 : _this$getSnapshotOpt3.selOPV) !== null && _this$getSnapshotOpt$3 !== void 0 ? _this$getSnapshotOpt$3 : '';
37718
38639
  var toDecisionNo = function toDecisionNo(entry) {
37719
- var _ref2, _Number2, _entry$decision3, _entry$decision4;
37720
- var nr = (_ref2 = (_Number2 = (_entry$decision3 = entry.decision) === null || _entry$decision3 === void 0 ? void 0 : _entry$decision3.Number) !== null && _Number2 !== void 0 ? _Number2 : (_entry$decision4 = entry.decision) === null || _entry$decision4 === void 0 ? void 0 : _entry$decision4.decisionNo) !== null && _ref2 !== void 0 ? _ref2 : entry.nr;
38640
+ var _ref5, _Number2, _entry$decision3, _entry$decision4;
38641
+ var nr = (_ref5 = (_Number2 = (_entry$decision3 = entry.decision) === null || _entry$decision3 === void 0 ? void 0 : _entry$decision3.Number) !== null && _Number2 !== void 0 ? _Number2 : (_entry$decision4 = entry.decision) === null || _entry$decision4 === void 0 ? void 0 : _entry$decision4.decisionNo) !== null && _ref5 !== void 0 ? _ref5 : entry.nr;
37721
38642
  return typeof nr === 'number' ? nr : Number(nr) || 0;
37722
38643
  };
37723
- var _loop11 = function _loop11() {
38644
+ var _loop13 = function _loop13() {
37724
38645
  var _before$visibleOPVs, _after$visibleOPVs$in, _after$visibleOPVs2, _after$selOPV;
37725
38646
  var entry = stack[i];
37726
38647
  var before = _this.getSnapshotOpt(entry.snapshots.before, optionCodex);
@@ -37741,7 +38662,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37741
38662
  lastSel = newSel;
37742
38663
  };
37743
38664
  for (var i = 0; i < stack.length; i++) {
37744
- _loop11();
38665
+ _loop13();
37745
38666
  }
37746
38667
  result.visible = lastVisible;
37747
38668
  return result;
@@ -37750,7 +38671,9 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37750
38671
  key: "prepareConfigItemsForView",
37751
38672
  value: function prepareConfigItemsForView(set, ops, myConfigItems, constructionRules, selectedVals, targetArticles, optionCodex,
37752
38673
  //bei einer OPG wird hier dessen hauptoptionCodex Übergeben
37753
- idmOpgGroupName, idmOpgValCodex, idmOpgOptionCodex, freeTextValue, freeTextLang) {
38674
+ idmOpgGroupName, idmOpgValCodex, idmOpgOptionCodex, idmOpgParentName,
38675
+ //dropdown header above the group: the invisible parent family's OPV name (e.g. Preisgruppe)
38676
+ freeTextValue, freeTextLang) {
37754
38677
  var _this2 = this;
37755
38678
  var myConfigItemsForView = [];
37756
38679
  var objectKeys = Array.from(myConfigItems.keys());
@@ -37759,8 +38682,8 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37759
38682
  myConfigItems = new Map(ops.option.articleOptionValues);
37760
38683
  }
37761
38684
  var groupContentItemIdObject = this.getGroupContentItemIdObject(Array.from(myConfigItems.values()), idmOpgGroupName);
37762
- var _loop12 = function _loop12() {
37763
- var _ops$optionOcd3, _item$images, _item$colorGroups, _item$pdfUrl, _item$url, _ops$option$checkForR;
38685
+ var _loop14 = function _loop14() {
38686
+ var _ops$optionOcd4, _item$images, _item$colorGroups, _item$pdfUrl, _item$url, _ops$option$checkForR;
37764
38687
  var item = myConfigItems.get(objectKeys[i]);
37765
38688
  if (!item) throw new Error('item ' + objectKeys[i] + ' not found in myConfigItems');
37766
38689
  var key = objectKeys[i];
@@ -37779,7 +38702,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37779
38702
  if (imageFromVisibleOPVsImages) {
37780
38703
  image = imageFromVisibleOPVsImages;
37781
38704
  }
37782
- var isFav = favoritesHandlerInstance.isFavorite(set, targetArticles, item, (_ops$optionOcd3 = ops.optionOcd) !== null && _ops$optionOcd3 !== void 0 ? _ops$optionOcd3 : optionCodex);
38705
+ var isFav = favoritesHandlerInstance.isFavorite(set, targetArticles, item, (_ops$optionOcd4 = ops.optionOcd) !== null && _ops$optionOcd4 !== void 0 ? _ops$optionOcd4 : optionCodex);
37783
38706
  var isSelected = !!selectedVals.find(function (opv) {
37784
38707
  return opv == item.codex;
37785
38708
  });
@@ -37797,7 +38720,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37797
38720
  zoomImage: zoomImage,
37798
38721
  hexColor: item.hexColor,
37799
38722
  groupName: groupName,
37800
- parentName: !idmOpgOptionCodex && (!set.CatalogData.hidePriceGroupsOfOPGs || !item.isParentOPVG) ? item.parentName : undefined,
38723
+ parentName: idmOpgOptionCodex ? !set.CatalogData.hidePriceGroupsOfOPGs ? idmOpgParentName : undefined : !set.CatalogData.hidePriceGroupsOfOPGs || !item.isParentOPVG ? item.parentName : undefined,
37801
38724
  longDescription: item.description,
37802
38725
  text: item.name + (item.isFreeText && freeTextToUse ? ': ' + freeTextToUse : ''),
37803
38726
  rals: item.rals,
@@ -37834,7 +38757,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37834
38757
  });
37835
38758
  };
37836
38759
  for (var i = 0; i < objectKeys.length; i++) {
37837
- if (_loop12()) continue;
38760
+ if (_loop14()) continue;
37838
38761
  }
37839
38762
  return {
37840
38763
  myConfigItemsForView: myConfigItemsForView
@@ -37868,12 +38791,12 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37868
38791
  for (var iKey in optionStatesOfArticles) {
37869
38792
  //hier evtl. die Article mit einer gewissen reihenfolge durchlaufen!
37870
38793
  var optionsStates = optionStatesOfArticles[iKey];
37871
- var _iterator16 = _createForOfIteratorHelper$9(optionsStates.values()),
37872
- _step16;
38794
+ var _iterator20 = _createForOfIteratorHelper$9(optionsStates.values()),
38795
+ _step20;
37873
38796
  try {
37874
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
38797
+ for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
37875
38798
  var _ops$addToMeasure2;
37876
- var ops = _step16.value;
38799
+ var ops = _step20.value;
37877
38800
  var selectionmode = ops.selectionmode;
37878
38801
  if (set.CatalogData.forceConfigSingle && (selectionmode == 1 || selectionmode == 2)) selectionmode = 3;
37879
38802
  if (ops.isInvisible || selectionmode == 0 || !ops.isDoShow || ops.visibleCount == 0 || !!((_ops$addToMeasure2 = ops.addToMeasure) !== null && _ops$addToMeasure2 !== void 0 && _ops$addToMeasure2.length)) {
@@ -37881,9 +38804,9 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37881
38804
  }
37882
38805
  }
37883
38806
  } catch (err) {
37884
- _iterator16.e(err);
38807
+ _iterator20.e(err);
37885
38808
  } finally {
37886
- _iterator16.f();
38809
+ _iterator20.f();
37887
38810
  }
37888
38811
  }
37889
38812
  return configTree;
@@ -38375,7 +39298,7 @@ var DivaSet = /*#__PURE__*/function () {
38375
39298
  var allAccs = [];
38376
39299
  var articles = this.getDivaArticles();
38377
39300
  var article = articles[basketId];
38378
- if (!article) throw new Error('article ' + basketId + ' does not exist');
39301
+ if (!article) return curNum;
38379
39302
  var myParentArticle = article.getBaseParent();
38380
39303
  var _this$getSplitPlanned = this.getSplitPlannedAccessoiresOfBasketId(basketId),
38381
39304
  notPlannedAcc = _this$getSplitPlanned.notPlannedAcc,
@@ -39284,7 +40207,7 @@ var DivaSet = /*#__PURE__*/function () {
39284
40207
  break;
39285
40208
  }
39286
40209
  _context5.next = 3;
39287
- return import('./DoorPlanner-dd3a1b18.js');
40210
+ return import('./DoorPlanner-b74f2c6a.js');
39288
40211
  case 3:
39289
40212
  _yield$import = _context5.sent;
39290
40213
  DoorPlanner = _yield$import["default"];
@@ -42674,7 +43597,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
42674
43597
  newArticle.accessoireParentArticle = set.getArticleByBasketId(newArticle.relatedToBasketId);
42675
43598
  }
42676
43599
  //holt die bereits gesetzten Option welche beim neuen Article übernommen werden könnten
42677
- defaultHeaderValues = articleHandlerInstance.getDefaultValuesOfArticles(set.getDivaArticles()); //falls die SVGs im frontend ausmultipliziert wurden hier die regel des SVGs als VariantValues anwenden
43600
+ defaultHeaderValues = initParams.dontInheritSetValues ? {} : articleHandlerInstance.getDefaultValuesOfArticles(set.getDivaArticles()); //falls die SVGs im frontend ausmultipliziert wurden hier die regel des SVGs als VariantValues anwenden
42678
43601
  if (initParams.svgJsonFormula && newArticle.catalogArticle.svgsAreMultiplied) {
42679
43602
  defaultHeaderValues = DivaUtils.getVariantValuesFromRule(initParams.svgJsonFormula, defaultHeaderValues);
42680
43603
  }
@@ -44522,7 +45445,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
44522
45445
  value: (function () {
44523
45446
  var _updateArticlesOptionStatesOfActSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35(set, myValues, targetArticlesWithNewValues, ignorePlanner, from, partlistDiff, forceUpdate) {
44524
45447
  var _resultPlannerUpdate;
44525
- var elementsToDeleteById, targetArticlesToUpdateOnly, previousValues, articles, article, optState, retValues, diff, resultPlannerUpdate, targetElementIds, i, articleToDel, index, result, articleCopyRelation, newArticle, rpu, copyIndex;
45448
+ var elementsToDeleteById, targetArticlesToUpdateOnly, previousValues, mayNeedRollback, articles, article, optState, retValues, diff, resultPlannerUpdate, targetElementIds, i, articleToDel, index, result, articleCopyRelation, newArticle, rpu, copyIndex;
44526
45449
  return _regeneratorRuntime.wrap(function _callee35$(_context37) {
44527
45450
  while (1) switch (_context37.prev = _context37.next) {
44528
45451
  case 0:
@@ -44537,63 +45460,71 @@ var DivaSetHandler = /*#__PURE__*/function () {
44537
45460
  targetArticlesToUpdateOnly = targetArticlesWithNewValues;
44538
45461
  }
44539
45462
  previousValues = {};
45463
+ /**
45464
+ * The ONLY reader of `previousValues` is the planner-rollback below, and that whole block is
45465
+ * skipped for `ignorePlanner` / `from === 'calcVariant'` callers. Snapshotting the article for
45466
+ * them meant a `getArticleJsonVariantValues()` plus a `structuredClone()` per call whose result
45467
+ * could never be read — and those callers are the hot ones: every variant sweep and every
45468
+ * catalog-test combination goes through 'calcVariant'.
45469
+ */
45470
+ mayNeedRollback = !ignorePlanner && from !== 'calcVariant';
44540
45471
  articles = set.getDivaArticles();
44541
- if (articles && targetArticlesWithNewValues && targetArticlesWithNewValues.length > 0 && myValues) {
45472
+ if (mayNeedRollback && articles && targetArticlesWithNewValues && targetArticlesWithNewValues.length > 0 && myValues) {
44542
45473
  article = articles[targetArticlesWithNewValues[0]];
44543
45474
  optState = article === null || article === void 0 ? void 0 : article.getArticleJsonVariantValues();
44544
45475
  previousValues = structuredClone(optState);
44545
45476
  }
44546
- _context37.next = 8;
45477
+ _context37.next = 9;
44547
45478
  return articleHandlerInstance.updateArticlesOptionStates(myValues, targetArticlesWithNewValues, targetArticlesToUpdateOnly, set.getDivaArticles(true), from);
44548
- case 8:
45479
+ case 9:
44549
45480
  retValues = _context37.sent;
44550
45481
  targetArticlesWithNewValues = retValues.targetArticlesToUpdate;
44551
45482
  if (!(retValues.partlistArticlesToLoad.length > 0)) {
44552
- _context37.next = 19;
45483
+ _context37.next = 20;
44553
45484
  break;
44554
45485
  }
44555
45486
  diff = targetArticlesToUpdateOnly.length - Object.keys(set.getDivaArticles()).length;
44556
45487
  if (!(diff == 0 || partlistDiff == diff)) {
44557
- _context37.next = 17;
45488
+ _context37.next = 18;
44558
45489
  break;
44559
45490
  }
44560
- _context37.next = 15;
45491
+ _context37.next = 16;
44561
45492
  return articleHandlerInstance.correctPartlistArticlesByGlobalRules(set, retValues.partlistArticlesToLoad, set.CatalogData.bundleRules, {
44562
45493
  doChange: false
44563
45494
  });
44564
- case 15:
44565
- _context37.next = 19;
45495
+ case 16:
45496
+ _context37.next = 20;
44566
45497
  break;
44567
- case 17:
44568
- _context37.next = 19;
45498
+ case 18:
45499
+ _context37.next = 20;
44569
45500
  return this.updateArticlesOptionStatesOfActSet(set, {}, targetArticlesWithNewValues, ignorePlanner, from, diff);
44570
- case 19:
45501
+ case 20:
44571
45502
  if (!(from !== 'initializingPartlist')) {
44572
- _context37.next = 22;
45503
+ _context37.next = 23;
44573
45504
  break;
44574
45505
  }
44575
- _context37.next = 22;
45506
+ _context37.next = 23;
44576
45507
  return this.updateEdoArticles(set, retValues.newEDOExtraArticles);
44577
- case 22:
45508
+ case 23:
44578
45509
  if (set.CatalogData.hasAlternateRenderings) set.CatalogData.updateAlternativeRenderings(set.getDivaArticles());
44579
45510
 
44580
45511
  //Update Planner - check if planner data changed
44581
45512
  if (!(!ignorePlanner && from != 'calcVariant')) {
44582
- _context37.next = 64;
45513
+ _context37.next = 65;
44583
45514
  break;
44584
45515
  }
44585
45516
  targetElementIds = this.getElementIdsOfArticles(set, targetArticlesWithNewValues);
44586
- _context37.next = 27;
45517
+ _context37.next = 28;
44587
45518
  return set.plannerHandler.updatePlanner(set.getSetId(), myValues, targetElementIds, forceUpdate);
44588
- case 27:
45519
+ case 28:
44589
45520
  resultPlannerUpdate = _context37.sent;
44590
45521
  if (!resultPlannerUpdate.failed) {
44591
- _context37.next = 31;
45522
+ _context37.next = 32;
44592
45523
  break;
44593
45524
  }
44594
- _context37.next = 31;
45525
+ _context37.next = 32;
44595
45526
  return articleHandlerInstance.updateArticlesOptionStates(previousValues, targetArticlesWithNewValues, targetArticlesToUpdateOnly, set.getDivaArticles(true), from);
44596
- case 31:
45527
+ case 32:
44597
45528
  elementsToDeleteById = resultPlannerUpdate.elemIdsToDelete;
44598
45529
  for (i = 0; i < resultPlannerUpdate.elemIdsToDelete.length; i++) {
44599
45530
  articleToDel = set.getArticleByElementId(resultPlannerUpdate.elemIdsToDelete[i]);
@@ -44603,58 +45534,58 @@ var DivaSetHandler = /*#__PURE__*/function () {
44603
45534
  }
44604
45535
  }
44605
45536
  if (!resultPlannerUpdate.doDeleteBackGrid) {
44606
- _context37.next = 40;
45537
+ _context37.next = 41;
44607
45538
  break;
44608
45539
  }
44609
- _context37.next = 36;
45540
+ _context37.next = 37;
44610
45541
  return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[0], false, resultPlannerUpdate.deletionType);
44611
- case 36:
45542
+ case 37:
44612
45543
  result = _context37.sent;
44613
45544
  //Others are deleted recursive
44614
45545
  if (result.selectElementId) {
44615
45546
  resultPlannerUpdate.elementIdsToUpdateSelection = [result.selectElementId];
44616
45547
  }
44617
- _context37.next = 47;
45548
+ _context37.next = 48;
44618
45549
  break;
44619
- case 40:
44620
- i = 0;
44621
45550
  case 41:
45551
+ i = 0;
45552
+ case 42:
44622
45553
  if (!(i < resultPlannerUpdate.elemIdsToDelete.length)) {
44623
- _context37.next = 47;
45554
+ _context37.next = 48;
44624
45555
  break;
44625
45556
  }
44626
- _context37.next = 44;
45557
+ _context37.next = 45;
44627
45558
  return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[i], false, resultPlannerUpdate.deletionType);
44628
- case 44:
45559
+ case 45:
44629
45560
  i++;
44630
- _context37.next = 41;
45561
+ _context37.next = 42;
44631
45562
  break;
44632
- case 47:
45563
+ case 48:
44633
45564
  if (!(resultPlannerUpdate.elementIdToCopy && resultPlannerUpdate.elementIdToCopy.length > 0)) {
44634
- _context37.next = 63;
45565
+ _context37.next = 64;
44635
45566
  break;
44636
45567
  }
44637
45568
  //Todo copy these elements
44638
45569
  articleCopyRelation = [];
44639
45570
  i = 0;
44640
- case 50:
45571
+ case 51:
44641
45572
  if (!(i < resultPlannerUpdate.elementIdToCopy.length)) {
44642
- _context37.next = 58;
45573
+ _context37.next = 59;
44643
45574
  break;
44644
45575
  }
44645
- _context37.next = 53;
45576
+ _context37.next = 54;
44646
45577
  return this.copyArticleByElementId(set, resultPlannerUpdate.elementIdToCopy[i], resultPlannerUpdate.ignoreOptionsToCopy);
44647
- case 53:
45578
+ case 54:
44648
45579
  newArticle = _context37.sent;
44649
45580
  articleCopyRelation.push({
44650
45581
  key: resultPlannerUpdate.elementIdToCopy[i],
44651
45582
  value: newArticle.basketId
44652
45583
  });
44653
- case 55:
45584
+ case 56:
44654
45585
  i++;
44655
- _context37.next = 50;
45586
+ _context37.next = 51;
44656
45587
  break;
44657
- case 58:
45588
+ case 59:
44658
45589
  rpu = resultPlannerUpdate;
44659
45590
  copyIndex = {
44660
45591
  x: rpu.copyDPType == 'AVL' ? -1 : rpu.copyDPType == 'AVR' ? 1 : 0,
@@ -44662,25 +45593,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
44662
45593
  z: rpu.copyType == 'BoxPlanner_backside' ? -1 : 0
44663
45594
  };
44664
45595
  if (!(resultPlannerUpdate.copyType == 'BoxPlanner_backside')) {
44665
- _context37.next = 63;
45596
+ _context37.next = 64;
44666
45597
  break;
44667
45598
  }
44668
- _context37.next = 63;
45599
+ _context37.next = 64;
44669
45600
  return set.plannerHandler.copyPlannerElements(set.getSetId(), articleCopyRelation, {
44670
45601
  copyIndex: copyIndex,
44671
45602
  copyType: resultPlannerUpdate.copyType,
44672
45603
  changedOPT: resultPlannerUpdate.changedOPT,
44673
45604
  targetElements: resultPlannerUpdate.targetElements
44674
45605
  });
44675
- case 63:
44676
- this.updatePosNrOfAccessoiresOfTargetArticles(set, targetArticlesWithNewValues);
44677
45606
  case 64:
45607
+ this.updatePosNrOfAccessoiresOfTargetArticles(set, targetArticlesWithNewValues);
45608
+ case 65:
44678
45609
  return _context37.abrupt("return", {
44679
45610
  articleCountChanged: elementsToDeleteById.length > 0,
44680
45611
  elementIdsToUpdateSelection: (_resultPlannerUpdate = resultPlannerUpdate) === null || _resultPlannerUpdate === void 0 ? void 0 : _resultPlannerUpdate.elementIdsToUpdateSelection,
44681
45612
  setId: set.getSetId()
44682
45613
  });
44683
- case 65:
45614
+ case 66:
44684
45615
  case "end":
44685
45616
  return _context37.stop();
44686
45617
  }
@@ -47112,7 +48043,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
47112
48043
  break;
47113
48044
  case 3:
47114
48045
  _context12.next = 5;
47115
- return import('./PfisterWWSHandler-1ba9df74.js');
48046
+ return import('./PfisterWWSHandler-670a6f34.js');
47116
48047
  case 5:
47117
48048
  _yield$import = _context12.sent;
47118
48049
  PfisterWWSHandler = _yield$import["default"];
@@ -47120,7 +48051,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
47120
48051
  return _context12.abrupt("break", 27);
47121
48052
  case 9:
47122
48053
  _context12.next = 11;
47123
- return import('./LiviqueWWSHandler-1634b15e.js');
48054
+ return import('./LiviqueWWSHandler-12e6cecf.js');
47124
48055
  case 11:
47125
48056
  _yield$import2 = _context12.sent;
47126
48057
  LiviqueWWSHandler = _yield$import2["default"];
@@ -47128,7 +48059,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
47128
48059
  return _context12.abrupt("break", 27);
47129
48060
  case 15:
47130
48061
  _context12.next = 17;
47131
- return import('./SeriousBasketHandler-f0ccbf97.js');
48062
+ return import('./SeriousBasketHandler-dbf84292.js');
47132
48063
  case 17:
47133
48064
  _yield$import3 = _context12.sent;
47134
48065
  SeriousWWSHandler = _yield$import3["default"];
@@ -47136,7 +48067,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
47136
48067
  return _context12.abrupt("break", 27);
47137
48068
  case 21:
47138
48069
  _context12.next = 23;
47139
- return import('./StandardWWSHandler-2a205527.js');
48070
+ return import('./StandardWWSHandler-2193dbc6.js');
47140
48071
  case 23:
47141
48072
  _yield$import4 = _context12.sent;
47142
48073
  StandardWWSHandler = _yield$import4["default"];
@@ -48523,7 +49454,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
48523
49454
  //If we need real time rendering initialize the SignalR and 3D host connection Handler
48524
49455
  bootMark('signalr: chunk import start');
48525
49456
  _context3.next = 3;
48526
- return import('./Host3DSignalR-d5d5d7f3.js');
49457
+ return import('./Host3DSignalR-5af3fdc7.js');
48527
49458
  case 3:
48528
49459
  _yield$import = _context3.sent;
48529
49460
  Host3DSignalR = _yield$import["default"];
@@ -50255,7 +51186,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
50255
51186
  break;
50256
51187
  case 8:
50257
51188
  _context5.next = 10;
50258
- return import('./DivaStandardPlanner-19e1f3d9.js');
51189
+ return import('./DivaStandardPlanner-75808b6c.js');
50259
51190
  case 10:
50260
51191
  _yield$import = _context5.sent;
50261
51192
  DivaStandardPlanner = _yield$import["default"];
@@ -50266,7 +51197,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
50266
51197
  return _context5.abrupt("break", 21);
50267
51198
  case 15:
50268
51199
  _context5.next = 17;
50269
- return import('./DivaBoxPlanner-2ba492c3.js');
51200
+ return import('./DivaBoxPlanner-8c20358a.js');
50270
51201
  case 17:
50271
51202
  _yield$import2 = _context5.sent;
50272
51203
  DivaBoxPlanner = _yield$import2["default"];
@@ -54610,13 +55541,6 @@ var DivaWebPlanner = /*#__PURE__*/function () {
54610
55541
  }()
54611
55542
  /*********************************END Functions in Logik called From View END *************************************/
54612
55543
  /*********************************** View attachment (Logik -> View) ***************************************/
54613
- /** True while a view is attached; false = headless (backoffice DIVA agent, artifact passes). */
54614
- }, {
54615
- key: "isViewAttached",
54616
- get: function get() {
54617
- return !!this.view;
54618
- }
54619
-
54620
55544
  /** Attach the view (initial mount or adoption of an existing, possibly headless instance). */
54621
55545
  }, {
54622
55546
  key: "attachView",
@@ -54642,15 +55566,39 @@ var DivaWebPlanner = /*#__PURE__*/function () {
54642
55566
 
54643
55567
  /**
54644
55568
  * Bring the view to a config step (and optionally one option value): the view does the
54645
- * actual navigation/scrolling. Used by the diva agent after it drives the configuration.
54646
- * No-op when headless.
55569
+ * actual navigation/scrolling. Used by the diva agent after it drives the configuration
55570
+ * and to point a step out to the user.
55571
+ *
55572
+ * Returns FALSE when headless — nothing was shown to anyone. Callers must report that
55573
+ * instead of assuming the user saw it; a silent no-op reads as success.
54647
55574
  */
54648
55575
  }, {
54649
55576
  key: "revealConfigStepInView",
54650
55577
  value: function revealConfigStepInView(configStepKey, optionValueCodex) {
54651
- var _this$view97, _this$view98;
54652
- (_this$view97 = this.view) === null || _this$view97 === void 0 || _this$view97.navigateToConfigStep(configStepKey, false);
54653
- if (optionValueCodex) (_this$view98 = this.view) === null || _this$view98 === void 0 || _this$view98.scrollToOptionValueInView(configStepKey, optionValueCodex);
55578
+ if (!this.view) return false;
55579
+ this.view.navigateToConfigStep(configStepKey, false);
55580
+ if (optionValueCodex) this.view.scrollToOptionValueInView(configStepKey, optionValueCodex);
55581
+ return true;
55582
+ }
55583
+
55584
+ /** Is a view attached — i.e. can a user actually see this instance? False = headless. */
55585
+ }, {
55586
+ key: "hasAttachedView",
55587
+ get: function get() {
55588
+ return !!this.view;
55589
+ }
55590
+
55591
+ /**
55592
+ * The config step the attached view currently shows. The read-back for
55593
+ * {@link revealConfigStepInView}: the view may land somewhere else (a step bound to
55594
+ * another option redirects to its group) or nowhere at all, so a caller that wants to
55595
+ * claim "the user is now looking at X" has to compare instead of trusting the call.
55596
+ */
55597
+ }, {
55598
+ key: "getCurConfigStepKeyInView",
55599
+ value: function getCurConfigStepKeyInView() {
55600
+ var _this$view97, _this$view97$getCurCo;
55601
+ return (_this$view97 = this.view) === null || _this$view97 === void 0 || (_this$view97$getCurCo = _this$view97.getCurConfigStepKey) === null || _this$view97$getCurCo === void 0 ? void 0 : _this$view97$getCurCo.call(_this$view97);
54654
55602
  }
54655
55603
 
54656
55604
  /***********************************Outside events the webPlanner subscribes to ******************************************/
@@ -56981,6 +57929,484 @@ var PlannerElementData = /*#__PURE__*/function () {
56981
57929
  }]);
56982
57930
  }();
56983
57931
 
57932
+ /**
57933
+ * The VALUE ENCODING of every catalog/article/option/option-value property, keyed by codex.
57934
+ *
57935
+ * A property's `Value` travels as a STRING and each property decides how that string is read - '1' for one flag,
57936
+ * 'true' for the next, a ';' list for a third. This table records which, so an editor can offer the right control
57937
+ * and write back exactly what the parser reads, and so a caller can validate a value before storing it.
57938
+ *
57939
+ * GENERATED from the four parsers - do not hand-edit; regenerate when a `case` is added there:
57940
+ * CatalogData.ts | CatalogArticleData.ts | CatalogOptionData.ts | CatalogOptionValueData.ts
57941
+ * `propertyValueCodec.test.ts` fails when a parser case has no entry here.
57942
+ */
57943
+
57944
+ /** The entity a property hangs on; the same codex can mean different things on different entities. */
57945
+
57946
+ /**
57947
+ * How the raw string is turned into a value. The boolean variants are NOT interchangeable: writing 'true' where
57948
+ * the parser tests `== '1'` silently yields false, and `boolean:present` treats EVERY non-empty string as true,
57949
+ * so its off-state is an ABSENT value rather than '0'.
57950
+ */
57951
+
57952
+ /** The encoding per property codex, for one entity. */
57953
+
57954
+ /** 95 properties parsed on the catalog entity. */
57955
+ var CATALOG_PROPERTIES = {
57956
+ '3D_COMPATIBLE_WITH_IMAGE_CACHE': 'boolean:1',
57957
+ ACCESSOIRE_STEP_AS_PLANNER: 'boolean:1',
57958
+ ADD_NEW_LINE_BEFOR_RULEDESC: 'boolean:1',
57959
+ ADD_PA_ON_EDO: 'opaque',
57960
+ ADD_POS_INVISIBILITY_TO_OL: 'boolean:1',
57961
+ ARTICLECONFIGALL: 'boolean:1',
57962
+ ARTICLECONFIGSINGLE: 'boolean:1',
57963
+ ARTICLE_NR: 'string',
57964
+ AUTO_OPEN_CONTENTITEM: 'all-or-list:;',
57965
+ BANNER: 'json',
57966
+ BUNDLE_RULES: 'json',
57967
+ CHECK_COLLISION_DIFFERENT_LAYERS: 'list:;',
57968
+ CONFIG_ACCESSOIRES: 'boolean:1',
57969
+ CONFIG_ONLY_ACCESSOIRES: 'boolean:1',
57970
+ DEFAULT_DO_SHOW_3DDIMENSIONS: 'boolean:1|true',
57971
+ DEFAULT_GROUPS_CLOSED: 'boolean-or-list:;',
57972
+ DIMENSION_CONFIG: 'json',
57973
+ DIVA3D_AR_FORCERTV: 'boolean:1',
57974
+ DIVA3D_AR_READY: 'boolean:1',
57975
+ DIVA3D_DISABLE_3DEXPORT: 'boolean:1',
57976
+ DIVA3D_PLANER_DIGITS: 'number',
57977
+ DIVA3D_PLANER_SHOW_ARTICLE_SVG: 'boolean:1',
57978
+ DIVA3D_RENDERING: 'boolean:1|true',
57979
+ DIVA3D_ROOM: 'string',
57980
+ DIVA3D_STATIC_BG_IMAGE_ROOMLIST: 'list:;',
57981
+ DIVA3D_USE_RTV_NEXT: 'boolean:1',
57982
+ DIVA_KI_READY: 'boolean:1|true',
57983
+ DOCKACCONAVOONLY: 'boolean:1',
57984
+ DONTCALCBASEPRICE: 'boolean:1',
57985
+ DONTHIDEOPTION: 'list:,',
57986
+ DONT_SAVE_ALTERNATIVERENDERINGS: 'boolean:1',
57987
+ DONT_SET_POSNR_FROM_PLANNER: 'boolean:1',
57988
+ DONT_SHOW_ACC_STEP: 'boolean:1',
57989
+ DONT_USE_VCODEX_FOR_BASKET: 'boolean:1',
57990
+ DO_SHOW_MAIN_DIMENSIONS: 'boolean:1|true',
57991
+ DO_USE_RULEDESC_FOR_PARTLIST: 'boolean:1',
57992
+ ELEMENT_COPY_AVLR: 'all-or-list:;',
57993
+ ENABLE_DO_SHOW_3DDIMENSIONS: 'boolean:1|true',
57994
+ FILTER_FOR_CHECKOUT_BUTTONS: 'list:;',
57995
+ FORCECONSTRUCTIONWARNINGARTICLES: 'list:;',
57996
+ FORCE_CONFIG_ALL_ACCESSOIRES: 'boolean:1',
57997
+ FORCE_CONFIG_SINGLE: 'boolean:1',
57998
+ HEADER_DIMENSION_IDS: 'list:;',
57999
+ HIDECOMPLETENESSWARNING: 'boolean:1',
58000
+ HIDECONSTRUCTIONWARNING: 'opaque',
58001
+ HIDE_2D_PLANNER: 'boolean:1',
58002
+ HIDE_AV_BUTTONS: 'string',
58003
+ HIDE_PLANNER_UI_ICONS: 'boolean:1',
58004
+ HIDE_PRICEPREVIEW_ON_OPTIONS: 'list:;',
58005
+ HIDE_PRICE_GROUPS_OF_OPGS: 'boolean:1',
58006
+ HIDE_SUBPOS_ARTICLECODEX_EKTEXT: 'boolean:1',
58007
+ IDM3D_CAT_CODEX: 'string',
58008
+ IDM3D_ENVIRONMENT: 'string',
58009
+ IGNOREDOCKINGNUMBER: 'boolean:1',
58010
+ IGNORELAYERAVC: 'boolean:1',
58011
+ IGNORELAYERAVNAVS: 'boolean:1',
58012
+ IGNORELAYERAVOAVU: 'boolean:1',
58013
+ IGNORE_ARTICLERELATIONS: 'boolean:1',
58014
+ IGNORE_ISDEFINED_CHECK: 'boolean:1',
58015
+ IGNORE_MAX_PRICE_AS_BASEPRICE: 'boolean:1',
58016
+ INIT_OPTIONTREE_TWICE: 'boolean:1',
58017
+ IS_IDM3D_CAT: 'boolean:1|true',
58018
+ MERGE_OPTIONS_TO_SAME_OPTION: 'list:;',
58019
+ NOTIFICATIONS: 'json',
58020
+ ONCONFIG_SINGLE_DONT_GENERALIZE: 'boolean:1',
58021
+ PARTLIST_POSTFIX: 'list:;',
58022
+ PLANNERTYPE: 'string',
58023
+ PLANNER_2DOT0: 'boolean:1',
58024
+ PLANNER_REPLACE_MODE: 'boolean:1',
58025
+ PLAN_2D_FONT_URL: 'string',
58026
+ PROGRAM_NR: 'string',
58027
+ RECONFIG_AFTER_ARTICLE_DOCKED: 'boolean:1',
58028
+ REPAIR_VARIANT_VALUES: 'opaque',
58029
+ RTV_PRESET: 'json',
58030
+ SHOWACCESSOIREONLASTTAB: 'boolean:1',
58031
+ SHOWACCONDPONLY: 'boolean:1',
58032
+ SHOWTYPENRINPLANNER: 'boolean:1',
58033
+ SHOW_AI_ROOM_RENDERING_IN_SUMMARY: 'boolean:1',
58034
+ SHOW_AI_ROOM_RENDERING_SUMMARY: 'boolean:1',
58035
+ SHOW_ALL_ITEMS_IN_PLANNER: 'boolean:1',
58036
+ SHOW_PRICEPREVIEW_ON_OPTIONS: 'list:;',
58037
+ STARTFILTERPARAMS: 'string',
58038
+ STARTHIDEARTICLES: 'list:;',
58039
+ START_PLANNER_ARTICLE: 'string',
58040
+ SUMMARY_TABGROUP_POSITION: 'list:;',
58041
+ USEBOXPLANNER: 'all-or-list:;',
58042
+ USEGLOBALSVGSCALE: 'boolean:1',
58043
+ USEPOSCOUNTVALUE: 'boolean:1',
58044
+ USEPRGASOPVARTICLENR: 'boolean:1',
58045
+ USE_DECISION_POS_COUNT_VALUE: 'boolean:1',
58046
+ USE_DIOMEX_CONFIG_LOGIC: 'boolean:1',
58047
+ USE_SHELFPLANNER_RTV: 'boolean:1',
58048
+ USE_SHORT_NAME_AS_NAME: 'boolean:1',
58049
+ USE_TYPENR_AS_ARTICLENR_EKTEXT: 'boolean:1',
58050
+ WARNINGS: 'json'
58051
+ };
58052
+
58053
+ /** 30 properties parsed on the article entity. */
58054
+ var ARTICLE_PROPERTIES = {
58055
+ '3DMODELNAME': 'string',
58056
+ ACCESSOIRE_POS_PRIO: 'number',
58057
+ ADD_AS_ZKAT: 'boolean:1|true',
58058
+ BASIC_UNIT_PRICE: 'number',
58059
+ BUNDLE_RULES: 'json',
58060
+ CONTENT_ITEM: 'string',
58061
+ DEPTH_HAS_PRICE: 'string',
58062
+ DO_NOT_DEL_ACC_IF_NOT_DOCKED: 'string',
58063
+ GROUP_CONTENT_ITEM: 'string',
58064
+ HAS3D: 'string',
58065
+ HEIGHTGRIDABOVE: 'number',
58066
+ HEIGHTGRIDBELOW: 'number',
58067
+ HEIGHTGRIDUSED: 'number',
58068
+ HEIGHT_HAS_PRICE: 'string',
58069
+ HIDE_IN_PLANNERSTEP: 'boolean:present',
58070
+ INVALID_ACCESSORIES: 'list:,',
58071
+ MAX_PLANNING_COUNT: 'number',
58072
+ ON_CONFIG_OPTION: 'string',
58073
+ ON_SET_CONFIG_OPTION: 'string',
58074
+ OPTIONS_FOR_PRINT: 'list:;',
58075
+ ORDER_POSNR: 'string',
58076
+ OVERWRITE_PARENT_DEPTH: 'string',
58077
+ OVERWRITE_PARENT_HEIGHT: 'string',
58078
+ OVERWRITE_PARENT_WIDTH: 'string',
58079
+ RETAIL_PREFIX: 'string',
58080
+ TABGROUP: 'string',
58081
+ TABGROUP_OPTIONS: 'string',
58082
+ TYPE_NO: 'string',
58083
+ WIDTH_HAS_PRICE: 'string',
58084
+ ZUBEHOER_FAMILIE: 'string'
58085
+ };
58086
+
58087
+ /** 40 properties parsed on the option entity. */
58088
+ var OPTION_PROPERTIES = {
58089
+ ADDITIONAL_GROUP_FILTER: 'json',
58090
+ ADD_OPT_TO_TABGROUP_IN_PL_SUM: 'string',
58091
+ ADD_TO_WWS: 'boolean:present',
58092
+ CHECK_FOR_REVERSE_CHANGES: 'list:;',
58093
+ CONTENT_ITEM: 'string',
58094
+ CONTENT_ITEM_TEASER: 'json',
58095
+ CUSTOM_DIMENSION: 'boolean:present',
58096
+ CUSTOM_DIMENSION_TEXT: 'string',
58097
+ DEFAULT_SIBLING_OPTION: 'string',
58098
+ DESCRIPTION: 'string',
58099
+ DIAMETER: 'boolean:present',
58100
+ EshopCategoryMapping: 'ignored',
58101
+ EshopSearchRelevant: 'ignored',
58102
+ FEATURE_TYPE: 'ignored',
58103
+ FREETEXT_DEFAULT_VALUE: 'string',
58104
+ GROUP_OPTIONS_LEFT_AND_RIGHT: 'list:;',
58105
+ HIDE_OPTION_IN_CONFIGURATOR: 'boolean:present',
58106
+ IGNORE_GROUPS: 'boolean:1',
58107
+ IGNORE_PGR_GROUP_POSITION: 'boolean:1',
58108
+ INFO_PDF: 'string',
58109
+ INFO_URL: 'string',
58110
+ ION_COMMENT_TEXT: 'ignored',
58111
+ ISDEFAULTVALUEFOROPTIONS: 'string',
58112
+ IS_MAIN_COLOR: 'boolean:present',
58113
+ IS_STATE: 'boolean:present',
58114
+ IsArtName: 'ignored',
58115
+ IsSalesText: 'ignored',
58116
+ MERGE_IDM_TO_OPG: 'string',
58117
+ ONLY_VISIBLE_IF_CONFIG_ALL: 'string',
58118
+ ONLY_VISIBLE_IF_CONFIG_SINGLE: 'string',
58119
+ ONLY_VISIBLE_IF_NOT_UNDOCK: 'string',
58120
+ REQUIRED_OPTION: 'boolean:present',
58121
+ REQUIRES_USER_INPUT: 'boolean:present',
58122
+ SETNAME: 'boolean:present',
58123
+ SHOW_FILTER: 'boolean:1',
58124
+ SHOW_IN_BASKET_WHEN_HAS_PRICE: 'ignored',
58125
+ SHOW_IN_VARIANTDESC: 'string',
58126
+ SHOW_SEARCHBAR: 'boolean:1',
58127
+ SHOW_SEPARAT_ON_TABGROUP: 'string',
58128
+ SUGGESTED_OPTION: 'boolean:present'
58129
+ };
58130
+
58131
+ /** 30 properties parsed on the optionValue entity. */
58132
+ var OPTIONVALUE_PROPERTIES = {
58133
+ ADD_TO_MEASURE: 'list:;',
58134
+ CONTENT_ITEM: 'string',
58135
+ CUSTOM_DIMENSION: 'opaque',
58136
+ DEFAULT_VALUE: 'string',
58137
+ EshopCategoryMapping: 'ignored',
58138
+ GROUP_CONTENT_ITEM: 'string',
58139
+ HIDE_IN_SUMMARY: 'boolean:present',
58140
+ INFO_PDF: 'string',
58141
+ INFO_URL: 'string',
58142
+ ION_COMMENT_TEXT: 'ignored',
58143
+ IS_NOT_RELEVANT: 'boolean:present',
58144
+ IsArtName: 'ignored',
58145
+ IsVariantAttribute: 'boolean:1',
58146
+ MEASURE_MAXIMUM: 'string',
58147
+ MEASURE_MINIMUM: 'string',
58148
+ MEASURE_STEP: 'string',
58149
+ MEASURE_UNIT: 'string',
58150
+ ONLY_VISIBLE_IF_NOT_UNDOCK: 'string',
58151
+ ON_RULE: 'string',
58152
+ OPTION_FREE_TEXT: 'boolean:present',
58153
+ PIMFlatValues: 'boolean:1',
58154
+ PRICE_UNIT: 'string',
58155
+ PriceTageRelevant: 'ignored',
58156
+ SAME_OPV: 'string',
58157
+ SETNAME: 'string',
58158
+ SET_BY_RULE: 'string',
58159
+ SET_CONFIG: 'string',
58160
+ SUMMARY_CODEX: 'string',
58161
+ TopFilterAttribute: 'ignored',
58162
+ VIEWPOINTNAME: 'string'
58163
+ };
58164
+ var PROPERTY_SCHEMAS = {
58165
+ catalog: CATALOG_PROPERTIES,
58166
+ article: ARTICLE_PROPERTIES,
58167
+ option: OPTION_PROPERTIES,
58168
+ optionValue: OPTIONVALUE_PROPERTIES
58169
+ };
58170
+
58171
+ /**
58172
+ * The encoding of one property, or undefined when the codex is not one the engine parses - an organization's own
58173
+ * key, which stays free text. A catalog-prefixed codex ('MYCAT__USEBOXPLANNER') resolves to its bare form, the
58174
+ * same way the parsers strip it.
58175
+ */
58176
+ function propertyEncodingOf(codex, entity) {
58177
+ var bare = codex.includes('__') ? codex.slice(codex.indexOf('__') + 2) : codex;
58178
+ var entities = entity ? [entity] : ['catalog', 'article', 'option', 'optionValue'];
58179
+ for (var _i = 0, _entities = entities; _i < _entities.length; _i++) {
58180
+ var candidate = _entities[_i];
58181
+ // Own keys only: a codex like 'constructor' or 'toString' would otherwise resolve to an inherited function.
58182
+ if (Object.prototype.hasOwnProperty.call(PROPERTY_SCHEMAS[candidate], bare)) return PROPERTY_SCHEMAS[candidate][bare];
58183
+ }
58184
+ return undefined;
58185
+ }
58186
+
58187
+ /**
58188
+ * Reading and writing a property VALUE in the encoding its own parser expects.
58189
+ *
58190
+ * Every property travels as a string and each one decides how that string is read (see propertySchemaRegistry).
58191
+ * An editor therefore cannot write "a boolean" - it has to write the dialect of THAT property, or the parser reads
58192
+ * the opposite of what the user chose. These two functions are that translation:
58193
+ *
58194
+ * - `decodePropertyValue` is DELIBERATELY TOLERANT. Stored values are a decade of history: the raw strings the
58195
+ * parsers document, real booleans and numbers written by editors that typed them natively, and the '.ToString()'
58196
+ * spellings those turn into on the way out ('True'). All of them must display as what they mean, or an editor
58197
+ * would show a flag as off and silently turn it off on the next save.
58198
+ * - `encodePropertyValue` is STRICT. It emits exactly one spelling per encoding - the one the parser reads.
58199
+ */
58200
+
58201
+ /** What a decoded property value can be, before an editor renders it. */
58202
+
58203
+ /** The raw string a stored value amounts to - what `.ToString()` would hand the parser. */
58204
+ function rawStringOf(stored) {
58205
+ if (stored === undefined || stored === null) return '';
58206
+ if (typeof stored === 'string') return stored;
58207
+ // A real boolean stored natively reaches the parser as .NET spells it, capital included.
58208
+ if (typeof stored === 'boolean') return stored ? 'True' : 'False';
58209
+ if (typeof stored === 'number') return String(stored);
58210
+ return JSON.stringify(stored);
58211
+ }
58212
+
58213
+ /**
58214
+ * Reads a stored boolean EXACTLY the way the property's parser does - the editor must show what the engine sees.
58215
+ * A `== '1'` property holding 'true' (or a natively stored True) is OFF in the engine; showing it as on would let
58216
+ * the next save switch the flag on for real. `boolean:present` is the odd one out, see the first branch.
58217
+ */
58218
+ function decodeBoolean(raw, encoding) {
58219
+ // ANY non-empty string is true here, '0' and 'false' included - the parser does `!!Value`. Reading it as a
58220
+ // normal boolean would show 'off' for a flag that is on, and the next save would write the user's wrong idea back.
58221
+ if (encoding === 'boolean:present') return raw !== '';
58222
+ var token = raw.trim();
58223
+ // The `'true'` parsers mostly lower-case before comparing, the `'1'` parsers compare the digit as is.
58224
+ var isOne = token === '1';
58225
+ var isTrue = token.toLowerCase() === 'true';
58226
+ if (encoding === 'boolean:1') return isOne;
58227
+ if (encoding === 'boolean:true') return isTrue;
58228
+ return isOne || isTrue;
58229
+ }
58230
+
58231
+ /** Splits a delimited list, dropping the empty segments a trailing delimiter leaves behind. */
58232
+ function decodeList(raw, separator) {
58233
+ return raw.split(separator).map(function (entry) {
58234
+ return entry.trim();
58235
+ }).filter(function (entry) {
58236
+ return entry !== '';
58237
+ });
58238
+ }
58239
+
58240
+ /**
58241
+ * Joins list entries, or removes the property when nothing is left: '' would reach the parser's `split` and come
58242
+ * back as the single entry '' - a cleared list must not turn into a list of one nameless group.
58243
+ */
58244
+ function encodeList(value, separator) {
58245
+ if (Array.isArray(value)) {
58246
+ var entries = value.map(function (entry) {
58247
+ return String(entry).trim();
58248
+ }).filter(function (entry) {
58249
+ return entry !== '';
58250
+ });
58251
+ return entries.length === 0 ? undefined : entries.join(separator);
58252
+ }
58253
+ // A boolean has no list spelling: 'True' would come back as a list of one entry literally named 'True'.
58254
+ if (typeof value === 'boolean') return undefined;
58255
+ var raw = rawStringOf(value);
58256
+ return raw === '' ? undefined : raw;
58257
+ }
58258
+
58259
+ /**
58260
+ * The value an editor should show for a stored property. `stored` is what the record holds - a string in the
58261
+ * normal case, or a natively-typed value from an editor that wrote one.
58262
+ */
58263
+ function decodePropertyValue(encoding, stored) {
58264
+ var raw = rawStringOf(stored);
58265
+ switch (encoding) {
58266
+ case 'boolean:1':
58267
+ case 'boolean:1|true':
58268
+ case 'boolean:true':
58269
+ case 'boolean:present':
58270
+ return decodeBoolean(raw, encoding);
58271
+ case 'number':
58272
+ {
58273
+ if (raw.trim() === '') return undefined;
58274
+ // German decimal commas reach these fields through spreadsheets and locale-formatted writers.
58275
+ var parsed = Number(raw.trim().replace(',', '.'));
58276
+ return Number.isFinite(parsed) ? parsed : undefined;
58277
+ }
58278
+ case 'list:;':
58279
+ return decodeList(raw, ';');
58280
+ case 'list:,':
58281
+ return decodeList(raw, ',');
58282
+
58283
+ // '1' means EVERYTHING; any other value is a list. Kept as the literal '1' so an editor can offer the two
58284
+ // states as a choice rather than making the user know the convention.
58285
+ case 'all-or-list:;':
58286
+ return raw.trim() === '1' ? true : decodeList(raw, ';');
58287
+
58288
+ // Three states, not two: '1' is ALL, '0' is NONE, and anything else is the list of the ones that apply.
58289
+ // '0' must NOT read as a one-entry list - that is how an off-state turns into the group literally named '0'.
58290
+ case 'boolean-or-list:;':
58291
+ {
58292
+ var token = raw.trim();
58293
+ if (token === '1') return true;
58294
+ if (token === '0') return false;
58295
+ return decodeList(raw, ';');
58296
+ }
58297
+ case 'json':
58298
+ {
58299
+ if (raw.trim() === '') return undefined;
58300
+ try {
58301
+ return JSON.parse(raw);
58302
+ } catch (_unused) {
58303
+ // Invalid JSON is still the user's text - hand it back so the editor can show and repair it rather than
58304
+ // replacing their work with an empty object.
58305
+ return raw;
58306
+ }
58307
+ }
58308
+ default:
58309
+ return raw === '' ? undefined : raw;
58310
+ }
58311
+ }
58312
+
58313
+ /**
58314
+ * The string to store for an edited value - exactly the spelling the property's parser reads.
58315
+ * `undefined` means the property should be REMOVED rather than written empty, which is how a `boolean:present`
58316
+ * flag is switched off.
58317
+ */
58318
+ function encodePropertyValue(encoding, value) {
58319
+ switch (encoding) {
58320
+ case 'boolean:1':
58321
+ case 'boolean:1|true':
58322
+ return value ? '1' : '0';
58323
+ case 'boolean:true':
58324
+ return value ? 'true' : 'false';
58325
+
58326
+ // Off is the ABSENCE of a value: this parser reads every non-empty string as true, so writing '0' or 'false'
58327
+ // would leave the flag ON.
58328
+ case 'boolean:present':
58329
+ return value ? '1' : undefined;
58330
+ case 'number':
58331
+ {
58332
+ // Blank input (including whitespace) clears the property; Number('') would be 0.
58333
+ if (value === undefined || value === null || String(value).trim() === '') return undefined;
58334
+ var parsed = typeof value === 'number' ? value : Number(String(value).trim().replace(',', '.'));
58335
+ // A decimal point, never a comma - the parsers run Number() on this string.
58336
+ return Number.isFinite(parsed) ? String(parsed) : undefined;
58337
+ }
58338
+ case 'list:;':
58339
+ return encodeList(value, ';');
58340
+ case 'list:,':
58341
+ return encodeList(value, ',');
58342
+
58343
+ // '1' is ALL; there is no spelling for OFF, so `false` removes the property (the list branch would otherwise
58344
+ // store the text 'False' as a one-entry list).
58345
+ case 'all-or-list:;':
58346
+ if (value === true) return '1';
58347
+ if (value === false) return undefined;
58348
+ return encodeList(value, ';');
58349
+ case 'boolean-or-list:;':
58350
+ if (value === true) return '1';
58351
+ // The off-state has its own spelling here, so it is written rather than left to the list branch, which
58352
+ // would REMOVE the property for an empty list instead of switching the state off.
58353
+ if (value === false) return '0';
58354
+ return encodeList(value, ';');
58355
+ case 'json':
58356
+ {
58357
+ if (value === undefined || value === '') return undefined;
58358
+ // Already-text stays text: it is either JSON the user typed or something they are still repairing.
58359
+ return typeof value === 'string' ? value : JSON.stringify(value);
58360
+ }
58361
+ default:
58362
+ {
58363
+ var raw = rawStringOf(value);
58364
+ return raw === '' ? undefined : raw;
58365
+ }
58366
+ }
58367
+ }
58368
+
58369
+ /** Whether a value can be stored for this encoding at all - what an editor blocks saving on. */
58370
+ function propertyValueProblem(encoding, value) {
58371
+ if (encoding === 'json' && typeof value === 'string' && value.trim() !== '') {
58372
+ try {
58373
+ JSON.parse(value);
58374
+ } catch (_unused2) {
58375
+ return 'invalidJson';
58376
+ }
58377
+ }
58378
+ if (encoding === 'number' && value !== undefined && String(value).trim() !== '') {
58379
+ var parsed = typeof value === 'number' ? value : Number(String(value).trim().replace(',', '.'));
58380
+ if (!Number.isFinite(parsed)) return 'notANumber';
58381
+ }
58382
+
58383
+ // A ';' inside a ';'-list entry would split it into two on the way back in - and every encoding that JOINS on
58384
+ // ';' is exposed to it, not just the plain list.
58385
+ var joinsOnSemicolon = encoding === 'list:;' || encoding === 'all-or-list:;' || encoding === 'boolean-or-list:;';
58386
+ if (joinsOnSemicolon && Array.isArray(value) && value.some(function (entry) {
58387
+ return String(entry).includes(';');
58388
+ })) {
58389
+ return 'separatorInEntry';
58390
+ }
58391
+ if (encoding === 'list:,' && Array.isArray(value) && value.some(function (entry) {
58392
+ return String(entry).includes(',');
58393
+ })) {
58394
+ return 'separatorInEntry';
58395
+ }
58396
+ return undefined;
58397
+ }
58398
+
58399
+ /** The control an editor should render for an encoding. */
58400
+ function editorKindOf(encoding) {
58401
+ if (encoding.startsWith('boolean:')) return 'checkbox';
58402
+ if (encoding === 'number') return 'number';
58403
+ if (encoding === 'list:;' || encoding === 'list:,') return 'list';
58404
+ if (encoding === 'all-or-list:;') return 'allOrList';
58405
+ if (encoding === 'boolean-or-list:;') return 'boolOrList';
58406
+ if (encoding === 'json') return 'json';
58407
+ return 'text';
58408
+ }
58409
+
56984
58410
  /**
56985
58411
  * Placeholder for the set name in the Serious checkout. API2 bed catalogs yield "<headboard> - <width> X <length>" from the
56986
58412
  * OPTBR / OPTLAE options and the headboard partlist article. IDM catalogs have none of these, so the selected values of the
@@ -74217,4 +75643,4 @@ function _withTimeout() {
74217
75643
  return _withTimeout.apply(this, arguments);
74218
75644
  }
74219
75645
 
74220
- export { ArtifactGenerationError as A, BoundingBox as B, Cell as C, DivaWebPlanner as D, Grid as G, HQRenderScript as H, JsonDataCache as J, OptionCatalogData as O, PlannerElementData as P, Rendering as R, Vector3 as V, articleHandlerInstance as a, setHandlerInstance as b, Vector2 as c, bootMark as d, DivaArticle as e, DivaCatalogData as f, DivaBasketHandler as g, CatalogPlannerArticleData as h, getSeriousSetNamePlaceholder as i, bootMarksEnabled as j, bootNetworkMark as k, loadAndRepairBasket as l, bootNow as m, bootRequestName as n, Vector4 as o, creatRenderOrders as p, getOrigProductId as q, headlessSession as r, summaryHandlerInstance as s, collectStructureStepKeys as t, runHeadlessArtifactPass as u, runHeadlessArtifactPassBatch as v };
75646
+ export { collectStructureStepKeys as A, BoundingBox as B, Cell as C, DivaWebPlanner as D, runHeadlessArtifactPass as E, runHeadlessArtifactPassBatch as F, Grid as G, HQRenderScript as H, ArtifactGenerationError as I, JsonDataCache as J, OptionCatalogData as O, PlannerElementData as P, Rendering as R, Vector3 as V, articleHandlerInstance as a, setHandlerInstance as b, Vector2 as c, bootMark as d, DivaArticle as e, DivaCatalogData as f, DivaBasketHandler as g, CatalogPlannerArticleData as h, PROPERTY_SCHEMAS as i, decodePropertyValue as j, encodePropertyValue as k, loadAndRepairBasket as l, propertyValueProblem as m, editorKindOf as n, getSeriousSetNamePlaceholder as o, propertyEncodingOf as p, bootMarksEnabled as q, rawStringOf as r, summaryHandlerInstance as s, bootNetworkMark as t, bootNow as u, bootRequestName as v, Vector4 as w, creatRenderOrders as x, getOrigProductId as y, headlessSession as z };