@crystaldesign/web-planner-logic 26.12.0-beta.27 → 26.12.0-beta.29

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 (40) hide show
  1. package/build/cjs/{DivaBoxPlanner-69dd68ba.js → DivaBoxPlanner-0f7e2078.js} +3 -3
  2. package/build/cjs/{DivaStandardPlanner-1e17ea12.js → DivaStandardPlanner-ebfa66c4.js} +2 -2
  3. package/build/cjs/{DoorPlanner-602a86f3.js → DoorPlanner-15cb0430.js} +2 -2
  4. package/build/cjs/{Host3DSignalR-09d9efe0.js → Host3DSignalR-5aede7a4.js} +2 -2
  5. package/build/cjs/{LiviqueWWSHandler-9497b33d.js → LiviqueWWSHandler-1f3f4217.js} +2 -2
  6. package/build/cjs/{PfisterWWSHandler-14686c6d.js → PfisterWWSHandler-185178ce.js} +2 -2
  7. package/build/cjs/{PlannerHandler2D-a22115ce.js → PlannerHandler2D-5a38f064.js} +5 -272
  8. package/build/cjs/{SeriousBasketHandler-acfb2f40.js → SeriousBasketHandler-e1ce56b0.js} +2 -2
  9. package/build/cjs/{ShelfPlanner-bd6038e1.js → ShelfPlanner-c7248511.js} +2 -2
  10. package/build/cjs/{StandardWWSHandler-bafafa71.js → StandardWWSHandler-e88dfbcf.js} +2 -2
  11. package/build/cjs/{index-cca37a97.js → index-0f7a7e3c.js} +696 -115
  12. package/build/cjs/index.js +1 -1
  13. package/build/esm/{DivaBoxPlanner-50d29c59.js → DivaBoxPlanner-3e72a31d.js} +3 -3
  14. package/build/esm/{DivaStandardPlanner-e1831308.js → DivaStandardPlanner-7afa7053.js} +2 -2
  15. package/build/esm/{DoorPlanner-598af141.js → DoorPlanner-531a001e.js} +2 -2
  16. package/build/esm/{Host3DSignalR-bc77d0ab.js → Host3DSignalR-61a6d882.js} +2 -2
  17. package/build/esm/{LiviqueWWSHandler-ace695dc.js → LiviqueWWSHandler-3c11a396.js} +2 -2
  18. package/build/esm/{PfisterWWSHandler-ebf67f99.js → PfisterWWSHandler-120f8933.js} +2 -2
  19. package/build/esm/{PlannerHandler2D-cb6781eb.js → PlannerHandler2D-91e383db.js} +3 -268
  20. package/build/esm/{SeriousBasketHandler-14961eb6.js → SeriousBasketHandler-070e3447.js} +2 -2
  21. package/build/esm/{ShelfPlanner-6f2b92a1.js → ShelfPlanner-29be7e07.js} +2 -2
  22. package/build/esm/{StandardWWSHandler-1c478a3c.js → StandardWWSHandler-359cb15b.js} +2 -2
  23. package/build/esm/{index-a201dfa2.js → index-16d95e66.js} +696 -116
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/interface/Planner/DockingPointDataType.d.ts +10 -0
  26. package/build/types/web-planner-logic/src/interface/Planner/DockingPointDataType.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/logic/Planner/PlannerUtils/SVGUtils.d.ts +8 -1
  28. package/build/types/web-planner-logic/src/logic/Planner/PlannerUtils/SVGUtils.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  30. package/build/types/web-planner-logic/src/model/Articles/Article/DivaCatalogArticle.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts +7 -0
  32. package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/model/Articles/CatalogPlannerArticleData.d.ts +6 -0
  34. package/build/types/web-planner-logic/src/model/Articles/CatalogPlannerArticleData.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts.map +1 -1
  36. package/build/types/web-planner-logic/src/test/accessoryWithoutDocking.test.d.ts +2 -0
  37. package/build/types/web-planner-logic/src/test/accessoryWithoutDocking.test.d.ts.map +1 -0
  38. package/build/types/web-planner-logic/src/test/countDockingPoints.test.d.ts +2 -0
  39. package/build/types/web-planner-logic/src/test/countDockingPoints.test.d.ts.map +1 -0
  40. package/package.json +3 -3
@@ -10,6 +10,7 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
10
10
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
11
11
  var axios$1 = require('axios');
12
12
  var DivaUtils = require('@crystaldesign/diva-utils');
13
+ var planner2dCore = require('@crystaldesign/planner-2d-core');
13
14
  var basketModel = require('@crystaldesign/basket-model');
14
15
  var _typeof = require('@babel/runtime/helpers/typeof');
15
16
  var fastXmlParser = require('fast-xml-parser');
@@ -19,7 +20,6 @@ var _inherits = require('@babel/runtime/helpers/inherits');
19
20
  var _wrapNativeSuper = require('@babel/runtime/helpers/wrapNativeSuper');
20
21
  var BasketHandler = require('@crystaldesign/basket-handler');
21
22
  var io = require('socket.io-client');
22
- require('@crystaldesign/planner-2d-core');
23
23
 
24
24
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
25
25
 
