@veloceapps/sdk 8.0.0-98 → 9.0.0-0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. package/cms/README.md +0 -20
  2. package/cms/cms.actions.d.ts +13 -1
  3. package/cms/components/preview/preview.component.d.ts +2 -3
  4. package/cms/components/preview/preview.types.d.ts +4 -0
  5. package/cms/index.d.ts +1 -0
  6. package/cms/modules/runtime/services/runtime.service.d.ts +1 -1
  7. package/cms/services/index.d.ts +0 -1
  8. package/cms/services/resources.service.d.ts +2 -0
  9. package/cms/types/index.d.ts +0 -1
  10. package/cms/utils/element-metadata-worker.d.ts +11 -0
  11. package/cms/utils/elements-resolver.d.ts +0 -2
  12. package/cms/utils/index.d.ts +3 -0
  13. package/cms/utils/transpilation-worker.d.ts +13 -0
  14. package/cms/vendor-map.d.ts +23 -18
  15. package/core/README.md +20 -0
  16. package/core/modules/configuration/configuration.module.d.ts +2 -1
  17. package/core/modules/configuration/helpers.d.ts +2 -1
  18. package/core/modules/configuration/index.d.ts +1 -1
  19. package/core/modules/configuration/services/configuration-state.service.d.ts +54 -0
  20. package/core/modules/configuration/services/configuration.service.d.ts +6 -6
  21. package/core/modules/configuration/types/configuration.types.d.ts +4 -0
  22. package/core/modules/flow-configuration/flow-configuration.module.d.ts +2 -1
  23. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +5 -0
  24. package/core/services/context.service.d.ts +2 -0
  25. package/core/services/flow-info.service.d.ts +29 -0
  26. package/core/services/flow-state-configuration.service.d.ts +19 -0
  27. package/core/services/flow-state.service.d.ts +80 -0
  28. package/core/services/index.d.ts +4 -1
  29. package/core/services/quote-draft.service.d.ts +12 -28
  30. package/core/types/flow-customization.types.d.ts +22 -0
  31. package/core/types/flow-state.types.d.ts +11 -0
  32. package/core/types/index.d.ts +3 -1
  33. package/{cms → core}/types/integration.types.d.ts +1 -1
  34. package/core/utils/line-item.utils.d.ts +1 -3
  35. package/esm2020/cms/cms.actions.mjs +21 -1
  36. package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +3 -3
  37. package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +3 -3
  38. package/esm2020/cms/components/preview/preview.component.mjs +10 -10
  39. package/esm2020/cms/components/preview/preview.module.mjs +2 -2
  40. package/esm2020/cms/components/preview/preview.types.mjs +1 -1
  41. package/esm2020/cms/index.mjs +2 -1
  42. package/esm2020/cms/launcher.module.mjs +4 -4
  43. package/esm2020/cms/modules/migrations/migrations.mjs +2 -2
  44. package/esm2020/cms/modules/migrations/services/migrations.service.mjs +6 -2
  45. package/esm2020/cms/modules/runtime/services/compilation.service.mjs +11 -7
  46. package/esm2020/cms/modules/runtime/services/runtime.service.mjs +4 -4
  47. package/esm2020/cms/plugins/configuration.plugin.mjs +8 -4
  48. package/esm2020/cms/services/index.mjs +1 -2
  49. package/esm2020/cms/services/io-provider.service.mjs +10 -9
  50. package/esm2020/cms/services/resources.service.mjs +10 -6
  51. package/esm2020/cms/services/templates.service.mjs +10 -9
  52. package/esm2020/cms/types/index.mjs +1 -2
  53. package/esm2020/cms/utils/element-metadata-worker.mjs +31 -0
  54. package/esm2020/cms/utils/elements-resolver.mjs +13 -27
  55. package/esm2020/cms/utils/encoding.utils.mjs +3 -2
  56. package/esm2020/cms/utils/index.mjs +4 -1
  57. package/esm2020/cms/utils/path.utils.mjs +3 -3
  58. package/esm2020/cms/utils/script.utils.mjs +19 -15
  59. package/esm2020/cms/utils/transpilation-worker.mjs +52 -0
  60. package/esm2020/cms/vendor-map.mjs +12 -5
  61. package/esm2020/core/core.module.mjs +19 -3
  62. package/esm2020/core/modules/configuration/configuration.module.mjs +7 -23
  63. package/esm2020/core/modules/configuration/helpers.mjs +21 -1
  64. package/esm2020/core/modules/configuration/index.mjs +2 -2
  65. package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +335 -0
  66. package/esm2020/core/modules/configuration/services/configuration.service.mjs +56 -50
  67. package/esm2020/core/modules/configuration/types/configuration.types.mjs +1 -1
  68. package/esm2020/core/modules/flow-configuration/flow-configuration.module.mjs +6 -6
  69. package/esm2020/core/modules/flow-configuration/services/flow-configuration.service.mjs +12 -9
  70. package/esm2020/core/services/context.service.mjs +17 -5
  71. package/esm2020/core/services/flow-info.service.mjs +99 -0
  72. package/esm2020/core/services/flow-state-configuration.service.mjs +53 -0
  73. package/esm2020/core/services/flow-state.service.mjs +512 -0
  74. package/esm2020/core/services/index.mjs +5 -2
  75. package/esm2020/core/services/integration.state.mjs +36 -0
  76. package/esm2020/core/services/product-images.service.mjs +4 -5
  77. package/esm2020/core/services/quote-draft.service.mjs +39 -91
  78. package/esm2020/core/services/runtime-settings.service.mjs +7 -5
  79. package/esm2020/core/types/flow-customization.types.mjs +3 -0
  80. package/esm2020/core/types/flow-state.types.mjs +2 -0
  81. package/esm2020/core/types/index.mjs +4 -2
  82. package/esm2020/core/types/integration.types.mjs +2 -0
  83. package/esm2020/core/utils/line-item.utils.mjs +33 -32
  84. package/esm2020/src/components/doc-gen/doc-gen.component.mjs +52 -55
  85. package/esm2020/src/components/flow-header/flow-header.component.mjs +108 -0
  86. package/esm2020/src/components/flow-header/flow-header.module.mjs +19 -0
  87. package/esm2020/src/components/flow-header/index.mjs +2 -0
  88. package/esm2020/src/components/guided-selling/guided-selling.component.mjs +40 -48
  89. package/esm2020/src/configure-primeng.mjs +33 -0
  90. package/esm2020/src/flow-routing.module.mjs +5 -18
  91. package/esm2020/src/flow.component.mjs +22 -37
  92. package/esm2020/src/flow.module.mjs +7 -5
  93. package/esm2020/src/guards/context.guard.mjs +6 -11
  94. package/esm2020/src/guards/flow.guard.mjs +23 -9
  95. package/esm2020/src/pages/assets/assets.component.mjs +30 -34
  96. package/esm2020/src/pages/catalog/catalog.component.mjs +30 -34
  97. package/esm2020/src/pages/debug/debug.component.mjs +2 -2
  98. package/esm2020/src/pages/product/product.component.mjs +34 -20
  99. package/esm2020/src/pages/record-not-found/record-not-found.component.mjs +6 -3
  100. package/esm2020/src/pages/remote/remote.component.mjs +15 -14
  101. package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +31 -35
  102. package/esm2020/src/resolvers/flow.resolver.mjs +37 -55
  103. package/esm2020/src/resolvers/quote.resolver.mjs +55 -67
  104. package/esm2020/src/services/doc-gen.service.mjs +4 -3
  105. package/esm2020/src/services/flow-dialog.service.mjs +21 -6
  106. package/esm2020/src/services/flow-router.service.mjs +56 -15
  107. package/esm2020/src/services/flow.service.mjs +76 -48
  108. package/esm2020/src/services/guided-selling.service.mjs +5 -4
  109. package/esm2020/src/services/index.mjs +3 -1
  110. package/esm2020/src/types/index.mjs +1 -2
  111. package/fesm2015/veloceapps-sdk-cms.mjs +286 -192
  112. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  113. package/fesm2015/veloceapps-sdk-core.mjs +1195 -427
  114. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  115. package/fesm2015/veloceapps-sdk.mjs +801 -1455
  116. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  117. package/fesm2020/veloceapps-sdk-cms.mjs +291 -207
  118. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  119. package/fesm2020/veloceapps-sdk-core.mjs +1176 -454
  120. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  121. package/fesm2020/veloceapps-sdk.mjs +770 -1420
  122. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  123. package/package.json +8 -7
  124. package/src/components/doc-gen/doc-gen.component.d.ts +7 -10
  125. package/src/components/flow-header/flow-header.component.d.ts +25 -0
  126. package/src/components/flow-header/flow-header.module.d.ts +9 -0
  127. package/src/components/flow-header/index.d.ts +1 -0
  128. package/src/components/guided-selling/guided-selling.component.d.ts +6 -9
  129. package/src/configure-primeng.d.ts +1 -0
  130. package/src/flow-routing.module.d.ts +1 -2
  131. package/src/flow.component.d.ts +7 -12
  132. package/src/flow.module.d.ts +2 -2
  133. package/src/guards/context.guard.d.ts +0 -1
  134. package/src/guards/flow.guard.d.ts +1 -1
  135. package/src/pages/assets/assets.component.d.ts +5 -7
  136. package/src/pages/catalog/catalog.component.d.ts +5 -7
  137. package/src/pages/product/product.component.d.ts +8 -7
  138. package/src/pages/record-not-found/record-not-found.component.d.ts +2 -0
  139. package/src/pages/remote/remote.component.d.ts +2 -3
  140. package/src/pages/shopping-cart/shopping-cart.component.d.ts +5 -7
  141. package/src/resolvers/flow.resolver.d.ts +6 -9
  142. package/src/resolvers/quote.resolver.d.ts +7 -14
  143. package/src/services/doc-gen.service.d.ts +1 -1
  144. package/src/services/flow-dialog.service.d.ts +5 -2
  145. package/src/services/flow-router.service.d.ts +7 -3
  146. package/src/services/flow.service.d.ts +10 -12
  147. package/src/services/guided-selling.service.d.ts +1 -1
  148. package/src/services/index.d.ts +2 -0
  149. package/src/types/index.d.ts +0 -1
  150. package/core/modules/configuration/services/configuration.state.d.ts +0 -30
  151. package/core/services/metric-calculation/metric-calculation.service.d.ts +0 -25
  152. package/core/services/metric-calculation/metric-calculation.types.d.ts +0 -1
  153. package/core/services/metric-calculation/metric-calculation.utils.d.ts +0 -5
  154. package/esm2020/cms/services/integration.state.mjs +0 -37
  155. package/esm2020/cms/types/integration.types.mjs +0 -2
  156. package/esm2020/core/modules/configuration/services/configuration.state.mjs +0 -142
  157. package/esm2020/core/services/metric-calculation/metric-calculation.service.mjs +0 -85
  158. package/esm2020/core/services/metric-calculation/metric-calculation.types.mjs +0 -2
  159. package/esm2020/core/services/metric-calculation/metric-calculation.utils.mjs +0 -42
  160. package/esm2020/src/components/header/cart-overlay/cart-preview.component.mjs +0 -119
  161. package/esm2020/src/components/header/cart-overlay/cart-preview.module.mjs +0 -47
  162. package/esm2020/src/components/header/header.component.mjs +0 -355
  163. package/esm2020/src/components/header/header.module.mjs +0 -52
  164. package/esm2020/src/components/header/header.types.mjs +0 -2
  165. package/esm2020/src/components/header/metrics/index.mjs +0 -2
  166. package/esm2020/src/components/header/metrics/metrics.component.mjs +0 -255
  167. package/esm2020/src/components/header/metrics/metrics.definitions.mjs +0 -2
  168. package/esm2020/src/components/header/metrics/metrics.module.mjs +0 -69
  169. package/esm2020/src/pages/empty-account/empty-account.component.mjs +0 -12
  170. package/esm2020/src/pages/empty-account/empty-account.module.mjs +0 -20
  171. package/esm2020/src/types/flow-customization.types.mjs +0 -3
  172. package/src/components/header/cart-overlay/cart-preview.component.d.ts +0 -36
  173. package/src/components/header/cart-overlay/cart-preview.module.d.ts +0 -14
  174. package/src/components/header/header.component.d.ts +0 -70
  175. package/src/components/header/header.module.d.ts +0 -16
  176. package/src/components/header/header.types.d.ts +0 -20
  177. package/src/components/header/metrics/index.d.ts +0 -1
  178. package/src/components/header/metrics/metrics.component.d.ts +0 -67
  179. package/src/components/header/metrics/metrics.definitions.d.ts +0 -1
  180. package/src/components/header/metrics/metrics.module.d.ts +0 -18
  181. package/src/pages/empty-account/empty-account.component.d.ts +0 -5
  182. package/src/pages/empty-account/empty-account.module.d.ts +0 -10
  183. package/src/types/flow-customization.types.d.ts +0 -12
  184. /package/{cms → core}/services/integration.state.d.ts +0 -0
@@ -1,49 +1,33 @@
1
1
  import * as i4 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Component, ChangeDetectionStrategy, NgModule, InjectionToken, Injectable, Optional, Inject, ViewChild, Input, inject } from '@angular/core';
5
- import * as i2 from '@veloceapps/api';
4
+ import { Component, ChangeDetectionStrategy, NgModule, Optional, Inject, Injectable, inject } from '@angular/core';
5
+ import * as i1$1 from '@veloceapps/api';
6
6
  import { ApiModule } from '@veloceapps/api';
7
7
  import * as i2$1 from '@veloceapps/components';
8
- import { ToastType, LetDirectiveModule, QuantityControlModule, ErrorTooltipModule, HiddenTextTooltipModule, LoaderModule, EmptyStateModule } from '@veloceapps/components';
8
+ import { ToastType, LoaderModule, LetDirectiveModule } from '@veloceapps/components';
9
9
  import * as i5 from '@veloceapps/sdk/cms';
10
- import { FlowAction, extractElementMetadata, extendElementMetadata, PreviewModule, LauncherModule } from '@veloceapps/sdk/cms';
11
- import * as i1$2 from '@veloceapps/sdk/core';
12
- import { isLineItemModified, getOriginParent, SdkPipesModule, ContextService, QuoteDraftService, ConfigurationService, generateModifiedAssetsMap, SdkCoreModule } from '@veloceapps/sdk/core';
10
+ import { extractElementMetadata, extendElementMetadata, btoaSafe, PreviewModule, FlowAction, LauncherModule } from '@veloceapps/sdk/cms';
11
+ import * as i2 from '@veloceapps/sdk/core';
12
+ import { FLOW_CUSTOMIZATION, ContextService, FlowStateService, FlowInfoService, QuoteDraftService, ConfigurationService, IntegrationState, SdkCoreModule } from '@veloceapps/sdk/core';
13
13
  import * as i3 from 'primeng/button';
14
14
  import { ButtonModule } from 'primeng/button';
15
15
  import * as i1 from 'primeng/dynamicdialog';
16
- import { SalesforceIdUtils, UITemplateComponentType, UITemplateType, ConfigurationContextMode, UUID } from '@veloceapps/core';
17
- import { map, filter, shareReplay, startWith, distinctUntilChanged, BehaviorSubject, Subject, tap, takeUntil, switchMap, of, first, catchError, combineLatest, finalize, noop, forkJoin, from, throwError } from 'rxjs';
18
- import * as i1$1 from '@angular/router';
16
+ import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest, forkJoin, throwError } from 'rxjs';
17
+ import * as i1$2 from '@angular/router';
19
18
  import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
20
- import * as i7 from 'primeng/overlaypanel';
21
- import { OverlayPanel, OverlayPanelModule } from 'primeng/overlaypanel';
22
- import * as i13 from 'primeng/splitbutton';
23
- import { SplitButtonModule } from 'primeng/splitbutton';
24
- import * as i10$1 from 'primeng/tooltip';
25
- import { TooltipModule } from 'primeng/tooltip';
26
- import * as i5$1 from '@angular/forms';
27
- import { FormGroup, FormControl, ReactiveFormsModule, Validators, FormsModule } from '@angular/forms';
28
- import { InputNumberModule } from 'primeng/inputnumber';
29
- import * as i9 from 'primeng/virtualscroller';
30
- import { VirtualScrollerModule } from 'primeng/virtualscroller';
31
- import * as i8 from 'primeng/api';
32
- import * as i5$2 from '@angular/cdk/drag-drop';
33
- import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
34
- import { requiredValidator, invalidCharactersValidator, standardCharSetWithSpaceRegExp, reservedIdentifierValidator } from '@veloceapps/core/forms';
35
- import { cloneDeep, uniq } from 'lodash';
36
- import { withLatestFrom, tap as tap$1, takeUntil as takeUntil$1, map as map$1 } from 'rxjs/operators';
37
- import * as i9$1 from 'primeng/sidebar';
38
- import { SidebarModule } from 'primeng/sidebar';
39
- import * as i10 from 'primeng/inputtext';
40
- import { InputTextModule } from 'primeng/inputtext';
41
- import * as i11 from 'primeng/checkbox';
42
- import { CheckboxModule } from 'primeng/checkbox';
19
+ import { UITemplateType, SalesforceIdUtils, mapShoppingCartSettings, getMaxRenewalTermsValue, ConfigurationContextMode, isVeloceError, extractErrorDetails, UUID } from '@veloceapps/core';
43
20
  import { HttpErrorResponse, HttpParams } from '@angular/common/http';
21
+ import * as i5$1 from '@angular/forms';
22
+ import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
44
23
  import { DropdownModule } from 'primeng/dropdown';
24
+ import * as i8 from 'primeng/inputtext';
25
+ import { InputTextModule } from 'primeng/inputtext';
45
26
  import * as i6 from 'primeng/radiobutton';
46
27
  import { RadioButtonModule } from 'primeng/radiobutton';
28
+ import * as i2$2 from 'primeng/api';
29
+ import { catchError as catchError$1 } from 'rxjs/operators';
30
+ import { DomHandler } from 'primeng/dom';
47
31
 
48
32
  const VELOCE_FLOW_ROOT_ROUTE = 'VELOCE_FLOW_ROOT_ROUTE';
49
33
 
@@ -91,264 +75,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
91
75
  }]
92
76
  }] });
93
77
 
