@veloceapps/sdk 5.0.14-8 → 5.0.14-GOOGLE

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/bundles/{veloceapps-sdk-cms.umd.js → veloce-sdk-cms.umd.js} +15 -16
  2. package/bundles/veloce-sdk-cms.umd.js.map +1 -0
  3. package/bundles/{veloceapps-sdk-core.umd.js → veloce-sdk-core.umd.js} +42 -197
  4. package/bundles/veloce-sdk-core.umd.js.map +1 -0
  5. package/bundles/{veloceapps-sdk-runtime.umd.js → veloce-sdk-runtime.umd.js} +4 -4
  6. package/bundles/veloce-sdk-runtime.umd.js.map +1 -0
  7. package/bundles/{veloceapps-sdk.umd.js → veloce-sdk.umd.js} +23 -27
  8. package/bundles/veloce-sdk.umd.js.map +1 -0
  9. package/cms/cms.default.d.ts +1 -1
  10. package/cms/components/element-renderer/element-renderer.component.d.ts +1 -1
  11. package/cms/components/preview/preview.component.d.ts +1 -1
  12. package/cms/components/preview/preview.module.d.ts +1 -1
  13. package/cms/injection-tokens.d.ts +1 -1
  14. package/cms/launcher.module.d.ts +3 -3
  15. package/cms/modules/federated/federated.module.d.ts +1 -1
  16. package/cms/package.json +7 -7
  17. package/cms/services/launcher.service.d.ts +1 -1
  18. package/cms/types/configuration.types.d.ts +1 -1
  19. package/cms/utils/element.utils.d.ts +1 -1
  20. package/cms/utils/elements-resolver.d.ts +1 -1
  21. package/{veloceapps-sdk.d.ts → cms/veloce-sdk-cms.d.ts} +1 -1
  22. package/cms/vendor-map.d.ts +70 -71
  23. package/core/modules/configuration/configuration.module.d.ts +1 -1
  24. package/core/modules/configuration/helpers.d.ts +1 -1
  25. package/core/modules/configuration/services/configuration-runtime.service.d.ts +2 -2
  26. package/core/modules/configuration/services/configuration.service.d.ts +2 -2
  27. package/core/modules/configuration/services/runtime-context.service.d.ts +1 -1
  28. package/core/modules/configuration/types/configuration-runtime.types.d.ts +1 -1
  29. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +2 -2
  30. package/core/modules/flow-configuration/services/flow-update.service.d.ts +1 -1
  31. package/core/package.json +7 -7
  32. package/core/services/context.service.d.ts +2 -2
  33. package/core/services/index.d.ts +0 -1
  34. package/core/services/product-images.service.d.ts +1 -1
  35. package/core/services/quote-draft.service.d.ts +3 -5
  36. package/core/types/quote-states.types.d.ts +1 -1
  37. package/core/types/runtime.types.d.ts +1 -1
  38. package/core/utils/line-item.utils.d.ts +1 -2
  39. package/core/utils/line-item.worker.d.ts +1 -1
  40. package/{cms/veloceapps-sdk-cms.d.ts → core/veloce-sdk-core.d.ts} +1 -1
  41. package/esm2015/cms/cms.default.js +1 -1
  42. package/esm2015/cms/components/element-renderer/element-renderer.component.js +3 -3
  43. package/esm2015/cms/components/preview/preview.component.js +3 -3
  44. package/esm2015/cms/components/preview/preview.module.js +2 -2
  45. package/esm2015/cms/injection-tokens.js +1 -1
  46. package/esm2015/cms/launcher.module.js +4 -4
  47. package/esm2015/cms/modules/federated/federated.component.js +1 -1
  48. package/esm2015/cms/modules/federated/federated.module.js +2 -2
  49. package/esm2015/cms/plugins/configuration.plugin.js +2 -2
  50. package/esm2015/cms/plugins/script.plugin.js +2 -2
  51. package/esm2015/cms/services/launcher.service.js +2 -3
  52. package/esm2015/cms/types/configuration.types.js +1 -1
  53. package/esm2015/cms/utils/element.utils.js +1 -1
  54. package/esm2015/cms/utils/elements-resolver.js +1 -1
  55. package/esm2015/cms/veloce-sdk-cms.js +5 -0
  56. package/esm2015/cms/vendor-map.js +12 -9
  57. package/esm2015/core/core.module.js +4 -4
  58. package/esm2015/core/modules/configuration/configuration.module.js +3 -3
  59. package/esm2015/core/modules/configuration/helpers.js +2 -2
  60. package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +3 -3
  61. package/esm2015/core/modules/configuration/services/configuration.service.js +4 -4
  62. package/esm2015/core/modules/configuration/services/runtime-context.service.js +3 -3
  63. package/esm2015/core/modules/configuration/types/configuration-runtime.types.js +1 -1
  64. package/esm2015/core/modules/flow-configuration/flow-configuration.module.js +2 -2
  65. package/esm2015/core/modules/flow-configuration/services/flow-configuration.service.js +3 -10
  66. package/esm2015/core/modules/flow-configuration/services/flow-update.service.js +2 -2
  67. package/esm2015/core/services/context.service.js +3 -3
  68. package/esm2015/core/services/index.js +1 -2
  69. package/esm2015/core/services/product-images.service.js +2 -2
  70. package/esm2015/core/services/quote-draft.service.js +7 -17
  71. package/esm2015/core/types/quote-states.types.js +1 -1
  72. package/esm2015/core/types/runtime.types.js +1 -1
  73. package/esm2015/core/utils/line-item.utils.js +3 -14
  74. package/esm2015/core/utils/line-item.worker.js +1 -1
  75. package/esm2015/core/veloce-sdk-core.js +5 -0
  76. package/esm2015/runtime/components/component-preview/component-preview.component.js +3 -3
  77. package/esm2015/runtime/components/section-renderer/section-renderer.component.js +1 -1
  78. package/esm2015/runtime/components/ui-runtime/runtime.component.js +5 -5
  79. package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +5 -5
  80. package/esm2015/runtime/execution/components/children-placeholder/children-placeholder.component.js +2 -2
  81. package/esm2015/runtime/execution/components/context-provider/context-provider.component.js +2 -2
  82. package/esm2015/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.js +1 -1
  83. package/esm2015/runtime/execution/components/federated/federated.component.js +1 -1
  84. package/esm2015/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.js +1 -1
  85. package/esm2015/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.js +3 -3
  86. package/esm2015/runtime/execution/components/velo-port-radio/velo-port-radio.component.js +1 -1
  87. package/esm2015/runtime/execution/components/velo-type/velo-type.component.js +2 -2
  88. package/esm2015/runtime/execution/directives/section-script.directive.js +3 -3
  89. package/esm2015/runtime/execution/directives/sf-query.directive.js +2 -2
  90. package/esm2015/runtime/execution/directives/velo-attribute.directive.js +2 -2
  91. package/esm2015/runtime/execution/directives/velo-port.directive.js +3 -3
  92. package/esm2015/runtime/execution/directives/vl-approval.directive.js +2 -2
  93. package/esm2015/runtime/execution/directives/vl-document-attachments.directive.js +2 -2
  94. package/esm2015/runtime/execution/directives/vl-document-templates.directive.js +2 -2
  95. package/esm2015/runtime/execution/directives/vl-quote.directive.js +3 -3
  96. package/esm2015/runtime/execution/directives/vl-ramp.directive.js +3 -3
  97. package/esm2015/runtime/execution/runtime-execution.module.js +6 -6
  98. package/esm2015/runtime/runtime.module.js +6 -6
  99. package/esm2015/runtime/services/cart.service.js +3 -3
  100. package/esm2015/runtime/services/configuration.service.js +6 -6
  101. package/esm2015/runtime/services/current-state.service.js +1 -1
  102. package/esm2015/runtime/services/product-model-cache.service.js +2 -2
  103. package/esm2015/runtime/services/runtime-context.service.js +5 -5
  104. package/esm2015/runtime/services/runtime-form.service.js +2 -2
  105. package/esm2015/runtime/services/runtime.service.js +3 -3
  106. package/esm2015/runtime/services/section-helper.service.js +2 -2
  107. package/esm2015/runtime/services/section-scope.service.js +1 -1
  108. package/esm2015/runtime/services/section-store.service.js +1 -1
  109. package/esm2015/runtime/services/section.service.js +3 -3
  110. package/esm2015/runtime/types/bound-data.types.js +1 -1
  111. package/esm2015/runtime/types/runtime.types.js +1 -1
  112. package/esm2015/runtime/types/script-registry.types.js +2 -2
  113. package/esm2015/runtime/utils/line-item.util.js +2 -2
  114. package/esm2015/runtime/utils/section.utils.js +2 -2
  115. package/esm2015/runtime/utils/sections-binder.helper.js +2 -2
  116. package/esm2015/runtime/veloce-sdk-runtime.js +5 -0
  117. package/esm2015/src/components/doc-gen/doc-gen.component.js +8 -8
  118. package/esm2015/src/components/doc-gen/doc-gen.module.js +2 -2
  119. package/esm2015/src/components/header/cart-overlay/cart-preview.component.js +3 -3
  120. package/esm2015/src/components/header/cart-overlay/cart-preview.module.js +2 -2
  121. package/esm2015/src/components/header/header.component.js +7 -7
  122. package/esm2015/src/components/header/header.module.js +2 -2
  123. package/esm2015/src/components/header/metrics/metrics.component.js +15 -19
  124. package/esm2015/src/components/header/metrics/metrics.definitions.js +6 -6
  125. package/esm2015/src/components/header/metrics/metrics.module.js +2 -2
  126. package/esm2015/src/flow.component.js +4 -4
  127. package/esm2015/src/flow.module.js +5 -5
  128. package/esm2015/src/guards/context.guard.js +3 -3
  129. package/esm2015/src/guards/product-unload.guard.js +2 -2
  130. package/esm2015/src/pages/catalog/catalog.component.js +7 -7
  131. package/esm2015/src/pages/catalog/catalog.module.js +3 -3
  132. package/esm2015/src/pages/debug/debug.component.js +3 -3
  133. package/esm2015/src/pages/empty-account/empty-account.component.js +1 -1
  134. package/esm2015/src/pages/empty-account/empty-account.module.js +3 -3
  135. package/esm2015/src/pages/legacy-product/legacy-product.component.js +6 -6
  136. package/esm2015/src/pages/legacy-product/legacy-product.module.js +2 -2
  137. package/esm2015/src/pages/product/product.component.js +4 -4
  138. package/esm2015/src/pages/product/product.module.js +3 -3
  139. package/esm2015/src/pages/remote/remote.component.js +7 -7
  140. package/esm2015/src/pages/remote/remote.module.js +3 -3
  141. package/esm2015/src/pages/remote/remote.types.js +1 -1
  142. package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +7 -7
  143. package/esm2015/src/pages/shopping-cart/shopping-cart.module.js +3 -3
  144. package/esm2015/src/resolvers/flow.resolver.js +3 -3
  145. package/esm2015/src/resolvers/quote.resolver.js +11 -11
  146. package/esm2015/src/services/doc-gen.service.js +3 -3
  147. package/esm2015/src/services/flow-dialog.service.js +2 -2
  148. package/esm2015/src/services/flow-router.service.js +3 -3
  149. package/esm2015/src/services/flow.service.js +4 -4
  150. package/esm2015/src/types/context-route.types.js +1 -1
  151. package/esm2015/src/types/flow-customization.types.js +1 -1
  152. package/esm2015/src/utils/flow.utils.js +2 -2
  153. package/esm2015/veloce-sdk.js +5 -0
  154. package/fesm2015/{veloceapps-sdk-cms.js → veloce-sdk-cms.js} +17 -15
  155. package/fesm2015/veloce-sdk-cms.js.map +1 -0
  156. package/fesm2015/{veloceapps-sdk-core.js → veloce-sdk-core.js} +38 -174
  157. package/fesm2015/veloce-sdk-core.js.map +1 -0
  158. package/fesm2015/{veloceapps-sdk-runtime.js → veloce-sdk-runtime.js} +10 -10
  159. package/fesm2015/veloce-sdk-runtime.js.map +1 -0
  160. package/fesm2015/{veloceapps-sdk.js → veloce-sdk.js} +32 -36
  161. package/fesm2015/veloce-sdk.js.map +1 -0
  162. package/package.json +13 -14
  163. package/runtime/components/component-preview/component-preview.component.d.ts +1 -1
  164. package/runtime/components/section-renderer/section-renderer.component.d.ts +1 -1
  165. package/runtime/components/ui-runtime/runtime.component.d.ts +2 -2
  166. package/runtime/components/ui-runtime-preview/runtime-preview.component.d.ts +3 -3
  167. package/runtime/execution/components/children-placeholder/children-placeholder.component.d.ts +1 -1
  168. package/runtime/execution/components/context-provider/context-provider.component.d.ts +2 -2
  169. package/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.d.ts +1 -1
  170. package/runtime/execution/components/federated/federated.component.d.ts +1 -1
  171. package/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.d.ts +1 -1
  172. package/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.d.ts +1 -1
  173. package/runtime/execution/components/velo-port-radio/velo-port-radio.component.d.ts +1 -1
  174. package/runtime/execution/components/velo-type/velo-type.component.d.ts +1 -1
  175. package/runtime/execution/directives/section-script.directive.d.ts +1 -1
  176. package/runtime/execution/directives/sf-query.directive.d.ts +2 -2
  177. package/runtime/execution/directives/velo-attribute.directive.d.ts +1 -1
  178. package/runtime/execution/directives/velo-port.directive.d.ts +1 -1
  179. package/runtime/execution/directives/vl-approval.directive.d.ts +2 -2
  180. package/runtime/execution/directives/vl-document-attachments.directive.d.ts +2 -2
  181. package/runtime/execution/directives/vl-document-templates.directive.d.ts +2 -2
  182. package/runtime/execution/directives/vl-quote.directive.d.ts +2 -2
  183. package/runtime/execution/directives/vl-ramp.directive.d.ts +3 -3
  184. package/runtime/execution/runtime-execution.module.d.ts +5 -5
  185. package/runtime/package.json +7 -7
  186. package/runtime/runtime.module.d.ts +5 -5
  187. package/runtime/services/cart.service.d.ts +3 -3
  188. package/runtime/services/configuration.service.d.ts +3 -3
  189. package/runtime/services/current-state.service.d.ts +1 -1
  190. package/runtime/services/product-model-cache.service.d.ts +2 -2
  191. package/runtime/services/runtime-context.service.d.ts +2 -2
  192. package/runtime/services/runtime-form.service.d.ts +1 -1
  193. package/runtime/services/runtime.service.d.ts +2 -2
  194. package/runtime/services/section-helper.service.d.ts +1 -1
  195. package/runtime/services/section-scope.service.d.ts +1 -1
  196. package/runtime/services/section-store.service.d.ts +1 -1
  197. package/runtime/services/section.service.d.ts +1 -1
  198. package/runtime/types/bound-data.types.d.ts +1 -1
  199. package/runtime/types/runtime.types.d.ts +2 -2
  200. package/runtime/utils/line-item.util.d.ts +1 -1
  201. package/runtime/utils/section.utils.d.ts +1 -1
  202. package/runtime/utils/sections-binder.helper.d.ts +1 -1
  203. package/{core/veloceapps-sdk-core.d.ts → runtime/veloce-sdk-runtime.d.ts} +1 -1
  204. package/src/components/doc-gen/doc-gen.component.d.ts +3 -3
  205. package/src/components/doc-gen/doc-gen.module.d.ts +1 -1
  206. package/src/components/header/cart-overlay/cart-preview.component.d.ts +1 -1
  207. package/src/components/header/cart-overlay/cart-preview.module.d.ts +1 -1
  208. package/src/components/header/header.component.d.ts +4 -4
  209. package/src/components/header/header.module.d.ts +1 -1
  210. package/src/components/header/metrics/metrics.component.d.ts +4 -5
  211. package/src/components/header/metrics/metrics.definitions.d.ts +1 -1
  212. package/src/components/header/metrics/metrics.module.d.ts +1 -1
  213. package/src/flow.component.d.ts +2 -2
  214. package/src/flow.module.d.ts +4 -4
  215. package/src/guards/context.guard.d.ts +1 -1
  216. package/src/guards/product-unload.guard.d.ts +1 -1
  217. package/src/pages/catalog/catalog.component.d.ts +3 -3
  218. package/src/pages/catalog/catalog.module.d.ts +2 -2
  219. package/src/pages/debug/debug.component.d.ts +3 -3
  220. package/src/pages/empty-account/empty-account.module.d.ts +2 -2
  221. package/src/pages/legacy-product/legacy-product.component.d.ts +4 -4
  222. package/src/pages/legacy-product/legacy-product.module.d.ts +1 -1
  223. package/src/pages/product/product.component.d.ts +1 -1
  224. package/src/pages/product/product.module.d.ts +2 -2
  225. package/src/pages/remote/remote.component.d.ts +3 -3
  226. package/src/pages/remote/remote.module.d.ts +2 -2
  227. package/src/pages/remote/remote.types.d.ts +1 -1
  228. package/src/pages/shopping-cart/shopping-cart.component.d.ts +3 -3
  229. package/src/pages/shopping-cart/shopping-cart.module.d.ts +2 -2
  230. package/src/resolvers/flow.resolver.d.ts +2 -2
  231. package/src/resolvers/quote.resolver.d.ts +1 -1
  232. package/src/services/doc-gen.service.d.ts +1 -1
  233. package/src/services/flow-dialog.service.d.ts +1 -1
  234. package/src/services/flow-router.service.d.ts +1 -1
  235. package/src/services/flow.service.d.ts +2 -2
  236. package/src/types/context-route.types.d.ts +1 -1
  237. package/src/types/flow-customization.types.d.ts +2 -2
  238. package/src/utils/flow.utils.d.ts +1 -1
  239. package/{runtime/veloceapps-sdk-runtime.d.ts → veloce-sdk.d.ts} +1 -1
  240. package/bundles/veloceapps-sdk-cms.umd.js.map +0 -1
  241. package/bundles/veloceapps-sdk-core.umd.js.map +0 -1
  242. package/bundles/veloceapps-sdk-runtime.umd.js.map +0 -1
  243. package/bundles/veloceapps-sdk.umd.js.map +0 -1
  244. package/core/services/metric-calculation/metric-calculation.service.d.ts +0 -21
  245. package/core/services/metric-calculation/metric-calculation.types.d.ts +0 -1
  246. package/core/services/metric-calculation/metric-calculation.utils.d.ts +0 -5
  247. package/esm2015/cms/veloceapps-sdk-cms.js +0 -5
  248. package/esm2015/core/services/metric-calculation/metric-calculation.service.js +0 -74
  249. package/esm2015/core/services/metric-calculation/metric-calculation.types.js +0 -2
  250. package/esm2015/core/services/metric-calculation/metric-calculation.utils.js +0 -42
  251. package/esm2015/core/veloceapps-sdk-core.js +0 -5
  252. package/esm2015/runtime/veloceapps-sdk-runtime.js +0 -5
  253. package/esm2015/veloceapps-sdk.js +0 -5
  254. package/fesm2015/veloceapps-sdk-cms.js.map +0 -1
  255. package/fesm2015/veloceapps-sdk-core.js.map +0 -1
  256. package/fesm2015/veloceapps-sdk-runtime.js.map +0 -1
  257. package/fesm2015/veloceapps-sdk.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, NgModule } from '@angular/core';