@@ -165,7 +165,7 @@ function _objectSpread$r(e) { for (var r = 1; r < arguments.length; r++) { var t
165
165
 
166
166
  // Import types from AI service
167
167
 
168
- var LOG$q = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
168
+ var LOG$r = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
169
169
 
170
170
  /**
171
171
  * Deadline for the optional catalog XML preload. Axios has no default timeout, and planner start-up
@@ -231,7 +231,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
231
231
  if (plannerConfig.settings) {
232
232
  this.initalizeWebConfigData(plannerConfig);
233
233
  } else {
234
- LOG$q.error(new DivaUtils.DivaError('Fehler beim laden der WebConfig', {
234
+ LOG$r.error(new DivaUtils.DivaError('Fehler beim laden der WebConfig', {
235
235
  code: 'WC_0001'
236
236
  }));
237
237
  throw Error('Initalize failed!');
@@ -292,7 +292,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
292
292
  case 0:
293
293
  skip = _args.length > 2 && _args[2] !== undefined ? _args[2] : 0;
294
294
  dontLogError = _args.length > 3 ? _args[3] : undefined;
295
- LOG$q.debug('DivaApiHandler.fetchData ' + url, 'DivaApiHandler, fetchData');
295
+ LOG$r.debug('DivaApiHandler.fetchData ' + url, 'DivaApiHandler, fetchData');
296
296
  if (init) {
297
297
  _context.next = 5;
298
298
  break;
@@ -333,7 +333,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
333
333
  netBytes = typeof data === 'string' ? data.length : Number((_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers['content-length']) || undefined;
334
334
  }
335
335
  if (data !== null && data !== void 0 && data.Error) {
336
- if (dontLogError) LOG$q.warn(data.Error + ' ' + url);else LOG$q.error(new DivaUtils.DivaError(data.Error, {
336
+ if (dontLogError) LOG$r.warn(data.Error + ' ' + url);else LOG$r.error(new DivaUtils.DivaError(data.Error, {
337
337
  code: 'WC_0001',
338
338
  custom: {
339
339
  url: url
@@ -455,7 +455,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
455
455
  return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
456
456
  while (1) switch (_context2.prev = _context2.next) {
457
457
  case 0:
458
- LOG$q.debug('getDataWithoutCache: ', {
458
+ LOG$r.debug('getDataWithoutCache: ', {
459
459
  queryString: queryString,
460
460
  init: init,
461
461
  useWebServiceApi: useWebServiceApi
@@ -533,7 +533,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
533
533
  return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
534
534
  while (1) switch (_context3.prev = _context3.next) {
535
535
  case 0:
536
- LOG$q.debug('getDataCache: ', {
536
+ LOG$r.debug('getDataCache: ', {
537
537
  queryString: queryString,
538
538
  cacheMD5: cacheMD5,
539
539
  accountSessionGuid: accountSessionGuid,
@@ -554,14 +554,14 @@ var DivaApiHandler = /*#__PURE__*/function () {
554
554
  _context3.next = 9;
555
555
  break;
556
556
  }
557
- LOG$q.debug('getDataFromInternalCache: ' + queryString);
557
+ LOG$r.debug('getDataFromInternalCache: ' + queryString);
558
558
  return _context3.abrupt("return", cacheHit);
559
559
  case 9:
560
560
  if (!(cacheMD5 && this.jsonDataCache.get(cacheMD5) && !((_this$divaWebConfigDa2 = this.divaWebConfigData) !== null && _this$divaWebConfigDa2 !== void 0 && _this$divaWebConfigDa2.addOrganizationIdToCacheKey))) {
561
561
  _context3.next = 12;
562
562
  break;
563
563
  }
564
- LOG$q.debug('getDataFromInternalCache: ' + queryString);
564
+ LOG$r.debug('getDataFromInternalCache: ' + queryString);
565
565
  return _context3.abrupt("return", this.jsonDataCache.get(cacheMD5));
566
566
  case 12:
567
567
  if (!addSession) {
@@ -611,7 +611,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
611
611
  // SHOULD have been authenticated against an account, the planner ends up using a
612
612
  // visitor sessionGuid (cached per organization in DataStore). Surface it so we
613
613
  // can spot regressions instead of silently sending the wrong GUID.
614
- LOG$q.warn('[SESSION-GUID][API] visitor fallback used for api2 call (no accountSessionGuid passed)', {
614
+ LOG$r.warn('[SESSION-GUID][API] visitor fallback used for api2 call (no accountSessionGuid passed)', {
615
615
  callTag: "api#".concat(this.instanceId, "/call#").concat(this.apiCallCount),
616
616
  queryString: queryString,
617
617
  organizationId: this.OrganizationId
@@ -633,7 +633,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
633
633
  this.jsonDataCache.set(myQS, result);
634
634
  if (cacheMD5 && !((_this$divaWebConfigDa3 = this.divaWebConfigData) !== null && _this$divaWebConfigDa3 !== void 0 && _this$divaWebConfigDa3.addOrganizationIdToCacheKey)) this.jsonDataCache.set(cacheMD5, result);
635
635
  }
636
- LOG$q.debug('getDataFromApi: ' + queryString);
636
+ LOG$r.debug('getDataFromApi: ' + queryString);
637
637
  return _context3.abrupt("return", result);
638
638
  case 41:
639
639
  case "end":
@@ -669,7 +669,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
669
669
  case 5:
670
670
  _context4.prev = 5;
671
671
  _context4.t0 = _context4["catch"](1);
672
- LOG$q.error(new DivaUtils.DivaError('could not create product in Configurator', {
672
+ LOG$r.error(new DivaUtils.DivaError('could not create product in Configurator', {
673
673
  cause: _context4.t0
674
674
  }));
675
675
  return _context4.abrupt("return", false);
@@ -1654,7 +1654,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1654
1654
  status = _context12.t0 === null || _context12.t0 === void 0 || (_e$response3 = _context12.t0.response) === null || _e$response3 === void 0 ? void 0 : _e$response3.status;
1655
1655
  body = _context12.t0 === null || _context12.t0 === void 0 || (_e$response4 = _context12.t0.response) === null || _e$response4 === void 0 ? void 0 : _e$response4.data;
1656
1656
  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;
1657
- LOG$q.error(new Error("Failed to create lead key for email ".concat(email, ": ").concat(apiMessage)));
1657
+ LOG$r.error(new Error("Failed to create lead key for email ".concat(email, ": ").concat(apiMessage)));
1658
1658
  throw new DivaUtils.DivaError(apiMessage || 'Failed to create lead key', {
1659
1659
  code: 'LEAD_KEY_REQUEST_FAILED',
1660
1660
  custom: {
@@ -1750,7 +1750,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1750
1750
  case 9:
1751
1751
  _context14.prev = 9;
1752
1752
  _context14.t0 = _context14["catch"](4);
1753
- LOG$q.error(new DivaUtils.DivaError('Error Connecting to Support-Service-LivePlanner', {
1753
+ LOG$r.error(new DivaUtils.DivaError('Error Connecting to Support-Service-LivePlanner', {
1754
1754
  cause: _context14.t0
1755
1755
  }));
1756
1756
  case 12:
@@ -1797,7 +1797,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1797
1797
  case 10:
1798
1798
  _context15.prev = 10;
1799
1799
  _context15.t0 = _context15["catch"](3);
1800
- LOG$q.error({
1800
+ LOG$r.error({
1801
1801
  message: 'Could not fetch dimension',
1802
1802
  name: 'get dimension error'
1803
1803
  });
@@ -1855,7 +1855,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1855
1855
  case 9:
1856
1856
  _context16.prev = 9;
1857
1857
  _context16.t0 = _context16["catch"](3);
1858
- LOG$q.error({
1858
+ LOG$r.error({
1859
1859
  message: 'Could not fetch catalogXml',
1860
1860
  name: 'get catalogXml error'
1861
1861
  });
@@ -1934,7 +1934,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1934
1934
  case 14:
1935
1935
  _context17.prev = 14;
1936
1936
  _context17.t0 = _context17["catch"](6);
1937
- LOG$q.error(new DivaUtils.DivaError('Error Connecting to Report Service', {
1937
+ LOG$r.error(new DivaUtils.DivaError('Error Connecting to Report Service', {
1938
1938
  cause: _context17.t0
1939
1939
  }));
1940
1940
  case 17:
@@ -2457,6 +2457,22 @@ var CatalogPlannerArticleData = /*#__PURE__*/function () {
2457
2457
  }
2458
2458
  return false;
2459
2459
  }
2460
+
2461
+ /**
2462
+ * Overwrites the docking point counts of the top svg. For IDM articles whose detail info delivered no
2463
+ * counts, so their svg was counted instead - without counts an article is not dockable (see isDockable).
2464
+ */
2465
+ }, {
2466
+ key: "applyDockingPointCounts",
2467
+ value: function applyDockingPointCounts(counts) {
2468
+ this.catPlanArt.topAVC = counts.avc;
2469
+ this.catPlanArt.topAVN = counts.avn;
2470
+ this.catPlanArt.topAVO = counts.avo;
2471
+ this.catPlanArt.topAVS = counts.avs;
2472
+ this.catPlanArt.topAVU = counts.avu;
2473
+ this.catPlanArt.topHasAVL = counts.avl > 0;
2474
+ this.catPlanArt.topHasAVR = counts.avr > 0;
2475
+ }
2460
2476
  }, {
2461
2477
  key: "filterType",
2462
2478
  get: function get() {
@@ -2468,7 +2484,7 @@ var CatalogPlannerArticleData = /*#__PURE__*/function () {
2468
2484
  }]);
2469
2485
  }();
2470
2486
 
2471
- var LOG$p = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
2487
+ var LOG$q = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
2472
2488
  var OptionCatalogData = /*#__PURE__*/function () {
2473
2489
  function OptionCatalogData(opt, catalogData) {
2474
2490
  var _this$opt$property;
@@ -2899,7 +2915,7 @@ var setOptionsProperties = function setOptionsProperties(catalogData, opt, prope
2899
2915
  case 'IsArtName':
2900
2916
  break;
2901
2917
  default:
2902
- LOG$p.debug('implement mapping for these props for options: ' + prop.Codex);
2918
+ LOG$q.debug('implement mapping for these props for options: ' + prop.Codex);
2903
2919
  break;
2904
2920
  }
2905
2921
  }
@@ -16694,7 +16710,7 @@ var ralClassics = [{
16694
16710
  rgb: '#7E8182'
16695
16711
  }];
16696
16712
 
16697
- var LOG$o = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
16713
+ var LOG$p = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
16698
16714
  var OptionValueCatalogData = /*#__PURE__*/function () {
16699
16715
  function OptionValueCatalogData(opv, catalogData) {
16700
16716
  var _this = this,
@@ -17186,7 +17202,7 @@ var setOptionValueProperties = function setOptionValueProperties(catalogData, op
17186
17202
  break;
17187
17203
  default:
17188
17204
  if (key.includes('__')) break;
17189
- LOG$o.debug('implement mapping for these props for optionValue: ' + prop.Codex);
17205
+ LOG$p.debug('implement mapping for these props for optionValue: ' + prop.Codex);
17190
17206
  var values_locales = [];
17191
17207
  if (prop.Value_locales) {
17192
17208
  var _prop$Value_locales;
@@ -17212,9 +17228,9 @@ var setOptionValueProperties = function setOptionValueProperties(catalogData, op
17212
17228
  return metaDatas;
17213
17229
  };
17214
17230
 
17215
- function _createForOfIteratorHelper$l(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$l(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; } } }; }
17216
- function _unsupportedIterableToArray$l(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$l(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$l(r, a) : void 0; } }
17217
- function _arrayLikeToArray$l(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; }
17231
+ function _createForOfIteratorHelper$n(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$n(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; } } }; }
17232
+ function _unsupportedIterableToArray$n(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$n(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$n(r, a) : void 0; } }
17233
+ function _arrayLikeToArray$n(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; }
17218
17234
  //kaufmännischer Artikel
17219
17235
  var CatalogArticleData = /*#__PURE__*/function () {
17220
17236
  function CatalogArticleData(catalogArticle, catalogData) {
@@ -18000,7 +18016,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
18000
18016
  value: function getOptionValueFromOption(opt, opv) {
18001
18017
  if (this._catalogArticle.articleOptions[opt] && this._catalogArticle.articleOptions[opt].hasOPG) {
18002
18018
  var myOPGs = this._catalogArticle.articleOptions[opt].articleOptionValues;
18003
- var _iterator = _createForOfIteratorHelper$l(myOPGs),
18019
+ var _iterator = _createForOfIteratorHelper$n(myOPGs),
18004
18020
  _step;
18005
18021
  try {
18006
18022
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -18067,7 +18083,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
18067
18083
  }]);
18068
18084
  }();
18069
18085
 
18070
- var LOG$n = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
18086
+ var LOG$o = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
18071
18087
  function initDivaCatalogData(json, orderSet, api) {
18072
18088
  var _json$MainCategory;
18073
18089
  var catalogData = {
@@ -18126,7 +18142,7 @@ function initDivaArticles(articleJson, plannerElementsJson, catalogData) {
18126
18142
  }
18127
18143
  } else {
18128
18144
  DivaUtils__default["default"].endSpanOfApm('Catalog initialize');
18129
- LOG$n.error(new DivaUtils.DivaError('Catalog ' + catalogData.catalogName + ' not listed', {
18145
+ LOG$o.error(new DivaUtils.DivaError('Catalog ' + catalogData.catalogName + ' not listed', {
18130
18146
  code: 'WC_0002'
18131
18147
  }));
18132
18148
  throw new Error('Articles of Catalog: ' + catalogData.catalogCodex + ' are empty');
@@ -19149,9 +19165,9 @@ var ArticleOptionValueData = /*#__PURE__*/function () {
19149
19165
  }]);
19150
19166
  }();
19151
19167
 
19152
- function _createForOfIteratorHelper$k(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(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; } } }; }
19153
- function _unsupportedIterableToArray$k(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$k(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$k(r, a) : void 0; } }
19154
- function _arrayLikeToArray$k(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; }
19168
+ function _createForOfIteratorHelper$m(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$m(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; } } }; }
19169
+ function _unsupportedIterableToArray$m(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$m(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$m(r, a) : void 0; } }
19170
+ function _arrayLikeToArray$m(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; }
19155
19171
  var ArticleOptionData = /*#__PURE__*/function () {
19156
19172
  function ArticleOptionData(opt, catalogData) {
19157
19173
  var _this$opt$property;
@@ -19251,7 +19267,7 @@ var ArticleOptionData = /*#__PURE__*/function () {
19251
19267
  }, {
19252
19268
  key: "getOpvByOcd",
19253
19269
  value: function getOpvByOcd(codex) {
19254
- var _iterator = _createForOfIteratorHelper$k(this.opt.articleOptionValues),
19270
+ var _iterator = _createForOfIteratorHelper$m(this.opt.articleOptionValues),
19255
19271
  _step;
19256
19272
  try {
19257
19273
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -19592,7 +19608,10 @@ var ArticleOptionData = /*#__PURE__*/function () {
19592
19608
  }]);
19593
19609
  }();
19594
19610
 
19595
- var LOG$m = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
19611
+ function _createForOfIteratorHelper$l(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$l(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; } } }; }
19612
+ function _unsupportedIterableToArray$l(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$l(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$l(r, a) : void 0; } }
19613
+ function _arrayLikeToArray$l(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; }
19614
+ var LOG$n = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
19596
19615
  function addSupplierColors(set, catalogArticleData, allOPVsOfOPT, supplierColors, catalog, newOPT, rule) {
19597
19616
  var lang = catalog.api.getLanguage();
19598
19617
  // the palette group shows "<GroupName> (<OPG name>)", so both carry the same translated label
@@ -19799,12 +19818,12 @@ function loadArticleOptions(json, catalogArticleData, set) {
19799
19818
  var myOPV = new ArticleOptionValueData(getArticleOptionValueType(set, tmpOPV.Codex, tmpOPV, catOPV, catalogArticleData, true, newOPG, multiselectOptions), set.CatalogData);
19800
19819
  allOPVsOfOPG.set(tmpOPV.Codex, myOPV);
19801
19820
  } else {
19802
- LOG$m.error(new Error('OPV not found: ' + tmpOPV.Codex));
19821
+ LOG$n.error(new Error('OPV not found: ' + tmpOPV.Codex));
19803
19822
  }
19804
19823
  }
19805
19824
  newOPG.initOPVsInOPG(allOPVsOfOPG);
19806
19825
  } else {
19807
- LOG$m.error(new Error('OPG not found: ' + tmpOPG.Codex));
19826
+ LOG$n.error(new Error('OPG not found: ' + tmpOPG.Codex));
19808
19827
  }
19809
19828
  }
19810
19829
  if ((_myOPT$OPV = myOPT.OPV) !== null && _myOPT$OPV !== void 0 && _myOPT$OPV.length) {
@@ -19820,11 +19839,11 @@ function loadArticleOptions(json, catalogArticleData, set) {
19820
19839
  var _myOPV = new ArticleOptionValueData(getArticleOptionValueType(set, _tmpOPG.Codex, _tmpOPG, _catOPV, catalogArticleData, true, _newOPG, multiselectOptions), set.CatalogData);
19821
19840
  _allOPVsOfOPG.set(_tmpOPG.Codex, _myOPV);
19822
19841
  } else {
19823
- LOG$m.error(new Error('OPV not found: ' + _tmpOPG.Codex));
19842
+ LOG$n.error(new Error('OPV not found: ' + _tmpOPG.Codex));
19824
19843
  }
19825
19844
  _newOPG.initOPVsInOPG(_allOPVsOfOPG);
19826
19845
  } else {
19827
- LOG$m.error(new Error('OPG not found: ' + _tmpOPG.Codex));
19846
+ LOG$n.error(new Error('OPG not found: ' + _tmpOPG.Codex));
19828
19847
  }
19829
19848
  }
19830
19849
  }
@@ -19836,7 +19855,7 @@ function loadArticleOptions(json, catalogArticleData, set) {
19836
19855
  var _myOPV2 = new ArticleOptionValueData(getArticleOptionValueType(set, _tmpOPV.Codex, _tmpOPV, _catOPV2, catalogArticleData, true, newOPT, multiselectOptions), set.CatalogData);
19837
19856
  allOPVsOfOPT.set(_tmpOPV.Codex, _myOPV2);
19838
19857
  } else {
19839
- LOG$m.error(new Error('OPV not found: ' + _tmpOPV.Codex));
19858
+ LOG$n.error(new Error('OPV not found: ' + _tmpOPV.Codex));
19840
19859
  }
19841
19860
  }
19842
19861
  }
@@ -19924,12 +19943,12 @@ function initDecisions(catalog, catalogArticleData, decisionRefs) {
19924
19943
  articleCodex: catalogArticle.articleCodex
19925
19944
  };
19926
19945
  if (myDecision.Type == '0') {
19927
- LOG$m.error(new DivaUtils.DivaError(text, {
19946
+ LOG$n.error(new DivaUtils.DivaError(text, {
19928
19947
  code: 'WC_0011',
19929
19948
  custom: stack
19930
19949
  }));
19931
19950
  } else {
19932
- LOG$m.warn(text, undefined, stack);
19951
+ LOG$n.warn(text, undefined, stack);
19933
19952
  }
19934
19953
  myDecision.Options.splice(m, 1);
19935
19954
  m--;
@@ -19953,9 +19972,81 @@ function initDecisions(catalog, catalogArticleData, decisionRefs) {
19953
19972
  }
19954
19973
  }
19955
19974
  }
19956
- catalogArticle.articleReferencedDecisions = catalogArticle.decisions.filter(function (d) {
19957
- return decisionRefs == undefined || decisionRefs.includes(d.Number.toString());
19975
+ catalogArticle.articleReferencedDecisions = getReferencedDecisions(catalogArticle.decisions, decisionRefs);
19976
+ }
19977
+
19978
+ /** The decisions an article evaluates, in prio order: its DecisionRefs plus what they switch off and no ENABLE_DECISION switches on. */
19979
+ function getReferencedDecisions(decisions, decisionRefs) {
19980
+ if (decisionRefs == undefined) return _toConsumableArray__default["default"](decisions);
19981
+ var evaluated = decisions.filter(function (d) {
19982
+ return decisionRefs.includes(String(d.Number));
19958
19983
  });
19984
+ var enableTargets = getActionTargets(decisions, 'ENABLE_DECISION');
19985
+ for (var i = 0; i < evaluated.length; i++) {
19986
+ var _iterator = _createForOfIteratorHelper$l(getActionTargets([evaluated[i]], 'DISABLE_DECISION')),
19987
+ _step;
19988
+ try {
19989
+ var _loop = function _loop() {
19990
+ var decisionNr = _step.value;
19991
+ var target = decisions.find(function (d) {
19992
+ return String(d.Number) == decisionNr;
19993
+ });
19994
+ if (target && !enableTargets.has(decisionNr) && !evaluated.includes(target)) evaluated.push(target);
19995
+ };
19996
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
19997
+ _loop();
19998
+ }
19999
+ } catch (err) {
20000
+ _iterator.e(err);
20001
+ } finally {
20002
+ _iterator.f();
20003
+ }
20004
+ }
20005
+ return evaluated.sort(function (a, b) {
20006
+ return Number(a.Prio) - Number(b.Prio);
20007
+ });
20008
+ }
20009
+
20010
+ /** Numbers of the decisions an action of the given type points at. */
20011
+ function getActionTargets(decisions, type) {
20012
+ var targets = new Set();
20013
+ var _iterator2 = _createForOfIteratorHelper$l(decisions),
20014
+ _step2;
20015
+ try {
20016
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
20017
+ var _decision$DOC;
20018
+ var decision = _step2.value;
20019
+ var _iterator3 = _createForOfIteratorHelper$l((_decision$DOC = decision.DOC) !== null && _decision$DOC !== void 0 ? _decision$DOC : []),
20020
+ _step3;
20021
+ try {
20022
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
20023
+ var _combination$DA;
20024
+ var combination = _step3.value;
20025
+ var _iterator4 = _createForOfIteratorHelper$l((_combination$DA = combination.DA) !== null && _combination$DA !== void 0 ? _combination$DA : []),
20026
+ _step4;
20027
+ try {
20028
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
20029
+ var action = _step4.value;
20030
+ if (action.Type == type && action.DecisionNr) targets.add(String(action.DecisionNr));
20031
+ }
20032
+ } catch (err) {
20033
+ _iterator4.e(err);
20034
+ } finally {
20035
+ _iterator4.f();
20036
+ }
20037
+ }
20038
+ } catch (err) {
20039
+ _iterator3.e(err);
20040
+ } finally {
20041
+ _iterator3.f();
20042
+ }
20043
+ }
20044
+ } catch (err) {
20045
+ _iterator2.e(err);
20046
+ } finally {
20047
+ _iterator2.f();
20048
+ }
20049
+ return targets;
19959
20050
  }
19960
20051
  function getArticleOptionType(myOPT, set, articleCodex) {
19961
20052
  var _set$CatalogData$cata, _set$CatalogData$cata2, _set$CatalogData$cata3, _set$CatalogData$cata4, _set$CatalogData$cata5, _myOPT$Properties;
@@ -20085,6 +20176,313 @@ function getArticleOptionValueType(set, codex, jsonOPV, catalogOPV, myArticle, i
20085
20176
  return opv;
20086
20177
  }
20087
20178
 
20179
+ function _createForOfIteratorHelper$k(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(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; } } }; }
20180
+ function _unsupportedIterableToArray$k(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$k(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$k(r, a) : void 0; } }
20181
+ function _arrayLikeToArray$k(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; }
20182
+ var LOG$m = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
20183
+ var COUNT_KEY_BY_DOCKING_TYPE = {
20184
+ AVC: 'avc',
20185
+ AVN: 'avn',
20186
+ AVO: 'avo',
20187
+ AVR: 'avr',
20188
+ AVS: 'avs',
20189
+ AVU: 'avu',
20190
+ AVL: 'avl'
20191
+ };
20192
+ var SVGUtils = /*#__PURE__*/function () {
20193
+ function SVGUtils() {
20194
+ _classCallCheck__default["default"](this, SVGUtils);
20195
+ }
20196
+ /**
20197
+ * This function removes all VIF and OLF information from the SVG. This is used for displaying only the OLT information
20198
+ * @param content The svg with OLF and OLT
20199
+ * @returns SVG with only OLT information
20200
+ */
20201
+ return _createClass__default["default"](SVGUtils, [{
20202
+ key: "removeOLFFromSvg",
20203
+ value: function removeOLFFromSvg(content) {
20204
+ var xmlDocument = planner2dCore.parseXml(content);
20205
+ var vifObjs = xmlDocument.evaluate("//*[starts-with(@id,'VIF')]", xmlDocument, null, 7, null);
20206
+ if (vifObjs.snapshotLength > 0) {
20207
+ for (var i = 0; i < vifObjs.snapshotLength; i++) {
20208
+ var _parentElement;
20209
+ (_parentElement = vifObjs.snapshotItem(i).parentElement) === null || _parentElement === void 0 || _parentElement.removeChild(vifObjs.snapshotItem(i));
20210
+ }
20211
+ }
20212
+ var olfObjs = xmlDocument.evaluate("//*[starts-with(@id,'OLF')]", xmlDocument, null, 7, null);
20213
+ if (olfObjs.snapshotLength > 0) {
20214
+ for (var i = 0; i < olfObjs.snapshotLength; i++) {
20215
+ var _parentElement2;
20216
+ (_parentElement2 = olfObjs.snapshotItem(i).parentElement) === null || _parentElement2 === void 0 || _parentElement2.removeChild(olfObjs.snapshotItem(i));
20217
+ }
20218
+ }
20219
+ return planner2dCore.serializeXml(xmlDocument);
20220
+ }
20221
+
20222
+ /**
20223
+ * This function returns the DPs of an svg
20224
+ * @param content The svg with OLF and OLT
20225
+ * @returns SVG with only OLT information
20226
+ */
20227
+ }, {
20228
+ key: "getDPsInSVG",
20229
+ value: function getDPsInSVG(content) {
20230
+ var dockingpointsSvgLine = [];
20231
+ var xmlDocument = planner2dCore.parseXml(content);
20232
+ var dpObjs = xmlDocument.evaluate("//*[starts-with(@id,'AV')]", xmlDocument, null, 7, null);
20233
+ if (dpObjs.snapshotLength > 0) {
20234
+ for (var i = 0; i < dpObjs.snapshotLength; i++) {
20235
+ var obj = dpObjs.snapshotItem(i);
20236
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'line') {
20237
+ dockingpointsSvgLine.push({
20238
+ x1: Number(obj.getAttribute('x1')),
20239
+ y1: Number(obj.getAttribute('y1')),
20240
+ x2: Number(obj.getAttribute('x2')),
20241
+ y2: Number(obj.getAttribute('y2')),
20242
+ dockingName: obj.getAttribute('id'),
20243
+ dockingType: obj.getAttribute('id').substring(0, 3)
20244
+ });
20245
+ } else {
20246
+ throw new Error('nodename type: ' + obj.nodeName + ' not implemented');
20247
+ }
20248
+ }
20249
+ }
20250
+ dockingpointsSvgLine.sort(function (a, b) {
20251
+ if (a.dockingType === 'AVL') return -1;
20252
+ if (a.dockingType === 'AVR' && ['AVR', 'AVC', 'AVU', 'AVO', 'AVS', 'AVN'].includes(b.dockingType)) return -1;
20253
+ return 0;
20254
+ });
20255
+ return dockingpointsSvgLine;
20256
+ }
20257
+
20258
+ /**
20259
+ * Counts the docking points of an svg per connector type - the numbers an IDM detail info carries
20260
+ * when the media service analyzed the upload. Throws like getDPsInSVG on an AV element that is no line.
20261
+ * @param content The svg
20262
+ * @returns How many AV lines of each type the svg draws
20263
+ */
20264
+ }, {
20265
+ key: "countDockingPoints",
20266
+ value: function countDockingPoints(content) {
20267
+ var counts = {
20268
+ avc: 0,
20269
+ avn: 0,
20270
+ avo: 0,
20271
+ avr: 0,
20272
+ avs: 0,
20273
+ avu: 0,
20274
+ avl: 0
20275
+ };
20276
+ var _iterator = _createForOfIteratorHelper$k(this.getDPsInSVG(content)),
20277
+ _step;
20278
+ try {
20279
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
20280
+ var dockingType = _step.value.dockingType;
20281
+ // getDPsInSVG takes every id starting with 'AV', so an id like 'AVATAR' yields a type without a count
20282
+ var key = COUNT_KEY_BY_DOCKING_TYPE[dockingType];
20283
+ if (key) counts[key]++;
20284
+ }
20285
+ } catch (err) {
20286
+ _iterator.e(err);
20287
+ } finally {
20288
+ _iterator.f();
20289
+ }
20290
+ return counts;
20291
+ }
20292
+
20293
+ /**
20294
+ * This function returns the DPs of an svg
20295
+ * @param content The svg with OLF and OLT
20296
+ * @returns SVG with only OLT information
20297
+ */
20298
+ }, {
20299
+ key: "getPointOfPoligonById",
20300
+ value: function getPointOfPoligonById(content, id) {
20301
+ var points = [];
20302
+ var xmlDocument = planner2dCore.parseXml(content);
20303
+ var dpObjs = xmlDocument.evaluate("//*[starts-with(@id,'" + id + "')]", xmlDocument, null, 7, null);
20304
+ if (dpObjs.snapshotLength > 1 || dpObjs.snapshotLength == 0) return undefined;
20305
+ for (var i = 0; i < dpObjs.snapshotLength; i++) {
20306
+ var obj = dpObjs.snapshotItem(i);
20307
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'polygon') {
20308
+ var pointsAsString = obj.getAttribute('points');
20309
+ if (pointsAsString) {
20310
+ var pointsFromString = pointsAsString.split(' ');
20311
+ for (var j = 0; j < pointsFromString.length; j++) {
20312
+ var xandY = pointsFromString[j].split(',');
20313
+ if (xandY.length !== 2) continue;
20314
+ points.push(new Vector2(Number(xandY[0]), Number(xandY[1])));
20315
+ }
20316
+ } else {
20317
+ return undefined;
20318
+ }
20319
+ }
20320
+ }
20321
+ return points;
20322
+ }
20323
+ }, {
20324
+ key: "getBoundingBoxOfPoints",
20325
+ value: function getBoundingBoxOfPoints(points) {
20326
+ var xArr = points.map(function (c) {
20327
+ return c.x;
20328
+ });
20329
+ var yArr = points.map(function (c) {
20330
+ return c.y;
20331
+ });
20332
+ var minX = Math.min.apply(Math, _toConsumableArray__default["default"](xArr));
20333
+ var maxX = Math.max.apply(Math, _toConsumableArray__default["default"](xArr));
20334
+ var minY = Math.min.apply(Math, _toConsumableArray__default["default"](yArr));
20335
+ var maxY = Math.max.apply(Math, _toConsumableArray__default["default"](yArr));
20336
+ var width = maxX - minX;
20337
+ var height = maxY - minY;
20338
+ return {
20339
+ width: width,
20340
+ height: height,
20341
+ minX: minX,
20342
+ minY: minY
20343
+ };
20344
+ }
20345
+
20346
+ /**
20347
+ * Returns OLF geometry (minX, minY, width, height) from SVG - supports rect and polygon.
20348
+ * Iterates through matches to find first rect/polygon (handles Illustrator group wrappers).
20349
+ */
20350
+ }, {
20351
+ key: "getOLFGeometryFromSvg",
20352
+ value: function getOLFGeometryFromSvg(content) {
20353
+ var xmlDocument = planner2dCore.parseXml(content);
20354
+ var olfObjs = xmlDocument.evaluate("//*[starts-with(@id,'OLF')]", xmlDocument, null, 7, null);
20355
+ for (var i = 0; i < olfObjs.snapshotLength; i++) {
20356
+ var obj = olfObjs.snapshotItem(i);
20357
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'rect') {
20358
+ var _obj$getAttribute, _obj$getAttribute2, _obj$getAttribute3, _obj$getAttribute4;
20359
+ var x = parseFloat((_obj$getAttribute = obj.getAttribute('x')) !== null && _obj$getAttribute !== void 0 ? _obj$getAttribute : '0');
20360
+ var y = parseFloat((_obj$getAttribute2 = obj.getAttribute('y')) !== null && _obj$getAttribute2 !== void 0 ? _obj$getAttribute2 : '0');
20361
+ var width = parseFloat((_obj$getAttribute3 = obj.getAttribute('width')) !== null && _obj$getAttribute3 !== void 0 ? _obj$getAttribute3 : '0');
20362
+ var height = parseFloat((_obj$getAttribute4 = obj.getAttribute('height')) !== null && _obj$getAttribute4 !== void 0 ? _obj$getAttribute4 : '0');
20363
+ return {
20364
+ minX: x,
20365
+ minY: y,
20366
+ width: width,
20367
+ height: height
20368
+ };
20369
+ }
20370
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'polygon') {
20371
+ var pts = obj.getAttribute('points');
20372
+ if (pts) {
20373
+ var points = pts.split(/\s+/).reduce(function (acc, p) {
20374
+ var _p$split = p.split(','),
20375
+ _p$split2 = _slicedToArray__default["default"](_p$split, 2),
20376
+ x = _p$split2[0],
20377
+ y = _p$split2[1];
20378
+ if (x != null && y != null) acc.push(new Vector2(Number(x), Number(y)));
20379
+ return acc;
20380
+ }, []);
20381
+ if (points.length) {
20382
+ var bbox = this.getBoundingBoxOfPoints(points);
20383
+ return {
20384
+ minX: bbox.minX,
20385
+ minY: bbox.minY,
20386
+ width: bbox.width,
20387
+ height: bbox.height
20388
+ };
20389
+ }
20390
+ }
20391
+ }
20392
+ }
20393
+ return undefined;
20394
+ }
20395
+
20396
+ /**
20397
+ * Returns OLT geometry (x, y, width, height) from SVG attributes - untransformed coords.
20398
+ * Iterates through matches to find first rect/polygon (handles Illustrator group wrappers).
20399
+ */
20400
+ }, {
20401
+ key: "getOLTGeometryFromSvg",
20402
+ value: function getOLTGeometryFromSvg(content) {
20403
+ var xmlDocument = planner2dCore.parseXml(content);
20404
+ var oltObjs = xmlDocument.evaluate("//*[starts-with(@id,'OLT')]", xmlDocument, null, 7, null);
20405
+ for (var i = 0; i < oltObjs.snapshotLength; i++) {
20406
+ var obj = oltObjs.snapshotItem(i);
20407
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'rect') {
20408
+ var _obj$getAttribute5, _obj$getAttribute6, _obj$getAttribute7, _obj$getAttribute8;
20409
+ var x = parseFloat((_obj$getAttribute5 = obj.getAttribute('x')) !== null && _obj$getAttribute5 !== void 0 ? _obj$getAttribute5 : '0');
20410
+ var y = parseFloat((_obj$getAttribute6 = obj.getAttribute('y')) !== null && _obj$getAttribute6 !== void 0 ? _obj$getAttribute6 : '0');
20411
+ var width = parseFloat((_obj$getAttribute7 = obj.getAttribute('width')) !== null && _obj$getAttribute7 !== void 0 ? _obj$getAttribute7 : '0');
20412
+ var height = parseFloat((_obj$getAttribute8 = obj.getAttribute('height')) !== null && _obj$getAttribute8 !== void 0 ? _obj$getAttribute8 : '0');
20413
+ return {
20414
+ x: x,
20415
+ y: y,
20416
+ width: width,
20417
+ height: height
20418
+ };
20419
+ }
20420
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'polygon') {
20421
+ var pts = obj.getAttribute('points');
20422
+ if (pts) {
20423
+ var points = pts.split(/\s+/).reduce(function (acc, p) {
20424
+ var _p$split3 = p.split(','),
20425
+ _p$split4 = _slicedToArray__default["default"](_p$split3, 2),
20426
+ x = _p$split4[0],
20427
+ y = _p$split4[1];
20428
+ if (x != null && y != null) acc.push(new Vector2(Number(x), Number(y)));
20429
+ return acc;
20430
+ }, []);
20431
+ if (points.length) {
20432
+ var bbox = this.getBoundingBoxOfPoints(points);
20433
+ return {
20434
+ x: bbox.minX,
20435
+ y: bbox.minY,
20436
+ width: bbox.width,
20437
+ height: bbox.height
20438
+ };
20439
+ }
20440
+ }
20441
+ }
20442
+ }
20443
+ return undefined;
20444
+ }
20445
+
20446
+ /**
20447
+ * This function looks if the svg has a Mask HTML element. If so it removes all masks from SVG
20448
+ * @param content
20449
+ */
20450
+ }, {
20451
+ key: "removeMaskFromSvg",
20452
+ value: function removeMaskFromSvg(content) {
20453
+ return planner2dCore.removeMask(content);
20454
+ }
20455
+
20456
+ /**
20457
+ * Stretches the SVG to the target OLT size and passes the result to the callback.
20458
+ * @param svgSourceUrl optional URL / path of the loaded SVG for diagnostics
20459
+ */
20460
+ }, {
20461
+ key: "ccCheckStretchAreas",
20462
+ value: function ccCheckStretchAreas(content, newWidthCM, newHeightCM, useglobalSvgScale, svgMinBorderXVal, svgMinBorderYVal, callback, svgSourceUrl) {
20463
+ var result = planner2dCore.stretchArticleSvg(content, newWidthCM, newHeightCM, {
20464
+ useGlobalScale: useglobalSvgScale,
20465
+ minBorderX: svgMinBorderXVal,
20466
+ minBorderY: svgMinBorderYVal
20467
+ });
20468
+ var _iterator2 = _createForOfIteratorHelper$k(result.warnings),
20469
+ _step2;
20470
+ try {
20471
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
20472
+ var warning = _step2.value;
20473
+ LOG$m.warn('[SVGUtils] ccCheckStretchAreas: ' + warning + (svgSourceUrl ? ' (svg: ' + svgSourceUrl + ')' : ''));
20474
+ }
20475
+ } catch (err) {
20476
+ _iterator2.e(err);
20477
+ } finally {
20478
+ _iterator2.f();
20479
+ }
20480
+ callback(result.svg);
20481
+ return result.sizes;
20482
+ }
20483
+ }]);
20484
+ }();
20485
+
20088
20486
  function ownKeys$q(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; }
20089
20487
  function _objectSpread$q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$q(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20090
20488
  function _createForOfIteratorHelper$j(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$j(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; } } }; }
@@ -20154,6 +20552,9 @@ function _loadMoreFromIDMArticles() {
20154
20552
  })), undefined, undefined, 'enricher');