94
- const FLOW_CUSTOMIZATION = new InjectionToken('FLOW_CUSTOMIZATION');
95
-
96
- class FlowRouterService {
97
- constructor(router, route, contextService, integrationState) {
98
- this.router = router;
99
- this.route = route;
100
- this.contextService = contextService;
101
- this.integrationState = integrationState;
102
- this.urlHistory = [];
103
- this.getLastChildRoute = (route) => {
104
- return route.firstChild ? this.getLastChildRoute(route.firstChild) : route;
105
- };
106
- this.getNthChildRoute = (route, index) => {
107
- if (index <= 0) {
108
- return route;
109
- }
110
- return route.firstChild ? this.getNthChildRoute(route.firstChild, index - 1) : route;
111
- };
112
- this.getLastChildRouteSnapshot = (route) => {
113
- return route.firstChild ? this.getLastChildRouteSnapshot(route.firstChild) : route;
114
- };
115
- this.watchLastChildRoute$ = (route) => {
116
- return this.routeChange$.pipe(map(() => this.getLastChildRouteSnapshot(route.snapshot)));
117
- };
118
- this.getLastChildParams = (route) => {
119
- return route.firstChild ? this.getLastChildParams(route.firstChild) : route.params;
120
- };
121
- this.watchLastChildParams$ = (route) => {
122
- return this.routeChange$.pipe(map(() => this.getLastChildParams(route.snapshot)));
123
- };
124
- this.getFlowSubpath$ = () => {
125
- return this.route$.pipe(map(route => {
126
- const url = route.url.join('/');
127
- const flowRootUrl = this.getFlowRootPath(route);
128
- return url.replace(flowRootUrl, '');
129
- }));
130
- };
131
- this.routeChange$ = this.router.events.pipe(filter(e => e instanceof NavigationEnd), shareReplay());
132
- this.lastChildParams$ = this.watchLastChildParams$(this.route).pipe(startWith(this.getLastChildParams(this.route.snapshot)), shareReplay());
133
- this.lastChildRoute$ = this.watchLastChildRoute$(this.route).pipe(startWith(this.getLastChildRouteSnapshot(this.route.snapshot)), shareReplay());
134
- this.loading$ = this.router.events.pipe(filter(e => e instanceof NavigationStart ||
135
- e instanceof NavigationCancel ||
136
- e instanceof NavigationEnd ||
137
- e instanceof NavigationError), map(e => e instanceof NavigationStart), startWith(false), distinctUntilChanged());
138
- this.routeChange$.subscribe(() => {
139
- this.urlHistory.push(this.router.url);
140
- // Close Guided Selling when user navigates to another flow page
141
- this.integrationState.dispatch(FlowAction.CloseGuidedSelling({ keepState: true }));
142
- });
143
- }
144
- getFlowRootRoute(route) {
145
- var _a;
146
- const path = [...route.pathFromRoot];
147
- while (path.length) {
148
- const parent = path.pop();
149
- if (!parent) {
150
- break;
151
- }
152
- if (((_a = parent.routeConfig) === null || _a === void 0 ? void 0 : _a.id) === VELOCE_FLOW_ROOT_ROUTE) {
153
- return parent;
154
- }
155
- }
156
- return;
157
- }
158
- getFlowRootPath(route) {
159
- const rootRoute = this.getFlowRootRoute(route);
160
- if (!rootRoute) {
161
- return '';
162
- }
163
- const path = rootRoute.pathFromRoot
164
- .map(r => r.url[0])
165
- .filter(Boolean)
166
- .join('/');
167
- return '/' + path;
168
- }
169
- get route$() {
170
- return this.lastChildRoute$;
171
- }
172
- get params$() {
173
- return this.lastChildParams$;
174
- }
175
- isConfigurationRoute$() {
176
- return this.getFlowSubpath$().pipe(map(url => url.startsWith('product')));
177
- }
178
- isCartRoute$() {
179
- return this.getFlowSubpath$().pipe(map(url => url.startsWith('cart')));
180
- }
181
- isCatalogRoute$() {
182
- return this.getFlowSubpath$().pipe(map(url => url.startsWith('catalog')));
183
- }
184
- isAssetsRoute$() {
185
- return this.getFlowSubpath$().pipe(map(url => url.startsWith('assets')));
186
- }
187
- navigateBack() {
188
- const prevUrl = this.urlHistory[this.urlHistory.length - 2];
189
- if (prevUrl) {
190
- this.router.navigateByUrl(prevUrl);
191
- }
192
- }
193
- navigateToProductConfiguration(productId, lineItemId) {
194
- this.contextService.update({ properties: { productId, lineItemId } });
195
- const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
196
- const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
197
- this.router.navigate([flowRouteUrl, 'product'], {
198
- queryParams: Object.assign(Object.assign({}, routeSnapshot.queryParams), { productId }),
199
- });
200
- }
201
- navigateToShoppingCart() {
202
- const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
203
- const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
204
- this.router.navigate([flowRouteUrl, 'cart'], { queryParams: routeSnapshot.queryParams });
205
- }
206
- navigateToCatalog() {
207
- const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
208
- const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
209
- this.router.navigate([flowRouteUrl, 'catalog'], { queryParams: routeSnapshot.queryParams });
210
- }
211
- navigateToAssets() {
212
- const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
213
- const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
214
- this.router.navigate([flowRouteUrl, 'assets'], { queryParams: routeSnapshot.queryParams });
215
- }
216
- switchObject(id) {
217
- const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
218
- const route = this.getLastChildRoute(this.route);
219
- const objName = SalesforceIdUtils.getSfObjectNameById(id);
220
- const queryParams = {
221
- quoteId: objName === 'Quote' ? id : undefined,
222
- accountId: objName === 'Account' ? id : undefined,
223
- orderId: objName === 'Order' ? id : undefined,
224
- };
225
- this.router.navigate([], { relativeTo: route, queryParams: Object.assign(Object.assign({}, routeSnapshot.queryParams), queryParams) });
226
- }
227
- }
228
- FlowRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i1$2.ContextService }, { token: i5.IntegrationState }], target: i0.ɵɵFactoryTarget.Injectable });
229
- FlowRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, providedIn: 'root' });
230
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, decorators: [{
231
- type: Injectable,
232
- args: [{ providedIn: 'root' }]
233
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i1$2.ContextService }, { type: i5.IntegrationState }]; } });
234
-
235
- class FlowService {
236
- get flow() {
237
- return this.flowSubj$.value;
238
- }
239
- constructor(integrationState, flowRouterService, quoteDraftService, configurationService, flowConfigurationService, flowsApiService) {
240
- this.integrationState = integrationState;
241
- this.flowRouterService = flowRouterService;
242
- this.quoteDraftService = quoteDraftService;
243
- this.configurationService = configurationService;
244
- this.flowConfigurationService = flowConfigurationService;
245
- this.flowsApiService = flowsApiService;
246
- this.flowSubj$ = new BehaviorSubject(null);
247
- this.flow$ = this.flowSubj$.asObservable();
248
- this.cleanup$ = new Subject();
249
- }
250
- cleanup() {
251
- this.cleanup$.next();
252
- this.flowSubj$.next(null);
253
- }
254
- setFlow(flow) {
255
- this.flowSubj$.next(flow !== null && flow !== void 0 ? flow : null);
256
- }
257
- setFlowById$(flowId) {
258
- return this.flowsApiService.getFlow(flowId).pipe(tap(flow => this.flowSubj$.next(flow !== null && flow !== void 0 ? flow : null)), map(flow => Boolean(flow)));
259
- }
260
- initSubscriptions() {
261
- this.integrationState
262
- .listen$(FlowAction.FLOW_CONFIGURE_PRODUCT)
263
- .pipe(tap(payload => {
264
- var _a, _b;
265
- const productId = (_a = payload.productId) !== null && _a !== void 0 ? _a : (_b = this.quoteDraftService.currentState.find(li => li.id === payload.lineItemId)) === null || _b === void 0 ? void 0 : _b.productId;
266
- if (productId) {
267
- this.flowRouterService.navigateToProductConfiguration(productId, payload.lineItemId);
268
- }
269
- else {
270
- console.warn("Parameter 'productId' is needed to start configuration");
271
- }
272
- }), takeUntil(this.cleanup$))
273
- .subscribe();
274
- this.integrationState
275
- .listen$(FlowAction.FLOW_SWITCH_OBJECT)
276
- .pipe(tap(payload => {
277
- this.flowRouterService.switchObject(payload.id);
278
- }), takeUntil(this.cleanup$))
279
- .subscribe();
280
- this.integrationState
281
- .listen$(FlowAction.FLOW_NAVIGATE_BACK)
282
- .pipe(tap(() => this.flowRouterService.navigateBack()), takeUntil(this.cleanup$))
283
- .subscribe();
284
- this.integrationState
285
- .listen$(FlowAction.FLOW_NAVIGATE_TO_CATALOG)
286
- .pipe(tap(() => this.flowRouterService.navigateToCatalog()), takeUntil(this.cleanup$))
287
- .subscribe();
288
- this.integrationState
289
- .listen$(FlowAction.FLOW_NAVIGATE_TO_SHOPPING_CART)
290
- .pipe(tap(() => this.flowRouterService.navigateToShoppingCart()), takeUntil(this.cleanup$))
291
- .subscribe();
292
- this.integrationState
293
- .listen$(FlowAction.FLOW_APPLY_PRODUCT_CONFIGURATION)
294
- .pipe(switchMap(() => {
295
- const quoteDraft = this.quoteDraftService.quoteDraft;
296
- const lineItem = this.configurationService.getSnapshot();
297
- if (!quoteDraft || !lineItem) {
298
- return of(undefined);
299
- }
300
- const isNewLineItem = quoteDraft.currentState.every(li => li.id !== lineItem.id);
301
- const assetId = lineItem.assetId || lineItem.openOrderLineItemId;
302
- let updatedState;
303
- if (isNewLineItem) {
304
- updatedState = [...quoteDraft.currentState, lineItem];
305
- }
306
- else {
307
- updatedState = quoteDraft.currentState.map(li => (li.id === lineItem.id ? lineItem : li));
308
- }
309
- return this.flowConfigurationService.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState })).pipe(tap(() => {
310
- var _a;
311
- if (assetId) {
312
- const modifiedAssets = (_a = this.integrationState.state.modifiedAssets) !== null && _a !== void 0 ? _a : {};
313
- this.integrationState.patchState({
314
- modifiedAssets: Object.assign(Object.assign({}, modifiedAssets), { [assetId]: true }),
315
- });
316
- }
317
- }));
318
- }), tap(() => {
319
- this.configurationService.hasUnsavedChanges = false;
320
- this.flowRouterService.navigateToShoppingCart();
321
- }), takeUntil(this.cleanup$))
322
- .subscribe();
323
- this.updateFlowPath();
324
- }
325
- updateFlowPath() {
326
- this.flowRouterService
327
- .getFlowSubpath$()
328
- .pipe(map(path => { var _a; return (_a = path.split('/')) === null || _a === void 0 ? void 0 : _a[0]; }), takeUntil(this.cleanup$))
329
- .subscribe(flowPath => this.integrationState.patchState({ flowPath }));
330
- }
331
- }
332
- FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, deps: [{ token: i5.IntegrationState }, { token: FlowRouterService }, { token: i1$2.QuoteDraftService }, { token: i1$2.ConfigurationService }, { token: i1$2.FlowConfigurationService }, { token: i2.FlowsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
333
- FlowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService });
334
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, decorators: [{
335
- type: Injectable
336
- }], ctorParameters: function () { return [{ type: i5.IntegrationState }, { type: FlowRouterService }, { type: i1$2.QuoteDraftService }, { type: i1$2.ConfigurationService }, { type: i1$2.FlowConfigurationService }, { type: i2.FlowsApiService }]; } });
337
-
338
78
  class DocGenComponent {
339
- constructor(quoteDraftService, contextService, templatesApi, toastService, flowService, customizationService) {
340
- this.quoteDraftService = quoteDraftService;
341
- this.contextService = contextService;
79
+ constructor(templatesApi, contextService, flowStateService, flowInfo, toastService, customizationService) {
342
80
  this.templatesApi = templatesApi;
81
+ this.contextService = contextService;
82
+ this.flowStateService = flowStateService;
83
+ this.flowInfo = flowInfo;
343
84
  this.toastService = toastService;
344
- this.flowService = flowService;
345
85
  this.customizationService = customizationService;
346
86
  this.uiDefinition$ = new BehaviorSubject(null);
347
87
  this.templateApiName = '';
348
88
  this.destroy$ = new Subject();
349
- // initialize when quote draft requested
350
- this.quoteDraftService.quoteDraft$
351
- .pipe(first(), tap(() => this.initialize()), takeUntil(this.destroy$))
89
+ // wait until flow is initialized
90
+ this.flowStateService
91
+ .isInitialized$()
92
+ .pipe(filter(Boolean), first(), tap(() => this.initialize()), takeUntil(this.destroy$))
352
93
  .subscribe();
353
94
  }
354
95
  ngOnDestroy() {
@@ -356,8 +97,8 @@ class DocGenComponent {
356
97
  this.destroy$.complete();
357
98
  }
358
99
  initialize() {
359
- var _a, _b;
360
- this.templateApiName = (_b = (_a = this.flowService.flow) === null || _a === void 0 ? void 0 : _a.properties.templates.docGen) !== null && _b !== void 0 ? _b : '';
100
+ var _a, _b, _c;
101
+ this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.docGen) !== null && _c !== void 0 ? _c : '';
361
102
  this.generateUIDefinition$()
362
103
  .pipe(tap(uiDef => {
363
104
  if (!uiDef) {
@@ -372,78 +113,75 @@ class DocGenComponent {
372
113
  }), takeUntil(this.destroy$))
373
114
  .subscribe();
374
115
  }
375
- getTemplateRootComponent$(template) {
376
- return this.templatesApi
377
- .fetchComponents$(template.id)
378
- .pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
379
- }
380
- getLocalTemplateComponentMeta$() {
116
+ getLocalMeta$() {
381
117
  var _a, _b;
382
- if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponent)) {
118
+ if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
383
119
  return of(undefined);
384
120
  }
385
- return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponent(this.templateApiName).pipe(map(component => {
386
- if (!component) {
121
+ return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
122
+ if (!components) {
387
123
  return;
388
124
  }
389
- return {
125
+ return components.map(component => ({
390
126
  html: component.html,
391
127
  css: component.css,
392
128
  js: component.js,
393
129
  json: component.json,
394
- };
130
+ }));
395
131
  }));
396
132
  }
397
- getDocGenComponentMeta$() {
398
- return this.templatesApi.fetchTemplates$().pipe(map(templates => {
399
- const template = templates.find(template => template.type === UITemplateType.DOCGEN && template.name === this.templateApiName);
400
- return template !== null && template !== void 0 ? template : templates[0];
401
- }), switchMap(template => (template ? this.getTemplateRootComponent$(template) : of(undefined))), switchMap(component => component ? this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : of(undefined)));
133
+ getOrgMeta$() {
134
+ const template = this.flowInfo.templates.DOCGEN;
135
+ if (!template) {
136
+ return of(undefined);
137
+ }
138
+ return this.templatesApi.fetchComponentsAttachments$(template.id);
402
139
  }
403
140
  generateUIDefinition$() {
404
141
  return of(undefined).pipe(tap(() => {
405
142
  if (!this.templateApiName) {
406
- throw new Error("Flow Query parameter 'docGenTemplateApiName' is missing.");
143
+ throw new Error("Flow 'docGen' template is not defined.");
407
144
  }
408
- }), switchMap(() => this.getLocalTemplateComponentMeta$()), switchMap(meta => (meta ? of(meta) : this.getDocGenComponentMeta$())), map(meta => {
145
+ }), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
409
146
  var _a;
410
- if (!meta) {
147
+ if (!metaList) {
411
148
  return;
412
149
  }
413
150
  const headerId = (_a = this.contextService.resolve().properties.Id) !== null && _a !== void 0 ? _a : null;
414
- let script = meta.js;
415
- if (script) {
416
- const metadata = extractElementMetadata(script);
417
- script = extendElementMetadata(script, {
151
+ const patchedMetaList = metaList.map(component => {
152
+ if (!component.js) {
153
+ return component;
154
+ }
155
+ const metadata = extractElementMetadata(component.js);
156
+ const script = extendElementMetadata(component.js, {
418
157
  inputs: Object.assign(Object.assign({}, metadata.inputs), { Id: headerId ? `"${headerId}"` : null }),
419
158
  });
420
- }
159
+ return Object.assign(Object.assign({}, component), { js: script });
160
+ });
421
161
  const uiDef = {
422
162
  name: '',
423
163
  createdTimestamp: 0,
424
164
  primary: true,
425
165
  type: 'DEFAULT',
426
166
  version: 2,
427
- children: [
428
- {
429
- children: [],
430
- template: meta.html && btoa(meta.html),
431
- script: script && btoa(script),
432
- styles: meta.css && btoa(meta.css),
433
- },
434
- ],
167
+ children: patchedMetaList.map(child => ({
168
+ children: [],
169
+ template: child.html && btoaSafe(child.html),
170
+ script: child.js && btoaSafe(child.js),
171
+ styles: child.css && btoaSafe(child.css),
172
+ })),
435
173
  };
436
174
  return uiDef;
437
175
  }));
438
176
  }
439
177
  }
440
- DocGenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocGenComponent, deps: [{ token: i1$2.QuoteDraftService }, { token: i1$2.ContextService }, { token: i2.UITemplatesApiService }, { token: i2$1.ToastService }, { token: FlowService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
178
+ DocGenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocGenComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i2.ContextService }, { token: i2.FlowStateService }, { token: i2.FlowInfoService }, { token: i2$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
441
179
  DocGenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: DocGenComponent, selector: "vl-flow-doc-gen", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
442
180
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocGenComponent, decorators: [{
443
181
  type: Component,
444
182
  args: [{ selector: 'vl-flow-doc-gen', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
445
183
  }], ctorParameters: function () {
446
- return [{ type: i1$2.QuoteDraftService }, { type: i1$2.ContextService }, { type: i2.UITemplatesApiService }, { type: i2$1.ToastService }, { type: FlowService }, { type: undefined, decorators: [{
184
+ return [{ type: i1$1.UITemplatesApiService }, { type: i2.ContextService }, { type: i2.FlowStateService }, { type: i2.FlowInfoService }, { type: i2$1.ToastService }, { type: undefined, decorators: [{
447
185
  type: Optional
448
186
  }, {
449
187
  type: Inject,
@@ -466,18 +204,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
466
204
  }] });
467
205
 
468
206
  class GuidedSellingComponent {
469
- constructor(quoteDraftService, templatesApi, toastService, flowService, customizationService) {
470
- this.quoteDraftService = quoteDraftService;
207
+ constructor(templatesApi, flowStateService, flowInfo, toastService, customizationService) {
471
208
  this.templatesApi = templatesApi;
209
+ this.flowStateService = flowStateService;
210
+ this.flowInfo = flowInfo;
472
211
  this.toastService = toastService;
473
- this.flowService = flowService;
474
212
  this.customizationService = customizationService;
475
213
  this.uiDefinition$ = new BehaviorSubject(null);
476
214
  this.templateApiName = '';
477
215
  this.destroy$ = new Subject();
478
- // initialize when quote draft requested
479
- this.quoteDraftService.quoteDraft$
480
- .pipe(first(), tap(() => this.initialize()), takeUntil(this.destroy$))
216
+ // wait until flow is initialized
217
+ this.flowStateService
218
+ .isInitialized$()
219
+ .pipe(filter(Boolean), first(), tap(() => this.initialize()), takeUntil(this.destroy$))
481
220
  .subscribe();
482
221
  }
483
222
  ngOnDestroy() {
@@ -485,8 +224,8 @@ class GuidedSellingComponent {
485
224
  this.destroy$.complete();
486
225
  }
487
226
  initialize() {
488
- var _a, _b;
489
- this.templateApiName = (_b = (_a = this.flowService.flow) === null || _a === void 0 ? void 0 : _a.properties.templates.guidedSelling) !== null && _b !== void 0 ? _b : '';
227
+ var _a, _b, _c;
228
+ this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.guidedSelling) !== null && _c !== void 0 ? _c : '';
490
229
  this.generateUIDefinition$()
491
230
  .pipe(tap(uiDef => {
492
231
  if (!uiDef) {
@@ -501,41 +240,37 @@ class GuidedSellingComponent {
501
240
  }), takeUntil(this.destroy$))
502
241
  .subscribe();
503
242
  }
504
- getTemplateRootComponent$(template) {
505
- return this.templatesApi
506
- .fetchComponents$(template.id)
507
- .pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
508
- }
509
- getLocalTemplateComponentMeta$() {
243
+ getLocalMeta$() {
510
244
  var _a, _b;
511
- if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponent)) {
245
+ if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
512
246
  return of(undefined);
513
247
  }
514
- return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponent(this.templateApiName).pipe(map(component => {
515
- if (!component) {
248
+ return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
249
+ if (!components) {
516
250
  return;
517
251
  }
518
- return {
252
+ return components.map(component => ({
519
253
  html: component.html,
520
254
  css: component.css,
521
255
  js: component.js,
522
256
  json: component.json,
523
- };
257
+ }));
524
258
  }));
525
259
  }
526
- getGuidedSellingComponentMeta$() {
527
- return this.templatesApi.fetchTemplates$().pipe(map(templates => {
528
- const template = templates.find(template => template.type === UITemplateType.GUIDED_SELLING && template.name === this.templateApiName);
529
- return template !== null && template !== void 0 ? template : templates[0];
530
- }), switchMap(template => (template ? this.getTemplateRootComponent$(template) : of(undefined))), switchMap(component => component ? this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : of(undefined)));
260
+ getOrgMeta$() {
261
+ const template = this.flowInfo.templates.GUIDED_SELLING;
262
+ if (!template) {
263
+ return of(undefined);
264
+ }
265
+ return this.templatesApi.fetchComponentsAttachments$(template.id);
531
266
  }
532
267
  generateUIDefinition$() {
533
268
  return of(undefined).pipe(tap(() => {
534
269
  if (!this.templateApiName) {
535
- throw new Error("Flow Query parameter 'guidedSellingTemplateApiName' is missing.");
270
+ throw new Error("Flow 'guidedSelling' template is not defined.");
536
271
  }
537
- }), switchMap(() => this.getLocalTemplateComponentMeta$()), switchMap(meta => (meta ? of(meta) : this.getGuidedSellingComponentMeta$())), map(meta => {
538
- if (!meta) {
272
+ }), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
273
+ if (!metaList) {
539
274
  return;
540
275
  }
541
276
  const uiDef = {
@@ -544,26 +279,24 @@ class GuidedSellingComponent {
544
279
  primary: true,
545
280
  type: 'DEFAULT',
546
281
  version: 2,
547
- children: [
548
- {
549
- children: [],
550
- template: meta.html && btoa(meta.html),
551
- script: meta.js && btoa(meta.js),
552
- styles: meta.css && btoa(meta.css),
553
- },
554
- ],
282
+ children: metaList.map(meta => ({
283
+ children: [],
284
+ template: meta.html && btoaSafe(meta.html),
285
+ script: meta.js && btoaSafe(meta.js),
286
+ styles: meta.css && btoaSafe(meta.css),
287
+ })),
555
288
  };
556
289
  return uiDef;
557
290
  }));
558
291
  }
559
292
  }
560
- GuidedSellingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, deps: [{ token: i1$2.QuoteDraftService }, { token: i2.UITemplatesApiService }, { token: i2$1.ToastService }, { token: FlowService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
293
+ GuidedSellingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i2.FlowStateService }, { token: i2.FlowInfoService }, { token: i2$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
561
294
  GuidedSellingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: GuidedSellingComponent, selector: "vl-flow-guided-selling", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
562
295
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, decorators: [{
563
296
  type: Component,
564
297
  args: [{ selector: 'vl-flow-guided-selling', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
565
298
  }], ctorParameters: function () {
566
- return [{ type: i1$2.QuoteDraftService }, { type: i2.UITemplatesApiService }, { type: i2$1.ToastService }, { type: FlowService }, { type: undefined, decorators: [{
299
+ return [{ type: i1$1.UITemplatesApiService }, { type: i2.FlowStateService }, { type: i2.FlowInfoService }, { type: i2$1.ToastService }, { type: undefined, decorators: [{
567
300
  type: Optional
568
301
  }, {
569
302
  type: Inject,
@@ -585,150 +318,307 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
585
318
  }]
586
319
  }] });
587
320
 
588
- class CartPreviewComponent {
589
- constructor(flowConfiguration, routerService, productImagesService, quoteDraftService) {
590
- this.flowConfiguration = flowConfiguration;
591
- this.routerService = routerService;
592
- this.productImagesService = productImagesService;
593
- this.quoteDraftService = quoteDraftService;
594
- this.productRowHeight = 65;
595
- this.form = new FormGroup({});
596
- this.hasTermInProducts = false;
597
- this.scrollHeight = 0;
598
- this.shouldUpdate$ = new BehaviorSubject(true);
599
- this.destroyed$ = new Subject();
600
- this.lockedProductId$ = combineLatest([this.routerService.route$, this.routerService.isConfigurationRoute$()]).pipe(map(([route, isConfigurationRoute]) => {
601
- if (!isConfigurationRoute) {
602
- return null;
603
- }
604
- return route.queryParams['productId'];
605
- }));
606
- this.isEditMode$ = this.quoteDraftService.isEditMode$();
607
- }
608
- ngOnChanges(changes) {
609
- const { products } = changes;
610
- if (products) {
611
- this.shouldUpdate$.next(true);
612
- this.scrollHeight = Math.min(this.products.length * this.productRowHeight, 460);
613
- }
614
- }
615
- ngAfterViewInit() {
616
- combineLatest([this.lockedProductId$, this.isEditMode$, this.shouldUpdate$, this.overlayPanel.onShow])
617
- .pipe(filter(() => this.overlayPanel.overlayVisible), takeUntil(this.destroyed$))
618
- .subscribe(([lockedProductId, isEditMode]) => this.updateControls(this.products, isEditMode, lockedProductId));
321
+ class FlowHeaderComponent {
322
+ constructor(templatesApi, flowStateService, flowInfo, toastService, customizationService) {
323
+ this.templatesApi = templatesApi;
324
+ this.flowStateService = flowStateService;
325
+ this.flowInfo = flowInfo;
326
+ this.toastService = toastService;
327
+ this.customizationService = customizationService;
328
+ this.uiDefinition$ = new BehaviorSubject(null);
329
+ this.templateApiName = '';
330
+ this.destroy$ = new Subject();
331
+ // wait until flow is initialized
332
+ this.flowStateService
333
+ .isInitialized$()
334
+ .pipe(filter(Boolean), first(), tap(() => this.initialize()), takeUntil(this.destroy$))
335
+ .subscribe();
619
336
  }
620
337
  ngOnDestroy() {
621
- this.destroyed$.next();
622
- this.destroyed$.complete();
623
- }
624
- getImageUrl(productId) {
625
- return this.productImagesService.getImageUrl$(productId);
626
- }
627
- navigateToProductConfiguration(productId, lineItemId) {
628
- this.overlayPanel.hide();
629
- this.routerService.navigateToProductConfiguration(productId, lineItemId);
338
+ this.destroy$.next();
339
+ this.destroy$.complete();
630
340
  }
631
- controlBlurHandler(product) {
632
- const control = this.form.get(product.id);
633
- if (!control || control.invalid) {
634
- return;
635
- }
636
- this.flowConfiguration.update([
637
- {
638
- dataType: 'LINEITEM',
639
- attributeType: 'QTY',
640
- id: product.id,
641
- newValue: control.value,
642
- },
643
- ]);
644
- }
645
- deleteHandler(product) {
646
- this.flowConfiguration.delete([product.id]);
647
- }
648
- deleteAllHandler() {
649
- const productIds = this.products.map(product => product.id);
650
- this.flowConfiguration.delete(productIds);
651
- }
652
- updateControls(products, isEditMode, lockedProductId) {
653
- const ids = [];
654
- products.forEach(item => {
655
- if (!item.id) {
656
- return;
657
- }
658
- ids.push(item.id);
659
- let control = this.form.get(item.id);
660
- if (!control) {
661
- control = new FormControl(item.qty, []);
662
- this.form.addControl(item.id, control);
341
+ initialize() {
342
+ var _a, _b, _c;
343
+ this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.flowHeader) !== null && _c !== void 0 ? _c : '';
344
+ this.generateUIDefinition$()
345
+ .pipe(tap(uiDef => {
346
+ if (!uiDef) {
347
+ throw new Error(`Component with name '${this.templateApiName}' not found.`);
663
348
  }
664
- else {
665
- control.setValue(item.qty);
349
+ this.uiDefinition$.next(uiDef);
350
+ }), catchError(err => {
351
+ var _a;
352
+ const message = 'Failed to resolve Flow Header component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
353
+ this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
354
+ return of();
355
+ }), takeUntil(this.destroy$))
356
+ .subscribe();
357
+ }
358
+ getLocalMeta$() {
359
+ var _a, _b;
360
+ if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
361
+ return of(undefined);
362
+ }
363
+ return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
364
+ if (!components) {
365
+ return;
666
366
  }
667
- if (!isEditMode || item.deleted || item.productId === lockedProductId) {
668
- control.disable();
367
+ return components.map(component => ({
368
+ html: component.html,
369
+ css: component.css,
370
+ js: component.js,
371
+ json: component.json,
372
+ }));
373
+ }));
374
+ }
375
+ getOrgMeta$() {
376
+ const template = this.flowInfo.templates.FLOW_HEADER;
377
+ if (!template) {
378
+ return of(undefined);
379
+ }
380
+ return this.templatesApi.fetchComponentsAttachments$(template.id);
381
+ }
382
+ generateUIDefinition$() {
383
+ return of(undefined).pipe(tap(() => {
384
+ if (!this.templateApiName) {
385
+ throw new Error("Flow 'flowHeader' template is not defined.");
669
386
  }
670
- else {
671
- control.enable();
387
+ }), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
388
+ if (!metaList) {
389
+ return;
672
390
  }
673
- });
674
- const removedIds = Object.keys(this.form.controls).filter(id => !ids.includes(id));
675
- removedIds.forEach(id => this.form.removeControl(id));
676
- this.hasTermInProducts = products.some((item) => item.hasTerm);
391
+ const uiDef = {
392
+ name: '',
393
+ createdTimestamp: 0,
394
+ primary: true,
395
+ type: 'DEFAULT',
396
+ version: 2,
397
+ children: metaList.map(meta => ({
398
+ children: [],
399
+ template: meta.html && btoaSafe(meta.html),
400
+ script: meta.js && btoaSafe(meta.js),
401
+ styles: meta.css && btoaSafe(meta.css),
402
+ })),
403
+ };
404
+ return uiDef;
405
+ }));
677
406
  }
678
407
  }
679
- CartPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CartPreviewComponent, deps: [{ token: i1$2.FlowConfigurationService }, { token: FlowRouterService }, { token: i1$2.ProductImagesService }, { token: i1$2.QuoteDraftService }], target: i0.ɵɵFactoryTarget.Component });
680
- CartPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CartPreviewComponent, selector: "vl-cart-preview", inputs: { products: "products" }, viewQueries: [{ propertyName: "overlayPanel", first: true, predicate: OverlayPanel, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<p-overlayPanel\n styleClass=\"catalog-overlay flow-header-overlay center no-padding\"\n showTransitionOptions=\"0ms\"\n hideTransitionOptions=\"0ms\"\n>\n <ng-template pTemplate>\n <div class=\"flow-header-overlay__wrapper\" *vlLet=\"lockedProductId$ | async as lockedProductId\">\n <ng-container *vlLet=\"isEditMode$ | async as isEditMode\">\n <ng-container *ngIf=\"products.length > 0; else empty\">\n <h2 class=\"flow-header-overlay__title\">\n <span>Products ({{ products.length }})</span>\n <i class=\"vl-icon vl-cross close-icon\" (click)=\"overlayPanel.hide()\"></i>\n </h2>\n\n <p-virtualScroller [value]=\"products\" scrollHeight=\"{{ scrollHeight }}px\" [itemSize]=\"productRowHeight\">\n <ng-template pTemplate=\"item\" let-product>\n <div\n class=\"product item\"\n *vlLet=\"!isEditMode || product.deleted as isReadonlyProduct\"\n [class.readonly]=\"isReadonlyProduct\"\n [class.deleted]=\"product.deleted\"\n >\n <ng-container *vlLet=\"lockedProductId === product.productId as isLockedProduct\">\n <div class=\"product__info\">\n <div class=\"product__image-wrapper\">\n <div\n *ngIf=\"getImageUrl(product.productId) | async as imageUrl; else noImage\"\n class=\"product__image\"\n [ngStyle]=\"{ 'background-image': 'url(' + imageUrl + ')' }\"\n ></div>\n </div>\n <div class=\"flex flex-column justify-content-center\">\n <div class=\"word-break product-name\" [class.line-through]=\"product.deleted\">\n {{ product.name }}\n </div>\n <div class=\"actions\" *ngIf=\"!isReadonlyProduct\">\n <p-button\n label=\"Configure\"\n [disabled]=\"isLockedProduct || !product.configurable || product.hasTerm\"\n styleClass=\"p-button-link p-button-sm\"\n (onClick)=\"navigateToProductConfiguration(product.productId, product.id)\"\n ></p-button>\n <p-button\n label=\"Delete\"\n [disabled]=\"isLockedProduct || product.hasTerm\"\n styleClass=\"p-button-link p-button-sm p-button-secondary\"\n (onClick)=\"deleteHandler(product)\"\n ></p-button>\n </div>\n </div>\n </div>\n\n <ng-container *ngIf=\"form.get(product.id) as control\">\n <div class=\"qty\" *ngIf=\"!isReadonlyProduct; else readonlyQty\">\n <vl-quantity-control\n [formControl]=\"$any(control)\"\n (valueChange)=\"controlBlurHandler(product)\"\n ></vl-quantity-control>\n </div>\n <ng-template #readonlyQty\n ><span class=\"text-right\">{{ control.value }}</span></ng-template\n >\n </ng-container>\n </ng-container>\n </div>\n </ng-template>\n </p-virtualScroller>\n\n <ng-template #noImage>\n <i class=\"vl-icon vl-no-image no-image-icon\"></i>\n </ng-template>\n\n <div class=\"flex footer\">\n <p-button\n label=\"Clear Cart\"\n styleClass=\"p-button-link p-button-sm pl-0 pr-0\"\n [disabled]=\"!isEditMode || !!lockedProductId || hasTermInProducts\"\n (onClick)=\"deleteAllHandler()\"\n ></p-button>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-template #empty>\n <h2 class=\"flow-header-overlay__title\">\n <span>Empty Cart</span>\n <i class=\"vl-icon vl-cross close-icon\" (click)=\"overlayPanel.hide()\"></i>\n </h2>\n\n <span class=\"empty-state\">\n <i class=\"vl-icon vl-bag\"></i>\n There are no products added to the Shopping Cart yet.\n </span>\n </ng-template>\n </div>\n </ng-template>\n</p-overlayPanel>\n", styles: ["p-virtualscroller ::ng-deep .p-virtualscroller-header{background:none;padding:0;border:none;font-weight:unset}.flow-header-overlay *{font-family:var(--cg-font-family)}.flow-header-overlay__wrapper{display:flex;flex-direction:column;width:460px;max-height:600px}.flow-header-overlay__wrapper .close-icon{cursor:pointer}.flow-header-overlay__title{display:flex;justify-content:space-between;align-items:center;margin:0 0 8px;font-size:16px;font-style:normal;font-weight:500;line-height:20px}.empty-state{background:var(--cg-bg-color);padding:16px;display:flex;gap:8px;justify-content:center;font-size:12px;font-weight:300;line-height:16px;letter-spacing:.3px}.product{display:grid;grid-template-columns:auto 100px;padding:8px 0;border-bottom:1px solid var(--cg-border-color)}.product.readonly{align-items:center}.product.deleted{opacity:.5}.product.item{height:65px;overflow:hidden}.product__info{display:flex;gap:16px}.product__image-wrapper{flex-shrink:0;height:48px;width:48px;display:flex;justify-content:center;align-items:center;background:var(--cg-bg-color-hover);border-radius:4px}.product__image{background-size:contain;background-repeat:no-repeat;background-position:center;height:calc(100% - 12px);width:calc(100% - 12px)}.product .product-name{margin-bottom:4px;font-size:14px;font-weight:500;line-height:20px}.product .actions{display:flex;gap:16px}.footer{padding-top:8px}.word-break{word-break:break-word}.no-image-icon{height:24px;width:24px}.qty{display:flex;align-items:center}.flow-header-overlay__wrapper ::ng-deep .p-button-link{padding:0;font-size:12px;font-weight:400;line-height:18px;letter-spacing:.3px;color:var(--cg-primary-color)}.flow-header-overlay__wrapper ::ng-deep .p-button-link:hover:enabled{color:var(--cg-text-color-secondary)}.flow-header-overlay__wrapper ::ng-deep .p-button-link:hover:enabled .p-button-label{text-decoration:none}.flow-header-overlay__wrapper ::ng-deep .p-button-link.p-button-secondary{color:var(--cg-text-color-secondary)}.flow-header-overlay__wrapper ::ng-deep .p-button-link.p-button-secondary:hover:enabled{color:var(--cg-primary-color)}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i7.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i8.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i2$1.LetDirective, selector: "[vlLet]", inputs: ["vlLet"] }, { kind: "component", type: i9.VirtualScroller, selector: "p-virtualScroller", inputs: ["value", "itemSize", "style", "styleClass", "scrollHeight", "lazy", "rows", "minBufferPx", "maxBufferPx", "delay", "trackBy", "totalRecords", "first", "cache"], outputs: ["onLazyLoad"] }, { kind: "component", type: i2$1.QuantityControlComponent, selector: "vl-quantity-control", outputs: ["valueChange"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
681
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CartPreviewComponent, decorators: [{
408
+ FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i2.FlowStateService }, { token: i2.FlowInfoService }, { token: i2$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
409
+ FlowHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowHeaderComponent, selector: "vl-flow-new-header", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
410
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, decorators: [{
682
411
  type: Component,
683
- args: [{ selector: 'vl-cart-preview', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-overlayPanel\n styleClass=\"catalog-overlay flow-header-overlay center no-padding\"\n showTransitionOptions=\"0ms\"\n hideTransitionOptions=\"0ms\"\n>\n <ng-template pTemplate>\n <div class=\"flow-header-overlay__wrapper\" *vlLet=\"lockedProductId$ | async as lockedProductId\">\n <ng-container *vlLet=\"isEditMode$ | async as isEditMode\">\n <ng-container *ngIf=\"products.length > 0; else empty\">\n <h2 class=\"flow-header-overlay__title\">\n <span>Products ({{ products.length }})</span>\n <i class=\"vl-icon vl-cross close-icon\" (click)=\"overlayPanel.hide()\"></i>\n </h2>\n\n <p-virtualScroller [value]=\"products\" scrollHeight=\"{{ scrollHeight }}px\" [itemSize]=\"productRowHeight\">\n <ng-template pTemplate=\"item\" let-product>\n <div\n class=\"product item\"\n *vlLet=\"!isEditMode || product.deleted as isReadonlyProduct\"\n [class.readonly]=\"isReadonlyProduct\"\n [class.deleted]=\"product.deleted\"\n >\n <ng-container *vlLet=\"lockedProductId === product.productId as isLockedProduct\">\n <div class=\"product__info\">\n <div class=\"product__image-wrapper\">\n <div\n *ngIf=\"getImageUrl(product.productId) | async as imageUrl; else noImage\"\n class=\"product__image\"\n [ngStyle]=\"{ 'background-image': 'url(' + imageUrl + ')' }\"\n ></div>\n </div>\n <div class=\"flex flex-column justify-content-center\">\n <div class=\"word-break product-name\" [class.line-through]=\"product.deleted\">\n {{ product.name }}\n </div>\n <div class=\"actions\" *ngIf=\"!isReadonlyProduct\">\n <p-button\n label=\"Configure\"\n [disabled]=\"isLockedProduct || !product.configurable || product.hasTerm\"\n styleClass=\"p-button-link p-button-sm\"\n (onClick)=\"navigateToProductConfiguration(product.productId, product.id)\"\n ></p-button>\n <p-button\n label=\"Delete\"\n [disabled]=\"isLockedProduct || product.hasTerm\"\n styleClass=\"p-button-link p-button-sm p-button-secondary\"\n (onClick)=\"deleteHandler(product)\"\n ></p-button>\n </div>\n </div>\n </div>\n\n <ng-container *ngIf=\"form.get(product.id) as control\">\n <div class=\"qty\" *ngIf=\"!isReadonlyProduct; else readonlyQty\">\n <vl-quantity-control\n [formControl]=\"$any(control)\"\n (valueChange)=\"controlBlurHandler(product)\"\n ></vl-quantity-control>\n </div>\n <ng-template #readonlyQty\n ><span class=\"text-right\">{{ control.value }}</span></ng-template\n >\n </ng-container>\n </ng-container>\n </div>\n </ng-template>\n </p-virtualScroller>\n\n <ng-template #noImage>\n <i class=\"vl-icon vl-no-image no-image-icon\"></i>\n </ng-template>\n\n <div class=\"flex footer\">\n <p-button\n label=\"Clear Cart\"\n styleClass=\"p-button-link p-button-sm pl-0 pr-0\"\n [disabled]=\"!isEditMode || !!lockedProductId || hasTermInProducts\"\n (onClick)=\"deleteAllHandler()\"\n ></p-button>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-template #empty>\n <h2 class=\"flow-header-overlay__title\">\n <span>Empty Cart</span>\n <i class=\"vl-icon vl-cross close-icon\" (click)=\"overlayPanel.hide()\"></i>\n </h2>\n\n <span class=\"empty-state\">\n <i class=\"vl-icon vl-bag\"></i>\n There are no products added to the Shopping Cart yet.\n </span>\n </ng-template>\n </div>\n </ng-template>\n</p-overlayPanel>\n", styles: ["p-virtualscroller ::ng-deep .p-virtualscroller-header{background:none;padding:0;border:none;font-weight:unset}.flow-header-overlay *{font-family:var(--cg-font-family)}.flow-header-overlay__wrapper{display:flex;flex-direction:column;width:460px;max-height:600px}.flow-header-overlay__wrapper .close-icon{cursor:pointer}.flow-header-overlay__title{display:flex;justify-content:space-between;align-items:center;margin:0 0 8px;font-size:16px;font-style:normal;font-weight:500;line-height:20px}.empty-state{background:var(--cg-bg-color);padding:16px;display:flex;gap:8px;justify-content:center;font-size:12px;font-weight:300;line-height:16px;letter-spacing:.3px}.product{display:grid;grid-template-columns:auto 100px;padding:8px 0;border-bottom:1px solid var(--cg-border-color)}.product.readonly{align-items:center}.product.deleted{opacity:.5}.product.item{height:65px;overflow:hidden}.product__info{display:flex;gap:16px}.product__image-wrapper{flex-shrink:0;height:48px;width:48px;display:flex;justify-content:center;align-items:center;background:var(--cg-bg-color-hover);border-radius:4px}.product__image{background-size:contain;background-repeat:no-repeat;background-position:center;height:calc(100% - 12px);width:calc(100% - 12px)}.product .product-name{margin-bottom:4px;font-size:14px;font-weight:500;line-height:20px}.product .actions{display:flex;gap:16px}.footer{padding-top:8px}.word-break{word-break:break-word}.no-image-icon{height:24px;width:24px}.qty{display:flex;align-items:center}.flow-header-overlay__wrapper ::ng-deep .p-button-link{padding:0;font-size:12px;font-weight:400;line-height:18px;letter-spacing:.3px;color:var(--cg-primary-color)}.flow-header-overlay__wrapper ::ng-deep .p-button-link:hover:enabled{color:var(--cg-text-color-secondary)}.flow-header-overlay__wrapper ::ng-deep .p-button-link:hover:enabled .p-button-label{text-decoration:none}.flow-header-overlay__wrapper ::ng-deep .p-button-link.p-button-secondary{color:var(--cg-text-color-secondary)}.flow-header-overlay__wrapper ::ng-deep .p-button-link.p-button-secondary:hover:enabled{color:var(--cg-primary-color)}\n"] }]
684
- }], ctorParameters: function () { return [{ type: i1$2.FlowConfigurationService }, { type: FlowRouterService }, { type: i1$2.ProductImagesService }, { type: i1$2.QuoteDraftService }]; }, propDecorators: { overlayPanel: [{
685
- type: ViewChild,
686
- args: [OverlayPanel]
687
- }], products: [{
688
- type: Input
689
- }] } });
412
+ args: [{ selector: 'vl-flow-new-header', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
413
+ }], ctorParameters: function () {
414
+ return [{ type: i1$1.UITemplatesApiService }, { type: i2.FlowStateService }, { type: i2.FlowInfoService }, { type: i2$1.ToastService }, { type: undefined, decorators: [{
415
+ type: Optional
416
+ }, {
417
+ type: Inject,
418
+ args: [FLOW_CUSTOMIZATION]
419
+ }] }];
420
+ } });
690
421
 
691
- class CartPreviewModule {
422
+ class FlowNewHeaderModule {
692
423
  }
693
- CartPreviewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CartPreviewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
694
- CartPreviewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: CartPreviewModule, declarations: [CartPreviewComponent], imports: [CommonModule,
695
- ReactiveFormsModule,
696
- ButtonModule,
697
- OverlayPanelModule,
698
- LetDirectiveModule,
699
- InputNumberModule,
700
- VirtualScrollerModule,
701
- QuantityControlModule], exports: [CartPreviewComponent] });
702
- CartPreviewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CartPreviewModule, imports: [CommonModule,
703
- ReactiveFormsModule,
704
- ButtonModule,
705
- OverlayPanelModule,
706
- LetDirectiveModule,
707
- InputNumberModule,
708
- VirtualScrollerModule,
709
- QuantityControlModule] });
710
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CartPreviewModule, decorators: [{
424
+ FlowNewHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowNewHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
425
+ FlowNewHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowNewHeaderModule, declarations: [FlowHeaderComponent], imports: [CommonModule, PreviewModule], exports: [FlowHeaderComponent] });
426
+ FlowNewHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowNewHeaderModule, imports: [CommonModule, PreviewModule] });
427
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowNewHeaderModule, decorators: [{
711
428
  type: NgModule,
712
429
  args: [{
713
- declarations: [CartPreviewComponent],
714
- imports: [
715
- CommonModule,
716
- ReactiveFormsModule,
717
- ButtonModule,
718
- OverlayPanelModule,
719
- LetDirectiveModule,
720
- InputNumberModule,
721
- VirtualScrollerModule,
722
- QuantityControlModule,
723
- ],
724
- exports: [CartPreviewComponent],
430
+ declarations: [FlowHeaderComponent],
431
+ imports: [CommonModule, PreviewModule],
432
+ exports: [FlowHeaderComponent],
725
433
  }]
726
434
  }] });
727
435
 
436
+ class FlowRouterService {
437
+ constructor(router, route, contextService, integrationState, flowInfoService, flowStateService) {
438
+ this.router = router;
439
+ this.route = route;
440
+ this.contextService = contextService;
441
+ this.integrationState = integrationState;
442
+ this.flowInfoService = flowInfoService;
443
+ this.flowStateService = flowStateService;
444
+ this.urlHistory = [];
445
+ this.getLastChildRoute = (route) => {
446
+ return route.firstChild ? this.getLastChildRoute(route.firstChild) : route;
447
+ };
448
+ this.getNthChildRoute = (route, index) => {
449
+ if (index <= 0) {
450
+ return route;
451
+ }
452
+ return route.firstChild ? this.getNthChildRoute(route.firstChild, index - 1) : route;
453
+ };
454
+ this.getLastChildRouteSnapshot = (route) => {
455
+ return route.firstChild ? this.getLastChildRouteSnapshot(route.firstChild) : route;
456
+ };
457
+ this.watchLastChildRoute$ = (route) => {
458
+ return this.routeChange$.pipe(map(() => this.getLastChildRouteSnapshot(route.snapshot)));
459
+ };
460
+ this.getLastChildParams = (route) => {
461
+ return route.firstChild ? this.getLastChildParams(route.firstChild) : route.params;
462
+ };
463
+ this.watchLastChildParams$ = (route) => {
464
+ return this.routeChange$.pipe(map(() => this.getLastChildParams(route.snapshot)));
465
+ };
466
+ this.getFlowSubpath$ = () => {
467
+ return this.route$.pipe(map(route => {
468
+ const url = route.url.join('/');
469
+ const flowRootUrl = this.getFlowRootPath(route);
470
+ return url.replace(flowRootUrl, '');
471
+ }));
472
+ };
473
+ this.routeChange$ = this.router.events.pipe(filter(e => e instanceof NavigationEnd), shareReplay());
474
+ this.lastChildParams$ = this.watchLastChildParams$(this.route).pipe(startWith(this.getLastChildParams(this.route.snapshot)), shareReplay());
475
+ this.lastChildRoute$ = this.watchLastChildRoute$(this.route).pipe(startWith(this.getLastChildRouteSnapshot(this.route.snapshot)), shareReplay());
476
+ this.loading$ = this.router.events.pipe(filter(e => e instanceof NavigationStart ||
477
+ e instanceof NavigationCancel ||
478
+ e instanceof NavigationEnd ||
479
+ e instanceof NavigationError), map(e => e instanceof NavigationStart), startWith(false), distinctUntilChanged());
480
+ this.routeChange$.subscribe(() => {
481
+ this.urlHistory.push(this.router.url);
482
+ // Close Guided Selling when user navigates to another flow page
483
+ this.integrationState.dispatch(FlowAction.CloseGuidedSelling({ keepState: true }));
484
+ });
485
+ }
486
+ getFlowRootRoute(route) {
487
+ var _a;
488
+ const path = [...route.pathFromRoot];
489
+ while (path.length) {
490
+ const parent = path.pop();
491
+ if (!parent) {
492
+ break;
493
+ }
494
+ if (((_a = parent.routeConfig) === null || _a === void 0 ? void 0 : _a.id) === VELOCE_FLOW_ROOT_ROUTE) {
495
+ return parent;
496
+ }
497
+ }
498
+ return;
499
+ }
500
+ getFlowRootPath(route) {
501
+ const rootRoute = this.getFlowRootRoute(route);
502
+ if (!rootRoute) {
503
+ return '';
504
+ }
505
+ const path = rootRoute.pathFromRoot
506
+ .map(r => r.url[0])
507
+ .filter(Boolean)
508
+ .join('/');
509
+ return '/' + path;
510
+ }
511
+ get route$() {
512
+ return this.lastChildRoute$;
513
+ }
514
+ get params$() {
515
+ return this.lastChildParams$;
516
+ }
517
+ get params() {
518
+ return this.getLastChildParams(this.route.snapshot);
519
+ }
520
+ isConfigurationRoute$() {
521
+ return this.getFlowSubpath$().pipe(map(url => url.startsWith('product')));
522
+ }
523
+ isCartRoute$() {
524
+ return this.getFlowSubpath$().pipe(map(url => url.startsWith('cart')));
525
+ }
526
+ isCatalogRoute$() {
527
+ return this.getFlowSubpath$().pipe(map(url => url.startsWith('catalog')));
528
+ }
529
+ isAssetsRoute$() {
530
+ return this.getFlowSubpath$().pipe(map(url => url.startsWith('assets')));
531
+ }
532
+ navigateBack() {
533
+ const prevUrl = this.urlHistory[this.urlHistory.length - 2];
534
+ if (prevUrl) {
535
+ this.router.navigateByUrl(prevUrl);
536
+ }
537
+ }
538
+ navigateTo(path, productId, lineItemId) {
539
+ if (path === 'shopping-cart') {
540
+ this.navigateToShoppingCart();
541
+ }
542
+ else if (path === 'catalog') {
543
+ this.navigateToCatalog();
544
+ }
545
+ else if (path === 'assets') {
546
+ this.navigateToAssets();
547
+ }
548
+ else if (path === 'product' && productId) {
549
+ this.navigateToProductConfiguration(productId, lineItemId);
550
+ }
551
+ }
552
+ navigateToProductConfiguration(productId, lineItemId) {
553
+ let updateContext$;
554
+ if (this.flowInfoService.isLegacy) {
555
+ updateContext$ = of(undefined).pipe(tap(() => {
556
+ this.contextService.update({ properties: { productId, lineItemId: lineItemId !== null && lineItemId !== void 0 ? lineItemId : '' } });
557
+ }));
558
+ }
559
+ else {
560
+ updateContext$ = this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_CONTEXT_PROPERTIES', {
561
+ productId,
562
+ lineItemId: lineItemId !== null && lineItemId !== void 0 ? lineItemId : '',
563
+ });
564
+ }
565
+ updateContext$
566
+ .pipe(tap(() => {
567
+ const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
568
+ const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
569
+ this.router.navigate([flowRouteUrl, 'product'], {
570
+ queryParams: Object.assign(Object.assign({}, routeSnapshot.queryParams), { productId }),
571
+ });
572
+ }))
573
+ .subscribe();
574
+ }
575
+ navigateToShoppingCart() {
576
+ const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
577
+ const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
578
+ this.router.navigate([flowRouteUrl, 'cart'], { queryParams: routeSnapshot.queryParams });
579
+ }
580
+ navigateToCatalog() {
581
+ const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
582
+ const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
583
+ this.router.navigate([flowRouteUrl, 'catalog'], { queryParams: routeSnapshot.queryParams });
584
+ }
585
+ navigateToAssets() {
586
+ const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
587
+ const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
588
+ this.router.navigate([flowRouteUrl, 'assets'], { queryParams: routeSnapshot.queryParams });
589
+ }
590
+ showErrorPage$(message, details) {
591
+ const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
592
+ const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
593
+ return from(this.router.navigate([flowRouteUrl, '404'], {
594
+ state: Object.assign({ message, type: 'error' }, (details && { details })),
595
+ replaceUrl: true,
596
+ })).pipe(map(() => false));
597
+ }
598
+ switchObject(id) {
599
+ const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
600
+ const route = this.getLastChildRoute(this.route);
601
+ const objName = SalesforceIdUtils.getSfObjectNameById(id);
602
+ const queryParams = {
603
+ quoteId: objName === 'Quote' ? id : undefined,
604
+ accountId: objName === 'Account' ? id : undefined,
605
+ orderId: objName === 'Order' ? id : undefined,
606
+ };
607
+ this.router.navigate([], { relativeTo: route, queryParams: Object.assign(Object.assign({}, routeSnapshot.queryParams), queryParams) });
608
+ }
609
+ }
610
+ FlowRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: i2.ContextService }, { token: i2.IntegrationState }, { token: i2.FlowInfoService }, { token: i2.FlowStateService }], target: i0.ɵɵFactoryTarget.Injectable });
611
+ FlowRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, providedIn: 'root' });
612
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, decorators: [{
613
+ type: Injectable,
614
+ args: [{ providedIn: 'root' }]
615
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i2.ContextService }, { type: i2.IntegrationState }, { type: i2.FlowInfoService }, { type: i2.FlowStateService }]; } });
616
+
728
617
  class FlowDialogService {
729
- constructor(dialogService, contextService) {
618
+ constructor(dialogService, contextService, runtimeSettings) {
730
619
  this.dialogService = dialogService;
731
620
  this.contextService = contextService;
621
+ this.runtimeSettings = runtimeSettings;
732
622
  }
733
623
  show(config) {
734
624
  return this.dialogService.open(FlowDialogComponent, {
@@ -749,8 +639,9 @@ class FlowDialogService {
749
639
  });
750
640
  }
751
641
  showReadonlyModeDialog() {
642
+ var _a;
752
643
  const ctx = this.contextService.resolve();
753
- const objectName = ctx.mode ? ctx.mode[0].toUpperCase() + ctx.mode.substring(1).toLowerCase() : 'Object';
644
+ const objectName = ctx.mode ? ((_a = ctx.mode[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) + ctx.mode.substring(1).toLowerCase() : 'Object';
754
645
  return this.show({
755
646
  title: 'Error',
756
647
  description: `${objectName} Cannot be Saved`,
@@ -837,679 +728,156 @@ class FlowDialogService {
837
728
  secondaryButton: 'Cancel',
838
729
  });
839
730
  }
731
+ showTermsLimitReachedDialog() {
732
+ const shoppingCartSettings = mapShoppingCartSettings(this.runtimeSettings.getShoppingCartSettings() || []);
733
+ const maxRenewalTerms = getMaxRenewalTermsValue(shoppingCartSettings);
734
+ return this.show({
735
+ title: 'Terms Limit Reached',
736
+ description: `You have reached the term quantity limit: ${maxRenewalTerms}. You can increase the limit in the Shopping Cart Settings.`,
737
+ primaryButton: 'Ok',
738
+ });
739
+ }
740
+ showDialog(dialog) {
741
+ const dialogFunction = this[dialog].bind(this);
742
+ return dialogFunction(dialog);
743
+ }
840
744
  }
841
- FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token: i1$2.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
745
+ FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token: i2.ContextService }, { token: i2.RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
842
746
  FlowDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService });
843
747
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, decorators: [{
844
748
  type: Injectable
845
- }], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i1$2.ContextService }]; } });
846
-
847
- const METRICS_STORAGE_KEY = 'vl-metrics';
749
+ }], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.ContextService }, { type: i2.RuntimeSettingsService }]; } });
848
750
 