3
- import { UUID, ConfigurationContext, ConfigurationContextMode, RuntimeModel, SalesforceIdUtils, ConfigurationMode, ChargeGroupUtils } from '@veloceapps/core';
4
- import { BehaviorSubject, zip, noop, combineLatest, Subject, take as take$1, map as map$1, distinctUntilChanged, catchError, of, tap as tap$1, throwError, shareReplay as shareReplay$1, switchMap as switchMap$1 } from 'rxjs';
3
+ import { UUID, ConfigurationContext, ConfigurationContextMode, RuntimeModel, SalesforceIdUtils, ConfigurationMode, ChargeGroupUtils } from '@veloce/core';
4
+ import { BehaviorSubject, map as map$1, distinctUntilChanged, catchError, of, tap as tap$1, zip, noop, combineLatest, throwError, shareReplay as shareReplay$1, switchMap as switchMap$1 } from 'rxjs';
5
5
  import { filter, tap, map, switchMap, skip, take, shareReplay, first, catchError as catchError$1, finalize } from 'rxjs/operators';
6
- import * as i1 from '@veloceapps/api';
7
- import { PriceApiService, ContextApiService, ProductModelApiService, ConfigurationApiService } from '@veloceapps/api';
8
- import { merge, isEqual, uniq, flatten, sortBy, map as map$2, cloneDeep } from 'lodash';
9
- import { ToastType, ConfirmationComponent, ConfirmationDialogModule } from '@veloceapps/components';
6
+ import * as i1 from '@veloce/api';
7
+ import { PriceApiService, ContextApiService, ProductModelApiService, ConfigurationApiService } from '@veloce/api';
8
+ import { merge, flatten, sortBy, cloneDeep } from 'lodash';
9
+ import { ToastType, ConfirmationComponent, ConfirmationDialogModule } from '@veloce/components';
10
10
  import * as i4 from 'primeng/api';
11
11
  import * as i5 from 'primeng/dynamicdialog';
12
12
  import moment from 'moment';
@@ -79,47 +79,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
79
79
  args: [{ providedIn: 'root' }]
80
80
  }], ctorParameters: function () { return [{ type: i1.ContextApiService }]; } });
81
81
 