20155
20553
  case 3:
20156
20554
  items = _context8.sent;
20555
+ _context8.next = 6;
20556
+ return fillMissingDockingPointCounts(items, set, catalogData);
20557
+ case 6:
20157
20558
  _loop3 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop3() {
20158
20559
  var catalogArticleData, item;
20159
20560
  return _regeneratorRuntime__default["default"].wrap(function _loop3$(_context4) {
@@ -20180,17 +20581,17 @@ function _loadMoreFromIDMArticles() {
20180
20581
  }, _loop3);
20181
20582
  });
20182
20583
  i = 0;
20183
- case 6:
20584
+ case 8:
20184
20585
  if (!(i < catalogArticleDatas.length)) {
20185
- _context8.next = 11;
20586
+ _context8.next = 13;
20186
20587
  break;
20187
20588
  }
20188
- return _context8.delegateYield(_loop3(), "t0", 8);
20189
- case 8:
20589
+ return _context8.delegateYield(_loop3(), "t0", 10);
20590
+ case 10:
20190
20591
  i++;
20191
- _context8.next = 6;
20592
+ _context8.next = 8;
20192
20593
  break;
20193
- case 11:
20594
+ case 13:
20194
20595
  toLoadDecisionIds = getToLoadDecisionIds(catalogArticleDatas, catalogData);