849
- class MetricsComponent {
850
- constructor(contextService, quoteDraftService, cdr, metricsCalculationService, flowConfiguration, shoppingCartSettingsApiService, runtimeSettings) {
851
- this.contextService = contextService;
751
+ class FlowService {
752
+ constructor(integrationState, flowRouterService, quoteDraftService, configurationService, configurationStateService, flowDialogService, flowConfigurationService, flowInfoService, flowStateService) {
753
+ this.integrationState = integrationState;
754
+ this.flowRouterService = flowRouterService;
852
755
  this.quoteDraftService = quoteDraftService;
853
- this.cdr = cdr;
854
- this.metricsCalculationService = metricsCalculationService;
855
- this.flowConfiguration = flowConfiguration;
856
- this.shoppingCartSettingsApiService = shoppingCartSettingsApiService;
857
- this.runtimeSettings = runtimeSettings;
858
- this.emptyStateMetrics = [
859
- { name: 'MRR', value: 0 },
860
- { name: 'E.MRR', value: 0 },
861
- { name: 'NRR', value: 0 },
862
- { name: 'E.NRR', value: 0 },
863
- ];
864
- this.visibleSelectedMetrics = [];
865
- this.restSelectedMetrics = [];
866
- this.metrics = [];
867
- this.filteredMetrics = [];
868
- this.sidebarVisible = false;
869
- this.searchControl = new FormControl('');
870
- this.isFocused = false;
871
- this.nameControl = new FormControl('', [
872
- requiredValidator,
873
- invalidCharactersValidator(standardCharSetWithSpaceRegExp),
874
- reservedIdentifierValidator,
875
- Validators.maxLength(80),
876
- ]);
877
- this.activeMetricRules = [];
878
- this.activeMetricRuleNames = [];
879
- this.defaultMetricRuleNames = [];
880
- this.metricKeys = [];
881
- this.lastSavedMetrics = [];
882
- this.destroyed$ = new Subject();
883
- this.currencySymbol = this.runtimeSettings.getCurrencySettings().symbol;
884
- }
885
- ngOnInit() {
886
- this.activeMetricRules = this.flowConfiguration.activeMetricsSnapshot.filter(metricRule => metricRule.metrics.some(metric => !!metric.totalName));
887
- const activeMetricRuleNames = this.activeMetricRules.map(metricRule => metricRule.title);
888
- this.shoppingCartSettingsApiService
889
- .getSettingsMap()
890
- .pipe(withLatestFrom(this.quoteDraftService.currentState$), tap$1(([settings, lineItems]) => {
891
- this.defaultMetricRuleNames = ((settings === null || settings === void 0 ? void 0 : settings.DEFAULT_HEADER_METRICS) || []).filter(ruleName => activeMetricRuleNames.includes(ruleName));
892
- this.metricKeys = this.collectMetricKeys(lineItems);
893
- this.activeMetricRuleNames = this.getActiveMetricRuleNames();
894
- }), takeUntil$1(this.destroyed$))
895
- .subscribe(() => {
896
- this.collectAvailableMetrics();
897
- });
898
- this.searchControl.valueChanges.pipe(takeUntil$1(this.destroyed$), startWith('')).subscribe(query => {
899
- this.filteredMetrics = this.metrics.filter(({ name }) => {
900
- return (name || '').toLowerCase().includes(query === null || query === void 0 ? void 0 : query.toLowerCase());
901
- });
902
- });
903
- this.metricsCalculationService.onMetricsUpdate$
904
- .pipe(takeUntil$1(this.destroyed$))
905
- .subscribe(() => this.cdr.detectChanges());
906
- }
907
- ngOnDestroy() {
908
- this.destroyed$.next();
909
- this.destroyed$.complete();
910
- }
911
- toggleOverlay(event, overlay, target) {
912
- event.stopPropagation();
913
- if (this.restSelectedMetrics.length) {
914
- if (!overlay.overlayVisible) {
915
- document.dispatchEvent(new Event('click'));
916
- }
917
- overlay.toggle(event, target);
918
- }
919
- else {
920
- this.openSidebar();
921
- }
922
- }
923
- openSidebar() {
924
- this.overlayPanel.hide();
925
- this.sidebarVisible = true;
926
- }
927
- closeSidebar() {
928
- this.sidebarVisible = false;
929
- this.metrics = cloneDeep(this.lastSavedMetrics);
930
- this.editingMetric = undefined;
931
- this.searchControl.setValue('');
932
- }
933
- getMetricValue(key) {
934
- const context = this.contextService.resolve();
935
- if (key.startsWith('Effective_')) {
936
- const correctKey = key.replace('Effective_', '');
937
- return this.toNumber(context.properties[correctKey]) - this.toNumber(context.properties[`Previous${correctKey}`]);
938
- }
939
- else {
940
- return this.metricsCalculationService.getMetricValue(key);
941
- }
942
- }
943
- save() {
944
- localStorage.setItem(METRICS_STORAGE_KEY, JSON.stringify(this.metrics));
945
- this.setMetrics();
946
- this.lastSavedMetrics = cloneDeep(this.metrics);
947
- this.closeSidebar();
948
- }
949
- changeMetricOrder(event) {
950
- moveItemInArray(this.metrics, event.previousIndex, event.currentIndex);
951
- this.filteredMetrics = this.metrics;
952
- }
953
- editMetric(metric) {
954
- if (this.editingMetric && this.nameControl.invalid) {
955
- return;
956
- }
957
- this.editingMetric = metric;
958
- this.nameControl.setValue(metric.name);
959
- }
960
- saveMetric() {
961
- var _a;
962
- if (this.nameControl.invalid) {
963
- return;
964
- }
965
- if (this.editingMetric) {
966
- this.editingMetric.name = (_a = this.nameControl.value) === null || _a === void 0 ? void 0 : _a.trim();
967
- }
968
- this.editingMetric = undefined;
969
- }
970
- cancelMetric() {
971
- this.editingMetric = undefined;
972
- }
973
- resetToDefault() {
974
- this.collectAvailableMetrics(true);
975
- }
976
- onFocus() {
977
- this.isFocused = true;
978
- }
979
- onBlur() {
980
- this.isFocused = false;
756
+ this.configurationService = configurationService;
757
+ this.configurationStateService = configurationStateService;
758
+ this.flowDialogService = flowDialogService;
759
+ this.flowConfigurationService = flowConfigurationService;
760
+ this.flowInfoService = flowInfoService;
761
+ this.flowStateService = flowStateService;
762
+ this.cleanup$ = new Subject();
981
763
  }
982
- clearSearch(event) {
983
- event.stopPropagation();
984
- this.searchControl.setValue('');
764
+ cleanup() {
765
+ this.cleanup$.next();
985
766
  }
986
- collectMetricKeys(lineItems) {
987
- const keys = [];
988
- lineItems.forEach(lineItem => {
989
- keys.push(...Object.keys(lineItem.totalMetrics || {}));
990
- keys.push(...this.collectMetricKeys(lineItem.lineItems));
991
- });
992
- return uniq(keys);
993
- }
994
- setMetrics() {
995
- const metrics = cloneDeep(this.metrics.filter(({ visible }) => visible));
996
- this.visibleSelectedMetrics = metrics.slice(0, 4);
997
- this.restSelectedMetrics = metrics.slice(4);
998
- }
999
- collectAvailableMetrics(resetToDefault = false) {
1000
- const storedMetrics = JSON.parse(localStorage.getItem(METRICS_STORAGE_KEY) || '[]');
1001
- const metricKeys = this.metricKeys.slice();
1002
- const isDefaultConfiguration = !storedMetrics.length || resetToDefault;
1003
- this.metrics = (isDefaultConfiguration ? this.activeMetricRuleNames : storedMetrics).reduce((result, metric) => {
1004
- const metricKeyIndex = metricKeys.findIndex(key => key === metric.key);
1005
- if (metricKeyIndex >= 0) {
1006
- metricKeys.splice(metricKeyIndex, 1);
1007
- }
1008
- if (isDefaultConfiguration && this.defaultMetricRuleNames.includes(metric.name)) {
1009
- metric.visible = true;
1010
- }
1011
- return [...result, metric];
1012
- }, []);
1013
- this.metrics = [
1014
- ...this.metrics,
1015
- ...metricKeys.map(metricKey => {
1016
- return { key: metricKey, name: this.getMetricName(metricKey), visible: false };
1017
- }),
1018
- ];
1019
- // sort the metrics by the order of default metric rule names from the shopping cart settings
1020
- this.metrics = this.sortMetrics();
1021
- this.metrics = cloneDeep(this.metrics);
1022
- this.searchControl.setValue('');
1023
- if (!resetToDefault) {
1024
- this.lastSavedMetrics = cloneDeep(this.metrics);
1025
- this.setMetrics();
1026
- }
1027
- this.cdr.markForCheck();
1028
- }
1029
- getMetricName(key) {
1030
- var _a;
1031
- return (((_a = this.activeMetricRules.find(metricRule => metricRule.metrics.find(metric => metric.totalName === key))) === null || _a === void 0 ? void 0 : _a.title) ||
1032
- key);
1033
- }
1034
- toNumber(value) {
1035
- return +(value || 0);
1036
- }
1037
- getActiveMetricRuleNames() {
1038
- return this.activeMetricRules.reduce((result, metricRule) => {
1039
- const name = metricRule.title;
1040
- const visible = this.defaultMetricRuleNames.includes(name);
1041
- metricRule.metrics.forEach(metric => {
1042
- result.push({
1043
- key: metric.totalName || metric.name,
1044
- name,
1045
- visible,
1046
- });
1047
- });
1048
- return result;
1049
- }, []);
1050
- }
1051
- /**
1052
- * Sorts the Metrics array by the order of the default metric rule names from the shopping cart settings.
1053
- * If a metric is included in the list of default metrics, it raises the metric to the top of the metrics array.
1054
- */
1055
- sortMetrics() {
1056
- return this.metrics.slice().sort((a, b) => {
1057
- const indexA = this.defaultMetricRuleNames.indexOf(a.name);
1058
- const indexB = this.defaultMetricRuleNames.indexOf(b.name);
1059
- if (indexA === -1 && indexB === -1) {
1060
- return 0;
767
+ initSubscriptions() {
768
+ this.integrationState
769
+ .listen$(FlowAction.FLOW_CONFIGURE_PRODUCT)
770
+ .pipe(switchMap(payload => {
771
+ var _a, _b;
772
+ if (this.flowInfoService.isLegacy) {
773
+ const productId = (_a = payload.productId) !== null && _a !== void 0 ? _a : (_b = this.quoteDraftService.currentState.find(li => li.id === payload.lineItemId)) === null || _b === void 0 ? void 0 : _b.productId;
774
+ return of(Object.assign(Object.assign({}, payload), { productId }));
1061
775
  }
1062
- if (indexA === -1) {
1063
- return 1;
776
+ return this.prepareConfiguration$(payload.lineItemId).pipe(map(() => payload));
777
+ }), tap(payload => {
778
+ if (payload.productId) {
779
+ this.flowRouterService.navigateToProductConfiguration(payload.productId, payload.lineItemId);
1064
780
  }
1065
- if (indexB === -1) {
1066
- return -1;
781
+ else {
782
+ console.warn("Parameter 'productId' is needed to start configuration");
1067
783
  }
1068
- return indexA - indexB;
1069
- });
1070
- }
1071
- }
1072
- MetricsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MetricsComponent, deps: [{ token: i1$2.ContextService }, { token: i1$2.QuoteDraftService }, { token: i0.ChangeDetectorRef }, { token: i1$2.MetricsCalculationService }, { token: i1$2.FlowConfigurationService }, { token: i2.ShoppingCartSettingsApiService }, { token: i1$2.RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Component });
1073
- MetricsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: MetricsComponent, selector: "vl-metrics", viewQueries: [{ propertyName: "overlayPanel", first: true, predicate: OverlayPanel, descendants: true }], ngImport: i0, template: "<div class=\"header-metrics\" (click)=\"toggleOverlay($event, overlayPanel, metricsTarget)\">\n <div class=\"metrics\">\n <div *ngFor=\"let metric of visibleSelectedMetrics\" class=\"metric\">\n <span\n class=\"name\"\n [vlHiddenTextTooltip]=\"metric.name\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ metric.name }}\n </span>\n <span class=\"filler\"></span>\n <span\n class=\"value\"\n vlHiddenTextTooltip=\"{{ getMetricValue(metric.key) | vlPrice }}\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ getMetricValue(metric.key) | vlPrice }}\n </span>\n </div>\n\n <ng-container *ngIf=\"!visibleSelectedMetrics.length\">\n <div *ngFor=\"let metric of emptyStateMetrics\" class=\"metric empty-state-metric\">\n <span\n class=\"name\"\n [vlHiddenTextTooltip]=\"metric.name\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ metric.name }}\n </span>\n <span class=\"filler\"></span>\n <span\n class=\"value\"\n vlHiddenTextTooltip=\"{{ metric.value | vlPrice }}\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ metric.value | vlPrice }}\n </span>\n </div>\n </ng-container>\n </div>\n\n <div #metricsTarget class=\"metrics-overlay-target\" [class.expanded]=\"overlayPanel?.overlayVisible\">\n <i class=\"vl-icon vl-arrow-down\"></i>\n </div>\n</div>\n\n<p-overlayPanel\n styleClass=\"catalog-overlay metrics-overlay-container right no-padding\"\n showTransitionOptions=\"0ms\"\n hideTransitionOptions=\"0ms\"\n>\n <ng-template pTemplate>\n <div class=\"overlay-metrics\">\n <div *ngFor=\"let metric of restSelectedMetrics\" class=\"metric\">\n <span\n class=\"name\"\n [vlHiddenTextTooltip]=\"metric.name\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ metric.name }}\n </span>\n <span class=\"filler\"></span>\n <span\n class=\"value\"\n vlHiddenTextTooltip=\"{{ getMetricValue(metric.key) | vlPrice }}\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ getMetricValue(metric.key) | vlPrice }}\n </span>\n </div>\n </div>\n <button class=\"config\" (click)=\"openSidebar()\">\n Metrics Config\n <i class=\"vl-icon vl-arrow-right\"></i>\n </button>\n </ng-template>\n</p-overlayPanel>\n\n<p-sidebar\n [visible]=\"sidebarVisible\"\n (visibleChange)=\"closeSidebar()\"\n position=\"right\"\n [baseZIndex]=\"1000\"\n [style]=\"{ width: '300px' }\"\n>\n <div class=\"container\">\n <div class=\"header\">\n Quote Metrics Config\n <i class=\"vl-icon vl-cross\" (click)=\"closeSidebar()\"></i>\n </div>\n\n <label class=\"search-container\" [class.active]=\"searchControl.value || isFocused\">\n <i class=\"vl-icon vl-search\"></i>\n <input\n data-test-id=\"search\"\n [formControl]=\"searchControl\"\n pInputText\n placeholder=\"Search for metric\u2026\"\n class=\"w-full search-input\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n <i *ngIf=\"searchControl.value\" class=\"vl-icon vl-cross\" (click)=\"clearSearch($event)\"></i>\n </label>\n\n <div class=\"content\">\n <div class=\"sidebar-metrics\" cdkDropList (cdkDropListDropped)=\"changeMetricOrder($event)\">\n <div\n *ngFor=\"let metric of filteredMetrics\"\n class=\"sidebar-metric\"\n [class.edit]=\"metric.key === editingMetric?.key\"\n cdkDrag\n [cdkDragDisabled]=\"!!searchControl.value\"\n >\n <div class=\"drag-icon\">\n <i class=\"vl-icon vl-drag\" cdkDragHandle></i>\n </div>\n <ng-container\n [ngTemplateOutlet]=\"metricTemplate\"\n [ngTemplateOutletContext]=\"{ metric: metric }\"\n ></ng-container>\n </div>\n </div>\n\n <div class=\"empty-state\" *ngIf=\"!filteredMetrics.length\">There are no items matching your search criteria</div>\n </div>\n <div class=\"footer\">\n <p-button\n label=\"Reset to Default\"\n styleClass=\"p-button-outlined p-button-sm\"\n (onClick)=\"resetToDefault()\"\n ></p-button>\n <p-button label=\"Save\" styleClass=\"p-button p-button-filled p-button-sm\" (onClick)=\"save()\"></p-button>\n </div>\n </div>\n</p-sidebar>\n\n<ng-template #metricTemplate let-metric=\"metric\">\n <div *ngIf=\"editingMetric?.key !== metric.key\" class=\"preview-state\">\n <p-checkbox\n [ngModel]=\"metric.visible\"\n (ngModelChange)=\"metric.visible = !metric.visible\"\n [binary]=\"true\"\n checkboxIcon=\"vl-icon vl-check\"\n ></p-checkbox>\n <div class=\"title\">{{ metric.name }}</div>\n </div>\n\n <div *ngIf=\"editingMetric?.key === metric.key\" class=\"edit-state\">\n <input data-test-id=\"name\" [formControl]=\"nameControl\" pInputText placeholder=\"Metric name\" class=\"w-full\" />\n <vl-error-tooltip [tooltip]=\"nameControl | error : 'name'\" [visible]=\"!!nameControl.errors\"></vl-error-tooltip>\n </div>\n <div class=\"actions\">\n <div *ngIf=\"editingMetric?.key !== metric.key\" (click)=\"editMetric(metric)\" class=\"action edit\">\n <i class=\"vl-icon vl-edit\"></i>\n </div>\n <div *ngIf=\"editingMetric?.key === metric.key\" (click)=\"cancelMetric()\" class=\"action cancel\">\n <i class=\"vl-icon vl-cross\"></i>\n </div>\n <div *ngIf=\"editingMetric?.key === metric.key\" (click)=\"saveMetric()\" class=\"action save\">\n <i class=\"vl-icon vl-check\"></i>\n </div>\n </div>\n</ng-template>\n", styles: [":host .header-metrics{display:flex;gap:8px;cursor:pointer}:host .header-metrics *{font-family:var(--cg-font-family)}:host .header-metrics .metrics{min-width:130px;max-width:260px;display:flex;flex-wrap:wrap;justify-content:flex-start;gap:0 8px;height:32px;align-items:flex-start}:host .header-metrics .metric{flex:1;flex-basis:114px;max-width:122px;display:flex;justify-content:space-between;align-items:flex-end;font-size:12px;line-height:16px;letter-spacing:.3px}:host .header-metrics .metric .name{color:#ffffffb3;max-width:30px;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host .header-metrics .metric .value{overflow:hidden;text-overflow:ellipsis;max-width:7rem}:host .header-metrics .metric.empty-state-metric{filter:blur(1.5px)}:host .metrics-overlay-target{display:flex;align-items:center;width:16px;border-radius:4px;background:rgba(255,255,255,.1)}:host .metrics-overlay-target .vl-icon{color:var(--cg-white)}:host .metrics-overlay-target.expanded .vl-icon:before{transform:rotate(180deg)}:host ::ng-deep .p-sidebar-header{display:none}:host ::ng-deep .p-sidebar-content{padding:0;height:100%}::ng-deep .p-overlaypanel.metrics-overlay-container{width:280px}::ng-deep .p-overlaypanel.metrics-overlay-container *{font-family:var(--cg-font-family)}::ng-deep .p-overlaypanel.metrics-overlay-container .p-overlaypanel-content{padding:0;margin-top:0}::ng-deep .p-overlaypanel.metrics-overlay-container .overlay-metrics{padding:16px;max-height:112px;overflow:auto}::ng-deep .p-overlaypanel.metrics-overlay-container .metric{display:flex;font-size:12px;line-height:16px;letter-spacing:.3px;align-items:flex-end}::ng-deep .p-overlaypanel.metrics-overlay-container .metric .name{color:var(--cg-text-color-secondary);max-width:50%;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}::ng-deep .p-overlaypanel.metrics-overlay-container .metric .value{overflow:hidden;text-overflow:ellipsis}::ng-deep .p-overlaypanel.metrics-overlay-container .metric .filler:before{background-image:radial-gradient(circle at 1px 1px,var(--cg-text-color-secondary) 1px,transparent 0)}::ng-deep .p-overlaypanel.metrics-overlay-container .config{height:48px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 8px 8px 16px;cursor:pointer;background:var(--cg-white);outline:none;border:none;border-top:1px solid var(--cg-border-color);width:100%;font-size:12px;line-height:16px;letter-spacing:.3px}::ng-deep .p-overlaypanel.metrics-overlay-container .config .vl-icon-chevron-down{color:var(--cg-primary-color)}.filler{flex:1;margin:0 4px 7px;min-width:7px}.filler:before{display:block;width:100%;height:2px;content:\"\";background-image:radial-gradient(circle at 1px 1px,rgba(255,255,255,.7) 1px,transparent 0);background-size:5px 2px}.container{display:flex;flex-direction:column;height:100%}.container .header{box-sizing:content-box;padding:24px 24px 0;margin-bottom:16px;height:32px;flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;font-family:var(--vl-font-family);font-size:20px;font-style:normal;font-weight:500;line-height:24px;letter-spacing:-.6px;color:var(--vl-accent-color)}.container .header i{cursor:pointer}.container .search-container{cursor:pointer;display:flex;height:32px;margin:0 24px 8px;padding:8px;background:var(--cg-bg-color);border:1px solid transparent;border-radius:32px}.container .search-container:hover,.container .search-container.active{background:var(--cg-white);border-color:var(--cg-primary-color)}.container .search-container .vl-icon{flex:0 0 auto}.container .search-container .search-input{width:100%;height:16px;padding:0 8px;border:none;font-size:12px;line-height:16px;letter-spacing:.3px;color:var(--cg-black-color);background:none}.container .search-container .search-input::placeholder{font-weight:400;font-size:12px;line-height:16px;letter-spacing:.3px;color:var(--cg-text-color-secondary)}.container .content{padding:0 24px;display:flex;flex-direction:column;flex:1;overflow:hidden}.container .footer{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 24px;border-top:1px solid var(--cg-border-color)}.container .footer p-button{flex:1}.container .footer p-button ::ng-deep button{border-radius:24px;width:100%;font-size:12px;font-family:var(--cg-font-family);font-weight:300;line-height:16px;letter-spacing:.3px;white-space:nowrap}.container .footer p-button ::ng-deep .p-button-outlined{background-color:var(--cg-white);color:var(--cg-primary-color)}.container .footer p-button ::ng-deep .p-button-outlined:hover{background-color:var(--cg-primary-color);color:var(--cg-white)}.container .footer p-button ::ng-deep .p-button-filled{background-color:var(--cg-primary-color);color:var(--cg-white);border:1px solid var(--cg-primary-color)}.container .footer p-button ::ng-deep .p-button-filled:hover{background-color:var(--cg-primary-color-hover);border-color:var(--cg-primary-color-hover)}.container app-empty-state::ng-deep{margin-bottom:12px}.container app-empty-state::ng-deep .container{width:100%;padding-bottom:0}.sidebar-metrics{width:100%;overflow:auto;padding:1px 0}.empty-state{display:flex;align-items:center;justify-content:center;padding:16px;color:var(--cg-text-color-secondary);font-size:12px;font-weight:300;line-height:16px;letter-spacing:.3px}.sidebar-metric{display:flex;align-items:center;height:32px;position:relative;border-bottom:1px solid var(--cg-border-color)}.sidebar-metric.edit{border-bottom-color:var(--cg-primary-color)}.sidebar-metric.edit .drag-icon{display:none}.sidebar-metric:hover:not(.edit){background:var(--cg-bg-color)}.sidebar-metric:hover:not(.edit) .edit{visibility:visible}.sidebar-metric p-checkbox{margin-right:8px}.sidebar-metric .drag-icon{width:16px;height:16px;margin-right:8px}.sidebar-metric .drag-icon i{cursor:pointer;color:var(--cg-text-color-disabled)}.sidebar-metric.cdk-drag-disabled .drag-icon i{cursor:default}.sidebar-metric .title{font-weight:400;font-size:12px;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-user-select:text;user-select:text;cursor:text;color:var(--cg-black)}.sidebar-metric .preview-state,.sidebar-metric .edit-state{position:relative;margin-right:8px;min-width:0;display:flex;align-items:center;flex:1}.sidebar-metric .preview-state input,.sidebar-metric .edit-state input{padding-left:48px;border:none;background:transparent;width:100%}.sidebar-metric .actions{display:flex;gap:4px}.sidebar-metric .action{cursor:pointer;width:24px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:4px}.sidebar-metric .action:hover{background:var(--cg-primary-color);color:var(--cg-white)}.sidebar-metric .edit{visibility:hidden}.sidebar-metric .save{border-color:var(--cg-primary-color);border-radius:4px}.sidebar-metric ::ng-deep .p-checkbox{width:16px;height:16px}.sidebar-metric ::ng-deep .p-checkbox .p-checkbox-box{width:16px;height:16px;border-width:1px;border-color:var(--cg-border-color)}.sidebar-metric ::ng-deep .p-checkbox .p-checkbox-box:hover{border-color:var(--cg-primary-color)}.sidebar-metric ::ng-deep .p-checkbox .p-checkbox-box.p-highlight{background:var(--cg-primary-color);border-color:var(--cg-primary-color)}.sidebar-metric ::ng-deep .p-checkbox .p-checkbox-box .p-checkbox-icon{flex:0 0 auto;width:12px;height:12px}.cdk-drag-preview{z-index:10001!important;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .metric-tooltip .p-tooltip-text{font-size:11px;line-height:14px;letter-spacing:.3px;background:var(--cg-primary-color-hover)}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i5$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i5$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i5$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i7.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i8.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i9$1.Sidebar, selector: "p-sidebar", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "directive", type: i10.InputText, selector: "[pInputText]" }, { kind: "component", type: i11.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "trueValue", "falseValue"], outputs: ["onChange"] }, { kind: "component", type: i2$1.ErrorTooltipComponent, selector: "vl-error-tooltip", inputs: ["tooltip", "visible", "top"] }, { kind: "directive", type: i2$1.AppHiddenTextTooltipDirective, selector: "[vlHiddenTextTooltip]", inputs: ["vlHiddenTextTooltip"] }, { kind: "pipe", type: i2$1.ErrorPipe, name: "error" }, { kind: "pipe", type: i1$2.PricePipe, name: "vlPrice" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1074
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MetricsComponent, decorators: [{
1075
- type: Component,
1076
- args: [{ selector: 'vl-metrics', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"header-metrics\" (click)=\"toggleOverlay($event, overlayPanel, metricsTarget)\">\n <div class=\"metrics\">\n <div *ngFor=\"let metric of visibleSelectedMetrics\" class=\"metric\">\n <span\n class=\"name\"\n [vlHiddenTextTooltip]=\"metric.name\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ metric.name }}\n </span>\n <span class=\"filler\"></span>\n <span\n class=\"value\"\n vlHiddenTextTooltip=\"{{ getMetricValue(metric.key) | vlPrice }}\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ getMetricValue(metric.key) | vlPrice }}\n </span>\n </div>\n\n <ng-container *ngIf=\"!visibleSelectedMetrics.length\">\n <div *ngFor=\"let metric of emptyStateMetrics\" class=\"metric empty-state-metric\">\n <span\n class=\"name\"\n [vlHiddenTextTooltip]=\"metric.name\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ metric.name }}\n </span>\n <span class=\"filler\"></span>\n <span\n class=\"value\"\n vlHiddenTextTooltip=\"{{ metric.value | vlPrice }}\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ metric.value | vlPrice }}\n </span>\n </div>\n </ng-container>\n </div>\n\n <div #metricsTarget class=\"metrics-overlay-target\" [class.expanded]=\"overlayPanel?.overlayVisible\">\n <i class=\"vl-icon vl-arrow-down\"></i>\n </div>\n</div>\n\n<p-overlayPanel\n styleClass=\"catalog-overlay metrics-overlay-container right no-padding\"\n showTransitionOptions=\"0ms\"\n hideTransitionOptions=\"0ms\"\n>\n <ng-template pTemplate>\n <div class=\"overlay-metrics\">\n <div *ngFor=\"let metric of restSelectedMetrics\" class=\"metric\">\n <span\n class=\"name\"\n [vlHiddenTextTooltip]=\"metric.name\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ metric.name }}\n </span>\n <span class=\"filler\"></span>\n <span\n class=\"value\"\n vlHiddenTextTooltip=\"{{ getMetricValue(metric.key) | vlPrice }}\"\n tooltipStyleClass=\"metric-tooltip\"\n tooltipPosition=\"bottom\"\n >\n {{ getMetricValue(metric.key) | vlPrice }}\n </span>\n </div>\n </div>\n <button class=\"config\" (click)=\"openSidebar()\">\n Metrics Config\n <i class=\"vl-icon vl-arrow-right\"></i>\n </button>\n </ng-template>\n</p-overlayPanel>\n\n<p-sidebar\n [visible]=\"sidebarVisible\"\n (visibleChange)=\"closeSidebar()\"\n position=\"right\"\n [baseZIndex]=\"1000\"\n [style]=\"{ width: '300px' }\"\n>\n <div class=\"container\">\n <div class=\"header\">\n Quote Metrics Config\n <i class=\"vl-icon vl-cross\" (click)=\"closeSidebar()\"></i>\n </div>\n\n <label class=\"search-container\" [class.active]=\"searchControl.value || isFocused\">\n <i class=\"vl-icon vl-search\"></i>\n <input\n data-test-id=\"search\"\n [formControl]=\"searchControl\"\n pInputText\n placeholder=\"Search for metric\u2026\"\n class=\"w-full search-input\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n <i *ngIf=\"searchControl.value\" class=\"vl-icon vl-cross\" (click)=\"clearSearch($event)\"></i>\n </label>\n\n <div class=\"content\">\n <div class=\"sidebar-metrics\" cdkDropList (cdkDropListDropped)=\"changeMetricOrder($event)\">\n <div\n *ngFor=\"let metric of filteredMetrics\"\n class=\"sidebar-metric\"\n [class.edit]=\"metric.key === editingMetric?.key\"\n cdkDrag\n [cdkDragDisabled]=\"!!searchControl.value\"\n >\n <div class=\"drag-icon\">\n <i class=\"vl-icon vl-drag\" cdkDragHandle></i>\n </div>\n <ng-container\n [ngTemplateOutlet]=\"metricTemplate\"\n [ngTemplateOutletContext]=\"{ metric: metric }\"\n ></ng-container>\n </div>\n </div>\n\n <div class=\"empty-state\" *ngIf=\"!filteredMetrics.length\">There are no items matching your search criteria</div>\n </div>\n <div class=\"footer\">\n <p-button\n label=\"Reset to Default\"\n styleClass=\"p-button-outlined p-button-sm\"\n (onClick)=\"resetToDefault()\"\n ></p-button>\n <p-button label=\"Save\" styleClass=\"p-button p-button-filled p-button-sm\" (onClick)=\"save()\"></p-button>\n </div>\n </div>\n</p-sidebar>\n\n<ng-template #metricTemplate let-metric=\"metric\">\n <div *ngIf=\"editingMetric?.key !== metric.key\" class=\"preview-state\">\n <p-checkbox\n [ngModel]=\"metric.visible\"\n (ngModelChange)=\"metric.visible = !metric.visible\"\n [binary]=\"true\"\n checkboxIcon=\"vl-icon vl-check\"\n ></p-checkbox>\n <div class=\"title\">{{ metric.name }}</div>\n </div>\n\n <div *ngIf=\"editingMetric?.key === metric.key\" class=\"edit-state\">\n <input data-test-id=\"name\" [formControl]=\"nameControl\" pInputText placeholder=\"Metric name\" class=\"w-full\" />\n <vl-error-tooltip [tooltip]=\"nameControl | error : 'name'\" [visible]=\"!!nameControl.errors\"></vl-error-tooltip>\n </div>\n <div class=\"actions\">\n <div *ngIf=\"editingMetric?.key !== metric.key\" (click)=\"editMetric(metric)\" class=\"action edit\">\n <i class=\"vl-icon vl-edit\"></i>\n </div>\n <div *ngIf=\"editingMetric?.key === metric.key\" (click)=\"cancelMetric()\" class=\"action cancel\">\n <i class=\"vl-icon vl-cross\"></i>\n </div>\n <div *ngIf=\"editingMetric?.key === metric.key\" (click)=\"saveMetric()\" class=\"action save\">\n <i class=\"vl-icon vl-check\"></i>\n </div>\n </div>\n</ng-template>\n", styles: [":host .header-metrics{display:flex;gap:8px;cursor:pointer}:host .header-metrics *{font-family:var(--cg-font-family)}:host .header-metrics .metrics{min-width:130px;max-width:260px;display:flex;flex-wrap:wrap;justify-content:flex-start;gap:0 8px;height:32px;align-items:flex-start}:host .header-metrics .metric{flex:1;flex-basis:114px;max-width:122px;display:flex;justify-content:space-between;align-items:flex-end;font-size:12px;line-height:16px;letter-spacing:.3px}:host .header-metrics .metric .name{color:#ffffffb3;max-width:30px;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host .header-metrics .metric .value{overflow:hidden;text-overflow:ellipsis;max-width:7rem}:host .header-metrics .metric.empty-state-metric{filter:blur(1.5px)}:host .metrics-overlay-target{display:flex;align-items:center;width:16px;border-radius:4px;background:rgba(255,255,255,.1)}:host .metrics-overlay-target .vl-icon{color:var(--cg-white)}:host .metrics-overlay-target.expanded .vl-icon:before{transform:rotate(180deg)}:host ::ng-deep .p-sidebar-header{display:none}:host ::ng-deep .p-sidebar-content{padding:0;height:100%}::ng-deep .p-overlaypanel.metrics-overlay-container{width:280px}::ng-deep .p-overlaypanel.metrics-overlay-container *{font-family:var(--cg-font-family)}::ng-deep .p-overlaypanel.metrics-overlay-container .p-overlaypanel-content{padding:0;margin-top:0}::ng-deep .p-overlaypanel.metrics-overlay-container .overlay-metrics{padding:16px;max-height:112px;overflow:auto}::ng-deep .p-overlaypanel.metrics-overlay-container .metric{display:flex;font-size:12px;line-height:16px;letter-spacing:.3px;align-items:flex-end}::ng-deep .p-overlaypanel.metrics-overlay-container .metric .name{color:var(--cg-text-color-secondary);max-width:50%;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}::ng-deep .p-overlaypanel.metrics-overlay-container .metric .value{overflow:hidden;text-overflow:ellipsis}::ng-deep .p-overlaypanel.metrics-overlay-container .metric .filler:before{background-image:radial-gradient(circle at 1px 1px,var(--cg-text-color-secondary) 1px,transparent 0)}::ng-deep .p-overlaypanel.metrics-overlay-container .config{height:48px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 8px 8px 16px;cursor:pointer;background:var(--cg-white);outline:none;border:none;border-top:1px solid var(--cg-border-color);width:100%;font-size:12px;line-height:16px;letter-spacing:.3px}::ng-deep .p-overlaypanel.metrics-overlay-container .config .vl-icon-chevron-down{color:var(--cg-primary-color)}.filler{flex:1;margin:0 4px 7px;min-width:7px}.filler:before{display:block;width:100%;height:2px;content:\"\";background-image:radial-gradient(circle at 1px 1px,rgba(255,255,255,.7) 1px,transparent 0);background-size:5px 2px}.container{display:flex;flex-direction:column;height:100%}.container .header{box-sizing:content-box;padding:24px 24px 0;margin-bottom:16px;height:32px;flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;font-family:var(--vl-font-family);font-size:20px;font-style:normal;font-weight:500;line-height:24px;letter-spacing:-.6px;color:var(--vl-accent-color)}.container .header i{cursor:pointer}.container .search-container{cursor:pointer;display:flex;height:32px;margin:0 24px 8px;padding:8px;background:var(--cg-bg-color);border:1px solid transparent;border-radius:32px}.container .search-container:hover,.container .search-container.active{background:var(--cg-white);border-color:var(--cg-primary-color)}.container .search-container .vl-icon{flex:0 0 auto}.container .search-container .search-input{width:100%;height:16px;padding:0 8px;border:none;font-size:12px;line-height:16px;letter-spacing:.3px;color:var(--cg-black-color);background:none}.container .search-container .search-input::placeholder{font-weight:400;font-size:12px;line-height:16px;letter-spacing:.3px;color:var(--cg-text-color-secondary)}.container .content{padding:0 24px;display:flex;flex-direction:column;flex:1;overflow:hidden}.container .footer{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 24px;border-top:1px solid var(--cg-border-color)}.container .footer p-button{flex:1}.container .footer p-button ::ng-deep button{border-radius:24px;width:100%;font-size:12px;font-family:var(--cg-font-family);font-weight:300;line-height:16px;letter-spacing:.3px;white-space:nowrap}.container .footer p-button ::ng-deep .p-button-outlined{background-color:var(--cg-white);color:var(--cg-primary-color)}.container .footer p-button ::ng-deep .p-button-outlined:hover{background-color:var(--cg-primary-color);color:var(--cg-white)}.container .footer p-button ::ng-deep .p-button-filled{background-color:var(--cg-primary-color);color:var(--cg-white);border:1px solid var(--cg-primary-color)}.container .footer p-button ::ng-deep .p-button-filled:hover{background-color:var(--cg-primary-color-hover);border-color:var(--cg-primary-color-hover)}.container app-empty-state::ng-deep{margin-bottom:12px}.container app-empty-state::ng-deep .container{width:100%;padding-bottom:0}.sidebar-metrics{width:100%;overflow:auto;padding:1px 0}.empty-state{display:flex;align-items:center;justify-content:center;padding:16px;color:var(--cg-text-color-secondary);font-size:12px;font-weight:300;line-height:16px;letter-spacing:.3px}.sidebar-metric{display:flex;align-items:center;height:32px;position:relative;border-bottom:1px solid var(--cg-border-color)}.sidebar-metric.edit{border-bottom-color:var(--cg-primary-color)}.sidebar-metric.edit .drag-icon{display:none}.sidebar-metric:hover:not(.edit){background:var(--cg-bg-color)}.sidebar-metric:hover:not(.edit) .edit{visibility:visible}.sidebar-metric p-checkbox{margin-right:8px}.sidebar-metric .drag-icon{width:16px;height:16px;margin-right:8px}.sidebar-metric .drag-icon i{cursor:pointer;color:var(--cg-text-color-disabled)}.sidebar-metric.cdk-drag-disabled .drag-icon i{cursor:default}.sidebar-metric .title{font-weight:400;font-size:12px;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-user-select:text;user-select:text;cursor:text;color:var(--cg-black)}.sidebar-metric .preview-state,.sidebar-metric .edit-state{position:relative;margin-right:8px;min-width:0;display:flex;align-items:center;flex:1}.sidebar-metric .preview-state input,.sidebar-metric .edit-state input{padding-left:48px;border:none;background:transparent;width:100%}.sidebar-metric .actions{display:flex;gap:4px}.sidebar-metric .action{cursor:pointer;width:24px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:4px}.sidebar-metric .action:hover{background:var(--cg-primary-color);color:var(--cg-white)}.sidebar-metric .edit{visibility:hidden}.sidebar-metric .save{border-color:var(--cg-primary-color);border-radius:4px}.sidebar-metric ::ng-deep .p-checkbox{width:16px;height:16px}.sidebar-metric ::ng-deep .p-checkbox .p-checkbox-box{width:16px;height:16px;border-width:1px;border-color:var(--cg-border-color)}.sidebar-metric ::ng-deep .p-checkbox .p-checkbox-box:hover{border-color:var(--cg-primary-color)}.sidebar-metric ::ng-deep .p-checkbox .p-checkbox-box.p-highlight{background:var(--cg-primary-color);border-color:var(--cg-primary-color)}.sidebar-metric ::ng-deep .p-checkbox .p-checkbox-box .p-checkbox-icon{flex:0 0 auto;width:12px;height:12px}.cdk-drag-preview{z-index:10001!important;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .metric-tooltip .p-tooltip-text{font-size:11px;line-height:14px;letter-spacing:.3px;background:var(--cg-primary-color-hover)}\n"] }]
1077
- }], ctorParameters: function () { return [{ type: i1$2.ContextService }, { type: i1$2.QuoteDraftService }, { type: i0.ChangeDetectorRef }, { type: i1$2.MetricsCalculationService }, { type: i1$2.FlowConfigurationService }, { type: i2.ShoppingCartSettingsApiService }, { type: i1$2.RuntimeSettingsService }]; }, propDecorators: { overlayPanel: [{
1078
- type: ViewChild,
1079
- args: [OverlayPanel]
1080
- }] } });
1081
-
1082
- class FlowHeaderComponent {
1083
- constructor(contextService, quoteDraftService, quoteApiService, sfApiService, flowConfiguration, routerService, dialogService, integrationState) {
1084
- this.contextService = contextService;
1085
- this.quoteDraftService = quoteDraftService;
1086
- this.quoteApiService = quoteApiService;
1087
- this.sfApiService = sfApiService;
1088
- this.flowConfiguration = flowConfiguration;
1089
- this.routerService = routerService;
1090
- this.dialogService = dialogService;
1091
- this.integrationState = integrationState;
1092
- this.isSaveInProgress$ = new BehaviorSubject(false);
1093
- this.isSubmitInProgress$ = new BehaviorSubject(false);
1094
- this.dateFormat = 'MM.dd.yyyy';
1095
- this.assetPriceLists$ = new BehaviorSubject([]);
1096
- this.mode$ = new BehaviorSubject(ConfigurationContextMode.TEST);
1097
- this.destroyed$ = new Subject();
1098
- this.contextProperties$ = this.contextService.resolve$().pipe(map(ctx => ctx.properties));
1099
- this.objectName$ = this.mode$.pipe(map(mode => { var _a; return (_a = mode === null || mode === void 0 ? void 0 : mode.toLocaleLowerCase()) !== null && _a !== void 0 ? _a : ''; }));
1100
- this.activePriceList$ = this.quoteDraftService.activePriceList$;
1101
- this.isReadonlyMode$ = this.quoteDraftService.hasProducts$.pipe(map(() => this.isReadonlyMode()));
1102
- this.status$ = this.contextService.resolve$().pipe(map(context => { var _a; return (_a = context.properties.Status) !== null && _a !== void 0 ? _a : ''; }));
1103
- this.isEditMode$ = this.quoteDraftService.isEditMode$();
1104
- this.assetsCount$ = this.getAssets$().pipe(map(lineItems => lineItems.length));
1105
- this.products$ = this.getDraftItems$().pipe(map(lineItems => this.generateProducts(lineItems)));
1106
- this.isConfigurationRoute$ = this.routerService.isConfigurationRoute$();
1107
- this.isCartRoute$ = this.routerService.isCartRoute$();
1108
- this.isCatalogRoute$ = this.routerService.isCatalogRoute$();
1109
- this.isAssetsRoute$ = this.routerService.isAssetsRoute$();
1110
- this.objectDetails$ = this.getObjectDetails$();
1111
- }
1112
- ngOnInit() {
1113
- this.contextService
1114
- .resolve$()
1115
- .pipe(takeUntil(this.destroyed$))
1116
- .subscribe(ctx => this.mode$.next(ctx.mode));
1117
- // update assetPriceLists on quoteDraft change in ACCOUNT mode
1118
- this.quoteDraftService.quoteDraft$
1119
- .pipe(takeUntil(this.destroyed$), filter(() => this.isAccountMode))
1120
- .subscribe(() => this.assetPriceLists$.next(this.quoteDraftService.assetPriceLists));
1121
- }
1122
- ngOnDestroy() {
1123
- this.destroyed$.next();
1124
- this.destroyed$.complete();
1125
- }
1126
- get isAccountMode() {
1127
- return this.mode$.value === ConfigurationContextMode.ACCOUNT;
1128
- }
1129
- get isQuoteMode() {
1130
- return this.mode$.value === ConfigurationContextMode.QUOTE;
1131
- }
1132
- get isAccountMode$() {
1133
- return this.mode$.pipe(map(mode => mode === ConfigurationContextMode.ACCOUNT));
1134
- }
1135
- get isQuoteMode$() {
1136
- return this.mode$.pipe(map(mode => mode === ConfigurationContextMode.QUOTE));
1137
- }
1138
- getSplitButtonActions(isCartRoute) {
1139
- return [
1140
- {
1141
- label: 'Save to Quote',
1142
- command: () => {
1143
- this.saveButtonClickHandler(isCartRoute);
1144
- },
1145
- },
1146
- {
1147
- label: 'Quick Save',
1148
- command: () => {
1149
- this.saveButtonClickHandler(isCartRoute, true);
1150
- },
1151
- },
1152
- {
1153
- label: 'Generate Document',
1154
- command: () => {
1155
- this.docGenButtonClickHandler(isCartRoute);
1156
- },
1157
- },
1158
- {
1159
- label: 'Submit For Approval',
1160
- command: () => {
1161
- this.submitButtonClickHandler(isCartRoute);
1162
- },
1163
- },
1164
- ];
1165
- }
1166
- back(objectId) {
1167
- const targetId = objectId !== null && objectId !== void 0 ? objectId : this.contextService.resolve().properties.Id;
1168
- if (targetId) {
1169
- window.VELO_BACK_FN.apply(null, [targetId]);
1170
- }
1171
- }
1172
- getSalesforceObjectLink(objectId) {
1173
- if (!objectId) {
1174
- return '';
1175
- }
1176
- return `${window.location.origin}/${objectId}`;
1177
- }
1178
- navigateToShoppingCart() {
1179
- if (!this.isReadonlyMode()) {
1180
- this.routerService.navigateToShoppingCart();
1181
- }
1182
- }
1183
- navigateToCatalog() {
1184
- if (!this.isReadonlyMode()) {
1185
- this.routerService.navigateToCatalog();
1186
- }
1187
- }
1188
- navigateToAssets() {
1189
- if (!this.isReadonlyMode()) {
1190
- this.routerService.navigateToAssets();
1191
- }
1192
- }
1193
- docGenButtonClickHandler(isCartRoute) {
1194
- if (this.isAccountMode) {
1195
- if (!this.quoteDraftService.hasUnsavedChanges) {
1196
- this.dialogService.showAccountNoChangesDialog().subscribe();
784
+ }), takeUntil(this.cleanup$))
785
+ .subscribe();
786
+ this.integrationState
787
+ .listen$(FlowAction.FLOW_SWITCH_OBJECT)
788
+ .pipe(tap(payload => {
789
+ this.flowRouterService.switchObject(payload.id);
790
+ }), takeUntil(this.cleanup$))
791
+ .subscribe();
792
+ this.integrationState
793
+ .listen$(FlowAction.FLOW_NAVIGATE_BACK)
794
+ .pipe(switchMap(() => this.configurationStateService.cancelConfiguration()), tap(() => this.flowRouterService.navigateBack()), takeUntil(this.cleanup$))
795
+ .subscribe();
796
+ this.integrationState
797
+ .listen$(FlowAction.FLOW_NAVIGATE_TO)
798
+ .pipe(switchMap(payload => this.configurationStateService.cancelConfiguration().pipe(map(() => payload))), tap(payload => {
799
+ if (payload.path === 'product') {
800
+ this.integrationState.dispatch(FlowAction.ConfigureProductAction(payload));
1197
801
  }
1198
802
  else {
1199
- this.dialogService.showDocgenAccountUnsavedChangesDialog().subscribe();
803
+ this.flowRouterService.navigateTo(payload.path, payload.productId, payload.lineItemId);
1200
804
  }
1201
- return;
1202
- }
1203
- if (!this.quoteDraftService.isEditMode()) {
1204
- this.dialogService.showDocgenReadonlyDialog().subscribe();
1205
- return;
1206
- }
1207
- if (!isCartRoute) {
1208
- this.dialogService.showDocgenOutsideShoppingCartDialog().subscribe();
1209
- return;
1210
- }
1211
- let shouldOpen$ = of(true);
1212
- if (this.quoteDraftService.hasUnsavedChanges) {
1213
- shouldOpen$ = this.dialogService.showDocgenUnsavedChangesDialog().pipe(switchMap(confirmed => {
1214
- if (!confirmed) {
1215
- return of(false);
1216
- }
1217
- return this.saveQuote$(true).pipe(map(() => true));
1218
- }));
1219
- }
1220
- shouldOpen$
1221
- .pipe(first(), tap(shouldOpen => shouldOpen && this.integrationState.dispatch(FlowAction.OpenDocGenAction())))
805
+ }), takeUntil(this.cleanup$))
1222
806
  .subscribe();
1223
- }
1224
- saveButtonClickHandler(isCartRoute, stayOnPage = false) {
1225
- if (!this.quoteDraftService.isEditMode()) {
1226
- if (this.isQuoteMode) {
1227
- this.dialogService.showQuoteReadonlyModeDialog().subscribe();
807
+ this.integrationState
808
+ .listen$(FlowAction.OPEN_DIALOG)
809
+ .pipe(switchMap(payload => this.flowDialogService.showDialog(payload.dialog).pipe(take(1))), takeUntil(this.cleanup$))
810
+ .subscribe(dialogResult => {
811
+ this.integrationState.patchState({ dialogResult });
812
+ });
813
+ this.integrationState
814
+ .listen$(FlowAction.FLOW_NAVIGATE_TO_CATALOG)
815
+ .pipe(tap(() => this.flowRouterService.navigateToCatalog()), takeUntil(this.cleanup$))
816
+ .subscribe();
817
+ this.integrationState
818
+ .listen$(FlowAction.FLOW_NAVIGATE_TO_SHOPPING_CART)
819
+ .pipe(tap(() => this.flowRouterService.navigateToShoppingCart()), takeUntil(this.cleanup$))
820
+ .subscribe();
821
+ this.integrationState
822
+ .listen$(FlowAction.FLOW_APPLY_PRODUCT_CONFIGURATION)
823
+ .pipe(switchMap(() => {
824
+ if (this.flowInfoService.isLegacy) {
825
+ return this.legacyApplyConfiguration();
1228
826
  }
1229
827
  else {
1230
- this.dialogService.showReadonlyModeDialog().subscribe();
828
+ return this.configurationStateService.saveConfiguration('', true).pipe(switchMap(() => this.configurationStateService.cancelConfiguration()), switchMap(() => this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'MODIFY_ASSETS', {
829
+ addConfiguringAssetId: true,
830
+ enable: true,
831
+ })));
1231
832
  }
1232
- return;
1233
- }
1234
- if (this.isUpsellQuoteWithoutChanges()) {
1235
- this.dialogService.showAccountNoChangesDialog().subscribe();
1236
- return;
1237
- }
1238
- if (this.isAccountMode && !this.quoteDraftService.hasUnsavedChanges) {
1239
- this.dialogService.showAccountNoChangesDialog().subscribe();
1240
- return;
1241
- }
1242
- if (!isCartRoute) {
1243
- this.dialogService.showQuoteOutsideShoppingCartDialog().subscribe();
1244
- return;
1245
- }
1246
- const lineItems = this.flowConfiguration.getSnapshot();
1247
- if (!lineItems.length) {
1248
- this.dialogService.showEmptyCartDialog().subscribe();
1249
- return;
1250
- }
1251
- this.saveQuote$(stayOnPage).subscribe();
1252
- }
1253
- submitButtonClickHandler(isCartRoute) {
1254
- if (this.isQuoteMode && !this.quoteDraftService.isEditMode()) {
1255
- this.dialogService.showReadonlyQuoteSubmitFailureDialog();
1256
- return;
1257
- }
1258
- if (this.isUpsellQuoteWithoutChanges()) {
1259
- this.dialogService.showAccountNoChangesDialog().subscribe();
1260
- return;
1261
- }
1262
- if (this.isAccountMode) {
1263
- this.dialogService.showAccountSubmitFailureDialog();
1264
- return;
1265
- }
1266
- if (!isCartRoute) {
1267
- this.dialogService.showOutsideShoppingCartQuoteSubmitFailureDialog().subscribe();
1268
- return;
1269
- }
1270
- const quoteDraft = this.quoteDraftService.quoteDraft;
1271
- if (!quoteDraft) {
1272
- return;
1273
- }
1274
- this.isSubmitInProgress$.next(true);
1275
- this.quoteApiService
1276
- .submitQuote(quoteDraft)
1277
- .pipe(tap(({ quoteId }) => {
1278
- this.quoteDraftService.hasUnsavedChanges = false;
1279
- this.back(quoteId);
1280
- }), finalize(() => this.isSubmitInProgress$.next(false)), takeUntil(this.destroyed$))
833
+ }), tap(() => {
834
+ this.configurationService.hasUnsavedChanges = false;
835
+ this.flowRouterService.navigateToShoppingCart();
836
+ }), takeUntil(this.cleanup$))
1281
837
  .subscribe();
838
+ this.updateFlowParams();
1282
839
  }
1283
- selectPriceList(priceListId) {
1284
- this.quoteDraftService.updateActivePriceList(priceListId);
840
+ updateFlowParams() {
841
+ this.flowRouterService
842
+ .getFlowSubpath$()
843
+ .pipe(map(path => { var _a; return (_a = path.split('/')) === null || _a === void 0 ? void 0 : _a[0]; }), takeUntil(this.cleanup$))
844
+ .subscribe(flowPath => this.integrationState.patchState({ flowPath }));
845
+ this.flowRouterService.route$
846
+ .pipe(map(path => path.queryParams['productId']), takeUntil(this.cleanup$))
847
+ .subscribe(productId => this.integrationState.patchState({ productId }));
1285
848
  }
1286
- toggleCartOverlay(cart, event) {
1287
- event.stopPropagation();
1288
- if (!this.isReadonlyMode()) {
1289
- if (!cart.overlayPanel.overlayVisible) {
1290
- document.dispatchEvent(new Event('click'));
1291
- }
1292
- cart === null || cart === void 0 ? void 0 : cart.overlayPanel.toggle(event);
849
+ prepareConfiguration$(lineItemId) {
850
+ if (!lineItemId) {
851
+ return of(undefined);
1293
852
  }
853
+ return this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_PRICE_LIST', {
854
+ lineItemId,
855
+ });
1294
856
  }
1295
- saveQuote$(stayOnPage = false) {
1296
- const quoteDraft = this.quoteDraftService.quoteDraftForActivePriceList;
1297
- if (!quoteDraft) {
857
+ legacyApplyConfiguration() {
858
+ const quoteDraft = this.quoteDraftService.quoteDraft;
859
+ const lineItem = this.configurationService.getSnapshot();
860
+ if (!quoteDraft || !lineItem) {
1298
861
  return of(undefined);
1299
862
  }
1300
- this.isSaveInProgress$.next(true);
1301
- return this.quoteApiService.upsertQuote(quoteDraft).pipe(tap(({ quoteId }) => {
1302
- this.quoteDraftService.hasUnsavedChanges = false;
1303
- if (!stayOnPage) {
1304
- this.back(quoteId);
1305
- }
1306
- }), finalize(() => this.isSaveInProgress$.next(false)), map(noop), takeUntil(this.destroyed$));
1307
- }
1308
- queryName$(objectName, id) {
1309
- if (!id) {
1310
- return of('');
863
+ const isNewLineItem = quoteDraft.currentState.every(li => li.id !== lineItem.id);
864
+ let updatedState;
865
+ if (isNewLineItem) {
866
+ updatedState = [...quoteDraft.currentState, lineItem];
1311
867
  }
1312
- const searchRequest = {
1313
- count: 1,
1314
- rawCondition: `Id = '${id}'`,
1315
- fields: ['Name'],
1316
- };
1317
- return this.sfApiService.query(searchRequest, objectName).pipe(map(result => { var _a, _b; return (_b = (_a = result[0]) === null || _a === void 0 ? void 0 : _a.Name) !== null && _b !== void 0 ? _b : ''; }), takeUntil(this.destroyed$));
1318
- }
1319
- getObjectDetails$() {
1320
- return this.contextService.resolve$().pipe(distinctUntilChanged((prevCtx, currCtx) => prevCtx.properties.Id === currCtx.properties.Id), map(ctx => {
1321
- const isAccountMode = ctx.mode === ConfigurationContextMode.ACCOUNT;
1322
- const isQuoteMode = ctx.mode === ConfigurationContextMode.QUOTE;
1323
- return {
1324
- accountId: isAccountMode ? ctx.properties.Id : ctx.properties.AccountId,
1325
- opportunityId: ctx.properties.OpportunityId,
1326
- quoteId: isQuoteMode ? ctx.properties.Id : undefined,
1327
- quoteName: isQuoteMode ? ctx.properties.Name : undefined,
1328
- quoteNumber: isQuoteMode ? ctx.properties.QuoteNumber : undefined,
1329
- };
1330
- }), switchMap(details => combineLatest([
1331
- of(details),
1332
- this.queryName$('Account', details.accountId),
1333
- this.queryName$('Opportunity', details.opportunityId),
1334
- ])), map(([details, accountName, opportunityName]) => (Object.assign(Object.assign({}, details), { accountName, opportunityName }))));
1335
- }
1336
- formatMetric(value) {
1337
- return (value ? Number(value) : 0).toFixed(2);
1338
- }
1339
- getDraftItems$() {
1340
- return combineLatest([
1341
- this.flowConfiguration.get(),
1342
- this.integrationState.state$.pipe(map(state => state.modifiedAssets), distinctUntilChanged()),
1343
- ]).pipe(map(([lineItems, modifiedAssets]) => {
1344
- const currentTerms = lineItems.reduce((acc, li) => {
1345
- var _a;
1346
- const assetId = li.assetId || li.openOrderLineItemId;
1347
- const isModified = isLineItemModified(li);
1348
- const currentTerm = (_a = getOriginParent(lineItems, li)) !== null && _a !== void 0 ? _a : li;
1349
- if (isModified || (assetId && (modifiedAssets === null || modifiedAssets === void 0 ? void 0 : modifiedAssets[assetId]))) {
1350
- acc.push(currentTerm);
1351
- }
1352
- return acc;
1353
- }, []);
1354
- const uniqCurrentTerms = currentTerms.filter((value, index, array) => array.indexOf(value) === index);
1355
- return uniqCurrentTerms;
1356
- }));
1357
- }
1358
- getAssets$() {
1359
- return this.flowConfiguration
1360
- .get()
1361
- .pipe(map(lineItems => lineItems.filter(li => (!!li.assetId || !!li.openOrderLineItemId) && !li.rampInstanceId)));
1362
- }
1363
- generateProducts(lineItems) {
1364
- const date = new Date();
1365
- date.setHours(0, 0, 0, 0);
1366
- const now = date.getTime();
1367
- const termParentIds = lineItems.map(li => li.rampInstanceId).filter(Boolean);
1368
- const lineItemsRampInstanceIdMap = lineItems.reduce((acc, li) => {
1369
- var _a;
1370
- acc[(_a = li.rampInstanceId) !== null && _a !== void 0 ? _a : ''] = li;
1371
- return acc;
1372
- }, {});
1373
- return lineItems.reduce((result, li) => {
1374
- // find main term line item
1375
- if (li.rampInstanceId) {
1376
- return result;
1377
- }
1378
- // find current term line item
1379
- let target = li;
1380
- while (target && target.endDate && new Date(target.endDate).getTime() <= now) {
1381
- target = lineItemsRampInstanceIdMap[li.id];
1382
- }
1383
- if (target && target.productId) {
1384
- result.push({
1385
- id: target.id,
1386
- productId: target.productId,
1387
- name: target.name,
1388
- configurable: target.properties['#configurable'] === 'true',
1389
- deleted: target.actionCode === 'DELETE',
1390
- hasTerm: termParentIds.includes(target.id),
1391
- qty: target.qty,
1392
- mrr: this.formatMetric(target.properties.VDM_Total_MRR),
1393
- nrr: this.formatMetric(target.properties.VDM_Total_NRR),
1394
- });
1395
- }
1396
- return result;
1397
- }, []);
1398
- }
1399
- isReadonlyMode() {
1400
- var _a;
1401
- return (((_a = this.quoteDraftService.quoteDraft) === null || _a === void 0 ? void 0 : _a.context.properties.mode) === ConfigurationContextMode.ACCOUNT &&
1402
- !this.quoteDraftService.hasProducts);
1403
- }
1404
- isUpsellQuoteWithoutChanges() {
1405
- const noUpdates = this.quoteDraftService.activeCurrentState.every(lineItem => lineItem.actionCode === 'EXIST');
1406
- const sameNumberOfProducts = this.quoteDraftService.getInitialCurrentState().length === this.quoteDraftService.activeCurrentState.length;
1407
- return noUpdates && sameNumberOfProducts;
868
+ else {
869
+ updatedState = quoteDraft.currentState.map(li => (li.id === lineItem.id ? lineItem : li));
870
+ }
871
+ return this.flowConfigurationService.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }));
1408
872
  }
1409
873
  }
1410
- FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i1$2.ContextService }, { token: i1$2.QuoteDraftService }, { token: i2.QuoteApiService }, { token: i2.SalesforceApiService }, { token: i1$2.FlowConfigurationService }, { token: FlowRouterService }, { token: FlowDialogService }, { token: i5.IntegrationState }], target: i0.ɵɵFactoryTarget.Component });
1411
- FlowHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowHeaderComponent, selector: "vl-flow-header", ngImport: i0, template: "<ng-container *ngIf=\"contextProperties$ | async as contextProperties\">\n <ng-container *ngIf=\"objectDetails$ | async as details\">\n <div class=\"flow-info\">\n <nav class=\"nav-item nav-back\" (click)=\"back()\">\n <i class=\"nav-icon vl-icon vl-icon-back\"></i>\n </nav>\n\n <ng-container *ngIf=\"isAccountMode$ | async\">\n <nav\n class=\"account-name nav-item\"\n [pTooltip]=\"contextProperties.Name ?? ''\"\n tooltipPosition=\"bottom\"\n [showDelay]=\"1000\"\n >\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(contextProperties.Id)\">{{ contextProperties.Name }}</a>\n </nav>\n </ng-container>\n\n <ng-container *ngIf=\"isQuoteMode$ | async\">\n <span class=\"nav-item\">Quote #{{ details.quoteNumber }}</span>\n\n <span class=\"dot-separator\"></span>\n\n <nav class=\"nav-item\" (click)=\"quoteDetails.toggle($event)\">\n <span>{{ status$ | async }}</span>\n\n <i *ngIf=\"!quoteDetails.overlayVisible\" class=\"vl-icon vl-arrow-down icon-with-margin\"></i>\n <i *ngIf=\"quoteDetails.overlayVisible\" class=\"vl-icon vl-arrow-up icon-with-margin\"></i>\n </nav>\n\n <p-overlayPanel styleClass=\"catalog-overlay quote-info-overlay\" #quoteDetails>\n <ng-template pTemplate>\n <div class=\"quote-info\">\n <div class=\"title\">\n <span>Quote Information</span>\n <span class=\"close-action\" (click)=\"quoteDetails.hide()\">\n <i class=\"vl-icon vl-cross\"></i>\n </span>\n </div>\n\n <div class=\"details\">\n <div class=\"details-row\">\n <div class=\"label\">Account Name</div>\n <div class=\"value\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.accountId)\">\n {{ details.accountName }}\n </a>\n </div>\n </div>\n <div class=\"details-row\">\n <div class=\"label\">Opportunity Name</div>\n <div class=\"value\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.opportunityId)\">\n {{ details.opportunityName }}\n </a>\n </div>\n </div>\n <div class=\"details-row\">\n <div class=\"label\">Quote Name</div>\n <div class=\"value\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.quoteId)\">\n {{ details.quoteName }}\n </a>\n </div>\n </div>\n <div class=\"details-row\">\n <div class=\"label\">Quote Number</div>\n <div class=\"value\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.quoteId)\">\n {{ details.quoteNumber }}\n </a>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n </p-overlayPanel>\n </ng-container>\n </div>\n\n <div class=\"flow-navigation\">\n <ng-container *vlLet=\"isReadonlyMode$ | async as isReadonlyMode\">\n <nav\n class=\"nav-item\"\n *vlLet=\"assetsCount$ | async as assetsCount\"\n [ngClass]=\"{ active: (isAssetsRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToAssets()\"\n >\n Assets\n <div *ngIf=\"assetsCount\" class=\"counter\">{{ assetsCount }}</div>\n </nav>\n <nav\n class=\"nav-item\"\n [ngClass]=\"{ active: (isCatalogRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToCatalog()\"\n >\n Catalog\n </nav>\n <nav\n *vlLet=\"isConfigurationRoute$ | async as isConfigurationRoute\"\n class=\"nav-item\"\n [ngClass]=\"{ active: isConfigurationRoute, disabled: !isConfigurationRoute }\"\n >\n Configurator\n </nav>\n <ng-container *vlLet=\"products$ | async as products\">\n <nav\n class=\"nav-item\"\n [ngClass]=\"{ active: (isCartRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToShoppingCart()\"\n >\n Shopping Cart\n <div *ngIf=\"products?.length\" class=\"counter\">{{ products?.length }}</div>\n\n <nav\n class=\"nav-popover-toggle\"\n [ngClass]=\"{ active: (isCartRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"toggleCartOverlay(cart, $event)\"\n >\n <i *ngIf=\"!cart?.overlayPanel?.overlayVisible\" class=\"vl-icon vl-arrow-down icon-with-margin\"></i>\n <i *ngIf=\"cart?.overlayPanel?.overlayVisible\" class=\"vl-icon vl-arrow-up icon-with-margin\"></i>\n </nav>\n </nav>\n\n <vl-cart-preview #cart [products]=\"products ?? []\"></vl-cart-preview>\n </ng-container>\n </ng-container>\n </div>\n\n <div class=\"flow-controls\">\n <ng-container *ngIf=\"(isReadonlyMode$ | async) === false\">\n <ng-container *vlLet=\"activePriceList$ | async as priceList\">\n <div class=\"price-plan\">\n <ng-container *vlLet=\"assetPriceLists$ | async as assetPriceLists\">\n <ng-container\n *ngIf=\"(isAccountMode$ | async) && assetPriceLists && assetPriceLists.length > 1; else singlePriceList\"\n >\n <nav class=\"nav-item\" (click)=\"priceListsOverlay?.toggle($event)\">\n <span>{{ priceList?.name }}</span>\n <i *ngIf=\"!priceListsOverlay?.overlayVisible\" class=\"vl-icon vl-arrow-down icon-with-margin\"></i>\n <i *ngIf=\"priceListsOverlay?.overlayVisible\" class=\"vl-icon vl-arrow-up icon-with-margin\"></i>\n </nav>\n\n <p-overlayPanel styleClass=\"price-list-overlay\" #priceListsOverlay>\n <ng-template pTemplate>\n <span\n *ngFor=\"let option of assetPriceLists\"\n class=\"price-list-option\"\n [class.active]=\"priceList?.id === option.id\"\n (click)=\"selectPriceList(option.id); priceListsOverlay.hide()\"\n >\n {{ option.name }}\n </span>\n </ng-template>\n </p-overlayPanel>\n </ng-container>\n </ng-container>\n\n <ng-template #singlePriceList>\n <div>{{ priceList?.name }}</div>\n </ng-template>\n\n <div *ngIf=\"contextProperties.StartDate\">{{ contextProperties.StartDate | date : dateFormat }}</div>\n </div>\n </ng-container>\n </ng-container>\n\n <vl-metrics></vl-metrics>\n\n <ng-container *vlLet=\"isCartRoute$ | async as isCartRoute\">\n <ng-container *vlLet=\"isReadonlyMode$ | async as isReadonlyMode\">\n <ng-container *vlLet=\"isSaveInProgress$ | async as isSaveInProgress\">\n <ng-container *vlLet=\"isSubmitInProgress$ | async as isSubmitInProgress\">\n <p-splitButton\n *ngIf=\"!isSaveInProgress && !isSubmitInProgress\"\n #splitButton\n label=\"Save to Quote\"\n (onClick)=\"saveButtonClickHandler(isCartRoute === true)\"\n [model]=\"getSplitButtonActions(isCartRoute === true)\"\n [disabled]=\"isReadonlyMode === true\"\n styleClass=\"catalog-split-button p-button-outlined\"\n [class.opened]=\"splitButton?.menu?.visible\"\n icon=\"vl-icon vl-arrow-down\"\n [menuStyle]=\"{ width: '144px' }\"\n >\n </p-splitButton>\n\n <p-button\n *ngIf=\"isSaveInProgress\"\n class=\"save-button\"\n styleClass=\"p-button\"\n label=\"Saving\"\n [loading]=\"true\"\n ></p-button>\n\n <p-button\n *ngIf=\"isSubmitInProgress\"\n class=\"submit-button\"\n styleClass=\"p-button\"\n label=\"Submitting\"\n [loading]=\"true\"\n ></p-button>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\n", styles: [":host{font-family:var(--cg-font-family);display:flex;align-items:center;height:48px;width:100%;background-color:var(--cg-primary-color);color:#fff;padding:0 16px;flex-shrink:0}:host *{font-family:var(--cg-font-family)}::ng-deep .p-overlaypanel.quote-info-overlay{margin-left:-16px}.quote-info{width:348px}.quote-info .title{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;font-size:16px;font-style:normal;font-weight:500;line-height:20px}.quote-info .title .close-action{padding:4px}.quote-info .title .vl-icon{cursor:pointer}.quote-info .details .details-row{display:flex;align-items:center}.quote-info .details .details-row .label,.quote-info .details .details-row .value{flex:1;padding:8px;color:var(--cg-black)}.quote-info .details .details-row .label{font-size:12px;font-weight:500;line-height:16px;letter-spacing:.2px}.quote-info .details .details-row .value{text-align:right}.quote-info .details .details-row a{color:var(--cg-black);text-decoration:none;font-size:12px;line-height:18px;letter-spacing:.3px;border-bottom:1px solid var(--cg-black)}:host ::ng-deep .catalog-split-button .p-splitbutton-defaultbutton{padding:8px 0 8px 16px;border-top-left-radius:24px;border-bottom-left-radius:24px;color:var(--cg-white);background:var(--cg-primary-color);border-color:var(--cg-white)}:host ::ng-deep .catalog-split-button .p-splitbutton-defaultbutton .p-button-icon{display:none}:host ::ng-deep .catalog-split-button .p-splitbutton-menubutton{width:16px;box-sizing:content-box;padding:8px;border-top-right-radius:24px;border-bottom-right-radius:24px;border-left:none;color:var(--cg-white);background:var(--cg-primary-color);border-color:var(--cg-white)}:host ::ng-deep .catalog-split-button .p-splitbutton-menubutton:hover:enabled{border-left:none}:host ::ng-deep .catalog-split-button .p-button{line-height:16px}:host ::ng-deep .catalog-split-button .p-button-label{font-size:12px;font-weight:300}:host ::ng-deep .catalog-split-button:hover .p-splitbutton-defaultbutton,:host ::ng-deep .catalog-split-button:hover .p-splitbutton-menubutton{color:var(--cg-primary-color);background:var(--cg-white);border-color:var(--cg-primary-color)}:host ::ng-deep .catalog-split-button:hover .p-splitbutton-defaultbutton:hover,:host ::ng-deep .catalog-split-button:hover .p-splitbutton-menubutton:hover{color:var(--cg-primary-color);background:var(--cg-white);border-color:var(--cg-primary-color)}:host ::ng-deep .catalog-split-button .p-menu-overlay{overflow:hidden;margin-top:4px;padding:0;border-radius:8px;box-shadow:0 8px 32px #0000001a}:host ::ng-deep .catalog-split-button .p-menu-overlay .p-menuitem:not(:last-child){border-bottom:1px solid var(--cg-border-color)}:host ::ng-deep .catalog-split-button .p-menu-overlay .p-menuitem-link{padding:8px;color:var(--cg-primary-color);white-space:nowrap;font-size:12px;font-weight:300;line-height:16px;letter-spacing:.3px}:host ::ng-deep .catalog-split-button .p-menu-overlay .p-menuitem-link .p-menuitem-text{color:var(--cg-primary-color)}:host ::ng-deep .catalog-split-button .p-menu-overlay .p-menuitem-link:hover{background:var(--cg-bg-color)}:host ::ng-deep p-splitButton.opened .p-button-icon{transform:rotate(180deg)}:host ::ng-deep p-splitButton.opened .p-splitbutton-defaultbutton,:host ::ng-deep p-splitButton.opened .p-splitbutton-menubutton{color:var(--cg-primary-color);background:var(--cg-white);border-color:var(--cg-primary-color)}:host ::ng-deep .save-button,:host ::ng-deep .submit-button{height:32px;width:136px;display:flex}:host ::ng-deep .save-button .p-button,:host ::ng-deep .submit-button .p-button{border-radius:24px;width:100%;height:100%;background:rgba(255,255,255,.3);opacity:1;border:none}:host ::ng-deep .save-button .p-button .p-button-label,:host ::ng-deep .submit-button .p-button .p-button-label{font-size:12px;line-height:16px;letter-spacing:.3px;white-space:nowrap}.vl-icon{display:inline-block}.flow-info{flex-shrink:0;display:flex;gap:8px;align-items:center}.flow-info .nav-item{font-weight:400;font-size:12px;line-height:16px;letter-spacing:.3px}.flow-info .nav-popover-toggle{margin-left:-8px}.flow-info .nav-item:not(.disabled):hover,.flow-info .nav-popover-toggle:not(.disabled):hover{opacity:.6}nav{display:flex;align-items:center;cursor:pointer;height:32px}nav.disabled{opacity:.6;cursor:default}nav .icon-with-margin{margin:0 4px}nav a{color:#fff}nav.account-name{margin-left:4px;max-width:200px;overflow:hidden;text-overflow:ellipsis}nav.nav-popover-toggle{width:16px;display:flex;justify-content:center}nav.nav-popover-toggle i{pointer-events:none;margin:0}nav i{pointer-events:none}.metrics__row{display:flex;justify-content:space-between;gap:2px}.dot-separator:after{content:\"\";display:block;width:2px;height:2px;border-radius:50%;background:#fff}.slash-separator:after{content:\"\";display:block;background:#fff;width:1px;height:16px}.flow-navigation{margin-left:16px;margin-right:auto;display:flex;gap:8px;justify-content:center}.flow-navigation .nav-item{padding:8px 16px;border-radius:32px;color:#ffffff80;font-size:12px;line-height:16px;letter-spacing:.3px;white-space:nowrap}.flow-navigation .nav-item:not(.disabled):hover:not(.active){color:var(--cg-white);background:rgba(255,255,255,.1)}.flow-navigation .nav-item:not(.disabled).active{color:var(--cg-white)}.flow-navigation .cart-nav-container{display:flex}.flow-navigation .nav-popover-toggle{margin-left:8px}.price-list-option{padding:8px;color:var(--vl-primary-color);cursor:pointer}.price-list-option.active,.price-list-option:hover{background:var(--vl-secondary-nav-bg)}.flow-controls{flex-shrink:0;display:flex;align-items:center;gap:8px;font-size:12px;line-height:16px}.flow-controls .price-plan{color:#ffffffb3}.counter{margin-left:8px;height:16px;min-width:16px;text-align:center;background:rgba(255,255,255,.2);border-radius:16px;padding:0 4px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i8.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i2$1.LetDirective, selector: "[vlLet]", inputs: ["vlLet"] }, { kind: "directive", type: i10$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: CartPreviewComponent, selector: "vl-cart-preview", inputs: ["products"] }, { kind: "component", type: i13.SplitButton, selector: "p-splitButton", inputs: ["model", "icon", "iconPos", "label", "style", "styleClass", "menuStyle", "menuStyleClass", "disabled", "tabindex", "appendTo", "dir", "expandAriaLabel", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onClick", "onDropdownClick"] }, { kind: "component", type: MetricsComponent, selector: "vl-metrics" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1412
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, decorators: [{
1413
- type: Component,
1414
- args: [{ selector: 'vl-flow-header', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"contextProperties$ | async as contextProperties\">\n <ng-container *ngIf=\"objectDetails$ | async as details\">\n <div class=\"flow-info\">\n <nav class=\"nav-item nav-back\" (click)=\"back()\">\n <i class=\"nav-icon vl-icon vl-icon-back\"></i>\n </nav>\n\n <ng-container *ngIf=\"isAccountMode$ | async\">\n <nav\n class=\"account-name nav-item\"\n [pTooltip]=\"contextProperties.Name ?? ''\"\n tooltipPosition=\"bottom\"\n [showDelay]=\"1000\"\n >\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(contextProperties.Id)\">{{ contextProperties.Name }}</a>\n </nav>\n </ng-container>\n\n <ng-container *ngIf=\"isQuoteMode$ | async\">\n <span class=\"nav-item\">Quote #{{ details.quoteNumber }}</span>\n\n <span class=\"dot-separator\"></span>\n\n <nav class=\"nav-item\" (click)=\"quoteDetails.toggle($event)\">\n <span>{{ status$ | async }}</span>\n\n <i *ngIf=\"!quoteDetails.overlayVisible\" class=\"vl-icon vl-arrow-down icon-with-margin\"></i>\n <i *ngIf=\"quoteDetails.overlayVisible\" class=\"vl-icon vl-arrow-up icon-with-margin\"></i>\n </nav>\n\n <p-overlayPanel styleClass=\"catalog-overlay quote-info-overlay\" #quoteDetails>\n <ng-template pTemplate>\n <div class=\"quote-info\">\n <div class=\"title\">\n <span>Quote Information</span>\n <span class=\"close-action\" (click)=\"quoteDetails.hide()\">\n <i class=\"vl-icon vl-cross\"></i>\n </span>\n </div>\n\n <div class=\"details\">\n <div class=\"details-row\">\n <div class=\"label\">Account Name</div>\n <div class=\"value\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.accountId)\">\n {{ details.accountName }}\n </a>\n </div>\n </div>\n <div class=\"details-row\">\n <div class=\"label\">Opportunity Name</div>\n <div class=\"value\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.opportunityId)\">\n {{ details.opportunityName }}\n </a>\n </div>\n </div>\n <div class=\"details-row\">\n <div class=\"label\">Quote Name</div>\n <div class=\"value\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.quoteId)\">\n {{ details.quoteName }}\n </a>\n </div>\n </div>\n <div class=\"details-row\">\n <div class=\"label\">Quote Number</div>\n <div class=\"value\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.quoteId)\">\n {{ details.quoteNumber }}\n </a>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n </p-overlayPanel>\n </ng-container>\n </div>\n\n <div class=\"flow-navigation\">\n <ng-container *vlLet=\"isReadonlyMode$ | async as isReadonlyMode\">\n <nav\n class=\"nav-item\"\n *vlLet=\"assetsCount$ | async as assetsCount\"\n [ngClass]=\"{ active: (isAssetsRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToAssets()\"\n >\n Assets\n <div *ngIf=\"assetsCount\" class=\"counter\">{{ assetsCount }}</div>\n </nav>\n <nav\n class=\"nav-item\"\n [ngClass]=\"{ active: (isCatalogRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToCatalog()\"\n >\n Catalog\n </nav>\n <nav\n *vlLet=\"isConfigurationRoute$ | async as isConfigurationRoute\"\n class=\"nav-item\"\n [ngClass]=\"{ active: isConfigurationRoute, disabled: !isConfigurationRoute }\"\n >\n Configurator\n </nav>\n <ng-container *vlLet=\"products$ | async as products\">\n <nav\n class=\"nav-item\"\n [ngClass]=\"{ active: (isCartRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToShoppingCart()\"\n >\n Shopping Cart\n <div *ngIf=\"products?.length\" class=\"counter\">{{ products?.length }}</div>\n\n <nav\n class=\"nav-popover-toggle\"\n [ngClass]=\"{ active: (isCartRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"toggleCartOverlay(cart, $event)\"\n >\n <i *ngIf=\"!cart?.overlayPanel?.overlayVisible\" class=\"vl-icon vl-arrow-down icon-with-margin\"></i>\n <i *ngIf=\"cart?.overlayPanel?.overlayVisible\" class=\"vl-icon vl-arrow-up icon-with-margin\"></i>\n </nav>\n </nav>\n\n <vl-cart-preview #cart [products]=\"products ?? []\"></vl-cart-preview>\n </ng-container>\n </ng-container>\n </div>\n\n <div class=\"flow-controls\">\n <ng-container *ngIf=\"(isReadonlyMode$ | async) === false\">\n <ng-container *vlLet=\"activePriceList$ | async as priceList\">\n <div class=\"price-plan\">\n <ng-container *vlLet=\"assetPriceLists$ | async as assetPriceLists\">\n <ng-container\n *ngIf=\"(isAccountMode$ | async) && assetPriceLists && assetPriceLists.length > 1; else singlePriceList\"\n >\n <nav class=\"nav-item\" (click)=\"priceListsOverlay?.toggle($event)\">\n <span>{{ priceList?.name }}</span>\n <i *ngIf=\"!priceListsOverlay?.overlayVisible\" class=\"vl-icon vl-arrow-down icon-with-margin\"></i>\n <i *ngIf=\"priceListsOverlay?.overlayVisible\" class=\"vl-icon vl-arrow-up icon-with-margin\"></i>\n </nav>\n\n <p-overlayPanel styleClass=\"price-list-overlay\" #priceListsOverlay>\n <ng-template pTemplate>\n <span\n *ngFor=\"let option of assetPriceLists\"\n class=\"price-list-option\"\n [class.active]=\"priceList?.id === option.id\"\n (click)=\"selectPriceList(option.id); priceListsOverlay.hide()\"\n >\n {{ option.name }}\n </span>\n </ng-template>\n </p-overlayPanel>\n </ng-container>\n </ng-container>\n\n <ng-template #singlePriceList>\n <div>{{ priceList?.name }}</div>\n </ng-template>\n\n <div *ngIf=\"contextProperties.StartDate\">{{ contextProperties.StartDate | date : dateFormat }}</div>\n </div>\n </ng-container>\n </ng-container>\n\n <vl-metrics></vl-metrics>\n\n <ng-container *vlLet=\"isCartRoute$ | async as isCartRoute\">\n <ng-container *vlLet=\"isReadonlyMode$ | async as isReadonlyMode\">\n <ng-container *vlLet=\"isSaveInProgress$ | async as isSaveInProgress\">\n <ng-container *vlLet=\"isSubmitInProgress$ | async as isSubmitInProgress\">\n <p-splitButton\n *ngIf=\"!isSaveInProgress && !isSubmitInProgress\"\n #splitButton\n label=\"Save to Quote\"\n (onClick)=\"saveButtonClickHandler(isCartRoute === true)\"\n [model]=\"getSplitButtonActions(isCartRoute === true)\"\n [disabled]=\"isReadonlyMode === true\"\n styleClass=\"catalog-split-button p-button-outlined\"\n [class.opened]=\"splitButton?.menu?.visible\"\n icon=\"vl-icon vl-arrow-down\"\n [menuStyle]=\"{ width: '144px' }\"\n >\n </p-splitButton>\n\n <p-button\n *ngIf=\"isSaveInProgress\"\n class=\"save-button\"\n styleClass=\"p-button\"\n label=\"Saving\"\n [loading]=\"true\"\n ></p-button>\n\n <p-button\n *ngIf=\"isSubmitInProgress\"\n class=\"submit-button\"\n styleClass=\"p-button\"\n label=\"Submitting\"\n [loading]=\"true\"\n ></p-button>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\n", styles: [":host{font-family:var(--cg-font-family);display:flex;align-items:center;height:48px;width:100%;background-color:var(--cg-primary-color);color:#fff;padding:0 16px;flex-shrink:0}:host *{font-family:var(--cg-font-family)}::ng-deep .p-overlaypanel.quote-info-overlay{margin-left:-16px}.quote-info{width:348px}.quote-info .title{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;font-size:16px;font-style:normal;font-weight:500;line-height:20px}.quote-info .title .close-action{padding:4px}.quote-info .title .vl-icon{cursor:pointer}.quote-info .details .details-row{display:flex;align-items:center}.quote-info .details .details-row .label,.quote-info .details .details-row .value{flex:1;padding:8px;color:var(--cg-black)}.quote-info .details .details-row .label{font-size:12px;font-weight:500;line-height:16px;letter-spacing:.2px}.quote-info .details .details-row .value{text-align:right}.quote-info .details .details-row a{color:var(--cg-black);text-decoration:none;font-size:12px;line-height:18px;letter-spacing:.3px;border-bottom:1px solid var(--cg-black)}:host ::ng-deep .catalog-split-button .p-splitbutton-defaultbutton{padding:8px 0 8px 16px;border-top-left-radius:24px;border-bottom-left-radius:24px;color:var(--cg-white);background:var(--cg-primary-color);border-color:var(--cg-white)}:host ::ng-deep .catalog-split-button .p-splitbutton-defaultbutton .p-button-icon{display:none}:host ::ng-deep .catalog-split-button .p-splitbutton-menubutton{width:16px;box-sizing:content-box;padding:8px;border-top-right-radius:24px;border-bottom-right-radius:24px;border-left:none;color:var(--cg-white);background:var(--cg-primary-color);border-color:var(--cg-white)}:host ::ng-deep .catalog-split-button .p-splitbutton-menubutton:hover:enabled{border-left:none}:host ::ng-deep .catalog-split-button .p-button{line-height:16px}:host ::ng-deep .catalog-split-button .p-button-label{font-size:12px;font-weight:300}:host ::ng-deep .catalog-split-button:hover .p-splitbutton-defaultbutton,:host ::ng-deep .catalog-split-button:hover .p-splitbutton-menubutton{color:var(--cg-primary-color);background:var(--cg-white);border-color:var(--cg-primary-color)}:host ::ng-deep .catalog-split-button:hover .p-splitbutton-defaultbutton:hover,:host ::ng-deep .catalog-split-button:hover .p-splitbutton-menubutton:hover{color:var(--cg-primary-color);background:var(--cg-white);border-color:var(--cg-primary-color)}:host ::ng-deep .catalog-split-button .p-menu-overlay{overflow:hidden;margin-top:4px;padding:0;border-radius:8px;box-shadow:0 8px 32px #0000001a}:host ::ng-deep .catalog-split-button .p-menu-overlay .p-menuitem:not(:last-child){border-bottom:1px solid var(--cg-border-color)}:host ::ng-deep .catalog-split-button .p-menu-overlay .p-menuitem-link{padding:8px;color:var(--cg-primary-color);white-space:nowrap;font-size:12px;font-weight:300;line-height:16px;letter-spacing:.3px}:host ::ng-deep .catalog-split-button .p-menu-overlay .p-menuitem-link .p-menuitem-text{color:var(--cg-primary-color)}:host ::ng-deep .catalog-split-button .p-menu-overlay .p-menuitem-link:hover{background:var(--cg-bg-color)}:host ::ng-deep p-splitButton.opened .p-button-icon{transform:rotate(180deg)}:host ::ng-deep p-splitButton.opened .p-splitbutton-defaultbutton,:host ::ng-deep p-splitButton.opened .p-splitbutton-menubutton{color:var(--cg-primary-color);background:var(--cg-white);border-color:var(--cg-primary-color)}:host ::ng-deep .save-button,:host ::ng-deep .submit-button{height:32px;width:136px;display:flex}:host ::ng-deep .save-button .p-button,:host ::ng-deep .submit-button .p-button{border-radius:24px;width:100%;height:100%;background:rgba(255,255,255,.3);opacity:1;border:none}:host ::ng-deep .save-button .p-button .p-button-label,:host ::ng-deep .submit-button .p-button .p-button-label{font-size:12px;line-height:16px;letter-spacing:.3px;white-space:nowrap}.vl-icon{display:inline-block}.flow-info{flex-shrink:0;display:flex;gap:8px;align-items:center}.flow-info .nav-item{font-weight:400;font-size:12px;line-height:16px;letter-spacing:.3px}.flow-info .nav-popover-toggle{margin-left:-8px}.flow-info .nav-item:not(.disabled):hover,.flow-info .nav-popover-toggle:not(.disabled):hover{opacity:.6}nav{display:flex;align-items:center;cursor:pointer;height:32px}nav.disabled{opacity:.6;cursor:default}nav .icon-with-margin{margin:0 4px}nav a{color:#fff}nav.account-name{margin-left:4px;max-width:200px;overflow:hidden;text-overflow:ellipsis}nav.nav-popover-toggle{width:16px;display:flex;justify-content:center}nav.nav-popover-toggle i{pointer-events:none;margin:0}nav i{pointer-events:none}.metrics__row{display:flex;justify-content:space-between;gap:2px}.dot-separator:after{content:\"\";display:block;width:2px;height:2px;border-radius:50%;background:#fff}.slash-separator:after{content:\"\";display:block;background:#fff;width:1px;height:16px}.flow-navigation{margin-left:16px;margin-right:auto;display:flex;gap:8px;justify-content:center}.flow-navigation .nav-item{padding:8px 16px;border-radius:32px;color:#ffffff80;font-size:12px;line-height:16px;letter-spacing:.3px;white-space:nowrap}.flow-navigation .nav-item:not(.disabled):hover:not(.active){color:var(--cg-white);background:rgba(255,255,255,.1)}.flow-navigation .nav-item:not(.disabled).active{color:var(--cg-white)}.flow-navigation .cart-nav-container{display:flex}.flow-navigation .nav-popover-toggle{margin-left:8px}.price-list-option{padding:8px;color:var(--vl-primary-color);cursor:pointer}.price-list-option.active,.price-list-option:hover{background:var(--vl-secondary-nav-bg)}.flow-controls{flex-shrink:0;display:flex;align-items:center;gap:8px;font-size:12px;line-height:16px}.flow-controls .price-plan{color:#ffffffb3}.counter{margin-left:8px;height:16px;min-width:16px;text-align:center;background:rgba(255,255,255,.2);border-radius:16px;padding:0 4px}\n"] }]
1415
- }], ctorParameters: function () { return [{ type: i1$2.ContextService }, { type: i1$2.QuoteDraftService }, { type: i2.QuoteApiService }, { type: i2.SalesforceApiService }, { type: i1$2.FlowConfigurationService }, { type: FlowRouterService }, { type: FlowDialogService }, { type: i5.IntegrationState }]; } });
1416
-
1417
- class MetricsModule {
1418
- }
1419
- MetricsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MetricsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1420
- MetricsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: MetricsModule, declarations: [MetricsComponent], imports: [CommonModule,
1421
- FormsModule,
1422
- ReactiveFormsModule,
1423
- DragDropModule,
1424
- ButtonModule,
1425
- OverlayPanelModule,
1426
- SidebarModule,
1427
- InputTextModule,
1428
- CheckboxModule,
1429
- LetDirectiveModule,
1430
- VirtualScrollerModule,
1431
- ErrorTooltipModule,
1432
- HiddenTextTooltipModule,
1433
- SdkPipesModule], exports: [MetricsComponent] });
1434
- MetricsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MetricsModule, imports: [CommonModule,
1435
- FormsModule,
1436
- ReactiveFormsModule,
1437
- DragDropModule,
1438
- ButtonModule,
1439
- OverlayPanelModule,
1440
- SidebarModule,
1441
- InputTextModule,
1442
- CheckboxModule,
1443
- LetDirectiveModule,
1444
- VirtualScrollerModule,
1445
- ErrorTooltipModule,
1446
- HiddenTextTooltipModule,
1447
- SdkPipesModule] });
1448
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MetricsModule, decorators: [{
1449
- type: NgModule,
1450
- args: [{
1451
- declarations: [MetricsComponent],
1452
- imports: [
1453
- CommonModule,
1454
- FormsModule,
1455
- ReactiveFormsModule,
1456
- DragDropModule,
1457
- ButtonModule,
1458
- OverlayPanelModule,
1459
- SidebarModule,
1460
- InputTextModule,
1461
- CheckboxModule,
1462
- LetDirectiveModule,
1463
- VirtualScrollerModule,
1464
- ErrorTooltipModule,
1465
- HiddenTextTooltipModule,
1466
- SdkPipesModule,
1467
- ],
1468
- exports: [MetricsComponent],
1469
- }]
1470
- }] });
1471
-
1472
- class FlowHeaderModule {
1473
- }
1474
- FlowHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1475
- FlowHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderModule, declarations: [FlowHeaderComponent], imports: [CommonModule,
1476
- OverlayPanelModule,
1477
- LetDirectiveModule,
1478
- TooltipModule,
1479
- ButtonModule,
1480
- CartPreviewModule,
1481
- SplitButtonModule,
1482
- MetricsModule,
1483
- SdkPipesModule], exports: [FlowHeaderComponent] });
1484
- FlowHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderModule, imports: [CommonModule,
1485
- OverlayPanelModule,
1486
- LetDirectiveModule,
1487
- TooltipModule,
1488
- ButtonModule,
1489
- CartPreviewModule,
1490
- SplitButtonModule,
1491
- MetricsModule,
1492
- SdkPipesModule] });
1493
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderModule, decorators: [{
1494
- type: NgModule,
1495
- args: [{
1496
- declarations: [FlowHeaderComponent],
1497
- imports: [
1498
- CommonModule,
1499
- OverlayPanelModule,
1500
- LetDirectiveModule,
1501
- TooltipModule,
1502
- ButtonModule,
1503
- CartPreviewModule,
1504
- SplitButtonModule,
1505
- MetricsModule,
1506
- SdkPipesModule,
1507
- ],
1508
- exports: [FlowHeaderComponent],
1509
- }]
1510
- }] });
874
+ FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, deps: [{ token: i5.IntegrationState }, { token: FlowRouterService }, { token: i2.QuoteDraftService }, { token: i2.ConfigurationService }, { token: i2.ConfigurationStateService }, { token: FlowDialogService }, { token: i2.FlowConfigurationService }, { token: i2.FlowInfoService }, { token: i2.FlowStateService }], target: i0.ɵɵFactoryTarget.Injectable });
875
+ FlowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService });
876
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, decorators: [{
877
+ type: Injectable
878
+ }], ctorParameters: function () { return [{ type: i5.IntegrationState }, { type: FlowRouterService }, { type: i2.QuoteDraftService }, { type: i2.ConfigurationService }, { type: i2.ConfigurationStateService }, { type: FlowDialogService }, { type: i2.FlowConfigurationService }, { type: i2.FlowInfoService }, { type: i2.FlowStateService }]; } });
1511
879
 
