@colijnit/product 256.1.4 → 256.1.6

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.
@@ -1,21 +1,22 @@
1
- import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
1
+ import { ChangeDetectorRef, ElementRef, OnDestroy } from '@angular/core';
2
2
  import { CoDocument } from '@colijnit/mainapi/build/model/co-document';
3
3
  import { ProductConnectorService } from '../../service/product-connector.service';
4
4
  import { ProductEventService } from '../../service/product-event.service';
5
- import { IconEnum } from '../../enum/icon.enum';
6
- import { IconCacheService } from '../../service/icon-cache.service';
7
5
  import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
8
- export declare class ImageCarouselComponent implements OnInit, OnDestroy {
6
+ export declare class ImageViewModel {
7
+ image: CoDocument | string;
8
+ source: SafeUrl;
9
+ originalSource: string;
10
+ }
11
+ export declare class ImageCarouselComponent implements OnDestroy {
9
12
  private _ione;
10
13
  private _appEventService;
11
14
  private _changeDetector;
12
15
  private _domSanitizer;
13
- iconCache: IconCacheService;
14
- readonly icons: typeof IconEnum;
15
- showLoader: boolean;
16
16
  carousel: ElementRef;
17
17
  showRefresh: boolean;
18
- set images(value: CoDocument[]);
18
+ set images(value: (CoDocument | string)[]);
19
+ get images(): (CoDocument | string)[];
19
20
  handleWindowResize(): void;
20
21
  gotoNextSlide(): void;
21
22
  gotoPrevSlide(): void;
@@ -23,18 +24,20 @@ export declare class ImageCarouselComponent implements OnInit, OnDestroy {
23
24
  get currentIndex(): number;
24
25
  set currentIndex(value: number);
25
26
  resizing: boolean;
26
- get images(): CoDocument[];
27
+ imageViewModels: ImageViewModel[];
28
+ showLoader: boolean;
27
29
  private _resizeTimer;
28
30
  private _currentIndex;
29
31
  private _images;
30
32
  private _subs;
31
- constructor(_ione: ProductConnectorService, _appEventService: ProductEventService, _changeDetector: ChangeDetectorRef, _domSanitizer: DomSanitizer, iconCache: IconCacheService);
32
- ngOnInit(): void;
33
+ private _resizeCanvasHeight;
34
+ constructor(_ione: ProductConnectorService, _appEventService: ProductEventService, _changeDetector: ChangeDetectorRef, _domSanitizer: DomSanitizer);
33
35
  ngOnDestroy(): void;
34
36
  handleThumbClick(index: number): void;
35
37
  onForceRenderImage(): void;
36
- getImageSrc(image: CoDocument | CustomEvent): SafeUrl;
38
+ handleShowImage(imageViewModel: ImageViewModel): void;
37
39
  private _filterValidImages;
38
- private _loadImages;
40
+ private _loadAndRescaleImages;
41
+ private _resizeAndSanitizeSource;
39
42
  private _scrollCarouselToIndex;
40
43
  }
@@ -7,6 +7,7 @@ import { ProductEventService } from '../../service/product-event.service';
7
7
  import { CatalogDefinition } from '@colijnit/articleapi/build/model/catalog-definition.bo';
8
8
  import { ExternalSourceArticleAddInterface } from '@colijnit/articleapi/build/interface/external-source-article-add.interface';
9
9
  import { ExternalCatalogStartupInfo } from '@colijnit/articleapi/build/model/external-catalog-startup-info';
10
+ import { ExternalSourceParameter } from '@colijnit/articleapi/build/model/external-source-parameter.bo';
10
11
  export declare class ProductExternalSourceComponent implements OnInit, OnDestroy {
11
12
  private _sanitizer;
12
13
  private _productConnectorService;
@@ -32,6 +33,7 @@ export declare class ProductExternalSourceComponent implements OnInit, OnDestroy
32
33
  externalSettings: any;
33
34
  token: string;
34
35
  variant: string;
36
+ urlParams: ExternalSourceParameter[];
35
37
  private _externalSource;
36
38
  private _externalCatalogStartupInfo;
37
39
  private _subs;
@@ -1,5 +1,6 @@
1
1
  import { ElementRef, EventEmitter, OnDestroy, Renderer2 } from '@angular/core';
2
2
  import { ProductScriptLoaderService } from '../../service/product-script-loader.service';
3
+ import { ExternalSourceParameter } from '@colijnit/articleapi/build/model/external-source-parameter.bo';
3
4
  export declare class ProductHdComponent implements OnDestroy {
4
5
  private _scriptLoader;
5
6
  private _renderer;
@@ -8,6 +9,7 @@ export declare class ProductHdComponent implements OnDestroy {
8
9
  get sku(): string;
9
10
  token: string;
10
11
  variant: string;
12
+ urlParams: ExternalSourceParameter[];
11
13
  configuratorFinished: EventEmitter<string>;
12
14
  configurationError: EventEmitter<any>;
13
15
  showClass: boolean;
@@ -18,5 +20,6 @@ export declare class ProductHdComponent implements OnDestroy {
18
20
  handleConfigurationFinished(event: CustomEvent): void;
19
21
  handleError(event: CustomEvent): void;
20
22
  private _prepareAttributes;
23
+ private _prepareConfiguratorUrls;
21
24
  private _loadTheScripts;
22
25
  }
@@ -17,7 +17,7 @@ export declare class ProductEventService {
17
17
  onImageReceived: Subject<string>;
18
18
  onRenderStarted: Subject<void>;
19
19
  onRenderImageReceived: Subject<string>;
20
- onDraftRenderImageReceived: Subject<string>;
20
+ onDraftRenderImageReceived: Subject<CustomEvent>;
21
21
  onArticleInfoReceived: Subject<string>;
22
22
  onUpdateProductInfoTab: Subject<number>;
23
23
  errorMessage: Subject<ValidationMessage[]>;
@@ -31,8 +31,8 @@
31
31
  function Version() {
32
32
  this.name = "@colijnit/product";
33
33
  this.description = "Product detail page project for iOne";
34
- this.symVer = "256.1.4";
35
- this.publishDate = "22-1-2025 20:45:30";
34
+ this.symVer = "256.1.6";
35
+ this.publishDate = "14-3-2025 14:06:38";
36
36
  }
37
37
  return Version;
38
38
  }());
@@ -1738,7 +1738,7 @@
1738
1738
  animations.transition('void => *', animations.animate('200ms ease-in-out')),
1739
1739
  ])
1740
1740
  ],
1741
- styles: [".page-wrapper{font-family:iOneMontserrat;font-size:12px;display:flex;flex-direction:column;max-width:1400px;padding:0 15px;margin:0 auto}.page-wrapper-content{display:flex;flex-direction:row;margin:40px 0}.page-wrapper-content:first-child{margin-top:0}.page-wrapper-content.no-top-margin{margin-top:0}.page-wrapper-left{display:flex;width:55%;flex-direction:column}.page-wrapper-right{display:flex;width:45%;flex-direction:column}.page-wrapper-full{display:flex;width:100%;flex-direction:column}.page-wrapper-66{display:flex;width:60%;flex-direction:column}.page-wrapper-33{display:flex;width:40%;flex-direction:column}.threed-selections{display:none}.threed-selections.show-selections{display:block}.threed-selections ::ng-deep .rp-lite-selector .rp-answers-slideout ::ng-deep co-slideout{width:480px;z-index:3}.product-action-buttons{position:relative}.product-action-buttons.full-screen{z-index:10}.product-image-container{grid-column:1/7;grid-row:1/6;position:relative}.product-page-block-selector-type{width:auto;position:absolute;top:10px;right:10px;z-index:2}.product-page-block-image{box-sizing:border-box;width:100%;z-index:1;position:relative}.product-page-block-image .threed-configurator{border:1px solid #efefef}.product-page-block-image .threed-configurator .layer .viewer canvas{height:100%;width:100%}.product-page-block-image .threed-configurator ::ng-deep .rp-element-toolbar{top:30px}.product-page-block-image app-image-carousel.show-animated,.product-page-block-image threed-configurator.show-animated{opacity:1;z-index:0;transition:all .2s ease-in-out}.product-page-block-image .fullscreen-button{cursor:pointer;height:50px;width:50px;position:absolute;left:30px;z-index:100;top:30px}.product-page-block-image.full{grid-column:1/11;grid-row:2/span 10;z-index:3}.product-page-block-description{grid-column:7/12;grid-row:1/1}.product-page-block-additional{width:100%}.product-page-block-additional-description{width:100%}.product-page-block-price{grid-column:1/3;grid-row:2/2;align-self:center}.product-page-block-price.full{grid-column:1/5}.product-page-block-addtocart{grid-column:3/5;grid-row:2/2;align-self:center;padding-top:30px!important}.product-page-block-addtocart ::ng-deep co-number-picker ::ng-deep co-button{cursor:pointer}.product-page-block-addtocart ::ng-deep co-number-picker ::ng-deep co-button:hover div.rippler{background:#f6f5f4}.product-page-block-addtocart ::ng-deep co-number-picker ::ng-deep co-button ::ng-deep co-icon{position:relative;z-index:2}.product-page-block-addtocart ::ng-deep co-button.cart-button{cursor:pointer}.product-page-block-addtocart ::ng-deep co-button.cart-button:hover{background:#74B77F}.addtocart-reserved{grid-column:1/3;grid-row:3/3}.product-page-block-stock{grid-column:1/3;grid-row:4/4}.product-page-block-delivery{grid-column:3/5;grid-row:4/4}::ng-deep co-scroll-container{overflow:hidden;position:relative}::ng-deep co-scroll-container .content-wrapper{padding:0}::ng-deep co-scroll-container .scroll-layer{left:0;top:0}::ng-deep co-scroll-container .scroll-layer .scroller{width:34px;height:34px;border-radius:36px;background:#fff;cursor:pointer;box-shadow:0 0 5px #0003}::ng-deep co-scroll-container .scroll-layer .scroller:hover{background:#f6f5f4}::ng-deep co-scroll-container .scroll-layer .scroller.left-scroll{left:5px}::ng-deep co-scroll-container .scroll-layer .scroller.left-scroll:before{border-width:0 3px 3px 0;padding:4px;margin-left:13px;margin-top:11px}::ng-deep co-scroll-container .scroll-layer .scroller.right-scroll{right:5px}::ng-deep co-scroll-container .scroll-layer .scroller.right-scroll:after{border-width:0 3px 3px 0;padding:4px;margin-left:9px;margin-top:11px}.product-page-block-variants{margin:20px 0 0}.product-page-block-variants ::ng-deep app-product-related>div{display:flex;grid-gap:15px;gap:15px;align-items:center;border-top:1px solid #f6f5f4;padding:5px 0 7px 15px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep app-header h3{font-size:14px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container{width:320px;max-width:100%;padding:0 16px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container .scroller{width:26px;height:26px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container .scroller.left-scroll{left:5px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container .scroller.left-scroll:before{border-width:0 2px 2px 0;margin-left:9px;margin-top:9px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container .scroller.right-scroll{right:5px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container .scroller.right-scroll:after{border-width:0 2px 2px 0;margin-left:6px;margin-top:9px}.product-page-block-variants ::ng-deep co-tile.small{min-width:50px!important;max-width:50px!important;border:1px solid #f6f5f4;margin:0 10px 0 0;border-radius:4px}.product-page-block-variants ::ng-deep co-tile.small:hover{border-color:#22313c}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper{padding:0}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper .tile-top{display:none}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper .image{height:40px!important;padding:5px;margin-bottom:10px}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper .image .no-image-wrapper .no-image{width:40px;height:40px}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper .image .no-image-wrapper span{display:none!important}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper .tile-bottom{display:none}.product-page-block-variants ::ng-deep co-tile.small .tile-extra-bottom{display:none}.product-page-block-alternatives ::ng-deep .article-wrapper{margin:0 20px 0 0}.product-page-block-alternatives ::ng-deep .article-wrapper:last-child{margin:0}.product-page-block-alternatives ::ng-deep co-tile{cursor:pointer;transition:all .14s ease-out;border:1px solid transparent;border-bottom-color:#f6f5f4;padding:15px 10px 0;width:319px;max-width:none;min-width:0;box-sizing:border-box}.product-page-block-alternatives ::ng-deep co-tile:hover{box-shadow:none;border-color:#f6f5f4}.product-page-block-alternatives ::ng-deep co-tile:hover .tile-wrapper div.image co-image{transform:scale(1.05)}.product-page-block-alternatives ::ng-deep co-tile:hover .tile-wrapper .tile-bottom{margin:0}.product-page-block-alternatives ::ng-deep co-tile:hover .tile-extra-bottom .main .description{text-decoration:underline}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper{padding:0;position:relative;outline:none;overflow:hidden}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper .tile-top{position:absolute;left:0;top:0;width:100%}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper div.image{position:relative;padding:1px;display:flex;align-items:center;justify-content:center;overflow:hidden;max-width:250px;margin:0 auto 10px;height:auto}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper div.image:after{content:\"\";padding:100% 0 0;float:left;width:100%}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper div.image co-image{position:absolute;left:0;top:0;overflow:hidden;width:100%;height:100%;-o-object-fit:contain;object-fit:contain;z-index:-1;transition:all .2s ease}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper div.image .no-image-wrapper{position:absolute;display:flex;left:50%;top:50%;margin:-48px 0 0 -54px;flex-direction:column;align-items:center;opacity:.25}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper .tile-bottom{transition:all .2s ease;height:auto}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper .tile-bottom ::ng-deep co-button{margin:0 0 5px!important;width:36px;height:36px;border:1px solid #22313C;cursor:pointer;border-radius:4px;padding:0!important;font-size:0}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper .tile-bottom ::ng-deep co-button co-icon{width:32px;height:32px;margin:0 2px}.product-page-block-alternatives ::ng-deep co-tile .tile-extra-bottom{outline:none;padding:15px 0;background:transparent!important;min-height:60px}.product-page-block-alternatives ::ng-deep co-tile .tile-extra-bottom .main{padding:0 10px}.product-page-block-alternatives ::ng-deep co-tile .tile-extra-bottom .main .description{font-size:15px;font-weight:bold;margin:0 0 2px}.product-page-block-alternatives ::ng-deep co-tile .tile-extra-bottom .main .price{font-size:16px;margin:15px 0 0;font-weight:bold;color:#2b60a7}.product-page-block-additional-information{grid-column:1/6;grid-row:4/4}.product-page-block-properties{grid-column:7/10;grid-row:3/3}.product-page-block-related-articles{grid-column:2/6;grid-row:4/4}.product-page-block-alternative-articles{grid-column:6/10;grid-row:4/4}.product-page-block-documents{grid-column:2/6;grid-row:5/5}.product-page-block-symbols{grid-column:6/10;grid-row:5/5}@media screen and (max-width: 950px){.default-padding{padding-top:20px;padding-bottom:20px}.m-padding{padding-top:15px;padding-bottom:15px}.s-padding{padding-top:5px;padding-bottom:5px}.page-wrapper{max-width:650px}.page-wrapper .page-wrapper-content{flex-direction:column;margin:30px 0}.page-wrapper .page-wrapper-content .page-wrapper-left{width:100%}.page-wrapper .page-wrapper-content .page-wrapper-right{width:100%}.product-page-block-alternatives ::ng-deep co-tile{width:284px!important}}@media screen and (max-width: 650px){[class*=-padding]{padding-left:0!important;padding-right:0!important}.product-page-block-addtocart ::ng-deep co-number-picker co-button{height:38px!important}.product-page-block-addtocart ::ng-deep co-number-picker co-input-text{height:38px!important;width:36px!important}.product-page-block-addtocart ::ng-deep co-button.cart-button{height:40px;font-size:13px}}\n"]
1741
+ styles: [".page-wrapper{font-family:iOneMontserrat;font-size:12px;display:flex;flex-direction:column;max-width:1400px;padding:0 15px;margin:0 auto}.page-wrapper-content{display:flex;flex-direction:row;margin:40px 0}.page-wrapper-content:first-child{margin-top:0}.page-wrapper-content.no-top-margin{margin-top:0}.page-wrapper-left{display:flex;width:55%;flex-direction:column}.page-wrapper-right{display:flex;width:45%;flex-direction:column}.page-wrapper-full{display:flex;width:100%;flex-direction:column}.page-wrapper-66{display:flex;width:60%;flex-direction:column}.page-wrapper-33{display:flex;width:40%;flex-direction:column}.threed-selections{display:none}.threed-selections.show-selections{display:block}.threed-selections ::ng-deep .rp-lite-selector .rp-answers-slideout ::ng-deep co-slideout{width:480px;z-index:3}.threed-selections ::ng-deep .co-summary-line{cursor:pointer}.product-action-buttons{position:relative}.product-action-buttons.full-screen{z-index:10}.product-image-container{grid-column:1/7;grid-row:1/6;position:relative}.product-page-block-selector-type{width:auto;position:absolute;top:10px;right:10px;z-index:2}.product-page-block-image{box-sizing:border-box;width:100%;z-index:1;position:relative}.product-page-block-image .threed-configurator{border:1px solid #efefef}.product-page-block-image .threed-configurator .layer .viewer canvas{height:100%;width:100%}.product-page-block-image .threed-configurator ::ng-deep .rp-element-toolbar{top:30px}.product-page-block-image app-image-carousel.show-animated,.product-page-block-image threed-configurator.show-animated{opacity:1;z-index:0;transition:all .2s ease-in-out}.product-page-block-image .fullscreen-button{cursor:pointer;height:50px;width:50px;position:absolute;left:30px;z-index:100;top:30px}.product-page-block-image.full{grid-column:1/11;grid-row:2/span 10;z-index:3}.product-page-block-description{grid-column:7/12;grid-row:1/1}.product-page-block-additional{width:100%}.product-page-block-additional-description{width:100%}.product-page-block-price{grid-column:1/3;grid-row:2/2;align-self:center}.product-page-block-price.full{grid-column:1/5}.product-page-block-addtocart{grid-column:3/5;grid-row:2/2;align-self:center;padding-top:30px!important}.product-page-block-addtocart ::ng-deep co-number-picker ::ng-deep co-button{cursor:pointer}.product-page-block-addtocart ::ng-deep co-number-picker ::ng-deep co-button:hover div.rippler{background:#f6f5f4}.product-page-block-addtocart ::ng-deep co-number-picker ::ng-deep co-button ::ng-deep co-icon{position:relative;z-index:2}.product-page-block-addtocart ::ng-deep co-button.cart-button{cursor:pointer}.product-page-block-addtocart ::ng-deep co-button.cart-button:hover{background:#74B77F}.addtocart-reserved{grid-column:1/3;grid-row:3/3}.product-page-block-stock{grid-column:1/3;grid-row:4/4}.product-page-block-delivery{grid-column:3/5;grid-row:4/4}::ng-deep co-scroll-container{overflow:hidden;position:relative}::ng-deep co-scroll-container .content-wrapper{padding:0}::ng-deep co-scroll-container .scroll-layer{left:0;top:0}::ng-deep co-scroll-container .scroll-layer .scroller{width:34px;height:34px;border-radius:36px;background:#fff;cursor:pointer;box-shadow:0 0 5px #0003}::ng-deep co-scroll-container .scroll-layer .scroller:hover{background:#f6f5f4}::ng-deep co-scroll-container .scroll-layer .scroller.left-scroll{left:5px}::ng-deep co-scroll-container .scroll-layer .scroller.left-scroll:before{border-width:0 3px 3px 0;padding:4px;margin-left:13px;margin-top:11px}::ng-deep co-scroll-container .scroll-layer .scroller.right-scroll{right:5px}::ng-deep co-scroll-container .scroll-layer .scroller.right-scroll:after{border-width:0 3px 3px 0;padding:4px;margin-left:9px;margin-top:11px}.product-page-block-variants{margin:20px 0 0}.product-page-block-variants ::ng-deep app-product-related>div{display:flex;grid-gap:15px;gap:15px;align-items:center;border-top:1px solid #f6f5f4;padding:5px 0 7px 15px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep app-header h3{font-size:14px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container{width:320px;max-width:100%;padding:0 16px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container .scroller{width:26px;height:26px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container .scroller.left-scroll{left:5px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container .scroller.left-scroll:before{border-width:0 2px 2px 0;margin-left:9px;margin-top:9px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container .scroller.right-scroll{right:5px}.product-page-block-variants ::ng-deep app-product-related>div ::ng-deep co-scroll-container .scroller.right-scroll:after{border-width:0 2px 2px 0;margin-left:6px;margin-top:9px}.product-page-block-variants ::ng-deep co-tile.small{min-width:50px!important;max-width:50px!important;border:1px solid #f6f5f4;margin:0 10px 0 0;border-radius:4px}.product-page-block-variants ::ng-deep co-tile.small:hover{border-color:#22313c}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper{padding:0}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper .tile-top{display:none}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper .image{height:40px!important;padding:5px;margin-bottom:10px}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper .image .no-image-wrapper .no-image{width:40px;height:40px}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper .image .no-image-wrapper span{display:none!important}.product-page-block-variants ::ng-deep co-tile.small .tile-wrapper .tile-bottom{display:none}.product-page-block-variants ::ng-deep co-tile.small .tile-extra-bottom{display:none}.product-page-block-alternatives ::ng-deep .article-wrapper{margin:0 20px 0 0}.product-page-block-alternatives ::ng-deep .article-wrapper:last-child{margin:0}.product-page-block-alternatives ::ng-deep co-tile{cursor:pointer;transition:all .14s ease-out;border:1px solid transparent;border-bottom-color:#f6f5f4;padding:15px 10px 0;width:319px;max-width:none;min-width:0;box-sizing:border-box}.product-page-block-alternatives ::ng-deep co-tile:hover{box-shadow:none;border-color:#f6f5f4}.product-page-block-alternatives ::ng-deep co-tile:hover .tile-wrapper div.image co-image{transform:scale(1.05)}.product-page-block-alternatives ::ng-deep co-tile:hover .tile-wrapper .tile-bottom{margin:0}.product-page-block-alternatives ::ng-deep co-tile:hover .tile-extra-bottom .main .description{text-decoration:underline}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper{padding:0;position:relative;outline:none;overflow:hidden}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper .tile-top{position:absolute;left:0;top:0;width:100%}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper div.image{position:relative;padding:1px;display:flex;align-items:center;justify-content:center;overflow:hidden;max-width:250px;margin:0 auto 10px;height:auto}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper div.image:after{content:\"\";padding:100% 0 0;float:left;width:100%}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper div.image co-image{position:absolute;left:0;top:0;overflow:hidden;width:100%;height:100%;-o-object-fit:contain;object-fit:contain;z-index:-1;transition:all .2s ease}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper div.image .no-image-wrapper{position:absolute;display:flex;left:50%;top:50%;margin:-48px 0 0 -54px;flex-direction:column;align-items:center;opacity:.25}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper .tile-bottom{transition:all .2s ease;height:auto}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper .tile-bottom ::ng-deep co-button{margin:0 0 5px!important;width:36px;height:36px;border:1px solid #22313C;cursor:pointer;border-radius:4px;padding:0!important;font-size:0}.product-page-block-alternatives ::ng-deep co-tile .tile-wrapper .tile-bottom ::ng-deep co-button co-icon{width:32px;height:32px;margin:0 2px}.product-page-block-alternatives ::ng-deep co-tile .tile-extra-bottom{outline:none;padding:15px 0;background:transparent!important;min-height:60px}.product-page-block-alternatives ::ng-deep co-tile .tile-extra-bottom .main{padding:0 10px}.product-page-block-alternatives ::ng-deep co-tile .tile-extra-bottom .main .description{font-size:15px;font-weight:bold;margin:0 0 2px}.product-page-block-alternatives ::ng-deep co-tile .tile-extra-bottom .main .price{font-size:16px;margin:15px 0 0;font-weight:bold;color:#2b60a7}.product-page-block-additional-information{grid-column:1/6;grid-row:4/4}.product-page-block-properties{grid-column:7/10;grid-row:3/3}.product-page-block-related-articles{grid-column:2/6;grid-row:4/4}.product-page-block-alternative-articles{grid-column:6/10;grid-row:4/4}.product-page-block-documents{grid-column:2/6;grid-row:5/5}.product-page-block-symbols{grid-column:6/10;grid-row:5/5}@media screen and (max-width: 950px){.default-padding{padding-top:20px;padding-bottom:20px}.m-padding{padding-top:15px;padding-bottom:15px}.s-padding{padding-top:5px;padding-bottom:5px}.page-wrapper{max-width:650px}.page-wrapper .page-wrapper-content{flex-direction:column;margin:30px 0}.page-wrapper .page-wrapper-content .page-wrapper-left{width:100%}.page-wrapper .page-wrapper-content .page-wrapper-right{width:100%}.product-page-block-alternatives ::ng-deep co-tile{width:284px!important}}@media screen and (max-width: 650px){[class*=-padding]{padding-left:0!important;padding-right:0!important}.product-page-block-addtocart ::ng-deep co-number-picker co-button{height:38px!important}.product-page-block-addtocart ::ng-deep co-number-picker co-input-text{height:38px!important;width:36px!important}.product-page-block-addtocart ::ng-deep co-button.cart-button{height:40px;font-size:13px}}\n"]
1742
1742
  },] }