20195
20596
  toLoadPFGroups = getPriceFeatureGroups(catalogArticleDatas, catalogData);
20196
20597
  toLoadFeatureClassRefNo = _toConsumableArray__default["default"](new Set(catalogArticleDatas.filter(function (a) {
@@ -20199,9 +20600,9 @@ function _loadMoreFromIDMArticles() {
20199
20600
  return a.featureClassRefNo;
20200
20601
  })));
20201
20602
  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];
20202
- _context8.next = 17;
20603
+ _context8.next = 19;
20203
20604
  return Promise.all(promises);
20204
- case 17:
20605
+ case 19:
20205
20606
  _yield$Promise$all = _context8.sent;
20206
20607
  _yield$Promise$all2 = _slicedToArray__default["default"](_yield$Promise$all, 3);
20207
20608
  featureClasses = _yield$Promise$all2[0];
@@ -20213,7 +20614,7 @@ function _loadMoreFromIDMArticles() {
20213
20614
  }
20214
20615
  }
20215
20616
  if (!(toLoadDecisionIds.length !== 0 && toLoadDecisionIds.length != (decisions === null || decisions === void 0 ? void 0 : decisions.length))) {
20216
- _context8.next = 27;
20617
+ _context8.next = 29;
20217
20618
  break;
20218
20619
  }