1512
- class FlowDocGenService {
880
+ class FlowGuidedSellingService {
1513
881
  constructor(integrationState) {
1514
882
  this.integrationState = integrationState;
1515
883
  this.cleanup$ = new Subject();
@@ -1522,53 +890,40 @@ class FlowDocGenService {
1522
890
  }
1523
891
  initSubscriptions() {
1524
892
  this.integrationState
1525
- .listen$(FlowAction.FLOW_OPEN_DOC_GEN)
893
+ .listen$(FlowAction.OPEN_GUIDED_SELLING)
1526
894
  .pipe(tap(() => this.isVisibleSubj$.next(true)), takeUntil(this.cleanup$))
1527
895
  .subscribe();
1528
896
  this.integrationState
1529
- .listen$(FlowAction.FLOW_CLOSE_DOC_GEN)
897
+ .listen$(FlowAction.CLOSE_GUIDED_SELLING)
1530
898
  .pipe(tap(() => this.isVisibleSubj$.next(false)), takeUntil(this.cleanup$))
1531
899
  .subscribe();
1532
900
  }
1533
901
  }
1534
- FlowDocGenService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDocGenService, deps: [{ token: i5.IntegrationState }], target: i0.ɵɵFactoryTarget.Injectable });
1535
- FlowDocGenService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDocGenService });
1536
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDocGenService, decorators: [{
902
+ FlowGuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, deps: [{ token: i2.IntegrationState }], target: i0.ɵɵFactoryTarget.Injectable });
903
+ FlowGuidedSellingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService });
904
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, decorators: [{
1537
905
  type: Injectable
1538
- }], ctorParameters: function () { return [{ type: i5.IntegrationState }]; } });
906
+ }], ctorParameters: function () { return [{ type: i2.IntegrationState }]; } });
1539
907
 