82
- function calculateMetricByMethod(lineItems, metric, method) {
83
- const items = getLineItemsByMethod(lineItems, method);
84
- return items.reduce((acc, li) => {
85
- let value = li.reduce((accProduct, item) => accProduct + ((item.totalMetrics && item.totalMetrics[metric]) || 0), 0);
86
- if (method === 'avg' && li.length > 0) {
87
- value /= li.length;
88
- }
89
- return acc + value;
90
- }, 0);
91
- }
92
- function getLineItemsByMethod(lineItems, method) {
93
- switch (method) {
94
- case 'first': {
95
- return lineItems.filter(li => !li.rampInstanceId).map(item => [item]);
96
- }
97
- case 'last': {
98
- const rootTermItems = lineItems.filter(li => !li.rampInstanceId);
99
- const products = rootTermItems.map(lineItem => [
100
- lineItem,
101
- ...lineItems.filter(li => li.rampInstanceId === lineItem.id),
102
- ]);
103
- return products
104
- .map(items => [...items].sort((a, b) => getDateValue(a.endDate || '') - getDateValue(b.endDate || '')).pop())
105
- .filter((li) => Boolean(li))
106
- .map(item => [item]);
107
- }
108
- case 'avg': {
109
- const rootTermItems = lineItems.filter(li => !li.rampInstanceId);
110
- return rootTermItems.map(lineItem => [lineItem, ...lineItems.filter(li => li.rampInstanceId === lineItem.id)]);
111
- }
112
- case 'sum': {
113
- return lineItems.map(item => [item]);
114
- }
115
- default: {
116
- return lineItems.map(item => [item]);
82
+ class ProductImagesService {
83
+ constructor(productApiService) {
84
+ this.productApiService = productApiService;
85
+ this.imagesMap$ = new BehaviorSubject({});
86
+ }
87
+ getImageUrl$(productId) {
88
+ if (this.imagesMap$.value[productId] == null) {
89
+ this.imagesMap$.next(Object.assign(Object.assign({}, this.imagesMap$.value), { [productId]: '' }));
90
+ this.fetchProductImage(productId);
117
91
  }
92
+ return this.imagesMap$.pipe(map$1(imagesMap => imagesMap[productId]), distinctUntilChanged());
93
+ }
94
+ fetchProductImage(productId) {
95
+ this.productApiService
96
+ .fetchImage$(productId)
97
+ .pipe(map$1(file => URL.createObjectURL(file)), catchError(() => of('')), tap$1(url => this.imagesMap$.next(Object.assign(Object.assign({}, this.imagesMap$.value), { [productId]: url }))))
98
+ .subscribe();
118
99
  }
119
100
  }
120
- function getDateValue(date) {
121
- return date ? new Date(date).getTime() : 0;
122
- }
101
+ ProductImagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductImagesService, deps: [{ token: i1.ProductApiService }], target: i0.ɵɵFactoryTarget.Injectable });
102
+ ProductImagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductImagesService, providedIn: 'root' });
103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductImagesService, decorators: [{
104
+ type: Injectable,
105
+ args: [{ providedIn: 'root' }]
106
+ }], ctorParameters: function () { return [{ type: i1.ProductApiService }]; } });
123
107
 
124
108
  class QuoteDraftService {
125
109
  constructor(context, quoteApiService, priceApiService) {
@@ -130,9 +114,9 @@ class QuoteDraftService {
130
114
  this.resetSubj$ = new BehaviorSubject(true);
131
115
  this.isInitializedSubj$ = new BehaviorSubject(false);
132
116
  this.initialCurrentState = [];
133
- this._hasUnsavedChanges = false;
134
117
  this.allPriceLists = [];
135
118
  this.assetPriceLists = [];
119
+ this.hasUnsavedChanges = false;
136
120
  this.reset$ = this.resetSubj$.asObservable();
137
121
  this.activePriceList$ = this.context.resolve$().pipe(map(ctx => this.allPriceLists.find(priceList => priceList.id === ctx.properties.PriceListId)), map(priceList => priceList !== null && priceList !== void 0 ? priceList : null));
138
122
  this.isInitializedSubj$
@@ -147,16 +131,6 @@ class QuoteDraftService {
147
131
  this.isInitializedSubj$.next(value);
148
132
  }
149
133
  }
150
- get hasUnsavedChanges() {
151
- return this._hasUnsavedChanges;
152
- }
153
- set hasUnsavedChanges(value) {
154
- var _a, _b;
155
- this._hasUnsavedChanges = value;
156
- if (!this._hasUnsavedChanges) {
157
- this.initialCurrentState = (_b = (_a = this.quoteDraft) === null || _a === void 0 ? void 0 : _a.currentState) !== null && _b !== void 0 ? _b : [];
158
- }
159
- }
160
134
  get hasAssets$() {
161
135
  return this.quoteSubj$.pipe(map(() => this.hasAssets));
162
136
  }
@@ -167,12 +141,13 @@ class QuoteDraftService {
167
141
  reset() {
168
142
  this.resetSubj$.next(true);
169
143
  this.quoteSubj$.next(null);
170
- this.hasUnsavedChanges = false;
144
+ this.initialCurrentState = [];
171
145
  }
172
146
  init(quoteId, params) {
173
147
  return zip(this.quoteApiService.getQuoteDraft(quoteId, params), this.priceApiService.getPriceLists()).pipe(tap(([quote, allPriceLists]) => {
174
148
  this.allPriceLists = allPriceLists;
175
149
  this.quoteSubj$.next(quote);
150
+ this.initialCurrentState = quote.currentState;
176
151
  this.context.update(quote.context);
177
152
  this.populateActivePriceLists$();
178
153
  }), map(() => noop()), take(1));
@@ -319,7 +294,7 @@ class QuoteDraftService {
319
294
  this.hasUnsavedChanges = !!quote && !quote.currentState.every(li => li.actionCode === 'EXIST');
320
295
  }
321
296
  else {
322
- this.hasUnsavedChanges = !isEqual(this.initialCurrentState, quote === null || quote === void 0 ? void 0 : quote.currentState);
297
+ this.hasUnsavedChanges = true;
323
298
  }
324
299
  }
325
300
  }
@@ -330,99 +305,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
330
305
  args: [{ providedIn: 'root' }]
331
306
  }], ctorParameters: function () { return [{ type: ContextService }, { type: i1.QuoteApiService }, { type: i1.PriceApiService }]; } });
332
307
 
333
- class MetricsCalculationService {
334
- constructor(quoteDraftService, settingsService) {
335
- this.quoteDraftService = quoteDraftService;
336
- this.settingsService = settingsService;
337
- this.metricsUpdated$ = new Subject();
338
- this.quoteMetricsSettings = {};
339
- this.metricsCalculationMethodMap = {};
340
- this.metricsData = {};
341
- combineLatest([
342
- this.quoteDraftService.currentState$,
343
- this.settingsService.fetchSetting('QUOTE_LEVEL_METRIC_CALCULATION_METHOD').pipe(take$1(1)),
344
- ]).subscribe(([lineItems, setting]) => {
345
- let settingsData = {};
346
- try {
347
- settingsData = JSON.parse((setting === null || setting === void 0 ? void 0 : setting.value) || '{}');
348
- }
349
- catch (error) {
350
- settingsData = {};
351
- }
352
- this.quoteMetricsSettings = settingsData;
353
- this.updateMetrics(lineItems);
354
- });
355
- }
356
- get onMetricsUpdate$() {
357
- return this.metricsUpdated$.asObservable();
358
- }
359
- getMetricValue(metric) {
360
- return this.metricsData[metric] || 0;
361
- }
362
- updateMetrics(lineItems) {
363
- const metricKeys = this.collectMetricKeys(lineItems).filter(key => !key.includes('Effective_'));
364
- this.metricsCalculationMethodMap = this.buildMetricsCalculationMethods(metricKeys, this.metricsCalculationMethodMap);
365
- this.metricsData = metricKeys.reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: this.calculateMetric(lineItems, key) })), {});
366
- this.metricsUpdated$.next();
367
- }
368
- calculateMetric(lineItems, metric) {
369
- return calculateMetricByMethod(lineItems, metric, this.metricsCalculationMethodMap[metric] || 'sum');
370
- }
371
- buildMetricsCalculationMethods(metricKeys, initial) {
372
- return metricKeys.reduce((acc, name) => {
373
- if (acc[name]) {
374
- return acc;
375
- }
376
- acc = Object.assign(Object.assign({}, acc), { [name]: 'sum' });
377
- const settingKey = name.replace(/VDM_|Total_/g, '');
378
- if (this.quoteMetricsSettings[settingKey]) {
379
- acc = Object.assign(Object.assign({}, acc), { [name]: this.quoteMetricsSettings[settingKey] });
380
- }
381
- return acc;
382
- }, initial);
383
- }
384
- collectMetricKeys(lineItems) {
385
- const keys = [];
386
- lineItems.forEach(lineItem => {
387
- keys.push(...Object.keys(lineItem.totalMetrics || {}));
388
- keys.push(...this.collectMetricKeys(lineItem.lineItems));
389
- });
390
- return uniq(keys);
391
- }
392
- }
393
- MetricsCalculationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: MetricsCalculationService, deps: [{ token: QuoteDraftService }, { token: i1.ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
394
- MetricsCalculationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: MetricsCalculationService, providedIn: 'root' });
395
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: MetricsCalculationService, decorators: [{
396
- type: Injectable,
397
- args: [{ providedIn: 'root' }]
398
- }], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: i1.ConfigurationSettingsApiService }]; } });
399
-
400
- class ProductImagesService {
401
- constructor(productApiService) {
402
- this.productApiService = productApiService;
403
- this.imagesMap$ = new BehaviorSubject({});
404
- }
405
- getImageUrl$(productId) {
406
- if (this.imagesMap$.value[productId] == null) {
407
- this.imagesMap$.next(Object.assign(Object.assign({}, this.imagesMap$.value), { [productId]: '' }));
408
- this.fetchProductImage(productId);
409
- }
410
- return this.imagesMap$.pipe(map$1(imagesMap => imagesMap[productId]), distinctUntilChanged());
411
- }
412
- fetchProductImage(productId) {
413
- this.productApiService
414
- .fetchImage$(productId)
415
- .pipe(map$1(file => URL.createObjectURL(file)), catchError(() => of('')), tap$1(url => this.imagesMap$.next(Object.assign(Object.assign({}, this.imagesMap$.value), { [productId]: url }))))
416
- .subscribe();
417
- }
418
- }
419
- ProductImagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductImagesService, deps: [{ token: i1.ProductApiService }], target: i0.ɵɵFactoryTarget.Injectable });
420
- ProductImagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductImagesService, providedIn: 'root' });
421
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductImagesService, decorators: [{
422
- type: Injectable,
423
- args: [{ providedIn: 'root' }]
424
- }], ctorParameters: function () { return [{ type: i1.ProductApiService }]; } });
425
-
426
308
  class RuntimeContextService {
427
309
  constructor(configurationApiService) {
428
310
  this.configurationApiService = configurationApiService;
@@ -648,17 +530,6 @@ const getRecommendedPrices = (portDomain, type) => {
648
530
  }, [0, 0])) !== null && _b !== void 0 ? _b : [0, 0];
649
531
  return { net, list };
650
532
  };