20219
20620
  loadedIds = new Set((_decisions$map = decisions === null || decisions === void 0 ? void 0 : decisions.map(function (d) {
@@ -20223,17 +20624,17 @@ function _loadMoreFromIDMArticles() {
20223
20624
  return !loadedIds.has(id);
20224
20625
  });
20225
20626
  throw new Error("loading decisions failed \u2013 missing: [".concat(missingIds.join(', '), "]"));
20226
- case 27:
20227
- _context8.next = 29;
20228
- return loadDecisionsReferencedByActions(set, catalogData);
20229
20627
  case 29:
20628
+ _context8.next = 31;
20629
+ return loadDecisionsReferencedByActions(set, catalogData);
20630
+ case 31:
20230
20631
  if (priceFeatureGroups) {
20231
20632
  for (_i6 = 0; _i6 < priceFeatureGroups.length; _i6++) {
20232
20633
  catalogData.loadedPriceFeaturegroups.push(initializePriceFeatureGroups(priceFeatureGroups[_i6], catalogData.idmOptionGroups));
20233
20634
  }
20234
20635
  }
20235
20636
  _iterator6 = _createForOfIteratorHelper$j(toLoadPFGroups);
20236
- _context8.prev = 31;
20637
+ _context8.prev = 33;
20237
20638
  _loop7 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop7() {
20238
20639
  var prfgNo, askedBy;
20239
20640
  return _regeneratorRuntime__default["default"].wrap(function _loop7$(_context5) {
@@ -20262,33 +20663,33 @@ function _loadMoreFromIDMArticles() {
20262
20663
  }, _loop7);
20263
20664
  });
20264
20665
  _iterator6.s();
20265
- case 34:
20666
+ case 36:
20266
20667
  if ((_step6 = _iterator6.n()).done) {
20267
- _context8.next = 40;
20668
+ _context8.next = 42;
20268
20669
  break;
20269
20670
  }
20270
- return _context8.delegateYield(_loop7(), "t1", 36);
20271
- case 36:
20671
+ return _context8.delegateYield(_loop7(), "t1", 38);
20672
+ case 38:
20272
20673
  if (!_context8.t1) {
20273
- _context8.next = 38;
20674
+ _context8.next = 40;
20274
20675
  break;
20275
20676
  }
20276
- return _context8.abrupt("continue", 38);
20277
- case 38:
20278
- _context8.next = 34;
20279
- break;
20677
+ return _context8.abrupt("continue", 40);
20280
20678
  case 40:
20281
- _context8.next = 45;
20679
+ _context8.next = 36;
20282
20680
  break;
20283
20681
  case 42:
20284
- _context8.prev = 42;
20285
- _context8.t2 = _context8["catch"](31);
20682
+ _context8.next = 47;
20683
+ break;
20684
+ case 44:
20685
+ _context8.prev = 44;
20686
+ _context8.t2 = _context8["catch"](33);
20286
20687
  _iterator6.e(_context8.t2);
20287
- case 45:
20288
- _context8.prev = 45;
20688
+ case 47:
20689
+ _context8.prev = 47;
20289
20690
  _iterator6.f();
20290
- return _context8.finish(45);
20291
- case 48:
20691
+ return _context8.finish(47);
20692
+ case 50:
20292
20693
  for (_i7 = 0; _i7 < catalogArticleDatas.length; _i7++) {
20293
20694
  catalogArticleData = catalogArticleDatas[_i7];
20294
20695
  catalogArticleData.articleIDMDecisions = sortDecisions(catalogData.getDecisionsByNo(_toConsumableArray__default["default"](new Set([].concat(_toConsumableArray__default["default"](catalogData.globalDecisions.map(function (g) {
@@ -20300,12 +20701,12 @@ function _loadMoreFromIDMArticles() {
20300
20701
  });
20301
20702
  toLoadFeatures = getFeatures(catalogData, featureClasses);
20302
20703
  if (!toLoadFeatures.length) {
20303
- _context8.next = 62;
20704
+ _context8.next = 64;
20304
20705
  break;
20305
20706
  }
20306
- _context8.next = 54;
20707
+ _context8.next = 56;
20307
20708
  return set.api.getDataCache(set.api.getIDMFeatures(catalogData.accountGuid, toLoadFeatures), undefined, undefined, 'enricher');
20308
- case 54:
20709
+ case 56:
20309
20710
  features = _context8.sent;
20310
20711
  _loop4 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop4() {
20311
20712
  var feature, insertIndex, k, _loop5, j;
@@ -20387,19 +20788,19 @@ function _loadMoreFromIDMArticles() {
20387
20788
  }, _loop4);
20388
20789
  });
20389
20790
  _i8 = 0;
20390
- case 57:
20791
+ case 59:
20391
20792
  if (!(_i8 < features.length)) {
20392
- _context8.next = 62;
20793
+ _context8.next = 64;
20393
20794
  break;
20394
20795
  }
20395
- return _context8.delegateYield(_loop4(), "t3", 59);
20396
- case 59:
20796
+ return _context8.delegateYield(_loop4(), "t3", 61);
20797
+ case 61:
20397
20798
  _i8++;
20398
- _context8.next = 57;
20799
+ _context8.next = 59;
20399
20800
  break;
20400
- case 62:
20801
+ case 64:
20401
20802
  _iterator7 = _createForOfIteratorHelper$j(toLoadFeatures);
20402
- _context8.prev = 63;
20803
+ _context8.prev = 65;
20403
20804
  _loop8 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop8() {
20404
20805
  var featureNo, askedBy;
20405
20806
  return _regeneratorRuntime__default["default"].wrap(function _loop8$(_context6) {
@@ -20429,33 +20830,33 @@ function _loadMoreFromIDMArticles() {
20429
20830
  }, _loop8);
20430
20831
  });
20431
20832
  _iterator7.s();
20432
- case 66:
20833
+ case 68:
20433
20834
  if ((_step7 = _iterator7.n()).done) {
20434
- _context8.next = 72;
20835
+ _context8.next = 74;
20435
20836
  break;
20436
20837
  }
20437
- return _context8.delegateYield(_loop8(), "t4", 68);
20438
- case 68:
20838
+ return _context8.delegateYield(_loop8(), "t4", 70);
20839
+ case 70:
20439
20840
  if (!_context8.t4) {
20440
- _context8.next = 70;
20841
+ _context8.next = 72;
20441
20842
  break;
20442
20843
  }
20443
- return _context8.abrupt("continue", 70);
20444
- case 70:
20445
- _context8.next = 66;
20446
- break;
20844
+ return _context8.abrupt("continue", 72);
20447
20845
  case 72:
20448
- _context8.next = 77;
20846
+ _context8.next = 68;
20449
20847
  break;
20450
20848
  case 74:
20451
- _context8.prev = 74;
20452
- _context8.t5 = _context8["catch"](63);
20849
+ _context8.next = 79;
20850
+ break;
20851
+ case 76:
20852
+ _context8.prev = 76;
20853
+ _context8.t5 = _context8["catch"](65);
20453
20854
  _iterator7.e(_context8.t5);
20454
- case 77:
20455
- _context8.prev = 77;
20855
+ case 79:
20856
+ _context8.prev = 79;
20456
20857
  _iterator7.f();
20457
- return _context8.finish(77);
20458
- case 80:
20858
+ return _context8.finish(79);
20859
+ case 82:
20459
20860
  _loop6 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop6() {
20460
20861
  var catalogArticleData, featureClass, features, j;
20461
20862
  return _regeneratorRuntime__default["default"].wrap(function _loop6$(_context7) {
@@ -20482,25 +20883,25 @@ function _loadMoreFromIDMArticles() {
20482
20883
  }, _loop6);
20483
20884
  });
20484
20885
  _i9 = 0;
20485
- case 82:
20886
+ case 84:
20486
20887
  if (!(_i9 < catalogArticleDatas.length)) {
20487
- _context8.next = 87;
20888
+ _context8.next = 89;
20488
20889
  break;
20489
20890
  }
20490
- return _context8.delegateYield(_loop6(), "t6", 84);
20491
- case 84:
20891
+ return _context8.delegateYield(_loop6(), "t6", 86);
20892
+ case 86:
20492
20893
  _i9++;
20493
- _context8.next = 82;
20894
+ _context8.next = 84;
20494
20895
  break;
20495
- case 87:
20896
+ case 89:
20496
20897
  catalogArticleDatas.map(function (c) {
20497
20898
  return c.areOptionsLoaded = true;
20498
20899
  });
20499
- case 88:
20900
+ case 90:
20500
20901
  case "end":
20501
20902
  return _context8.stop();
20502
20903
  }
20503
- }, _callee2, null, [[31, 42, 45, 48], [63, 74, 77, 80]]);
20904
+ }, _callee2, null, [[33, 44, 47, 50], [65, 76, 79, 82]]);
20504
20905
  }));
20505
20906
  return _loadMoreFromIDMArticles.apply(this, arguments);
20506
20907
  }