1540
908
  class FlowComponent {
1541
- constructor(routerService, quoteDraftService, flowService, docGenService, integrationState, contextService) {
909
+ constructor(routerService, flowService, flowInfo, guidedSellingService) {
1542
910
  this.routerService = routerService;
1543
- this.quoteDraftService = quoteDraftService;
1544
911
  this.flowService = flowService;
1545
- this.docGenService = docGenService;
1546
- this.integrationState = integrationState;
1547
- this.contextService = contextService;
912
+ this.flowInfo = flowInfo;
913
+ this.guidedSellingService = guidedSellingService;
1548
914
  this.isLoading$ = this.routerService.loading$;
1549
- this.showHeader$ = combineLatest([
1550
- this.routerService.route$,
1551
- this.quoteDraftService.isStandalone$,
1552
- this.contextService.isInitialized$,
1553
- ]).pipe(map(([route, isStandalone, isContextInited]) => !!isContextInited && this.quoteDraftService.isInitialized && route.data['showHeader'] && !isStandalone));
1554
- this.isStandalone$ = this.quoteDraftService.isStandalone$;
915
+ this.showHeader$ = combineLatest([this.routerService.route$, this.flowInfo.flow$]).pipe(map(([route, flow]) => route.data['showHeader'] && !(flow === null || flow === void 0 ? void 0 : flow.properties.standalone)));
916
+ this.isStandalone$ = this.flowInfo.flow$.pipe(map(flow => Boolean(flow === null || flow === void 0 ? void 0 : flow.properties.standalone)));
917
+ this.guidedSellingVisible$ = this.guidedSellingService.isVisible$;
1555
918
  this.flowService.initSubscriptions();
1556
919
  }
1557
- ngOnInit() {
1558
- this.integrationState.clear();
1559
- }
1560
- ngOnDestroy() {
1561
- this.flowService.cleanup();
1562
- this.docGenService.cleanup();
1563
- this.contextService.delete();
1564
- }
1565
920
  }
1566
- FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: i1$2.QuoteDraftService }, { token: FlowService }, { token: FlowDocGenService }, { token: i5.IntegrationState }, { token: i1$2.ContextService }], target: i0.ɵɵFactoryTarget.Component });
1567
- FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowComponent, selector: "vl-flow", ngImport: i0, template: "<vl-flow-header *ngIf=\"showHeader$ | async\"></vl-flow-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n</div>\n\n<ng-container *ngIf=\"(isStandalone$ | async) !== true\">\n <vl-flow-doc-gen></vl-flow-doc-gen>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "component", type: FlowHeaderComponent, selector: "vl-flow-header" }, { kind: "component", type: DocGenComponent, selector: "vl-flow-doc-gen" }, { kind: "component", type: GuidedSellingComponent, selector: "vl-flow-guided-selling" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
921
+ FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: FlowService }, { token: i2.FlowInfoService }, { token: FlowGuidedSellingService }], target: i0.ɵɵFactoryTarget.Component });
922
+ FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowComponent, selector: "vl-flow", ngImport: i0, template: "<vl-flow-new-header *ngIf=\"showHeader$ | async\"></vl-flow-new-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <div class=\"guided-selling\" [ngClass]=\"{ hidden: (guidedSellingVisible$ | async) === false }\">\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n </div>\n</div>\n\n<ng-container *ngIf=\"(isStandalone$ | async) !== true\">\n <vl-flow-doc-gen></vl-flow-doc-gen>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}.guided-selling{position:absolute;top:0;width:100%;height:100%;z-index:100}.hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "component", type: FlowHeaderComponent, selector: "vl-flow-new-header" }, { kind: "component", type: DocGenComponent, selector: "vl-flow-doc-gen" }, { kind: "component", type: GuidedSellingComponent, selector: "vl-flow-guided-selling" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1568
923
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, decorators: [{
1569
924
  type: Component,
1570
- args: [{ selector: 'vl-flow', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-flow-header *ngIf=\"showHeader$ | async\"></vl-flow-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n</div>\n\n<ng-container *ngIf=\"(isStandalone$ | async) !== true\">\n <vl-flow-doc-gen></vl-flow-doc-gen>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}\n"] }]
1571
- }], ctorParameters: function () { return [{ type: FlowRouterService }, { type: i1$2.QuoteDraftService }, { type: FlowService }, { type: FlowDocGenService }, { type: i5.IntegrationState }, { type: i1$2.ContextService }]; } });
925
+ args: [{ selector: 'vl-flow', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-flow-new-header *ngIf=\"showHeader$ | async\"></vl-flow-new-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <div class=\"guided-selling\" [ngClass]=\"{ hidden: (guidedSellingVisible$ | async) === false }\">\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n </div>\n</div>\n\n<ng-container *ngIf=\"(isStandalone$ | async) !== true\">\n <vl-flow-doc-gen></vl-flow-doc-gen>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}.guided-selling{position:absolute;top:0;width:100%;height:100%;z-index:100}.hidden{display:none}\n"] }]
926
+ }], ctorParameters: function () { return [{ type: FlowRouterService }, { type: FlowService }, { type: i2.FlowInfoService }, { type: FlowGuidedSellingService }]; } });
1572
927
 
1573
928
  const getFlowObjectIdPropertyName = (id) => {
1574
929
  const objectName = SalesforceIdUtils.getSfObjectNameById(id);
@@ -1609,7 +964,7 @@ class ContextGuard {
1609
964
  const mode = this.getConfigurationContextMode(accountId, quoteId, orderId, rpcMessage);
1610
965
  // Restrict if mode is not defined
1611
966
  if (mode == null) {
1612
- return this.handleError(route, 'Mode is undefined');
967
+ return this.routerService.showErrorPage$('Mode is undefined');
1613
968
  }
1614
969
  const headerId = accountId || quoteId || orderId || this.rpcMessageId || 'empty-for-test-mode';
1615
970
  // Allow if context is already initialized with the same headerId
@@ -1621,13 +976,13 @@ class ContextGuard {
1621
976
  }
1622
977
  // Initialize context and runtime settings
1623
978
  return forkJoin([this.contextService.create(headerId, mode), this.runtimeSettingsService.create()]).pipe(tap(([context]) => {
1624
- // Update context with queryParams
1625
979
  this.contextService.update(Object.assign(Object.assign({}, context), { properties: Object.assign(Object.assign(Object.assign({}, context.properties), (queryParams !== null && queryParams !== void 0 ? queryParams : {})), getDefaultProperties({ mode })) }));
1626
980
  // Init currency settings
1627
981
  this.runtimeSettingsService.initCurrency(context.properties['CurrencyIsoCode']);
1628
982
  }), map(() => true), catchError(e => {
1629
983
  const message = e instanceof HttpErrorResponse ? e.error.message : e;
1630
- return this.handleError(route, message);
984
+ const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
985
+ return this.routerService.showErrorPage$(message, errorDetails);
1631
986
  }));
1632
987
  }
1633
988
  canActivate(route) {
@@ -1661,36 +1016,42 @@ class ContextGuard {
1661
1016
  }
1662
1017
  return;
1663
1018
  }
1664
- handleError(route, message) {
1665
- this.contextService.delete();
1666
- const parentUrl = this.routerService.getFlowRootPath(route);
1667
- return from(this.router.navigate([parentUrl, '404'], { state: { message } })).pipe(map(() => false));
1668
- }
1669
1019
  }
1670
- ContextGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextGuard, deps: [{ token: i1$1.Router }, { token: FlowRouterService }, { token: i1$2.ContextService }, { token: i1$2.RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
1020
+ ContextGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextGuard, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i2.ContextService }, { token: i2.RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
1671
1021
  ContextGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextGuard });
1672
1022
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextGuard, decorators: [{
1673
1023
  type: Injectable
1674
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: FlowRouterService }, { type: i1$2.ContextService }, { type: i1$2.RuntimeSettingsService }]; } });
1024
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i2.ContextService }, { type: i2.RuntimeSettingsService }]; } });
1675
1025
 
1676
- const initFlow = (route) => {
1026
+ const keepFlowInitialized = (route) => {
1677
1027
  const contextService = inject(ContextService);
1678
- const flowService = inject(FlowService);
1028
+ const flowState = inject(FlowStateService);
1029
+ const flowInfoService = inject(FlowInfoService);
1030
+ const routerService = inject(FlowRouterService);
1679
1031
  const quoteDraft = inject(QuoteDraftService);
1680
1032
  const configurationService = inject(ConfigurationService);
1033
+ const integrationState = inject(IntegrationState);
1681
1034
  const { flowId } = route.queryParams;
1682
- const flow = flowService.flow;
1035
+ const flow = flowInfoService.flow;
1683
1036
  if (flow && (flow === null || flow === void 0 ? void 0 : flow.id) === flowId) {
1684
1037
  return true;
1685
1038
  }
1686
1039
  // Cleanup
1687
- contextService.delete();
1688
- configurationService.reset();
1040
+ flowState.cleanup();
1689
1041
  quoteDraft.reset();
1042
+ configurationService.reset();
1043
+ integrationState.clear();
1044
+ flowInfoService.cleanup();
1045
+ contextService.delete();
1690
1046
  if (!flowId) {
1691
1047
  return true;
1692
1048
  }
1693
- return flowService.setFlowById$(flowId);
1049
+ const params = Object.assign(Object.assign({}, route.queryParams), flow === null || flow === void 0 ? void 0 : flow.properties.queryParams);
1050
+ return flowInfoService.init$(flowId, params).pipe(map(() => true), catchError(e => {
1051
+ const message = e instanceof HttpErrorResponse ? e.error.message : e;
1052
+ const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
1053
+ return routerService.showErrorPage$(message, errorDetails);
1054
+ }));
1694
1055
  };
1695
1056
 
1696
1057
  class ProductUnloadGuard {
@@ -1727,11 +1088,11 @@ class ProductUnloadGuard {
1727
1088
  }));
1728
1089
  }
1729
1090
  }
1730
- ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$1.Router }, { token: i1$2.ContextService }, { token: i1$2.QuoteDraftService }, { token: i1$2.ConfigurationService }, { token: FlowDialogService }], target: i0.ɵɵFactoryTarget.Injectable });
1091
+ ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$2.Router }, { token: i2.ContextService }, { token: i2.QuoteDraftService }, { token: i2.ConfigurationService }, { token: FlowDialogService }], target: i0.ɵɵFactoryTarget.Injectable });
1731
1092
  ProductUnloadGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard });
1732
1093
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, decorators: [{
1733
1094
  type: Injectable
1734
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$2.ContextService }, { type: i1$2.QuoteDraftService }, { type: i1$2.ConfigurationService }, { type: FlowDialogService }]; } });
1095
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i2.ContextService }, { type: i2.QuoteDraftService }, { type: i2.ConfigurationService }, { type: FlowDialogService }]; } });
1735
1096
 
1736
1097
  class RootGuard {
1737
1098
  constructor(router, routerService) {
@@ -1766,26 +1127,26 @@ class RootGuard {
1766
1127
  return true;
1767
1128
  }
1768
1129
  }
1769
- RootGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RootGuard, deps: [{ token: i1$1.Router }, { token: FlowRouterService }], target: i0.ɵɵFactoryTarget.Injectable });
1130
+ RootGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RootGuard, deps: [{ token: i1$2.Router }, { token: FlowRouterService }], target: i0.ɵɵFactoryTarget.Injectable });
1770
1131
  RootGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RootGuard, providedIn: 'root' });
1771
1132
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RootGuard, decorators: [{
1772
1133
  type: Injectable,
1773
1134
  args: [{ providedIn: 'root' }]
1774
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: FlowRouterService }]; } });
1135
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }]; } });
1775
1136
 