651
- const multiplyLineItems = (lineItem, qty, split) => {
652
- if (split) {
653
- const unifyIds = (lineItem) => (Object.assign(Object.assign({}, lineItem), { id: UUID.UUID(), lineItems: lineItem.lineItems.map(unifyIds) }));
654
- return map$2(new Array(qty), () => unifyIds(lineItem));
655
- }
656
- else {
657
- return [
658
- Object.assign(Object.assign({}, lineItem), { qty: qty }),
659
- ];
660
- }
661
- };
662
533
 
663
534
  var lineItem_utils = /*#__PURE__*/Object.freeze({
664
535
  __proto__: null,
@@ -673,8 +544,7 @@ var lineItem_utils = /*#__PURE__*/Object.freeze({
673
544
  patchAttributes: patchAttributes,
674
545
  getAttributeValue: getAttributeValue,
675
546
  generateLineItem: generateLineItem,
676
- getRecommendedPrices: getRecommendedPrices,
677
- multiplyLineItems: multiplyLineItems
547
+ getRecommendedPrices: getRecommendedPrices
678
548
  });
679
549
 
680
550
  class LineItemWorker {
@@ -1055,13 +925,7 @@ class FlowConfigurationService {
1055
925
  if (!quoteDraft) {
1056
926
  return of(null);
1057
927
  }
1058
- return this.configurationService.configureExternal$(productId, qty).pipe(map$1(lineItem => {
1059
- var _a, _b;
1060
- const model = this.configurationService.getRuntimeModel();
1061
- const split = (_b = (_a = model === null || model === void 0 ? void 0 : model.types.find(type => type.name === lineItem.type)) === null || _a === void 0 ? void 0 : _a.split) !== null && _b !== void 0 ? _b : false;
1062
- const lineItems = multiplyLineItems(lineItem, qty !== null && qty !== void 0 ? qty : 1, split);
1063
- return [...quoteDraft.currentState, ...lineItems];
1064
- }), switchMap$1(updatedState => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map$1(() => this.quoteDraftService.quoteDraft), this.handleErrorAndBounceBack());
928
+ return this.configurationService.configureExternal$(productId, qty).pipe(map$1(lineItem => [...quoteDraft.currentState, lineItem]), switchMap$1(updatedState => this.calculate$(Object.assign(Object.assign({}, quoteDraft), { currentState: updatedState }))), map$1(() => this.quoteDraftService.quoteDraft), this.handleErrorAndBounceBack());
1065
929
  }
1066
930
  get() {
1067
931
  return this.quoteDraftService.quoteDraft$.pipe(map$1(() => this.quoteDraftService.activeCurrentState), shareReplay$1());
@@ -1154,12 +1018,12 @@ class SdkCoreModule {
1154
1018
  }
1155
1019
  SdkCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SdkCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1156
1020
  SdkCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SdkCoreModule, imports: [ConfigurationModule, FlowConfigurationModule] });
1157
- SdkCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SdkCoreModule, providers: [ContextService, QuoteDraftService, ProductImagesService, MetricsCalculationService], imports: [[ConfigurationModule, FlowConfigurationModule]] });
1021
+ SdkCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SdkCoreModule, providers: [ContextService, QuoteDraftService, ProductImagesService], imports: [[ConfigurationModule, FlowConfigurationModule]] });
1158
1022
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SdkCoreModule, decorators: [{
1159
1023
  type: NgModule,
1160
1024
  args: [{
1161
1025
  imports: [ConfigurationModule, FlowConfigurationModule],
1162
- providers: [ContextService, QuoteDraftService, ProductImagesService, MetricsCalculationService],
1026
+ providers: [ContextService, QuoteDraftService, ProductImagesService],
1163
1027
  }]
1164
1028
  }] });
1165
1029
 
@@ -1167,5 +1031,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
1167
1031
  * Generated bundle index. Do not edit.
1168
1032
  */
1169
1033
 