@@ -20624,7 +21025,179 @@ function initIDMArticleRelations(item, catalogArticleData, catalog) {
20624
21025
  catalogArticle.hasArticleRelations = catalogArticle.articleRelations.length > 0;
20625
21026
  }
20626
21027
 
21028
+ /** True when IDM delivered no docking point counts for this svg at all - a delivered 0 is a real count. */
21029
+ function lacksDockingPointCounts(svg) {
21030
+ return [svg.avc, svg.avn, svg.avo, svg.avr, svg.avs, svg.avu, svg.avl].every(function (count) {
21031
+ return count === undefined;
21032
+ });
21033
+ }
21034
+
21035
+ /**
21036
+ * Counts the docking points of accessory svgs whose IDM detail info delivered none - the frontend counterpart
21037
+ * of api2's FillAVsIfMissing for CE catalogs. Without counts an accessory is not dockable, so the accessory
21038
+ * step adds it without its svg and the planner palette never offers it. Has to run before the relations are
21039
+ * mapped, because they and the planner palette take a snapshot of the counts.
21040
+ */
21041
+ function fillMissingDockingPointCounts(_x3, _x4, _x5) {
21042
+ return _fillMissingDockingPointCounts.apply(this, arguments);
21043
+ }
21044
+
20627
21045
  /** Load IDM decisions by number; a list too long for one GET url goes through the POST query endpoint. */