1743
1743
  ];
1744
1744
  ProductPageComponent.ctorParameters = function () { return [
@@ -1874,31 +1874,45 @@
1874
1874
  },] }
1875
1875
  ];
1876
1876
 
1877
+ var ImageViewModel = /** @class */ (function () {
1878
+ function ImageViewModel() {
1879
+ }
1880
+ return ImageViewModel;
1881
+ }());
1877
1882
  var ImageCarouselComponent = /** @class */ (function () {
1878
- function ImageCarouselComponent(_ione, _appEventService, _changeDetector, _domSanitizer, iconCache) {
1883
+ function ImageCarouselComponent(_ione, _appEventService, _changeDetector, _domSanitizer) {
1879
1884
  var _this = this;
1880
1885
  this._ione = _ione;
1881
1886
  this._appEventService = _appEventService;
1882
1887
  this._changeDetector = _changeDetector;
1883
1888
  this._domSanitizer = _domSanitizer;
1884
- this.iconCache = iconCache;
1885
- this.icons = IconEnum;
1886
- this.showLoader = false;
1887
1889
  this.showRefresh = false;
1888
1890
  this.resizing = false;
1891
+ this.imageViewModels = [];
1892
+ this.showLoader = false;
1889
1893
  this._currentIndex = 0;
1890
1894
  this._images = [];
1891
1895
  this._subs = [];
1896
+ this._resizeCanvasHeight = 500;
1892
1897
  this._subs.push(this._appEventService.onRenderStarted.subscribe(function () {
1893
1898
  _this.showLoader = true;
1894
- }), this._appEventService.onDraftRenderImageReceived.subscribe(function (url) {
1895
- if (_this._images[0] instanceof coDocument.CoDocument) {
1896
- _this._images.unshift(url);
1897
- }
1898
- else {
1899
- _this._images[0] = url;
1899
+ _this._changeDetector.detectChanges();
1900
+ setTimeout(function () {
1901
+ _this.showLoader = false;
1902
+ _this._changeDetector.detectChanges();
1903
+ }, 10000);
1904
+ }), this._appEventService.onDraftRenderImageReceived.subscribe(function (event) {
1905
+ if (event && event.detail) {
1906
+ if (_this._images[0] instanceof coDocument.CoDocument) {
1907
+ _this._images.unshift(event.detail);
1908
+ }
1909
+ else {
1910
+ _this._images[0] = event.detail;
1911
+ }
1912
+ _this._loadAndRescaleImages();
1900
1913
  }
1901
1914
  _this.showLoader = false;
1915
+ _this._changeDetector.detectChanges();
1902
1916
  }));
1903
1917
  }
1904
1918
  Object.defineProperty(ImageCarouselComponent.prototype, "images", {
@@ -1908,7 +1922,7 @@
1908
1922
  set: function (value) {
1909
1923
  if (value && value.length > 0) {
1910
1924
  this._images = this._filterValidImages(value);
1911
- this._loadImages();
1925
+ this._loadAndRescaleImages();
1912
1926
  this._changeDetector.detectChanges();
1913
1927
  }
1914
1928
  },
@@ -1944,8 +1958,6 @@
1944
1958
  enumerable: false,
1945
1959
  configurable: true
1946
1960
  });
1947
- ImageCarouselComponent.prototype.ngOnInit = function () {
1948
- };
1949
1961
  ImageCarouselComponent.prototype.ngOnDestroy = function () {
1950
1962
  this.carousel = undefined;
1951
1963
  this._subs.forEach(function (s) { return s.unsubscribe(); });
@@ -1956,20 +1968,16 @@
1956
1968
  ImageCarouselComponent.prototype.onForceRenderImage = function () {
1957
1969
  this._appEventService.onForceRenderImage.next();
1958
1970
  };
1959
- ImageCarouselComponent.prototype.getImageSrc = function (image) {
1960
- var source = '';
1961
- if (image instanceof coDocument.CoDocument) {
1962
- if (image.filePath) {
1963
- source = image.filePath;
1964
- }
1965
- else {
1966
- source = image.documentBodyAsDataUri;
1967
- }
1968
- }
1969
- else if (image.detail !== undefined) {
1970
- source = image.detail;
1971
+ ImageCarouselComponent.prototype.handleShowImage = function (imageViewModel) {
1972
+ if (imageViewModel && imageViewModel.originalSource) {
1973
+ var popupWindow = window.open('', 'Image zoom', 'width=600,height=400');
1974
+ // Set the content of the popup window
1975
+ popupWindow.document.write('<html><head><title>Image zoom</title></head><body>');
1976
+ popupWindow.document.write("<img src=" + imageViewModel.originalSource + " alt=\"Image\" style=\"width:100%; height:auto;\">");
1977
+ popupWindow.document.write('</body></html>');
1978
+ // Close the document to render the popup window
1979
+ popupWindow.document.close();
1971
1980
  }
1972
- return this._domSanitizer.bypassSecurityTrustUrl(source);
1973
1981
  };
1974
1982
  ImageCarouselComponent.prototype._filterValidImages = function (value) {
1975
1983
  if (!value) {
@@ -1977,23 +1985,76 @@
1977
1985
  }
1978
1986
  return value.filter(function (doc) {
1979
1987
  var pattern = /\.(jpg|jpeg|png|gif|bmp|tiff|webp)$/i;
1980
- return pattern.test(doc.fileName) || !!doc.filePath;
1988
+ return typeof doc === 'string' || (pattern.test(doc.fileName) || !!doc.filePath);
1981
1989
  });
1982
1990
  };
1983
- ImageCarouselComponent.prototype._loadImages = function () {
1991
+ ImageCarouselComponent.prototype._loadAndRescaleImages = function () {
1984
1992
  var _this = this;
1993
+ this.imageViewModels.length = 0;
1985
1994
  if (this._images) {
1986
1995
  this._images.forEach(function (i) {
1987
- if (!i.documentBody && !i.filePath) {
1988
- _this._ione.getDocumentContent(i.documentId, false).then(function (content) {
1989
- if (content) {
1990
- i.documentBody = content.documentContent;
1991
- }
1992
- });
1996
+ var imageViewModel = new ImageViewModel();
1997
+ imageViewModel.image = i;
1998
+ if (typeof i === 'string') { // is a rendered image coming from configurator
1999
+ _this._resizeAndSanitizeSource(i, imageViewModel);
1993
2000
  }
2001
+ else {
2002
+ if (i.filePath) {
2003
+ _this._resizeAndSanitizeSource(i.filePath, imageViewModel);
2004
+ }
2005
+ else if (i.documentBody) {
2006
+ _this._resizeAndSanitizeSource(i.documentBodyAsDataUri, imageViewModel);
2007
+ }
2008
+ else {
2009
+ _this._ione.getDocumentContent(i.documentId, false).then(function (content) {
2010
+ if (content) {
2011
+ i.documentBody = content.documentContent;
2012
+ _this._resizeAndSanitizeSource(i.documentBodyAsDataUri, imageViewModel);
2013
+ _this._changeDetector.detectChanges();
2014
+ }
2015
+ });
2016
+ }
2017
+ }
2018
+ _this.imageViewModels.push(imageViewModel);
2019
+ _this._changeDetector.detectChanges();
1994
2020
  });
1995
2021
  }
1996
2022
  };
2023
+ ImageCarouselComponent.prototype._resizeAndSanitizeSource = function (source, imageViewModel) {
2024
+ var _this = this;
2025
+ var resizeCanvas = document.createElement('canvas');
2026
+ var resizeCanvasContext = resizeCanvas.getContext('2d');
2027
+ var resizeImage = document.createElement('img');
2028
+ resizeImage.onload = function () { return __awaiter(_this, void 0, void 0, function () {
2029
+ var originalWidth, originalHeight, aspectRatio, newWidth, newHeight, imageWidth, resizedSource;
2030
+ return __generator(this, function (_a) {
2031
+ resizeCanvasContext.imageSmoothingEnabled = true;
2032
+ resizeCanvasContext.imageSmoothingQuality = 'high';
2033
+ originalWidth = resizeImage.width;
2034
+ originalHeight = resizeImage.height;
2035
+ aspectRatio = originalWidth / originalHeight;
2036
+ newWidth = this._resizeCanvasHeight;
2037
+ newHeight = this._resizeCanvasHeight;
2038
+ if (originalWidth > originalHeight) {
2039
+ newHeight = this._resizeCanvasHeight / aspectRatio;
2040
+ }
2041
+ else {
2042
+ newWidth = this._resizeCanvasHeight * aspectRatio;
2043
+ }
2044
+ // Set the canvas size to the new width and height
2045
+ resizeCanvas.width = newWidth;
2046
+ resizeCanvas.height = newHeight;
2047
+ imageWidth = this._resizeCanvasHeight * (resizeImage.height / resizeImage.width);
2048
+ resizeCanvasContext.drawImage(resizeImage, 0, 0, newWidth, newHeight);
2049
+ resizedSource = resizeCanvas.toDataURL('image/jpeg');
2050
+ imageViewModel.source = this._domSanitizer.bypassSecurityTrustUrl(resizedSource);
2051
+ imageViewModel.originalSource = source;
2052
+ return [2 /*return*/];
2053
+ });
2054
+ }); };
2055
+ // @ts-ignore
2056
+ resizeImage.src = source;
2057
+ };
1997
2058
  ImageCarouselComponent.prototype._scrollCarouselToIndex = function () {
1998
2059
  if (this.currentIndex > -1 && this.currentIndex <= this.images.length) {
1999
2060
  var movePx = this.currentIndex * this.carousel.nativeElement.clientWidth;
@@ -2011,16 +2072,16 @@
2011
2072
  ImageCarouselComponent.decorators = [
2012
2073
  { type: i0.Component, args: [{
2013
2074
  selector: 'app-image-carousel',
2014
- template: "\n <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<!--\n <co-icon class=\"selector-type-icon refresh-button\" [iconData]=\"iconCache.getIcon(icons.Refresh)\" (click)=\"onForceRenderImage()\" [class.loading]=\"showLoader\" *ngIf=\"showRefresh\"></co-icon>\n-->\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 ",
2015
- 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{animation:spin 1s linear infinite}#product_page_carousel .refresh-button:hover{box-shadow:none;background:#74B77F;transition:all .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:all .2s ease;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}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"]
2075
+ template: "\n <div id=\"product_page_carousel\">\n <div id=\"product_page_carousel_items\">\n <co-loader [isShown]=\"true\" *ngIf=\"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=\"imageViewModels[0]\" class=\"carousel-item\" [id]=\"'slide-0'\" [class.active]=\"isCurrentIndex(0)\" (click)=\"handleShowImage(imageViewModels[0])\">\n <img [src]=\"imageViewModels[0].source\">\n </div>\n <div *ngFor=\"let imageViewModel of imageViewModels.slice(1); let index = index\" class=\"carousel-item\"\n [id]=\"'slide-' + (index + 1)\" [class.active]=\"isCurrentIndex((index + 1))\" (click)=\"handleShowImage(imageViewModel)\">\n <img [src]=\"imageViewModel.source\">\n </div>\n <div class=\"carousel-scroller-layer\" *ngIf=\"imageViewModels && imageViewModels.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 <!--\n <co-icon class=\"selector-type-icon refresh-button\" [iconData]=\"iconCache.getIcon(icons.Refresh)\" (click)=\"onForceRenderImage()\" [class.loading]=\"showLoader\" *ngIf=\"showRefresh\"></co-icon>\n -->\n </div>\n\n <div id=\"product_page_carousel_thumbs\">\n <co-scroll-container class=\"scroll-container\" *ngIf=\"imageViewModels && imageViewModels.length > 1\">\n <div *ngFor=\"let imageViewModel of imageViewModels; let index = index\" class=\"carousel-thumb\"\n [class.active]=\"index === currentIndex\">\n <img [src]=\"imageViewModel.source\" (click)=\"handleThumbClick(index)\"/>\n </div>\n </co-scroll-container>\n </div>\n </div>\n ",
2076
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
2077
+ 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{animation:spin 1s linear infinite}#product_page_carousel .refresh-button:hover{box-shadow:none;background:#74B77F;transition:all .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;cursor:zoom-in;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:all .2s ease;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}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"]
2016
2078
  },] }
2017
2079
  ];
2018
2080
  ImageCarouselComponent.ctorParameters = function () { return [
2019
2081
  { type: ProductConnectorService },
2020
2082
  { type: ProductEventService },
2021
2083
  { type: i0.ChangeDetectorRef },
2022
- { type: i1$1.DomSanitizer },
2023
- { type: IconCacheService }
2084
+ { type: i1$1.DomSanitizer }
2024
2085
  ]; };
2025
2086
  ImageCarouselComponent.propDecorators = {
2026
2087
  carousel: [{ type: i0.ViewChild, args: ['carousel', { read: i0.ElementRef },] }],
@@ -3376,6 +3437,7 @@
3376
3437
  this._scriptLoader = _scriptLoader;
3377
3438
  this._renderer = _renderer;
3378
3439
  this.variant = '';
3440
+ this.urlParams = [];
3379
3441
  this.configuratorFinished = new i0.EventEmitter();
3380
3442
  this.configurationError = new i0.EventEmitter();
3381
3443
  this.showClass = true;
@@ -3414,7 +3476,10 @@
3414
3476
  this.configurationError.emit(event.detail.status);
3415
3477
  };
3416
3478
  ProductHdComponent.prototype._prepareAttributes = function () {
3417
- if (this.hdeConfigurator && this.hdeConfigurator.nativeElement && this.token && (this.sku || this.variant)) {
3479
+ if (this.hdeConfigurator && this.hdeConfigurator.nativeElement && this.urlParams && this.token && (this.sku || this.variant)) {
3480
+ //for local testing please turn off for packing and publishing!
3481
+ //this.prepareTestingUrlparams();
3482
+ this._prepareConfiguratorUrls();
3418
3483
  this.hdeConfigurator.nativeElement.setAttribute('bearerToken', this.token);
3419
3484
  if (this._sku) {
3420
3485
  this.hdeConfigurator.nativeElement.setAttribute('data-productId', this._sku);
@@ -3425,34 +3490,54 @@
3425
3490
  this._loadTheScripts();
3426
3491
  }
3427
3492
  };
3428
- // load external scripts
3493
+ //set necessary references to configurator.
3494
+ ProductHdComponent.prototype._prepareConfiguratorUrls = function () {
3495
+ //fetch the setting from the external source
3496
+ var apiurl = this.urlParams.find(function (item) { return item.key === 'apiurl'; }).value;
3497
+ var productVariantCommandApiUrl = this.urlParams.find(function (item) { return item.key === 'productVariantCommandApiUrl'; }).value;
3498
+ var productVariantQueryApiUrl = this.urlParams.find(function (item) { return item.key === 'productVariantQueryApiUrl'; }).value;
3499
+ var localizationApiUrl = this.urlParams.find(function (item) { return item.key === 'localizationApiUrl'; }).value;
3500
+ //apply to configurator
3501
+ this.hdeConfigurator.nativeElement.setAttribute('apiurl', apiurl);
3502
+ this.hdeConfigurator.nativeElement.setAttribute('productVariantCommandApiUrl', productVariantCommandApiUrl);
3503
+ this.hdeConfigurator.nativeElement.setAttribute('productVariantQueryApiUrl', productVariantQueryApiUrl);
3504
+ this.hdeConfigurator.nativeElement.setAttribute('localizationApiUrl', localizationApiUrl);
3505
+ };
3506
+ // load external scripts into client
3429
3507
  ProductHdComponent.prototype._loadTheScripts = function () {
3430
3508
  return __awaiter(this, void 0, void 0, function () {
3431
- var scripts, i;
3509
+ var headerUrls, headerArray, i, styles, stylesArray, j;
3432
3510
  return __generator(this, function (_a) {
3433
3511
  switch (_a.label) {
3434
3512
  case 0:
3435
- scripts = [
3436
- // hard-coded for now, should come from the external source
3437
- 'https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/polyfills.js',
3438
- 'https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/runtime.js',
3439
- 'https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/main.js'
3440
- ];
3513
+ headerUrls = this.urlParams.find(function (item) { return item.key === 'header'; }).value;
3514
+ headerArray = headerUrls.replace(/\s+/g, '').split(',');
3441
3515
  i = 0;
3442
3516
  _a.label = 1;
3443
3517
  case 1:
3444
- if (!(i < scripts.length)) return [3 /*break*/, 4];
3445
- return [4 /*yield*/, this._scriptLoader.loadScript(scripts[i], this._renderer).catch(function (error) { return console.error(error); })];
3518
+ if (!(i < headerArray.length)) return [3 /*break*/, 4];
3519
+ return [4 /*yield*/, this._scriptLoader.loadScript(headerArray[i], this._renderer).catch(function (error) { return console.error(error); })];
3446
3520
  case 2:
3447
3521
  _a.sent();
3448
3522
  _a.label = 3;
3449
3523
  case 3:
3450
3524
  i++;
3451
3525
  return [3 /*break*/, 1];
3452
- case 4: return [4 /*yield*/, this._scriptLoader.addStyleSheet('https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/styles.css', this._renderer)];
3526
+ case 4:
3527
+ styles = this.urlParams.find(function (item) { return item.key === 'stylesheet'; }).value;
3528
+ stylesArray = styles.replace(/\s+/g, '').split(',');
3529
+ j = 0;
3530
+ _a.label = 5;
3453
3531
  case 5:
3532
+ if (!(j < stylesArray.length)) return [3 /*break*/, 8];
3533
+ return [4 /*yield*/, this._scriptLoader.addStyleSheet(stylesArray[j], this._renderer)];
3534
+ case 6:
3454
3535
  _a.sent();
3455
- return [2 /*return*/];
3536
+ _a.label = 7;
3537
+ case 7:
3538
+ j++;
3539
+ return [3 /*break*/, 5];
3540
+ case 8: return [2 /*return*/];
3456
3541
  }
3457
3542
  });
3458
3543
  });
@@ -3462,7 +3547,7 @@
3462
3547
  ProductHdComponent.decorators = [
3463
3548
  { type: i0.Component, args: [{
3464
3549
  selector: 'co-product-hd',
3465
- template: "\n <hde-configurator #hdeConfigurator\n apiurl=\"https://bmsproductconfigurator-acceptance.azurewebsites.net/api/configurator/\"\n productVariantCommandApiUrl=\"https://bmsproductvariantcommand-acceptance.azurewebsites.net/\"\n productVariantQueryApiUrl=\"https://bmsproductvariantquery-acceptance.azurewebsites.net/\"\n language=\"nl\"\n localizationApiUrl=\"https://hde-cdn.azureedge.net/libs/BMS.DST.Localization/\"\n localizationFileExtension=\".json\"\n (configurationFinished)=\"handleConfigurationFinished($event)\"\n (configurationFailed)=\"handleError($event)\"\n >\n <hde-progress-bar></hde-progress-bar>\n </hde-configurator>\n ",
3550
+ template: "\n <hde-configurator #hdeConfigurator\n language=\"nl\"\n localizationFileExtension=\".json\"\n (configurationFinished)=\"handleConfigurationFinished($event)\"\n (configurationFailed)=\"handleError($event)\"\n >\n <hde-progress-bar></hde-progress-bar>\n </hde-configurator>\n ",
3466
3551
  encapsulation: i0.ViewEncapsulation.None
3467
3552
  },] }
3468
3553
  ];
@@ -3475,6 +3560,7 @@
3475
3560
  sku: [{ type: i0.Input }],
3476
3561
  token: [{ type: i0.Input }],
3477
3562
  variant: [{ type: i0.Input }],
3563
+ urlParams: [{ type: i0.Input }],
3478
3564
  configuratorFinished: [{ type: i0.Output }],
3479
3565
  configurationError: [{ type: i0.Output }],
3480
3566
  showClass: [{ type: i0.HostBinding, args: ['class.co-product-hd',] }]
@@ -3519,6 +3605,7 @@
3519
3605
  this.externalSettings = {};
3520
3606
  this.token = ""; //= "eyJhbGciOiJSUzI1NiIsImtpZCI6IkYxOThERkVEOEUwQTQ1MzY3M0M1MUE2Rjk1QUVDQzU3RTM0NjM4RkRSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6IjhaamY3WTRLUlRaenhScHZsYTdNVi1OR09QMCJ9.eyJuYmYiOjE3MzIxOTkyOTUsImV4cCI6MTczMjIwMjg5NSwiaXNzIjoiaHR0cHM6Ly9ibXNpZGVudGl0eS1hY2NlcHRhbmNlLmF6dXJld2Vic2l0ZXMubmV0IiwiYXVkIjpbImNhdGFsb2dxdWVyeWFwaSIsImNvbmZpZ3VyYXRvcmFwaSIsInByb2R1Y3R2YXJpYW50Y29tbWFuZGFwaSIsInByb2R1Y3R2YXJpYW50cXVlcnlhcGkiXSwiY2xpZW50X2lkIjoiaW1wZXJzb25hdGlvbi5jbGllbnQiLCJzdWIiOiIwOTMwZDI4Mi05NGU4LTQ5MGEtOGI2NC1mYTk1YmIyYzE1ODIiLCJhdXRoX3RpbWUiOjE3MzIxOTkyOTUsImlkcCI6ImxvY2FsIiwiZW52aXJvbm1lbnQiOiJNU0wiLCJzZWxsZXIiOiJTRTAwMDA5NiIsInNlbGxlcmd1aWQiOiIxMDk1MWJjNS1hZmMzLTQ1MGEtNmVkMS0wOGQ4NDNlNmE5OTQiLCJwZXJtaXNzaW9uIjpbInNhbGVzLmV4cG9ydHRlbXBsYXRlcy5yZWFkIiwiZG9jdW1lbnRsaWJyYXJ5LnRhZy5yZWFkIiwiZG9jdW1lbnRsaWJyYXJ5LmRvY3VtZW50LnJlYWQiLCJkb2N1bWVudGxpYnJhcnkudGFnZ3JvdXAucmVhZCIsInNhbGVzLm9yZGVyLndyaXRlIiwic2FsZXMuY3VzdG9tZXIucmVhZCIsInNhbGVzLm9yZGVyLmRlbGl2ZXJ5YWRkcmVzcy53cml0ZSIsInNlcnZpY2UucmVxdWVzdC5yZWFkIiwiY2F0YWxvZy50YWcucmVhZCIsInNhbGVzLm9yZGVyLnJlYWQiLCJzYWxlcy5jdXN0b21lci53cml0ZSIsInJlcXVlc3Rmb3JxdW90ZS53cml0ZSIsInNhbGVzLm9yZGVyLmJvb2siLCJyZXF1ZXN0Zm9ycXVvdGUucmVhZCIsInNhbGVzLmxlYWQucmVhZCIsInB1cmNoYXNlLm9yZGVyLnJlYWQiLCJzYWxlcy5xdW90ZS5yZWFkIiwic2FsZXMucXVvdGUud3JpdGUiLCJjYXRhbG9nLml0ZW0ucmVhZCIsInNhbGVzLmxlYWQud3JpdGUiLCJzZXJ2aWNlLnJlcXVlc3Quc3VibWl0Iiwic2FsZXMub3JkZXIuZGVsaXZlcnlhZGRyZXNzLnJlYWQiLCJwdXJjaGFzZS5vcmRlci53cml0ZSIsInB1cmNoYXNlLm9yZGVyLnByaWNlcy53cml0ZSIsInB1cmNoYXNlLm9yZGVyLnByaWNlcy5yZWFkIiwic2VydmljZS5yZXF1ZXN0LndyaXRlIiwiY2F0YWxvZy5jYXRhbG9nLnJlYWQiLCJjYXRhbG9nLmNhdGFsb2cud3JpdGUiLCJjYXRhbG9nLmN1cnJlbmN5LnJlYWQiLCJjYXRhbG9nLmN1cnJlbmN5LndyaXRlIiwiY2F0YWxvZy5pdGVtLndyaXRlIiwiY2F0YWxvZy5sb2NhbGl6YXRpb24ucmVhZCIsImNhdGFsb2cubG9jYWxpemF0aW9uLndyaXRlIiwiY2F0YWxvZy5wcm9kdWN0LnJlYWQiLCJjYXRhbG9nLnByb2R1Y3Qud3JpdGUiLCJjYXRhbG9nLnByb2R1Y3RzZXR0aW5nLnJlYWQiLCJjYXRhbG9nLnByb2R1Y3RzZXR0aW5nLndyaXRlIiwiY2F0YWxvZy5zZWxsZXIucmVhZCIsImNhdGFsb2cuc2VsbGVyLndyaXRlIiwiY2F0YWxvZy50YWcud3JpdGUiLCJjYXRhbG9nLnVvbS5yZWFkIiwiY2F0YWxvZy51b20ud3JpdGUiLCJjYXRhbG9nLnZhdGNhdGVnb3J5LnJlYWQiLCJjYXRhbG9nLnZhdGNhdGVnb3J5LndyaXRlIiwiY2F0YWxvZy52ZW5kb3IucmVhZCIsImNhdGFsb2cudmVuZG9yLndyaXRlIiwicHVyY2hhc2Uuc2VsbGVyLnJlYWQiLCJwdXJjaGFzZS5zZWxsZXIud3JpdGUiLCJjYXRhbG9nLmFydGljbGUucmVhZCIsImNhdGFsb2cuYXJ0aWNsZS53cml0ZSIsInNhbGVzLnF1b3RlLmxpbmVzLnJlYWQiLCJzYWxlcy5xdW90ZS5saW5lcy53cml0ZSIsInNhbGVzLnNlbGxlci5yZWFkIiwic2FsZXMuc2VsbGVyLndyaXRlIiwiYWNjb3VudGluZy52ZW5kb3JpbnZvaWNlLnJlYWQiLCJpZGVudGl0eS51c2VyLnJlYWQiLCJpZGVudGl0eS51c2VyLndyaXRlIiwiaWRlbnRpdHkucm9sZS5yZWFkIiwic2VsbGVyLnByb2R1Y3RwcmljZS5zZXR0aW5ncy5yZWFkIiwic2VsbGVyLnByb2R1Y3RwcmljZS5zZXR0aW5ncy53cml0ZSIsImNvbmZpZ3VyYXRvci5wdXJjaGFzZXByaWNlLnJlYWQiLCJzdG9jay5mYWJyaWMucmVhZCJdLCJuYW1lIjoiUm9iaW4iLCJmYW1pbHlfbmFtZSI6ImRlIFdpbnRlciAoQ29saWpuLUlUKSIsInJvbGUiOlsic2VsbGVyIiwiZGVhbGVyX21hbmFnZXIiXSwiaWF0IjoxNzMyMTk5Mjk1LCJzY29wZSI6WyJjYXRhbG9ncXVlcnlhcGkiLCJjb25maWd1cmF0b3JhcGkiLCJwcm9kdWN0dmFyaWFudGNvbW1hbmRhcGkiLCJwcm9kdWN0dmFyaWFudHF1ZXJ5YXBpIl0sImFtciI6WyJpbXBlcnNvbmF0aW9uIl19.rbguVPnkXXDzsM6QKgXulhrF41jIjCuGDV13ig1GC8MewLCJ7wA038OSwT26sx2mCexjvuGYt45YScfPwfTkDy3ErPmHRods64X1dJWZnf-23NTP2iI32K_1vMZH5GOGbMzuFtbKAFQv4hgFAxoyWqFVWyJvuOtQcWyZStROyPHwjAnpnj-x1cVQpOhbO-kQUFvy_VUrPpF3aYVCcO2cFirQTXR6kxSGcYGGcsPY-_eiAd93UdG2EM6xLAocDLaFV72CQI6XEs0WQG1f4SqvH52v3OTkgWBLgYV35gpyIe0-2nazGL0R8pTNuDqrOb7OGmuTRMoTIiRi67-wTxx8cQ";
3521
3607
  this.variant = "";
3608
+ this.urlParams = [];
3522
3609
  this._subs = [];
3523
3610
  }
3524
3611
  Object.defineProperty(ProductExternalSourceComponent.prototype, "externalSource", {
@@ -3538,10 +3625,12 @@
3538
3625
  return this._externalCatalogStartupInfo;
3539
3626
  },
3540
3627
  set: function (value) {
3541
- this._externalCatalogStartupInfo = value;
3542
- this.externalSource = value.externalSource;
3543
- this.loaded = false;
3544
- this._prepareExternalSource();
3628
+ if (value) {
3629
+ this._externalCatalogStartupInfo = value;
3630
+ this.externalSource = value.externalSource;
3631
+ this.loaded = false;
3632
+ this._prepareExternalSource();
3633
+ }
3545
3634
  },
3546
3635
  enumerable: false,
3547
3636
  configurable: true
@@ -3633,6 +3722,7 @@
3633
3722
  this.token = this.externalCatalogStartupInfo.token;
3634
3723
  this.sku = this.externalCatalogStartupInfo.externalGoodId;
3635
3724
  this.variant = this.externalCatalogStartupInfo.flattenedGoodId;
3725
+ this.urlParams = this.externalCatalogStartupInfo.externalSource.parameters;
3636
3726
  this.switchToConfigurator();
3637
3727
  this.loaded = true;
3638
3728
  }
@@ -3663,7 +3753,7 @@
3663
3753
  ProductExternalSourceComponent.decorators = [
3664
3754
  { type: i0.Component, args: [{
3665
3755
  selector: 'co-product-external-source',
3666
- template: "\n <ng-container *ngIf=\"loaded\">\n <ng-container *ngIf=\"showProduct\">\n <app-product-page\n [sku]=\"sku\"\n [settings]=\"externalSettings\"\n [externalSource]=\"externalSource\"\n ></app-product-page>\n </ng-container>\n <ng-container *ngIf=\"showSource\">\n <iframe width=\"100%\" height=\"100%\" [src]=\"safeUrl\" frameborder=\"0\" allowfullscreen></iframe>\n </ng-container>\n <ng-container *ngIf=\"showConfigurator\">\n <co-product-hd width=\"100%\" height=\"100%\"\n [sku]=\"sku\"\n [variant]=\"variant\"\n [token]=\"token\"\n (configuratorFinished)=\"handleConfigurationFinished($event)\"></co-product-hd>\n </ng-container>\n </ng-container>\n ",
3756
+ template: "\n <ng-container *ngIf=\"loaded\">\n <ng-container *ngIf=\"showProduct\">\n <app-product-page\n [sku]=\"sku\"\n [settings]=\"externalSettings\"\n [externalSource]=\"externalSource\"\n ></app-product-page>\n </ng-container>\n <ng-container *ngIf=\"showSource\">\n <iframe width=\"100%\" height=\"100%\" [src]=\"safeUrl\" frameborder=\"0\" allowfullscreen></iframe>\n </ng-container>\n <ng-container *ngIf=\"showConfigurator\">\n <co-product-hd width=\"100%\" height=\"100%\"\n [sku]=\"sku\"\n [variant]=\"variant\"\n [token]=\"token\"\n [urlParams]=\"urlParams\"\n (configuratorFinished)=\"handleConfigurationFinished($event)\"></co-product-hd>\n </ng-container>\n </ng-container>\n ",
3667
3757
  providers: [
3668
3758
  ProductSettingsService,
3669
3759
  ProductConnectorAdapterService,