1170
- export { ConfigurationRuntimeService, ConfigurationService, ContextService, FlowConfigurationModule, FlowConfigurationService, FlowUpdateService, LineItemWorker, MetricsCalculationService, ProductImagesService, QuoteDraftService, RuntimeMode, RuntimeOperation, RuntimeStep, SdkCoreModule, findLineItem, findLineItemWithComparator, generateLineItem, getAttributeValue, getAttributes, getDefaultLineItem, getRecommendedPrices, insertLineItem, lineItem_utils as lineItemUtils, mapAttributes, multiplyLineItems, patchAttributes, removeLineItem, replaceLineItem, upsertAttributes };
1171
- //# sourceMappingURL=veloceapps-sdk-core.js.map
1034
+ export { ConfigurationRuntimeService, ConfigurationService, ContextService, FlowConfigurationModule, FlowConfigurationService, FlowUpdateService, LineItemWorker, ProductImagesService, QuoteDraftService, RuntimeMode, RuntimeOperation, RuntimeStep, SdkCoreModule, findLineItem, findLineItemWithComparator, generateLineItem, getAttributeValue, getAttributes, getDefaultLineItem, getRecommendedPrices, insertLineItem, lineItem_utils as lineItemUtils, mapAttributes, patchAttributes, removeLineItem, replaceLineItem, upsertAttributes };
1035
+ //# sourceMappingURL=veloce-sdk-core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"veloce-sdk-core.js","sources":["../../../../libs/sdk/core/modules/configuration/helpers.ts","../../../../libs/sdk/core/types/runtime.types.ts","../../../../libs/sdk/core/services/context.service.ts","../../../../libs/sdk/core/services/product-images.service.ts","../../../../libs/sdk/core/services/quote-draft.service.ts","../../../../libs/sdk/core/modules/configuration/services/runtime-context.service.ts","../../../../libs/sdk/core/modules/configuration/services/configuration-runtime.service.ts","../../../../libs/sdk/core/utils/line-item.utils.ts","../../../../libs/sdk/core/utils/line-item.worker.ts","../../../../libs/sdk/core/modules/configuration/services/configuration.service.ts","../../../../libs/sdk/core/modules/flow-configuration/services/flow-update.service.ts","../../../../libs/sdk/core/modules/flow-configuration/services/flow-configuration.service.ts","../../../../libs/sdk/core/modules/flow-configuration/flow-configuration.module.ts","../../../../libs/sdk/core/modules/configuration/configuration.module.ts","../../../../libs/sdk/core/core.module.ts","../../../../libs/sdk/core/veloce-sdk-core.ts"],"sourcesContent":["import { LineItem, UUID } from '@veloce/core';\nimport { RuntimeContext, UIDefinitionProps } from '../../types';\n\nexport const getDefaultLineItem = (\n context: RuntimeContext,\n uiDefinitionProperties: UIDefinitionProps,\n qty = 1,\n): LineItem => {\n const id = UUID.UUID();\n\n const lineItem: LineItem = {\n id,\n type: uiDefinitionProperties.rootType ?? '',\n cfgStatus: 'Default',\n actionCode: 'ADD',\n qty,\n productName: context.properties?.displayName || context.productName,\n productId: context.productId ?? '',\n ...(context.offeringId\n ? { offeringId: context.offeringId, offeringInstanceId: context.offeringInstanceId || id }\n : {}),\n } as LineItem;\n\n return lineItem;\n};\n","import { ContextProperties, RuntimeModel } from '@veloce/core';\nimport { UIDefinition } from './ui-definition.types';\n\nexport enum RuntimeMode {\n TEST,\n PROD,\n}\n\nexport enum RuntimeOperation {\n INIT = 'INIT',\n UPDATE = 'UPDATE',\n}\n\nexport enum RuntimeStep {\n START = 'START',\n UPDATE = 'UPDATE',\n}\n\nexport interface InvocationContext {\n runtimeOperation?: RuntimeOperation;\n runtimeStep?: RuntimeStep;\n}\n\nexport interface RuntimeContext {\n modelId: string;\n runtimeMode: RuntimeMode;\n runtimeModel: RuntimeModel;\n uiDefinition?: UIDefinition;\n productId?: string;\n productName?: string;\n productType?: string;\n properties?: ContextProperties;\n offeringId?: string;\n offeringInstanceId?: string;\n invocationContext?: InvocationContext;\n}\n","import { Injectable } from '@angular/core';\nimport { ContextApiService } from '@veloce/api';\nimport { ConfigurationContext, ConfigurationContextMode } from '@veloce/core';\nimport { merge } from 'lodash';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { filter, map, tap } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class ContextService {\n private context = new BehaviorSubject<ConfigurationContext | null>(null);\n\n constructor(private contextApiService: ContextApiService) {}\n\n public get isInitialized(): boolean {\n return Boolean(this.context.value);\n }\n\n public resolve(): ConfigurationContext {\n if (!this.context.value) {\n throw new Error('Context is not initialized yet!');\n }\n\n return { ...this.context.value };\n }\n\n public resolve$(): Observable<ConfigurationContext> {\n return this.context.pipe(filter((ctx): ctx is ConfigurationContext => Boolean(ctx)));\n }\n\n public create(headerId: string, mode: ConfigurationContextMode): Observable<ConfigurationContext> {\n return this.contextApiService.getContext(headerId, mode).pipe(\n tap(context => this.context.next(merge(new ConfigurationContext(headerId, mode), context))),\n map(() => this.resolve() as ConfigurationContext),\n );\n }\n\n public update(partialContext: Partial<ConfigurationContext>): ConfigurationContext {\n const originalContext = this.resolve();\n\n const updatedContext: ConfigurationContext = {\n ...originalContext,\n ...(partialContext as ConfigurationContext),\n properties: {\n ...originalContext.properties,\n ...partialContext.properties,\n },\n };\n\n this.context.next(updatedContext);\n\n return updatedContext;\n }\n\n public set(context: ConfigurationContext): ConfigurationContext {\n const originalContext = this.resolve();\n\n const updatedContext: ConfigurationContext = {\n ...originalContext,\n ...context,\n };\n\n this.context.next(updatedContext);\n\n return updatedContext;\n }\n\n public delete(): void {\n this.context.next(null);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ProductApiService } from '@veloce/api';\nimport { Dictionary } from 'lodash';\nimport { BehaviorSubject, catchError, distinctUntilChanged, map, Observable, of, tap } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class ProductImagesService {\n private imagesMap$ = new BehaviorSubject<Dictionary<string>>({});\n\n constructor(private productApiService: ProductApiService) {}\n\n public getImageUrl$(productId: string): Observable<string | null> {\n if (this.imagesMap$.value[productId] == null) {\n this.imagesMap$.next({ ...this.imagesMap$.value, [productId]: '' });\n this.fetchProductImage(productId);\n }\n\n return this.imagesMap$.pipe(\n map(imagesMap => imagesMap[productId]),\n distinctUntilChanged(),\n );\n }\n\n private fetchProductImage(productId: string): void {\n this.productApiService\n .fetchImage$(productId)\n .pipe(\n map(file => URL.createObjectURL(file)),\n catchError(() => of('')),\n tap(url => this.imagesMap$.next({ ...this.imagesMap$.value, [productId]: url })),\n )\n .subscribe();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PriceApiService, QuoteApiService } from '@veloce/api';\nimport { ConfigurationContextMode, LineItem, PriceList, PriceSummary, QuoteDraft } from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { BehaviorSubject, combineLatest, noop, Observable, zip } from 'rxjs';\nimport { filter, map, shareReplay, skip, switchMap, take, tap } from 'rxjs/operators';\nimport { ContextService } from './context.service';\n\n@Injectable({ providedIn: 'root' })\nexport class QuoteDraftService {\n private quoteSubj$ = new BehaviorSubject<QuoteDraft | null>(null);\n private resetSubj$ = new BehaviorSubject<boolean>(true);\n private isInitializedSubj$ = new BehaviorSubject<boolean>(false);\n private initialCurrentState: LineItem[] = [];\n\n public get isInitialized(): boolean {\n return this.isInitializedSubj$.getValue();\n }\n public set isInitialized(value: boolean) {\n if (this.isInitialized !== value) {\n this.isInitializedSubj$.next(value);\n }\n }\n\n public get hasAssets$(): Observable<boolean> {\n return this.quoteSubj$.pipe(map(() => this.hasAssets));\n }\n public get hasAssets(): boolean {\n const quoteDraft = this.quoteSubj$.value;\n return Boolean(quoteDraft && quoteDraft.currentState.length > 0);\n }\n\n public allPriceLists: PriceList[] = [];\n public assetPriceLists: PriceList[] = [];\n public hasUnsavedChanges = false;\n public reset$ = this.resetSubj$.asObservable();\n public activePriceList$: Observable<PriceList | null>;\n\n constructor(\n private context: ContextService,\n private quoteApiService: QuoteApiService,\n private priceApiService: PriceApiService,\n ) {\n this.activePriceList$ = this.context.resolve$().pipe(\n map(ctx => this.allPriceLists.find(priceList => priceList.id === ctx.properties.PriceListId)),\n map(priceList => priceList ?? null),\n );\n\n this.isInitializedSubj$\n .pipe(\n filter(isInitialized => isInitialized),\n switchMap(() => this.quoteSubj$.asObservable()),\n skip(1),\n tap(quote => this.markAsUpdated(quote)),\n )\n .subscribe();\n }\n\n public reset(): void {\n this.resetSubj$.next(true);\n this.quoteSubj$.next(null);\n this.initialCurrentState = [];\n }\n\n public init(quoteId: string, params: Dictionary<string>): Observable<void> {\n return zip(this.quoteApiService.getQuoteDraft(quoteId, params), this.priceApiService.getPriceLists()).pipe(\n tap(([quote, allPriceLists]) => {\n this.allPriceLists = allPriceLists;\n this.quoteSubj$.next(quote);\n this.initialCurrentState = quote.currentState;\n\n this.context.update(quote.context);\n\n this.populateActivePriceLists$();\n }),\n map(() => noop()),\n take(1),\n );\n }\n\n public setCurrentLineItemState(lineItems: LineItem[]): void {\n const quoteDraft = this.quoteSubj$.value;\n\n if (!quoteDraft) {\n return;\n }\n\n this.quoteSubj$.next({\n ...quoteDraft,\n currentState: lineItems,\n });\n }\n\n public updateQuoteDraft(update: Partial<QuoteDraft>): void {\n const quoteDraft = this.quoteSubj$.value;\n\n if (!quoteDraft) {\n return;\n }\n\n if (update.context) {\n this.context.set(update.context);\n }\n\n this.quoteSubj$.next({\n ...quoteDraft,\n ...update,\n });\n }\n\n public updateByPriceSummary(priceSummary: PriceSummary): void {\n const quoteDraft = this.quoteSubj$.value;\n\n if (!quoteDraft) {\n return;\n }\n\n const updatedCurrentState = this.currentState.map(lineItem => {\n const updated = priceSummary.lineItems.find(li => li.id === lineItem.id);\n return updated ?? lineItem;\n });\n\n this.quoteSubj$.next({\n ...quoteDraft,\n currentState: updatedCurrentState,\n totalPrices: priceSummary.totalPrices,\n approvalItems: priceSummary.approvalItems,\n });\n }\n\n public get quoteDraft$(): Observable<QuoteDraft> {\n return combineLatest([this.quoteSubj$, this.context.resolve$()]).pipe(\n map(() => this.quoteDraft),\n filter((quote): quote is QuoteDraft => Boolean(quote)),\n shareReplay(),\n );\n }\n\n public get quoteDraft(): QuoteDraft | null {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return null;\n }\n\n return {\n ...quote,\n context: this.context.resolve(),\n };\n }\n\n public get quoteDraftForActivePriceList(): QuoteDraft | null {\n const quoteDraft = this.quoteDraft;\n\n if (!quoteDraft) {\n return null;\n }\n\n return {\n ...quoteDraft,\n initialState: this.filterByActivePriceList(quoteDraft.initialState),\n currentState: this.filterByActivePriceList(quoteDraft.currentState),\n };\n }\n\n public get currentState$(): Observable<LineItem[]> {\n return this.quoteDraft$.pipe(map(quote => quote.currentState));\n }\n\n public get currentState(): LineItem[] {\n return this.quoteDraft?.currentState ?? [];\n }\n\n /**\n * Stream of activeCurrentState\n */\n public get activeCurrentState$(): Observable<LineItem[]> {\n return this.quoteDraft$.pipe(map(() => this.activeCurrentState));\n }\n\n /**\n * activeCurrentState is currentState passed through additional filters\n */\n public get activeCurrentState(): LineItem[] {\n let currentState = this.quoteDraft?.currentState ?? [];\n\n currentState = this.filterByActivePriceList(currentState);\n\n return currentState;\n }\n\n /**\n * Stream of activeInitialState\n */\n public get activeInitialState$(): Observable<LineItem[]> {\n return this.quoteDraft$.pipe(map(() => this.activeInitialState));\n }\n\n /**\n * activeInitialState is initialState passed through additional filters\n */\n public get activeInitialState(): LineItem[] {\n const ctx = this.context.resolve();\n let initialState = this.quoteDraft?.initialState ?? [];\n\n if (ctx.mode === ConfigurationContextMode.ACCOUNT) {\n initialState = this.filterByActivePriceList(initialState);\n }\n\n return initialState;\n }\n\n public get isStandalone(): boolean {\n return this.context.resolve().properties.standalone === 'true';\n }\n\n public get isStandalone$(): Observable<boolean> {\n return this.context.resolve$().pipe(map(() => this.isStandalone));\n }\n\n public getInitialCurrentState(): LineItem[] {\n return this.initialCurrentState;\n }\n\n public isEditMode$(): Observable<boolean> {\n return this.context.resolve$().pipe(map(() => this.isEditMode()));\n }\n\n public isEditMode(): boolean {\n const context = this.context.resolve();\n\n if (context.mode === ConfigurationContextMode.ACCOUNT) {\n return true;\n }\n\n if (context.mode === ConfigurationContextMode.QUOTE) {\n return context.properties.Status === 'Draft';\n }\n\n return false;\n }\n\n public updateActivePriceList(priceListId: string): void {\n this.context.update({ properties: { PriceListId: priceListId } });\n }\n\n private populateActivePriceLists$(): void {\n const ctx = this.context.resolve();\n const quoteDraft = this.quoteDraft;\n\n if (!quoteDraft) {\n return;\n }\n\n // In ACCOUNT mode populate price lists from related assets\n if (ctx.mode === ConfigurationContextMode.ACCOUNT) {\n // Populate list of price lists\n this.assetPriceLists = quoteDraft.currentState\n .map(({ priceListId }) => priceListId)\n .reduce<PriceList[]>((trunk, priceListId) => {\n if (!priceListId || trunk.some(item => item.id === priceListId)) {\n return trunk;\n }\n\n return [\n ...trunk,\n { id: priceListId, name: this.allPriceLists.find(item => item.id === priceListId)?.name ?? '' },\n ];\n }, []);\n }\n }\n\n private filterByActivePriceList(lineItems: LineItem[]): LineItem[] {\n const ctx = this.context.resolve();\n\n return lineItems.filter(li => !li.priceListId || li.priceListId === ctx.properties.PriceListId);\n }\n\n private markAsUpdated(quote: QuoteDraft | null): void {\n if (quote?.context.properties.mode === ConfigurationContextMode.ACCOUNT) {\n this.hasUnsavedChanges = !!quote && !quote.currentState.every(li => li.actionCode === 'EXIST');\n } else {\n this.hasUnsavedChanges = true;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { RuntimeData, RuntimeModel, UIDefinition as LegacyUiDefinition } from '@veloce/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { RuntimeContext, RuntimeMode, UIDefinition } from '../../../types';\n\n@Injectable()\nexport class RuntimeContextService {\n constructor(private configurationApiService: ConfigurationApiService) {}\n\n public getRuntimeContext(productId: string, offeringId?: string): Observable<RuntimeContext> {\n return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(\n map(runtimeData => {\n const uiDefinition = this.getUIDefinition(runtimeData);\n const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);\n const { productName, properties } =\n Array.from(runtimeModel.components.values()).find(c => c.productId === productId) ?? {};\n\n return {\n modelId: runtimeData.modelId,\n uiDefinition: uiDefinition,\n runtimeModel: runtimeModel,\n runtimeMode: RuntimeMode.PROD,\n productId: productId,\n productType: properties?.displayName || productName,\n offeringId: offeringId,\n properties: {\n PricingEnabled: uiDefinition?.properties?.pricingEnabled ? 'true' : 'false',\n PriceListId: uiDefinition?.properties?.priceList,\n },\n };\n }),\n );\n }\n\n private getUIDefinition(runtimeData: RuntimeData): UIDefinition | undefined {\n let rawUiDefinitions: Array<UIDefinition | LegacyUiDefinition>;\n try {\n rawUiDefinitions = JSON.parse(runtimeData.uiDefinitionsSource);\n } catch (e) {\n return;\n }\n\n const uiDefinitions = rawUiDefinitions.filter(uiDef => (uiDef as UIDefinition).version) as UIDefinition[];\n const uiDefinition = uiDefinitions.find(uiDef => uiDef.primary) ?? uiDefinitions[0];\n\n return uiDefinition;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { ConfigurationContextMode, LineItem, RuntimeModel, SalesforceIdUtils } from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { combineLatest, Observable } from 'rxjs';\nimport { first, tap } from 'rxjs/operators';\nimport { ContextService } from '../../../services';\nimport { RuntimeContext, RuntimeMode, UIDefinition, UIDefinitionProps } from '../../../types';\nimport { RuntimeInitializationProps } from '../types/configuration-runtime.types';\nimport { RuntimeContextService } from './runtime-context.service';\n\n@Injectable()\nexport class ConfigurationRuntimeService {\n private _runtimeContext?: RuntimeContext;\n private _assets?: LineItem[];\n private _isInitialized = false;\n\n public initializationProps?: RuntimeInitializationProps;\n public uiDefinitionProperties: UIDefinitionProps = {};\n\n constructor(\n private apiService: ConfigurationApiService,\n private contextService: ContextService,\n private runtimeContextService: RuntimeContextService,\n ) {}\n\n public reset(): void {\n this._isInitialized = false;\n this._runtimeContext = undefined;\n this._assets = undefined;\n this.initializationProps = undefined;\n this.uiDefinitionProperties = {};\n }\n\n public initTestMode(modelId: string, uiDefinition: UIDefinition): any {\n this.uiDefinitionProperties = uiDefinition.properties ?? {};\n const uiDefinitionExternals = uiDefinition.externals ?? {};\n\n return combineLatest([\n this.apiService.getRuntimeDataByModelId(modelId),\n this.contextService.create('TestId', ConfigurationContextMode.TEST),\n ]).pipe(\n first(),\n tap(([runtimeData, context]) => {\n this._runtimeContext = {\n modelId: modelId,\n runtimeModel: RuntimeModel.create(runtimeData.types, runtimeData.products),\n runtimeMode: RuntimeMode.TEST,\n };\n\n this.contextService.update({\n properties: {\n ...this.runtimeContext?.properties,\n ...context.properties,\n ModelId: modelId,\n RuntimeMode: ConfigurationContextMode.TEST,\n PricingEnabled: this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false',\n StartDate: new Date().toISOString().substring(0, 10),\n PriceListId: this.uiDefinitionProperties.priceList,\n standalone: 'true',\n ...uiDefinitionExternals,\n },\n });\n\n this._isInitialized = true;\n }),\n );\n }\n\n public init(props: RuntimeInitializationProps): Observable<RuntimeContext | undefined> {\n this.initializationProps = props;\n this._assets = props.assets;\n const context = this.contextService.resolve();\n\n return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(\n tap(runtimeContext => {\n this.uiDefinitionProperties = runtimeContext.uiDefinition?.properties ?? {};\n const { PriceListId } = context.properties ?? {};\n\n const mergeContext: RuntimeContext = {\n ...runtimeContext,\n properties: {\n ...runtimeContext.properties,\n ...context.properties,\n PricingEnabled: PriceListId ? 'true' : 'false',\n },\n };\n\n this.id15to18('AccountId', mergeContext.properties);\n this._runtimeContext = mergeContext;\n\n if (context.properties && this._runtimeContext.properties?.StartDate) {\n this.contextService.update({\n properties: {\n ...this._runtimeContext.properties,\n ...context.properties,\n },\n });\n }\n\n this._isInitialized = true;\n }),\n );\n }\n\n private id15to18(propertyName: string, source?: Dictionary<any>): void {\n if (!source) {\n return;\n }\n\n const value = source[propertyName];\n\n if (typeof value === 'string' && value.length === 15) {\n source[propertyName] = SalesforceIdUtils.generateId18FromId15(value);\n }\n }\n\n public getAsset(lineItem: LineItem): LineItem | undefined {\n return this._assets && this._assets.find(a => a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId);\n }\n\n public get isInitialized(): boolean {\n return this._isInitialized;\n }\n\n public get runtimeModel(): RuntimeModel | undefined {\n return this.runtimeContext?.runtimeModel;\n }\n\n public get runtimeContext(): RuntimeContext | undefined {\n return this._runtimeContext;\n }\n}\n","import { Attribute, CfgStatus, LineItem, PortDomain, UUID } from '@veloce/core';\nimport { Dictionary, flatten, sortBy } from 'lodash';\n\nexport const findLineItem = (id: string, lineItems: LineItem[]): LineItem | undefined => {\n return findLineItemWithComparator(lineItems, (li: LineItem) => li.id === id);\n};\n\nexport const findLineItemWithComparator = (\n lineItems: LineItem[],\n comparator: (li: LineItem) => boolean,\n): LineItem | undefined => {\n let currentLevel = lineItems;\n\n while (currentLevel.length) {\n const found = currentLevel.find(comparator);\n\n if (found) {\n return found;\n }\n\n currentLevel = flatten(currentLevel.map(parent => parent.lineItems));\n }\n\n return;\n};\n\nexport const insertLineItem = (lineItem: LineItem, parentId: string, toInsert: LineItem): LineItem => {\n const insertData = lineItem.id === parentId ? [toInsert] : [];\n return {\n ...lineItem,\n lineItems: [\n ...insertData,\n ...lineItem.lineItems.map(li => {\n return insertLineItem(li, parentId, toInsert);\n }),\n ],\n };\n};\n\nexport const removeLineItem = (lineItem: LineItem, idToRemove: string): LineItem => {\n return {\n ...lineItem,\n lineItems: lineItem.lineItems\n .map(li => {\n if (li.id === idToRemove) {\n return;\n } else if (li.lineItems.length) {\n return removeLineItem(li, idToRemove);\n }\n return li;\n })\n .filter(r => !!r) as LineItem[],\n };\n};\n\nexport const replaceLineItem = (lineItem: LineItem, replaceTo: LineItem): LineItem => {\n if (lineItem.id === replaceTo.id) {\n return { ...replaceTo };\n }\n\n return {\n ...lineItem,\n lineItems: lineItem.lineItems.map(li => {\n if (li.id === replaceTo.id) {\n return replaceTo;\n } else if (li.lineItems.length) {\n return replaceLineItem(li, replaceTo);\n }\n return li;\n }),\n };\n};\n\nexport const mapAttributes = (attributes: Attribute[]): Dictionary<any> => {\n return attributes.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});\n};\n\nexport const getAttributes = (attributes: Attribute[], names: string[] = []): Attribute[] => {\n const filtered = attributes.filter(({ name }) => names.includes(name));\n return sortBy(filtered, [({ name }): number => names.indexOf(name)]);\n};\n\nexport const upsertAttributes = (\n originalAttributes: Attribute[],\n attributesToUpsert: { name: string; value: any }[],\n): Attribute[] => {\n return attributesToUpsert.reduce((acc, { name, value }) => {\n const [origAttr] = getAttributes(acc, [name]);\n return [\n ...acc.filter(attr => attr.name !== name),\n { ...(origAttr ?? { name }), cfgStatus: 'User' as CfgStatus, value },\n ];\n }, originalAttributes);\n};\n\nexport const patchAttributes = (\n rootLineItem: LineItem,\n id: string,\n attrs: { name: string; value: any }[],\n): LineItem => {\n const lineItem = findLineItem(id, [rootLineItem]);\n\n if (!lineItem) {\n return rootLineItem;\n }\n\n const attributes = upsertAttributes(lineItem.attributes, attrs);\n return replaceLineItem(rootLineItem, { ...lineItem, attributes });\n};\n\nexport const getAttributeValue = (attributes: Attribute[], name: string): any =>\n attributes.find(attr => attr.name === name)?.value;\n\nexport const generateLineItem = (\n port: string,\n type: string,\n parentId: string,\n attributes: { name: string; value: any }[] = [],\n lineItems: LineItem[] = [],\n): LineItem => {\n return {\n id: UUID.UUID(),\n port,\n type,\n actionCode: 'ADD',\n cfgStatus: 'New',\n attributes: attributes.map(({ name, value }) => ({ cfgStatus: 'User', name, value })),\n lineItems,\n parentId,\n qty: 1,\n } as LineItem;\n};\n\nexport const getRecommendedPrices = (portDomain: PortDomain, type: string): { net: number; list: number } => {\n const domainType = portDomain.domainTypes.find(({ name }) => name === type);\n\n const [net, list] = domainType?.recommendedPrices\n ?.filter(({ chargeMethod }) => chargeMethod === 'ONE_TIME')\n .reduce(\n (acc, rp) => {\n const [netPrice, listPrice] = acc;\n return [netPrice + rp.netPrice, listPrice + rp.listPrice];\n },\n [0, 0],\n ) ?? [0, 0];\n\n return { net, list };\n};\n","import { LineItem } from '@veloce/core';\nimport { insertLineItem, patchAttributes, removeLineItem, replaceLineItem } from './line-item.utils';\n\nexport class LineItemWorker {\n public li: LineItem;\n\n constructor(src: LineItem) {\n this.li = { ...src };\n }\n\n public insert(parentId: string, toInsert: LineItem): LineItemWorker {\n return new LineItemWorker(insertLineItem(this.li, parentId, toInsert));\n }\n\n public remove(id: string): LineItemWorker {\n return new LineItemWorker(removeLineItem(this.li, id));\n }\n\n public replace(toReplace: LineItem): LineItemWorker {\n return new LineItemWorker(replaceLineItem(this.li, toReplace));\n }\n\n public patchAttribute(attrs: { name: string; value: any }[], id?: string): LineItemWorker {\n return new LineItemWorker(patchAttributes(this.li, id ?? this.li.id, attrs));\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { ConfirmationComponent, ToastType } from '@veloce/components';\nimport {\n Charge,\n CompiledPricePlan,\n ConfigurationContext,\n ConfigurationMode,\n ConfigurationRequest,\n LineItem,\n RuntimeModel,\n VlWindow,\n} from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { MessageService } from 'primeng/api';\nimport { DialogService } from 'primeng/dynamicdialog';\nimport { BehaviorSubject, Observable, shareReplay, throwError } from 'rxjs';\nimport { catchError, finalize, first, map, switchMap, tap } from 'rxjs/operators';\nimport { ContextService, QuoteDraftService } from '../../../services';\nimport { QuoteStates, RuntimeContext, RuntimeStep } from '../../../types';\nimport { LineItemWorker } from '../../../utils';\nimport { getDefaultLineItem } from '../helpers';\nimport { ConfigurationRuntimeService } from './configuration-runtime.service';\n\ndeclare const window: VlWindow;\n\n@Injectable()\nexport class ConfigurationService {\n private mode = ConfigurationMode.SEARCH;\n private states: QuoteStates = {};\n\n private lineItem = new BehaviorSubject<LineItem | undefined>(undefined);\n private charges = new BehaviorSubject<Dictionary<Charge>>({});\n private pricePlans = new BehaviorSubject<Dictionary<CompiledPricePlan>>({});\n\n public hasUnsavedChanges = false;\n\n constructor(\n private quoteDraftService: QuoteDraftService,\n private runtimeService: ConfigurationRuntimeService,\n private contextService: ContextService,\n private configurationApiService: ConfigurationApiService,\n private messageService: MessageService,\n private dialogService: DialogService,\n ) {}\n\n public reset(): void {\n this.hasUnsavedChanges = false;\n this.runtimeService.reset();\n\n this.states = {};\n this.lineItem.next(undefined);\n this.charges.next({});\n this.pricePlans.next({});\n }\n\n public patch$(lineItem: LineItem): Observable<LineItem> {\n if (!this.lineItem.value) {\n return throwError(() => new Error(`Source LineItem not found`));\n }\n\n this.states.configurableRamp = new LineItemWorker(this.lineItem.value).replace(lineItem).li;\n this.states.asset = this.states.configurableRamp\n ? this.runtimeService.getAsset(this.states.configurableRamp)\n : undefined;\n\n return this.configure().pipe(\n catchError(error => {\n console.error(error);\n\n if (!this.runtimeService.uiDefinitionProperties.suppressToastMessages) {\n this.messageService.add({ severity: 'error', summary: error });\n }\n\n // bounce back if configuration call has failed\n this.lineItem.next(this.lineItem.value ? { ...this.lineItem.value } : undefined);\n\n return throwError(() => error);\n }),\n tap(() => {\n if (!this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n }\n }),\n );\n }\n\n public patch(lineItem: LineItem): void {\n this.patch$(lineItem).subscribe();\n }\n\n public updateCurrentStates(update: Partial<QuoteStates>): void {\n this.states = {\n ...this.states,\n ...update,\n };\n }\n\n public get(): Observable<LineItem | undefined> {\n return this.lineItem.asObservable().pipe(shareReplay());\n }\n\n public getSnapshot(): LineItem | undefined {\n return this.lineItem.value ? { ...this.lineItem.value } : undefined;\n }\n\n public getRuntimeModel(): RuntimeModel | undefined {\n return this.runtimeService.runtimeModel;\n }\n\n public getRuntimeContext(): RuntimeContext | undefined {\n return this.runtimeService.runtimeContext;\n }\n\n public get contextSnapshot(): ConfigurationContext {\n return this.contextService.resolve();\n }\n\n public get context$(): Observable<ConfigurationContext> {\n return this.contextService.resolve$();\n }\n\n public get charges$(): Observable<Dictionary<Charge>> {\n return this.charges.asObservable();\n }\n\n public get chargesSnapshot(): Dictionary<Charge> {\n return this.charges.value;\n }\n\n public get pricePlans$(): Observable<Dictionary<CompiledPricePlan>> {\n return this.pricePlans.asObservable();\n }\n\n public get pricePlansSnapshot(): Dictionary<CompiledPricePlan> {\n return this.pricePlans.value;\n }\n\n public configure(): Observable<LineItem> {\n const runtimeContext = this.getRuntimeContext();\n const runtimeModel = this.getRuntimeModel();\n if (!runtimeContext || !runtimeModel) {\n return throwError(() => new Error('Runtime context/model not initialized'));\n }\n\n const uiDefinitionProperties = {\n ...(runtimeContext.uiDefinition?.properties ?? {}),\n ...(this.runtimeService.uiDefinitionProperties ?? {}),\n };\n const qty = this.runtimeService.initializationProps?.defaultQty;\n const lineItem = this.states.configurableRamp ?? getDefaultLineItem(runtimeContext, uiDefinitionProperties, qty);\n const configurationRequest = this.createRequest(lineItem);\n\n const mainPricingEnabled = runtimeContext.properties?.PricingEnabled;\n const pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;\n\n return this.configurationApiService\n .configureLineItem({ configurationRequest, runtimeModel, pricingEnabled })\n .pipe(\n map(({ lineItem, context, charges, pricePlans, deletedLineItems }) => {\n this.contextService.update(context ?? {});\n this.charges.next(charges ?? {});\n this.pricePlans.next(pricePlans ?? {});\n if (deletedLineItems?.length) {\n this.showInactiveProductsConfirmation();\n }\n return lineItem;\n }),\n )\n .pipe(\n tap(lineItem => lineItem && this.lineItem.next(lineItem)),\n catchError(error =>\n throwError(() => new Error(error.error?.message || error.message || JSON.stringify(error))),\n ),\n );\n }\n\n public configureExternal$(productId: string, qty?: number): Observable<LineItem> {\n this.updateCurrentStates({\n currentState: this.quoteDraftService.currentState,\n });\n\n return this.runtimeService.init({ productId, defaultQty: qty }).pipe(\n switchMap(() => this.configure()),\n first(),\n catchError(error => {\n this.messageService.add({ severity: ToastType.error, summary: error });\n throw error;\n }),\n finalize(() => this.reset()),\n );\n }\n\n private createRequest(lineItem: LineItem): ConfigurationRequest {\n return {\n lineItem,\n mode: this.mode,\n step: !this.lineItem.value ? RuntimeStep.START : RuntimeStep.UPDATE,\n attributeDomainMode: 'ALL',\n context: this.contextService.resolve(),\n lineItems: this.states.currentState || [],\n asset: this.states.asset,\n };\n }\n\n private showInactiveProductsConfirmation(): void {\n this.dialogService\n .open(ConfirmationComponent, {\n dismissableMask: false,\n closeOnEscape: false,\n closable: false,\n showHeader: true,\n header: `Inactive Products in Quote`,\n width: '440px',\n data: {\n confirmationConfig: {\n title: ' ',\n description: 'This quote contains inactive products. Do you want to remove them?',\n submitBtn: 'Remove products',\n cancelBtn: 'Back to Quote',\n },\n },\n })\n .onClose.subscribe(result => {\n if (!result) {\n const context = this.contextService.resolve();\n window['VELO_BACK_FN'].apply(null, [context.headerId]);\n }\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ChargeGroupUtils, LineItem } from '@veloce/core';\nimport { flatten } from 'lodash';\nimport moment from 'moment';\nimport { LineItemWorker } from '../../../utils';\nimport { FlowUpdateParams } from '../types/update.types';\n\n@Injectable()\nexport class FlowUpdateService {\n public update(rootLineItems: LineItem[], updates: FlowUpdateParams[]): void {\n let remainingUpdates = [...updates];\n let currentLevel = rootLineItems;\n\n while (currentLevel.length && remainingUpdates.length) {\n currentLevel.forEach(li => {\n const unhandledUpdates: FlowUpdateParams[] = [];\n\n remainingUpdates.forEach(update => {\n let updated = false;\n\n switch (update.dataType) {\n case 'LINEITEM':\n updated = this.applyLineItemUpdate(li, update);\n break;\n case 'CHARGE':\n updated = this.applyChargeUpdate(li, update);\n break;\n case 'GROUP_CHARGE':\n updated = this.applyChargeGroupUpdate(li, update);\n break;\n default:\n // Unknown dataType. Do not try to handle it anymore\n updated = true;\n }\n\n if (!updated) {\n unhandledUpdates.push(update);\n }\n });\n\n remainingUpdates = unhandledUpdates;\n });\n\n currentLevel = flatten(currentLevel.map(parent => parent.lineItems));\n }\n }\n\n public delete(lineItems: LineItem[], id: string): LineItem[] {\n const idsToRemove: string[] = [id];\n const topLevelLineItem = lineItems.find(li => li.id === id);\n\n if (topLevelLineItem) {\n // find term-related line items (which are only top level)\n // expired term line items won't be deleted\n let foundTermLineItem: LineItem | undefined = topLevelLineItem;\n\n while (foundTermLineItem) {\n foundTermLineItem = lineItems.find(li => foundTermLineItem && li.rampInstanceId === foundTermLineItem.id);\n if (foundTermLineItem) {\n idsToRemove.push(foundTermLineItem.id);\n }\n }\n }\n\n const filtered = lineItems.filter(lineItem => !idsToRemove.includes(lineItem.id));\n return filtered.map(lineItem => new LineItemWorker(lineItem).remove(id).li);\n }\n\n private applyLineItemUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n if (lineItem.id !== update.id) {\n return false;\n }\n\n switch (update.attributeType) {\n case 'QTY':\n lineItem.qty = update.newValue;\n break;\n case 'EFFECTIVE_START_DATE':\n lineItem.properties.StartDate = moment(update.newValue).format('YYYY-MM-DD');\n break;\n case 'END_DATE':\n lineItem.properties.EndDate = moment(update.newValue).format('YYYY-MM-DD');\n break;\n case 'PRICE_ADJUSTMENT':\n {\n const [charge] = lineItem.chargeItems;\n if (charge) {\n charge.priceAdjustment = update.newValue;\n }\n }\n break;\n case 'LIST_PRICE_ADJUSTMENT':\n {\n const [charge] = lineItem.chargeItems;\n if (charge) {\n charge.listPriceAdjustment = update.newValue;\n }\n }\n break;\n default:\n throw new Error(`Not suppored AttributeType for LineItem update: ${update.attributeType}`);\n }\n\n return true;\n }\n\n private applyChargeUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n const foundCharge = lineItem.chargeItems.find(({ id }) => id === update.id);\n if (!foundCharge) {\n return false;\n }\n\n if (update.attributeType === 'PRICE_ADJUSTMENT') {\n foundCharge.priceAdjustment = update.newValue;\n } else if (update.attributeType === 'LIST_PRICE_ADJUSTMENT') {\n foundCharge.listPriceAdjustment = update.newValue;\n } else {\n throw new Error(`Not suppored AttributeType for Charge Item update: ${update.attributeType}`);\n }\n\n return true;\n }\n\n private applyChargeGroupUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n const foundChargeGroup = ChargeGroupUtils.findChargeGroupById(update.id, lineItem);\n if (!foundChargeGroup) {\n return false;\n }\n\n if (update.attributeType === 'PRICE_ADJUSTMENT') {\n foundChargeGroup.priceAdjustment = update.newValue;\n } else if (update.attributeType === 'LIST_PRICE_ADJUSTMENT') {\n foundChargeGroup.listPriceAdjustment = update.newValue;\n } else {\n throw new Error(`Not suppored AttributeType for Charge Group Item update: ${update.attributeType}`);\n }\n\n return true;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ProceduresApiService } from '@veloce/api';\nimport { Charge, CompiledPricePlan, ConfigurationContext, LineItem, QuoteDraft } from '@veloce/core';\nimport { cloneDeep, Dictionary } from 'lodash';\nimport { catchError, map, noop, Observable, of, shareReplay, switchMap, tap, throwError } from 'rxjs';\nimport { ContextService, QuoteDraftService } from '../../../services';\nimport { ConfigurationService } from '../../configuration';\nimport { FlowUpdateParams } from '../types/update.types';\nimport { FlowUpdateService } from './flow-update.service';\n\n@Injectable()\nexport class FlowConfigurationService {\n constructor(\n private proceduresApiService: ProceduresApiService,\n private contextService: ContextService,\n private quoteDraftService: QuoteDraftService,\n private updateService: FlowUpdateService,\n private configurationService: ConfigurationService,\n ) {}\n\n public calculate$(quoteDraft: QuoteDraft): Observable<void> {\n return this.proceduresApiService.apply$(quoteDraft).pipe(\n tap(result => {\n // sort the result current state based on the quote draft initial state\n const initialStateIds = quoteDraft.initialState.map(lineItem => lineItem.integrationId);\n result.currentState = result.currentState\n .slice()\n .sort((a, b) => initialStateIds.indexOf(a.integrationId) - initialStateIds.indexOf(b.integrationId));\n this.quoteDraftService.updateQuoteDraft(result);\n }),\n map(noop),\n );\n }\n\n public calculate(quoteDraft: QuoteDraft): void {\n this.calculate$(quoteDraft).subscribe();\n }\n\n public update$(updates: FlowUpdateParams[]): Observable<QuoteDraft | null> {\n const quoteDraft = this.quoteDraftService.quoteDraft;\n\n if (!quoteDraft) {\n return of(null);\n }\n\n return of([]).pipe(\n map(() => {\n const updatedState = cloneDeep(quoteDraft.currentState);\n this.updateService.update(updatedState, updates);\n return updatedState;\n }),\n switchMap(updatedState => this.calculate$({ ...quoteDraft, currentState: updatedState })),\n map(() => this.quoteDraftService.quoteDraft),\n this.handleErrorAndBounceBack(),\n );\n }\n\n public update(updates: FlowUpdateParams[]): void {\n this.update$(updates).subscribe();\n }\n\n public revert$(lineItemId: string): Observable<QuoteDraft | null> {\n const quoteDraft = this.quoteDraftService.quoteDraft;\n const initialCurrentState = this.quoteDraftService.getInitialCurrentState();\n const currentState = this.quoteDraftService.activeCurrentState;\n\n const currentLineItemIndex = currentState.findIndex(({ id }) => id === lineItemId);\n const currentLineItem = currentState[currentLineItemIndex];\n\n const initialLineItem = initialCurrentState.find(\n ({ integrationId }) => integrationId === currentLineItem?.integrationId,\n );\n\n if (!quoteDraft || !currentLineItem || !initialLineItem) {\n return of(null);\n }\n\n const updatedState = cloneDeep(currentState);\n updatedState.splice(currentLineItemIndex, 1, initialLineItem);\n\n return of([]).pipe(\n tap(() => {\n this.quoteDraftService.setCurrentLineItemState(updatedState);\n }),\n switchMap(() => this.calculate$({ ...quoteDraft, currentState: updatedState })),\n map(() => this.quoteDraftService.quoteDraft),\n this.handleErrorAndBounceBack(),\n );\n }\n\n public revert(lineItemId: string): void {\n this.revert$(lineItemId).subscribe();\n }\n\n public delete$(ids: string[]): Observable<QuoteDraft | null> {\n const quoteDraft = this.quoteDraftService.quoteDraft;\n const currentState = this.quoteDraftService.currentState;\n\n if (!quoteDraft) {\n return of(null);\n }\n\n return of([]).pipe(\n map(() => ids.reduce((result, id) => this.updateService.delete(result, id), currentState)),\n switchMap(updatedState => this.calculate$({ ...quoteDraft, currentState: updatedState })),\n map(() => this.quoteDraftService.quoteDraft),\n this.handleErrorAndBounceBack(),\n );\n }\n\n public delete(ids: string[]): void {\n this.delete$(ids).subscribe();\n }\n\n public addTerm$(term: LineItem): Observable<QuoteDraft | null> {\n const quoteDraft = this.quoteDraftService.quoteDraft;\n\n if (!quoteDraft) {\n return of(null);\n }\n\n const updatedState = [...quoteDraft.currentState, term];\n\n return of([]).pipe(\n switchMap(() => this.calculate$({ ...quoteDraft, currentState: updatedState })),\n map(() => this.quoteDraftService.quoteDraft),\n this.handleErrorAndBounceBack(),\n );\n }\n\n public addToCart$(productId: string, qty?: number): Observable<QuoteDraft | null> {\n const quoteDraft = this.quoteDraftService.quoteDraft;\n\n if (!quoteDraft) {\n return of(null);\n }\n\n return this.configurationService.configureExternal$(productId, qty).pipe(\n map(lineItem => [...quoteDraft.currentState, lineItem]),\n switchMap(updatedState => this.calculate$({ ...quoteDraft, currentState: updatedState })),\n map(() => this.quoteDraftService.quoteDraft),\n this.handleErrorAndBounceBack(),\n );\n }\n\n public get(): Observable<LineItem[]> {\n return this.quoteDraftService.quoteDraft$.pipe(\n map(() => this.quoteDraftService.activeCurrentState),\n shareReplay(),\n );\n }\n\n public getSnapshot(): LineItem[] {\n return this.quoteDraftService?.currentState.slice() ?? [];\n }\n\n public get charges$(): Observable<Dictionary<Charge>> {\n return this.quoteDraftService.quoteDraft$.pipe(map(({ charges }) => charges));\n }\n\n public get pricePlans$(): Observable<Dictionary<CompiledPricePlan>> {\n return this.quoteDraftService.quoteDraft$.pipe(map(({ pricePlans }) => pricePlans));\n }\n\n public get chargesSnapshot(): Dictionary<Charge> {\n return this.quoteDraftService.quoteDraft?.charges ?? {};\n }\n\n public get pricePlansSnapshot(): Dictionary<CompiledPricePlan> {\n return this.quoteDraftService.quoteDraft?.pricePlans ?? {};\n }\n\n public get contextSnapshot(): ConfigurationContext {\n return this.contextService.resolve();\n }\n\n public get context$(): Observable<ConfigurationContext> {\n return this.contextService.resolve$();\n }\n\n private handleErrorAndBounceBack() {\n return <T>(source$: Observable<T>): Observable<T> => {\n return source$.pipe(\n catchError(error => {\n console.error(error);\n\n // bounce back if configuration call has failed\n const quoteDraft = this.quoteDraftService.quoteDraft;\n if (quoteDraft) {\n this.quoteDraftService.updateQuoteDraft(quoteDraft);\n }\n\n return throwError(() => error);\n }),\n );\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PriceApiService } from '@veloce/api';\nimport { FlowConfigurationService } from './services/flow-configuration.service';\nimport { FlowUpdateService } from './services/flow-update.service';\n\n@NgModule({\n imports: [],\n providers: [FlowConfigurationService, FlowUpdateService, PriceApiService],\n})\nexport class FlowConfigurationModule {}\n","import { NgModule } from '@angular/core';\nimport { ConfigurationApiService, ContextApiService, ProductModelApiService } from '@veloce/api';\nimport { ConfirmationDialogModule } from '@veloce/components';\nimport { ConfigurationRuntimeService } from './services/configuration-runtime.service';\nimport { ConfigurationService } from './services/configuration.service';\nimport { RuntimeContextService } from './services/runtime-context.service';\n\n@NgModule({\n imports: [ConfirmationDialogModule],\n providers: [\n ContextApiService,\n ProductModelApiService,\n ConfigurationApiService,\n ConfigurationRuntimeService,\n RuntimeContextService,\n ConfigurationService,\n ],\n})\nexport class ConfigurationModule {}\n","import { NgModule } from '@angular/core';\nimport { FlowConfigurationModule } from './modules';\nimport { ConfigurationModule } from './modules/configuration/configuration.module';\nimport { ContextService, ProductImagesService, QuoteDraftService } from './services';\n\n@NgModule({\n imports: [ConfigurationModule, FlowConfigurationModule],\n providers: [ContextService, QuoteDraftService, ProductImagesService],\n})\nexport class SdkCoreModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["map","tap","catchError","shareReplay","switchMap"],"mappings":";;;;;;;;;;;;;MAGa,kBAAkB,GAAG,CAChC,OAAuB,EACvB,sBAAyC,EACzC,GAAG,GAAG,CAAC;;IAEP,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAEvB,MAAM,QAAQ,GAAa,gBACzB,EAAE,EACF,IAAI,EAAE,MAAA,sBAAsB,CAAC,QAAQ,mCAAI,EAAE,EAC3C,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,KAAK,EACjB,GAAG,EACH,WAAW,EAAE,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,WAAW,KAAI,OAAO,CAAC,WAAW,EACnE,SAAS,EAAE,MAAA,OAAO,CAAC,SAAS,mCAAI,EAAE,KAC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Inject, EventEmitter, TemplateRef, ChangeDetectionStrategy, Output, Directive, HostBinding, NgModule, ViewChildren, ViewEncapsulation } from '@angular/core';
3
3
  import * as i4 from '@angular/forms';