21046
+ function _fillMissingDockingPointCounts() {
21047
+ _fillMissingDockingPointCounts = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(items, set, catalogData) {
21048
+ var accessories, _iterator8, _step8, item, _iterator9, _step9, ref, accessory, svgUtils, countsByUrl, countSvg;
21049
+ return _regeneratorRuntime__default["default"].wrap(function _callee4$(_context10) {
21050
+ while (1) switch (_context10.prev = _context10.next) {
21051
+ case 0:
21052
+ if (!catalogData.ignoreArticleRelations) {
21053
+ _context10.next = 2;
21054
+ break;
21055
+ }
21056
+ return _context10.abrupt("return");
21057
+ case 2:
21058
+ accessories = new Set();
21059
+ _iterator8 = _createForOfIteratorHelper$j(items);
21060
+ _context10.prev = 4;
21061
+ _iterator8.s();
21062
+ case 6:
21063
+ if ((_step8 = _iterator8.n()).done) {
21064
+ _context10.next = 29;
21065
+ break;
21066
+ }
21067
+ item = _step8.value;
21068
+ _iterator9 = _createForOfIteratorHelper$j(readAdditionalItemRefs(item));
21069
+ _context10.prev = 9;
21070
+ _iterator9.s();
21071
+ case 11:
21072
+ if ((_step9 = _iterator9.n()).done) {
21073
+ _context10.next = 19;
21074
+ break;
21075
+ }
21076
+ ref = _step9.value;
21077
+ if (!(ref.serieNo != catalogData.catalogCodex)) {
21078
+ _context10.next = 15;
21079
+ break;
21080
+ }
21081
+ return _context10.abrupt("continue", 17);
21082
+ case 15:
21083
+ accessory = catalogData.getCatalogArticle(ref.typeNo);
21084
+ if (accessory && !accessory.isHidden && accessory.catalogPlannerArticle) accessories.add(accessory);
21085
+ case 17:
21086
+ _context10.next = 11;
21087
+ break;
21088
+ case 19:
21089
+ _context10.next = 24;
21090
+ break;
21091
+ case 21:
21092
+ _context10.prev = 21;
21093
+ _context10.t0 = _context10["catch"](9);
21094
+ _iterator9.e(_context10.t0);
21095
+ case 24:
21096
+ _context10.prev = 24;
21097
+ _iterator9.f();
21098
+ return _context10.finish(24);
21099
+ case 27:
21100
+ _context10.next = 6;
21101
+ break;
21102
+ case 29:
21103
+ _context10.next = 34;
21104
+ break;
21105
+ case 31:
21106
+ _context10.prev = 31;
21107
+ _context10.t1 = _context10["catch"](4);
21108
+ _iterator8.e(_context10.t1);
21109
+ case 34:
21110
+ _context10.prev = 34;
21111
+ _iterator8.f();
21112
+ return _context10.finish(34);
21113
+ case 37:
21114
+ svgUtils = new SVGUtils(); // accessories may share a drawing - fetch and count each url once
21115
+ countsByUrl = new Map();
21116
+ countSvg = function countSvg(url) {
21117
+ var counts = countsByUrl.get(url);
21118
+ if (!counts) {
21119
+ counts = set.api.fetchData(url, {
21120
+ method: 'GET',
21121
+ config: {},
21122
+ data: {}
21123
+ }).then(function (svgContent) {
21124
+ return svgUtils.countDockingPoints(svgContent);
21125
+ })["catch"](function (e) {
21126
+ LOG$l.warn('docking points of the accessory svg ' + url + ' could not be counted', e);
21127
+ return undefined;
21128
+ });
21129
+ countsByUrl.set(url, counts);
21130
+ }
21131
+ return counts;
21132
+ };
21133
+ _context10.next = 42;
21134
+ return Promise.all(_toConsumableArray__default["default"](accessories).map(/*#__PURE__*/function () {
21135
+ var _ref4 = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(accessory) {
21136
+ var _accessory$svgs, _accessory$catalogPla12;
21137
+ var svgs, uncounted, counts, topCounts, paletteView;
21138
+ return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context9) {
21139
+ while (1) switch (_context9.prev = _context9.next) {
21140
+ case 0:
21141
+ svgs = (_accessory$svgs = accessory.svgs) !== null && _accessory$svgs !== void 0 ? _accessory$svgs : [];
21142
+ uncounted = svgs.filter(lacksDockingPointCounts);
21143
+ if (uncounted.length) {
21144
+ _context9.next = 4;
21145
+ break;
21146
+ }
21147
+ return _context9.abrupt("return");
21148
+ case 4:
21149
+ _context9.next = 6;
21150
+ return Promise.all(uncounted.map(function (svg) {
21151
+ return countSvg(svg.url);
21152
+ }));
21153
+ case 6:
21154
+ counts = _context9.sent;
21155
+ // every svg gets its counts, so an svg swap (IDMArticleEngine) reads real ones too
21156
+ uncounted.forEach(function (svg, i) {
21157
+ if (counts[i]) Object.assign(svg, counts[i]);
21158
+ });
21159
+
21160
+ // the planner article took its top values from the first svg (IDMCatalogData.getCatalogPlanner)
21161
+ topCounts = uncounted[0] === svgs[0] ? counts[0] : undefined;
21162
+ if (topCounts) {
21163
+ _context9.next = 11;
21164
+ break;
21165
+ }
21166
+ return _context9.abrupt("return");
21167
+ case 11:
21168
+ (_accessory$catalogPla12 = accessory.catalogPlannerArticle) === null || _accessory$catalogPla12 === void 0 || _accessory$catalogPla12.applyDockingPointCounts(topCounts);
21169
+ paletteView = catalogData.plannerPaletteViewInfo.catalogPlannerArticles.find(function (view) {
21170
+ return view.articleCodex == accessory.articleCodex;
21171
+ });
21172
+ if (paletteView) {
21173
+ Object.assign(paletteView, {
21174
+ hasAVC: topCounts.avc > 0,
21175
+ hasAVN: topCounts.avn > 0,
21176
+ hasAVO: topCounts.avo > 0,
21177
+ hasAVS: topCounts.avs > 0,
21178
+ hasAVU: topCounts.avu > 0,
21179
+ hasAVL: topCounts.avl > 0,
21180
+ hasAVR: topCounts.avr > 0
21181
+ });
21182
+ }
21183
+ case 14:
21184
+ case "end":
21185
+ return _context9.stop();
21186
+ }
21187
+ }, _callee3);
21188
+ }));
21189
+ return function (_x8) {
21190
+ return _ref4.apply(this, arguments);
21191
+ };
21192
+ }()));
21193
+ case 42:
21194
+ case "end":
21195
+ return _context10.stop();
21196
+ }
21197
+ }, _callee4, null, [[4, 31, 34, 37], [9, 21, 24, 27]]);
21198
+ }));
21199
+ return _fillMissingDockingPointCounts.apply(this, arguments);
21200
+ }
20628
21201
  var fetchDecisions = function fetchDecisions(set, catalogData, decisionNos) {
20629
21202
  var getUrl = set.api.getIDMDecisions(catalogData.accountGuid, decisionNos);
20630
21203
  if (getUrl.length > 2000) {
@@ -20721,7 +21294,7 @@ var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20721
21294
  }
20722
21295
  }, _callee);