1776
1137
  class AssetsComponent {
1777
- constructor(templatesApi, cdr, toastService, flowService, customizationService) {
1778
- var _a, _b;
1138
+ constructor(templatesApi, cdr, toastService, flowInfo, customizationService) {
1139
+ var _a, _b, _c;
1779
1140
  this.templatesApi = templatesApi;
1780
1141
  this.cdr = cdr;
1781
1142
  this.toastService = toastService;
1782
- this.flowService = flowService;
1143
+ this.flowInfo = flowInfo;
1783
1144
  this.customizationService = customizationService;
1784
1145
  this.uiDefinition = undefined;
1785
1146
  this.state$ = new BehaviorSubject({ loading: true, failure: false });
1786
1147
  this.templateApiName = '';
1787
1148
  this.destroyed$ = new Subject();
1788
- this.templateApiName = (_b = (_a = this.flowService.flow) === null || _a === void 0 ? void 0 : _a.properties.templates.assets) !== null && _b !== void 0 ? _b : '';
1149
+ this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.assets) !== null && _c !== void 0 ? _c : '';
1789
1150
  }
1790
1151
  ngOnInit() {
1791
1152
  this.generateUIDefinition$()
@@ -1809,38 +1170,37 @@ class AssetsComponent {
1809
1170
  this.destroyed$.next();
1810
1171
  this.destroyed$.complete();
1811
1172
  }
1812
- getTemplateRootComponent$(template) {
1813
- return this.templatesApi
1814
- .fetchComponents$(template.id)
1815
- .pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
1816
- }
1817
- getLocalAssetsComponentMeta$() {
1173
+ getLocalMeta$() {
1818
1174
  var _a, _b;
1819
- if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getAssetsComponent)) {
1175
+ if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
1820
1176
  return of(undefined);
1821
1177
  }
1822
- return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getAssetsComponent(this.templateApiName).pipe(map(component => {
1823
- if (!component) {
1178
+ return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
1179
+ if (!components) {
1824
1180
  return;
1825
1181
  }
1826
- return {
1182
+ return components.map(component => ({
1827
1183
  html: component.html,
1828
1184
  css: component.css,
1829
1185
  js: component.js,
1830
1186
  json: component.json,
1831
- };
1187
+ }));
1832
1188
  }));
1833
1189
  }
1834
- getAssetsComponentMeta$() {
1835
- return this.templatesApi.fetchTemplates$().pipe(map(templates => templates.find(template => template.name === this.templateApiName)), switchMap(template => (template ? this.getTemplateRootComponent$(template) : of(undefined))), switchMap(component => component ? this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : of(undefined)));
1190
+ getOrgMeta$() {
1191
+ const template = this.flowInfo.templates.SHOPPING_CART;
1192
+ if (!template) {
1193
+ return of(undefined);
1194
+ }
1195
+ return this.templatesApi.fetchComponentsAttachments$(template.id);
1836
1196
  }
1837
1197
  generateUIDefinition$() {
1838
1198
  return of(undefined).pipe(tap(() => {
1839
1199
  if (!this.templateApiName) {
1840
- throw new Error("Flow Query parameter 'assetsTemplateApiName' is missing.");
1200
+ throw new Error("Flow 'assets' template is not defined.");
1841
1201
  }
1842
- }), switchMap(() => this.getLocalAssetsComponentMeta$()), switchMap(meta => (meta ? of(meta) : this.getAssetsComponentMeta$())), map(meta => {
1843
- if (!meta) {
1202
+ }), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
1203
+ if (!metaList) {
1844
1204
  return;
1845
1205
  }
1846
1206
  const uiDef = {
@@ -1849,26 +1209,24 @@ class AssetsComponent {
1849
1209
  primary: true,
1850
1210
  type: 'DEFAULT',
1851
1211
  version: 2,
1852
- children: [
1853
- {
1854
- children: [],
1855
- template: meta.html && btoa(meta.html),
1856
- script: meta.js && btoa(meta.js),
1857
- styles: meta.css && btoa(meta.css),
1858
- },
1859
- ],
1212
+ children: metaList.map(meta => ({
1213
+ children: [],
1214
+ template: meta.html && btoaSafe(meta.html),
1215
+ script: meta.js && btoaSafe(meta.js),
1216
+ styles: meta.css && btoaSafe(meta.css),
1217
+ })),
1860
1218
  };
1861
1219
  return uiDef;
1862
1220
  }));
1863
1221
  }
1864
1222
  }
1865
- AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, deps: [{ token: i2.UITemplatesApiService }, { token: i0.ChangeDetectorRef }, { token: i2$1.ToastService }, { token: FlowService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1223
+ AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i0.ChangeDetectorRef }, { token: i2$1.ToastService }, { token: i2.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1866
1224
  AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: AssetsComponent, selector: "vl-flow-assets", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1867
1225
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, decorators: [{
1868
1226
  type: Component,
1869
1227
  args: [{ selector: 'vl-flow-assets', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
1870
1228
  }], ctorParameters: function () {
1871
- return [{ type: i2.UITemplatesApiService }, { type: i0.ChangeDetectorRef }, { type: i2$1.ToastService }, { type: FlowService }, { type: undefined, decorators: [{
1229
+ return [{ type: i1$1.UITemplatesApiService }, { type: i0.ChangeDetectorRef }, { type: i2$1.ToastService }, { type: i2.FlowInfoService }, { type: undefined, decorators: [{
1872
1230
  type: Optional
1873
1231
  }, {
1874
1232
  type: Inject,
@@ -1891,18 +1249,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1891
1249
  }] });
1892
1250
 
1893
1251
  class CatalogComponent {
1894
- constructor(templatesApi, cdr, toastService, flowService, customizationService) {
1895
- var _a, _b;
1252
+ constructor(templatesApi, cdr, toastService, flowInfo, customizationService) {
1253
+ var _a, _b, _c;
1896
1254
  this.templatesApi = templatesApi;
1897
1255
  this.cdr = cdr;
1898
1256
  this.toastService = toastService;
1899
- this.flowService = flowService;
1257
+ this.flowInfo = flowInfo;
1900
1258
  this.customizationService = customizationService;
1901
1259
  this.uiDefinition = undefined;
1902
1260
  this.state$ = new BehaviorSubject({ loading: true, failure: false });
1903
1261
  this.templateApiName = '';
1904
1262
  this.destroyed$ = new Subject();
1905
- this.templateApiName = (_b = (_a = this.flowService.flow) === null || _a === void 0 ? void 0 : _a.properties.templates.catalog) !== null && _b !== void 0 ? _b : '';
1263
+ this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.catalog) !== null && _c !== void 0 ? _c : '';
1906
1264
  }
1907
1265
  ngOnInit() {
1908
1266
  this.generateUIDefinition$()
@@ -1926,38 +1284,37 @@ class CatalogComponent {
1926
1284
  this.destroyed$.next();
1927
1285
  this.destroyed$.complete();
1928
1286
  }
1929
- getTemplateRootComponent$(template) {
1930
- return this.templatesApi
1931
- .fetchComponents$(template.id)
1932
- .pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
1933
- }
1934
- getLocalCatalogComponentMeta$() {
1287
+ getLocalMeta$() {
1935
1288
  var _a, _b;
1936
- if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getCatalogComponent)) {
1289
+ if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
1937
1290
  return of(undefined);
1938
1291
  }
1939
- return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getCatalogComponent(this.templateApiName).pipe(map(component => {
1940
- if (!component) {
1292
+ return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
1293
+ if (!components) {
1941
1294
  return;
1942
1295
  }
1943
- return {
1296
+ return components.map(component => ({
1944
1297
  html: component.html,
1945
1298
  css: component.css,
1946
1299
  js: component.js,
1947
1300
  json: component.json,
1948
- };
1301
+ }));
1949
1302
  }));
1950
1303
  }
1951
- getCatalogComponentMeta$() {
1952
- return this.templatesApi.fetchTemplates$().pipe(map(templates => templates.find(template => template.name === this.templateApiName)), switchMap(template => (template ? this.getTemplateRootComponent$(template) : of(undefined))), switchMap(component => component ? this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : of(undefined)));
1304
+ getOrgMeta$() {
1305
+ const template = this.flowInfo.templates.CATALOG;
1306
+ if (!template) {
1307
+ return of(undefined);
1308
+ }
1309
+ return this.templatesApi.fetchComponentsAttachments$(template.id);
1953
1310
  }
1954
1311
  generateUIDefinition$() {
1955
1312
  return of(undefined).pipe(tap(() => {
1956
1313
  if (!this.templateApiName) {
1957
- throw new Error("Flow Query parameter 'catalogTemplateApiName' is missing.");
1314
+ throw new Error("Flow 'catalog' template is not defined.");
1958
1315
  }
1959
- }), switchMap(() => this.getLocalCatalogComponentMeta$()), switchMap(meta => (meta ? of(meta) : this.getCatalogComponentMeta$())), map(meta => {
1960
- if (!meta) {
1316
+ }), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
1317
+ if (!metaList) {
1961
1318
  return;
1962
1319
  }
1963
1320
  const uiDef = {
@@ -1966,26 +1323,24 @@ class CatalogComponent {
1966
1323
  primary: true,
1967
1324
  type: 'DEFAULT',
1968
1325
  version: 2,
1969
- children: [
1970
- {
1971
- children: [],
1972
- template: meta.html && btoa(meta.html),
1973
- script: meta.js && btoa(meta.js),
1974
- styles: meta.css && btoa(meta.css),
1975
- },
1976
- ],
1326
+ children: metaList.map(meta => ({
1327
+ children: [],
1328
+ template: meta.html && btoaSafe(meta.html),
1329
+ script: meta.js && btoaSafe(meta.js),
1330
+ styles: meta.css && btoaSafe(meta.css),
1331
+ })),
1977
1332
  };
1978
1333
  return uiDef;
1979
1334
  }));
1980
1335
  }
1981
1336
  }
1982
- CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, deps: [{ token: i2.UITemplatesApiService }, { token: i0.ChangeDetectorRef }, { token: i2$1.ToastService }, { token: FlowService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1337
+ CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i0.ChangeDetectorRef }, { token: i2$1.ToastService }, { token: i2.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1983
1338
  CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CatalogComponent, selector: "vl-flow-catalog", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1984
1339
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, decorators: [{
1985
1340
  type: Component,
1986
1341
  args: [{ selector: 'vl-flow-catalog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
1987
1342
  }], ctorParameters: function () {
1988
- return [{ type: i2.UITemplatesApiService }, { type: i0.ChangeDetectorRef }, { type: i2$1.ToastService }, { type: FlowService }, { type: undefined, decorators: [{
1343
+ return [{ type: i1$1.UITemplatesApiService }, { type: i0.ChangeDetectorRef }, { type: i2$1.ToastService }, { type: i2.FlowInfoService }, { type: undefined, decorators: [{
1989
1344
  type: Optional
1990
1345
  }, {
1991
1346
  type: Inject,
@@ -2037,12 +1392,12 @@ class DebugComponent {
2037
1392
  return new HttpParams({ fromObject: params }).toString();
2038
1393
  }
2039
1394
  }
2040
- DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, deps: [{ token: i2.FlowsApiService }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i1$2.ContextService }, { token: i1$2.QuoteDraftService }], target: i0.ɵɵFactoryTarget.Component });
2041
- DebugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: DebugComponent, selector: "vl-flow-debug", ngImport: i0, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tr{cursor:pointer}tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i6.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i10.InputText, selector: "[pInputText]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1395
+ DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, deps: [{ token: i1$1.FlowsApiService }, { token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: i2.ContextService }, { token: i2.QuoteDraftService }], target: i0.ɵɵFactoryTarget.Component });
1396
+ DebugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: DebugComponent, selector: "vl-flow-debug", ngImport: i0, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tbody>tr{cursor:pointer}tbody>tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i6.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i8.InputText, selector: "[pInputText]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2042
1397
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, decorators: [{
2043
1398
  type: Component,
2044
- args: [{ selector: 'vl-flow-debug', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tr{cursor:pointer}tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"] }]
2045
- }], ctorParameters: function () { return [{ type: i2.FlowsApiService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i1$2.ContextService }, { type: i1$2.QuoteDraftService }]; } });
1399
+ args: [{ selector: 'vl-flow-debug', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tbody>tr{cursor:pointer}tbody>tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"] }]
1400
+ }], ctorParameters: function () { return [{ type: i1$1.FlowsApiService }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i2.ContextService }, { type: i2.QuoteDraftService }]; } });
2046
1401
 
2047
1402
  const routes$1 = [{ path: '', component: DebugComponent }];
2048
1403
  class DebugModule {
@@ -2050,7 +1405,7 @@ class DebugModule {
2050
1405
  DebugModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2051
1406
  DebugModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DebugModule, declarations: [DebugComponent], imports: [CommonModule,
2052
1407
  FormsModule,
2053
- ReactiveFormsModule, i1$1.RouterModule, RadioButtonModule,
1408
+ ReactiveFormsModule, i1$2.RouterModule, RadioButtonModule,
2054
1409
  ButtonModule,
2055
1410
  InputTextModule,
2056
1411
  DropdownModule] });
@@ -2079,36 +1434,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2079
1434
  }]
2080
1435
  }] });
2081
1436
 
2082
- class EmptyAccountComponent {
2083
- }
2084
- EmptyAccountComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EmptyAccountComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2085
- EmptyAccountComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: EmptyAccountComponent, selector: "vl-empty-account", ngImport: i0, template: "<vl-empty-state\n primaryText=\"No Orders in your Account\"\n secondaryText=\"To proceed, go to the Shopping Cart from a Quote.\"\n>\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"400\" height=\"281\" viewBox=\"0 0 400 281\" fill=\"none\">\n <path d=\"M264.214 26.9277H70.8805V128.186H264.214V26.9277Z\" fill=\"#0466C8\" />\n <path\n d=\"M143 56.5H136.217C128.166 64.4791 120.051 72.5209 112 80.5H118.783C126.834 72.5209 134.949 64.5419 143 56.5Z\"\n fill=\"white\"\n />\n <path\n d=\"M242.932 57.5681V79.4319H128.575L133.724 74.2801L150.429 57.5681H242.932ZM244 56.5H149.989C142.014 64.4791 133.976 72.5209 126 80.5H244V56.5Z\"\n fill=\"white\"\n />\n <path d=\"M129 56.5H81V80.5H104.969C112.958 72.5209 120.948 64.5419 129 56.5Z\" fill=\"white\" />\n <path\n d=\"M82.3 23.2016C82.2366 23.2016 82.1732 23.2644 82.1098 23.2644C81.3494 23.5785 80.5889 23.5785 79.8918 23.2644C79.765 23.2016 79.6383 23.1387 79.4482 23.0759C78.9412 22.7618 78.561 22.322 78.3075 21.7565C77.6104 20.2487 78.1173 18.6151 79.6383 17.8612C81.1592 17.1073 82.9971 17.547 83.6942 19.0549C84.3913 20.6256 83.8843 22.3848 82.3 23.2016Z\"\n fill=\"#B4D1EF\"\n />\n <path\n d=\"M92.2716 23.2016C92.2086 23.2016 92.1457 23.2644 92.0827 23.2644C91.3273 23.5785 90.5718 23.5785 89.8793 23.2644C89.7534 23.2016 89.6275 23.1387 89.4386 23.0759C88.935 22.7618 88.5573 22.322 88.3054 21.7565C87.6129 20.2487 88.1166 18.6151 89.6275 17.8612C91.1384 17.1073 92.9641 17.547 93.6566 19.0549C94.412 20.6256 93.9084 22.3848 92.2716 23.2016Z\"\n fill=\"#B4D1EF\"\n />\n <path\n d=\"M102.3 23.2016C102.237 23.2016 102.173 23.2644 102.11 23.2644C101.349 23.5785 100.589 23.5785 99.8918 23.2644C99.765 23.2016 99.6383 23.1387 99.4482 23.0759C98.9412 22.7618 98.561 22.322 98.3075 21.7565C97.6104 20.2487 98.1174 18.6151 99.6383 17.8612C101.159 17.1073 102.997 17.547 103.694 19.0549C104.391 20.6256 103.884 22.3848 102.3 23.2016Z\"\n fill=\"#B4D1EF\"\n />\n <path\n d=\"M210.126 91.0156H130.44C129.748 91.0156 129.748 92.0848 130.44 92.0848H210.126C210.818 92.0848 210.818 91.0156 210.126 91.0156Z\"\n fill=\"white\"\n />\n <path\n d=\"M197.484 97.5566H142.013C141.321 97.5566 141.321 98.6258 142.013 98.6258H197.484C198.176 98.6258 198.176 97.5566 197.484 97.5566Z\"\n fill=\"white\"\n />\n <path\n d=\"M229.436 35.5H61.5553C60.8149 35.5 60.8149 36.5 61.5553 36.5H229.503C230.176 36.5 230.176 35.5 229.436 35.5Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M270.44 35.3555H256.226C256.163 35.3555 256.163 36.4246 256.226 36.4246H270.44C270.503 36.4246 270.503 35.3555 270.44 35.3555Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M332.704 212.022C332.642 212.022 332.579 212.022 332.516 211.959L280.566 191.582C280.377 191.519 280.252 191.33 280.252 191.141C280.252 190.953 280.314 190.764 280.44 190.638C292.83 181.33 333.333 150.953 335.346 150.953C335.472 150.953 335.66 151.016 335.723 151.141C335.849 151.267 335.849 151.393 335.849 151.519L333.208 211.456C333.208 211.644 333.082 211.77 332.956 211.896C332.893 211.959 332.767 212.022 332.704 212.022ZM281.824 190.953L332.138 210.701L334.717 152.336C329.811 155.166 301.321 176.299 281.824 190.953Z\"\n fill=\"#E5ECF4\"\n />\n <path\n d=\"M366.289 231.015C366.226 231.015 366.226 231.015 366.164 231.015L349.371 227.053C349.182 226.99 349.057 226.927 348.994 226.739C348.931 226.613 348.931 226.424 348.994 226.236L357.736 211.141C357.862 210.953 358.05 210.89 358.239 210.89C358.428 210.89 358.616 211.015 358.679 211.204C366.918 229.758 366.792 230.324 366.792 230.512C366.792 230.638 366.667 230.764 366.541 230.89C366.478 230.953 366.415 231.015 366.289 231.015ZM350.314 226.173L365.472 229.758C364.465 227.116 360.755 218.626 358.113 212.651L350.314 226.173Z\"\n fill=\"#E5ECF4\"\n />\n <path\n d=\"M199.686 248.751C192.516 229.38 177.799 213.909 159.497 205.67V205.607C159.748 193.343 154.528 181.141 144.654 173.657C133.396 165.104 118.365 162.902 104.591 164.034C78.1132 166.236 53.0189 181.456 38.805 203.846C36.9811 206.739 35.3459 209.758 33.8365 212.839C33.522 213.468 34.4654 214.034 34.7799 213.405C45.4088 191.015 66.1635 174.16 90 167.682C113.711 161.267 146.981 164.726 156.226 191.519C157.736 195.921 158.491 200.575 158.428 205.229C150.943 201.959 142.893 199.946 134.465 199.254C121.447 198.248 103.522 199.506 95.283 211.204C91.761 216.236 90.8805 222.525 93.5849 228.122C96.2893 233.72 101.761 237.745 107.421 239.946C118.868 244.475 132.39 242.462 142.642 235.858C152.642 229.38 158.679 218.688 159.371 206.865C177.17 215.041 191.572 230.072 198.616 249.066C198.931 249.695 199.937 249.443 199.686 248.751ZM152.075 225.481C145.094 235.355 133.019 241.141 121.006 241.267C109.434 241.393 92.7044 234.6 93.0189 220.701C93.2076 213.217 98.9937 207.305 105.346 204.286C112.013 201.141 119.748 200.198 127.044 200.072C137.987 199.883 148.616 202.148 158.302 206.361C158.113 213.154 156.038 219.883 152.075 225.481Z\"\n fill=\"#E5ECF4\"\n />\n <path\n d=\"M341.447 271.204H322.767C322.075 271.204 322.075 272.273 322.767 272.273H341.447C342.138 272.336 342.138 271.204 341.447 271.204Z\"\n fill=\"#E5ECF4\"\n />\n <path\n d=\"M233.522 75.4814C230.881 89.3179 229.245 103.154 224.025 110.576C213.962 124.915 185.975 137.117 178.428 143.972C170.881 150.764 171.95 151.142 173.019 152.588C173.648 153.469 177.862 151.771 181.132 150.261C177.421 152.211 172.579 155.23 173.711 157.242C174.654 159.003 178.679 157.808 182.201 156.362C178.994 158.123 175.786 160.387 176.981 161.959C178.365 163.783 183.585 161.897 187.107 160.387C184.088 162.022 180.314 164.475 181.635 166.299C183.774 169.192 235.849 149.758 245.157 120.702C248.805 109.318 250.881 94.6009 252.013 80.8274C245.786 79.3808 239.623 77.494 233.522 75.4814Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M182.327 148.437C179.497 150.576 176.226 151.645 172.704 151.582C172.013 151.582 172.013 152.651 172.704 152.651C176.415 152.714 179.937 151.582 182.893 149.318C183.396 148.941 182.893 147.997 182.327 148.437Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M184.906 154.852C183.27 155.607 181.635 156.173 179.937 156.676C178.302 157.117 175.723 158.06 174.151 157.117C173.522 156.802 173.019 157.683 173.585 158.06C175.157 158.94 176.918 158.5 178.553 158.123C180.943 157.62 183.145 156.802 185.346 155.796C186.101 155.481 185.535 154.538 184.906 154.852Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M186.163 158.185C184.277 159.946 180.189 163.217 177.421 161.833C176.792 161.519 176.226 162.462 176.855 162.777C180.252 164.412 184.528 161.141 186.855 158.94C187.421 158.437 186.667 157.682 186.163 158.185Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M253.522 46.0474C253.522 47.1166 253.522 48.3115 253.522 49.6323C253.459 57.3052 253.145 69.1291 252.013 81.6449C251.95 82.148 251.95 82.6512 251.887 83.1543C245.472 82.148 236.981 79.2549 230.629 78.1857C232.893 65.7958 237.736 54.2864 244.151 45.4185C245.157 44.0348 246.226 42.7769 247.421 41.6449L253.522 40.5757C253.522 40.5757 253.522 41.3933 253.585 42.8398C253.522 43.6574 253.522 44.7266 253.522 46.0474Z\"\n fill=\"#F2F7FC\"\n />\n <path\n d=\"M184.687 136.932C179.875 137.121 175.253 138.637 170.631 139.837C165.565 141.101 160.5 142.174 155.371 143.122C134.602 146.975 113.264 148.238 92.1786 146.849C74.7659 145.712 55.3904 142.238 43.2332 128.531C32.469 116.403 28.9865 98.1477 34.9384 82.9879C40.7638 68.0807 55.3271 57.6583 70.9668 55.5738V54.5C58.6197 56.0792 46.969 62.7748 39.4341 72.755C29.9996 85.325 28.6066 102.317 34.6218 116.719C41.0804 132.257 55.2004 141.227 71.1568 145.017C80.2747 147.165 89.6458 147.923 98.9537 148.302C109.718 148.744 120.545 148.428 131.246 147.544C143.087 146.533 154.801 144.638 166.388 142.048C172.403 140.658 178.545 138.321 184.687 138.132C190.576 137.942 197.604 140.974 197.921 147.607C197.984 148.302 199.061 148.302 198.997 147.607C198.617 140.216 191.209 136.679 184.687 136.932Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M190 164.091V172.909C190 173.697 191 173.697 191 172.909V164.091C191 163.303 190 163.303 190 164.091Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M199 164.037V172.963C199 173.679 200 173.679 200 172.963V164.037C200 163.321 199 163.321 199 164.037Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M182 166.5V155.275C182 148.205 187.792 142.5 194.969 142.5C202.145 142.5 207.937 148.205 207.937 155.275L208 166.5H182Z\"\n fill=\"#0466C8\"\n />\n <path\n d=\"M209.483 165.5H180.517C179.828 165.5 179.828 166.5 180.517 166.5H209.483C210.172 166.5 210.172 165.5 209.483 165.5Z\"\n fill=\"#0466C8\"\n />\n <path\n d=\"M203.711 151.519V161.582C203.711 162.274 204.78 162.274 204.78 161.582V151.519C204.843 150.827 203.711 150.827 203.711 151.519Z\"\n fill=\"white\"\n />\n <path\n d=\"M196.73 134.601C187.421 142.148 183.648 152.274 187.233 153.343C190.818 154.412 203.208 135.67 203.208 135.67L196.73 134.601Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M199.748 139.632C196.855 144.098 193.396 148.374 189.182 151.708L188.239 152.399C187.358 152.84 186.352 152.148 186.478 150.953C186.541 150.45 187.233 149.066 187.421 148.689C187.925 147.557 188.491 146.425 189.057 145.292C190.377 142.777 191.824 140.387 193.459 138.06C193.836 137.494 192.893 136.928 192.516 137.494C191.195 139.443 181.824 152.399 186.855 153.594C189.245 154.16 191.824 150.827 193.27 149.381C196.038 146.55 198.491 143.469 200.692 140.135C201.069 139.569 200.126 139.066 199.748 139.632Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M211.132 135.984C207.736 139.003 203.648 140.89 199.057 141.33C198.365 141.393 198.365 142.462 199.057 142.399C203.899 141.896 208.239 139.947 211.887 136.739C212.39 136.299 211.635 135.544 211.132 135.984Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M238.176 254.224C250.692 253.783 263.208 255.607 275.723 255.796C275.157 254.475 274.654 253.217 274.088 251.897C273.774 251.205 273.459 250.513 273.145 249.821C270.377 243.658 267.484 237.809 264.717 232.274C254.906 235.859 245.031 239.129 234.843 241.331C237.547 246.928 239.12 251.393 238.176 254.224Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M273.899 253.595C276.101 253.783 278.365 253.783 280.566 253.72C284.717 253.658 288.805 253.72 292.956 253.72C299.12 253.783 305.283 253.532 311.384 253.091C307.17 244.161 302.767 235.796 298.553 228.06C289.057 230.639 279.56 232.966 269.937 235.104C273.145 242.525 275.031 249.003 273.899 253.595Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M274.214 250.828C273.836 255.104 271.069 257.997 267.107 259.57C256.352 263.909 259.937 272.84 259.937 272.84H319.874C316.918 265.167 313.648 257.809 310.314 250.765H274.214V250.828Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M307.296 229.758C293.459 203.783 276.289 186.299 281.447 173.72C297.233 135.419 300.818 107.997 291.887 84.3494L267.484 80.0098C267.484 80.0098 269.623 91.5192 268.553 112.337C267.484 133.154 252.201 152.022 250.252 182.337C249.182 199.129 259.937 225.985 266.415 241.582C275.912 238.437 297.547 232.085 307.296 229.758Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M265.786 234.475C252.516 207.934 240.063 187.683 246.415 172.714C263.145 133.406 281.069 109.884 272.075 86.1733C272.075 86.1733 254.843 72.5255 253.774 93.3431C252.704 114.161 218.05 153.846 214.088 183.972C211.321 204.915 223.962 230.513 230.252 245.356C240.252 242.337 256.352 238.815 265.786 234.475Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M282.201 272.84H222.264C222.264 272.84 222.264 260.45 234.654 257.243C237.17 256.614 238.302 255.104 238.491 252.966H274.591C277.296 259.255 279.874 265.922 282.201 272.84Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M274.088 251.896C274.025 252.274 273.962 252.588 273.836 252.966C273.082 255.67 271.195 258.123 268.428 259.444C264.151 261.519 259.119 261.456 256.289 265.922C254.969 268.06 254.402 270.45 254.34 272.84H253.333C253.522 268.311 254.906 264.098 259.182 261.708C262.704 259.758 267.233 259.821 270.252 256.991C271.447 255.922 272.264 254.475 272.704 252.966C273.019 251.959 273.145 250.89 273.082 249.884C273.459 250.513 273.774 251.205 274.088 251.896Z\"\n fill=\"white\"\n />\n <path\n d=\"M281.195 256.739C279.497 255.67 277.799 254.601 276.101 253.532C275.535 253.154 274.969 254.098 275.535 254.475C277.233 255.544 278.931 256.614 280.629 257.683C281.258 258.06 281.761 257.117 281.195 256.739Z\"\n fill=\"white\"\n />\n <path\n d=\"M244.717 257.809C242.893 257.242 241.132 256.739 239.308 256.173C238.616 255.985 238.365 256.991 238.994 257.243C240.818 257.809 242.579 258.312 244.403 258.878C245.094 259.066 245.346 258.06 244.717 257.809Z\"\n fill=\"white\"\n />\n <path\n d=\"M262.516 231.267C261.069 227.682 259.623 224.098 258.239 220.513C257.987 219.884 256.918 220.135 257.17 220.827C258.616 224.412 260.063 227.997 261.447 231.582C261.698 232.211 262.767 231.959 262.516 231.267Z\"\n fill=\"white\"\n />\n <path\n d=\"M268.616 110.073C268.491 110.513 268.365 110.953 268.302 111.394C265.786 121.645 263.208 131.897 260.692 142.148C260.503 142.84 259.497 142.526 259.623 141.834C262.264 131.331 264.843 120.765 267.484 110.262C267.61 109.821 267.736 109.381 267.799 108.878C268.05 109.318 268.365 109.696 268.616 110.073Z\"\n fill=\"white\"\n />\n <path\n d=\"M268.616 110.073C268.491 110.513 268.365 110.953 268.302 111.393C268.05 111.016 267.736 110.639 267.484 110.261C266.478 108.878 265.409 107.494 264.402 106.11C263.962 105.544 264.906 105.041 265.346 105.544C266.163 106.676 266.981 107.808 267.862 108.878C268.05 109.318 268.365 109.695 268.616 110.073Z\"\n fill=\"white\"\n />\n <path\n d=\"M251.698 43.0913C238.994 45.7328 251.509 69.5693 253.836 93.3429L291.887 84.3492C291.887 84.3492 276.415 37.997 251.698 43.0913Z\"\n fill=\"#F2F7FC\"\n />\n <path\n d=\"M251.384 79.8839C249.308 73.6574 247.296 67.4939 245.22 61.2675C245.031 60.6386 243.962 60.8901 244.151 61.582C246.226 67.8084 248.239 73.9719 250.314 80.1983C250.566 80.8273 251.572 80.5128 251.384 79.8839Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M332.075 57.431C322.39 48.3744 311.447 43.5945 299.811 41.2046C297.673 46.9908 295.723 52.9027 293.962 58.8147C295.66 59.3807 297.359 60.0096 298.994 60.6386C323.396 69.6323 326.667 87.1794 330.566 97.6197C334.528 108.06 322.642 122.777 326.604 124.538C330.566 126.362 336.289 113.028 336.289 113.028C336.289 113.028 334.843 135.481 337.736 136.173C340.377 136.865 341.698 131.016 342.264 126.488C342.076 130.764 342.327 136.047 344.906 135.859C347.17 135.67 347.862 131.456 347.987 127.494C348.365 130.764 349.245 133.909 351.384 134.098C354.088 134.349 353.962 128.626 353.522 124.349C354.277 128.123 355.66 132.777 358.05 131.896C362.075 130.513 353.962 77.8713 332.075 57.431Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M302.453 41.7707C300.314 47.7455 296.667 58.8147 295.157 64.9782C287.61 60.6386 279.245 57.1795 273.082 53.6575C265.723 49.5065 258.742 47.5569 254.717 46.3619C254.277 46.2361 253.836 46.1103 253.459 46.0474C251.572 45.5443 250.566 45.2298 250.566 45.2298L251.95 43.0286L253.459 40.5757C254.717 40.4499 255.912 40.3871 257.17 40.2613C272.704 38.9405 288.176 38.3745 302.453 41.7707Z\"\n fill=\"#F2F7FC\"\n />\n <path\n d=\"M341.761 123.846C341.384 127.117 341.887 134.853 337.673 135.67C336.981 135.796 337.296 136.865 337.987 136.739C339.874 136.362 341.069 134.915 341.572 133.154C342.453 130.261 342.453 126.928 342.83 123.909C342.956 123.154 341.824 123.154 341.761 123.846Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M346.981 122.966C346.918 124.852 346.855 126.739 346.73 128.626C346.667 129.884 347.107 135.544 344.78 135.041C344.088 134.915 343.837 135.922 344.466 136.11C346.352 136.488 347.296 135.104 347.61 133.406C348.176 130.073 347.925 126.362 348.05 122.966C348.113 122.274 347.044 122.274 346.981 122.966Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M353.648 122.022C353.648 121.33 352.579 121.33 352.579 122.022C352.642 124.035 353.774 132.337 351.132 133.029C350.44 133.217 350.755 134.224 351.447 134.098C353.019 133.657 353.648 132.525 353.774 130.953C354.088 128.06 353.711 124.978 353.648 122.022Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M358.868 119.129C358.805 118.437 357.736 118.5 357.799 119.192C357.987 120.953 360.126 130.639 357.547 131.142C356.855 131.267 357.17 132.274 357.862 132.148C359.56 131.834 360 130.387 360 128.815C359.937 125.67 359.245 122.337 358.868 119.129Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M275.346 54.3493C274.088 53.8462 272.83 53.4059 271.635 52.9028C271.006 52.6512 270.692 53.7204 271.321 53.972C272.579 54.4751 273.836 54.9154 275.031 55.4185C275.723 55.6701 276.038 54.6009 275.346 54.3493Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M256.164 41.9592C254.277 37.4938 251.509 31.2045 251.132 31.1416L241.006 33.28C241.006 33.28 245.849 42.9655 248.113 47.5567C250.629 45.4812 253.333 43.6573 256.164 41.9592Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M252.704 28.4372C252.704 28.7517 252.642 29.0661 252.579 29.3806C252.516 29.6951 252.453 30.0095 252.39 30.2611C252.39 30.324 252.327 30.3869 252.327 30.4498C252.264 30.7013 252.201 30.9529 252.138 31.2045C250.943 35.041 247.862 38.0598 243.082 38.1856C233.899 38.3743 230.252 30.7013 231.384 24.412C232.138 20.1982 235.094 16.5504 239.937 16.173C240.126 16.173 240.377 16.1102 240.566 16.1102C245.031 16.0473 248.176 17.6825 250.189 20.0724C250.503 20.5127 250.818 20.9529 251.132 21.3932C251.321 21.7076 251.447 22.0221 251.635 22.3366C251.887 22.8397 252.075 23.3429 252.201 23.846C252.641 25.3554 252.83 26.9278 252.704 28.4372Z\"\n fill=\"#D4E8F7\"\n />\n <path d=\"M236.478 29.3179L238.679 34.9782L234.528 35.2298L236.478 29.3179Z\" fill=\"#002957\" />\n <path\n d=\"M239.182 28.0601L239.434 28.8148C239.686 29.4438 238.616 29.6953 238.365 29.0664L238.113 28.3117C237.924 27.6827 238.994 27.4312 239.182 28.0601Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M233.27 28.9406L233.522 29.6954C233.774 30.3243 232.704 30.5759 232.453 29.9469L232.201 29.1922C232.013 28.5004 233.082 28.2488 233.27 28.9406Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M247.044 27.1166C246.918 27.6827 246.855 28.3116 246.73 28.8776C246.604 29.5695 247.673 29.8839 247.736 29.1921C247.862 28.6261 247.924 27.9971 248.05 27.4311C248.176 26.7393 247.17 26.4877 247.044 27.1166Z\"\n fill=\"#0466C8\"\n />\n <path\n d=\"M252.201 23.8461C252.013 23.343 251.824 22.8399 251.635 22.3367C251.509 22.0222 251.321 21.7078 251.132 21.3933C250.88 20.9531 250.566 20.5128 250.189 20.0726C248.176 17.6197 245.031 15.9845 240.566 16.1103C240.377 16.1103 240.126 16.1103 239.937 16.1732C238.491 16.299 234.465 16.9279 232.956 18.8147C228.616 20.1355 225.157 23.909 229.308 25.4814C232.453 26.8021 238.176 25.7958 240.88 24.4751C241.132 25.6072 242.83 28.7518 244.151 28.626C245.723 28.4373 245.472 26.6763 244.969 25.6072C244.906 25.4814 244.843 25.3556 244.78 25.2298C245.094 25.0411 245.409 24.8524 245.786 24.7267C247.925 23.7204 250.818 24.6638 251.509 27.1166C251.824 28.3744 251.698 29.7581 250.943 30.7015C250.88 30.8273 251.824 31.2046 252.138 31.2675C252.201 31.016 252.264 30.7644 252.327 30.5128C252.327 30.4499 252.327 30.387 252.39 30.3241C252.453 30.0097 252.516 29.7581 252.579 29.4436C252.642 29.1292 252.641 28.8147 252.704 28.5002C252.767 26.9279 252.641 25.3556 252.201 23.8461Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M257.17 40.2612L256.226 42.7141L254.78 46.3619L253.522 49.5694L251.635 54.4122L246.478 48.1858L244.151 45.4185C245.157 44.0348 246.226 42.777 247.421 41.6449L253.522 40.5757C254.717 40.4499 255.912 40.3241 257.17 40.2612Z\"\n fill=\"#D4E8F7\"\n />\n </svg>\n</vl-empty-state>\n", styles: [":host{display:flex;height:100%}\n"], dependencies: [{ kind: "component", type: i2$1.EmptyStateComponent, selector: "vl-empty-state", inputs: ["primaryText", "secondaryText", "buttonLabel", "icon", "disabled"], outputs: ["buttonClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2086
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EmptyAccountComponent, decorators: [{
2087
- type: Component,
2088
- args: [{ selector: 'vl-empty-account', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-empty-state\n primaryText=\"No Orders in your Account\"\n secondaryText=\"To proceed, go to the Shopping Cart from a Quote.\"\n>\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"400\" height=\"281\" viewBox=\"0 0 400 281\" fill=\"none\">\n <path d=\"M264.214 26.9277H70.8805V128.186H264.214V26.9277Z\" fill=\"#0466C8\" />\n <path\n d=\"M143 56.5H136.217C128.166 64.4791 120.051 72.5209 112 80.5H118.783C126.834 72.5209 134.949 64.5419 143 56.5Z\"\n fill=\"white\"\n />\n <path\n d=\"M242.932 57.5681V79.4319H128.575L133.724 74.2801L150.429 57.5681H242.932ZM244 56.5H149.989C142.014 64.4791 133.976 72.5209 126 80.5H244V56.5Z\"\n fill=\"white\"\n />\n <path d=\"M129 56.5H81V80.5H104.969C112.958 72.5209 120.948 64.5419 129 56.5Z\" fill=\"white\" />\n <path\n d=\"M82.3 23.2016C82.2366 23.2016 82.1732 23.2644 82.1098 23.2644C81.3494 23.5785 80.5889 23.5785 79.8918 23.2644C79.765 23.2016 79.6383 23.1387 79.4482 23.0759C78.9412 22.7618 78.561 22.322 78.3075 21.7565C77.6104 20.2487 78.1173 18.6151 79.6383 17.8612C81.1592 17.1073 82.9971 17.547 83.6942 19.0549C84.3913 20.6256 83.8843 22.3848 82.3 23.2016Z\"\n fill=\"#B4D1EF\"\n />\n <path\n d=\"M92.2716 23.2016C92.2086 23.2016 92.1457 23.2644 92.0827 23.2644C91.3273 23.5785 90.5718 23.5785 89.8793 23.2644C89.7534 23.2016 89.6275 23.1387 89.4386 23.0759C88.935 22.7618 88.5573 22.322 88.3054 21.7565C87.6129 20.2487 88.1166 18.6151 89.6275 17.8612C91.1384 17.1073 92.9641 17.547 93.6566 19.0549C94.412 20.6256 93.9084 22.3848 92.2716 23.2016Z\"\n fill=\"#B4D1EF\"\n />\n <path\n d=\"M102.3 23.2016C102.237 23.2016 102.173 23.2644 102.11 23.2644C101.349 23.5785 100.589 23.5785 99.8918 23.2644C99.765 23.2016 99.6383 23.1387 99.4482 23.0759C98.9412 22.7618 98.561 22.322 98.3075 21.7565C97.6104 20.2487 98.1174 18.6151 99.6383 17.8612C101.159 17.1073 102.997 17.547 103.694 19.0549C104.391 20.6256 103.884 22.3848 102.3 23.2016Z\"\n fill=\"#B4D1EF\"\n />\n <path\n d=\"M210.126 91.0156H130.44C129.748 91.0156 129.748 92.0848 130.44 92.0848H210.126C210.818 92.0848 210.818 91.0156 210.126 91.0156Z\"\n fill=\"white\"\n />\n <path\n d=\"M197.484 97.5566H142.013C141.321 97.5566 141.321 98.6258 142.013 98.6258H197.484C198.176 98.6258 198.176 97.5566 197.484 97.5566Z\"\n fill=\"white\"\n />\n <path\n d=\"M229.436 35.5H61.5553C60.8149 35.5 60.8149 36.5 61.5553 36.5H229.503C230.176 36.5 230.176 35.5 229.436 35.5Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M270.44 35.3555H256.226C256.163 35.3555 256.163 36.4246 256.226 36.4246H270.44C270.503 36.4246 270.503 35.3555 270.44 35.3555Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M332.704 212.022C332.642 212.022 332.579 212.022 332.516 211.959L280.566 191.582C280.377 191.519 280.252 191.33 280.252 191.141C280.252 190.953 280.314 190.764 280.44 190.638C292.83 181.33 333.333 150.953 335.346 150.953C335.472 150.953 335.66 151.016 335.723 151.141C335.849 151.267 335.849 151.393 335.849 151.519L333.208 211.456C333.208 211.644 333.082 211.77 332.956 211.896C332.893 211.959 332.767 212.022 332.704 212.022ZM281.824 190.953L332.138 210.701L334.717 152.336C329.811 155.166 301.321 176.299 281.824 190.953Z\"\n fill=\"#E5ECF4\"\n />\n <path\n d=\"M366.289 231.015C366.226 231.015 366.226 231.015 366.164 231.015L349.371 227.053C349.182 226.99 349.057 226.927 348.994 226.739C348.931 226.613 348.931 226.424 348.994 226.236L357.736 211.141C357.862 210.953 358.05 210.89 358.239 210.89C358.428 210.89 358.616 211.015 358.679 211.204C366.918 229.758 366.792 230.324 366.792 230.512C366.792 230.638 366.667 230.764 366.541 230.89C366.478 230.953 366.415 231.015 366.289 231.015ZM350.314 226.173L365.472 229.758C364.465 227.116 360.755 218.626 358.113 212.651L350.314 226.173Z\"\n fill=\"#E5ECF4\"\n />\n <path\n d=\"M199.686 248.751C192.516 229.38 177.799 213.909 159.497 205.67V205.607C159.748 193.343 154.528 181.141 144.654 173.657C133.396 165.104 118.365 162.902 104.591 164.034C78.1132 166.236 53.0189 181.456 38.805 203.846C36.9811 206.739 35.3459 209.758 33.8365 212.839C33.522 213.468 34.4654 214.034 34.7799 213.405C45.4088 191.015 66.1635 174.16 90 167.682C113.711 161.267 146.981 164.726 156.226 191.519C157.736 195.921 158.491 200.575 158.428 205.229C150.943 201.959 142.893 199.946 134.465 199.254C121.447 198.248 103.522 199.506 95.283 211.204C91.761 216.236 90.8805 222.525 93.5849 228.122C96.2893 233.72 101.761 237.745 107.421 239.946C118.868 244.475 132.39 242.462 142.642 235.858C152.642 229.38 158.679 218.688 159.371 206.865C177.17 215.041 191.572 230.072 198.616 249.066C198.931 249.695 199.937 249.443 199.686 248.751ZM152.075 225.481C145.094 235.355 133.019 241.141 121.006 241.267C109.434 241.393 92.7044 234.6 93.0189 220.701C93.2076 213.217 98.9937 207.305 105.346 204.286C112.013 201.141 119.748 200.198 127.044 200.072C137.987 199.883 148.616 202.148 158.302 206.361C158.113 213.154 156.038 219.883 152.075 225.481Z\"\n fill=\"#E5ECF4\"\n />\n <path\n d=\"M341.447 271.204H322.767C322.075 271.204 322.075 272.273 322.767 272.273H341.447C342.138 272.336 342.138 271.204 341.447 271.204Z\"\n fill=\"#E5ECF4\"\n />\n <path\n d=\"M233.522 75.4814C230.881 89.3179 229.245 103.154 224.025 110.576C213.962 124.915 185.975 137.117 178.428 143.972C170.881 150.764 171.95 151.142 173.019 152.588C173.648 153.469 177.862 151.771 181.132 150.261C177.421 152.211 172.579 155.23 173.711 157.242C174.654 159.003 178.679 157.808 182.201 156.362C178.994 158.123 175.786 160.387 176.981 161.959C178.365 163.783 183.585 161.897 187.107 160.387C184.088 162.022 180.314 164.475 181.635 166.299C183.774 169.192 235.849 149.758 245.157 120.702C248.805 109.318 250.881 94.6009 252.013 80.8274C245.786 79.3808 239.623 77.494 233.522 75.4814Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M182.327 148.437C179.497 150.576 176.226 151.645 172.704 151.582C172.013 151.582 172.013 152.651 172.704 152.651C176.415 152.714 179.937 151.582 182.893 149.318C183.396 148.941 182.893 147.997 182.327 148.437Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M184.906 154.852C183.27 155.607 181.635 156.173 179.937 156.676C178.302 157.117 175.723 158.06 174.151 157.117C173.522 156.802 173.019 157.683 173.585 158.06C175.157 158.94 176.918 158.5 178.553 158.123C180.943 157.62 183.145 156.802 185.346 155.796C186.101 155.481 185.535 154.538 184.906 154.852Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M186.163 158.185C184.277 159.946 180.189 163.217 177.421 161.833C176.792 161.519 176.226 162.462 176.855 162.777C180.252 164.412 184.528 161.141 186.855 158.94C187.421 158.437 186.667 157.682 186.163 158.185Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M253.522 46.0474C253.522 47.1166 253.522 48.3115 253.522 49.6323C253.459 57.3052 253.145 69.1291 252.013 81.6449C251.95 82.148 251.95 82.6512 251.887 83.1543C245.472 82.148 236.981 79.2549 230.629 78.1857C232.893 65.7958 237.736 54.2864 244.151 45.4185C245.157 44.0348 246.226 42.7769 247.421 41.6449L253.522 40.5757C253.522 40.5757 253.522 41.3933 253.585 42.8398C253.522 43.6574 253.522 44.7266 253.522 46.0474Z\"\n fill=\"#F2F7FC\"\n />\n <path\n d=\"M184.687 136.932C179.875 137.121 175.253 138.637 170.631 139.837C165.565 141.101 160.5 142.174 155.371 143.122C134.602 146.975 113.264 148.238 92.1786 146.849C74.7659 145.712 55.3904 142.238 43.2332 128.531C32.469 116.403 28.9865 98.1477 34.9384 82.9879C40.7638 68.0807 55.3271 57.6583 70.9668 55.5738V54.5C58.6197 56.0792 46.969 62.7748 39.4341 72.755C29.9996 85.325 28.6066 102.317 34.6218 116.719C41.0804 132.257 55.2004 141.227 71.1568 145.017C80.2747 147.165 89.6458 147.923 98.9537 148.302C109.718 148.744 120.545 148.428 131.246 147.544C143.087 146.533 154.801 144.638 166.388 142.048C172.403 140.658 178.545 138.321 184.687 138.132C190.576 137.942 197.604 140.974 197.921 147.607C197.984 148.302 199.061 148.302 198.997 147.607C198.617 140.216 191.209 136.679 184.687 136.932Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M190 164.091V172.909C190 173.697 191 173.697 191 172.909V164.091C191 163.303 190 163.303 190 164.091Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M199 164.037V172.963C199 173.679 200 173.679 200 172.963V164.037C200 163.321 199 163.321 199 164.037Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M182 166.5V155.275C182 148.205 187.792 142.5 194.969 142.5C202.145 142.5 207.937 148.205 207.937 155.275L208 166.5H182Z\"\n fill=\"#0466C8\"\n />\n <path\n d=\"M209.483 165.5H180.517C179.828 165.5 179.828 166.5 180.517 166.5H209.483C210.172 166.5 210.172 165.5 209.483 165.5Z\"\n fill=\"#0466C8\"\n />\n <path\n d=\"M203.711 151.519V161.582C203.711 162.274 204.78 162.274 204.78 161.582V151.519C204.843 150.827 203.711 150.827 203.711 151.519Z\"\n fill=\"white\"\n />\n <path\n d=\"M196.73 134.601C187.421 142.148 183.648 152.274 187.233 153.343C190.818 154.412 203.208 135.67 203.208 135.67L196.73 134.601Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M199.748 139.632C196.855 144.098 193.396 148.374 189.182 151.708L188.239 152.399C187.358 152.84 186.352 152.148 186.478 150.953C186.541 150.45 187.233 149.066 187.421 148.689C187.925 147.557 188.491 146.425 189.057 145.292C190.377 142.777 191.824 140.387 193.459 138.06C193.836 137.494 192.893 136.928 192.516 137.494C191.195 139.443 181.824 152.399 186.855 153.594C189.245 154.16 191.824 150.827 193.27 149.381C196.038 146.55 198.491 143.469 200.692 140.135C201.069 139.569 200.126 139.066 199.748 139.632Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M211.132 135.984C207.736 139.003 203.648 140.89 199.057 141.33C198.365 141.393 198.365 142.462 199.057 142.399C203.899 141.896 208.239 139.947 211.887 136.739C212.39 136.299 211.635 135.544 211.132 135.984Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M238.176 254.224C250.692 253.783 263.208 255.607 275.723 255.796C275.157 254.475 274.654 253.217 274.088 251.897C273.774 251.205 273.459 250.513 273.145 249.821C270.377 243.658 267.484 237.809 264.717 232.274C254.906 235.859 245.031 239.129 234.843 241.331C237.547 246.928 239.12 251.393 238.176 254.224Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M273.899 253.595C276.101 253.783 278.365 253.783 280.566 253.72C284.717 253.658 288.805 253.72 292.956 253.72C299.12 253.783 305.283 253.532 311.384 253.091C307.17 244.161 302.767 235.796 298.553 228.06C289.057 230.639 279.56 232.966 269.937 235.104C273.145 242.525 275.031 249.003 273.899 253.595Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M274.214 250.828C273.836 255.104 271.069 257.997 267.107 259.57C256.352 263.909 259.937 272.84 259.937 272.84H319.874C316.918 265.167 313.648 257.809 310.314 250.765H274.214V250.828Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M307.296 229.758C293.459 203.783 276.289 186.299 281.447 173.72C297.233 135.419 300.818 107.997 291.887 84.3494L267.484 80.0098C267.484 80.0098 269.623 91.5192 268.553 112.337C267.484 133.154 252.201 152.022 250.252 182.337C249.182 199.129 259.937 225.985 266.415 241.582C275.912 238.437 297.547 232.085 307.296 229.758Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M265.786 234.475C252.516 207.934 240.063 187.683 246.415 172.714C263.145 133.406 281.069 109.884 272.075 86.1733C272.075 86.1733 254.843 72.5255 253.774 93.3431C252.704 114.161 218.05 153.846 214.088 183.972C211.321 204.915 223.962 230.513 230.252 245.356C240.252 242.337 256.352 238.815 265.786 234.475Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M282.201 272.84H222.264C222.264 272.84 222.264 260.45 234.654 257.243C237.17 256.614 238.302 255.104 238.491 252.966H274.591C277.296 259.255 279.874 265.922 282.201 272.84Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M274.088 251.896C274.025 252.274 273.962 252.588 273.836 252.966C273.082 255.67 271.195 258.123 268.428 259.444C264.151 261.519 259.119 261.456 256.289 265.922C254.969 268.06 254.402 270.45 254.34 272.84H253.333C253.522 268.311 254.906 264.098 259.182 261.708C262.704 259.758 267.233 259.821 270.252 256.991C271.447 255.922 272.264 254.475 272.704 252.966C273.019 251.959 273.145 250.89 273.082 249.884C273.459 250.513 273.774 251.205 274.088 251.896Z\"\n fill=\"white\"\n />\n <path\n d=\"M281.195 256.739C279.497 255.67 277.799 254.601 276.101 253.532C275.535 253.154 274.969 254.098 275.535 254.475C277.233 255.544 278.931 256.614 280.629 257.683C281.258 258.06 281.761 257.117 281.195 256.739Z\"\n fill=\"white\"\n />\n <path\n d=\"M244.717 257.809C242.893 257.242 241.132 256.739 239.308 256.173C238.616 255.985 238.365 256.991 238.994 257.243C240.818 257.809 242.579 258.312 244.403 258.878C245.094 259.066 245.346 258.06 244.717 257.809Z\"\n fill=\"white\"\n />\n <path\n d=\"M262.516 231.267C261.069 227.682 259.623 224.098 258.239 220.513C257.987 219.884 256.918 220.135 257.17 220.827C258.616 224.412 260.063 227.997 261.447 231.582C261.698 232.211 262.767 231.959 262.516 231.267Z\"\n fill=\"white\"\n />\n <path\n d=\"M268.616 110.073C268.491 110.513 268.365 110.953 268.302 111.394C265.786 121.645 263.208 131.897 260.692 142.148C260.503 142.84 259.497 142.526 259.623 141.834C262.264 131.331 264.843 120.765 267.484 110.262C267.61 109.821 267.736 109.381 267.799 108.878C268.05 109.318 268.365 109.696 268.616 110.073Z\"\n fill=\"white\"\n />\n <path\n d=\"M268.616 110.073C268.491 110.513 268.365 110.953 268.302 111.393C268.05 111.016 267.736 110.639 267.484 110.261C266.478 108.878 265.409 107.494 264.402 106.11C263.962 105.544 264.906 105.041 265.346 105.544C266.163 106.676 266.981 107.808 267.862 108.878C268.05 109.318 268.365 109.695 268.616 110.073Z\"\n fill=\"white\"\n />\n <path\n d=\"M251.698 43.0913C238.994 45.7328 251.509 69.5693 253.836 93.3429L291.887 84.3492C291.887 84.3492 276.415 37.997 251.698 43.0913Z\"\n fill=\"#F2F7FC\"\n />\n <path\n d=\"M251.384 79.8839C249.308 73.6574 247.296 67.4939 245.22 61.2675C245.031 60.6386 243.962 60.8901 244.151 61.582C246.226 67.8084 248.239 73.9719 250.314 80.1983C250.566 80.8273 251.572 80.5128 251.384 79.8839Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M332.075 57.431C322.39 48.3744 311.447 43.5945 299.811 41.2046C297.673 46.9908 295.723 52.9027 293.962 58.8147C295.66 59.3807 297.359 60.0096 298.994 60.6386C323.396 69.6323 326.667 87.1794 330.566 97.6197C334.528 108.06 322.642 122.777 326.604 124.538C330.566 126.362 336.289 113.028 336.289 113.028C336.289 113.028 334.843 135.481 337.736 136.173C340.377 136.865 341.698 131.016 342.264 126.488C342.076 130.764 342.327 136.047 344.906 135.859C347.17 135.67 347.862 131.456 347.987 127.494C348.365 130.764 349.245 133.909 351.384 134.098C354.088 134.349 353.962 128.626 353.522 124.349C354.277 128.123 355.66 132.777 358.05 131.896C362.075 130.513 353.962 77.8713 332.075 57.431Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M302.453 41.7707C300.314 47.7455 296.667 58.8147 295.157 64.9782C287.61 60.6386 279.245 57.1795 273.082 53.6575C265.723 49.5065 258.742 47.5569 254.717 46.3619C254.277 46.2361 253.836 46.1103 253.459 46.0474C251.572 45.5443 250.566 45.2298 250.566 45.2298L251.95 43.0286L253.459 40.5757C254.717 40.4499 255.912 40.3871 257.17 40.2613C272.704 38.9405 288.176 38.3745 302.453 41.7707Z\"\n fill=\"#F2F7FC\"\n />\n <path\n d=\"M341.761 123.846C341.384 127.117 341.887 134.853 337.673 135.67C336.981 135.796 337.296 136.865 337.987 136.739C339.874 136.362 341.069 134.915 341.572 133.154C342.453 130.261 342.453 126.928 342.83 123.909C342.956 123.154 341.824 123.154 341.761 123.846Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M346.981 122.966C346.918 124.852 346.855 126.739 346.73 128.626C346.667 129.884 347.107 135.544 344.78 135.041C344.088 134.915 343.837 135.922 344.466 136.11C346.352 136.488 347.296 135.104 347.61 133.406C348.176 130.073 347.925 126.362 348.05 122.966C348.113 122.274 347.044 122.274 346.981 122.966Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M353.648 122.022C353.648 121.33 352.579 121.33 352.579 122.022C352.642 124.035 353.774 132.337 351.132 133.029C350.44 133.217 350.755 134.224 351.447 134.098C353.019 133.657 353.648 132.525 353.774 130.953C354.088 128.06 353.711 124.978 353.648 122.022Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M358.868 119.129C358.805 118.437 357.736 118.5 357.799 119.192C357.987 120.953 360.126 130.639 357.547 131.142C356.855 131.267 357.17 132.274 357.862 132.148C359.56 131.834 360 130.387 360 128.815C359.937 125.67 359.245 122.337 358.868 119.129Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M275.346 54.3493C274.088 53.8462 272.83 53.4059 271.635 52.9028C271.006 52.6512 270.692 53.7204 271.321 53.972C272.579 54.4751 273.836 54.9154 275.031 55.4185C275.723 55.6701 276.038 54.6009 275.346 54.3493Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M256.164 41.9592C254.277 37.4938 251.509 31.2045 251.132 31.1416L241.006 33.28C241.006 33.28 245.849 42.9655 248.113 47.5567C250.629 45.4812 253.333 43.6573 256.164 41.9592Z\"\n fill=\"#D4E8F7\"\n />\n <path\n d=\"M252.704 28.4372C252.704 28.7517 252.642 29.0661 252.579 29.3806C252.516 29.6951 252.453 30.0095 252.39 30.2611C252.39 30.324 252.327 30.3869 252.327 30.4498C252.264 30.7013 252.201 30.9529 252.138 31.2045C250.943 35.041 247.862 38.0598 243.082 38.1856C233.899 38.3743 230.252 30.7013 231.384 24.412C232.138 20.1982 235.094 16.5504 239.937 16.173C240.126 16.173 240.377 16.1102 240.566 16.1102C245.031 16.0473 248.176 17.6825 250.189 20.0724C250.503 20.5127 250.818 20.9529 251.132 21.3932C251.321 21.7076 251.447 22.0221 251.635 22.3366C251.887 22.8397 252.075 23.3429 252.201 23.846C252.641 25.3554 252.83 26.9278 252.704 28.4372Z\"\n fill=\"#D4E8F7\"\n />\n <path d=\"M236.478 29.3179L238.679 34.9782L234.528 35.2298L236.478 29.3179Z\" fill=\"#002957\" />\n <path\n d=\"M239.182 28.0601L239.434 28.8148C239.686 29.4438 238.616 29.6953 238.365 29.0664L238.113 28.3117C237.924 27.6827 238.994 27.4312 239.182 28.0601Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M233.27 28.9406L233.522 29.6954C233.774 30.3243 232.704 30.5759 232.453 29.9469L232.201 29.1922C232.013 28.5004 233.082 28.2488 233.27 28.9406Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M247.044 27.1166C246.918 27.6827 246.855 28.3116 246.73 28.8776C246.604 29.5695 247.673 29.8839 247.736 29.1921C247.862 28.6261 247.924 27.9971 248.05 27.4311C248.176 26.7393 247.17 26.4877 247.044 27.1166Z\"\n fill=\"#0466C8\"\n />\n <path\n d=\"M252.201 23.8461C252.013 23.343 251.824 22.8399 251.635 22.3367C251.509 22.0222 251.321 21.7078 251.132 21.3933C250.88 20.9531 250.566 20.5128 250.189 20.0726C248.176 17.6197 245.031 15.9845 240.566 16.1103C240.377 16.1103 240.126 16.1103 239.937 16.1732C238.491 16.299 234.465 16.9279 232.956 18.8147C228.616 20.1355 225.157 23.909 229.308 25.4814C232.453 26.8021 238.176 25.7958 240.88 24.4751C241.132 25.6072 242.83 28.7518 244.151 28.626C245.723 28.4373 245.472 26.6763 244.969 25.6072C244.906 25.4814 244.843 25.3556 244.78 25.2298C245.094 25.0411 245.409 24.8524 245.786 24.7267C247.925 23.7204 250.818 24.6638 251.509 27.1166C251.824 28.3744 251.698 29.7581 250.943 30.7015C250.88 30.8273 251.824 31.2046 252.138 31.2675C252.201 31.016 252.264 30.7644 252.327 30.5128C252.327 30.4499 252.327 30.387 252.39 30.3241C252.453 30.0097 252.516 29.7581 252.579 29.4436C252.642 29.1292 252.641 28.8147 252.704 28.5002C252.767 26.9279 252.641 25.3556 252.201 23.8461Z\"\n fill=\"#002957\"\n />\n <path\n d=\"M257.17 40.2612L256.226 42.7141L254.78 46.3619L253.522 49.5694L251.635 54.4122L246.478 48.1858L244.151 45.4185C245.157 44.0348 246.226 42.777 247.421 41.6449L253.522 40.5757C254.717 40.4499 255.912 40.3241 257.17 40.2612Z\"\n fill=\"#D4E8F7\"\n />\n </svg>\n</vl-empty-state>\n", styles: [":host{display:flex;height:100%}\n"] }]
2089
- }] });
2090
-
2091
- class EmptyAccountModule {
2092
- }
2093
- EmptyAccountModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EmptyAccountModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2094
- EmptyAccountModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: EmptyAccountModule, declarations: [EmptyAccountComponent], imports: [CommonModule, PreviewModule, LoaderModule, EmptyStateModule], exports: [EmptyAccountComponent] });
2095
- EmptyAccountModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EmptyAccountModule, imports: [CommonModule, PreviewModule, LoaderModule, EmptyStateModule] });
2096
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EmptyAccountModule, decorators: [{
2097
- type: NgModule,
2098
- args: [{
2099
- declarations: [EmptyAccountComponent],
2100
- imports: [CommonModule, PreviewModule, LoaderModule, EmptyStateModule],
2101
- exports: [EmptyAccountComponent],
2102
- }]
2103
- }] });
2104
-
2105
1437
  class ProductComponent {
2106
- constructor(contextService, configurationRuntimeService, configurationService, configurationState, quoteDraftService, integrationState, customizationService) {
1438
+ constructor(contextService, configurationRuntimeService, configurationService, configurationStateService, quoteDraftService, flowInfoService, flowStateService, integrationState, customizationService) {
2107
1439
  this.contextService = contextService;
2108
1440
  this.configurationRuntimeService = configurationRuntimeService;
2109
1441
  this.configurationService = configurationService;
2110
- this.configurationState = configurationState;
1442
+ this.configurationStateService = configurationStateService;
2111
1443
  this.quoteDraftService = quoteDraftService;
1444
+ this.flowInfoService = flowInfoService;
1445
+ this.flowStateService = flowStateService;
2112
1446
  this.integrationState = integrationState;
2113
1447
  this.customizationService = customizationService;
2114
1448
  this.uiDefinition$ = new BehaviorSubject(undefined);
@@ -2129,18 +1463,28 @@ class ProductComponent {
2129
1463
  }));
2130
1464
  }
2131
1465
  init$() {
2132
- return this.quoteDraftService.quoteDraft$.pipe(first(), switchMap(quote => {
1466
+ let quoteDraft$;
1467
+ if (this.flowInfoService.isLegacy || !this.flowInfoService.isStateful) {
1468
+ quoteDraft$ = this.quoteDraftService.quoteDraft$;
1469
+ }
1470
+ else {
1471
+ quoteDraft$ = of(undefined);
1472
+ }
1473
+ return quoteDraft$.pipe(first(), switchMap(quote => {
2133
1474
  const contextProperties = this.contextService.resolve().properties;
2134
1475
  const productId = contextProperties.productId;
2135
1476
  if (!productId) {
2136
1477
  throw new Error(`Unable to start configuration for 'productId == null'`);
2137
1478
  }
2138
- const lineItemId = this.getLineItemId(quote, productId, contextProperties.lineItemId);
2139
- const currentStateItem = quote.currentState.find(({ id }) => id === lineItemId);
2140
- if (currentStateItem) {
2141
- this.configurationService.setConfigurableRamp(currentStateItem);
1479
+ if (!quote) {
1480
+ const offeringId = contextProperties.offeringId;
1481
+ return this.configurationRuntimeService.init({ productId, offeringId });
2142
1482
  }
2143
- const { offeringId } = currentStateItem !== null && currentStateItem !== void 0 ? currentStateItem : {};
1483
+ const lineItem = this.getLineItem(quote, productId, contextProperties.lineItemId);
1484
+ if (lineItem) {
1485
+ this.configurationService.setConfigurableRamp(lineItem);
1486
+ }
1487
+ const { offeringId } = lineItem !== null && lineItem !== void 0 ? lineItem : {};
2144
1488
  return this.configurationRuntimeService.init({ productId, offeringId });
2145
1489
  }), switchMap(() => this.customizeUI$()), tap(() => {
2146
1490
  var _a, _b;
@@ -2156,25 +1500,29 @@ class ProductComponent {
2156
1500
  this.configurationRuntimeService.initializationProps.attributesMap =
2157
1501
  this.integrationState.state.guidedSelling;
2158
1502
  }
2159
- }), switchMap(() => this.configurationState.init$()));
1503
+ }), switchMap(() => this.configurationStateService.init$()));
2160
1504
  }
2161
- getLineItemId(quote, productId, lineItemId) {
2162
- var _a, _b;
1505
+ getLineItem(quote, productId, lineItemId) {
1506
+ var _a;
2163
1507
  // search by lineItemId first
2164
- let id = (_a = quote.currentState.find(li => li.id === lineItemId)) === null || _a === void 0 ? void 0 : _a.id;
2165
- if (!id && this.quoteDraftService.isStandalone) {
2166
- id = (_b = quote.currentState.find(li => li.productId === productId)) === null || _b === void 0 ? void 0 : _b.id;
1508
+ let li = quote.currentState.find(li => li.id === lineItemId);
1509
+ if (!li && this.quoteDraftService.isStandalone) {
1510
+ li = quote.currentState.find(li => li.productId === productId);
1511
+ }
1512
+ // If still not found, is could be an asset
1513
+ if (!li) {
1514
+ li = (_a = this.quoteDraftService.assetsState) === null || _a === void 0 ? void 0 : _a.currentState.find(li => li.id === lineItemId);
2167
1515
  }
2168
- return id;
1516
+ return li;
2169
1517
  }
2170
1518
  }
2171
- ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, deps: [{ token: i1$2.ContextService }, { token: i1$2.ConfigurationRuntimeService }, { token: i1$2.ConfigurationService }, { token: i1$2.ConfigurationState }, { token: i1$2.QuoteDraftService }, { token: i5.IntegrationState }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1519
+ ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, deps: [{ token: i2.ContextService }, { token: i2.ConfigurationRuntimeService }, { token: i2.ConfigurationService }, { token: i2.ConfigurationStateService }, { token: i2.QuoteDraftService }, { token: i2.FlowInfoService }, { token: i2.FlowStateService }, { token: i2.IntegrationState }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2172
1520
  ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<vl-cms-preview [uiDefinition]=\"$any(uiDefinition$ | async)\" [config]=\"config\"></vl-cms-preview>\n", styles: [""], dependencies: [{ kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2173
1521
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, decorators: [{
2174
1522
  type: Component,
2175
1523
  args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview [uiDefinition]=\"$any(uiDefinition$ | async)\" [config]=\"config\"></vl-cms-preview>\n" }]
2176
1524
  }], ctorParameters: function () {
2177
- return [{ type: i1$2.ContextService }, { type: i1$2.ConfigurationRuntimeService }, { type: i1$2.ConfigurationService }, { type: i1$2.ConfigurationState }, { type: i1$2.QuoteDraftService }, { type: i5.IntegrationState }, { type: undefined, decorators: [{
1525
+ return [{ type: i2.ContextService }, { type: i2.ConfigurationRuntimeService }, { type: i2.ConfigurationService }, { type: i2.ConfigurationStateService }, { type: i2.QuoteDraftService }, { type: i2.FlowInfoService }, { type: i2.FlowStateService }, { type: i2.IntegrationState }, { type: undefined, decorators: [{
2178
1526
  type: Optional
2179
1527
  }, {
2180
1528
  type: Inject,
@@ -2201,26 +1549,29 @@ class RecordNotFoundComponent {
2201
1549
  this.router = router;
2202
1550
  this.route = route;
2203
1551
  this.subMessage = '';
1552
+ this.type = '';
2204
1553
  const navigation = this.router.getCurrentNavigation();
2205
1554
  const { state } = (navigation === null || navigation === void 0 ? void 0 : navigation.extras) || {};
2206
1555
  this.message = state === null || state === void 0 ? void 0 : state['message'];
1556
+ this.type = (state === null || state === void 0 ? void 0 : state['type']) || '';
1557
+ this.details = state === null || state === void 0 ? void 0 : state['details'];
2207
1558
  if (typeof this.message === 'string') {
2208
1559
  this.subMessage = this.message.includes('/describe') ? 'A potential problem with permissions' : '';
2209
1560
  }
2210
1561
  }
2211
1562
  }
2212
- RecordNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
2213
- RecordNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RecordNotFoundComponent, selector: "vl-flow-record-not-found", ngImport: i0, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div class=\"msg\">\n <div *ngIf=\"message; else defaultMessage\" class=\"message-title\">\n <p>{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"message-title\">{{ subMessage }}</p>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;padding:24px 54px}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1563
+ RecordNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
1564
+ RecordNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RecordNotFoundComponent, selector: "vl-flow-record-not-found", ngImport: i0, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div *ngIf=\"message; else defaultMessage\">\n <p class=\"text message-text\" [class]=\"type\">{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"text\">{{ subMessage }}</p>\n\n <div *ngIf=\"details && details.length > 0\">\n <div *ngFor=\"let detail of details\" class=\"text\">{{ detail }}</div>\n </div>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;padding:24px 54px}:host .text{white-space:pre-line;word-break:break-word}:host .message-text.error{color:var(--vl-error-text-color)}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2214
1565
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, decorators: [{
2215
1566
  type: Component,
2216
- args: [{ selector: 'vl-flow-record-not-found', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div class=\"msg\">\n <div *ngIf=\"message; else defaultMessage\" class=\"message-title\">\n <p>{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"message-title\">{{ subMessage }}</p>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;padding:24px 54px}\n"] }]
2217
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
1567
+ args: [{ selector: 'vl-flow-record-not-found', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div *ngIf=\"message; else defaultMessage\">\n <p class=\"text message-text\" [class]=\"type\">{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"text\">{{ subMessage }}</p>\n\n <div *ngIf=\"details && details.length > 0\">\n <div *ngFor=\"let detail of details\" class=\"text\">{{ detail }}</div>\n </div>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;padding:24px 54px}:host .text{white-space:pre-line;word-break:break-word}:host .message-text.error{color:var(--vl-error-text-color)}\n"] }]
1568
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }]; } });
2218
1569
 
2219
1570
  const routes = [{ path: '', component: RecordNotFoundComponent }];
2220
1571
  class RecordNotFoundModule {
2221
1572
  }
2222
1573
  RecordNotFoundModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2223
- RecordNotFoundModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundModule, declarations: [RecordNotFoundComponent], imports: [CommonModule, i1$1.RouterModule] });
1574
+ RecordNotFoundModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundModule, declarations: [RecordNotFoundComponent], imports: [CommonModule, i1$2.RouterModule] });
2224
1575
  RecordNotFoundModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundModule, imports: [CommonModule, RouterModule.forChild(routes)] });
2225
1576
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundModule, decorators: [{
2226
1577
  type: NgModule,
@@ -2337,7 +1688,7 @@ class RemoteComponent {
2337
1688
  let items = [lineItem];
2338
1689
  for (let i = 0; i < items.length; i++) {
2339
1690
  const item = items[i];
2340
- const children = options.get(item.id);
1691
+ const children = item && options.get(item.id);
2341
1692
  if (children) {
2342
1693
  item.lineItems = children;
2343
1694
  items = items.concat(children);
@@ -2409,17 +1760,17 @@ class RemoteComponent {
2409
1760
  const optionConfigurations = this.getOptionConfigurations(this.rpcMessage.product);
2410
1761
  const rootProductOptions = this.rpcMessage.options.filter(po => po.configuredProductId === lineItem.productId);
2411
1762
  childItems.forEach(lineItem => {
2412
- var _a, _b, _c;
1763
+ var _a, _b, _c, _d;
2413
1764
  const rootOption = rootProductOptions.find(po => po.optionalProductId === lineItem.productId);
2414
1765
  if (rootOption) {
2415
1766
  const featureOptions = (_a = optionConfigurations[rootOption.featureName]) !== null && _a !== void 0 ? _a : (optionConfigurations[rootOption.featureName] = []);
2416
1767
  const originOption = !rootOption.hasChildren
2417
- ? optionConfigurations[rootOption.featureName].find(({ optionId }) => optionId === rootOption.optionId)
1768
+ ? (_b = optionConfigurations[rootOption.featureName]) === null || _b === void 0 ? void 0 : _b.find(({ optionId }) => optionId === rootOption.optionId)
2418
1769
  : undefined;
2419
1770
  const option = originOption !== null && originOption !== void 0 ? originOption : {};
2420
- option.optionId = (_b = option.optionId) !== null && _b !== void 0 ? _b : rootOption.optionId;
1771
+ option.optionId = (_c = option.optionId) !== null && _c !== void 0 ? _c : rootOption.optionId;
2421
1772
  this.updateContentData(option, lineItem);
2422
- option.index = (_c = option.index) !== null && _c !== void 0 ? _c : featureOptions.length;
1773
+ option.index = (_d = option.index) !== null && _d !== void 0 ? _d : featureOptions.length;
2423
1774
  option.selected = true;
2424
1775
  if (!originOption) {
2425
1776
  featureOptions.push(option);
@@ -2466,8 +1817,9 @@ class RemoteComponent {
2466
1817
  }
2467
1818
  }
2468
1819
  for (const option of notBundleOptions) {
2469
- if (bundleOptionsByOptionId[option.configuredProductId]) {
2470
- bundleOptionsByOptionId[option.configuredProductId].hasChildren = true;
1820
+ const bundleOption = bundleOptionsByOptionId[option.configuredProductId];
1821
+ if (bundleOption) {
1822
+ bundleOption.hasChildren = true;
2471
1823
  }
2472
1824
  }
2473
1825
  }
@@ -2476,7 +1828,7 @@ class RemoteComponent {
2476
1828
  let items = (_a = lineItem.lineItems) !== null && _a !== void 0 ? _a : [];
2477
1829
  for (let i = 0; i < items.length; i++) {
2478
1830
  const item = items[i];
2479
- if (item.lineItems) {
1831
+ if (item === null || item === void 0 ? void 0 : item.lineItems) {
2480
1832
  items = items.concat(item.lineItems.map(li => (Object.assign(Object.assign({}, li), { parentLineItem: item }))));
2481
1833
  }
2482
1834
  }
@@ -2538,9 +1890,10 @@ class RemoteComponent {
2538
1890
  component.attributes
2539
1891
  .filter(a => a.properties && a.properties[propertyName])
2540
1892
  .forEach(mapping => {
1893
+ var _a;
2541
1894
  const attribute = lineItem.attributes.find(a => a.name === mapping.name);
2542
1895
  if (attribute) {
2543
- new Set(mapping.properties[propertyName].split(',')).forEach(k => (result[k] = attribute.value));
1896
+ new Set((_a = mapping.properties[propertyName]) === null || _a === void 0 ? void 0 : _a.split(',')).forEach(k => (result[k] = attribute.value));
2544
1897
  }
2545
1898
  });
2546
1899
  return result;
@@ -2558,12 +1911,12 @@ class RemoteComponent {
2558
1911
  return optionConfigurations;
2559
1912
  }
2560
1913
  }
2561
- RemoteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RemoteComponent, deps: [{ token: i1$2.ContextService }, { token: i1$2.QuoteDraftService }, { token: i1$2.ConfigurationRuntimeService }, { token: i1$2.ConfigurationService }, { token: i1$2.ConfigurationState }, { token: i8.MessageService }, { token: i5.IntegrationState }, { token: i4.Location }], target: i0.ɵɵFactoryTarget.Component });
1914
+ RemoteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RemoteComponent, deps: [{ token: i2.ContextService }, { token: i2.QuoteDraftService }, { token: i2.ConfigurationRuntimeService }, { token: i2.ConfigurationService }, { token: i2.ConfigurationStateService }, { token: i2$2.MessageService }, { token: i2.IntegrationState }, { token: i4.Location }], target: i0.ɵɵFactoryTarget.Component });
2562
1915
  RemoteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RemoteComponent, selector: "vl-flow-remote", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2563
1916
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RemoteComponent, decorators: [{
2564
1917
  type: Component,
2565
1918
  args: [{ selector: 'vl-flow-remote', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
2566
- }], ctorParameters: function () { return [{ type: i1$2.ContextService }, { type: i1$2.QuoteDraftService }, { type: i1$2.ConfigurationRuntimeService }, { type: i1$2.ConfigurationService }, { type: i1$2.ConfigurationState }, { type: i8.MessageService }, { type: i5.IntegrationState }, { type: i4.Location }]; } });
1919
+ }], ctorParameters: function () { return [{ type: i2.ContextService }, { type: i2.QuoteDraftService }, { type: i2.ConfigurationRuntimeService }, { type: i2.ConfigurationService }, { type: i2.ConfigurationStateService }, { type: i2$2.MessageService }, { type: i2.IntegrationState }, { type: i4.Location }]; } });
2567
1920
 
2568
1921
  class RemoteModule {
2569
1922
  }
@@ -2580,18 +1933,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2580
1933
  }] });
2581
1934
 
2582
1935
  class ShoppingCartComponent {
2583
- constructor(templatesApi, cdr, toastService, flowService, customizationService) {
2584
- var _a, _b;
1936
+ constructor(templatesApi, cdr, toastService, flowInfo, customizationService) {
1937
+ var _a, _b, _c;
2585
1938
  this.templatesApi = templatesApi;
2586
1939
  this.cdr = cdr;
2587
1940
  this.toastService = toastService;
2588
- this.flowService = flowService;
1941
+ this.flowInfo = flowInfo;
2589
1942
  this.customizationService = customizationService;
2590
1943
  this.uiDefinition = undefined;
2591
1944
  this.state$ = new BehaviorSubject({ loading: true, failure: false });
2592
1945
  this.templateApiName = '';
2593
1946
  this.destroyed$ = new Subject();
2594
- this.templateApiName = (_b = (_a = this.flowService.flow) === null || _a === void 0 ? void 0 : _a.properties.templates.shoppingCart) !== null && _b !== void 0 ? _b : '';
1947
+ this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.shoppingCart) !== null && _c !== void 0 ? _c : '';
2595
1948
  }
2596
1949
  ngOnInit() {
2597
1950
  this.generateUIDefinition$()
@@ -2603,7 +1956,7 @@ class ShoppingCartComponent {
2603
1956
  this.state$.next({ loading: false, failure: false });
2604
1957
  }), catchError(err => {
2605
1958
  var _a;
2606
- const message = 'Failed to resolve Shopping cart component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
1959
+ const message = 'Failed to resolve Shopping Cart component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
2607
1960
  this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
2608
1961
  this.uiDefinition = undefined;
2609
1962
  this.state$.next({ loading: false, failure: true });
@@ -2615,38 +1968,37 @@ class ShoppingCartComponent {
2615
1968
  this.destroyed$.next();
2616
1969
  this.destroyed$.complete();
2617
1970
  }
2618
- getTemplateRootComponent$(template) {
2619
- return this.templatesApi
2620
- .fetchComponents$(template.id)
2621
- .pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
2622
- }
2623
- getLocalShoppingCartComponentMeta$() {
1971
+ getLocalMeta$() {
2624
1972
  var _a, _b;
2625
- if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getShoppingCartComponent)) {
1973
+ if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
2626
1974
  return of(undefined);
2627
1975
  }
2628
- return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getShoppingCartComponent(this.templateApiName).pipe(map(component => {
2629
- if (!component) {
1976
+ return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
1977
+ if (!components) {
2630
1978
  return;
2631
1979
  }
2632
- return {
1980
+ return components.map(component => ({
2633
1981
  html: component.html,
2634
1982
  css: component.css,
2635
1983
  js: component.js,
2636
1984
  json: component.json,
2637
- };
1985
+ }));
2638
1986
  }));
2639
1987
  }
2640
- getShoppingCartComponentMeta$() {
2641
- return this.templatesApi.fetchTemplates$().pipe(map(templates => templates.find(template => template.name === this.templateApiName)), switchMap(template => (template ? this.getTemplateRootComponent$(template) : of(undefined))), switchMap(component => component ? this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : of(undefined)));
1988
+ getOrgMeta$() {
1989
+ const template = this.flowInfo.templates.SHOPPING_CART;
1990
+ if (!template) {
1991
+ return of(undefined);
1992
+ }
1993
+ return this.templatesApi.fetchComponentsAttachments$(template.id);
2642
1994
  }
2643
1995
  generateUIDefinition$() {
2644
1996
  return of(undefined).pipe(tap(() => {
2645
1997
  if (!this.templateApiName) {
2646
- throw new Error("Flow Query parameter 'cartTemplateApiName' is missing.");
1998
+ throw new Error("Flow 'shoppingCart' template is not defined.");
2647
1999
  }
2648
- }), switchMap(() => this.getLocalShoppingCartComponentMeta$()), switchMap(meta => (meta ? of(meta) : this.getShoppingCartComponentMeta$())), map(meta => {
2649
- if (!meta) {
2000
+ }), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
2001
+ if (!metaList) {
2650
2002
  return;
2651
2003
  }
2652
2004
  const uiDef = {
@@ -2655,26 +2007,24 @@ class ShoppingCartComponent {
2655
2007
  primary: true,
2656
2008
  type: 'DEFAULT',
2657
2009
  version: 2,
2658
- children: [
2659
- {
2660
- children: [],
2661
- template: meta.html && btoa(meta.html),
2662
- script: meta.js && btoa(meta.js),
2663
- styles: meta.css && btoa(meta.css),
2664
- },
2665
- ],
2010
+ children: metaList.map(meta => ({
2011
+ children: [],
2012
+ template: meta.html && btoaSafe(meta.html),
2013
+ script: meta.js && btoaSafe(meta.js),
2014
+ styles: meta.css && btoaSafe(meta.css),
2015
+ })),
2666
2016
  };
2667
2017
  return uiDef;
2668
2018
  }));
2669
2019
  }
2670
2020
  }
2671
- ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i2.UITemplatesApiService }, { token: i0.ChangeDetectorRef }, { token: i2$1.ToastService }, { token: FlowService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2021
+ ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i0.ChangeDetectorRef }, { token: i2$1.ToastService }, { token: i2.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2672
2022
  ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2673
2023
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, decorators: [{
2674
2024
  type: Component,
2675
2025
  args: [{ selector: 'vl-flow-shopping-cart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
2676
2026
  }], ctorParameters: function () {
2677
- return [{ type: i2.UITemplatesApiService }, { type: i0.ChangeDetectorRef }, { type: i2$1.ToastService }, { type: FlowService }, { type: undefined, decorators: [{
2027
+ return [{ type: i1$1.UITemplatesApiService }, { type: i0.ChangeDetectorRef }, { type: i2$1.ToastService }, { type: i2.FlowInfoService }, { type: undefined, decorators: [{
2678
2028
  type: Optional
2679
2029
  }, {
2680
2030
  type: Inject,
@@ -2697,140 +2047,114 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2697
2047
  }] });
2698
2048
 
2699
2049
  class FlowResolver {
2700
- constructor(router, flowsApiService, routerService, contextService, flowService) {
2050
+ constructor(router, routerService, contextService, flowInfo) {
2701
2051
  this.router = router;
2702
- this.flowsApiService = flowsApiService;
2703
2052
  this.routerService = routerService;
2704
2053
  this.contextService = contextService;
2705
- this.flowService = flowService;
2706
- }
2707
- handleError(route, message, queryParams) {
2708
- const parentUrl = this.routerService.getFlowRootPath(route);
2709
- return this.router.navigate([parentUrl, '404'], {
2710
- queryParams,
2711
- state: {
2712
- message: message,
2713
- },
2714
- });
2054
+ this.flowInfo = flowInfo;
2715
2055
  }
2716
2056
  resolve(route) {
2717
2057
  const { queryParams } = route;
2718
- const { flowId } = queryParams;
2719
- if (!flowId) {
2720
- return this.handleError(route);
2721
- }
2722
- return this.flowsApiService.getFlow(flowId).pipe(map$1(flow => {
2723
- if (!flow) {
2724
- return this.handleError(route, `Flow with flowId=${flowId} is not defined`);
2725
- }
2726
- const { properties } = flow;
2727
- const { queryParams: flowQueryParams, entryPath } = properties;
2728
- const mergedQueryParams = Object.assign(Object.assign({}, queryParams), flowQueryParams);
2729
- const contextProperties = Object.entries(Object.assign(Object.assign({}, mergedQueryParams), getDefaultProperties({ flowParams: properties }))).reduce((trunk, [key, value]) => (Object.assign(Object.assign({}, trunk), { [key]: String(value) })), {});
2730
- this.contextService.update({ properties: contextProperties });
2731
- this.flowService.setFlow(flow);
2732
- const parentUrl = this.routerService.getFlowRootPath(route);
2733
- const entryUrl = String(entryPath !== null && entryPath !== void 0 ? entryPath : '')
2734
- .split('/')
2735
- .filter(Boolean);
2736
- return this.router
2737
- .navigate([parentUrl, ...entryUrl], {
2738
- queryParams: mergedQueryParams,
2739
- replaceUrl: true,
2740
- })
2741
- .catch(e => {
2742
- const message = e instanceof HttpErrorResponse ? e.error.message : e;
2743
- return this.handleError(route, message, mergedQueryParams);
2744
- });
2058
+ const flow = this.flowInfo.flow;
2059
+ if (!flow) {
2060
+ return of(false);
2061
+ }
2062
+ const { properties } = flow;
2063
+ const { queryParams: flowQueryParams, entryPath } = properties;
2064
+ const mergedQueryParams = Object.assign(Object.assign({}, queryParams), flowQueryParams);
2065
+ const contextProperties = Object.entries(Object.assign(Object.assign({}, mergedQueryParams), getDefaultProperties({ flowParams: properties }))).reduce((trunk, [key, value]) => (Object.assign(Object.assign({}, trunk), { [key]: String(value) })), {});
2066
+ this.contextService.update({ properties: contextProperties });
2067
+ this.flowInfo.flow = flow;
2068
+ const parentUrl = this.routerService.getFlowRootPath(route);
2069
+ const entryUrl = String(entryPath !== null && entryPath !== void 0 ? entryPath : '')
2070
+ .split('/')
2071
+ .filter(Boolean);
2072
+ return from(this.router.navigate([parentUrl, ...entryUrl], {
2073
+ queryParams: mergedQueryParams,
2074
+ replaceUrl: true,
2075
+ })).pipe(catchError$1(e => {
2076
+ const message = e instanceof HttpErrorResponse ? e.error.message : e;
2077
+ const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
2078
+ return this.routerService.showErrorPage$(message, errorDetails);
2745
2079
  }));
2746
2080
  }
2747
2081
  }
2748
- FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, deps: [{ token: i1$1.Router }, { token: i2.FlowsApiService }, { token: FlowRouterService }, { token: i1$2.ContextService }, { token: FlowService }], target: i0.ɵɵFactoryTarget.Injectable });
2082
+ FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i2.ContextService }, { token: i2.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
2749
2083
  FlowResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver });
2750
2084
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, decorators: [{
2751
2085
  type: Injectable
2752
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i2.FlowsApiService }, { type: FlowRouterService }, { type: i1$2.ContextService }, { type: FlowService }]; } });
2086
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i2.ContextService }, { type: i2.FlowInfoService }]; } });
2753
2087
 
2754
2088
  class QuoteResolver {
2755
- constructor(router, quoteDraftService, routerService, contextService, flowConfiguration, integrationState, flowService) {
2089
+ constructor(router, quoteDraftService, routerService, contextService, flowInfo, flowStateService) {
2756
2090
  this.router = router;
2757
2091
  this.quoteDraftService = quoteDraftService;
2758
2092
  this.routerService = routerService;
2759
2093
  this.contextService = contextService;
2760
- this.flowConfiguration = flowConfiguration;
2761
- this.integrationState = integrationState;
2762
- this.flowService = flowService;
2763
- }
2764
- handleError(route, message) {
2765
- const parentUrl = this.routerService.getFlowRootPath(route);
2766
- return from(this.router.navigate([parentUrl, '404'], { state: { message } }));
2767
- }
2768
- calculate$() {
2769
- const quoteDraft = this.quoteDraftService.quoteDraft;
2770
- if (!this.quoteDraftService.isStandalone && quoteDraft && !this.accountHasNotAssets()) {
2771
- return this.flowConfiguration.calculate$(quoteDraft);
2772
- }
2773
- return of(undefined);
2094
+ this.flowInfo = flowInfo;
2095
+ this.flowStateService = flowStateService;
2774
2096
  }
2775
2097
  resolve(route) {
2776
- const { headerId } = this.contextService.resolve();
2777
- const quote = this.quoteDraftService.quoteDraft;
2778
- if (quote && quote.quoteId === headerId) {
2098
+ const flow = this.flowInfo.flow;
2099
+ if (!flow) {
2100
+ return of(false);
2101
+ }
2102
+ if (this.flowStateService.isInitialized()) {
2779
2103
  return of(true);
2780
2104
  }
2781
- const queryParams = route.queryParams;
2782
- return this.quoteDraftService.init(headerId, queryParams).pipe(switchMap(() => this.calculate$()), tap(() => {
2783
- var _a;
2784
- const canNavigate = !((_a = this.flowService.flow) === null || _a === void 0 ? void 0 : _a.properties.suppressInitialNavigation);
2785
- if (!this.quoteDraftService.isStandalone && canNavigate) {
2786
- if (this.shouldNavigateToAssets()) {
2787
- this.changeNavigation('/assets', route);
2788
- }
2789
- else if (!this.quoteDraftService.isInitialized && this.quoteDraftService.hasProducts) {
2790
- this.changeNavigation('/cart', route);
2791
- }
2792
- }
2793
- this.initializeModifiedAssetsMap();
2794
- this.quoteDraftService.isInitialized = true;
2795
- this.quoteDraftService.hasUnsavedChanges = false;
2796
- }), catchError(e => {
2105
+ return this.flowStateService.init$().pipe(switchMap(() => this.checkDynamicNavigation$(route)), catchError(e => {
2797
2106
  const message = e instanceof HttpErrorResponse ? e.error.message : e;
2798
- return this.handleError(route, message);
2107
+ const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
2108
+ return this.routerService.showErrorPage$(message, errorDetails);
2799
2109
  }));
2800
2110
  }
2801
- changeNavigation(path, route) {
2802
- const parentUrl = this.routerService.getFlowRootPath(route);
2803
- this.router
2804
- .navigate([parentUrl + path], {
2805
- queryParams: route.queryParams,
2806
- replaceUrl: true,
2807
- })
2808
- .catch(e => {
2809
- const message = e instanceof HttpErrorResponse ? e.error.message : e;
2810
- return this.handleError(route, message);
2811
- });
2812
- }
2813
- shouldNavigateToAssets() {
2814
- var _a, _b;
2815
- if (this.contextService.mode === ConfigurationContextMode.ACCOUNT) {
2816
- return true;
2111
+ checkDynamicNavigation$(route) {
2112
+ const flow = this.flowInfo.flow;
2113
+ if (!flow) {
2114
+ return of(true);
2817
2115
  }
2818
- return (_b = (_a = this.quoteDraftService.quoteDraft) === null || _a === void 0 ? void 0 : _a.currentState.some(li => !!li.assetId)) !== null && _b !== void 0 ? _b : false;
2819
- }
2820
- accountHasNotAssets() {
2821
- return this.contextService.mode === ConfigurationContextMode.ACCOUNT && !this.quoteDraftService.hasProducts;
2116
+ if (flow.properties.suppressInitialNavigation || flow.properties.standalone) {
2117
+ return of(true);
2118
+ }
2119
+ return this.getNavigateTo().pipe(switchMap(navigateTo => {
2120
+ if (!navigateTo) {
2121
+ return of(true);
2122
+ }
2123
+ const parentUrl = this.routerService.getFlowRootPath(route);
2124
+ return from(this.router.navigate([parentUrl + navigateTo], {
2125
+ queryParams: route.queryParams,
2126
+ replaceUrl: true,
2127
+ }));
2128
+ }));
2822
2129
  }
2823
- initializeModifiedAssetsMap() {
2824
- this.integrationState.patchState({
2825
- modifiedAssets: generateModifiedAssetsMap(this.quoteDraftService.currentState),
2826
- });
2130
+ getNavigateTo() {
2131
+ const flow = this.flowInfo.flow;
2132
+ let navigateTo;
2133
+ if (flow === null || flow === void 0 ? void 0 : flow.properties.stateful) {
2134
+ return this.flowStateService.select$(UITemplateType.FLOW_ENGINE, 'NAVIGATE_TO').pipe(map(r => {
2135
+ if (r.success) {
2136
+ return r.result;
2137
+ }
2138
+ return '';
2139
+ }));
2140
+ }
2141
+ else {
2142
+ const isAccountMode = this.contextService.mode === ConfigurationContextMode.ACCOUNT;
2143
+ if (isAccountMode || this.quoteDraftService.hasAssets) {
2144
+ navigateTo = '/assets';
2145
+ }
2146
+ else if (this.quoteDraftService.hasProducts) {
2147
+ navigateTo = '/cart';
2148
+ }
2149
+ }
2150
+ return of(navigateTo);
2827
2151
  }
2828
2152
  }
2829
- QuoteResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteResolver, deps: [{ token: i1$1.Router }, { token: i1$2.QuoteDraftService }, { token: FlowRouterService }, { token: i1$2.ContextService }, { token: i1$2.FlowConfigurationService }, { token: i5.IntegrationState }, { token: FlowService }], target: i0.ɵɵFactoryTarget.Injectable });
2153
+ QuoteResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteResolver, deps: [{ token: i1$2.Router }, { token: i2.QuoteDraftService }, { token: FlowRouterService }, { token: i2.ContextService }, { token: i2.FlowInfoService }, { token: i2.FlowStateService }], target: i0.ɵɵFactoryTarget.Injectable });
2830
2154
  QuoteResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteResolver });
2831
2155
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteResolver, decorators: [{
2832
2156
  type: Injectable
2833
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$2.QuoteDraftService }, { type: FlowRouterService }, { type: i1$2.ContextService }, { type: i1$2.FlowConfigurationService }, { type: i5.IntegrationState }, { type: FlowService }]; } });
2157
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i2.QuoteDraftService }, { type: FlowRouterService }, { type: i2.ContextService }, { type: i2.FlowInfoService }, { type: i2.FlowStateService }]; } });
2834
2158
 
2835
2159
  const rootRoute = {
2836
2160
  id: VELOCE_FLOW_ROOT_ROUTE,
@@ -2841,7 +2165,7 @@ const rootRoute = {
2841
2165
  children: [
2842
2166
  {
2843
2167
  path: '',
2844
- canActivate: [initFlow],
2168
+ canActivate: [keepFlowInitialized],
2845
2169
  runGuardsAndResolvers: 'always',
2846
2170
  children: [
2847
2171
  {
@@ -2884,14 +2208,6 @@ const rootRoute = {
2884
2208
  canActivate: [ContextGuard],
2885
2209
  data: { showHeader: true },
2886
2210
  },
2887
- {
2888
- path: 'empty',
2889
- component: EmptyAccountComponent,
2890
- runGuardsAndResolvers: 'paramsOrQueryParamsChange',
2891
- resolve: { quote: QuoteResolver },
2892
- canActivate: [ContextGuard],
2893
- data: { showHeader: true },
2894
- },
2895
2211
  {
2896
2212
  path: 'remote',
2897
2213
  component: RemoteComponent,
@@ -2914,19 +2230,17 @@ const rootRoute = {
2914
2230
  class FlowRoutingModule {
2915
2231
  }
2916
2232
  FlowRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2917
- FlowRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, imports: [i1$1.RouterModule, ProductModule,
2233
+ FlowRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, imports: [i1$2.RouterModule, ProductModule,
2918
2234
  ShoppingCartModule,
2919
2235
  CatalogModule,
2920
2236
  AssetsModule,
2921
- RemoteModule,
2922
- EmptyAccountModule], exports: [RouterModule] });
2237
+ RemoteModule], exports: [RouterModule] });
2923
2238
  FlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, providers: [FlowRouterService, RootGuard, ContextGuard, ProductUnloadGuard, FlowResolver, QuoteResolver], imports: [RouterModule.forChild([rootRoute]),
2924
2239
  ProductModule,
2925
2240
  ShoppingCartModule,
2926
2241
  CatalogModule,
2927
2242
  AssetsModule,
2928
- RemoteModule,
2929
- EmptyAccountModule, RouterModule] });
2243
+ RemoteModule, RouterModule] });
2930
2244
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, decorators: [{
2931
2245
  type: NgModule,
2932
2246
  args: [{
@@ -2937,18 +2251,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2937
2251
  CatalogModule,
2938
2252
  AssetsModule,
2939
2253
  RemoteModule,
2940
- EmptyAccountModule,
2941
2254
  ],
2942
2255
  exports: [RouterModule],
2943
2256
  providers: [FlowRouterService, RootGuard, ContextGuard, ProductUnloadGuard, FlowResolver, QuoteResolver],
2944
2257
  }]
2945
2258
  }] });
