@colijnit/product 1.9.5 → 2.9.0

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 (66) hide show
  1. package/app/components/product-additional-info/product-additional-info.component.d.ts +4 -3
  2. package/app/components/product-external-source/product-external-source.component.d.ts +30 -0
  3. package/app/components/product-external-source/product-external-source.module.d.ts +2 -0
  4. package/app/components/product-page/product-page.component.d.ts +4 -0
  5. package/app/components/product-page/product-page.module.d.ts +2 -0
  6. package/app/ione-product.component.d.ts +1 -3
  7. package/app/model/{settings.d.ts → productSettings.d.ts} +3 -2
  8. package/app/pipe/pipe.module.d.ts +2 -0
  9. package/app/service/product-connector-adapter.service.d.ts +8 -2
  10. package/app/service/product-connector.service.d.ts +10 -5
  11. package/app/service/product-settings.service.d.ts +3 -3
  12. package/bundles/colijnit-product.umd.js +1476 -1262
  13. package/bundles/colijnit-product.umd.js.map +1 -1
  14. package/bundles/colijnit-product.umd.min.js +2 -2
  15. package/bundles/colijnit-product.umd.min.js.map +1 -1
  16. package/colijnit-product.d.ts +29 -28
  17. package/colijnit-product.metadata.json +1 -1
  18. package/esm2015/app/components/product-additional-info/product-additional-info.component.js +23 -16
  19. package/esm2015/app/components/product-addtocart/product-addtocart.component.js +2 -2
  20. package/esm2015/app/components/product-delivery/product-delivery.component.js +1 -2
  21. package/esm2015/app/components/product-external-source/product-external-source.component.js +123 -0
  22. package/esm2015/app/components/product-external-source/product-external-source.module.js +23 -0
  23. package/esm2015/app/components/product-page/product-page.component.js +45 -15
  24. package/esm2015/app/components/product-page/product-page.module.js +66 -0
  25. package/esm2015/app/ione-product.component.js +38 -19
  26. package/esm2015/app/ione-product.module.js +8 -61
  27. package/esm2015/app/model/productSettings.js +16 -0
  28. package/esm2015/app/pipe/pipe.module.js +20 -0
  29. package/esm2015/app/product-version.js +3 -3
  30. package/esm2015/app/service/dictionary.service.js +1 -1
  31. package/esm2015/app/service/product-connector-adapter.service.js +34 -9
  32. package/esm2015/app/service/product-connector.service.js +33 -35
  33. package/esm2015/app/service/product-event.service.js +2 -6
  34. package/esm2015/app/service/product-settings.service.js +13 -74
  35. package/esm2015/colijnit-product.js +30 -29
  36. package/esm2015/public_api.js +3 -1
  37. package/esm5/app/components/product-additional-info/product-additional-info.component.js +43 -24
  38. package/esm5/app/components/product-addtocart/product-addtocart.component.js +2 -2
  39. package/esm5/app/components/product-delivery/product-delivery.component.js +1 -2
  40. package/esm5/app/components/product-external-source/product-external-source.component.js +126 -0
  41. package/esm5/app/components/product-external-source/product-external-source.module.js +26 -0
  42. package/esm5/app/components/product-page/product-page.component.js +49 -15
  43. package/esm5/app/components/product-page/product-page.module.js +69 -0
  44. package/esm5/app/ione-product.component.js +47 -20
  45. package/esm5/app/ione-product.module.js +8 -61
  46. package/esm5/app/model/productSettings.js +18 -0
  47. package/esm5/app/pipe/pipe.module.js +23 -0
  48. package/esm5/app/product-version.js +3 -3
  49. package/esm5/app/service/dictionary.service.js +1 -1
  50. package/esm5/app/service/product-connector-adapter.service.js +61 -10
  51. package/esm5/app/service/product-connector.service.js +65 -52
  52. package/esm5/app/service/product-event.service.js +2 -6
  53. package/esm5/app/service/product-settings.service.js +14 -74
  54. package/esm5/colijnit-product.js +30 -29
  55. package/esm5/public_api.js +3 -1
  56. package/fesm2015/colijnit-product.js +1189 -1043
  57. package/fesm2015/colijnit-product.js.map +1 -1
  58. package/fesm5/colijnit-product.js +1447 -1234
  59. package/fesm5/colijnit-product.js.map +1 -1
  60. package/package.json +5 -4
  61. package/public_api.d.ts +2 -0
  62. package/app/service/product-module.service.d.ts +0 -9
  63. package/esm2015/app/model/settings.js +0 -15
  64. package/esm2015/app/service/product-module.service.js +0 -39
  65. package/esm5/app/model/settings.js +0 -17
  66. package/esm5/app/service/product-module.service.js +0 -50
@@ -1,7 +1,5 @@
1
- import { __decorate, __awaiter, __generator, __spread } from 'tslib';
2
- import { Input, Component, ɵɵdefineInjectable, Injectable, ɵɵinject, Output, Directive, ChangeDetectorRef, ViewChild, ElementRef, HostListener, HostBinding, Renderer2, SecurityContext, Pipe, EventEmitter, ViewEncapsulation, NgModule, CUSTOM_ELEMENTS_SCHEMA, APP_INITIALIZER } from '@angular/core';
3
- import { ButtonModule, IconModule, NumberPickerModule, InputTextModule, FilesUploadModule, LoaderModule, ScrollContainerModule, TileModule, LevelIndicatorModule, PriceDisplayPipeModule, ArticleTileModule } from '@colijnit/corecomponents';
4
- import { CoDocument } from '@colijnit/mainapi/build/model/co-document';
1
+ import { __awaiter, __generator, __decorate, __spread } from 'tslib';
2
+ import { ɵɵdefineInjectable, Injectable, ɵɵinject, Output, Directive, EventEmitter, ChangeDetectorRef, Input, Component, ViewEncapsulation, HostBinding, Renderer2, ViewChild, ElementRef, HostListener, Pipe, NgModule, SecurityContext, CUSTOM_ELEMENTS_SCHEMA, APP_INITIALIZER } from '@angular/core';
5
3
  import { Subject, BehaviorSubject } from 'rxjs';
6
4
  import { Options } from '@colijnit/ioneconnector/build/model/options';
7
5
  import { ArticleFullObject } from '@colijnit/articleapi/build/model/article-full-object';
@@ -10,40 +8,110 @@ import { Articles } from '@colijnit/articleapi/build/articles';
10
8
  import { DeliveryPrognosis } from '@colijnit/articleapi/build/model/delivery-prognosis';
11
9
  import { DocumentContent } from '@colijnit/articleapi/build/model/document-content';
12
10
  import { BusinessObjectFactory } from '@colijnit/ioneconnector/build/service/business-object-factory';
11
+ import { Transaction } from '@colijnit/transactionapi/build/transaction';
12
+ import { MainApi } from '@colijnit/mainapi';
13
13
  import { HttpClient } from '@angular/common/http';
14
14
  import { StringUtils } from '@colijnit/ioneconnector/build/utils/string-utils';
15
+ import { CommonModule } from '@angular/common';
15
16
  import { DomSanitizer } from '@angular/platform-browser';
16
17
  import { trigger, state, style, transition, animate } from '@angular/animations';
18
+ import { CoDocument } from '@colijnit/mainapi/build/model/co-document';
19
+ import { IconModule, LoaderModule, NumberPickerModule, ButtonModule, PriceDisplayPipeModule, InputTextModule, FilesUploadModule, ScrollContainerModule, TileModule, LevelIndicatorModule, ArticleTileModule } from '@colijnit/corecomponents';
17
20
  import { ConfiguratorStatisticsEnvironment } from '@colijnit/articleapi/build/model/configurator-statistics-environment';
18
- import { CommonModule } from '@angular/common';
19
21
 
20
22
  // this file is dynamically created, do not change this
21
23
  var Version = /** @class */ (function () {
22
24
  function Version() {
23
25
  this.name = "@colijnit/product";
24
26
  this.description = "Product detail page project for iOne";
25
- this.symVer = "1.9.5";
26
- this.publishDate = "21-6-2023 11:47:53";
27
+ this.symVer = "2.9.0";
28
+ this.publishDate = "7-9-2023 15:18:44";
27
29
  }
28
30
  return Version;
29
31
  }());
30
32
 