4
4
  import { FormGroup, FormControl, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
- import * as i7 from '@veloceapps/core';
6
- import { EntityUtil, UUID, SectionPathUtil, TypeValidators, ConfigurationMode, RuntimeModel, OrderByPipe, PricingUtils, PagedEntity, CoreModule, SalesforceIdUtils, SearchFilterPipe, ConfigurationContextMode } from '@veloceapps/core';
7
- import * as i2 from '@veloceapps/sdk/core';
8
- import { RuntimeMode, RuntimeStep, SdkCoreModule } from '@veloceapps/sdk/core';
5
+ import * as i7 from '@veloce/core';
6
+ import { EntityUtil, UUID, SectionPathUtil, TypeValidators, ConfigurationMode, RuntimeModel, OrderByPipe, PricingUtils, PagedEntity, CoreModule, SalesforceIdUtils, SearchFilterPipe, ConfigurationContextMode } from '@veloce/core';
7
+ import * as i2 from '@veloce/sdk/core';
8
+ import { RuntimeMode, RuntimeStep, SdkCoreModule } from '@veloce/sdk/core';
9
9
  import * as rxjs from 'rxjs';
10
10
  import { Subject, BehaviorSubject, of, merge, combineLatest } from 'rxjs';
11
11
  import * as _ from 'lodash';
12
12
  import { keys, isUndefined, isNull, isString, isDate, set, values } from 'lodash';
13
13
  import * as rxjsOperators from 'rxjs/operators';
14
14
  import { map, take, tap, shareReplay, takeUntil } from 'rxjs/operators';
15
- import * as i8 from '@veloceapps/components';
16
- import { ConfirmationComponent, LoaderModule } from '@veloceapps/components';
17
- import * as i1 from '@veloceapps/api';
18
- import { ApiModule } from '@veloceapps/api';
15
+ import * as i8 from '@veloce/components';
16
+ import { ConfirmationComponent, LoaderModule } from '@veloce/components';
17
+ import * as i1 from '@veloce/api';
18
+ import { ApiModule } from '@veloce/api';
19
19
  import * as i3 from 'primeng/dynamicdialog';
20
20
  import { DialogService } from 'primeng/dynamicdialog';
21
21
  import * as i3$1 from 'primeng/api';
@@ -26,7 +26,7 @@ import { ScrollingModule } from '@angular/cdk/scrolling';
26
26
  import * as i5 from '@angular/common';
27
27
  import { CurrencyPipe, DOCUMENT, CommonModule, DatePipe } from '@angular/common';
28
28
  import '@angular/compiler';
29
- import { VeloceElementsModule } from '@veloceapps/elements';
29
+ import { VeloceElementsModule } from '@veloce/elements';
30
30
  import * as i5$1 from 'ngx-bootstrap/popover';
31
31
  import { PopoverModule } from 'ngx-bootstrap/popover';
32
32
  import { TemplatePortal } from '@angular/cdk/portal';
@@ -3893,4 +3893,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
3893
3893
  */
3894
3894
 
3895
3895
  export { ComponentPreviewComponent, CurrentStateService, RuntimeComponent, RuntimeContextService, RuntimeModule, RuntimePreviewComponent, RuntimeService, SectionRendererComponent };
3896
- //# sourceMappingURL=veloceapps-sdk-runtime.js.map
3896
+ //# sourceMappingURL=veloce-sdk-runtime.js.map