2946
2259
 
2947
- class FlowGuidedSellingService {
2260
+ class FlowDocGenService {
2948
2261
  constructor(integrationState) {
2949
2262
  this.integrationState = integrationState;
2950
2263
  this.cleanup$ = new Subject();
2951
- this.isVisibleSubj$ = new BehaviorSubject(true);
2264
+ this.isVisibleSubj$ = new BehaviorSubject(false);
2952
2265
  this.isVisible$ = this.isVisibleSubj$.asObservable();
2953
2266
  this.initSubscriptions();
2954
2267
  }
@@ -2957,21 +2270,54 @@ class FlowGuidedSellingService {
2957
2270
  }
2958
2271
  initSubscriptions() {
2959
2272
  this.integrationState
2960
- .listen$(FlowAction.OPEN_GUIDED_SELLING)
2273
+ .listen$(FlowAction.FLOW_OPEN_DOC_GEN)
2961
2274
  .pipe(tap(() => this.isVisibleSubj$.next(true)), takeUntil(this.cleanup$))
2962
2275
  .subscribe();
2963
2276
  this.integrationState
2964
- .listen$(FlowAction.CLOSE_GUIDED_SELLING)
2277
+ .listen$(FlowAction.FLOW_CLOSE_DOC_GEN)
2965
2278
  .pipe(tap(() => this.isVisibleSubj$.next(false)), takeUntil(this.cleanup$))
2966
2279
  .subscribe();
2967
2280
  }
2968
2281
  }
2969
- FlowGuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, deps: [{ token: i5.IntegrationState }], target: i0.ɵɵFactoryTarget.Injectable });
2970
- FlowGuidedSellingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService });
2971
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, decorators: [{
2282
+ FlowDocGenService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDocGenService, deps: [{ token: i2.IntegrationState }], target: i0.ɵɵFactoryTarget.Injectable });
2283
+ FlowDocGenService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDocGenService });
2284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDocGenService, decorators: [{
2972
2285
  type: Injectable
2973
- }], ctorParameters: function () { return [{ type: i5.IntegrationState }]; } });
2286
+ }], ctorParameters: function () { return [{ type: i2.IntegrationState }]; } });
2287
+
2288
+ const configurePrimengShadowDOM = () => {
2289
+ DomHandler.getScrollableParents = (element) => {
2290
+ const scrollableParents = [];
2291
+ if (element) {
2292
+ const parents = DomHandler.getParents(element).filter((item) => !(item instanceof ShadowRoot));
2293
+ const overflowRegex = /(auto|scroll)/;
2294
+ const overflowCheck = (node) => {
2295
+ const styleDeclaration = window['getComputedStyle'](node, null);
2296
+ return (overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) ||
2297
+ overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) ||
2298
+ overflowRegex.test(styleDeclaration.getPropertyValue('overflowY')));
2299
+ };
2300
+ for (const parent of parents) {
2301
+ const scrollSelectors = parent.nodeType === 1 && parent.dataset['scrollselectors'];
2302
+ if (scrollSelectors) {
2303
+ const selectors = scrollSelectors.split(',');
2304
+ for (const selector of selectors) {
2305
+ const el = DomHandler.findSingle(parent, selector);
2306
+ if (el && overflowCheck(el)) {
2307
+ scrollableParents.push(el);
2308
+ }
2309
+ }
2310
+ }
2311
+ if (parent.nodeType !== 9 && overflowCheck(parent)) {
2312
+ scrollableParents.push(parent);
2313
+ }
2314
+ }
2315
+ }
2316
+ return scrollableParents;
2317
+ };
2318
+ };
2974
2319
 
2320
+ configurePrimengShadowDOM();
2975
2321
  class FlowModule {
2976
2322
  }
2977
2323
  FlowModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -2981,7 +2327,7 @@ FlowModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15
2981
2327
  ApiModule,
2982
2328
  LauncherModule,
2983
2329
  LoaderModule,
2984
- FlowHeaderModule,
2330
+ FlowNewHeaderModule,
2985
2331
  FlowDialogModule,
2986
2332
  SdkCoreModule,
2987
2333
  DocGenModule,
@@ -2992,7 +2338,7 @@ FlowModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15
2992
2338
  ApiModule,
2993
2339
  LauncherModule,
2994
2340
  LoaderModule,
2995
- FlowHeaderModule,
2341
+ FlowNewHeaderModule,
2996
2342
  FlowDialogModule,
2997
2343
  SdkCoreModule,
2998
2344
  DocGenModule,
@@ -3008,7 +2354,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3008
2354
  ApiModule,
3009
2355
  LauncherModule,
3010
2356
  LoaderModule,
3011
- FlowHeaderModule,
2357
+ FlowNewHeaderModule,
3012
2358
  FlowDialogModule,
3013
2359
  SdkCoreModule,
3014
2360
  DocGenModule,
@@ -3022,5 +2368,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3022
2368
  * Generated bundle index. Do not edit.
3023
2369
  */
3024
2370
 
3025
- export { ContextGuard, FLOW_CUSTOMIZATION, FlowModule, FlowService, VELOCE_FLOW_ROOT_ROUTE, getDefaultProperties, getFlowObjectIdPropertyName };
2371
+ export { ContextGuard, FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE, getDefaultProperties, getFlowObjectIdPropertyName };
3026
2372
  //# sourceMappingURL=veloceapps-sdk.mjs.map