31
- var ProductDescriptionComponent = /** @class */ (function () {
32
- function ProductDescriptionComponent() {
33
+ var JsonUtilsService = /** @class */ (function () {
34
+ function JsonUtilsService() {
33
35
  }
34
- ProductDescriptionComponent.prototype.ngOnInit = function () {
36
+ JsonUtilsService.prototype.readJsonFile = function (filePath) {
37
+ return __awaiter(this, void 0, void 0, function () {
38
+ var response, e_1;
39
+ return __generator(this, function (_a) {
40
+ switch (_a.label) {
41
+ case 0:
42
+ _a.trys.push([0, 2, , 3]);
43
+ return [4 /*yield*/, fetch(filePath)];
44
+ case 1:
45
+ response = _a.sent();
46
+ if (!response.ok) {
47
+ return [2 /*return*/, null];
48
+ }
49
+ else {
50
+ return [2 /*return*/, response.json()];
51
+ }
52
+ return [3 /*break*/, 3];
53
+ case 2:
54
+ e_1 = _a.sent();
55
+ console.error('Error getting file:', e_1.message);
56
+ return [2 /*return*/, ''];
57
+ case 3: return [2 /*return*/];
58
+ }
59
+ });
60
+ });
35
61
  };
36
- __decorate([
37
- Input()
38
- ], ProductDescriptionComponent.prototype, "article", void 0);
39
- ProductDescriptionComponent = __decorate([
40
- Component({
41
- selector: 'app-product-description',
42
- template: "<div class=\"pd-title-wrapper\">\n <span class=\"pd-description\" [textContent]=\"article?.descriptionRetail\" *ngIf=\"article?.descriptionRetail\"></span>\n <span class=\"pd-sku\" [textContent]=\"article?.articleNr\" *ngIf=\"article?.articleNr\"></span>\n</div>\n",
43
- styles: [":host{display:block}.pd-title-wrapper{margin:20px 0 0}.pd-description{color:#22313c;font-size:25px;font-weight:700;width:100%;display:block}.pd-sku{color:#5b6875;font-size:16px}@media screen and (max-width:650px){.pd-description{font-size:21px}.pd-sku{font-size:13px}}"]
62
+ JsonUtilsService.ɵprov = ɵɵdefineInjectable({ factory: function JsonUtilsService_Factory() { return new JsonUtilsService(); }, token: JsonUtilsService, providedIn: "root" });
63
+ JsonUtilsService = __decorate([
64
+ Injectable({
65
+ providedIn: 'root'
44
66
  })
45
- ], ProductDescriptionComponent);
46
- return ProductDescriptionComponent;
67
+ ], JsonUtilsService);
68
+ return JsonUtilsService;
69
+ }());
70
+
71
+ var SettingsOptions = /** @class */ (function () {
72
+ function SettingsOptions() {
73
+ this.showStockStatus = false;
74
+ this.showZoomButton = false;
75
+ this.showTagFilter = false;
76
+ this.showAsConfigured = false;
77
+ this.inlineAnswers = false;
78
+ this.showArButton = false;
79
+ this.arEnabled = false;
80
+ this.vrEnabled = false;
81
+ }
82
+ return SettingsOptions;
83
+ }());
84
+
85
+ var RenderModes;
86
+ (function (RenderModes) {
87
+ RenderModes["RenderRoom"] = "render_room";
88
+ RenderModes["RenderShop"] = "render_shop";
89
+ RenderModes["RenderIone"] = "render_ione";
90
+ })(RenderModes || (RenderModes = {}));
91
+
92
+ var RenderParameters = /** @class */ (function () {
93
+ function RenderParameters() {
94
+ this.host = "";
95
+ this.port = 0;
96
+ this.secure = false;
97
+ this.renderMode = RenderModes.RenderShop;
98
+ }
99
+ return RenderParameters;
100
+ }());
101
+
102
+ var ProductSettings = /** @class */ (function () {
103
+ function ProductSettings() {
104
+ this.session = undefined;
105
+ this.useGroups = true;
106
+ this.useRenders = false;
107
+ this.useLoginEncryption = true;
108
+ this.createWebOrder = true;
109
+ this.useMatch = false;
110
+ this.currencySymbol = '€';
111
+ this.options = new SettingsOptions();
112
+ this.renderParameters = new RenderParameters();
113
+ }
114
+ return ProductSettings;
47
115
  }());
48
116
 
49
117
  // Sole responsibility is simply to wrap around a colijn.Connector to create a stable inner interface to the library in a 1:1 method way.
@@ -57,14 +125,46 @@ var ProductConnectorAdapterService = /** @class */ (function () {
57
125
  this.articleConnector.showLoader.unsubscribe();
58
126
  };
59
127
  ProductConnectorAdapterService.prototype.initConnector = function (options) {
60
- var _this = this;
61
- this.articleConnector = new Articles(options);
62
- options.session = this.articleConnector.session;
63
- this.articleConnector.showLoader.subscribe(function (value) { return _this.showLoader.next(value); });
128
+ return __awaiter(this, void 0, void 0, function () {
129
+ var _this = this;
130
+ return __generator(this, function (_a) {
131
+ switch (_a.label) {
132
+ case 0:
133
+ this.articleConnector = new Articles(options);
134
+ return [4 /*yield*/, this.articleConnector.connect()];
135
+ case 1:
136
+ _a.sent();
137
+ this.transactionConnector = new Transaction(options);
138
+ this.articleConnector.showLoader.subscribe(function (value) { return _this.showLoader.next(value); });
139
+ return [2 /*return*/];
140
+ }
141
+ });
142
+ });
64
143
  };
65
144
  ProductConnectorAdapterService.prototype.setInstance = function (instanceId) {
66
145
  // this.articleConnector.setInstanceToConfigure(instanceId, false);
67
146
  };
147
+ ProductConnectorAdapterService.prototype.getProductBundleSettings = function (url, upId) {
148
+ return __awaiter(this, void 0, void 0, function () {
149
+ var tempSettings, tempMainConnector, response;
150
+ return __generator(this, function (_a) {
151
+ switch (_a.label) {
152
+ case 0:
153
+ tempSettings = new ProductSettings();
154
+ tempSettings.url = url;
155
+ tempSettings.schema = upId.toString();
156
+ tempMainConnector = new MainApi(tempSettings);
157
+ return [4 /*yield*/, tempMainConnector.getPublicParams(upId)];
158
+ case 1:
159
+ response = _a.sent();
160
+ if (response) {
161
+ return [2 /*return*/, response.productSettings];
162
+ }
163
+ return [2 /*return*/, ""];
164
+ }
165
+ });
166
+ });
167
+ };
68
168
  ProductConnectorAdapterService.prototype.getDeliveryPrognosis = function (goodId, branchNr) {
69
169
  return __awaiter(this, void 0, void 0, function () {
70
170
  var deliveryPrognosis;
@@ -223,51 +323,30 @@ var ProductConnectorAdapterService = /** @class */ (function () {
223
323
  });
224
324
  });
225
325
  };
226
- ProductConnectorAdapterService.ɵprov = ɵɵdefineInjectable({ factory: function ProductConnectorAdapterService_Factory() { return new ProductConnectorAdapterService(); }, token: ProductConnectorAdapterService, providedIn: "root" });
227
- ProductConnectorAdapterService = __decorate([
228
- Injectable({
229
- providedIn: 'root'
230
- })
231
- ], ProductConnectorAdapterService);
232
- return ProductConnectorAdapterService;
233
- }());
234
-
235
- var JsonUtilsService = /** @class */ (function () {
236
- function JsonUtilsService() {
237
- }
238
- JsonUtilsService.prototype.readJsonFile = function (filePath) {
326
+ ProductConnectorAdapterService.prototype.addWebSessionTransactionLine = function (sku, quantity) {
239
327
  return __awaiter(this, void 0, void 0, function () {
240
- var response, e_1;
241
328
  return __generator(this, function (_a) {
242
329
  switch (_a.label) {
243
- case 0:
244
- _a.trys.push([0, 2, , 3]);
245
- return [4 /*yield*/, fetch(filePath)];
246
- case 1:
247
- response = _a.sent();
248
- if (!response.ok) {
249
- return [2 /*return*/, null];
250
- }
251
- else {
252
- return [2 /*return*/, response.json()];
253
- }
254
- return [3 /*break*/, 3];
255
- case 2:
256
- e_1 = _a.sent();
257
- console.error('Error getting file:', e_1.message);
258
- return [2 /*return*/, ''];
259
- case 3: return [2 /*return*/];
330
+ case 0: return [4 /*yield*/, this.transactionConnector.addWebSessionTransactionLine(sku, quantity)];
331
+ case 1: return [2 /*return*/, _a.sent()];
260
332
  }
261
333
  });
262
334
  });
263
335
  };
264
- JsonUtilsService.ɵprov = ɵɵdefineInjectable({ factory: function JsonUtilsService_Factory() { return new JsonUtilsService(); }, token: JsonUtilsService, providedIn: "root" });
265
- JsonUtilsService = __decorate([
266
- Injectable({
267
- providedIn: 'root'
268
- })
269
- ], JsonUtilsService);
270
- return JsonUtilsService;
336
+ ProductConnectorAdapterService.prototype.getWebTransaction = function () {
337
+ return __awaiter(this, void 0, void 0, function () {
338
+ return __generator(this, function (_a) {
339
+ switch (_a.label) {
340
+ case 0: return [4 /*yield*/, this.transactionConnector.getWebSessionSalesOrder()];
341
+ case 1: return [2 /*return*/, _a.sent()];
342
+ }
343
+ });
344
+ });
345
+ };
346
+ ProductConnectorAdapterService = __decorate([
347
+ Injectable()
348
+ ], ProductConnectorAdapterService);
349
+ return ProductConnectorAdapterService;
271
350
  }());
272
351
 
273
352
  var LanguageCode;
@@ -428,51 +507,6 @@ var DictionaryService = /** @class */ (function () {
428
507
  return DictionaryService;
429
508
  }());
430
509
 
431
- var SettingsOptions = /** @class */ (function () {
432
- function SettingsOptions() {
433
- this.showStockStatus = false;
434
- this.showZoomButton = false;
435
- this.showTagFilter = false;
436
- this.showAsConfigured = false;
437
- this.inlineAnswers = false;
438
- this.showArButton = false;
439
- this.arEnabled = false;
440
- this.vrEnabled = false;
441
- }
442
- return SettingsOptions;
443
- }());
444
-
445
- var RenderModes;
446
- (function (RenderModes) {
447
- RenderModes["RenderRoom"] = "render_room";
448
- RenderModes["RenderShop"] = "render_shop";
449
- RenderModes["RenderIone"] = "render_ione";
450
- })(RenderModes || (RenderModes = {}));
451
-
452
- var RenderParameters = /** @class */ (function () {
453
- function RenderParameters() {
454
- this.host = "";
455
- this.port = 0;
456
- this.secure = false;
457
- this.renderMode = RenderModes.RenderShop;
458
- }
459
- return RenderParameters;
460
- }());
461
-
462
- var Settings = /** @class */ (function () {
463
- function Settings() {
464
- this.session = undefined;
465
- this.useGroups = true;
466
- this.useRenders = false;
467
- this.useEncryption = true;
468
- this.useMatch = false;
469
- this.currencySymbol = '€';
470
- this.options = new SettingsOptions();
471
- this.renderParameters = new RenderParameters();
472
- }
473
- return Settings;
474
- }());
475
-
476
510
  var ProductSettingsService = /** @class */ (function () {
477
511
  function ProductSettingsService(_jsonUtilsService, _dictionaryService) {
478
512
  this._jsonUtilsService = _jsonUtilsService;
@@ -500,13 +534,13 @@ var ProductSettingsService = /** @class */ (function () {
500
534
  case 1:
501
535
  jsonSettings = _a.sent();
502
536
  if (jsonSettings) {
503
- this.settings = Object.assign(new Settings(), jsonSettings);
537
+ this.settings = Object.assign(new ProductSettings(), jsonSettings);
504
538
  this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
505
539
  this.settingsFinished();
506
540
  }
507
541
  return [3 /*break*/, 3];
508
542
  case 2:
509
- this.settings = Object.assign(new Settings(), settings);
543
+ this.settings = Object.assign(new ProductSettings(), settings);
510
544
  this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
511
545
  this.settingsFinished();
512
546
  _a.label = 3;
@@ -517,52 +551,19 @@ var ProductSettingsService = /** @class */ (function () {
517
551
  };
518
552
  ProductSettingsService.prototype.createSettingsFromObject = function (obj) {
519
553
  return __awaiter(this, void 0, void 0, function () {
554
+ var ownOptions, ownRenderParameters;
520
555
  return __generator(this, function (_a) {
521
556
  if (!this.settings) {
522
- this.settings = new Settings();
523
- }
524
- if (obj.hasOwnProperty('url')) {
525
- this.settings.url = obj['url'];
526
- this._dictionaryService.rootUrl = this.settings.url.replace('/ajaxservice', '');
527
- }
528
- if (obj.hasOwnProperty('schema')) {
529
- this.settings.schema = obj['schema'];
530
- }
531
- if (obj.hasOwnProperty('version')) {
532
- this.settings.version = obj['version'];
533
- }
534
- if (obj.hasOwnProperty('branch')) {
535
- this.settings.branch = obj['branch'];
557
+ this.settings = new ProductSettings();
536
558
  }
537
- if (obj.hasOwnProperty('currency')) {
538
- this.settings.currency = obj['currency'];
559
+ ownOptions = Object.assign({}, this.settings.options);
560
+ ownRenderParameters = Object.assign({}, this.settings.renderParameters);
561
+ this.settings = Object.assign({}, this.settings, obj);
562
+ if (obj.renderParameters) {
563
+ this.settings.renderParameters = Object.assign({}, ownRenderParameters, obj.renderParameters);
539
564
  }
540
- if (obj.hasOwnProperty('client')) {
541
- this.settings.client = obj['client'];
542
- }
543
- if (obj.hasOwnProperty('languageCode')) {
544
- this.settings.languageCode = obj['languageCode'];
545
- }
546
- if (obj.hasOwnProperty('username')) {
547
- this.settings.username = obj['username'];
548
- }
549
- if (obj.hasOwnProperty('password')) {
550
- this.settings.password = obj['password'];
551
- }
552
- if (obj.hasOwnProperty('timeoutInMs')) {
553
- this.settings.timeoutInMs = obj['timeoutInMs'];
554
- }
555
- if (obj.hasOwnProperty('session')) {
556
- this.settings.session = obj['session'];
557
- }
558
- if (obj.hasOwnProperty('useGroups')) {
559
- this.settings.useGroups = obj['useGroups'];
560
- }
561
- if (obj.hasOwnProperty('useEncryption')) {
562
- this.settings.useEncryption = obj['useEncryption'];
563
- }
564
- if (obj.hasOwnProperty('useMatch')) {
565
- this.settings.useMatch = obj['useMatch'];
565
+ if (obj.options) {
566
+ this.settings.options = Object.assign({}, ownOptions, obj.options);
566
567
  }
567
568
  if (obj.hasOwnProperty('assetPath')) {
568
569
  this.settings.assetPath = obj['assetPath'];
@@ -577,27 +578,6 @@ var ProductSettingsService = /** @class */ (function () {
577
578
  this.settings.threeDAssetPath += '/';
578
579
  }
579
580
  }
580
- if (obj.hasOwnProperty('currencySymbol')) {
581
- this.settings.currencySymbol = obj['currencySymbol'];
582
- }
583
- if (obj.hasOwnProperty('gtm')) {
584
- this.settings.gtm = obj['gtm'];
585
- }
586
- if (obj.hasOwnProperty('assetIndex')) {
587
- this.settings.assetIndex = obj['assetIndex'];
588
- }
589
- if (obj.hasOwnProperty('lightPresetsIndex')) {
590
- this.settings.lightPresetsIndex = obj['lightPresetsIndex'];
591
- }
592
- if (obj.hasOwnProperty('additionalTranslationFile')) {
593
- this.settings.additionalTranslationFile = obj['additionalTranslationFile'];
594
- }
595
- if (obj.hasOwnProperty('options')) {
596
- this.settings.options = obj['options'];
597
- }
598
- if (obj.hasOwnProperty('renderParameters')) {
599
- this.settings.renderParameters = obj['renderParameters'];
600
- }
601
581
  this.settingsFinished();
602
582
  return [2 /*return*/];
603
583
  });
@@ -620,19 +600,16 @@ var ProductSettingsService = /** @class */ (function () {
620
600
  { type: JsonUtilsService },
621
601
  { type: DictionaryService }
622
602
  ]; };
623
- ProductSettingsService.ɵprov = ɵɵdefineInjectable({ factory: function ProductSettingsService_Factory() { return new ProductSettingsService(ɵɵinject(JsonUtilsService), ɵɵinject(DictionaryService)); }, token: ProductSettingsService, providedIn: "root" });
624
603
  ProductSettingsService = __decorate([
625
- Injectable({
626
- providedIn: 'root'
627
- })
604
+ Injectable()
628
605
  ], ProductSettingsService);
629
606
  return ProductSettingsService;
630
607
  }());
631
608
 
632
609
  // Holds all iONE backend related state and methods for a running HomeDecorator. To be used anywhere internally.
633
610
  var ProductConnectorService = /** @class */ (function () {
634
- function ProductConnectorService(connector, _settingsService) {
635
- this.connector = connector;
611
+ function ProductConnectorService(_adapterService, _settingsService) {
612
+ this._adapterService = _adapterService;
636
613
  this._settingsService = _settingsService;
637
614
  this.controllerInitialized = new BehaviorSubject(false);
638
615
  this._initializing = false;
@@ -650,57 +627,61 @@ var ProductConnectorService = /** @class */ (function () {
650
627
  ProductConnectorService.prototype.ngOnDestroy = function () {
651
628
  this.subs.forEach(function (sub) { return sub.unsubscribe(); });
652
629
  };
653
- ProductConnectorService.prototype.initDefaultDevelopTestConnection = function () {
630
+ ProductConnectorService.prototype.initConnection = function () {
654
631
  return __awaiter(this, void 0, void 0, function () {
655
- var settings;
632
+ var settings, e_1;
656
633
  return __generator(this, function (_a) {
657
- if (this._initialized || this._initializing) {
658
- return [2 /*return*/];
659
- }
660
- this._initializing = true;
661
- try {
662
- settings = this._settingsService.settings;
663
- if (!settings) {
664
- throw Error('Settings are not defined!');
665
- }
666
- this.connectorOptions.url = settings.url;
667
- this.connectorOptions.schema = settings.schema;
668
- this.connectorOptions.version = settings.version;
669
- this.connectorOptions.branch = settings.branch;
670
- this.connectorOptions.username = settings.username;
671
- this.connectorOptions.password = settings.password;
672
- this.connectorOptions.session = settings.session;
673
- this.connectorOptions.currencyId = settings.currency;
674
- this.connectorOptions.useGroups = settings.useGroups;
675
- this.connectorOptions.useRenders = settings.useRenders;
676
- this.connectorOptions.useLoginEncryption = settings.useEncryption;
677
- this.connectorOptions.languageCode = settings.languageCode;
678
- this.connector.initConnector(this.connectorOptions);
679
- this._settingsService.settings.session = this.connectorOptions.session;
680
- this.controllerInitialized.next(true);
681
- this._initialized = true;
682
- this._initializing = false;
683
- }
684
- catch (e) {
685
- this._initializing = false;
634
+ switch (_a.label) {
635
+ case 0:
636
+ if (this._initialized || this._initializing) {
637
+ return [2 /*return*/];
638
+ }
639
+ this._initializing = true;
640
+ _a.label = 1;
641
+ case 1:
642
+ _a.trys.push([1, 3, , 4]);
643
+ settings = this._settingsService.settings;
644
+ if (!settings) {
645
+ throw Error('Settings are not defined!');
646
+ }
647
+ this.connectorOptions = Object.assign(new Options(), settings);
648
+ return [4 /*yield*/, this._adapterService.initConnector(this.connectorOptions)];
649
+ case 2:
650
+ _a.sent();
651
+ this.controllerInitialized.next(true);
652
+ this._initialized = true;
653
+ this._initializing = false;
654
+ return [3 /*break*/, 4];
655
+ case 3:
656
+ e_1 = _a.sent();
657
+ this._initializing = false;
658
+ return [3 /*break*/, 4];
659
+ case 4: return [2 /*return*/];
686
660
  }
687
- return [2 /*return*/];
661
+ });
662
+ });
663
+ };
664
+ ProductConnectorService.prototype.getProductBundleSettings = function (url, upId) {
665
+ return __awaiter(this, void 0, void 0, function () {
666
+ return __generator(this, function (_a) {
667
+ return [2 /*return*/, this._adapterService.getProductBundleSettings(url, upId)];
688
668
  });
689
669
  });
690
670
  };
691
671
  ProductConnectorService.prototype.setInstance = function (instanceId) {
692
- this.connector.setInstance(instanceId);
672
+ this._instanceId = instanceId;
673
+ this._adapterService.setInstance(instanceId);
693
674
  };
694
675
  ProductConnectorService.prototype.getFullArticle = function (sku) {
695
676
  return __awaiter(this, void 0, void 0, function () {
696
677
  var goodId;
697
678
  return __generator(this, function (_a) {
698
679
  switch (_a.label) {
699
- case 0: return [4 /*yield*/, this.connector.getGoodIdFromArticleNr(sku)];
680
+ case 0: return [4 /*yield*/, this._adapterService.getGoodIdFromArticleNr(sku)];
700
681
  case 1:
701
682
  goodId = _a.sent();
702
683
  if (goodId) {
703
- return [2 /*return*/, this.connector.getArticleFullObject(goodId)];
684
+ return [2 /*return*/, this._adapterService.getArticleFullObject(goodId)];
704
685
  }
705
686
  return [2 /*return*/, null];
706
687
  }
@@ -709,27 +690,42 @@ var ProductConnectorService = /** @class */ (function () {
709
690
  };
710
691
  ProductConnectorService.prototype.getDocumentContent = function (docId, thumbnail) {
711
692
  if (thumbnail === void 0) { thumbnail = true; }
712
- return this.connector.getDocumentContent(docId, thumbnail);
693
+ return this._adapterService.getDocumentContent(docId, thumbnail);
713
694
  };
714
695
  ProductConnectorService.prototype.getDeliveryPrognosis = function (goodId) {
715
- return this.connector.getDeliveryPrognosis(goodId);
696
+ return this._adapterService.getDeliveryPrognosis(goodId);
716
697
  };
717
698
  ProductConnectorService.prototype.getSelectorDeliveryDate = function () {
718
699
  return __awaiter(this, void 0, void 0, function () {
719
700
  return __generator(this, function (_a) {
720
- return [2 /*return*/, this.connector.getSelectorDeliveryDate()];
701
+ return [2 /*return*/, this._adapterService.getSelectorDeliveryDate()];
721
702
  });
722
703
  });
723
704
  };
724
705
  ProductConnectorService.prototype.getDeliveryDate2 = function (goodId) {
725
- return this.connector.getDeliveryDate2(goodId);
706
+ return this._adapterService.getDeliveryDate2(goodId);
726
707
  };
727
708
  ProductConnectorService.prototype.getSuperArticle = function (id) {
728
- return this.connector.getSuperArticle(id);
709
+ return this._adapterService.getSuperArticle(id);
729
710
  };
730
- ProductConnectorService.prototype.getJsonArticleFlatTree = function (goodId, goodType, quantity, showLoader, instanceId, configuratorStatistics) {
711
+ ProductConnectorService.prototype.getJsonArticleFlatTree = function (goodId, goodType, quantity, showLoader, configuratorStatistics) {
731
712
  if (showLoader === void 0) { showLoader = true; }
732
- return this.connector.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, instanceId, configuratorStatistics);
713
+ return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, this._instanceId, configuratorStatistics);
714
+ };
715
+ ProductConnectorService.prototype.addWebSessionTransactionLine = function (sku, quantity) {
716
+ return __awaiter(this, void 0, void 0, function () {
717
+ return __generator(this, function (_a) {
718
+ switch (_a.label) {
719
+ case 0: return [4 /*yield*/, this._adapterService.addWebSessionTransactionLine(sku, quantity)];
720
+ case 1: return [2 /*return*/, _a.sent()];
721
+ }
722
+ });
723
+ });
724
+ };
725
+ ProductConnectorService.prototype.getWebTransaction = function () {
726
+ this._adapterService.getWebTransaction().then(function (response) {
727
+ console.log(response);
728
+ });
733
729
  };
734
730
  ProductConnectorService.prototype.onShowLoaderChange = function (showLoader) {
735
731
  this._shouldShowLoader = showLoader;
@@ -738,11 +734,8 @@ var ProductConnectorService = /** @class */ (function () {
738
734
  { type: ProductConnectorAdapterService },
739
735
  { type: ProductSettingsService }
740
736
  ]; };
741
- ProductConnectorService.ɵprov = ɵɵdefineInjectable({ factory: function ProductConnectorService_Factory() { return new ProductConnectorService(ɵɵinject(ProductConnectorAdapterService), ɵɵinject(ProductSettingsService)); }, token: ProductConnectorService, providedIn: "root" });
742
737
  ProductConnectorService = __decorate([
743
- Injectable({
744
- providedIn: 'root'
745
- })
738
+ Injectable()
746
739
  ], ProductConnectorService);
747
740
  return ProductConnectorService;
748
741
  }());
@@ -762,7 +755,6 @@ var ProductEventService = /** @class */ (function () {
762
755
  this.onArticleInfoReceived = new Subject();
763
756
  this.onUpdateProductInfoTab = new Subject();
764
757
  }
765
- ProductEventService.ɵprov = ɵɵdefineInjectable({ factory: function ProductEventService_Factory() { return new ProductEventService(); }, token: ProductEventService, providedIn: "root" });
766
758
  __decorate([
767
759
  Output()
768
760
  ], ProductEventService.prototype, "onAddToCart", void 0);
@@ -777,13 +769,320 @@ var ProductEventService = /** @class */ (function () {
777
769
  ], ProductEventService.prototype, "onForceRenderImage", void 0);
778
770
  ProductEventService = __decorate([
779
771
  Directive(),
780
- Injectable({
781
- providedIn: 'root'
782
- })
772
+ Injectable()
783
773
  ], ProductEventService);
784
774
  return ProductEventService;
785
775
  }());
786
776
 
777
+ var IoneProductComponent = /** @class */ (function () {
778
+ function IoneProductComponent(_dictionary, _jsonUtils, _ione, _changeDetector, _appEventService, _settingsService) {
779
+ // this.sku = 'CF-HILL';
780
+ // this.sku = 'CF-ALMADA';
781
+ // this.sku = 'CF-39904ANT';
782
+ // this.sku = 'CF-22346001';
783
+ // this.sku = '104';
784
+ // this.sku = '1000561986';
785
+ // this.sku = '1000567768';
786
+ // this.sku = '1000234793';
787
+ // this.sku = '1066';
788
+ // this.sku = '104';
789
+ var _this = this;
790
+ this._dictionary = _dictionary;
791
+ this._jsonUtils = _jsonUtils;
792
+ this._ione = _ione;
793
+ this._changeDetector = _changeDetector;
794
+ this._appEventService = _appEventService;
795
+ this._settingsService = _settingsService;
796
+ this.onAddToCart = new EventEmitter();
797
+ this.forceRenderImage = new EventEmitter();
798
+ this.onAlternativeClick = new EventEmitter();
799
+ this.onArticleInfoReceived = new EventEmitter();
800
+ this.onArticleReceived = new EventEmitter();
801
+ this.onSelectionsReceived = new EventEmitter();
802
+ this.onAddToQuote = new EventEmitter();
803
+ this._subs = [];
804
+ // this.sku = "70000107";
805
+ this._subs.push(
806
+ // this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true),
807
+ this._appEventService.onAddToCart.subscribe(function (json) {
808
+ _this._handleAddToCart(json);
809
+ }), this._appEventService.onAddToQuote.subscribe(function (json) { return _this.onAddToQuote.emit(json); }), this._appEventService.onAlternativeClick.subscribe(function (article) { return _this.onAlternativeClick.emit(article); }), this._appEventService.onArticleInfoReceived.subscribe(function (info) { return _this._handleAnswerInfoReceived(info); }), this._appEventService.onArticleReceived.subscribe(function (article) { return _this.onArticleReceived.emit(article); }), this._appEventService.onSelectionsReceived.subscribe(function (selections) { return _this.onSelectionsReceived.emit(selections); }));
810
+ }
811
+ Object.defineProperty(IoneProductComponent.prototype, "settings", {
812
+ get: function () {
813
+ return this._settings;
814
+ },
815
+ set: function (value) {
816
+ if (value) {
817
+ var settings = void 0;
818
+ if (typeof value === 'string') {
819
+ settings = JSON.parse(value);
820
+ }
821
+ else {
822
+ settings = value;
823
+ }
824
+ this._settingsService.createSettingsFromObject(settings);
825
+ // this._initConnection(settings);
826
+ }
827
+ },
828
+ enumerable: true,
829
+ configurable: true
830
+ });
831
+ IoneProductComponent.prototype.ngOnChanges = function (changes) {
832
+ this._changeDetector.detectChanges();
833
+ };
834
+ IoneProductComponent.prototype.ngOnDestroy = function () {
835
+ this._subs.forEach(function (s) { return s.unsubscribe(); });
836
+ };
837
+ IoneProductComponent.prototype._handleAnswerInfoReceived = function (info) {
838
+ this.onArticleInfoReceived.next(info);
839
+ };
840
+ IoneProductComponent.prototype._handleAddToCart = function (json) {
841
+ return __awaiter(this, void 0, void 0, function () {
842
+ var articleTreeData, i, good, subArticle;
843
+ return __generator(this, function (_a) {
844
+ switch (_a.label) {
845
+ case 0:
846
+ if (!this._settingsService.settings.createWebOrder) return [3 /*break*/, 7];
847
+ if (!json) return [3 /*break*/, 7];
848
+ articleTreeData = JSON.parse(json);
849
+ if (!(articleTreeData.articleTree && articleTreeData.articleTree.article)) return [3 /*break*/, 7];
850
+ if (!(articleTreeData.articleTree.compositeGoods && Array.isArray(articleTreeData.articleTree.compositeGoods) &&
851
+ articleTreeData.articleTree.compositeGoods.length > 0 && articleTreeData.articleTree.subArticles && Array.isArray(articleTreeData.articleTree.subArticles))) return [3 /*break*/, 5];
852
+ i = 0;
853
+ _a.label = 1;
854
+ case 1:
855
+ if (!(i < articleTreeData.articleTree.compositeGoods.length - 1)) return [3 /*break*/, 4];
856
+ good = articleTreeData.articleTree.compositeGoods[i];
857
+ subArticle = articleTreeData.articleTree.subArticles[i];
858
+ return [4 /*yield*/, this._ione.addWebSessionTransactionLine(subArticle.articleNumber, good.quantity)];
859
+ case 2:
860
+ _a.sent();
861
+ _a.label = 3;
862
+ case 3:
863
+ i++;
864
+ return [3 /*break*/, 1];
865
+ case 4: return [3 /*break*/, 7];
866
+ case 5: return [4 /*yield*/, this._ione.addWebSessionTransactionLine(articleTreeData.articleTree.article.articleNumber, 1)];
867
+ case 6:
868
+ _a.sent();
869
+ _a.label = 7;
870
+ case 7:
871
+ this.onAddToCart.emit(json);
872
+ return [2 /*return*/];
873
+ }
874
+ });
875
+ });
876
+ };
877
+ IoneProductComponent.ctorParameters = function () { return [
878
+ { type: DictionaryService },
879
+ { type: JsonUtilsService },
880
+ { type: ProductConnectorService },
881
+ { type: ChangeDetectorRef },
882
+ { type: ProductEventService },
883
+ { type: ProductSettingsService }
884
+ ]; };
885
+ __decorate([
886
+ Input()
887
+ ], IoneProductComponent.prototype, "sku", void 0);
888
+ __decorate([
889
+ Input()
890
+ ], IoneProductComponent.prototype, "settings", null);
891
+ __decorate([
892
+ Output()
893
+ ], IoneProductComponent.prototype, "onAddToCart", void 0);
894
+ __decorate([
895
+ Output()
896
+ ], IoneProductComponent.prototype, "forceRenderImage", void 0);
897
+ __decorate([
898
+ Output()
899
+ ], IoneProductComponent.prototype, "onAlternativeClick", void 0);
900
+ __decorate([
901
+ Output()
902
+ ], IoneProductComponent.prototype, "onArticleInfoReceived", void 0);
903
+ __decorate([
904
+ Output()
905
+ ], IoneProductComponent.prototype, "onArticleReceived", void 0);
906
+ __decorate([
907
+ Output()
908
+ ], IoneProductComponent.prototype, "onSelectionsReceived", void 0);
909
+ __decorate([
910
+ Output()
911
+ ], IoneProductComponent.prototype, "onAddToQuote", void 0);
912
+ IoneProductComponent = __decorate([
913
+ Component({
914
+ selector: 'app-ione-product',
915
+ template: "\n <app-product-page [sku]=\"sku\"\n ></app-product-page>\n ",
916
+ providers: [
917
+ ProductEventService,
918
+ ProductSettingsService,
919
+ ProductConnectorAdapterService,
920
+ ProductConnectorService
921
+ ],
922
+ encapsulation: ViewEncapsulation.Emulated,
923
+ styles: [""]
924
+ })
925
+ ], IoneProductComponent);
926
+ return IoneProductComponent;
927
+ }());
928
+
929
+ var ProductInitializerService = /** @class */ (function () {
930
+ function ProductInitializerService(_settingsService) {
931
+ this._settingsService = _settingsService;
932
+ }
933
+ ProductInitializerService.prototype.initializeApp = function () {
934
+ return __awaiter(this, void 0, void 0, function () {
935
+ return __generator(this, function (_a) {
936
+ return [2 /*return*/, this._settingsService.initializeSettings()];
937
+ });
938
+ });
939
+ };
940
+ ProductInitializerService.ctorParameters = function () { return [
941
+ { type: ProductSettingsService }
942
+ ]; };
943
+ ProductInitializerService.ɵprov = ɵɵdefineInjectable({ factory: function ProductInitializerService_Factory() { return new ProductInitializerService(ɵɵinject(ProductSettingsService)); }, token: ProductInitializerService, providedIn: "root" });
944
+ ProductInitializerService = __decorate([
945
+ Injectable({
946
+ providedIn: 'root',
947
+ })
948
+ ], ProductInitializerService);
949
+ return ProductInitializerService;
950
+ }());
951
+
952
+ var ProductExternalSourceComponent = /** @class */ (function () {
953
+ function ProductExternalSourceComponent(_sanitizer, _productConnectorService, _appEventService) {
954
+ this._sanitizer = _sanitizer;
955
+ this._productConnectorService = _productConnectorService;
956
+ this._appEventService = _appEventService;
957
+ this.addToCart = new EventEmitter();
958
+ this.addToQuote = new EventEmitter();
959
+ this.alternativeClick = new EventEmitter();
960
+ this.showProduct = false;
961
+ this.loaded = false;
962
+ this.externalSettings = {};
963
+ this._subs = [];
964
+ }
965
+ Object.defineProperty(ProductExternalSourceComponent.prototype, "externalSource", {
966
+ get: function () {
967
+ return this._externalSource;
968
+ },
969
+ set: function (value) {
970
+ this._externalSource = value;
971
+ this.loaded = false;
972
+ this._prepareExternalSource();
973
+ },
974
+ enumerable: true,
975
+ configurable: true
976
+ });
977
+ ProductExternalSourceComponent.prototype.showClass = function () {
978
+ return true;
979
+ };
980
+ ProductExternalSourceComponent.prototype.ngOnInit = function () {
981
+ var _this = this;
982
+ this._subs.push(this._appEventService.onAddToCart.subscribe(function (json) { return _this.addToCart.next(json); }), this._appEventService.onAddToQuote.subscribe(function (json) { return _this.addToQuote.next(json); }), this._appEventService.onAlternativeClick.subscribe(function (article) { return _this.alternativeClick.next(article); }));
983
+ };
984
+ ProductExternalSourceComponent.prototype.ngOnDestroy = function () {
985
+ this._subs.forEach(function (s) { return s.unsubscribe(); });
986
+ };
987
+ ProductExternalSourceComponent.prototype._prepareExternalSource = function () {
988
+ return __awaiter(this, void 0, void 0, function () {
989
+ var bundleSettings;
990
+ return __generator(this, function (_a) {
991
+ switch (_a.label) {
992
+ case 0:
993
+ if (!this._externalSource) {
994
+ return [2 /*return*/];
995
+ }
996
+ this.externalUrl = undefined;
997
+ this.externalSettings = {};
998
+ if (!(this.externalSource.type === 'CATF')) return [3 /*break*/, 2];
999
+ return [4 /*yield*/, this._productConnectorService.getProductBundleSettings(this.externalSource.url, parseInt(this.externalSource.schema, 0))];
1000
+ case 1:
1001
+ bundleSettings = _a.sent();
1002
+ this.externalSettings = JSON.parse(bundleSettings);
1003
+ if (this.options) {
1004
+ this.externalSettings.options = this.options;
1005
+ }
1006
+ // this.externalSettings.assetPath = "https://cdn1.colijn-it.nl/content43";
1007
+ // this.externalSettings.threeDAssetPath = "https://cdn1.colijn-it.nl/content43";
1008
+ if (this.externalSource.username && this.externalSource.password) {
1009
+ this.externalSettings.useLoginEncryption = true;
1010
+ this.externalSettings.username = this.externalSource.username;
1011
+ this.externalSettings.password = this.externalSource.password;
1012
+ }
1013
+ // finally show the catalog
1014
+ this.showProduct = true;
1015
+ return [3 /*break*/, 3];
1016
+ case 2:
1017
+ this.externalUrl = this.externalSource.url;
1018
+ this.safeUrl = this._sanitizer.bypassSecurityTrustResourceUrl(this.externalUrl);
1019
+ this.showProduct = false;
1020
+ _a.label = 3;
1021
+ case 3:
1022
+ this.loaded = true;
1023
+ return [2 /*return*/];
1024
+ }
1025
+ });
1026
+ });
1027
+ };
1028
+ ProductExternalSourceComponent.ctorParameters = function () { return [
1029
+ { type: DomSanitizer },
1030
+ { type: ProductConnectorService },
1031
+ { type: ProductEventService }
1032
+ ]; };
1033
+ __decorate([
1034
+ Input()
1035
+ ], ProductExternalSourceComponent.prototype, "sku", void 0);
1036
+ __decorate([
1037
+ Input()
1038
+ ], ProductExternalSourceComponent.prototype, "externalSource", null);
1039
+ __decorate([
1040
+ Input()
1041
+ ], ProductExternalSourceComponent.prototype, "options", void 0);
1042
+ __decorate([
1043
+ Output()
1044
+ ], ProductExternalSourceComponent.prototype, "addToCart", void 0);
1045
+ __decorate([
1046
+ Output()
1047
+ ], ProductExternalSourceComponent.prototype, "addToQuote", void 0);
1048
+ __decorate([
1049
+ Output()
1050
+ ], ProductExternalSourceComponent.prototype, "alternativeClick", void 0);
1051
+ __decorate([
1052
+ HostBinding('class.co-product-external-source')
1053
+ ], ProductExternalSourceComponent.prototype, "showClass", null);
1054
+ ProductExternalSourceComponent = __decorate([
1055
+ Component({
1056
+ selector: 'co-product-external-source',
1057
+ template: "\n <ng-container *ngIf=\"loaded\">\n <ng-container *ngIf=\"showProduct\">\n <app-product-page\n [sku]=\"sku\"\n [settings]=\"externalSettings\"\n ></app-product-page>\n </ng-container>\n <ng-container *ngIf=\"!showProduct\">\n <iframe width=\"100%\" height=\"100%\" [src]=\"safeUrl\" frameborder=\"0\" allowfullscreen></iframe>\n </ng-container>\n </ng-container>\n ",
1058
+ providers: [
1059
+ ProductEventService,
1060
+ ProductSettingsService,
1061
+ ProductConnectorAdapterService,
1062
+ ProductConnectorService
1063
+ ],
1064
+ encapsulation: ViewEncapsulation.None
1065
+ })
1066
+ ], ProductExternalSourceComponent);
1067
+ return ProductExternalSourceComponent;
1068
+ }());
1069
+
1070
+ var StockAndDelivery = /** @class */ (function () {
1071
+ function StockAndDelivery(stock, deliveryDescription) {
1072
+ this.stock = 0;
1073
+ this.stock = stock;
1074
+ this.deliveryDescription = deliveryDescription;
1075
+ }
1076
+ return StockAndDelivery;
1077
+ }());
1078
+
1079
+ var SelectorType;
1080
+ (function (SelectorType) {
1081
+ SelectorType["TwoD"] = "2D";
1082
+ SelectorType["ThreeD"] = "3D";
1083
+ SelectorType["Omni"] = "Omni";
1084
+ })(SelectorType || (SelectorType = {}));
1085
+
787
1086
  /** AUTO GENERATED FILE. DO NOT CHANGE.. **/
788
1087
  var IconEnum;
789
1088
  (function (IconEnum) {
@@ -861,208 +1160,31 @@ var IconCacheService = /** @class */ (function () {
861
1160
  return IconCacheService;
862
1161
  }());
863
1162
 
864
- var ImageCarouselComponent = /** @class */ (function () {
865
- function ImageCarouselComponent(_ione, _appEventService, _changeDetector, _domSanitizer, iconCache) {
1163
+ var ProductPageComponent = /** @class */ (function () {
1164
+ function ProductPageComponent(_ione, _renderer, _changeDetector, iconCache, settingsService, appEventService) {
866
1165
  var _this = this;
867
1166
  this._ione = _ione;
868
- this._appEventService = _appEventService;
1167
+ this._renderer = _renderer;
869
1168
  this._changeDetector = _changeDetector;
870
- this._domSanitizer = _domSanitizer;
871
1169
  this.iconCache = iconCache;
872
- this.icons = IconEnum;
873
- this.showLoader = false;
874
- this.showRefresh = false;
875
- this.resizing = false;
876
- this._currentIndex = 0;
877
- this._images = [];
1170
+ this.settingsService = settingsService;
1171
+ this.appEventService = appEventService;
1172
+ this.icon = IconEnum;
1173
+ this.configurable = false;
1174
+ this.threeD = false;
1175
+ this.show2D = true;
1176
+ this.show3D = false;
1177
+ this.configuring = false;
1178
+ this.fullscreenAnimationEnd = false;
1179
+ this.settingsLoaded = false;
1180
+ this._fullScreen = false;
878
1181
  this._subs = [];
879
- this._subs.push(this._appEventService.onRenderStarted.subscribe(function () {
880
- _this.showLoader = true;
881
- }), this._appEventService.onDraftRenderImageReceived.subscribe(function (url) {
882
- if (_this._images[0] instanceof CoDocument) {
883
- _this._images.unshift(url);
884
- }
885
- else {
886
- _this._images[0] = url;
1182
+ this._subs.push(this.appEventService.onForceRenderImage.subscribe(function (x) {
1183
+ if (_this.selections.nativeElement) {
1184
+ _this.selections.nativeElement.forceRenderImage();
887
1185
  }
888
- _this.showLoader = false;
889
- }));
890
- }
891
- Object.defineProperty(ImageCarouselComponent.prototype, "images", {
892
- get: function () {
893
- return this._images;
894
- },
895
- set: function (value) {
896
- if (value && value.length > 0) {
897
- this._images = value;
898
- this._loadImages();
899
- this._changeDetector.detectChanges();
900
- }
901
- },
902
- enumerable: true,
903
- configurable: true
904
- });
905
- ImageCarouselComponent.prototype.handleWindowResize = function () {
906
- var _this = this;
907
- this.resizing = true;
908
- this._scrollCarouselToIndex();
909
- clearTimeout(this._resizeTimer);
910
- this._resizeTimer = setTimeout(function () {
911
- _this.resizing = false;
912
- }, 200);
913
- };
914
- ImageCarouselComponent.prototype.gotoNextSlide = function () {
915
- this.currentIndex++;
916
- };
917
- ImageCarouselComponent.prototype.gotoPrevSlide = function () {
918
- this.currentIndex--;
919
- };
920
- ImageCarouselComponent.prototype.isCurrentIndex = function (index) {
921
- return this.currentIndex === index;
922
- };
923
- Object.defineProperty(ImageCarouselComponent.prototype, "currentIndex", {
924
- get: function () {
925
- return this._currentIndex;
926
- },
927
- set: function (value) {
928
- this._currentIndex = value;
929
- this._scrollCarouselToIndex();
930
- },
931
- enumerable: true,
932
- configurable: true
933
- });
934
- ImageCarouselComponent.prototype.ngOnInit = function () {
935
- };
936
- ImageCarouselComponent.prototype.ngOnDestroy = function () {
937
- this.carousel = undefined;
938
- this._subs.forEach(function (s) { return s.unsubscribe(); });
939
- };
940
- ImageCarouselComponent.prototype.handleThumbClick = function (index) {
941
- this.currentIndex = index;
942
- };
943
- ImageCarouselComponent.prototype.onForceRenderImage = function () {
944
- this._appEventService.onForceRenderImage.next();
945
- };
946
- ImageCarouselComponent.prototype.getImageSrc = function (image) {
947
- var source = '';
948
- if (image instanceof CoDocument) {
949
- if (image.filePath) {
950
- source = image.filePath;
951
- }
952
- else {
953
- source = image.documentBodyAsDataUri;
954
- }
955
- }
956
- else if (image.detail !== undefined) {
957
- source = image.detail;
958
- }
959
- return this._domSanitizer.bypassSecurityTrustUrl(source);
960
- };
961
- ImageCarouselComponent.prototype._loadImages = function () {
962
- var _this = this;
963
- if (this._images) {
964
- this._images.forEach(function (i) {
965
- if (!i.documentBody && !i.filePath) {
966
- _this._ione.getDocumentContent(i.documentId, false).then(function (content) {
967
- if (content) {
968
- i.documentBody = content.documentContent;
969
- }
970
- });
971
- }
972
- });
973
- }
974
- };
975
- ImageCarouselComponent.prototype._scrollCarouselToIndex = function () {
976
- if (this.currentIndex > -1 && this.currentIndex <= this.images.length) {
977
- var movePx = this.currentIndex * this.carousel.nativeElement.clientWidth;
978
- if (this.carousel && this.carousel.nativeElement) {
979
- this.carousel.nativeElement.scrollLeft = movePx;
980
- // this.carousel.nativeElement.scrollTo({
981
- // left: movePx,
982
- // behavior: 'smooth'
983
- // });
984
- }
985
- }
986
- };
987
- ImageCarouselComponent.ctorParameters = function () { return [
988
- { type: ProductConnectorService },
989
- { type: ProductEventService },
990
- { type: ChangeDetectorRef },
991
- { type: DomSanitizer },
992
- { type: IconCacheService }
993
- ]; };
994
- __decorate([
995
- ViewChild('carousel', { read: ElementRef })
996
- ], ImageCarouselComponent.prototype, "carousel", void 0);
997
- __decorate([
998
- Input()
999
- ], ImageCarouselComponent.prototype, "showRefresh", void 0);
1000
- __decorate([
1001
- Input()
1002
- ], ImageCarouselComponent.prototype, "images", null);
1003
- __decorate([
1004
- HostListener('window:resize')
1005
- ], ImageCarouselComponent.prototype, "handleWindowResize", null);
1006
- __decorate([
1007
- HostListener('swipeleft')
1008
- ], ImageCarouselComponent.prototype, "gotoNextSlide", null);
1009
- __decorate([
1010
- HostListener('swiperight')
1011
- ], ImageCarouselComponent.prototype, "gotoPrevSlide", null);
1012
- __decorate([
1013
- HostBinding('class.resizing')
1014
- ], ImageCarouselComponent.prototype, "resizing", void 0);
1015
- ImageCarouselComponent = __decorate([
1016
- Component({
1017
- selector: 'app-image-carousel',
1018
- template: "<div id=\"product_page_carousel\">\n <div id=\"product_page_carousel_items\">\n <co-loader [isShown]=\"showLoader\"></co-loader>\n <div #carousel class=\"inner-carousel\">\n <!-- This has been taken out of the for loop to prevent flashing images when updating. -->\n <div *ngIf=\"images[0]\" class=\"carousel-item\" [id]=\"'slide-0'\" [class.active]=\"isCurrentIndex(0)\">\n <img [src]=\"getImageSrc(images[0])\">\n </div>\n <div *ngFor=\"let image of images.slice(1); let index = index\" class=\"carousel-item\" [id]=\"'slide-' + (index + 1)\" [class.active]=\"isCurrentIndex((index + 1))\">\n <img [src]=\"getImageSrc(image)\">\n </div>\n <div class=\"carousel-scroller-layer\" *ngIf=\"images && images.length > 1\">\n <div class=\"carousel-item-scroller prev\" (click)=\"gotoPrevSlide()\" *ngIf=\"currentIndex > 0\"></div>\n <div class=\"carousel-item-scroller next\" (click)=\"gotoNextSlide()\" *ngIf=\"currentIndex < images.length - 1\"></div>\n </div>\n </div>\n <co-icon class=\"selector-type-icon refresh-button\" [iconData]=\"iconCache.getIcon(icons.Refresh)\" (click)=\"onForceRenderImage()\" [class.loading]=\"showLoader\" *ngIf=\"showRefresh\"></co-icon>\n </div>\n\n <div id=\"product_page_carousel_thumbs\">\n <co-scroll-container class=\"scroll-container\" *ngIf=\"images && images.length > 1\">\n <div *ngFor=\"let image of images; let index = index\" class=\"carousel-thumb\" [class.active]=\"index === currentIndex\">\n <img [src]=\"getImageSrc(image)\" (click)=\"handleThumbClick(index)\"/>\n </div>\n </co-scroll-container>\n </div>\n</div>\n",
1019
- styles: [":host{max-height:540px;height:100%;position:relative}:host:not(.resizing) .inner-carousel{scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scroll-snap-type:x mandatory}#product_page_carousel{position:relative}#product_page_carousel .refresh-button{position:absolute;bottom:10px;right:10px;background:#fff}#product_page_carousel .refresh-button.loading{-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin}#product_page_carousel .refresh-button:hover{box-shadow:none;background:#74b77f;transition:.2s ease-in-out}#product_page_carousel .refresh-button:hover ::ng-deep svg path{fill:#fff!important}#product_page_carousel #product_page_carousel_items{position:relative;margin-bottom:10px}#product_page_carousel #product_page_carousel_items ::ng-deep co-loader{position:absolute}#product_page_carousel .inner-carousel{display:flex;flex-direction:row;align-items:center;overflow:hidden;max-height:500px;border:1px solid #efefef}#product_page_carousel .carousel-item{max-height:500px;width:100%;display:flex;flex-shrink:0;flex-grow:0}#product_page_carousel .carousel-item img{width:100%;height:auto;-o-object-fit:contain;object-fit:contain}#product_page_carousel .carousel-scroller-layer{height:100%;width:100%;position:absolute;pointer-events:none;top:0;left:0}#product_page_carousel #product_page_carousel_thumbs{display:flex;justify-content:flex-start;height:80px;margin-left:auto;margin-right:auto}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container{padding:0 22px}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container .content-wrapper{padding:0}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb{opacity:1;cursor:pointer;transition:.2s;padding:4px;border:1px solid #f6f5f4}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb.active,#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:hover{border-color:#22313c}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:not(:last-child){margin-right:10px}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb img{height:68px}@media screen and (max-width:650px){#product_page_carousel_thumbs{height:57px!important}#product_page_carousel_thumbs .carousel-thumb img{height:50px!important}}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]
1020
- })
1021
- ], ImageCarouselComponent);
1022
- return ImageCarouselComponent;
1023
- }());
1024
-
1025
- var StockAndDelivery = /** @class */ (function () {
1026
- function StockAndDelivery(stock, deliveryDescription) {
1027
- this.stock = 0;
1028
- this.stock = stock;
1029
- this.deliveryDescription = deliveryDescription;
1030
- }
1031
- return StockAndDelivery;
1032
- }());
1033
-
1034
- var SelectorType;
1035
- (function (SelectorType) {
1036
- SelectorType["TwoD"] = "2D";
1037
- SelectorType["ThreeD"] = "3D";
1038
- SelectorType["Omni"] = "Omni";
1039
- })(SelectorType || (SelectorType = {}));
1040
-
1041
- var ProductPageComponent = /** @class */ (function () {
1042
- function ProductPageComponent(_ione, _renderer, _changeDetector, iconCache, settingsService, appEventService) {
1043
- var _this = this;
1044
- this._ione = _ione;
1045
- this._renderer = _renderer;
1046
- this._changeDetector = _changeDetector;
1047
- this.iconCache = iconCache;
1048
- this.settingsService = settingsService;
1049
- this.appEventService = appEventService;
1050
- this.icon = IconEnum;
1051
- this.configurable = false;
1052
- this.threeD = false;
1053
- this.show2D = true;
1054
- this.show3D = false;
1055
- this.configuring = false;
1056
- this.fullscreenAnimationEnd = false;
1057
- this.settingsLoaded = false;
1058
- this._fullScreen = false;
1059
- this._subs = [];
1060
- this._subs.push(this.appEventService.onForceRenderImage.subscribe(function (x) {
1061
- if (_this.selections.nativeElement) {
1062
- _this.selections.nativeElement.forceRenderImage();
1063
- }
1064
- }), this.settingsService.settingsLoaded.subscribe(function (loaded) {
1065
- _this.settingsLoaded = loaded;
1186
+ }), this.settingsService.settingsLoaded.subscribe(function (loaded) { return _this._handleSettingsLoaded(loaded); }), this._ione.controllerInitialized.subscribe(function (initialized) {
1187
+ _this.settingsLoaded = initialized;
1066
1188
  }));
1067
1189
  }
1068
1190
  Object.defineProperty(ProductPageComponent.prototype, "sku", {
@@ -1084,6 +1206,23 @@ var ProductPageComponent = /** @class */ (function () {
1084
1206
  enumerable: true,
1085
1207
  configurable: true
1086
1208
  });
1209
+ Object.defineProperty(ProductPageComponent.prototype, "settings", {
1210
+ get: function () {
1211
+ return this._settings;
1212
+ },
1213
+ set: function (value) {
1214
+ if (value) {
1215
+ if (typeof value === 'string') {
1216
+ this._settings = JSON.parse(value);
1217
+ }
1218
+ else {
1219
+ this._settings = value;
1220
+ }
1221
+ }
1222
+ },
1223
+ enumerable: true,
1224
+ configurable: true
1225
+ });
1087
1226
  Object.defineProperty(ProductPageComponent.prototype, "fullScreen", {
1088
1227
  get: function () {
1089
1228
  return this._fullScreen;
@@ -1120,6 +1259,13 @@ var ProductPageComponent = /** @class */ (function () {
1120
1259
  configurable: true
1121
1260
  });
1122
1261
  ProductPageComponent.prototype.ngOnInit = function () {
1262
+ if (this._settings) {
1263
+ this.settingsService.settings = undefined;
1264
+ this.settingsService.createSettingsFromObject(this._settings);
1265
+ }
1266
+ else {
1267
+ this._settings = this.settingsService.settings;
1268
+ }
1123
1269
  };
1124
1270
  ProductPageComponent.prototype.ngAfterViewInit = function () {
1125
1271
  };
@@ -1144,6 +1290,11 @@ var ProductPageComponent = /** @class */ (function () {
1144
1290
  ProductPageComponent.prototype.showFullScreen = function () {
1145
1291
  this.fullScreen = !this.fullScreen;
1146
1292
  };
1293
+ ProductPageComponent.prototype._handleSettingsLoaded = function (loaded) {
1294
+ if (loaded) {
1295
+ this._ione.initConnection();
1296
+ }
1297
+ };
1147
1298
  ProductPageComponent.prototype._getArticle = function () {
1148
1299
  return __awaiter(this, void 0, void 0, function () {
1149
1300
  var _this = this;
@@ -1157,18 +1308,20 @@ var ProductPageComponent = /** @class */ (function () {
1157
1308
  if (init) {
1158
1309
  this._ione.getFullArticle(this._sku).then(function (article) {
1159
1310
  _this.article = article;
1160
- _this.configurable = _this.article.goodType === 'B';
1161
- if (_this.configurable) {
1162
- _this.currentView = SelectorType.TwoD;
1163
- }
1164
- _this.threeD = _this.article.is3D;
1165
- _this.selectorType = _this.article.selectorTypeCustomer;
1166
- _this._ione.getDeliveryPrognosis(_this.article.goodId).then(function (stockInfo) {
1167
- var stockAndDelivery = stockInfo;
1168
- _this.stockAndDelivery = new StockAndDelivery(0, stockAndDelivery.returnValue ? stockAndDelivery.returnValue : ' ');
1311
+ if (_this.article) {
1312
+ _this.configurable = _this.article.goodType === 'B';
1313
+ if (_this.configurable) {
1314
+ _this.currentView = SelectorType.TwoD;
1315
+ }
1316
+ _this.threeD = _this.article.is3D;
1317
+ _this.selectorType = _this.article.selectorTypeCustomer;
1318
+ _this._ione.getDeliveryPrognosis(_this.article.goodId).then(function (stockInfo) {
1319
+ var stockAndDelivery = stockInfo;
1320
+ _this.stockAndDelivery = new StockAndDelivery(0, stockAndDelivery.returnValue ? stockAndDelivery.returnValue : ' ');
1321
+ _this._changeDetector.detectChanges();
1322
+ });
1169
1323
  _this._changeDetector.detectChanges();
1170
- });
1171
- _this._changeDetector.detectChanges();
1324
+ }
1172
1325
  });
1173
1326
  }
1174
1327
  return [2 /*return*/];
@@ -1198,10 +1351,13 @@ var ProductPageComponent = /** @class */ (function () {
1198
1351
  __decorate([
1199
1352
  Input()
1200
1353
  ], ProductPageComponent.prototype, "sku", null);
1354
+ __decorate([
1355
+ Input()
1356
+ ], ProductPageComponent.prototype, "settings", null);
1201
1357
  ProductPageComponent = __decorate([
1202
1358
  Component({
1203
1359
  selector: 'app-product-page',
1204
- template: "<div class=\"page-wrapper\">\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <div class=\"product-image-container\">\r\n <div class=\"product-page-block-selector-type\">\r\n <app-product-selector-type class=\"default-padding\"\r\n [(currentType)]=\"currentView\"\r\n [show2D]=\"configurable\"\r\n [show3D]=\"threeD\"\r\n ></app-product-selector-type>\r\n </div>\r\n <div class=\"product-page-block-image default-padding\" [class.full]=\"fullScreen\">\r\n <app-image-carousel [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\" [images]=\"article?.images\" [showRefresh]=\"configurable && threeD\"></app-image-carousel>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-configurator #configurator class=\"threed-configurator\"\r\n [class.configurator-full-screen]=\"fullScreen\"\r\n [@toggleVisibilityByState]=\"show3D ? 'show' : 'hide'\"\r\n [@toggleFullScreen]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n ></threed-configurator>\r\n </ng-container>\r\n <co-icon #fullscreenbutton class=\"fullscreen-button\" *ngIf=\"show3D\"\r\n [@toggleTopLeft]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [iconData]=\"iconCache.getIcon(fullScreenIcon)\"\r\n (click)=\"showFullScreen()\"></co-icon>\r\n <co-icon class=\"threed-watermark\" *ngIf=\"show3D && fullScreen\"\r\n [iconData]=\"iconCache.getIcon(icon.Logo)\"></co-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-description\">\r\n <app-product-description class=\"default-padding\" [article]=\"article\"></app-product-description>\r\n </div>\r\n <div class=\"product-page-block-additional\">\r\n <div class=\"product-page-block-additional-description\">\r\n <app-product-additional-description class=\"default-padding\" [article]=\"article\"></app-product-additional-description>\r\n </div>\r\n <div class=\"product-page-block-price\" [class.full]=\"configuring\">\r\n <app-product-price class=\"s-padding\" *ngIf=\"!configuring\"\r\n [pricing]=\"article?.pricing\"\r\n [configurable]=\"configurable\"\r\n ></app-product-price>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-selections #selections class=\"threed-selections\" [class.show-selections]=\"configuring\" [@toggleFullScreenRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [class.default-padding]=\"!fullScreen\"\r\n [class.show-full-screen]=\"fullScreen\"\r\n [class.mini-scrollbar]=\"fullScreen\"\r\n [sku]=\"sku\"\r\n [settings]=\"settingsService.settings\"\r\n (onUserActionFromThreeD)=\"configuring = true\"\r\n (instanceSet)=\"setInstance($event)\"\r\n (onImageReceived)=\"appEventService.onImageReceived.next($event)\"\r\n (onRenderStarted)=\"appEventService.onRenderStarted.next()\"\r\n (onDraftRenderImageReceived)=\"appEventService.onDraftRenderImageReceived.next($event)\"\r\n (onArticleReceived)=\"appEventService.onArticleReceived.next($event.detail)\"\r\n (onSelectionsReceived)=\"appEventService.onSelectionsReceived.next($event.detail)\"\r\n (onArticleInfoReceived)=\"appEventService.onArticleInfoReceived.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"addtocart-reserved product-action-buttons\" *ngIf=\"configuring\" [class.full-screen]=\"fullScreen\">\r\n <app-product-addtocart class=\"default-padding\"\r\n [configurable]=\"false\"\r\n [fullscreen]=\"fullScreen\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"product-page-block-variants\">\r\n <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-stock>\r\n </div>\r\n <div class=\"product-page-block-delivery\">\r\n <app-product-delivery class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-delivery>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <app-product-info-tabs class=\"no-padding\" [article]=\"article\"></app-product-info-tabs>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-related s-padding\">\r\n <app-product-related *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"1\" [label]=\"'RELATED_PRODUCTS' | localize\"></app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content no-top-margin\">\r\n <div class=\"page-wrapper-full\">\r\n <div class=\"product-page-block-alternatives s-padding\">\r\n <app-product-related *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"4\" [isSmallModus]=\"false\" [label]=\"'ALTERNATIVE_PRODUCTS' | localize\"></app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n",
1360
+ template: "<ng-container *ngIf=\"settingsLoaded\">\r\n <div class=\"page-wrapper\">\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <div class=\"product-image-container\">\r\n <div class=\"product-page-block-selector-type\">\r\n <app-product-selector-type class=\"default-padding\"\r\n [(currentType)]=\"currentView\"\r\n [show2D]=\"configurable\"\r\n [show3D]=\"threeD\"\r\n ></app-product-selector-type>\r\n </div>\r\n <div class=\"product-page-block-image default-padding\" [class.full]=\"fullScreen\">\r\n <app-image-carousel [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\" [images]=\"article?.images\" [showRefresh]=\"configurable && threeD\"></app-image-carousel>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-configurator #configurator class=\"threed-configurator\"\r\n [class.configurator-full-screen]=\"fullScreen\"\r\n [@toggleVisibilityByState]=\"show3D ? 'show' : 'hide'\"\r\n [@toggleFullScreen]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n ></threed-configurator>\r\n </ng-container>\r\n <co-icon #fullscreenbutton class=\"fullscreen-button\" *ngIf=\"show3D\"\r\n [@toggleTopLeft]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [iconData]=\"iconCache.getIcon(fullScreenIcon)\"\r\n (click)=\"showFullScreen()\"></co-icon>\r\n <co-icon class=\"threed-watermark\" *ngIf=\"show3D && fullScreen\"\r\n [iconData]=\"iconCache.getIcon(icon.Logo)\"></co-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-description\">\r\n <app-product-description class=\"default-padding\" [article]=\"article\"></app-product-description>\r\n </div>\r\n <div class=\"product-page-block-additional\">\r\n <div class=\"product-page-block-additional-description\">\r\n <app-product-additional-description class=\"default-padding\" [article]=\"article\"></app-product-additional-description>\r\n </div>\r\n <div class=\"product-page-block-price\" [class.full]=\"configuring\">\r\n <app-product-price class=\"s-padding\" *ngIf=\"!configuring\"\r\n [pricing]=\"article?.pricing\"\r\n [configurable]=\"configurable\"\r\n ></app-product-price>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-selections #selections class=\"threed-selections\" [class.show-selections]=\"configuring\" [@toggleFullScreenRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [class.default-padding]=\"!fullScreen\"\r\n [class.show-full-screen]=\"fullScreen\"\r\n [class.mini-scrollbar]=\"fullScreen\"\r\n [sku]=\"sku\"\r\n [settings]=\"settings\"\r\n (onUserActionFromThreeD)=\"configuring = true\"\r\n (instanceSet)=\"setInstance($event)\"\r\n (onImageReceived)=\"appEventService.onImageReceived.next($event)\"\r\n (onRenderStarted)=\"appEventService.onRenderStarted.next()\"\r\n (onDraftRenderImageReceived)=\"appEventService.onDraftRenderImageReceived.next($event)\"\r\n (onArticleReceived)=\"appEventService.onArticleReceived.next($event.detail)\"\r\n (onSelectionsReceived)=\"appEventService.onSelectionsReceived.next($event.detail)\"\r\n (onArticleInfoReceived)=\"appEventService.onArticleInfoReceived.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"addtocart-reserved product-action-buttons\" *ngIf=\"configuring\" [class.full-screen]=\"fullScreen\">\r\n <app-product-addtocart class=\"default-padding\"\r\n [configurable]=\"false\"\r\n [fullscreen]=\"fullScreen\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"product-page-block-variants\">\r\n <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-stock>\r\n </div>\r\n <div class=\"product-page-block-delivery\">\r\n <app-product-delivery class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-delivery>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <app-product-info-tabs class=\"no-padding\" [article]=\"article\"></app-product-info-tabs>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-related s-padding\">\r\n <app-product-related *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"1\" [label]=\"'RELATED_PRODUCTS' | localize\"></app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content no-top-margin\">\r\n <div class=\"page-wrapper-full\">\r\n <div class=\"product-page-block-alternatives s-padding\">\r\n <app-product-related *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"4\" [isSmallModus]=\"false\" [label]=\"'ALTERNATIVE_PRODUCTS' | localize\"></app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n",
1205
1361
  animations: [
1206
1362
  trigger('toggleFullScreen', [
1207
1363
  state('fullscreen', style({ 'position': 'fixed', 'top': '0', 'left': '0', 'width': '100%', 'height': '100%' })),
@@ -1240,203 +1396,231 @@ var ProductPageComponent = /** @class */ (function () {
1240
1396
  return ProductPageComponent;
1241
1397
  }());
1242
1398
 
1243
- var ProductDocumentsComponent = /** @class */ (function () {
1244
- function ProductDocumentsComponent(iconCache) {
1245
- this.iconCache = iconCache;
1246
- this.icon = IconEnum;
1247
- this.showLabel = false;
1248
- this.documents = [];
1399
+ var ProductSelectorTypeComponent = /** @class */ (function () {
1400
+ function ProductSelectorTypeComponent(_iconCache, _changeDetector) {
1401
+ this._iconCache = _iconCache;
1402
+ this._changeDetector = _changeDetector;
1403
+ this.type = SelectorType;
1404
+ this.icons = IconEnum;
1405
+ this.onIconClick = new EventEmitter();
1406
+ this.currentTypeChange = new EventEmitter();
1407
+ this.twoDIcon = this._iconCache.getIcon(this.icons.TwoD);
1408
+ this.threeDIcon = this._iconCache.getIcon(this.icons.ThreeD);
1249
1409
  }
1250
- ProductDocumentsComponent.ctorParameters = function () { return [
1251
- { type: IconCacheService }
1410
+ ProductSelectorTypeComponent.prototype.ngOnInit = function () {
1411
+ };
1412
+ ProductSelectorTypeComponent.prototype.handleIconClick = function (type) {
1413
+ this.currentType = type;
1414
+ this.currentTypeChange.next(this.currentType);
1415
+ this.onIconClick.next(this.currentType);
1416
+ this._changeDetector.detectChanges();
1417
+ };
1418
+ ProductSelectorTypeComponent.ctorParameters = function () { return [
1419
+ { type: IconCacheService },
1420
+ { type: ChangeDetectorRef }
1252
1421
  ]; };
1253
1422
  __decorate([
1254
1423
  Input()
1255
- ], ProductDocumentsComponent.prototype, "showLabel", void 0);
1424
+ ], ProductSelectorTypeComponent.prototype, "show2D", void 0);
1256
1425
  __decorate([
1257
1426
  Input()
1258
- ], ProductDocumentsComponent.prototype, "documents", void 0);
1259
- ProductDocumentsComponent = __decorate([
1427
+ ], ProductSelectorTypeComponent.prototype, "show3D", void 0);
1428
+ __decorate([
1429
+ Input()
1430
+ ], ProductSelectorTypeComponent.prototype, "currentType", void 0);
1431
+ __decorate([
1432
+ Output()
1433
+ ], ProductSelectorTypeComponent.prototype, "onIconClick", void 0);
1434
+ __decorate([
1435
+ Output()
1436
+ ], ProductSelectorTypeComponent.prototype, "currentTypeChange", void 0);
1437
+ ProductSelectorTypeComponent = __decorate([
1260
1438
  Component({
1261
- selector: 'app-product-documents',
1262
- template: "<app-header *ngIf=\"showLabel\" [label]=\"'DOCUMENTS' | localize\" [amount]=\"documents?.length\"></app-header>\n<div *ngIf=\"documents && documents.length > 0\">\n <co-files-upload [documents]=\"documents\" [canAdd]=\"false\" readonly></co-files-upload>\n</div>\n",
1263
- styles: [":host{display:block}::ng-deep co-files-upload{flex-direction:column!important;width:100%}::ng-deep co-file-upload{margin:0!important;border-bottom:1px solid #f6f5f4}::ng-deep co-file-upload:first-child{border-top:1px solid #f6f5f4}::ng-deep co-files-upload .files-upload-wrapper{flex-direction:column!important;width:100%}::ng-deep co-file-upload co-tile{max-width:100%!important;width:100%;position:relative}::ng-deep co-file-upload co-tile:hover{box-shadow:none!important}::ng-deep co-file-upload co-tile:hover .tile-extra-bottom{background-color:#f6f5f4!important}::ng-deep co-file-upload co-tile .tile-wrapper{position:absolute!important;left:0;top:0;width:100%;height:100%;z-index:2;opacity:0;box-sizing:border-box}::ng-deep co-file-upload co-tile .tile-wrapper .image{position:absolute!important;left:0;top:0;width:100%!important;height:100%!important;cursor:pointer}::ng-deep co-file-upload co-tile .tile-extra-bottom{outline:0!important;border:none!important;background:url(../../../assets/icons/download.svg) left 6px center/36px auto no-repeat!important;line-height:20px;padding:20px 20px 20px 60px!important;margin:0!important}::ng-deep co-file-upload co-tile .tile-extra-bottom .main{padding:0!important}"]
1439
+ selector: 'app-product-selector-type',
1440
+ template: "<div *ngIf=\"show2D || show3D\" class=\"show-in\" [textContent]=\"'SHOW_IN' | localize\"></div>\n<co-icon *ngIf=\"show2D\" class=\"selector-type-icon\"\n [class.active]=\"currentType === type.TwoD\"\n [iconData]=\"twoDIcon\"\n (click)=\"handleIconClick(type.TwoD)\"\n></co-icon>\n<co-icon *ngIf=\"show3D\" class=\"selector-type-icon\"\n [class.active]=\"currentType === type.ThreeD\"\n [iconData]=\"threeDIcon\"\n (click)=\"handleIconClick(type.ThreeD)\"\n></co-icon>\n",
1441
+ styles: [":host{display:flex;flex-direction:row;align-items:center}:host .show-in{display:none}:host>:not(:last-child){margin-right:10px}::ng-deep co-icon.selector-type-icon{box-shadow:inset 0 0 0 1px #22313c;border-radius:50%;background:0 0;height:34px;width:34px;cursor:pointer}::ng-deep co-icon.selector-type-icon.active{box-shadow:none;background:#74b77f;transition:.2s ease-in-out}::ng-deep co-icon.selector-type-icon.active [fill]{fill:#fff}"]
1264
1442
  })
1265
- ], ProductDocumentsComponent);
1266
- return ProductDocumentsComponent;
1443
+ ], ProductSelectorTypeComponent);
1444
+ return ProductSelectorTypeComponent;
1267
1445
  }());
1268
1446
 
1269
- var ProductRelatedComponent = /** @class */ (function () {
1270
- function ProductRelatedComponent(_iOne, _appEventService) {
1271
- this._iOne = _iOne;
1272
- this._appEventService = _appEventService;
1273
- this.isSmallModus = true;
1274
- this._articles = [];
1447
+ var ImageCarouselComponent = /** @class */ (function () {
1448
+ function ImageCarouselComponent(_ione, _appEventService, _changeDetector, _domSanitizer, iconCache) {
1449
+ var _this = this;
1450
+ this._ione = _ione;
1451
+ this._appEventService = _appEventService;
1452
+ this._changeDetector = _changeDetector;
1453
+ this._domSanitizer = _domSanitizer;
1454
+ this.iconCache = iconCache;
1455
+ this.icons = IconEnum;
1456
+ this.showLoader = false;
1457
+ this.showRefresh = false;
1458
+ this.resizing = false;
1459
+ this._currentIndex = 0;
1460
+ this._images = [];
1461
+ this._subs = [];
1462
+ this._subs.push(this._appEventService.onRenderStarted.subscribe(function () {
1463
+ _this.showLoader = true;
1464
+ }), this._appEventService.onDraftRenderImageReceived.subscribe(function (url) {
1465
+ if (_this._images[0] instanceof CoDocument) {
1466
+ _this._images.unshift(url);
1467
+ }
1468
+ else {
1469
+ _this._images[0] = url;
1470
+ }
1471
+ _this.showLoader = false;
1472
+ }));
1275
1473
  }
1276
- Object.defineProperty(ProductRelatedComponent.prototype, "articles", {
1474
+ Object.defineProperty(ImageCarouselComponent.prototype, "images", {
1277
1475
  get: function () {
1278
- return this._articles;
1476
+ return this._images;
1279
1477
  },
1280
1478
  set: function (value) {
1281
- var _this = this;
1282
- if (value) {
1283
- if (this.refType && this.refType !== undefined) {
1284
- if (value.length > 0) {
1285
- value.forEach(function (x) {
1286
- if (x.refType === _this.refType) {
1287
- _this._articles.push(x);
1288
- }
1289
- });
1290
- }
1291
- }
1292
- else {
1293
- this._articles = value;
1294
- }
1479
+ if (value && value.length > 0) {
1480
+ this._images = value;
1295
1481
  this._loadImages();
1482
+ this._changeDetector.detectChanges();
1296
1483
  }
1297
1484
  },
1298
1485
  enumerable: true,
1299
1486
  configurable: true
1300
1487
  });
1301
- ProductRelatedComponent.prototype.handleContentClick = function (article) {
1302
- this._appEventService.onAlternativeClick.next(article);
1488
+ ImageCarouselComponent.prototype.handleWindowResize = function () {
1489
+ var _this = this;
1490
+ this.resizing = true;
1491
+ this._scrollCarouselToIndex();
1492
+ clearTimeout(this._resizeTimer);
1493
+ this._resizeTimer = setTimeout(function () {
1494
+ _this.resizing = false;
1495
+ }, 200);
1303
1496
  };
1304
- ProductRelatedComponent.prototype._loadImages = function () {
1497
+ ImageCarouselComponent.prototype.gotoNextSlide = function () {
1498
+ this.currentIndex++;
1499
+ };
1500
+ ImageCarouselComponent.prototype.gotoPrevSlide = function () {
1501
+ this.currentIndex--;
1502
+ };
1503
+ ImageCarouselComponent.prototype.isCurrentIndex = function (index) {
1504
+ return this.currentIndex === index;
1505
+ };
1506
+ Object.defineProperty(ImageCarouselComponent.prototype, "currentIndex", {
1507
+ get: function () {
1508
+ return this._currentIndex;
1509
+ },
1510
+ set: function (value) {
1511
+ this._currentIndex = value;
1512
+ this._scrollCarouselToIndex();
1513
+ },
1514
+ enumerable: true,
1515
+ configurable: true
1516
+ });
1517
+ ImageCarouselComponent.prototype.ngOnInit = function () {
1518
+ };
1519
+ ImageCarouselComponent.prototype.ngOnDestroy = function () {
1520
+ this.carousel = undefined;
1521
+ this._subs.forEach(function (s) { return s.unsubscribe(); });
1522
+ };
1523
+ ImageCarouselComponent.prototype.handleThumbClick = function (index) {
1524
+ this.currentIndex = index;
1525
+ };
1526
+ ImageCarouselComponent.prototype.onForceRenderImage = function () {
1527
+ this._appEventService.onForceRenderImage.next();
1528
+ };
1529
+ ImageCarouselComponent.prototype.getImageSrc = function (image) {
1530
+ var source = '';
1531
+ if (image instanceof CoDocument) {
1532
+ if (image.filePath) {
1533
+ source = image.filePath;
1534
+ }
1535
+ else {
1536
+ source = image.documentBodyAsDataUri;
1537
+ }
1538
+ }
1539
+ else if (image.detail !== undefined) {
1540
+ source = image.detail;
1541
+ }
1542
+ return this._domSanitizer.bypassSecurityTrustUrl(source);
1543
+ };
1544
+ ImageCarouselComponent.prototype._loadImages = function () {
1305
1545
  var _this = this;
1306
- this._articles.forEach(function (a) {
1307
- if (!a.image.documentBody) {
1308
- _this._iOne.getDocumentContent(a.image.documentId).then(function (content) {
1309
- if (content) {
1310
- a.image.documentBody = content.documentContent;
1311
- }
1312
- });
1546
+ if (this._images) {
1547
+ this._images.forEach(function (i) {
1548
+ if (!i.documentBody && !i.filePath) {
1549
+ _this._ione.getDocumentContent(i.documentId, false).then(function (content) {
1550
+ if (content) {
1551
+ i.documentBody = content.documentContent;
1552
+ }
1553
+ });
1554
+ }
1555
+ });
1556
+ }
1557
+ };
1558
+ ImageCarouselComponent.prototype._scrollCarouselToIndex = function () {
1559
+ if (this.currentIndex > -1 && this.currentIndex <= this.images.length) {
1560
+ var movePx = this.currentIndex * this.carousel.nativeElement.clientWidth;
1561
+ if (this.carousel && this.carousel.nativeElement) {
1562
+ this.carousel.nativeElement.scrollLeft = movePx;
1563
+ // this.carousel.nativeElement.scrollTo({
1564
+ // left: movePx,
1565
+ // behavior: 'smooth'
1566
+ // });
1313
1567
  }
1314
- });
1568
+ }
1315
1569
  };
1316
- ProductRelatedComponent.ctorParameters = function () { return [
1570
+ ImageCarouselComponent.ctorParameters = function () { return [
1317
1571
  { type: ProductConnectorService },
1318
- { type: ProductEventService }
1572
+ { type: ProductEventService },
1573
+ { type: ChangeDetectorRef },
1574
+ { type: DomSanitizer },
1575
+ { type: IconCacheService }
1319
1576
  ]; };
1320
1577
  __decorate([
1321
- Input()
1322
- ], ProductRelatedComponent.prototype, "refType", void 0);
1578
+ ViewChild('carousel', { read: ElementRef })
1579
+ ], ImageCarouselComponent.prototype, "carousel", void 0);
1323
1580
  __decorate([
1324
1581
  Input()
1325
- ], ProductRelatedComponent.prototype, "label", void 0);
1582
+ ], ImageCarouselComponent.prototype, "showRefresh", void 0);
1326
1583
  __decorate([
1327
1584
  Input()
1328
- ], ProductRelatedComponent.prototype, "isSmallModus", void 0);
1585
+ ], ImageCarouselComponent.prototype, "images", null);
1329
1586
  __decorate([
1330
- Input()
1331
- ], ProductRelatedComponent.prototype, "articles", null);
1332
- ProductRelatedComponent = __decorate([
1333
- Component({
1334
- selector: 'app-product-related',
1335
- template: "<div *ngIf=\"articles && articles.length > 0\">\n <app-header [label]=\"label\" [amount]=\"articles?.length\" *ngIf=\"label\"></app-header>\n <co-scroll-container>\n <div class=\"article-wrapper\" *ngFor=\"let article of articles\">\n <co-article-tile\n [imageData]=\"article.image.documentBodyAsDataUri\"\n [description]=\"article.description\"\n [price]=\"article.price\"\n [level]=\"article.stockStatus\"\n [isSmallModus]=\"isSmallModus\"\n [hasConfigureButton]=\"article.goodType === 'B'\"\n (contentClick)=\"handleContentClick(article)\"\n ></co-article-tile>\n </div>\n </co-scroll-container>\n</div>\n",
1336
- styles: [":host{display:block}.article-wrapper{display:flex;flex-direction:row}.article-wrapper ::ng-deep co-tile.small{min-width:189px;max-width:189px;height:100%}.article-wrapper ::ng-deep co-tile.small:hover{box-shadow:none;cursor:pointer}.article-wrapper ::ng-deep co-tile.small:hover .tile-bottom .left-buttons{margin:0!important}.article-wrapper ::ng-deep co-tile.small .tile-wrapper{outline:0!important;padding-bottom:0;overflow:hidden}.article-wrapper ::ng-deep co-tile.small .tile-wrapper div.image{height:100px}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons{position:absolute;top:0;right:0;margin:0 -32px 0 0;align-items:flex-end;transition:.2s ease-in-out}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons ::ng-deep co-button.card-button.mini{width:30px;height:30px;transform:none;border-radius:4px;margin:0 0 5px}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons ::ng-deep co-button.card-button.mini ::ng-deep co-icon{width:30px;height:30px}.article-wrapper ::ng-deep co-tile.small .tile-extra-bottom{outline:0!important;background:0 0!important}.article-wrapper ::ng-deep co-tile.small .tile-extra-bottom .price{color:#74b77f;margin:5px 0 0;font-weight:400;font-size:12px}"]
1337
- })
1338
- ], ProductRelatedComponent);
1339
- return ProductRelatedComponent;
1340
- }());
1341
-
1342
- var HeaderComponent = /** @class */ (function () {
1343
- function HeaderComponent() {
1344
- }
1345
- HeaderComponent.prototype.ngOnInit = function () {
1346
- };
1587
+ HostListener('window:resize')
1588
+ ], ImageCarouselComponent.prototype, "handleWindowResize", null);
1347
1589
  __decorate([
1348
- Input()
1349
- ], HeaderComponent.prototype, "label", void 0);
1590
+ HostListener('swipeleft')
1591
+ ], ImageCarouselComponent.prototype, "gotoNextSlide", null);
1350
1592
  __decorate([
1351
- Input()
1352
- ], HeaderComponent.prototype, "amount", void 0);
1353
- HeaderComponent = __decorate([
1593
+ HostListener('swiperight')
1594
+ ], ImageCarouselComponent.prototype, "gotoPrevSlide", null);
1595
+ __decorate([
1596
+ HostBinding('class.resizing')
1597
+ ], ImageCarouselComponent.prototype, "resizing", void 0);
1598
+ ImageCarouselComponent = __decorate([
1354
1599
  Component({
1355
- selector: 'app-header',
1356
- template: "<ng-container *ngIf=\"label\">\n <div class=\"header-wrapper\">\n <h3 [textContent]=\"label\"></h3>\n <span *ngIf=\"amount\" class=\"amount\" [textContent]=\"'(' + amount + ')'\"></span>\n </div>\n</ng-container>\n",
1357
- styles: [".header-wrapper{display:flex;flex-direction:row;align-items:center}.header-wrapper .amount{margin-left:5px}"]
1600
+ selector: 'app-image-carousel',
1601
+ template: "<div id=\"product_page_carousel\">\n <div id=\"product_page_carousel_items\">\n <co-loader [isShown]=\"showLoader\"></co-loader>\n <div #carousel class=\"inner-carousel\">\n <!-- This has been taken out of the for loop to prevent flashing images when updating. -->\n <div *ngIf=\"images[0]\" class=\"carousel-item\" [id]=\"'slide-0'\" [class.active]=\"isCurrentIndex(0)\">\n <img [src]=\"getImageSrc(images[0])\">\n </div>\n <div *ngFor=\"let image of images.slice(1); let index = index\" class=\"carousel-item\" [id]=\"'slide-' + (index + 1)\" [class.active]=\"isCurrentIndex((index + 1))\">\n <img [src]=\"getImageSrc(image)\">\n </div>\n <div class=\"carousel-scroller-layer\" *ngIf=\"images && images.length > 1\">\n <div class=\"carousel-item-scroller prev\" (click)=\"gotoPrevSlide()\" *ngIf=\"currentIndex > 0\"></div>\n <div class=\"carousel-item-scroller next\" (click)=\"gotoNextSlide()\" *ngIf=\"currentIndex < images.length - 1\"></div>\n </div>\n </div>\n <co-icon class=\"selector-type-icon refresh-button\" [iconData]=\"iconCache.getIcon(icons.Refresh)\" (click)=\"onForceRenderImage()\" [class.loading]=\"showLoader\" *ngIf=\"showRefresh\"></co-icon>\n </div>\n\n <div id=\"product_page_carousel_thumbs\">\n <co-scroll-container class=\"scroll-container\" *ngIf=\"images && images.length > 1\">\n <div *ngFor=\"let image of images; let index = index\" class=\"carousel-thumb\" [class.active]=\"index === currentIndex\">\n <img [src]=\"getImageSrc(image)\" (click)=\"handleThumbClick(index)\"/>\n </div>\n </co-scroll-container>\n </div>\n</div>\n",
1602
+ styles: [":host{max-height:540px;height:100%;position:relative}:host:not(.resizing) .inner-carousel{scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scroll-snap-type:x mandatory}#product_page_carousel{position:relative}#product_page_carousel .refresh-button{position:absolute;bottom:10px;right:10px;background:#fff}#product_page_carousel .refresh-button.loading{-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin}#product_page_carousel .refresh-button:hover{box-shadow:none;background:#74b77f;transition:.2s ease-in-out}#product_page_carousel .refresh-button:hover ::ng-deep svg path{fill:#fff!important}#product_page_carousel #product_page_carousel_items{position:relative;margin-bottom:10px}#product_page_carousel #product_page_carousel_items ::ng-deep co-loader{position:absolute}#product_page_carousel .inner-carousel{display:flex;flex-direction:row;align-items:center;overflow:hidden;max-height:500px;border:1px solid #efefef}#product_page_carousel .carousel-item{max-height:500px;width:100%;display:flex;flex-shrink:0;flex-grow:0}#product_page_carousel .carousel-item img{width:100%;height:auto;-o-object-fit:contain;object-fit:contain}#product_page_carousel .carousel-scroller-layer{height:100%;width:100%;position:absolute;pointer-events:none;top:0;left:0}#product_page_carousel #product_page_carousel_thumbs{display:flex;justify-content:flex-start;height:80px;margin-left:auto;margin-right:auto}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container{padding:0 22px}#product_page_carousel #product_page_carousel_thumbs ::ng-deep co-scroll-container .content-wrapper{padding:0}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb{opacity:1;cursor:pointer;transition:.2s;padding:4px;border:1px solid #f6f5f4}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb.active,#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:hover{border-color:#22313c}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb:not(:last-child){margin-right:10px}#product_page_carousel #product_page_carousel_thumbs .carousel-thumb img{height:68px}@media screen and (max-width:650px){#product_page_carousel_thumbs{height:57px!important}#product_page_carousel_thumbs .carousel-thumb img{height:50px!important}}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]
1358
1603
  })
1359
- ], HeaderComponent);
1360
- return HeaderComponent;
1604
+ ], ImageCarouselComponent);
1605
+ return ImageCarouselComponent;
1361
1606
  }());
1362
1607
 
1363
- var TabType;
1364
- (function (TabType) {
1365
- TabType["Additional"] = "additional";
1366
- TabType["Properties"] = "properties";
1367
- })(TabType || (TabType = {}));
1368
- var ProductInfoComponent = /** @class */ (function () {
1369
- function ProductInfoComponent() {
1370
- this.tabType = TabType;
1371
- this.currentTab = TabType.Additional;
1608
+ var ProductDescriptionComponent = /** @class */ (function () {
1609
+ function ProductDescriptionComponent() {
1372
1610
  }
1373
- ProductInfoComponent.prototype.ngOnInit = function () {
1374
- };
1375
- ProductInfoComponent.prototype.switchTab = function (tab) {
1376
- this.currentTab = tab;
1611
+ ProductDescriptionComponent.prototype.ngOnInit = function () {
1377
1612
  };
1378
1613
  __decorate([
1379
1614
  Input()
1380
- ], ProductInfoComponent.prototype, "article", void 0);
1381
- ProductInfoComponent = __decorate([
1615
+ ], ProductDescriptionComponent.prototype, "article", void 0);
1616
+ ProductDescriptionComponent = __decorate([
1382
1617
  Component({
1383
- selector: 'app-product-info',
1384
- template: "<div>\n <div class=\"info-wrapper\">\n <div class=\"info-navigation\">\n <span [textContent]=\"'ADDITIONAL_DATA' | localize\" class=\"navigator\" [class.selected]=\"currentTab === tabType.Additional\" (mouseup)=\"switchTab(tabType.Additional)\"></span>\n <span [textContent]=\"'PROPERTIES' | localize\" class=\"navigator\" [class.selected]=\"currentTab === tabType.Properties\" (mouseup)=\"switchTab(tabType.Properties)\"></span>\n </div>\n <ng-container [ngSwitch]=\"currentTab\" class=\"content\">\n <div *ngSwitchCase=\"tabType.Additional\" @showContent>\n <app-product-additional-info\n [article]=\"article\"\n ></app-product-additional-info>\n </div>\n <div *ngSwitchCase=\"tabType.Properties\" @showContent>\n <app-product-properties [article]=\"article\"></app-product-properties>\n </div>\n </ng-container>\n </div>\n</div>\n",
1385
- animations: [
1386
- trigger('showContent', [
1387
- state('void', style({ 'opacity': '0' })),
1388
- state('*', style({ 'opacity': '1' })),
1389
- transition('void => *', animate('200ms 100ms ease-in-out')),
1390
- ])
1391
- ],
1392
- styles: [".info-navigation{margin:30px 0}.info-navigation .navigator:not(:last-child){margin-right:30px}.navigator{font-size:15px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.navigator.selected{color:#2b60a7}"]
1393
- })
1394
- ], ProductInfoComponent);
1395
- return ProductInfoComponent;
1396
- }());
1397
-
1398
- var ProductModuleService = /** @class */ (function () {
1399
- function ProductModuleService(_iOneConnectorService) {
1400
- this._iOneConnectorService = _iOneConnectorService;
1401
- this._superArticles = new Map();
1402
- }
1403
- ProductModuleService.prototype.getArticle = function (id) {
1404
- return __awaiter(this, void 0, void 0, function () {
1405
- return __generator(this, function (_a) {
1406
- switch (_a.label) {
1407
- case 0: return [4 /*yield*/, this._getArticle(id)];
1408
- case 1: return [2 /*return*/, _a.sent()];
1409
- }
1410
- });
1411
- });
1412
- };
1413
- ProductModuleService.prototype._getArticle = function (id) {
1414
- return __awaiter(this, void 0, void 0, function () {
1415
- var mainArticle;
1416
- return __generator(this, function (_a) {
1417
- switch (_a.label) {
1418
- case 0:
1419
- if (!this._superArticles.has(id)) return [3 /*break*/, 1];
1420
- return [2 /*return*/, this._superArticles.get(id)];
1421
- case 1: return [4 /*yield*/, this._iOneConnectorService.getSuperArticle(id)];
1422
- case 2:
1423
- mainArticle = _a.sent();
1424
- this._superArticles.set(id, mainArticle);
1425
- return [2 /*return*/, mainArticle];
1426
- }
1427
- });
1428
- });
1429
- };
1430
- ProductModuleService.ctorParameters = function () { return [
1431
- { type: ProductConnectorService }
1432
- ]; };
1433
- ProductModuleService.ɵprov = ɵɵdefineInjectable({ factory: function ProductModuleService_Factory() { return new ProductModuleService(ɵɵinject(ProductConnectorService)); }, token: ProductModuleService, providedIn: "root" });
1434
- ProductModuleService = __decorate([
1435
- Injectable({
1436
- providedIn: 'root'
1618
+ selector: 'app-product-description',
1619
+ template: "<div class=\"pd-title-wrapper\">\n <span class=\"pd-description\" [textContent]=\"article?.descriptionRetail\" *ngIf=\"article?.descriptionRetail\"></span>\n <span class=\"pd-sku\" [textContent]=\"article?.articleNr\" *ngIf=\"article?.articleNr\"></span>\n</div>\n",
1620
+ styles: [":host{display:block}.pd-title-wrapper{margin:20px 0 0}.pd-description{color:#22313c;font-size:25px;font-weight:700;width:100%;display:block}.pd-sku{color:#5b6875;font-size:16px}@media screen and (max-width:650px){.pd-description{font-size:21px}.pd-sku{font-size:13px}}"]
1437
1621
  })
1438
- ], ProductModuleService);
1439
- return ProductModuleService;
1622
+ ], ProductDescriptionComponent);
1623
+ return ProductDescriptionComponent;
1440
1624
  }());
1441
1625
 
1442
1626
  var BitUtils = /** @class */ (function () {
@@ -1460,248 +1644,326 @@ var BitUtils = /** @class */ (function () {
1460
1644
  return BitUtils;
1461
1645
  }());
1462
1646
 
1463
- var ProductAdditionalInfoComponent = /** @class */ (function () {
1464
- function ProductAdditionalInfoComponent(_sanitizer, _moduleService, _changeDetector) {
1465
- this._sanitizer = _sanitizer;
1466
- this._moduleService = _moduleService;
1467
- this._changeDetector = _changeDetector;
1468
- this.showLabel = false;
1469
- this.textParts = [];
1647
+ var ProductAdditionalDescriptionComponent = /** @class */ (function () {
1648
+ function ProductAdditionalDescriptionComponent(_appEventService) {
1649
+ this._appEventService = _appEventService;
1470
1650
  }
1471
- Object.defineProperty(ProductAdditionalInfoComponent.prototype, "article", {
1651
+ Object.defineProperty(ProductAdditionalDescriptionComponent.prototype, "article", {
1472
1652
  get: function () {
1473
1653
  return this._article;
1474
1654
  },
1475
1655
  set: function (value) {
1476
- var _this = this;
1477
- if (value) {
1478
- this._article = value;
1479
- this._buildInfo().then(function () {
1480
- _this._changeDetector.detectChanges();
1481
- });
1656
+ this._article = value;
1657
+ if (this._article) {
1658
+ this.description = this.article.additionalDescription;
1659
+ this._prepareDescription();
1482
1660
  }
1483
1661
  },
1484
1662
  enumerable: true,
1485
1663
  configurable: true
1486
1664
  });
1487
- ProductAdditionalInfoComponent.prototype.ngOnInit = function () {
1665
+ ProductAdditionalDescriptionComponent.prototype.ngOnInit = function () {
1488
1666
  };
1489
- ProductAdditionalInfoComponent.prototype._getTextsSuperArticle = function () {
1667
+ ProductAdditionalDescriptionComponent.prototype.onReadMore = function () {
1668
+ this._appEventService.onUpdateProductInfoTab.next(0);
1669
+ };
1670
+ ProductAdditionalDescriptionComponent.prototype._prepareDescription = function () {
1490
1671
  var _this = this;
1491
- return new Promise(function (resolve, reject) {
1492
- var texts = [];
1493
- if (_this.article.superArticleNr) {
1494
- _this._moduleService.getArticle(_this.article.superArticleNr).then(function (mainArticle) {
1495
- mainArticle.texts.forEach(function (txt) {
1496
- if (BitUtils.IsFullDescription(txt.publication)) {
1497
- var safeTxt = _this._sanitizer.sanitize(SecurityContext.HTML, txt.text);
1498
- texts.push(safeTxt);
1499
- }
1500
- });
1501
- resolve(texts);
1502
- }).catch(function () {
1503
- resolve([]);
1504
- });
1672
+ this.description = '';
1673
+ if (this.article.texts && this.article.texts.length > 0) {
1674
+ this.article.texts.forEach(function (txt) {
1675
+ if (BitUtils.IsShortDescription(txt.publication)) {
1676
+ _this.description += txt.text;
1677
+ }
1678
+ });
1679
+ this.description = this.description.replace(/<[^>]*>?/gm, '');
1680
+ if (this.description.length > 250) {
1681
+ this.description = this.description.substr(0, 250) + ' [..]';
1682
+ }
1683
+ }
1684
+ };
1685
+ ProductAdditionalDescriptionComponent.ctorParameters = function () { return [
1686
+ { type: ProductEventService }
1687
+ ]; };
1688
+ __decorate([
1689
+ Input()
1690
+ ], ProductAdditionalDescriptionComponent.prototype, "article", null);
1691
+ ProductAdditionalDescriptionComponent = __decorate([
1692
+ Component({
1693
+ selector: 'app-product-additional-description',
1694
+ template: "<ng-container *ngIf=\"description !== ''\">\n <div class=\"pd-additional-description\">\n <p [innerHTML]=\"description\"></p>\n <button class=\"pd-read-more-btn\" [textContent]=\"'READ_MORE' | localize\" (click)=\"onReadMore()\"></button>\n </div>\n</ng-container>\n",
1695
+ styles: [":host{display:block;padding-top:0!important}:host :focus{outline:0!important}:host .pd-additional-description{line-height:190%;color:#22313c;font-size:13px}:host .pd-read-more-btn{color:#2b60a7;border:none;background:0 0;cursor:pointer;text-decoration:underline;font-family:iOneMontserrat}:host .pd-read-more-btn:hover{color:#74b77f}@media screen and (max-width:650px){:host .pd-additional-description{font-size:12px}}"]
1696
+ })
1697
+ ], ProductAdditionalDescriptionComponent);
1698
+ return ProductAdditionalDescriptionComponent;
1699
+ }());
1700
+
1701
+ var ProductPriceComponent = /** @class */ (function () {
1702
+ function ProductPriceComponent(_changeDetector) {
1703
+ this._changeDetector = _changeDetector;
1704
+ this.showFromPrice = false;
1705
+ this._configurable = false;
1706
+ }
1707
+ Object.defineProperty(ProductPriceComponent.prototype, "pricing", {
1708
+ get: function () {
1709
+ return this._pricing;
1710
+ },
1711
+ set: function (value) {
1712
+ this._pricing = value;
1713
+ this._setPrices();
1714
+ },
1715
+ enumerable: true,
1716
+ configurable: true
1717
+ });
1718
+ Object.defineProperty(ProductPriceComponent.prototype, "configurable", {
1719
+ set: function (value) {
1720
+ this._configurable = value;
1721
+ this._setPrices();
1722
+ },
1723
+ enumerable: true,
1724
+ configurable: true
1725
+ });
1726
+ ProductPriceComponent.prototype.ngOnInit = function () {
1727
+ };
1728
+ ProductPriceComponent.prototype._setPrices = function () {
1729
+ if (this._pricing) {
1730
+ this.valutaSign = this._getSign(this._pricing.retailCurrency);
1731
+ if (this._configurable) {
1732
+ this.fromPrice = this._pricing.retailBasePrice ? this._pricing.retailBasePrice : this._pricing.priceBaseline;
1733
+ this.fromLabel = this._pricing.retailBasePrice ? 'PRICE' : 'FROM';
1734
+ this.toPrice = undefined;
1505
1735
  }
1506
1736
  else {
1507
- resolve(texts);
1737
+ this.fromPrice = this._pricing.retailSuggestedPrice ? this._pricing.retailSuggestedPrice : this._pricing.retailBasePrice;
1738
+ this.fromLabel = this._pricing.retailSuggestedPrice ? 'Was' : 'PRICE';
1739
+ this.toPrice = this._pricing.retailSuggestedPrice ? this._pricing.retailBasePrice : undefined;
1740
+ this.toLabel = this._pricing.retailSuggestedPrice ? 'IS_NOW' : '';
1508
1741
  }
1509
- });
1742
+ this._changeDetector.detectChanges();
1743
+ }
1510
1744
  };
1511
- ProductAdditionalInfoComponent.prototype._prepareArticleTexts = function () {
1745
+ ProductPriceComponent.prototype._getSign = function (currency) {
1746
+ switch (currency) {
1747
+ case 'EUR':
1748
+ return '€';
1749
+ default:
1750
+ return '€';
1751
+ }
1752
+ };
1753
+ ProductPriceComponent.ctorParameters = function () { return [
1754
+ { type: ChangeDetectorRef }
1755
+ ]; };
1756
+ __decorate([
1757
+ Input()
1758
+ ], ProductPriceComponent.prototype, "pricing", null);
1759
+ __decorate([
1760
+ Input()
1761
+ ], ProductPriceComponent.prototype, "configurable", null);
1762
+ ProductPriceComponent = __decorate([
1763
+ Component({
1764
+ selector: 'app-product-price',
1765
+ template: "<div *ngIf=\"toPrice\">\n <div class=\"price-wrapper\" *ngIf=\"fromPrice > toPrice\">\n <div class=\"from-price-label\" [textContent]=\"fromLabel | localize\"></div>\n <div class=\"from-price\" [textContent]=\"fromPrice | priceDisplay\"></div>\n </div>\n <div class=\"price-wrapper\">\n <div class=\"to-price-label\" [textContent]=\"toLabel | localize\"></div>\n <div class=\"to-price\" [textContent]=\"toPrice | priceDisplay\"></div>\n </div>\n</div>\n",
1766
+ styles: [":host{display:flex;flex-direction:column}.price-wrapper{width:100%;font-size:15px;margin:0 0 5px;display:inline-block}.price-wrapper:last-child{margin:0}.from-price-label,.to-price-label{color:#5b6875;display:none}.from-price{font-size:16px;font-weight:700;text-decoration:line-through;color:#5b6875}.to-price{font-size:25px;font-weight:700;color:#74b77f}@media screen and (max-width:650px){.from-price{font-size:13px}.to-price{font-size:21px}}"]
1767
+ })
1768
+ ], ProductPriceComponent);
1769
+ return ProductPriceComponent;
1770
+ }());
1771
+
1772
+ var ProductAddtocartComponent = /** @class */ (function () {
1773
+ function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService) {
1774
+ this.iconCache = iconCache;
1775
+ this._ioneControllerService = _ioneControllerService;
1776
+ this._appEventService = _appEventService;
1777
+ this._settingsService = _settingsService;
1778
+ this.icon = IconEnum;
1779
+ this.configurable = false;
1780
+ this.configuring = false;
1781
+ this.fullscreen = false;
1782
+ this.startConfiguration = new EventEmitter();
1783
+ this.addToCartClick = new EventEmitter();
1784
+ this.addToQuoteClick = new EventEmitter();
1785
+ this.showQuoteButton = false;
1786
+ this._quantity = 1;
1787
+ }
1788
+ Object.defineProperty(ProductAddtocartComponent.prototype, "quantity", {
1789
+ get: function () {
1790
+ return this._quantity;
1791
+ },
1792
+ set: function (value) {
1793
+ this._quantity = Math.max(1, value);
1794
+ },
1795
+ enumerable: true,
1796
+ configurable: true
1797
+ });
1798
+ ProductAddtocartComponent.prototype.ngOnInit = function () {
1799
+ };
1800
+ ProductAddtocartComponent.prototype.ngOnDestroy = function () {
1801
+ this.addToCartButton = undefined;
1802
+ };
1803
+ ProductAddtocartComponent.prototype.handleAddToCartClick = function (quantity) {
1512
1804
  return __awaiter(this, void 0, void 0, function () {
1513
- var texts;
1514
- var _a;
1515
- var _this = this;
1516
- return __generator(this, function (_b) {
1517
- switch (_b.label) {
1518
- case 0: return [4 /*yield*/, this._getTextsSuperArticle()];
1805
+ var _a, _b;
1806
+ return __generator(this, function (_c) {
1807
+ switch (_c.label) {
1808
+ case 0:
1809
+ _b = (_a = this._appEventService.onAddToCart).next;
1810
+ return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
1519
1811
  case 1:
1520
- texts = _b.sent();
1521
- if (texts.length > 0) {
1522
- (_a = this.textParts).push.apply(_a, __spread(texts));
1523
- }
1524
- if (this.article.texts) {
1525
- this.article.texts.forEach(function (txt) {
1526
- if (BitUtils.IsFullDescription(txt.publication)) {
1527
- var safeTxt = _this._sanitizer.sanitize(SecurityContext.HTML, txt.text);
1528
- _this.textParts.push(safeTxt);
1529
- }
1530
- });
1531
- }
1812
+ _b.apply(_a, [_c.sent()]);
1813
+ return [2 /*return*/];
1814
+ }
1815
+ });
1816
+ });
1817
+ };
1818
+ ProductAddtocartComponent.prototype.handleAddToQuoteClick = function (quantity) {
1819
+ return __awaiter(this, void 0, void 0, function () {
1820
+ var _a, _b;
1821
+ return __generator(this, function (_c) {
1822
+ switch (_c.label) {
1823
+ case 0:
1824
+ _b = (_a = this._appEventService.onAddToQuote).next;
1825
+ return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
1826
+ case 1:
1827
+ _b.apply(_a, [_c.sent()]);
1532
1828
  return [2 /*return*/];
1533
1829
  }
1534
1830
  });
1535
1831
  });
1536
1832
  };
1537
- ProductAdditionalInfoComponent.prototype._buildInfo = function () {
1833
+ ProductAddtocartComponent.prototype._getJSONFromArticleObject = function (article) {
1538
1834
  return __awaiter(this, void 0, void 0, function () {
1835
+ var configuratorStatistics;
1539
1836
  return __generator(this, function (_a) {
1540
1837
  switch (_a.label) {
1541
1838
  case 0:
1542
- this.textParts.length = 0;
1543
- return [4 /*yield*/, this._prepareArticleTexts()];
1544
- case 1:
1545
- _a.sent();
1546
- if (this.textParts.length === 0) {
1547
- if (this.article.additionalDescription) {
1548
- this.textParts.push(this.article.additionalDescription);
1549
- }
1550
- else if (this.article.description) {
1551
- this.textParts.push(this.article.description);
1552
- }
1553
- }
1554
- return [2 /*return*/];
1839
+ configuratorStatistics = new ConfiguratorStatisticsEnvironment();
1840
+ configuratorStatistics.userType = 'iOneProductPage';
1841
+ configuratorStatistics.transactionType = 'Sales';
1842
+ configuratorStatistics.actionDomain = 'bundle';
1843
+ configuratorStatistics.sessionId = this._settingsService.settings.session ? this._settingsService.settings.session.sessionId : 'unknown';
1844
+ configuratorStatistics.webHost = window.location.host;
1845
+ configuratorStatistics.bundleHost = window.location.host;
1846
+ return [4 /*yield*/, this._ioneControllerService.getJsonArticleFlatTree(article.article.goodId, article.article.goodType, article.quantity, true, configuratorStatistics)];
1847
+ case 1: return [2 /*return*/, _a.sent()];
1555
1848
  }
1556
1849
  });
1557
1850
  });
1558
1851
  };
1559
- ProductAdditionalInfoComponent.ctorParameters = function () { return [
1560
- { type: DomSanitizer },
1561
- { type: ProductModuleService },
1562
- { type: ChangeDetectorRef }
1852
+ ProductAddtocartComponent.ctorParameters = function () { return [
1853
+ { type: IconCacheService },
1854
+ { type: ProductConnectorService },
1855
+ { type: ProductEventService },
1856
+ { type: ProductSettingsService }
1563
1857
  ]; };
1858
+ __decorate([
1859
+ ViewChild('addtocartbutton', { read: ElementRef })
1860
+ ], ProductAddtocartComponent.prototype, "addToCartButton", void 0);
1564
1861
  __decorate([
1565
1862
  Input()
1566
- ], ProductAdditionalInfoComponent.prototype, "article", null);
1863
+ ], ProductAddtocartComponent.prototype, "article", void 0);
1567
1864
  __decorate([
1568
1865
  Input()
1569
- ], ProductAdditionalInfoComponent.prototype, "showLabel", void 0);
1570
- ProductAdditionalInfoComponent = __decorate([
1571
- Component({
1572
- selector: 'app-product-additional-info',
1573
- template: "<h3 *ngIf=\"showLabel\" [textContent]=\"'ADDITIONAL_DATA' | localize\"></h3>\n<ng-container *ngIf=\"textParts && textParts.length > 0\">\n <div class=\"additional-info-parts\" *ngFor=\"let text of textParts\" [innerHTML]=\"text\"></div>\n</ng-container>\n",
1574
- styles: [":host{display:block}:host .additional-info-parts{margin-bottom:20px;line-height:190%;color:#22313c;font-size:13px}:host ::ng-deep p{line-height:190%;margin:15px 0}:host ::ng-deep font{font-family:iOneMontserrat}:host .additional-info-parts>:first-child{margin-top:0}:host .additional-info-parts>:last-child{margin-bottom:0}"]
1575
- })
1576
- ], ProductAdditionalInfoComponent);
1577
- return ProductAdditionalInfoComponent;
1578
- }());
1579
-
1580
- var propertyMap = new Map([
1581
- ['articleNr', 'ARTICLE_NUMBER'],
1582
- ['catExtra', 'CATEGORY'],
1583
- ['catType', 'CATEGORY_TYPE'],
1584
- ['description', 'DESCRIPTION'],
1585
- ['material', 'MATERIAL'],
1586
- ['title', 'TITLE'],
1587
- ['turnOverGroup', 'TURNOVERGROUP'],
1588
- ['height', 'HEIGHT'],
1589
- ['width', 'WIDTH']
1590
- ]);
1591
- var ProductPropertiesComponent = /** @class */ (function () {
1592
- function ProductPropertiesComponent() {
1593
- this.showLabel = false;
1594
- this.properties = [];
1595
- }
1596
- Object.defineProperty(ProductPropertiesComponent.prototype, "article", {
1597
- get: function () {
1598
- return this._article;
1599
- },
1600
- set: function (value) {
1601
- this._article = value;
1602
- this._prepareProperties();
1603
- },
1604
- enumerable: true,
1605
- configurable: true
1606
- });
1607
- ProductPropertiesComponent.prototype.ngOnInit = function () {
1608
- };
1609
- ProductPropertiesComponent.prototype._prepareProperties = function () {
1610
- var _this = this;
1611
- this.properties.length = 0;
1612
- if (!this._article) {
1613
- return;
1614
- }
1615
- propertyMap.forEach(function (value, key) {
1616
- if (_this.article.hasOwnProperty(key)) {
1617
- _this.properties.push({ key: value, value: _this.article[key] });
1618
- }
1619
- });
1620
- };
1866
+ ], ProductAddtocartComponent.prototype, "configurable", void 0);
1621
1867
  __decorate([
1622
1868
  Input()
1623
- ], ProductPropertiesComponent.prototype, "article", null);
1869
+ ], ProductAddtocartComponent.prototype, "configuring", void 0);
1624
1870
  __decorate([
1871
+ HostBinding('class.full-screen'),
1625
1872
  Input()
1626
- ], ProductPropertiesComponent.prototype, "showLabel", void 0);
1627
- ProductPropertiesComponent = __decorate([
1873
+ ], ProductAddtocartComponent.prototype, "fullscreen", void 0);
1874
+ __decorate([
1875
+ Input()
1876
+ ], ProductAddtocartComponent.prototype, "quantity", null);
1877
+ __decorate([
1878
+ Output()
1879
+ ], ProductAddtocartComponent.prototype, "startConfiguration", void 0);
1880
+ __decorate([
1881
+ Output()
1882
+ ], ProductAddtocartComponent.prototype, "addToCartClick", void 0);
1883
+ __decorate([
1884
+ Output()
1885
+ ], ProductAddtocartComponent.prototype, "addToQuoteClick", void 0);
1886
+ ProductAddtocartComponent = __decorate([
1628
1887
  Component({
1629
- selector: 'app-product-properties',
1630
- template: "<div class=\"article-properties-wrapper\">\n <h3 *ngIf=\"showLabel\" [textContent]=\"'PROPERTIES' | localize\"></h3>\n <ng-container *ngFor=\"let property of properties\">\n <div class=\"article-property\">\n <div class=\"article-property-key\" [textContent]=\"property.key | localize\"></div>\n <div class=\"article-property-value\" [textContent]=\"property.value\"></div>\n </div>\n </ng-container>\n</div>\n",
1631
- styles: [":host{display:block}.article-properties-wrapper{display:flex;flex-direction:column}.article-property{display:flex;flex-direction:row;border-bottom:1px solid #f6f5f4;padding:11px 0;font-size:13px}.article-property:first-child{border-top:1px solid #f6f5f4}.article-property-key{flex-basis:200px;flex-shrink:0;color:#5b6875}@media screen and (max-width:450px){.article-property-key{flex-basis:130px}}"]
1632
- })
1633
- ], ProductPropertiesComponent);
1634
- return ProductPropertiesComponent;
1635
- }());
1636
-
1637
- var LocalizePipe = /** @class */ (function () {
1638
- function LocalizePipe(_dictionaryService) {
1639
- this._dictionaryService = _dictionaryService;
1640
- }
1641
- LocalizePipe.prototype.transform = function (value, upperCaseFirst, replace) {
1642
- var _a;
1643
- if (upperCaseFirst === void 0) { upperCaseFirst = true; }
1644
- if (replace === void 0) { replace = []; }
1645
- if (!value) {
1646
- return '';
1647
- }
1648
- replace = replace ? replace : [];
1649
- if (!Array.isArray(replace)) {
1650
- replace = [replace];
1651
- }
1652
- return (_a = this._dictionaryService).get.apply(_a, __spread([value, upperCaseFirst], replace));
1653
- };
1654
- LocalizePipe.ctorParameters = function () { return [
1655
- { type: DictionaryService }
1656
- ]; };
1657
- LocalizePipe = __decorate([
1658
- Pipe({
1659
- name: 'localize'
1888
+ selector: 'app-product-addtocart',
1889
+ template: "<div class=\"atc-wrapper\">\n <co-number-picker *ngIf=\"!configurable && !configuring\" class=\"quantity-select\" [(model)]=\"quantity\" [min]=\"1\" horizontal></co-number-picker>\n <div class=\"button-wrapper\">\n <co-button class=\"configure-button\" *ngIf=\"configurable\"\n [iconData]=\"iconCache.getIcon(icon.MagicWand)\"\n [label]=\"'CONFIGURE' | localize\"\n (onClick)=\"startConfiguration.emit()\"\n ></co-button>\n <co-button #addtocartbutton class=\"cart-button\" *ngIf=\"!configurable\"\n [iconData]=\"iconCache.getIcon(icon.AddToCartDrop)\"\n [label]=\"'SHOPPING_CART_IN' | localize\"\n (onClick)=\"handleAddToCartClick(quantity)\"\n ></co-button>\n <co-button class=\"cart-button quote\" *ngIf=\"!configurable && showQuoteButton\"\n [iconData]=\"iconCache.getIcon(icon.Quote)\"\n [label]=\"'QUOTATION' | localize\"\n (onClick)=\"handleAddToQuoteClick(quantity)\"\n ></co-button>\n </div>\n</div>\n",
1890
+ styles: [":host{display:flex;flex-direction:column}:host :not(:last-child){margin-bottom:5px}:host .atc-wrapper{display:flex;flex-direction:row;align-items:baseline}:host .atc-wrapper .quantity-select{margin-right:5px}:host.full-screen .cart-button{position:fixed;right:20px;bottom:20px;z-index:3}::ng-deep co-number-picker{max-width:100px;border:2px solid #f6f5f4;border-radius:5px}::ng-deep co-number-picker ::ng-deep co-input-text{height:50px!important;border:none!important;width:50px!important}::ng-deep co-number-picker ::ng-deep co-input-text:after{display:none}::ng-deep co-number-picker ::ng-deep co-input-text.focused{box-shadow:none!important;border:none!important;background:0 0!important}::ng-deep co-number-picker ::ng-deep co-input-text .clear-icon{display:none}::ng-deep co-number-picker ::ng-deep co-input-text input{width:100%;text-align:center}::ng-deep co-number-picker ::ng-deep co-button{justify-content:center;padding:0!important;margin:0!important;height:50px!important;background-color:transparent!important}::ng-deep co-number-picker ::ng-deep co-button ::ng-deep co-icon [fill]{fill:#22313c!important}.button-wrapper ::ng-deep co-button{height:50px;max-width:300px;justify-content:center;font-size:15px;border-radius:5px!important;cursor:pointer;padding:0 20px!important}.button-wrapper ::ng-deep co-button:hover{background:#74b77f}::ng-deep co-button.cart-button{border-radius:5px}::ng-deep co-button.cart-button.quote{background:#7292b6}"]
1660
1891
  })
1661
- // A pipe for localizing string values in view templates.
1662
- ], LocalizePipe);
1663
- return LocalizePipe;
1892
+ ], ProductAddtocartComponent);
1893
+ return ProductAddtocartComponent;
1664
1894
  }());
1665
1895
 
1666
- var ProductDeliveryComponent = /** @class */ (function () {
1667
- function ProductDeliveryComponent(_localizePipe, _iOne, _iconCache) {
1668
- this._localizePipe = _localizePipe;
1896
+ var ProductRelatedComponent = /** @class */ (function () {
1897
+ function ProductRelatedComponent(_iOne, _appEventService) {
1669
1898
  this._iOne = _iOne;
1670
- this._iconCache = _iconCache;
1671
- this.icon = IconEnum;
1672
- this.iconData = this._iconCache.getIcon(this.icon.Truck);
1899
+ this._appEventService = _appEventService;
1900
+ this.isSmallModus = true;
1901
+ this._articles = [];
1673
1902
  }
1674
- Object.defineProperty(ProductDeliveryComponent.prototype, "stockAndDelivery", {
1903
+ Object.defineProperty(ProductRelatedComponent.prototype, "articles", {
1904
+ get: function () {
1905
+ return this._articles;
1906
+ },
1675
1907
  set: function (value) {
1908
+ var _this = this;
1676
1909
  if (value) {
1677
- this.deliveryDescription = value.deliveryDescription;
1678
- if (this.deliveryDescription.length > 0 && this.deliveryDescription[0] === ' ') {
1679
- this.deliveryDescription = this._localizePipe.transform('ASK_FOR_INFORMATION');
1910
+ if (this.refType && this.refType !== undefined) {
1911
+ if (value.length > 0) {
1912
+ value.forEach(function (x) {
1913
+ if (x.refType === _this.refType) {
1914
+ _this._articles.push(x);
1915
+ }
1916
+ });
1917
+ }
1918
+ }
1919
+ else {
1920
+ this._articles = value;
1680
1921
  }
1922
+ this._loadImages();
1681
1923
  }
1682
1924
  },
1683
1925
  enumerable: true,
1684
1926
  configurable: true
1685
1927
  });
1686
- ProductDeliveryComponent.prototype.ngOnInit = function () {
1928
+ ProductRelatedComponent.prototype.handleContentClick = function (article) {
1929
+ this._appEventService.onAlternativeClick.next(article);
1687
1930
  };
1688
- ProductDeliveryComponent.ctorParameters = function () { return [
1689
- { type: LocalizePipe },
1931
+ ProductRelatedComponent.prototype._loadImages = function () {
1932
+ var _this = this;
1933
+ this._articles.forEach(function (a) {
1934
+ if (!a.image.documentBody) {
1935
+ _this._iOne.getDocumentContent(a.image.documentId).then(function (content) {
1936
+ if (content) {
1937
+ a.image.documentBody = content.documentContent;
1938
+ }
1939
+ });
1940
+ }
1941
+ });
1942
+ };
1943
+ ProductRelatedComponent.ctorParameters = function () { return [
1690
1944
  { type: ProductConnectorService },
1691
- { type: IconCacheService }
1945
+ { type: ProductEventService }
1692
1946
  ]; };
1693
1947
  __decorate([
1694
1948
  Input()
1695
- ], ProductDeliveryComponent.prototype, "stockAndDelivery", null);
1696
- ProductDeliveryComponent = __decorate([
1949
+ ], ProductRelatedComponent.prototype, "refType", void 0);
1950
+ __decorate([
1951
+ Input()
1952
+ ], ProductRelatedComponent.prototype, "label", void 0);
1953
+ __decorate([
1954
+ Input()
1955
+ ], ProductRelatedComponent.prototype, "isSmallModus", void 0);
1956
+ __decorate([
1957
+ Input()
1958
+ ], ProductRelatedComponent.prototype, "articles", null);
1959
+ ProductRelatedComponent = __decorate([
1697
1960
  Component({
1698
- selector: 'app-product-delivery',
1699
- template: "<!--<app-header [label]=\"'DELIVERY_TIME_PERIOD' | localize\"></app-header>-->\n<div class=\"product-delivery-wrapper\">\n <co-icon class=\"delivery-icon\" [iconData]=\"iconData\"></co-icon>\n <div class=\"product-delivery-fields\">\n <div class=\"pp-default-label\" [textContent]=\"'DELIVERY_TIME_PERIOD' | localize\"></div>\n <div class=\"pp-default-description\" [textContent]=\"deliveryDescription | date:'dd MMMM yyyy'\"></div>\n </div>\n</div>\n",
1700
- providers: [LocalizePipe],
1701
- styles: [":host{display:block}.product-delivery-wrapper{display:flex;flex-direction:row;align-items:center;border-bottom:1px solid #f6f5f4;padding:20px 15px}.product-delivery-wrapper .delivery-icon{margin:0 15px 0 0;width:40px;height:37px}.product-delivery-wrapper .product-delivery-fields{display:flex;flex-direction:column}.product-delivery-wrapper .product-delivery-fields .pp-default-label{font-size:14px;margin:0}@media screen and (max-width:400px){.product-delivery-wrapper{padding:15px 0 15px 10px}.product-delivery-wrapper .delivery-icon{margin:0 15px 0 0;width:32px;height:28px}.product-delivery-wrapper .product-delivery-fields .pp-default-label{font-size:13px}}"]
1961
+ selector: 'app-product-related',
1962
+ template: "<div *ngIf=\"articles && articles.length > 0\">\n <app-header [label]=\"label\" [amount]=\"articles?.length\" *ngIf=\"label\"></app-header>\n <co-scroll-container>\n <div class=\"article-wrapper\" *ngFor=\"let article of articles\">\n <co-article-tile\n [imageData]=\"article.image.documentBodyAsDataUri\"\n [description]=\"article.description\"\n [price]=\"article.price\"\n [level]=\"article.stockStatus\"\n [isSmallModus]=\"isSmallModus\"\n [hasConfigureButton]=\"article.goodType === 'B'\"\n (contentClick)=\"handleContentClick(article)\"\n ></co-article-tile>\n </div>\n </co-scroll-container>\n</div>\n",
1963
+ styles: [":host{display:block}.article-wrapper{display:flex;flex-direction:row}.article-wrapper ::ng-deep co-tile.small{min-width:189px;max-width:189px;height:100%}.article-wrapper ::ng-deep co-tile.small:hover{box-shadow:none;cursor:pointer}.article-wrapper ::ng-deep co-tile.small:hover .tile-bottom .left-buttons{margin:0!important}.article-wrapper ::ng-deep co-tile.small .tile-wrapper{outline:0!important;padding-bottom:0;overflow:hidden}.article-wrapper ::ng-deep co-tile.small .tile-wrapper div.image{height:100px}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons{position:absolute;top:0;right:0;margin:0 -32px 0 0;align-items:flex-end;transition:.2s ease-in-out}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons ::ng-deep co-button.card-button.mini{width:30px;height:30px;transform:none;border-radius:4px;margin:0 0 5px}.article-wrapper ::ng-deep co-tile.small .tile-wrapper .tile-bottom .left-buttons ::ng-deep co-button.card-button.mini ::ng-deep co-icon{width:30px;height:30px}.article-wrapper ::ng-deep co-tile.small .tile-extra-bottom{outline:0!important;background:0 0!important}.article-wrapper ::ng-deep co-tile.small .tile-extra-bottom .price{color:#74b77f;margin:5px 0 0;font-weight:400;font-size:12px}"]
1702
1964
  })
1703
- ], ProductDeliveryComponent);
1704
- return ProductDeliveryComponent;
1965
+ ], ProductRelatedComponent);
1966
+ return ProductRelatedComponent;
1705
1967
  }());
1706
1968
 
1707
1969
  var ProductStockComponent = /** @class */ (function () {
@@ -1735,616 +1997,567 @@ var ProductStockComponent = /** @class */ (function () {
1735
1997
  template: "<!--<app-header [label]=\"'STOCK' | localize\"></app-header>-->\n<!--<co-level-indicator [model]=\"'medium'\"></co-level-indicator>-->\n<div class=\"product-stock-wrapper\">\n <co-icon class=\"stock-icon\" [iconData]=\"iconData\"></co-icon>\n <div class=\"product-stock-fields\">\n <div class=\"pp-default-label in-stock\" [textContent]=\"'PRODUCT_IN_STOCK' | localize\" *ngIf=\"numberInStock > 0\"></div>\n <div class=\"pp-default-label not-in-stock\" [textContent]=\"'PRODUCT_NOT_IN_STOCK' | localize\" *ngIf=\"!(numberInStock > 0)\"></div>\n </div>\n</div>\n",
1736
1998
  styles: [":host{display:block}.product-stock-wrapper{display:flex;flex-direction:row;align-items:center;border-top:1px solid #f6f5f4;border-bottom:1px solid #f6f5f4;padding:20px 15px}.product-stock-wrapper .stock-icon{margin:0 15px 0 0;width:40px;height:37px}.product-stock-wrapper .product-stock-fields{display:flex;flex-direction:row}.product-stock-wrapper .product-stock-fields .pp-default-label{font-size:14px;margin:0}.product-stock-wrapper .product-stock-fields .pp-default-label:after{content:\"\";width:10px;height:10px;border-radius:10px;background:#74b77f;display:inline-block;margin:0 0 0 15px}.product-stock-wrapper .product-stock-fields .pp-default-label.not-in-stock:after{background:#f15152}@media screen and (max-width:400px){.product-stock-wrapper{padding:15px 0 15px 10px}.product-stock-wrapper .stock-icon{margin:0 15px 0 0;width:32px;height:28px}.product-stock-wrapper .product-stock-fields .pp-default-label{font-size:13px}}"]
1737
1999
  })
1738
- ], ProductStockComponent);
1739
- return ProductStockComponent;
2000
+ ], ProductStockComponent);
2001
+ return ProductStockComponent;
2002
+ }());
2003
+
2004
+ var LocalizePipe = /** @class */ (function () {
2005
+ function LocalizePipe(_dictionaryService) {
2006
+ this._dictionaryService = _dictionaryService;
2007
+ }
2008
+ LocalizePipe.prototype.transform = function (value, upperCaseFirst, replace) {
2009
+ var _a;
2010
+ if (upperCaseFirst === void 0) { upperCaseFirst = true; }
2011
+ if (replace === void 0) { replace = []; }
2012
+ if (!value) {
2013
+ return '';
2014
+ }
2015
+ replace = replace ? replace : [];
2016
+ if (!Array.isArray(replace)) {
2017
+ replace = [replace];
2018
+ }
2019
+ return (_a = this._dictionaryService).get.apply(_a, __spread([value, upperCaseFirst], replace));
2020
+ };
2021
+ LocalizePipe.ctorParameters = function () { return [
2022
+ { type: DictionaryService }
2023
+ ]; };
2024
+ LocalizePipe = __decorate([
2025
+ Pipe({
2026
+ name: 'localize'
2027
+ })
2028
+ // A pipe for localizing string values in view templates.
2029
+ ], LocalizePipe);
2030
+ return LocalizePipe;
1740
2031
  }());
1741
2032
 
1742
- var ProductSymbolsComponent = /** @class */ (function () {
1743
- function ProductSymbolsComponent() {
1744
- this.symbolStrings = [];
2033
+ var ProductDeliveryComponent = /** @class */ (function () {
2034
+ function ProductDeliveryComponent(_localizePipe, _iOne, _iconCache) {
2035
+ this._localizePipe = _localizePipe;
2036
+ this._iOne = _iOne;
2037
+ this._iconCache = _iconCache;
2038
+ this.icon = IconEnum;
2039
+ this.iconData = this._iconCache.getIcon(this.icon.Truck);
1745
2040
  }
1746
- Object.defineProperty(ProductSymbolsComponent.prototype, "symbols", {
1747
- get: function () {
1748
- return this._symbols;
1749
- },
2041
+ Object.defineProperty(ProductDeliveryComponent.prototype, "stockAndDelivery", {
1750
2042
  set: function (value) {
1751
- this._symbols = value;
1752
- if (this._symbols && this._symbols.hasOwnProperty('fontCode')) {
1753
- this._className = this._symbols['fontCode'] === 'VLOER' ? 'floor' : (this._className === 'WAS' ? 'ginetex' : '');
1754
- }
1755
- if (this._symbols && this._symbols.hasOwnProperty('symbolString')) {
1756
- for (var i = 0; i < this._symbols['symbolString'].length; i++) {
1757
- this.symbolStrings.push(this._symbols['symbolString'][i]);
2043
+ if (value) {
2044
+ this.deliveryDescription = value.deliveryDescription;
2045
+ if (this.deliveryDescription.length > 0 && this.deliveryDescription[0] === ' ') {
2046
+ this.deliveryDescription = this._localizePipe.transform('ASK_FOR_INFORMATION');
1758
2047
  }
1759
2048
  }
1760
2049
  },
1761
2050
  enumerable: true,
1762
2051
  configurable: true
1763
2052
  });
1764
- ProductSymbolsComponent.prototype.ngOnInit = function () {
2053
+ ProductDeliveryComponent.prototype.ngOnInit = function () {
1765
2054
  };
2055
+ ProductDeliveryComponent.ctorParameters = function () { return [
2056
+ { type: LocalizePipe },
2057
+ { type: ProductConnectorService },
2058
+ { type: IconCacheService }
2059
+ ]; };
1766
2060
  __decorate([
1767
2061
  Input()
1768
- ], ProductSymbolsComponent.prototype, "symbols", null);
1769
- __decorate([
1770
- HostBinding('class')
1771
- ], ProductSymbolsComponent.prototype, "_className", void 0);
1772
- ProductSymbolsComponent = __decorate([
2062
+ ], ProductDeliveryComponent.prototype, "stockAndDelivery", null);
2063
+ ProductDeliveryComponent = __decorate([
1773
2064
  Component({
1774
- selector: 'app-product-symbols',
1775
- template: "<div *ngIf=\"symbols && symbols.length > 0\">\n <app-header [label]=\"'SYMBOLS' | localize\" [amount]=\"symbols?.length\"></app-header>\n <co-scroll-container>\n <co-tile small noImagePlaceholder *ngFor=\"let symbol of symbolStrings\">\n <ng-container tile-over-image>\n <div class=\"symbol\" [textContent]=\"symbol\"></div>\n </ng-container>\n <ng-container tile-extra-bottom-content>\n <div class=\"symbol-name\" [textContent]=\"'Wat moet hier?'\"></div>\n </ng-container>\n </co-tile>\n </co-scroll-container>\n</div>\n",
1776
- styles: [":host{display:block}:host.floor .symbol{font-family:iOneFloorsymbols}:host.ginetex .symbol{font-family:iOneGinetexsymbols}.symbol{font-size:100px}"]
2065
+ selector: 'app-product-delivery',
2066
+ template: "<!--<app-header [label]=\"'DELIVERY_TIME_PERIOD' | localize\"></app-header>-->\n<div class=\"product-delivery-wrapper\">\n <co-icon class=\"delivery-icon\" [iconData]=\"iconData\"></co-icon>\n <div class=\"product-delivery-fields\">\n <div class=\"pp-default-label\" [textContent]=\"'DELIVERY_TIME_PERIOD' | localize\"></div>\n <div class=\"pp-default-description\" [textContent]=\"deliveryDescription | date:'dd MMMM yyyy'\"></div>\n </div>\n</div>\n",
2067
+ styles: [":host{display:block}.product-delivery-wrapper{display:flex;flex-direction:row;align-items:center;border-bottom:1px solid #f6f5f4;padding:20px 15px}.product-delivery-wrapper .delivery-icon{margin:0 15px 0 0;width:40px;height:37px}.product-delivery-wrapper .product-delivery-fields{display:flex;flex-direction:column}.product-delivery-wrapper .product-delivery-fields .pp-default-label{font-size:14px;margin:0}@media screen and (max-width:400px){.product-delivery-wrapper{padding:15px 0 15px 10px}.product-delivery-wrapper .delivery-icon{margin:0 15px 0 0;width:32px;height:28px}.product-delivery-wrapper .product-delivery-fields .pp-default-label{font-size:13px}}"]
1777
2068
  })
1778
- ], ProductSymbolsComponent);
1779
- return ProductSymbolsComponent;
2069
+ ], ProductDeliveryComponent);
2070
+ return ProductDeliveryComponent;
1780
2071
  }());
1781
2072
 
1782
- var ProductPriceComponent = /** @class */ (function () {
1783
- function ProductPriceComponent(_changeDetector) {
1784
- this._changeDetector = _changeDetector;
1785
- this.showFromPrice = false;
1786
- this._configurable = false;
2073
+ var ProductInfoTabsComponent = /** @class */ (function () {
2074
+ function ProductInfoTabsComponent(_appEventService) {
2075
+ var _this = this;
2076
+ this._appEventService = _appEventService;
2077
+ this.activeTabHeight = 0;
2078
+ this.tabs = [];
2079
+ this._subs = [];
2080
+ this._subs.push(this._appEventService.onUpdateProductInfoTab.subscribe(function (index) {
2081
+ _this.updateTab(index);
2082
+ _this.tabContent.nativeElement.scrollIntoView({ behavior: 'smooth' });
2083
+ }));
1787
2084
  }
1788
- Object.defineProperty(ProductPriceComponent.prototype, "pricing", {
1789
- get: function () {
1790
- return this._pricing;
1791
- },
1792
- set: function (value) {
1793
- this._pricing = value;
1794
- this._setPrices();
1795
- },
1796
- enumerable: true,
1797
- configurable: true
1798
- });
1799
- Object.defineProperty(ProductPriceComponent.prototype, "configurable", {
2085
+ Object.defineProperty(ProductInfoTabsComponent.prototype, "article", {
1800
2086
  set: function (value) {
1801
- this._configurable = value;
1802
- this._setPrices();
2087
+ if (value) {
2088
+ this.articleObject = value;
2089
+ this._setupTabs();
2090
+ this.updateTab(0);
2091
+ }
1803
2092
  },
1804
2093
  enumerable: true,
1805
2094
  configurable: true
1806
2095
  });
1807
- ProductPriceComponent.prototype.ngOnInit = function () {
2096
+ ProductInfoTabsComponent.prototype.ngOnDestroy = function () {
2097
+ this._subs.forEach(function (s) { return s.unsubscribe(); });
1808
2098
  };
1809
- ProductPriceComponent.prototype._setPrices = function () {
1810
- if (this._pricing) {
1811
- this.valutaSign = this._getSign(this._pricing.retailCurrency);
1812
- if (this._configurable) {
1813
- this.fromPrice = this._pricing.retailBasePrice ? this._pricing.retailBasePrice : this._pricing.priceBaseline;
1814
- this.fromLabel = this._pricing.retailBasePrice ? 'PRICE' : 'FROM';
1815
- this.toPrice = undefined;
1816
- }
1817
- else {
1818
- this.fromPrice = this._pricing.retailSuggestedPrice ? this._pricing.retailSuggestedPrice : this._pricing.retailBasePrice;
1819
- this.fromLabel = this._pricing.retailSuggestedPrice ? 'Was' : 'PRICE';
1820
- this.toPrice = this._pricing.retailSuggestedPrice ? this._pricing.retailBasePrice : undefined;
1821
- this.toLabel = this._pricing.retailSuggestedPrice ? 'IS_NOW' : '';
2099
+ ProductInfoTabsComponent.prototype.updateTab = function (tabIndex) {
2100
+ this.activeTab = tabIndex;
2101
+ this.updateHeight(tabIndex);
2102
+ };
2103
+ ProductInfoTabsComponent.prototype.updateHeight = function (tabIndex) {
2104
+ if (this.tabContent.nativeElement.children.length > 0) {
2105
+ if (this.tabContent.nativeElement.children[tabIndex] !== undefined) {
2106
+ this.activeTabHeight = this.tabContent.nativeElement.children[tabIndex].offsetHeight;
1822
2107
  }
1823
- this._changeDetector.detectChanges();
1824
2108
  }
1825
2109
  };
1826
- ProductPriceComponent.prototype._getSign = function (currency) {
1827
- switch (currency) {
1828
- case 'EUR':
1829
- return '€';
1830
- default:
1831
- return '€';
2110
+ ProductInfoTabsComponent.prototype._setupTabs = function () {
2111
+ this.tabs.push({ title: 'DESCRIPTION' });
2112
+ this.tabs.push({ title: 'FEATURES' });
2113
+ if (this.articleObject.documents !== undefined && this.articleObject.documents.length > 0) {
2114
+ this.tabs.push({ title: 'DOWNLOADS' });
2115
+ }
2116
+ if (this.articleObject.symbols !== undefined && this.articleObject.symbols.length > 0) {
2117
+ this.tabs.push({ title: 'SYMBOLS' });
1832
2118
  }
1833
2119
  };
1834
- ProductPriceComponent.ctorParameters = function () { return [
1835
- { type: ChangeDetectorRef }
2120
+ ProductInfoTabsComponent.ctorParameters = function () { return [
2121
+ { type: ProductEventService }
1836
2122
  ]; };
1837
2123
  __decorate([
1838
- Input()
1839
- ], ProductPriceComponent.prototype, "pricing", null);
2124
+ ViewChild('tabContent')
2125
+ ], ProductInfoTabsComponent.prototype, "tabContent", void 0);
1840
2126
  __decorate([
1841
2127
  Input()
1842
- ], ProductPriceComponent.prototype, "configurable", null);
1843
- ProductPriceComponent = __decorate([
2128
+ ], ProductInfoTabsComponent.prototype, "article", null);
2129
+ ProductInfoTabsComponent = __decorate([
1844
2130
  Component({
1845
- selector: 'app-product-price',
1846
- template: "<div *ngIf=\"toPrice\">\n <div class=\"price-wrapper\" *ngIf=\"fromPrice > toPrice\">\n <div class=\"from-price-label\" [textContent]=\"fromLabel | localize\"></div>\n <div class=\"from-price\" [textContent]=\"fromPrice | priceDisplay\"></div>\n </div>\n <div class=\"price-wrapper\">\n <div class=\"to-price-label\" [textContent]=\"toLabel | localize\"></div>\n <div class=\"to-price\" [textContent]=\"toPrice | priceDisplay\"></div>\n </div>\n</div>\n",
1847
- styles: [":host{display:flex;flex-direction:column}.price-wrapper{width:100%;font-size:15px;margin:0 0 5px;display:inline-block}.price-wrapper:last-child{margin:0}.from-price-label,.to-price-label{color:#5b6875;display:none}.from-price{font-size:16px;font-weight:700;text-decoration:line-through;color:#5b6875}.to-price{font-size:25px;font-weight:700;color:#74b77f}@media screen and (max-width:650px){.from-price{font-size:13px}.to-price{font-size:21px}}"]
2131
+ selector: 'app-product-info-tabs',
2132
+ template: "<div class=\"tab-container\">\r\n <div class=\"tab-header\">\r\n <button *ngFor=\"let tab of tabs; let i = index\" class=\"tab-header-button\" [class.active]=\"activeTab === i\" [textContent]=\"tab.title | localize\" (click)=\"updateTab(i)\"></button>\r\n </div>\r\n <div class=\"tab-content\" #tabContent [style.height.px]=\"(activeTabHeight > 0 ? activeTabHeight : '')\">\r\n <div class=\"tab-content-item\" *ngFor=\"let tab of tabs; let i = index\" [class.active]=\"activeTab === i\">\r\n <ng-container *ngIf=\"i === 0\">\r\n <app-product-additional-info class=\"\" [article]=\"articleObject\" [showLabel]=\"false\"></app-product-additional-info>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 1\">\r\n <app-product-properties class=\"\" [article]=\"articleObject\" [showLabel]=\"false\"></app-product-properties>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 2\">\r\n <app-product-documents [showLabel]=\"false\" class=\"\" *ngIf=\"articleObject?.documents && articleObject?.documents.length > 0\" [documents]=\"articleObject?.documents\"></app-product-documents>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 3\">\r\n <app-product-symbols class=\"\" *ngIf=\"articleObject?.symbols && articleObject?.symbols.length > 0\" [symbols]=\"articleObject?.symbols\"></app-product-symbols>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n",
2133
+ styles: [":focus{outline:0}:host .tab-header{border-bottom:3px solid #f6f5f4;margin:0 0 30px}:host .tab-header .tab-header-button{background:0 0;border:none;border-bottom:3px solid transparent;line-height:20px;padding:15px 20px;cursor:pointer;font-family:iOneMontserrat;color:#22313c;font-weight:700;margin:0 0 -3px;opacity:.5}:host .tab-header .tab-header-button:hover{opacity:1}:host .tab-header .tab-header-button.active{opacity:1;border-color:#74b77f}:host .tab-content{padding:0 20px 30px;margin:0 0 20px;border-bottom:2px solid #f6f5f4;transition:.2s ease-in-out;position:relative}:host .tab-content .tab-content-item{opacity:0;position:absolute;left:0;top:0;visibility:hidden;width:100%}:host .tab-content .tab-content-item.active{opacity:1;visibility:visible;position:static}@media screen and (max-width:650px){:host .tab-content{padding:0 10px 15px}}@media screen and (max-width:450px){:host .tab-header{display:flex}:host .tab-header .tab-header-button{width:100%;padding:10px;font-size:11px}}"]
1848
2134
  })
1849
- ], ProductPriceComponent);
1850
- return ProductPriceComponent;
2135
+ ], ProductInfoTabsComponent);
2136
+ return ProductInfoTabsComponent;
1851
2137
  }());
1852
2138
 
1853
- var ProductAddtocartComponent = /** @class */ (function () {
1854
- function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService) {
2139
+ var PipeModule = /** @class */ (function () {
2140
+ function PipeModule() {
2141
+ }
2142
+ PipeModule = __decorate([
2143
+ NgModule({
2144
+ exports: [
2145
+ LocalizePipe
2146
+ ],
2147
+ declarations: [
2148
+ LocalizePipe
2149
+ ],
2150
+ providers: [
2151
+ LocalizePipe
2152
+ ]
2153
+ })
2154
+ ], PipeModule);
2155
+ return PipeModule;
2156
+ }());
2157
+
2158
+ var ProductDocumentsComponent = /** @class */ (function () {
2159
+ function ProductDocumentsComponent(iconCache) {
1855
2160
  this.iconCache = iconCache;
1856
- this._ioneControllerService = _ioneControllerService;
1857
- this._appEventService = _appEventService;
1858
- this._settingsService = _settingsService;
1859
2161
  this.icon = IconEnum;
1860
- this.configurable = false;
1861
- this.configuring = false;
1862
- this.fullscreen = false;
1863
- this.startConfiguration = new EventEmitter();
1864
- this.addToCartClick = new EventEmitter();
1865
- this.addToQuoteClick = new EventEmitter();
1866
- this.showQuoteButton = false;
1867
- this._quantity = 1;
2162
+ this.showLabel = false;
2163
+ this.documents = [];
1868
2164
  }
1869
- Object.defineProperty(ProductAddtocartComponent.prototype, "quantity", {
1870
- get: function () {
1871
- return this._quantity;
1872
- },
1873
- set: function (value) {
1874
- this._quantity = Math.max(1, value);
1875
- },
1876
- enumerable: true,
1877
- configurable: true
1878
- });
1879
- ProductAddtocartComponent.prototype.ngOnInit = function () {
1880
- };
1881
- ProductAddtocartComponent.prototype.ngOnDestroy = function () {
1882
- this.addToCartButton = undefined;
1883
- };
1884
- ProductAddtocartComponent.prototype.handleAddToCartClick = function (quantity) {
1885
- return __awaiter(this, void 0, void 0, function () {
1886
- var _a, _b;
1887
- return __generator(this, function (_c) {
1888
- switch (_c.label) {
1889
- case 0:
1890
- _b = (_a = this._appEventService.onAddToCart).next;
1891
- return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
1892
- case 1:
1893
- _b.apply(_a, [_c.sent()]);
1894
- return [2 /*return*/];
1895
- }
1896
- });
1897
- });
1898
- };
1899
- ProductAddtocartComponent.prototype.handleAddToQuoteClick = function (quantity) {
1900
- return __awaiter(this, void 0, void 0, function () {
1901
- var _a, _b;
1902
- return __generator(this, function (_c) {
1903
- switch (_c.label) {
1904
- case 0:
1905
- _b = (_a = this._appEventService.onAddToQuote).next;
1906
- return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
1907
- case 1:
1908
- _b.apply(_a, [_c.sent()]);
1909
- return [2 /*return*/];
1910
- }
1911
- });
1912
- });
1913
- };
1914
- ProductAddtocartComponent.prototype._getJSONFromArticleObject = function (article) {
1915
- return __awaiter(this, void 0, void 0, function () {
1916
- var configuratorStatistics;
1917
- return __generator(this, function (_a) {
1918
- switch (_a.label) {
1919
- case 0:
1920
- configuratorStatistics = new ConfiguratorStatisticsEnvironment();
1921
- configuratorStatistics.userType = 'iOneProductPage';
1922
- configuratorStatistics.transactionType = 'Sales';
1923
- configuratorStatistics.actionDomain = 'bundle';
1924
- configuratorStatistics.sessionId = this._settingsService.settings.session ? this._settingsService.settings.session.sessionId : 'unknown';
1925
- configuratorStatistics.webHost = window.location.host;
1926
- configuratorStatistics.bundleHost = window.location.host;
1927
- return [4 /*yield*/, this._ioneControllerService.getJsonArticleFlatTree(article.article.goodId, article.article.goodType, article.quantity, true, undefined, configuratorStatistics)];
1928
- case 1: return [2 /*return*/, _a.sent()];
1929
- }
1930
- });
1931
- });
1932
- };
1933
- ProductAddtocartComponent.ctorParameters = function () { return [
1934
- { type: IconCacheService },
1935
- { type: ProductConnectorService },
1936
- { type: ProductEventService },
1937
- { type: ProductSettingsService }
1938
- ]; };
1939
- __decorate([
1940
- ViewChild('addtocartbutton', { read: ElementRef })
1941
- ], ProductAddtocartComponent.prototype, "addToCartButton", void 0);
1942
- __decorate([
1943
- Input()
1944
- ], ProductAddtocartComponent.prototype, "article", void 0);
2165
+ ProductDocumentsComponent.ctorParameters = function () { return [
2166
+ { type: IconCacheService }
2167
+ ]; };
1945
2168
  __decorate([
1946
2169
  Input()
1947
- ], ProductAddtocartComponent.prototype, "configurable", void 0);
2170
+ ], ProductDocumentsComponent.prototype, "showLabel", void 0);
1948
2171
  __decorate([
1949
2172
  Input()
1950
- ], ProductAddtocartComponent.prototype, "configuring", void 0);
2173
+ ], ProductDocumentsComponent.prototype, "documents", void 0);
2174
+ ProductDocumentsComponent = __decorate([
2175
+ Component({
2176
+ selector: 'app-product-documents',
2177
+ template: "<app-header *ngIf=\"showLabel\" [label]=\"'DOCUMENTS' | localize\" [amount]=\"documents?.length\"></app-header>\n<div *ngIf=\"documents && documents.length > 0\">\n <co-files-upload [documents]=\"documents\" [canAdd]=\"false\" readonly></co-files-upload>\n</div>\n",
2178
+ styles: [":host{display:block}::ng-deep co-files-upload{flex-direction:column!important;width:100%}::ng-deep co-file-upload{margin:0!important;border-bottom:1px solid #f6f5f4}::ng-deep co-file-upload:first-child{border-top:1px solid #f6f5f4}::ng-deep co-files-upload .files-upload-wrapper{flex-direction:column!important;width:100%}::ng-deep co-file-upload co-tile{max-width:100%!important;width:100%;position:relative}::ng-deep co-file-upload co-tile:hover{box-shadow:none!important}::ng-deep co-file-upload co-tile:hover .tile-extra-bottom{background-color:#f6f5f4!important}::ng-deep co-file-upload co-tile .tile-wrapper{position:absolute!important;left:0;top:0;width:100%;height:100%;z-index:2;opacity:0;box-sizing:border-box}::ng-deep co-file-upload co-tile .tile-wrapper .image{position:absolute!important;left:0;top:0;width:100%!important;height:100%!important;cursor:pointer}::ng-deep co-file-upload co-tile .tile-extra-bottom{outline:0!important;border:none!important;background:url(../../../assets/icons/download.svg) left 6px center/36px auto no-repeat!important;line-height:20px;padding:20px 20px 20px 60px!important;margin:0!important}::ng-deep co-file-upload co-tile .tile-extra-bottom .main{padding:0!important}"]
2179
+ })
2180
+ ], ProductDocumentsComponent);
2181
+ return ProductDocumentsComponent;
2182
+ }());
2183
+
2184
+ var HeaderComponent = /** @class */ (function () {
2185
+ function HeaderComponent() {
2186
+ }
2187
+ HeaderComponent.prototype.ngOnInit = function () {
2188
+ };
1951
2189
  __decorate([
1952
- HostBinding('class.full-screen'),
1953
2190
  Input()
1954
- ], ProductAddtocartComponent.prototype, "fullscreen", void 0);
2191
+ ], HeaderComponent.prototype, "label", void 0);
1955
2192
  __decorate([
1956
2193
  Input()
1957
- ], ProductAddtocartComponent.prototype, "quantity", null);
1958
- __decorate([
1959
- Output()
1960
- ], ProductAddtocartComponent.prototype, "startConfiguration", void 0);
1961
- __decorate([
1962
- Output()
1963
- ], ProductAddtocartComponent.prototype, "addToCartClick", void 0);
1964
- __decorate([
1965
- Output()
1966
- ], ProductAddtocartComponent.prototype, "addToQuoteClick", void 0);
1967
- ProductAddtocartComponent = __decorate([
2194
+ ], HeaderComponent.prototype, "amount", void 0);
2195
+ HeaderComponent = __decorate([
1968
2196
  Component({
1969
- selector: 'app-product-addtocart',
1970
- template: "<div class=\"atc-wrapper\">\n <co-number-picker *ngIf=\"!configurable && !configuring\" class=\"quantity-select\" [(model)]=\"quantity\" [min]=\"1\" horizontal></co-number-picker>\n <div class=\"button-wrapper\">\n <co-button class=\"configure-button\" *ngIf=\"configurable\"\n [iconData]=\"iconCache.getIcon(icon.MagicWand)\"\n [label]=\"'CONFIGURE' | localize\"\n (onClick)=\"startConfiguration.emit()\"\n ></co-button>\n <co-button #addtocartbutton class=\"cart-button\" *ngIf=\"!configurable\"\n [iconData]=\"iconCache.getIcon(icon.AddToCartDrop)\"\n [label]=\"'SHOPPING_CART_IN' | localize\"\n (onClick)=\"handleAddToCartClick(quantity)\"\n ></co-button>\n <co-button class=\"cart-button quote\" *ngIf=\"!configurable && showQuoteButton\"\n [iconData]=\"iconCache.getIcon(icon.Quote)\"\n [label]=\"'QUOTATION' | localize\"\n (onClick)=\"handleAddToQuoteClick(quantity)\"\n ></co-button>\n </div>\n</div>\n",
1971
- styles: [":host{display:flex;flex-direction:column}:host :not(:last-child){margin-bottom:5px}:host .atc-wrapper{display:flex;flex-direction:row;align-items:baseline}:host .atc-wrapper .quantity-select{margin-right:5px}:host.full-screen .cart-button{position:fixed;right:20px;bottom:20px;z-index:3}::ng-deep co-number-picker{max-width:100px;border:2px solid #f6f5f4;border-radius:5px}::ng-deep co-number-picker ::ng-deep co-input-text{height:50px!important;border:none!important;width:50px!important}::ng-deep co-number-picker ::ng-deep co-input-text:after{display:none}::ng-deep co-number-picker ::ng-deep co-input-text.focused{box-shadow:none!important;border:none!important;background:0 0!important}::ng-deep co-number-picker ::ng-deep co-input-text .clear-icon{display:none}::ng-deep co-number-picker ::ng-deep co-input-text input{width:100%;text-align:center}::ng-deep co-number-picker ::ng-deep co-button{justify-content:center;padding:0!important;margin:0!important;height:50px!important;background-color:transparent!important}::ng-deep co-number-picker ::ng-deep co-button ::ng-deep co-icon [fill]{fill:#22313c!important}.button-wrapper ::ng-deep co-button{height:50px;max-width:300px;justify-content:center;font-size:15px;border-radius:5px!important;cursor:pointer;padding:0 20px!important}.button-wrapper ::ng-deep co-button:hover{background:#74b77f}::ng-deep co-button.cart-button{border-radius:5px}::ng-deep co-button.cart-button.quote{background:#7292b6}"]
2197
+ selector: 'app-header',
2198
+ template: "<ng-container *ngIf=\"label\">\n <div class=\"header-wrapper\">\n <h3 [textContent]=\"label\"></h3>\n <span *ngIf=\"amount\" class=\"amount\" [textContent]=\"'(' + amount + ')'\"></span>\n </div>\n</ng-container>\n",
2199
+ styles: [".header-wrapper{display:flex;flex-direction:row;align-items:center}.header-wrapper .amount{margin-left:5px}"]
1972
2200
  })
1973
- ], ProductAddtocartComponent);
1974
- return ProductAddtocartComponent;
2201
+ ], HeaderComponent);
2202
+ return HeaderComponent;
1975
2203
  }());
1976
2204
 
1977
- var ProductSelectorTypeComponent = /** @class */ (function () {
1978
- function ProductSelectorTypeComponent(_iconCache, _changeDetector) {
1979
- this._iconCache = _iconCache;
1980
- this._changeDetector = _changeDetector;
1981
- this.type = SelectorType;
1982
- this.icons = IconEnum;
1983
- this.onIconClick = new EventEmitter();
1984
- this.currentTypeChange = new EventEmitter();
1985
- this.twoDIcon = this._iconCache.getIcon(this.icons.TwoD);
1986
- this.threeDIcon = this._iconCache.getIcon(this.icons.ThreeD);
2205
+ var TabType;
2206
+ (function (TabType) {
2207
+ TabType["Additional"] = "additional";
2208
+ TabType["Properties"] = "properties";
2209
+ })(TabType || (TabType = {}));
2210
+ var ProductInfoComponent = /** @class */ (function () {
2211
+ function ProductInfoComponent() {
2212
+ this.tabType = TabType;
2213
+ this.currentTab = TabType.Additional;
1987
2214
  }
1988
- ProductSelectorTypeComponent.prototype.ngOnInit = function () {
2215
+ ProductInfoComponent.prototype.ngOnInit = function () {
1989
2216
  };
1990
- ProductSelectorTypeComponent.prototype.handleIconClick = function (type) {
1991
- this.currentType = type;
1992
- this.currentTypeChange.next(this.currentType);
1993
- this.onIconClick.next(this.currentType);
1994
- this._changeDetector.detectChanges();
2217
+ ProductInfoComponent.prototype.switchTab = function (tab) {
2218
+ this.currentTab = tab;
1995
2219
  };
1996
- ProductSelectorTypeComponent.ctorParameters = function () { return [
1997
- { type: IconCacheService },
1998
- { type: ChangeDetectorRef }
1999
- ]; };
2000
2220
  __decorate([
2001
2221
  Input()
2002
- ], ProductSelectorTypeComponent.prototype, "show2D", void 0);
2003
- __decorate([
2004
- Input()
2005
- ], ProductSelectorTypeComponent.prototype, "show3D", void 0);
2006
- __decorate([
2007
- Input()
2008
- ], ProductSelectorTypeComponent.prototype, "currentType", void 0);
2009
- __decorate([
2010
- Output()
2011
- ], ProductSelectorTypeComponent.prototype, "onIconClick", void 0);
2012
- __decorate([
2013
- Output()
2014
- ], ProductSelectorTypeComponent.prototype, "currentTypeChange", void 0);
2015
- ProductSelectorTypeComponent = __decorate([
2222
+ ], ProductInfoComponent.prototype, "article", void 0);
2223
+ ProductInfoComponent = __decorate([
2016
2224
  Component({
2017
- selector: 'app-product-selector-type',
2018
- template: "<div *ngIf=\"show2D || show3D\" class=\"show-in\" [textContent]=\"'SHOW_IN' | localize\"></div>\n<co-icon *ngIf=\"show2D\" class=\"selector-type-icon\"\n [class.active]=\"currentType === type.TwoD\"\n [iconData]=\"twoDIcon\"\n (click)=\"handleIconClick(type.TwoD)\"\n></co-icon>\n<co-icon *ngIf=\"show3D\" class=\"selector-type-icon\"\n [class.active]=\"currentType === type.ThreeD\"\n [iconData]=\"threeDIcon\"\n (click)=\"handleIconClick(type.ThreeD)\"\n></co-icon>\n",
2019
- styles: [":host{display:flex;flex-direction:row;align-items:center}:host .show-in{display:none}:host>:not(:last-child){margin-right:10px}::ng-deep co-icon.selector-type-icon{box-shadow:inset 0 0 0 1px #22313c;border-radius:50%;background:0 0;height:34px;width:34px;cursor:pointer}::ng-deep co-icon.selector-type-icon.active{box-shadow:none;background:#74b77f;transition:.2s ease-in-out}::ng-deep co-icon.selector-type-icon.active [fill]{fill:#fff}"]
2225
+ selector: 'app-product-info',
2226
+ template: "<div>\n <div class=\"info-wrapper\">\n <div class=\"info-navigation\">\n <span [textContent]=\"'ADDITIONAL_DATA' | localize\" class=\"navigator\" [class.selected]=\"currentTab === tabType.Additional\" (mouseup)=\"switchTab(tabType.Additional)\"></span>\n <span [textContent]=\"'PROPERTIES' | localize\" class=\"navigator\" [class.selected]=\"currentTab === tabType.Properties\" (mouseup)=\"switchTab(tabType.Properties)\"></span>\n </div>\n <ng-container [ngSwitch]=\"currentTab\" class=\"content\">\n <div *ngSwitchCase=\"tabType.Additional\" @showContent>\n <app-product-additional-info\n [article]=\"article\"\n ></app-product-additional-info>\n </div>\n <div *ngSwitchCase=\"tabType.Properties\" @showContent>\n <app-product-properties [article]=\"article\"></app-product-properties>\n </div>\n </ng-container>\n </div>\n</div>\n",
2227
+ animations: [
2228
+ trigger('showContent', [
2229
+ state('void', style({ 'opacity': '0' })),
2230
+ state('*', style({ 'opacity': '1' })),
2231
+ transition('void => *', animate('200ms 100ms ease-in-out')),
2232
+ ])
2233
+ ],
2234
+ styles: [".info-navigation{margin:30px 0}.info-navigation .navigator:not(:last-child){margin-right:30px}.navigator{font-size:15px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.navigator.selected{color:#2b60a7}"]
2020
2235
  })
2021
- ], ProductSelectorTypeComponent);
2022
- return ProductSelectorTypeComponent;
2236
+ ], ProductInfoComponent);
2237
+ return ProductInfoComponent;
2023
2238
  }());
2024
2239
 
2025
- var IoneProductComponent = /** @class */ (function () {
2026
- function IoneProductComponent(_dictionary, _jsonUtils, _ione, _changeDetector, _appEventService, _settingsService) {
2027
- // this.sku = 'CF-HILL';
2028
- // this.sku = 'CF-ALMADA';
2029
- // this.sku = 'CF-39904ANT';
2030
- // this.sku = 'CF-22346001';
2031
- // this.sku = '104';
2032
- // this.sku = '1000561986';
2033
- // this.sku = '1000234793';
2034
- // this.sku = '1066';
2035
- // this.sku = '104';
2036
- var _this = this;
2037
- this._dictionary = _dictionary;
2038
- this._jsonUtils = _jsonUtils;
2039
- this._ione = _ione;
2240
+ var ProductAdditionalInfoComponent = /** @class */ (function () {
2241
+ function ProductAdditionalInfoComponent(_sanitizer, _connectorService, _changeDetector) {
2242
+ this._sanitizer = _sanitizer;
2243
+ this._connectorService = _connectorService;
2040
2244
  this._changeDetector = _changeDetector;
2041
- this._appEventService = _appEventService;
2042
- this._settingsService = _settingsService;
2043
- this.onAddToCart = new EventEmitter();
2044
- this.forceRenderImage = new EventEmitter();
2045
- this.onAlternativeClick = new EventEmitter();
2046
- this.onArticleInfoReceived = new EventEmitter();
2047
- this.onArticleReceived = new EventEmitter();
2048
- this.onSelectionsReceived = new EventEmitter();
2049
- this.onAddToQuote = new EventEmitter();
2050
- this.upAndLoaded = false;
2051
- this._subs = [];
2052
- this._subs.push(this._settingsService.settingsLoaded.subscribe(function (loaded) { return _this._handleSettingsLoaded(loaded); }),
2053
- // this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true),
2054
- this._appEventService.onAddToCart.subscribe(function (json) { return _this.onAddToCart.emit(json); }), this._appEventService.onAddToQuote.subscribe(function (json) { return _this.onAddToQuote.emit(json); }), this._appEventService.onAlternativeClick.subscribe(function (article) { return _this.onAlternativeClick.emit(article); }), this._appEventService.onArticleInfoReceived.subscribe(function (info) { return _this._handleAnswerInfoReceived(info); }), this._appEventService.onArticleReceived.subscribe(function (article) { return _this.onArticleReceived.emit(article); }), this._appEventService.onSelectionsReceived.subscribe(function (selections) { return _this.onSelectionsReceived.emit(selections); }));
2245
+ this.showLabel = false;
2246
+ this.textParts = [];
2247
+ this._superArticles = new Map();
2055
2248
  }
2056
- Object.defineProperty(IoneProductComponent.prototype, "settings", {
2249
+ Object.defineProperty(ProductAdditionalInfoComponent.prototype, "article", {
2057
2250
  get: function () {
2058
- return this._settings;
2251
+ return this._article;
2059
2252
  },
2060
2253
  set: function (value) {
2254
+ var _this = this;
2061
2255
  if (value) {
2062
- var settings = void 0;
2063
- if (typeof value === 'string') {
2064
- settings = JSON.parse(value);
2065
- }
2066
- else {
2067
- settings = value;
2068
- }
2069
- this._settingsService.createSettingsFromObject(settings);
2070
- // this._initConnection(settings);
2256
+ this._article = value;
2257
+ this._buildInfo().then(function () {
2258
+ _this._changeDetector.detectChanges();
2259
+ });
2071
2260
  }
2072
2261
  },
2073
2262
  enumerable: true,
2074
2263
  configurable: true
2075
2264
  });
2076
- IoneProductComponent.prototype.ngOnChanges = function (changes) {
2077
- this._changeDetector.detectChanges();
2078
- };
2079
- IoneProductComponent.prototype.ngOnDestroy = function () {
2080
- this._subs.forEach(function (s) { return s.unsubscribe(); });
2081
- };
2082
- IoneProductComponent.prototype._handleSettingsLoaded = function (loaded) {
2083
- if (loaded) {
2084
- this.upAndLoaded = true;
2085
- this._initConnection();
2086
- }
2265
+ ProductAdditionalInfoComponent.prototype.ngOnInit = function () {
2087
2266
  };
2088
- IoneProductComponent.prototype._handleAnswerInfoReceived = function (info) {
2089
- this.onArticleInfoReceived.next(info);
2267
+ ProductAdditionalInfoComponent.prototype._getTextsSuperArticle = function () {
2268
+ return __awaiter(this, void 0, void 0, function () {
2269
+ var _this = this;
2270
+ return __generator(this, function (_a) {
2271
+ return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
2272
+ var texts, mainArticle;
2273
+ var _this = this;
2274
+ return __generator(this, function (_a) {
2275
+ switch (_a.label) {
2276
+ case 0:
2277
+ texts = [];
2278
+ if (!this.article.superArticleNr) return [3 /*break*/, 4];
2279
+ mainArticle = void 0;
2280
+ if (!this._superArticles.has(this.article.superArticleNr)) return [3 /*break*/, 1];
2281
+ mainArticle = this._superArticles.get(this.article.superArticleNr);
2282
+ return [3 /*break*/, 3];
2283
+ case 1: return [4 /*yield*/, this._connectorService.getSuperArticle(this.article.superArticleNr)];
2284
+ case 2:
2285
+ mainArticle = _a.sent();
2286
+ this._superArticles.set(this.article.superArticleNr, mainArticle);
2287
+ _a.label = 3;
2288
+ case 3:
2289
+ mainArticle.texts.forEach(function (txt) {
2290
+ if (BitUtils.IsFullDescription(txt.publication)) {
2291
+ var safeTxt = _this._sanitizer.sanitize(SecurityContext.HTML, txt.text);
2292
+ texts.push(safeTxt);
2293
+ }
2294
+ });
2295
+ resolve(texts);
2296
+ return [3 /*break*/, 5];
2297
+ case 4:
2298
+ resolve(texts);
2299
+ _a.label = 5;
2300
+ case 5: return [2 /*return*/];
2301
+ }
2302
+ });
2303
+ }); })];
2304
+ });
2305
+ });
2090
2306
  };
2091
- // we need to prepare the settings before we can use it for the 3d configurator bundle
2092
- IoneProductComponent.prototype._initConnection = function () {
2307
+ ProductAdditionalInfoComponent.prototype._prepareArticleTexts = function () {
2093
2308
  return __awaiter(this, void 0, void 0, function () {
2309
+ var texts;
2310
+ var _a;
2094
2311
  var _this = this;
2312
+ return __generator(this, function (_b) {
2313
+ switch (_b.label) {
2314
+ case 0: return [4 /*yield*/, this._getTextsSuperArticle()];
2315
+ case 1:
2316
+ texts = _b.sent();
2317
+ if (texts.length > 0) {
2318
+ (_a = this.textParts).push.apply(_a, __spread(texts));
2319
+ }
2320
+ if (this.article.texts) {
2321
+ this.article.texts.forEach(function (txt) {
2322
+ if (BitUtils.IsFullDescription(txt.publication)) {
2323
+ var safeTxt = _this._sanitizer.sanitize(SecurityContext.HTML, txt.text);
2324
+ _this.textParts.push(safeTxt);
2325
+ }
2326
+ });
2327
+ }
2328
+ return [2 /*return*/];
2329
+ }
2330
+ });
2331
+ });
2332
+ };
2333
+ ProductAdditionalInfoComponent.prototype._buildInfo = function () {
2334
+ return __awaiter(this, void 0, void 0, function () {
2095
2335
  return __generator(this, function (_a) {
2096
- this._ione.initDefaultDevelopTestConnection();
2097
- // settingsToUse.session = this._ione.connector.connector.session;
2098
- setTimeout(function () {
2099
- _this._changeDetector.detectChanges();
2100
- });
2101
- return [2 /*return*/];
2336
+ switch (_a.label) {
2337
+ case 0:
2338
+ this.textParts.length = 0;
2339
+ return [4 /*yield*/, this._prepareArticleTexts()];
2340
+ case 1:
2341
+ _a.sent();
2342
+ if (this.textParts.length === 0) {
2343
+ if (this.article.additionalDescription) {
2344
+ this.textParts.push(this.article.additionalDescription);
2345
+ }
2346
+ else if (this.article.description) {
2347
+ this.textParts.push(this.article.description);
2348
+ }
2349
+ }
2350
+ return [2 /*return*/];
2351
+ }
2102
2352
  });
2103
2353
  });
2104
2354
  };
2105
- IoneProductComponent.ctorParameters = function () { return [
2106
- { type: DictionaryService },
2107
- { type: JsonUtilsService },
2108
- { type: ProductConnectorService },
2109
- { type: ChangeDetectorRef },
2110
- { type: ProductEventService },
2111
- { type: ProductSettingsService }
2112
- ]; };
2113
- __decorate([
2114
- Input()
2115
- ], IoneProductComponent.prototype, "sku", void 0);
2116
- __decorate([
2117
- Input()
2118
- ], IoneProductComponent.prototype, "settings", null);
2119
- __decorate([
2120
- Output()
2121
- ], IoneProductComponent.prototype, "onAddToCart", void 0);
2122
- __decorate([
2123
- Output()
2124
- ], IoneProductComponent.prototype, "forceRenderImage", void 0);
2125
- __decorate([
2126
- Output()
2127
- ], IoneProductComponent.prototype, "onAlternativeClick", void 0);
2128
- __decorate([
2129
- Output()
2130
- ], IoneProductComponent.prototype, "onArticleInfoReceived", void 0);
2131
- __decorate([
2132
- Output()
2133
- ], IoneProductComponent.prototype, "onArticleReceived", void 0);
2355
+ ProductAdditionalInfoComponent.ctorParameters = function () { return [
2356
+ { type: DomSanitizer },
2357
+ { type: ProductConnectorService },
2358
+ { type: ChangeDetectorRef }
2359
+ ]; };
2134
2360
  __decorate([
2135
- Output()
2136
- ], IoneProductComponent.prototype, "onSelectionsReceived", void 0);
2361
+ Input()
2362
+ ], ProductAdditionalInfoComponent.prototype, "article", null);
2137
2363
  __decorate([
2138
- Output()
2139
- ], IoneProductComponent.prototype, "onAddToQuote", void 0);
2140
- IoneProductComponent = __decorate([
2364
+ Input()
2365
+ ], ProductAdditionalInfoComponent.prototype, "showLabel", void 0);
2366
+ ProductAdditionalInfoComponent = __decorate([
2141
2367
  Component({
2142
- selector: 'app-ione-product',
2143
- template: "<app-product-page *ngIf=\"upAndLoaded\" [sku]=\"sku\"\n></app-product-page>\n",
2144
- encapsulation: ViewEncapsulation.Emulated,
2145
- styles: [""]
2368
+ selector: 'app-product-additional-info',
2369
+ template: "<h3 *ngIf=\"showLabel\" [textContent]=\"'ADDITIONAL_DATA' | localize\"></h3>\n<ng-container *ngIf=\"textParts && textParts.length > 0\">\n <div class=\"additional-info-parts\" *ngFor=\"let text of textParts\" [innerHTML]=\"text\"></div>\n</ng-container>\n",
2370
+ styles: [":host{display:block}:host .additional-info-parts{margin-bottom:20px;line-height:190%;color:#22313c;font-size:13px}:host ::ng-deep p{line-height:190%;margin:15px 0}:host ::ng-deep font{font-family:iOneMontserrat}:host .additional-info-parts>:first-child{margin-top:0}:host .additional-info-parts>:last-child{margin-bottom:0}"]
2146
2371
  })
2147
- ], IoneProductComponent);
2148
- return IoneProductComponent;
2372
+ ], ProductAdditionalInfoComponent);
2373
+ return ProductAdditionalInfoComponent;
2149
2374
  }());
2150
2375
 
2151
- var ProductAdditionalDescriptionComponent = /** @class */ (function () {
2152
- function ProductAdditionalDescriptionComponent(_appEventService) {
2153
- this._appEventService = _appEventService;
2376
+ var propertyMap = new Map([
2377
+ ['articleNr', 'ARTICLE_NUMBER'],
2378
+ ['catExtra', 'CATEGORY'],
2379
+ ['catType', 'CATEGORY_TYPE'],
2380
+ ['description', 'DESCRIPTION'],
2381
+ ['material', 'MATERIAL'],
2382
+ ['title', 'TITLE'],
2383
+ ['turnOverGroup', 'TURNOVERGROUP'],
2384
+ ['height', 'HEIGHT'],
2385
+ ['width', 'WIDTH']
2386
+ ]);
2387
+ var ProductPropertiesComponent = /** @class */ (function () {
2388
+ function ProductPropertiesComponent() {
2389
+ this.showLabel = false;
2390
+ this.properties = [];
2154
2391
  }
2155
- Object.defineProperty(ProductAdditionalDescriptionComponent.prototype, "article", {
2392
+ Object.defineProperty(ProductPropertiesComponent.prototype, "article", {
2156
2393
  get: function () {
2157
2394
  return this._article;
2158
2395
  },
2159
2396
  set: function (value) {
2160
2397
  this._article = value;
2161
- if (this._article) {
2162
- this.description = this.article.additionalDescription;
2163
- this._prepareDescription();
2164
- }
2398
+ this._prepareProperties();
2165
2399
  },
2166
2400
  enumerable: true,
2167
2401
  configurable: true
2168
2402
  });
2169
- ProductAdditionalDescriptionComponent.prototype.ngOnInit = function () {
2170
- };
2171
- ProductAdditionalDescriptionComponent.prototype.onReadMore = function () {
2172
- this._appEventService.onUpdateProductInfoTab.next(0);
2403
+ ProductPropertiesComponent.prototype.ngOnInit = function () {
2173
2404
  };
2174
- ProductAdditionalDescriptionComponent.prototype._prepareDescription = function () {
2405
+ ProductPropertiesComponent.prototype._prepareProperties = function () {
2175
2406
  var _this = this;
2176
- this.description = '';
2177
- if (this.article.texts && this.article.texts.length > 0) {
2178
- this.article.texts.forEach(function (txt) {
2179
- if (BitUtils.IsShortDescription(txt.publication)) {
2180
- _this.description += txt.text;
2181
- }
2182
- });
2183
- this.description = this.description.replace(/<[^>]*>?/gm, '');
2184
- if (this.description.length > 250) {
2185
- this.description = this.description.substr(0, 250) + ' [..]';
2186
- }
2407
+ this.properties.length = 0;
2408
+ if (!this._article) {
2409
+ return;
2187
2410
  }
2411
+ propertyMap.forEach(function (value, key) {
2412
+ if (_this.article.hasOwnProperty(key)) {
2413
+ _this.properties.push({ key: value, value: _this.article[key] });
2414
+ }
2415
+ });
2188
2416
  };
2189
- ProductAdditionalDescriptionComponent.ctorParameters = function () { return [
2190
- { type: ProductEventService }
2191
- ]; };
2192
2417
  __decorate([
2193
2418
  Input()
2194
- ], ProductAdditionalDescriptionComponent.prototype, "article", null);
2195
- ProductAdditionalDescriptionComponent = __decorate([
2419
+ ], ProductPropertiesComponent.prototype, "article", null);
2420
+ __decorate([
2421
+ Input()
2422
+ ], ProductPropertiesComponent.prototype, "showLabel", void 0);
2423
+ ProductPropertiesComponent = __decorate([
2196
2424
  Component({
2197
- selector: 'app-product-additional-description',
2198
- template: "<ng-container *ngIf=\"description !== ''\">\n <div class=\"pd-additional-description\">\n <p [innerHTML]=\"description\"></p>\n <button class=\"pd-read-more-btn\" [textContent]=\"'READ_MORE' | localize\" (click)=\"onReadMore()\"></button>\n </div>\n</ng-container>\n",
2199
- styles: [":host{display:block;padding-top:0!important}:host :focus{outline:0!important}:host .pd-additional-description{line-height:190%;color:#22313c;font-size:13px}:host .pd-read-more-btn{color:#2b60a7;border:none;background:0 0;cursor:pointer;text-decoration:underline;font-family:iOneMontserrat}:host .pd-read-more-btn:hover{color:#74b77f}@media screen and (max-width:650px){:host .pd-additional-description{font-size:12px}}"]
2425
+ selector: 'app-product-properties',
2426
+ template: "<div class=\"article-properties-wrapper\">\n <h3 *ngIf=\"showLabel\" [textContent]=\"'PROPERTIES' | localize\"></h3>\n <ng-container *ngFor=\"let property of properties\">\n <div class=\"article-property\">\n <div class=\"article-property-key\" [textContent]=\"property.key | localize\"></div>\n <div class=\"article-property-value\" [textContent]=\"property.value\"></div>\n </div>\n </ng-container>\n</div>\n",
2427
+ styles: [":host{display:block}.article-properties-wrapper{display:flex;flex-direction:column}.article-property{display:flex;flex-direction:row;border-bottom:1px solid #f6f5f4;padding:11px 0;font-size:13px}.article-property:first-child{border-top:1px solid #f6f5f4}.article-property-key{flex-basis:200px;flex-shrink:0;color:#5b6875}@media screen and (max-width:450px){.article-property-key{flex-basis:130px}}"]
2200
2428
  })
2201
- ], ProductAdditionalDescriptionComponent);
2202
- return ProductAdditionalDescriptionComponent;
2429
+ ], ProductPropertiesComponent);
2430
+ return ProductPropertiesComponent;
2203
2431
  }());
2204
2432
 
2205
- var ProductInfoTabsComponent = /** @class */ (function () {
2206
- function ProductInfoTabsComponent(_appEventService) {
2207
- var _this = this;
2208
- this._appEventService = _appEventService;
2209
- this.activeTabHeight = 0;
2210
- this.tabs = [];
2211
- this._subs = [];
2212
- this._subs.push(this._appEventService.onUpdateProductInfoTab.subscribe(function (index) {
2213
- _this.updateTab(index);
2214
- _this.tabContent.nativeElement.scrollIntoView({ behavior: 'smooth' });
2215
- }));
2433
+ var ProductSymbolsComponent = /** @class */ (function () {
2434
+ function ProductSymbolsComponent() {
2435
+ this.symbolStrings = [];
2216
2436
  }
2217
- Object.defineProperty(ProductInfoTabsComponent.prototype, "article", {
2437
+ Object.defineProperty(ProductSymbolsComponent.prototype, "symbols", {
2438
+ get: function () {
2439
+ return this._symbols;
2440
+ },
2218
2441
  set: function (value) {
2219
- if (value) {
2220
- this.articleObject = value;
2221
- this._setupTabs();
2222
- this.updateTab(0);
2442
+ this._symbols = value;
2443
+ if (this._symbols && this._symbols.hasOwnProperty('fontCode')) {
2444
+ this._className = this._symbols['fontCode'] === 'VLOER' ? 'floor' : (this._className === 'WAS' ? 'ginetex' : '');
2445
+ }
2446
+ if (this._symbols && this._symbols.hasOwnProperty('symbolString')) {
2447
+ for (var i = 0; i < this._symbols['symbolString'].length; i++) {
2448
+ this.symbolStrings.push(this._symbols['symbolString'][i]);
2449
+ }
2223
2450
  }
2224
2451
  },
2225
2452
  enumerable: true,
2226
2453
  configurable: true
2227
2454
  });
2228
- ProductInfoTabsComponent.prototype.ngOnDestroy = function () {
2229
- this._subs.forEach(function (s) { return s.unsubscribe(); });
2230
- };
2231
- ProductInfoTabsComponent.prototype.updateTab = function (tabIndex) {
2232
- this.activeTab = tabIndex;
2233
- this.updateHeight(tabIndex);
2234
- };
2235
- ProductInfoTabsComponent.prototype.updateHeight = function (tabIndex) {
2236
- if (this.tabContent.nativeElement.children.length > 0) {
2237
- if (this.tabContent.nativeElement.children[tabIndex] !== undefined) {
2238
- this.activeTabHeight = this.tabContent.nativeElement.children[tabIndex].offsetHeight;
2239
- }
2240
- }
2241
- };
2242
- ProductInfoTabsComponent.prototype._setupTabs = function () {
2243
- this.tabs.push({ title: 'DESCRIPTION' });
2244
- this.tabs.push({ title: 'FEATURES' });
2245
- if (this.articleObject.documents !== undefined && this.articleObject.documents.length > 0) {
2246
- this.tabs.push({ title: 'DOWNLOADS' });
2247
- }
2248
- if (this.articleObject.symbols !== undefined && this.articleObject.symbols.length > 0) {
2249
- this.tabs.push({ title: 'SYMBOLS' });
2250
- }
2455
+ ProductSymbolsComponent.prototype.ngOnInit = function () {
2251
2456
  };
2252
- ProductInfoTabsComponent.ctorParameters = function () { return [
2253
- { type: ProductEventService }
2254
- ]; };
2255
- __decorate([
2256
- ViewChild('tabContent')
2257
- ], ProductInfoTabsComponent.prototype, "tabContent", void 0);
2258
2457
  __decorate([
2259
2458
  Input()
2260
- ], ProductInfoTabsComponent.prototype, "article", null);
2261
- ProductInfoTabsComponent = __decorate([
2459
+ ], ProductSymbolsComponent.prototype, "symbols", null);
2460
+ __decorate([
2461
+ HostBinding('class')
2462
+ ], ProductSymbolsComponent.prototype, "_className", void 0);
2463
+ ProductSymbolsComponent = __decorate([
2262
2464
  Component({
2263
- selector: 'app-product-info-tabs',
2264
- template: "<div class=\"tab-container\">\r\n <div class=\"tab-header\">\r\n <button *ngFor=\"let tab of tabs; let i = index\" class=\"tab-header-button\" [class.active]=\"activeTab === i\" [textContent]=\"tab.title | localize\" (click)=\"updateTab(i)\"></button>\r\n </div>\r\n <div class=\"tab-content\" #tabContent [style.height.px]=\"(activeTabHeight > 0 ? activeTabHeight : '')\">\r\n <div class=\"tab-content-item\" *ngFor=\"let tab of tabs; let i = index\" [class.active]=\"activeTab === i\">\r\n <ng-container *ngIf=\"i === 0\">\r\n <app-product-additional-info class=\"\" [article]=\"articleObject\" [showLabel]=\"false\"></app-product-additional-info>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 1\">\r\n <app-product-properties class=\"\" [article]=\"articleObject\" [showLabel]=\"false\"></app-product-properties>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 2\">\r\n <app-product-documents [showLabel]=\"false\" class=\"\" *ngIf=\"articleObject?.documents && articleObject?.documents.length > 0\" [documents]=\"articleObject?.documents\"></app-product-documents>\r\n </ng-container>\r\n <ng-container *ngIf=\"i === 3\">\r\n <app-product-symbols class=\"\" *ngIf=\"articleObject?.symbols && articleObject?.symbols.length > 0\" [symbols]=\"articleObject?.symbols\"></app-product-symbols>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n",
2265
- styles: [":focus{outline:0}:host .tab-header{border-bottom:3px solid #f6f5f4;margin:0 0 30px}:host .tab-header .tab-header-button{background:0 0;border:none;border-bottom:3px solid transparent;line-height:20px;padding:15px 20px;cursor:pointer;font-family:iOneMontserrat;color:#22313c;font-weight:700;margin:0 0 -3px;opacity:.5}:host .tab-header .tab-header-button:hover{opacity:1}:host .tab-header .tab-header-button.active{opacity:1;border-color:#74b77f}:host .tab-content{padding:0 20px 30px;margin:0 0 20px;border-bottom:2px solid #f6f5f4;transition:.2s ease-in-out;position:relative}:host .tab-content .tab-content-item{opacity:0;position:absolute;left:0;top:0;visibility:hidden;width:100%}:host .tab-content .tab-content-item.active{opacity:1;visibility:visible;position:static}@media screen and (max-width:650px){:host .tab-content{padding:0 10px 15px}}@media screen and (max-width:450px){:host .tab-header{display:flex}:host .tab-header .tab-header-button{width:100%;padding:10px;font-size:11px}}"]
2266
- })
2267
- ], ProductInfoTabsComponent);
2268
- return ProductInfoTabsComponent;
2269
- }());
2270
-
2271
- var ProductInitializerService = /** @class */ (function () {
2272
- function ProductInitializerService(_settingsService) {
2273
- this._settingsService = _settingsService;
2274
- }
2275
- ProductInitializerService.prototype.initializeApp = function () {
2276
- return __awaiter(this, void 0, void 0, function () {
2277
- return __generator(this, function (_a) {
2278
- return [2 /*return*/, this._settingsService.initializeSettings()];
2279
- });
2280
- });
2281
- };
2282
- ProductInitializerService.ctorParameters = function () { return [
2283
- { type: ProductSettingsService }
2284
- ]; };
2285
- ProductInitializerService.ɵprov = ɵɵdefineInjectable({ factory: function ProductInitializerService_Factory() { return new ProductInitializerService(ɵɵinject(ProductSettingsService)); }, token: ProductInitializerService, providedIn: "root" });
2286
- ProductInitializerService = __decorate([
2287
- Injectable({
2288
- providedIn: 'root',
2465
+ selector: 'app-product-symbols',
2466
+ template: "<div *ngIf=\"symbols && symbols.length > 0\">\n <app-header [label]=\"'SYMBOLS' | localize\" [amount]=\"symbols?.length\"></app-header>\n <co-scroll-container>\n <co-tile small noImagePlaceholder *ngFor=\"let symbol of symbolStrings\">\n <ng-container tile-over-image>\n <div class=\"symbol\" [textContent]=\"symbol\"></div>\n </ng-container>\n <ng-container tile-extra-bottom-content>\n <div class=\"symbol-name\" [textContent]=\"'Wat moet hier?'\"></div>\n </ng-container>\n </co-tile>\n </co-scroll-container>\n</div>\n",
2467
+ styles: [":host{display:block}:host.floor .symbol{font-family:iOneFloorsymbols}:host.ginetex .symbol{font-family:iOneGinetexsymbols}.symbol{font-size:100px}"]
2289
2468
  })
2290
- ], ProductInitializerService);
2291
- return ProductInitializerService;
2469
+ ], ProductSymbolsComponent);
2470
+ return ProductSymbolsComponent;
2292
2471
  }());
2293
2472
 
2294
- function initializeApp(context) {
2295
- var x = function () { return context.initializeApp(); };
2296
- return x;
2297
- }
2298
- var IoneProductModule = /** @class */ (function () {
2299
- function IoneProductModule() {
2473
+ var ProductPageModule = /** @class */ (function () {
2474
+ function ProductPageModule() {
2300
2475
  }
2301
- IoneProductModule = __decorate([
2476
+ ProductPageModule = __decorate([
2302
2477
  NgModule({
2303
2478
  imports: [
2304
- // BrowserAnimationsModule,
2305
2479
  CommonModule,
2306
- ButtonModule,
2307
2480
  IconModule,
2481
+ LoaderModule,
2482
+ PipeModule,
2308
2483
  NumberPickerModule,
2484
+ ButtonModule,
2485
+ PriceDisplayPipeModule,
2309
2486
  InputTextModule,
2310
2487
  FilesUploadModule,
2311
- LoaderModule,
2312
2488
  ScrollContainerModule,
2313
2489
  TileModule,
2314
2490
  LevelIndicatorModule,
2315
- PriceDisplayPipeModule,
2316
- ArticleTileModule
2491
+ ArticleTileModule,
2317
2492
  ],
2318
2493
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
2319
2494
  declarations: [
2320
- IoneProductComponent,
2321
2495
  ProductPageComponent,
2496
+ ProductSelectorTypeComponent,
2322
2497
  ImageCarouselComponent,
2323
2498
  ProductDescriptionComponent,
2324
- ProductDocumentsComponent,
2499
+ ProductAdditionalDescriptionComponent,
2500
+ ProductPriceComponent,
2501
+ ProductAddtocartComponent,
2325
2502
  ProductRelatedComponent,
2503
+ ProductStockComponent,
2504
+ ProductDeliveryComponent,
2505
+ ProductInfoTabsComponent,
2506
+ ProductDocumentsComponent,
2326
2507
  HeaderComponent,
2327
2508
  ProductInfoComponent,
2328
2509
  ProductAdditionalInfoComponent,
2329
2510
  ProductPropertiesComponent,
2330
- ProductDeliveryComponent,
2331
- ProductStockComponent,
2332
- ProductSymbolsComponent,
2333
- ProductPriceComponent,
2334
- ProductAddtocartComponent,
2335
- ProductInfoTabsComponent,
2336
- LocalizePipe,
2337
- ProductSelectorTypeComponent,
2338
- ProductAdditionalDescriptionComponent
2511
+ ProductSymbolsComponent
2512
+ ],
2513
+ exports: [ProductPageComponent]
2514
+ })
2515
+ ], ProductPageModule);
2516
+ return ProductPageModule;
2517
+ }());
2518
+
2519
+ var ProductExternalSourceModule = /** @class */ (function () {
2520
+ function ProductExternalSourceModule() {
2521
+ }
2522
+ ProductExternalSourceModule = __decorate([
2523
+ NgModule({
2524
+ imports: [
2525
+ CommonModule,
2526
+ ProductPageModule
2527
+ ],
2528
+ declarations: [
2529
+ ProductExternalSourceComponent
2530
+ ],
2531
+ exports: [
2532
+ ProductExternalSourceComponent
2533
+ ]
2534
+ })
2535
+ ], ProductExternalSourceModule);
2536
+ return ProductExternalSourceModule;
2537
+ }());
2538
+
2539
+ function initializeApp(context) {
2540
+ var x = function () { return context.initializeApp(); };
2541
+ return x;
2542
+ }
2543
+ var IoneProductModule = /** @class */ (function () {
2544
+ function IoneProductModule() {
2545
+ }
2546
+ IoneProductModule = __decorate([
2547
+ NgModule({
2548
+ imports: [
2549
+ // BrowserAnimationsModule,
2550
+ CommonModule,
2551
+ ProductExternalSourceModule,
2552
+ ProductPageModule
2553
+ ],
2554
+ declarations: [
2555
+ IoneProductComponent
2339
2556
  ],
2340
2557
  entryComponents: [
2341
2558
  IoneProductComponent
2342
2559
  ],
2343
2560
  providers: [
2344
- ProductSettingsService,
2345
- ProductConnectorService,
2346
- ProductConnectorAdapterService,
2347
- IconCacheService,
2348
2561
  {
2349
2562
  provide: APP_INITIALIZER,
2350
2563
  useFactory: initializeApp,
@@ -2365,5 +2578,5 @@ var IoneProductModule = /** @class */ (function () {
2365
2578
  * Generated bundle index. Do not edit.
2366
2579
  */
2367
2580
 
2368
- export { IoneProductModule, Version, initializeApp, IoneProductComponent as ɵa, DictionaryService as ɵb, ProductAdditionalDescriptionComponent as ɵba, ProductInitializerService as ɵbb, JsonUtilsService as ɵc, ProductConnectorService as ɵd, ProductConnectorAdapterService as ɵe, ProductSettingsService as ɵf, ProductEventService as ɵg, ProductPageComponent as ɵh, IconCacheService as ɵi, ImageCarouselComponent as ɵj, ProductDescriptionComponent as ɵk, ProductDocumentsComponent as ɵl, ProductRelatedComponent as ɵm, HeaderComponent as ɵn, ProductInfoComponent as ɵo, ProductAdditionalInfoComponent as ɵp, ProductModuleService as ɵq, ProductPropertiesComponent as ɵr, ProductDeliveryComponent as ɵs, LocalizePipe as ɵt, ProductStockComponent as ɵu, ProductSymbolsComponent as ɵv, ProductPriceComponent as ɵw, ProductAddtocartComponent as ɵx, ProductInfoTabsComponent as ɵy, ProductSelectorTypeComponent as ɵz };
2581
+ export { IoneProductModule, ProductExternalSourceComponent, ProductExternalSourceModule, Version, initializeApp, ProductPageModule as ɵa, PipeModule as ɵb, ProductSymbolsComponent as ɵba, IoneProductComponent as ɵbb, ProductInitializerService as ɵbc, LocalizePipe as ɵc, DictionaryService as ɵd, JsonUtilsService as ɵe, ProductPageComponent as ɵf, ProductConnectorService as ɵg, ProductConnectorAdapterService as ɵh, ProductSettingsService as ɵi, IconCacheService as ɵj, ProductEventService as ɵk, ProductSelectorTypeComponent as ɵl, ImageCarouselComponent as ɵm, ProductDescriptionComponent as ɵn, ProductAdditionalDescriptionComponent as ɵo, ProductPriceComponent as ɵp, ProductAddtocartComponent as ɵq, ProductRelatedComponent as ɵr, ProductStockComponent as ɵs, ProductDeliveryComponent as ɵt, ProductInfoTabsComponent as ɵu, ProductDocumentsComponent as ɵv, HeaderComponent as ɵw, ProductInfoComponent as ɵx, ProductAdditionalInfoComponent as ɵy, ProductPropertiesComponent as ɵz };
2369
2582
  //# sourceMappingURL=colijnit-product.js.map