20723
21296
  }));
20724
- return function loadDecisionsReferencedByActions(_x3, _x4) {
21297
+ return function loadDecisionsReferencedByActions(_x6, _x7) {
20725
21298
  return _ref3.apply(this, arguments);
20726
21299
  };
20727
21300
  }();
@@ -31716,7 +32289,7 @@ var DivaArticle = /*#__PURE__*/function () {
31716
32289
  break;
31717
32290
  }
31718
32291
  _context.next = 4;
31719
- return Promise.resolve().then(function () { return require('./ShelfPlanner-bd6038e1.js'); });
32292
+ return Promise.resolve().then(function () { return require('./ShelfPlanner-c7248511.js'); });
31720
32293
  case 4:
31721
32294
  _yield$import = _context.sent;
31722
32295
  ShelfPlanner = _yield$import["default"];
@@ -40310,7 +40883,7 @@ var DivaSet = /*#__PURE__*/function () {
40310
40883
  break;
40311
40884
  }
40312
40885
  _context5.next = 3;
40313
- return Promise.resolve().then(function () { return require('./DoorPlanner-602a86f3.js'); });
40886
+ return Promise.resolve().then(function () { return require('./DoorPlanner-15cb0430.js'); });
40314
40887
  case 3:
40315
40888
  _yield$import = _context5.sent;
40316
40889
  DoorPlanner = _yield$import["default"];
@@ -43696,7 +44269,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
43696
44269
  case 6:
43697
44270
  //falls ein Accessoire verplant wurde wird das Accessoire beim Parent auch hinterlegt
43698
44271
  if (newArticle.relatedToBasketId) {
43699
- if (!newArticle.isDockable) (_set$getArticleByBask2 = set.getArticleByBasketId(newArticle.relatedToBasketId)) === null || _set$getArticleByBask2 === void 0 || _set$getArticleByBask2.addAccessoire(newArticle);
44272
+ // a dockable accessory is registered by the docking callback - one added without docking never gets there
44273
+ if (!newArticle.isDockable || initParams.notDocking) (_set$getArticleByBask2 = set.getArticleByBasketId(newArticle.relatedToBasketId)) === null || _set$getArticleByBask2 === void 0 || _set$getArticleByBask2.addAccessoire(newArticle);
43700
44274
  newArticle.accessoireParentArticle = set.getArticleByBasketId(newArticle.relatedToBasketId);
43701
44275
  }
43702
44276
  //holt die bereits gesetzten Option welche beim neuen Article übernommen werden könnten
@@ -48154,7 +48728,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
48154
48728
  break;
48155
48729
  case 3:
48156
48730
  _context12.next = 5;
48157
- return Promise.resolve().then(function () { return require('./PfisterWWSHandler-14686c6d.js'); });
48731
+ return Promise.resolve().then(function () { return require('./PfisterWWSHandler-185178ce.js'); });
48158
48732
  case 5:
48159
48733
  _yield$import = _context12.sent;
48160
48734
  PfisterWWSHandler = _yield$import["default"];
@@ -48162,7 +48736,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
48162
48736
  return _context12.abrupt("break", 27);
48163
48737
  case 9:
48164
48738
  _context12.next = 11;
48165
- return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-9497b33d.js'); });
48739
+ return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-1f3f4217.js'); });
48166
48740
  case 11:
48167
48741
  _yield$import2 = _context12.sent;
48168
48742
  LiviqueWWSHandler = _yield$import2["default"];
@@ -48170,7 +48744,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
48170
48744
  return _context12.abrupt("break", 27);
48171
48745
  case 15:
48172
48746
  _context12.next = 17;
48173
- return Promise.resolve().then(function () { return require('./SeriousBasketHandler-acfb2f40.js'); });
48747
+ return Promise.resolve().then(function () { return require('./SeriousBasketHandler-e1ce56b0.js'); });
48174
48748
  case 17:
48175
48749
  _yield$import3 = _context12.sent;
48176
48750
  SeriousWWSHandler = _yield$import3["default"];
@@ -48178,7 +48752,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
48178
48752
  return _context12.abrupt("break", 27);
48179
48753
  case 21:
48180
48754
  _context12.next = 23;
48181
- return Promise.resolve().then(function () { return require('./StandardWWSHandler-bafafa71.js'); });
48755
+ return Promise.resolve().then(function () { return require('./StandardWWSHandler-e88dfbcf.js'); });
48182
48756
  case 23:
48183
48757
  _yield$import4 = _context12.sent;
48184
48758
  StandardWWSHandler = _yield$import4["default"];
@@ -49565,7 +50139,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
49565
50139
  //If we need real time rendering initialize the SignalR and 3D host connection Handler
49566
50140
  bootMark('signalr: chunk import start');
49567
50141
  _context3.next = 3;
49568
- return Promise.resolve().then(function () { return require('./Host3DSignalR-09d9efe0.js'); });
50142
+ return Promise.resolve().then(function () { return require('./Host3DSignalR-5aede7a4.js'); });
49569
50143
  case 3:
49570
50144
  _yield$import = _context3.sent;
49571
50145
  Host3DSignalR = _yield$import["default"];
@@ -51297,7 +51871,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
51297
51871
  break;
51298
51872
  case 8:
51299
51873
  _context5.next = 10;
51300
- return Promise.resolve().then(function () { return require('./DivaStandardPlanner-1e17ea12.js'); });
51874
+ return Promise.resolve().then(function () { return require('./DivaStandardPlanner-ebfa66c4.js'); });
51301
51875
  case 10:
51302
51876
  _yield$import = _context5.sent;
51303
51877
  DivaStandardPlanner = _yield$import["default"];
@@ -51308,7 +51882,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
51308
51882
  return _context5.abrupt("break", 21);
51309
51883
  case 15:
51310
51884
  _context5.next = 17;
51311
- return Promise.resolve().then(function () { return require('./DivaBoxPlanner-69dd68ba.js'); });
51885
+ return Promise.resolve().then(function () { return require('./DivaBoxPlanner-0f7e2078.js'); });
51312
51886
  case 17:
51313
51887
  _yield$import2 = _context5.sent;
51314
51888
  DivaBoxPlanner = _yield$import2["default"];
@@ -57376,6 +57950,12 @@ var PlannerElementData = /*#__PURE__*/function () {
57376
57950
  set: function set(cornerPos) {
57377
57951
  var _this$planElement$olt3, _this$planElement$olt4;
57378
57952
  if (!this.planElement.plannerData) return;
57953
+ // Mirrors the getter: without an OLF there is no OLF/OLT split. Deriving the center from the OLT size would shift an
57954
+ // element whose OLT is smaller than its canvas (an accessory's margin for its AV lines) by half the difference.
57955
+ if (!this.HasOLFPolygon) {
57956
+ this.WorldPosCorner = cornerPos;
57957
+ return;
57958
+ }
57379
57959
  var w = (_this$planElement$olt3 = this.planElement.oltWidth) !== null && _this$planElement$olt3 !== void 0 ? _this$planElement$olt3 : this.planElement.plannerData.width;
57380
57960
  var d = (_this$planElement$olt4 = this.planElement.oltDepth) !== null && _this$planElement$olt4 !== void 0 ? _this$planElement$olt4 : this.planElement.plannerData.depth;
57381
57961
  var oltCenterDir = new Vector2(w / 2, d / 2);
@@ -75770,6 +76350,7 @@ exports.OptionCatalogData = OptionCatalogData;
75770
76350
  exports.PROPERTY_SCHEMAS = PROPERTY_SCHEMAS;
75771
76351
  exports.PlannerElementData = PlannerElementData;
75772
76352
  exports.Rendering = Rendering;
76353
+ exports.SVGUtils = SVGUtils;
75773
76354
  exports.Vector2 = Vector2;
75774
76355
  exports.Vector3 = Vector3;
75775
76356
  exports.Vector4 = Vector4;