@veloceapps/sdk 0.0.0-watch

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 (351) hide show
  1. package/README.md +7 -0
  2. package/cms/cms.actions.d.ts +12 -0
  3. package/cms/cms.default.d.ts +5 -0
  4. package/cms/cms.elements.d.ts +4 -0
  5. package/cms/components/element-children/element-children.component.d.ts +10 -0
  6. package/cms/components/element-children/element-children.module.d.ts +8 -0
  7. package/cms/components/element-renderer/element-renderer.component.d.ts +35 -0
  8. package/cms/components/element-renderer/element-renderer.module.d.ts +7 -0
  9. package/cms/components/element.component.d.ts +13 -0
  10. package/cms/components/index.d.ts +1 -0
  11. package/cms/components/plugin.component.d.ts +15 -0
  12. package/cms/components/preview/index.d.ts +2 -0
  13. package/cms/components/preview/preview.component.d.ts +34 -0
  14. package/cms/components/preview/preview.module.d.ts +11 -0
  15. package/cms/decorators/element.decorator.d.ts +2 -0
  16. package/cms/decorators/index.d.ts +1 -0
  17. package/cms/directives/custom-template.directive.d.ts +12 -0
  18. package/cms/engine/models/entity.d.ts +11 -0
  19. package/cms/engine/models/plugin.d.ts +5 -0
  20. package/cms/index.d.ts +11 -0
  21. package/cms/injection-tokens.d.ts +11 -0
  22. package/cms/launcher.module.d.ts +10 -0
  23. package/cms/modules/federated/default-options.d.ts +4 -0
  24. package/cms/modules/federated/export.d.ts +1 -0
  25. package/cms/modules/federated/federated.component.d.ts +26 -0
  26. package/cms/modules/federated/federated.module.d.ts +9 -0
  27. package/cms/modules/federated/federated.types.d.ts +30 -0
  28. package/cms/modules/federated/federated.utils.d.ts +1 -0
  29. package/cms/package.json +10 -0
  30. package/cms/plugins/configuration.plugin.d.ts +23 -0
  31. package/cms/plugins/io.plugin.d.ts +9 -0
  32. package/cms/plugins/script.plugin.d.ts +13 -0
  33. package/cms/services/dynamic-module.service.d.ts +15 -0
  34. package/cms/services/element-context.service.d.ts +8 -0
  35. package/cms/services/index.d.ts +3 -0
  36. package/cms/services/integration.state.d.ts +17 -0
  37. package/cms/services/io-provider.service.d.ts +15 -0
  38. package/cms/services/launcher.service.d.ts +18 -0
  39. package/cms/services/templates.service.d.ts +9 -0
  40. package/cms/types/common.types.d.ts +103 -0
  41. package/cms/types/configuration.types.d.ts +17 -0
  42. package/cms/types/elements.types.d.ts +2 -0
  43. package/cms/types/index.d.ts +5 -0
  44. package/cms/types/integration.types.d.ts +4 -0
  45. package/cms/types/path.types.d.ts +11 -0
  46. package/cms/utils/element.utils.d.ts +15 -0
  47. package/cms/utils/elements-resolver.d.ts +20 -0
  48. package/cms/utils/index.d.ts +3 -0
  49. package/cms/utils/path.utils.d.ts +5 -0
  50. package/cms/veloce-sdk-cms.d.ts +5 -0
  51. package/cms/vendor-map.d.ts +689 -0
  52. package/core/core.module.d.ts +8 -0
  53. package/core/index.d.ts +6 -0
  54. package/core/modules/configuration/configuration.module.d.ts +7 -0
  55. package/core/modules/configuration/helpers.d.ts +3 -0
  56. package/core/modules/configuration/index.d.ts +4 -0
  57. package/core/modules/configuration/services/configuration-runtime.service.d.ts +28 -0
  58. package/core/modules/configuration/services/configuration.service.d.ts +40 -0
  59. package/core/modules/configuration/services/runtime-context.service.d.ts +14 -0
  60. package/core/modules/configuration/types/configuration-runtime.types.d.ts +6 -0
  61. package/core/modules/flow-configuration/flow-configuration.module.d.ts +6 -0
  62. package/core/modules/flow-configuration/index.d.ts +4 -0
  63. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +37 -0
  64. package/core/modules/flow-configuration/services/flow-update.service.d.ts +12 -0
  65. package/core/modules/flow-configuration/types/update.types.d.ts +12 -0
  66. package/core/modules/index.d.ts +2 -0
  67. package/core/package.json +10 -0
  68. package/core/services/context.service.d.ts +17 -0
  69. package/core/services/index.d.ts +3 -0
  70. package/core/services/product-images.service.d.ts +12 -0
  71. package/core/services/quote-draft.service.d.ts +31 -0
  72. package/core/types/index.d.ts +3 -0
  73. package/core/types/quote-states.types.d.ts +6 -0
  74. package/core/types/runtime.types.d.ts +31 -0
  75. package/core/types/ui-definition.types.d.ts +26 -0
  76. package/core/utils/index.d.ts +2 -0
  77. package/core/utils/line-item.utils.d.ts +26 -0
  78. package/core/utils/line-item.worker.d.ts +12 -0
  79. package/core/veloce-sdk-core.d.ts +5 -0
  80. package/esm2015/cms/cms.actions.js +17 -0
  81. package/esm2015/cms/cms.default.js +6 -0
  82. package/esm2015/cms/cms.elements.js +29 -0
  83. package/esm2015/cms/components/element-children/element-children.component.js +23 -0
  84. package/esm2015/cms/components/element-children/element-children.module.js +18 -0
  85. package/esm2015/cms/components/element-renderer/element-renderer.component.js +143 -0
  86. package/esm2015/cms/components/element-renderer/element-renderer.module.js +16 -0
  87. package/esm2015/cms/components/element.component.js +31 -0
  88. package/esm2015/cms/components/index.js +2 -0
  89. package/esm2015/cms/components/plugin.component.js +16 -0
  90. package/esm2015/cms/components/preview/index.js +3 -0
  91. package/esm2015/cms/components/preview/preview.component.js +105 -0
  92. package/esm2015/cms/components/preview/preview.module.js +23 -0
  93. package/esm2015/cms/decorators/element.decorator.js +6 -0
  94. package/esm2015/cms/decorators/index.js +2 -0
  95. package/esm2015/cms/directives/custom-template.directive.js +25 -0
  96. package/esm2015/cms/engine/models/entity.js +18 -0
  97. package/esm2015/cms/engine/models/plugin.js +6 -0
  98. package/esm2015/cms/index.js +11 -0
  99. package/esm2015/cms/injection-tokens.js +8 -0
  100. package/esm2015/cms/launcher.module.js +23 -0
  101. package/esm2015/cms/modules/federated/default-options.js +5 -0
  102. package/esm2015/cms/modules/federated/export.js +2 -0
  103. package/esm2015/cms/modules/federated/federated.component.js +82 -0
  104. package/esm2015/cms/modules/federated/federated.module.js +19 -0
  105. package/esm2015/cms/modules/federated/federated.types.js +2 -0
  106. package/esm2015/cms/modules/federated/federated.utils.js +37 -0
  107. package/esm2015/cms/plugins/configuration.plugin.js +94 -0
  108. package/esm2015/cms/plugins/io.plugin.js +37 -0
  109. package/esm2015/cms/plugins/script.plugin.js +66 -0
  110. package/esm2015/cms/services/dynamic-module.service.js +33 -0
  111. package/esm2015/cms/services/element-context.service.js +10 -0
  112. package/esm2015/cms/services/index.js +4 -0
  113. package/esm2015/cms/services/integration.state.js +40 -0
  114. package/esm2015/cms/services/io-provider.service.js +51 -0
  115. package/esm2015/cms/services/launcher.service.js +57 -0
  116. package/esm2015/cms/services/templates.service.js +19 -0
  117. package/esm2015/cms/types/common.types.js +2 -0
  118. package/esm2015/cms/types/configuration.types.js +2 -0
  119. package/esm2015/cms/types/elements.types.js +2 -0
  120. package/esm2015/cms/types/index.js +6 -0
  121. package/esm2015/cms/types/integration.types.js +2 -0
  122. package/esm2015/cms/types/path.types.js +2 -0
  123. package/esm2015/cms/utils/element.utils.js +149 -0
  124. package/esm2015/cms/utils/elements-resolver.js +108 -0
  125. package/esm2015/cms/utils/index.js +4 -0
  126. package/esm2015/cms/utils/path.utils.js +67 -0
  127. package/esm2015/cms/veloce-sdk-cms.js +5 -0
  128. package/esm2015/cms/vendor-map.js +35 -0
  129. package/esm2015/core/core.module.js +18 -0
  130. package/esm2015/core/index.js +7 -0
  131. package/esm2015/core/modules/configuration/configuration.module.js +34 -0
  132. package/esm2015/core/modules/configuration/helpers.js +10 -0
  133. package/esm2015/core/modules/configuration/index.js +5 -0
  134. package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +90 -0
  135. package/esm2015/core/modules/configuration/services/configuration.service.js +153 -0
  136. package/esm2015/core/modules/configuration/services/runtime-context.service.js +61 -0
  137. package/esm2015/core/modules/configuration/types/configuration-runtime.types.js +2 -0
  138. package/esm2015/core/modules/flow-configuration/flow-configuration.module.js +18 -0
  139. package/esm2015/core/modules/flow-configuration/index.js +5 -0
  140. package/esm2015/core/modules/flow-configuration/services/flow-configuration.service.js +90 -0
  141. package/esm2015/core/modules/flow-configuration/services/flow-update.service.js +114 -0
  142. package/esm2015/core/modules/flow-configuration/types/update.types.js +2 -0
  143. package/esm2015/core/modules/index.js +3 -0
  144. package/esm2015/core/services/context.service.js +44 -0
  145. package/esm2015/core/services/index.js +4 -0
  146. package/esm2015/core/services/product-images.service.js +30 -0
  147. package/esm2015/core/services/quote-draft.service.js +88 -0
  148. package/esm2015/core/types/index.js +4 -0
  149. package/esm2015/core/types/quote-states.types.js +2 -0
  150. package/esm2015/core/types/runtime.types.js +16 -0
  151. package/esm2015/core/types/ui-definition.types.js +2 -0
  152. package/esm2015/core/utils/index.js +3 -0
  153. package/esm2015/core/utils/line-item.utils.js +98 -0
  154. package/esm2015/core/utils/line-item.worker.js +19 -0
  155. package/esm2015/core/veloce-sdk-core.js +5 -0
  156. package/esm2015/index.js +2 -0
  157. package/esm2015/runtime/components/component-preview/component-preview.component.js +125 -0
  158. package/esm2015/runtime/components/index.js +5 -0
  159. package/esm2015/runtime/components/section-renderer/section-renderer.component.js +71 -0
  160. package/esm2015/runtime/components/ui-runtime/runtime.component.js +427 -0
  161. package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +109 -0
  162. package/esm2015/runtime/execution/components/children-placeholder/children-placeholder.component.js +68 -0
  163. package/esm2015/runtime/execution/components/context-provider/context-provider.component.js +36 -0
  164. package/esm2015/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.js +72 -0
  165. package/esm2015/runtime/execution/components/federated/federated.component.js +81 -0
  166. package/esm2015/runtime/execution/components/velo-attribute/velo-attribute.component.js +65 -0
  167. package/esm2015/runtime/execution/components/velo-multiselect/velo-multiselect.component.js +136 -0
  168. package/esm2015/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.js +80 -0
  169. package/esm2015/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.js +101 -0
  170. package/esm2015/runtime/execution/components/velo-port-radio/velo-port-radio.component.js +150 -0
  171. package/esm2015/runtime/execution/components/velo-type/velo-type.component.js +121 -0
  172. package/esm2015/runtime/execution/directives/section-script.directive.js +242 -0
  173. package/esm2015/runtime/execution/directives/sf-query.directive.js +34 -0
  174. package/esm2015/runtime/execution/directives/velo-attribute.directive.js +86 -0
  175. package/esm2015/runtime/execution/directives/velo-port.directive.js +373 -0
  176. package/esm2015/runtime/execution/directives/vl-approval.directive.js +22 -0
  177. package/esm2015/runtime/execution/directives/vl-document-attachments.directive.js +35 -0
  178. package/esm2015/runtime/execution/directives/vl-document-templates.directive.js +59 -0
  179. package/esm2015/runtime/execution/directives/vl-quote.directive.js +41 -0
  180. package/esm2015/runtime/execution/directives/vl-ramp.directive.js +51 -0
  181. package/esm2015/runtime/execution/runtime-execution.module.js +163 -0
  182. package/esm2015/runtime/execution/utils/federated.util.js +37 -0
  183. package/esm2015/runtime/index.js +5 -0
  184. package/esm2015/runtime/runtime.module.js +104 -0
  185. package/esm2015/runtime/services/cart.service.js +28 -0
  186. package/esm2015/runtime/services/collapsible-state.service.js +34 -0
  187. package/esm2015/runtime/services/configuration.service.js +102 -0
  188. package/esm2015/runtime/services/current-state.service.js +17 -0
  189. package/esm2015/runtime/services/form-scope.service.js +30 -0
  190. package/esm2015/runtime/services/index.js +4 -0
  191. package/esm2015/runtime/services/product-model-cache.service.js +30 -0
  192. package/esm2015/runtime/services/runtime-context.service.js +56 -0
  193. package/esm2015/runtime/services/runtime-form.service.js +224 -0
  194. package/esm2015/runtime/services/runtime.service.js +108 -0
  195. package/esm2015/runtime/services/section-helper.service.js +27 -0
  196. package/esm2015/runtime/services/section-scope.service.js +36 -0
  197. package/esm2015/runtime/services/section-store.service.js +22 -0
  198. package/esm2015/runtime/services/section.service.js +124 -0
  199. package/esm2015/runtime/types/bound-data.types.js +7 -0
  200. package/esm2015/runtime/types/index.js +2 -0
  201. package/esm2015/runtime/types/runtime.types.js +2 -0
  202. package/esm2015/runtime/types/script-registry.types.js +51 -0
  203. package/esm2015/runtime/utils/line-item.util.js +273 -0
  204. package/esm2015/runtime/utils/section.utils.js +26 -0
  205. package/esm2015/runtime/utils/sections-binder.helper.js +105 -0
  206. package/esm2015/runtime/veloce-sdk-runtime.js +5 -0
  207. package/esm2015/src/components/dialog/dialog.component.js +30 -0
  208. package/esm2015/src/components/dialog/dialog.module.js +19 -0
  209. package/esm2015/src/components/dialog/dialog.types.js +2 -0
  210. package/esm2015/src/components/header/cart-overlay/cart-preview.component.js +116 -0
  211. package/esm2015/src/components/header/cart-overlay/cart-preview.module.js +23 -0
  212. package/esm2015/src/components/header/header.component.js +196 -0
  213. package/esm2015/src/components/header/header.module.js +23 -0
  214. package/esm2015/src/components/header/header.types.js +2 -0
  215. package/esm2015/src/constants.js +2 -0
  216. package/esm2015/src/flow-routing.module.js +97 -0
  217. package/esm2015/src/flow.component.js +35 -0
  218. package/esm2015/src/flow.module.js +52 -0
  219. package/esm2015/src/guards/context.guard.js +75 -0
  220. package/esm2015/src/guards/index.js +2 -0
  221. package/esm2015/src/guards/product-unload.guard.js +43 -0
  222. package/esm2015/src/guards/root.guard.js +41 -0
  223. package/esm2015/src/index.js +7 -0
  224. package/esm2015/src/pages/catalog/catalog.component.js +117 -0
  225. package/esm2015/src/pages/catalog/catalog.module.js +20 -0
  226. package/esm2015/src/pages/debug/debug.component.js +65 -0
  227. package/esm2015/src/pages/debug/debug.module.js +48 -0
  228. package/esm2015/src/pages/legacy-product/legacy-product.component.js +132 -0
  229. package/esm2015/src/pages/legacy-product/legacy-product.module.js +21 -0
  230. package/esm2015/src/pages/product/product.component.js +95 -0
  231. package/esm2015/src/pages/product/product.module.js +20 -0
  232. package/esm2015/src/pages/record-not-found/record-not-found.component.js +29 -0
  233. package/esm2015/src/pages/record-not-found/record-not-found.module.js +20 -0
  234. package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +117 -0
  235. package/esm2015/src/pages/shopping-cart/shopping-cart.module.js +20 -0
  236. package/esm2015/src/resolvers/flow.resolver.js +58 -0
  237. package/esm2015/src/resolvers/quote.resolver.js +45 -0
  238. package/esm2015/src/services/flow-dialog.service.js +80 -0
  239. package/esm2015/src/services/flow-router.service.js +124 -0
  240. package/esm2015/src/services/flow.service.js +67 -0
  241. package/esm2015/src/services/index.js +2 -0
  242. package/esm2015/src/types/context-route.types.js +2 -0
  243. package/esm2015/src/types/flow-customization.types.js +3 -0
  244. package/esm2015/src/types/index.js +3 -0
  245. package/esm2015/src/types/route.types.js +2 -0
  246. package/esm2015/src/utils/flow.utils.js +12 -0
  247. package/esm2015/src/utils/index.js +2 -0
  248. package/esm2015/veloce-sdk.js +5 -0
  249. package/fesm2015/veloce-sdk-cms.js +1301 -0
  250. package/fesm2015/veloce-sdk-cms.js.map +1 -0
  251. package/fesm2015/veloce-sdk-core.js +837 -0
  252. package/fesm2015/veloce-sdk-core.js.map +1 -0
  253. package/fesm2015/veloce-sdk-runtime.js +3895 -0
  254. package/fesm2015/veloce-sdk-runtime.js.map +1 -0
  255. package/fesm2015/veloce-sdk.js +1635 -0
  256. package/fesm2015/veloce-sdk.js.map +1 -0
  257. package/index.d.ts +1 -0
  258. package/package.json +49 -0
  259. package/runtime/components/component-preview/component-preview.component.d.ts +27 -0
  260. package/runtime/components/index.d.ts +4 -0
  261. package/runtime/components/section-renderer/section-renderer.component.d.ts +25 -0
  262. package/runtime/components/ui-runtime/runtime.component.d.ts +53 -0
  263. package/runtime/components/ui-runtime-preview/runtime-preview.component.d.ts +27 -0
  264. package/runtime/execution/components/children-placeholder/children-placeholder.component.d.ts +30 -0
  265. package/runtime/execution/components/context-provider/context-provider.component.d.ts +14 -0
  266. package/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.d.ts +25 -0
  267. package/runtime/execution/components/federated/federated.component.d.ts +36 -0
  268. package/runtime/execution/components/velo-attribute/velo-attribute.component.d.ts +19 -0
  269. package/runtime/execution/components/velo-multiselect/velo-multiselect.component.d.ts +35 -0
  270. package/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.d.ts +22 -0
  271. package/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.d.ts +22 -0
  272. package/runtime/execution/components/velo-port-radio/velo-port-radio.component.d.ts +28 -0
  273. package/runtime/execution/components/velo-type/velo-type.component.d.ts +31 -0
  274. package/runtime/execution/directives/section-script.directive.d.ts +59 -0
  275. package/runtime/execution/directives/sf-query.directive.d.ts +15 -0
  276. package/runtime/execution/directives/velo-attribute.directive.d.ts +26 -0
  277. package/runtime/execution/directives/velo-port.directive.d.ts +74 -0
  278. package/runtime/execution/directives/vl-approval.directive.d.ts +10 -0
  279. package/runtime/execution/directives/vl-document-attachments.directive.d.ts +15 -0
  280. package/runtime/execution/directives/vl-document-templates.directive.d.ts +33 -0
  281. package/runtime/execution/directives/vl-quote.directive.d.ts +14 -0
  282. package/runtime/execution/directives/vl-ramp.directive.d.ts +15 -0
  283. package/runtime/execution/runtime-execution.module.d.ts +27 -0
  284. package/runtime/execution/utils/federated.util.d.ts +6 -0
  285. package/runtime/index.d.ts +4 -0
  286. package/runtime/package.json +10 -0
  287. package/runtime/runtime.module.d.ts +18 -0
  288. package/runtime/services/cart.service.d.ts +15 -0
  289. package/runtime/services/collapsible-state.service.d.ts +15 -0
  290. package/runtime/services/configuration.service.d.ts +19 -0
  291. package/runtime/services/current-state.service.d.ts +8 -0
  292. package/runtime/services/form-scope.service.d.ts +20 -0
  293. package/runtime/services/index.d.ts +3 -0
  294. package/runtime/services/product-model-cache.service.d.ts +14 -0
  295. package/runtime/services/runtime-context.service.d.ts +16 -0
  296. package/runtime/services/runtime-form.service.d.ts +24 -0
  297. package/runtime/services/runtime.service.d.ts +43 -0
  298. package/runtime/services/section-helper.service.d.ts +8 -0
  299. package/runtime/services/section-scope.service.d.ts +14 -0
  300. package/runtime/services/section-store.service.d.ts +11 -0
  301. package/runtime/services/section.service.d.ts +30 -0
  302. package/runtime/types/bound-data.types.d.ts +13 -0
  303. package/runtime/types/index.d.ts +1 -0
  304. package/runtime/types/runtime.types.d.ts +19 -0
  305. package/runtime/types/script-registry.types.d.ts +13 -0
  306. package/runtime/utils/line-item.util.d.ts +34 -0
  307. package/runtime/utils/section.utils.d.ts +2 -0
  308. package/runtime/utils/sections-binder.helper.d.ts +16 -0
  309. package/runtime/veloce-sdk-runtime.d.ts +5 -0
  310. package/src/components/dialog/dialog.component.d.ts +13 -0
  311. package/src/components/dialog/dialog.module.d.ts +9 -0
  312. package/src/components/dialog/dialog.types.d.ts +6 -0
  313. package/src/components/header/cart-overlay/cart-preview.component.d.ts +31 -0
  314. package/src/components/header/cart-overlay/cart-preview.module.d.ts +13 -0
  315. package/src/components/header/header.component.d.ts +48 -0
  316. package/src/components/header/header.module.d.ts +13 -0
  317. package/src/components/header/header.types.d.ts +19 -0
  318. package/src/constants.d.ts +1 -0
  319. package/src/flow-routing.module.d.ts +11 -0
  320. package/src/flow.component.d.ts +17 -0
  321. package/src/flow.module.d.ts +15 -0
  322. package/src/guards/context.guard.d.ts +18 -0
  323. package/src/guards/index.d.ts +1 -0
  324. package/src/guards/product-unload.guard.d.ts +16 -0
  325. package/src/guards/root.guard.d.ts +15 -0
  326. package/src/index.d.ts +6 -0
  327. package/src/pages/catalog/catalog.component.d.ts +32 -0
  328. package/src/pages/catalog/catalog.module.d.ts +10 -0
  329. package/src/pages/debug/debug.component.d.ts +27 -0
  330. package/src/pages/debug/debug.module.d.ts +14 -0
  331. package/src/pages/legacy-product/legacy-product.component.d.ts +37 -0
  332. package/src/pages/legacy-product/legacy-product.module.d.ts +10 -0
  333. package/src/pages/product/product.component.d.ts +30 -0
  334. package/src/pages/product/product.module.d.ts +10 -0
  335. package/src/pages/record-not-found/record-not-found.component.d.ts +11 -0
  336. package/src/pages/record-not-found/record-not-found.module.d.ts +9 -0
  337. package/src/pages/shopping-cart/shopping-cart.component.d.ts +32 -0
  338. package/src/pages/shopping-cart/shopping-cart.module.d.ts +10 -0
  339. package/src/resolvers/flow.resolver.d.ts +14 -0
  340. package/src/resolvers/quote.resolver.d.ts +18 -0
  341. package/src/services/flow-dialog.service.d.ts +20 -0
  342. package/src/services/flow-router.service.d.ts +35 -0
  343. package/src/services/flow.service.d.ts +17 -0
  344. package/src/services/index.d.ts +1 -0
  345. package/src/types/context-route.types.d.ts +5 -0
  346. package/src/types/flow-customization.types.d.ts +11 -0
  347. package/src/types/index.d.ts +2 -0
  348. package/src/types/route.types.d.ts +9 -0
  349. package/src/utils/flow.utils.d.ts +1 -0
  350. package/src/utils/index.d.ts +1 -0
  351. package/veloce-sdk.d.ts +5 -0
@@ -0,0 +1,1635 @@
1
+ import * as i9 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Component, ChangeDetectionStrategy, NgModule, Injectable, ViewChild, Input, InjectionToken, Optional, Inject } from '@angular/core';
5
+ import * as i1$2 from '@veloce/api';
6
+ import { ApiModule } from '@veloce/api';
7
+ import * as i3$1 from '@veloce/components';
8
+ import { LetDirectiveModule, ToastType, LoaderModule } from '@veloce/components';
9
+ import * as i4 from '@veloce/sdk/cms';
10
+ import { FlowAction, PreviewModule, LauncherModule } from '@veloce/sdk/cms';
11
+ import * as i2$1 from '@veloce/sdk/core';
12
+ import { RuntimeOperation, SdkCoreModule } from '@veloce/sdk/core';
13
+ import * as i2 from 'primeng/button';
14
+ import { ButtonModule } from 'primeng/button';
15
+ import * as i1 from 'primeng/dynamicdialog';
16
+ import * as i3 from 'primeng/overlaypanel';
17
+ import { OverlayPanel, OverlayPanelModule } from 'primeng/overlaypanel';
18
+ import * as i10 from 'primeng/tooltip';
19
+ import { TooltipModule } from 'primeng/tooltip';
20
+ import * as i7 from '@angular/forms';
21
+ import { FormGroup, FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
22
+ import * as i5 from 'primeng/inputnumber';
23
+ import { InputNumberModule } from 'primeng/inputnumber';
24
+ import { map, filter, shareReplay, startWith, distinctUntilChanged, BehaviorSubject, Subject, combineLatest, takeUntil, tap, finalize, switchMap, of, catchError, from, first as first$1 } from 'rxjs';
25
+ import * as i1$1 from '@angular/router';
26
+ import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
27
+ import * as i2$2 from 'primeng/api';
28
+ import { ConfigurationContextMode, UITemplateComponentType, UITemplateType, EntityUtil } from '@veloce/core';
29
+ import { HttpErrorResponse } from '@angular/common/http';
30
+ import * as i4$1 from 'primeng/dropdown';
31
+ import { DropdownModule } from 'primeng/dropdown';
32
+ import * as i8 from 'primeng/inputtext';
33
+ import { InputTextModule } from 'primeng/inputtext';
34
+ import * as i6 from 'primeng/radiobutton';
35
+ import { RadioButtonModule } from 'primeng/radiobutton';
36
+ import { first, takeUntil as takeUntil$1, take, map as map$1, switchMap as switchMap$1 } from 'rxjs/operators';
37
+ import * as i4$2 from '@veloce/sdk/runtime';
38
+ import { RuntimeModule } from '@veloce/sdk/runtime';
39
+ import * as i1$3 from 'ngx-bootstrap/tooltip';
40
+ import { TooltipModule as TooltipModule$1 } from 'ngx-bootstrap/tooltip';
41
+
42
+ const VELOCE_FLOW_ROOT_ROUTE = 'VELOCE_FLOW_ROOT_ROUTE';
43
+
44
+ class FlowDialogComponent {
45
+ constructor(dialogConfig, ref) {
46
+ this.dialogConfig = dialogConfig;
47
+ this.ref = ref;
48
+ this.config = this.dialogConfig.data.config;
49
+ }
50
+ cancelHandler() {
51
+ this.ref.close();
52
+ }
53
+ confirmHandler() {
54
+ this.ref.close(true);
55
+ }
56
+ }
57
+ FlowDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogComponent, deps: [{ token: i1.DynamicDialogConfig }, { token: i1.DynamicDialogRef }], target: i0.ɵɵFactoryTarget.Component });
58
+ FlowDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: FlowDialogComponent, selector: "vl-flow-dialog", ngImport: i0, template: "<div *ngIf=\"config.description\" class=\"description\">\n {{ config.description }}\n</div>\n\n<div class=\"form-actions\">\n <p-button\n *ngIf=\"config.secondaryButton\"\n styleClass=\"p-button-outlined button-text-bold\"\n [label]=\"config.secondaryButton!\"\n (onClick)=\"cancelHandler()\"\n ></p-button>\n <p-button\n styleClass=\"p-button p-button-filled\"\n [label]=\"config.primaryButton\"\n (onClick)=\"confirmHandler()\"\n ></p-button>\n</div>\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .description{flex:1;padding:0 24px 24px;font-weight:400;font-size:12px;line-height:16px;color:var(--vl-text-color-deep-accent)}:host .form-actions{border-top:1px solid var(--vl-border-color);padding:1.5rem 2.2rem;display:flex;justify-content:flex-end;width:100%;grid-gap:10px;gap:10px}\n"], components: [{ type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogComponent, decorators: [{
60
+ type: Component,
61
+ args: [{
62
+ selector: 'vl-flow-dialog',
63
+ templateUrl: './dialog.component.html',
64
+ styleUrls: ['./dialog.component.scss'],
65
+ changeDetection: ChangeDetectionStrategy.OnPush,
66
+ }]
67
+ }], ctorParameters: function () { return [{ type: i1.DynamicDialogConfig }, { type: i1.DynamicDialogRef }]; } });
68
+
69
+ class FlowDialogModule {
70
+ }
71
+ FlowDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
72
+ FlowDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogModule, declarations: [FlowDialogComponent], imports: [CommonModule, ButtonModule], exports: [FlowDialogComponent] });
73
+ FlowDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogModule, imports: [[CommonModule, ButtonModule]] });
74
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogModule, decorators: [{
75
+ type: NgModule,
76
+ args: [{
77
+ declarations: [FlowDialogComponent],
78
+ imports: [CommonModule, ButtonModule],
79
+ exports: [FlowDialogComponent],
80
+ }]
81
+ }] });
82
+
83
+ class FlowRouterService {
84
+ constructor(router, route, contextService) {
85
+ this.router = router;
86
+ this.route = route;
87
+ this.contextService = contextService;
88
+ this.urlHistory = [];
89
+ this.getLastChildRoute = (route) => {
90
+ return route.firstChild ? this.getLastChildRoute(route.firstChild) : route;
91
+ };
92
+ this.getNthChildRoute = (route, index) => {
93
+ if (index <= 0) {
94
+ return route;
95
+ }
96
+ return route.firstChild ? this.getNthChildRoute(route.firstChild, index - 1) : route;
97
+ };
98
+ this.getLastChildRouteSnapshot = (route) => {
99
+ return route.firstChild ? this.getLastChildRouteSnapshot(route.firstChild) : route;
100
+ };
101
+ this.watchLastChildRoute$ = (route) => {
102
+ return this.routeChange$.pipe(map(() => this.getLastChildRouteSnapshot(route.snapshot)));
103
+ };
104
+ this.getLastChildParams = (route) => {
105
+ return route.firstChild ? this.getLastChildParams(route.firstChild) : route.params;
106
+ };
107
+ this.watchLastChildParams$ = (route) => {
108
+ return this.routeChange$.pipe(map(() => this.getLastChildParams(route.snapshot)));
109
+ };
110
+ this.getFlowSubpath$ = () => {
111
+ return this.route$.pipe(map(route => {
112
+ const url = route.url.join('/');
113
+ const flowRootUrl = this.getFlowRootPath(route);
114
+ return url.replace(flowRootUrl, '');
115
+ }));
116
+ };
117
+ this.routeChange$ = this.router.events.pipe(filter(e => e instanceof NavigationEnd), shareReplay());
118
+ this.lastChildParams$ = this.watchLastChildParams$(this.route).pipe(startWith(this.getLastChildParams(this.route.snapshot)), shareReplay());
119
+ this.lastChildRoute$ = this.watchLastChildRoute$(this.route).pipe(startWith(this.getLastChildRouteSnapshot(this.route.snapshot)), shareReplay());
120
+ this.loading$ = this.router.events.pipe(filter(e => e instanceof NavigationStart ||
121
+ e instanceof NavigationCancel ||
122
+ e instanceof NavigationEnd ||
123
+ e instanceof NavigationError), map(e => e instanceof NavigationStart), startWith(false), distinctUntilChanged());
124
+ this.router.events.pipe(filter(e => e instanceof NavigationEnd)).subscribe(() => {
125
+ this.urlHistory.push(this.router.url);
126
+ });
127
+ }
128
+ getFlowRootRoute(route) {
129
+ var _a;
130
+ const path = [...route.pathFromRoot];
131
+ while (path.length) {
132
+ const parent = path.pop();
133
+ if (!parent) {
134
+ break;
135
+ }
136
+ if (((_a = parent.routeConfig) === null || _a === void 0 ? void 0 : _a.id) === VELOCE_FLOW_ROOT_ROUTE) {
137
+ return parent;
138
+ }
139
+ }
140
+ return;
141
+ }
142
+ getFlowRootPath(route) {
143
+ const rootRoute = this.getFlowRootRoute(route);
144
+ if (!rootRoute) {
145
+ return '';
146
+ }
147
+ const path = rootRoute.pathFromRoot
148
+ .map(r => { var _a; return (_a = r.routeConfig) === null || _a === void 0 ? void 0 : _a.path; })
149
+ .filter(Boolean)
150
+ .join('/');
151
+ return '/' + path;
152
+ }
153
+ get route$() {
154
+ return this.lastChildRoute$;
155
+ }
156
+ get params$() {
157
+ return this.lastChildParams$;
158
+ }
159
+ isConfigurationRoute$() {
160
+ return this.getFlowSubpath$().pipe(map(url => url.startsWith('product')));
161
+ }
162
+ isCartRoute$() {
163
+ return this.getFlowSubpath$().pipe(map(url => url.startsWith('cart')));
164
+ }
165
+ isCatalogRoute$() {
166
+ return this.getFlowSubpath$().pipe(map(url => url.startsWith('catalog')));
167
+ }
168
+ navigateBack() {
169
+ const prevUrl = this.urlHistory[this.urlHistory.length - 2];
170
+ if (prevUrl) {
171
+ this.router.navigateByUrl(prevUrl);
172
+ }
173
+ }
174
+ navigateToProductConfiguration(productId, lineItemId) {
175
+ this.contextService.update({ properties: { productId, lineItemId } });
176
+ const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
177
+ const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
178
+ this.router.navigate([flowRouteUrl, 'product'], {
179
+ queryParams: Object.assign(Object.assign({}, routeSnapshot.queryParams), { productId }),
180
+ });
181
+ }
182
+ navigateToShoppingCart() {
183
+ const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
184
+ const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
185
+ this.router.navigate([flowRouteUrl, 'cart'], { queryParams: routeSnapshot.queryParams });
186
+ }
187
+ navigateToCatalog() {
188
+ const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
189
+ const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
190
+ this.router.navigate([flowRouteUrl, 'catalog'], { queryParams: routeSnapshot.queryParams });
191
+ }
192
+ }
193
+ FlowRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRouterService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i2$1.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
194
+ FlowRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRouterService, providedIn: 'root' });
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRouterService, decorators: [{
196
+ type: Injectable,
197
+ args: [{ providedIn: 'root' }]
198
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i2$1.ContextService }]; } });
199
+
200
+ class CartPreviewComponent {
201
+ constructor(flowConfiguration, routerService, productImagesService) {
202
+ this.flowConfiguration = flowConfiguration;
203
+ this.routerService = routerService;
204
+ this.productImagesService = productImagesService;
205
+ this.form = new FormGroup({});
206
+ this.shouldUpdate$ = new BehaviorSubject(true);
207
+ this.destroyed$ = new Subject();
208
+ this.readonlyProductId$ = combineLatest([
209
+ this.routerService.route$,
210
+ this.routerService.isConfigurationRoute$(),
211
+ ]).pipe(map(([route, isConfigurationRoute]) => {
212
+ if (!isConfigurationRoute) {
213
+ return null;
214
+ }
215
+ return route.queryParams.productId;
216
+ }));
217
+ }
218
+ ngOnChanges(changes) {
219
+ if (changes.products) {
220
+ this.shouldUpdate$.next(true);
221
+ }
222
+ }
223
+ ngAfterViewInit() {
224
+ combineLatest([this.readonlyProductId$, this.shouldUpdate$, this.overlayPanel.onShow])
225
+ .pipe(filter(() => this.overlayPanel.overlayVisible), takeUntil(this.destroyed$))
226
+ .subscribe(([readonlyProductId]) => this.updateControls(this.products, readonlyProductId));
227
+ }
228
+ ngOnDestroy() {
229
+ this.destroyed$.next();
230
+ this.destroyed$.complete();
231
+ }
232
+ getImageUrl(productId) {
233
+ return this.productImagesService.getImageUrl$(productId);
234
+ }
235
+ navigateToProductConfiguration(productId, lineItemId) {
236
+ this.overlayPanel.hide();
237
+ this.routerService.navigateToProductConfiguration(productId, lineItemId);
238
+ }
239
+ controlBlurHandler(product) {
240
+ const control = this.form.controls[product.id];
241
+ if (control.invalid) {
242
+ return;
243
+ }
244
+ this.flowConfiguration.update([
245
+ {
246
+ dataType: 'LINEITEM',
247
+ attributeType: 'QTY',
248
+ id: product.id,
249
+ newValue: control.value,
250
+ },
251
+ ]);
252
+ }
253
+ deleteHandler(product) {
254
+ this.flowConfiguration.delete([product.id]);
255
+ }
256
+ deleteAllHandler() {
257
+ const productIds = this.products.map(product => product.id);
258
+ this.flowConfiguration.delete(productIds);
259
+ }
260
+ updateControls(products, readonlyProductId) {
261
+ const ids = [];
262
+ products.forEach(item => {
263
+ var _a;
264
+ if (!item.id) {
265
+ return;
266
+ }
267
+ ids.push(item.id);
268
+ if (!this.form.controls[item.id]) {
269
+ this.form.addControl(item.id, new FormControl(item.qty, []));
270
+ }
271
+ else {
272
+ (_a = this.form.controls[item.id]) === null || _a === void 0 ? void 0 : _a.setValue(item.qty);
273
+ }
274
+ if (item.productId === readonlyProductId) {
275
+ this.form.controls[item.id].disable();
276
+ }
277
+ else {
278
+ this.form.controls[item.id].enable();
279
+ }
280
+ });
281
+ const removedIds = Object.keys(this.form.controls).filter(id => !ids.includes(id));
282
+ removedIds.forEach(id => this.form.removeControl(id));
283
+ }
284
+ }
285
+ CartPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CartPreviewComponent, deps: [{ token: i2$1.FlowConfigurationService }, { token: FlowRouterService }, { token: i2$1.ProductImagesService }], target: i0.ɵɵFactoryTarget.Component });
286
+ CartPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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=\"navigation-settings-overlay flow-header-overlay center\"\n showTransitionOptions=\"0ms\"\n hideTransitionOptions=\"0ms\"\n>\n <ng-template pTemplate>\n <div class=\"flow-header-overlay__wrapper\" *vlLet=\"readonlyProductId$ | async as readonlyProductId\">\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-icon-close close-icon\" (click)=\"overlayPanel.hide()\"></i>\n </h2>\n\n <div class=\"product header\">\n <span>Product</span>\n <span class=\"text-right\">Qty</span>\n <span class=\"text-right\">MRR</span>\n <span class=\"text-right\">NRR</span>\n </div>\n\n <div class=\"scrollable-wrapper\">\n <div class=\"product\" *ngFor=\"let product of products\">\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 }}</div>\n <div>\n <p-button\n label=\"Configure\"\n [disabled]=\"!product.configurable || readonlyProductId === product.productId\"\n styleClass=\"p-button-link p-button-sm pl-0\"\n (onClick)=\"navigateToProductConfiguration(product.productId, product.id)\"\n ></p-button>\n <p-button\n label=\"Delete\"\n [disabled]=\"readonlyProductId === product.productId\"\n styleClass=\"p-button-link p-button-sm p-button-danger pl-0 pr-0\"\n (onClick)=\"deleteHandler(product)\"\n ></p-button>\n </div>\n </div>\n </div>\n\n <span>\n <p-inputNumber\n *ngIf=\"form.controls[product.id] as control\"\n class=\"qty-control\"\n [formControl]=\"$any(control)\"\n [min]=\"1\"\n [required]=\"true\"\n (onBlur)=\"controlBlurHandler(product)\"\n ></p-inputNumber>\n </span>\n <span class=\"text-right pt-3\">$0.00</span>\n <span class=\"text-right pt-3\">$0.00</span>\n </div>\n\n <ng-template #noImage>\n <i class=\"vl-icon vl-icon-no-image no-image-icon\"></i>\n </ng-template>\n </div>\n\n <div class=\"flex justify-content-end mt-3\">\n <p-button\n label=\"Clear cart\"\n styleClass=\"p-button-link p-button-sm p-button-danger pl-0 pr-0\"\n [disabled]=\"readonlyProductId\"\n (onClick)=\"deleteAllHandler()\"\n ></p-button>\n </div>\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-icon-close close-icon\" (click)=\"overlayPanel.hide()\"></i>\n </h2>\n\n <span class=\"empty-state\">There are no products added to the Shopping Cart yet.</span>\n </ng-template>\n </div>\n </ng-template>\n</p-overlayPanel>\n", styles: [".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 16px}.empty-state{color:var(--vl-text-color-deep-accent)}.scrollable-wrapper{overflow:auto}.product{display:grid;grid-template-columns:auto 60px 80px 80px;padding:16px 0}.product:not(.header){border-bottom:1px solid var(--vl-border-color)}.product.header{color:var(--vl-text-color-deep-accent)}.product__info{display:flex;grid-gap:16px;gap:16px}.product__image-wrapper{flex-shrink:0;height:64px;width:64px;display:flex;justify-content:center;align-items:center;background:var(--vl-primary-nav-overlay-bg);border-radius:4px}.product__image{background-size:contain;background-repeat:no-repeat;background-position:center;height:calc(100% - 12px);width:calc(100% - 12px)}.product .qty-control ::ng-deep .p-inputnumber-input{align-self:flex-start;text-align:right;width:100%}.word-break{word-break:break-word}.no-image-icon{color:#b4d1ef;height:18px;width:18px}\n"], components: [{ type: i3.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }], directives: [{ type: i2$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i3$1.LetDirective, selector: "[vlLet]", inputs: ["vlLet"] }, { type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
287
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CartPreviewComponent, decorators: [{
288
+ type: Component,
289
+ args: [{
290
+ selector: 'vl-cart-preview',
291
+ templateUrl: './cart-preview.component.html',
292
+ styleUrls: ['./cart-preview.component.scss'],
293
+ changeDetection: ChangeDetectionStrategy.OnPush,
294
+ }]
295
+ }], ctorParameters: function () { return [{ type: i2$1.FlowConfigurationService }, { type: FlowRouterService }, { type: i2$1.ProductImagesService }]; }, propDecorators: { overlayPanel: [{
296
+ type: ViewChild,
297
+ args: [OverlayPanel]
298
+ }], products: [{
299
+ type: Input
300
+ }] } });
301
+
302
+ class CartPreviewModule {
303
+ }
304
+ CartPreviewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CartPreviewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
305
+ CartPreviewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CartPreviewModule, declarations: [CartPreviewComponent], imports: [CommonModule, ReactiveFormsModule, ButtonModule, OverlayPanelModule, LetDirectiveModule, InputNumberModule], exports: [CartPreviewComponent] });
306
+ CartPreviewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CartPreviewModule, imports: [[CommonModule, ReactiveFormsModule, ButtonModule, OverlayPanelModule, LetDirectiveModule, InputNumberModule]] });
307
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CartPreviewModule, decorators: [{
308
+ type: NgModule,
309
+ args: [{
310
+ declarations: [CartPreviewComponent],
311
+ imports: [CommonModule, ReactiveFormsModule, ButtonModule, OverlayPanelModule, LetDirectiveModule, InputNumberModule],
312
+ exports: [CartPreviewComponent],
313
+ }]
314
+ }] });
315
+
316
+ class FlowDialogService {
317
+ constructor(dialogService, contextService) {
318
+ this.dialogService = dialogService;
319
+ this.contextService = contextService;
320
+ }
321
+ show(config) {
322
+ return this.dialogService.open(FlowDialogComponent, {
323
+ dismissableMask: true,
324
+ closeOnEscape: true,
325
+ closable: true,
326
+ showHeader: true,
327
+ header: config.title,
328
+ width: '440px',
329
+ data: { config },
330
+ }).onClose;
331
+ }
332
+ showEmptyCartDialog() {
333
+ return this.show({
334
+ title: 'No Products in Quote',
335
+ description: 'There are no products in your Quote. To save a Quote, add at least one product.',
336
+ primaryButton: 'OK',
337
+ });
338
+ }
339
+ showReadonlyModeDialog() {
340
+ const ctx = this.contextService.resolve();
341
+ const objectName = ctx.mode ? ctx.mode[0].toUpperCase() + ctx.mode.substring(1).toLowerCase() : 'Object';
342
+ return this.show({
343
+ title: 'Error',
344
+ description: `${objectName} Cannot be Saved`,
345
+ primaryButton: 'OK',
346
+ });
347
+ }
348
+ showQuoteReadonlyModeDialog() {
349
+ return this.show({
350
+ title: 'Quote Cannot be Saved',
351
+ description: 'It is only possible to save quotes with the “Draft” status. Please create a new quote to make and save changes.',
352
+ primaryButton: 'OK',
353
+ });
354
+ }
355
+ showAccountNoChangesDialog() {
356
+ return this.show({
357
+ title: 'No Changes to Save',
358
+ description: 'There are no changes since the last update. Please make changes to proceed.',
359
+ primaryButton: 'OK',
360
+ });
361
+ }
362
+ showUnsavedChangesDialog() {
363
+ return this.show({
364
+ title: 'Unsaved Changes',
365
+ description: 'Are you sure you want to leave this page and discard your unsaved changes?',
366
+ primaryButton: 'Keep Editing',
367
+ secondaryButton: 'Discard Changes',
368
+ });
369
+ }
370
+ showReadonlyQuoteSubmitFailureDialog() {
371
+ return this.show({
372
+ title: 'Cannot Submit for Approval',
373
+ description: 'It is only possible to submit for approval quotes with the “Draft“ status. Please create a new quote to proceed.',
374
+ primaryButton: 'OK',
375
+ });
376
+ }
377
+ showAccountSubmitFailureDialog() {
378
+ return this.show({
379
+ title: 'Save Changes',
380
+ description: 'To submit for approval, save the quote first, and then submit it for approval from the Shopping Cart.',
381
+ primaryButton: 'OK',
382
+ });
383
+ }
384
+ }
385
+ FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token: i2$1.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
386
+ FlowDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogService });
387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogService, decorators: [{
388
+ type: Injectable
389
+ }], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2$1.ContextService }]; } });
390
+
391
+ class FlowHeaderComponent {
392
+ constructor(contextService, quoteDraftService, quoteApiService, sfApiService, flowConfiguration, routerService, dialogService) {
393
+ this.contextService = contextService;
394
+ this.quoteDraftService = quoteDraftService;
395
+ this.quoteApiService = quoteApiService;
396
+ this.sfApiService = sfApiService;
397
+ this.flowConfiguration = flowConfiguration;
398
+ this.routerService = routerService;
399
+ this.dialogService = dialogService;
400
+ this.disabledActionButtonTooltip = 'Available from the Shopping Cart';
401
+ this.objectDetails$ = new BehaviorSubject({});
402
+ this.isSaveInProgress$ = new BehaviorSubject(false);
403
+ this.isSubmitInProgress$ = new BehaviorSubject(false);
404
+ this.destroyed$ = new Subject();
405
+ const ctx = this.contextService.resolve();
406
+ this.mode = ctx.mode;
407
+ this.objectName = ctx.mode.toLowerCase();
408
+ this.contextProperties = ctx.properties;
409
+ this.status$ = this.contextService.resolve$().pipe(map(context => { var _a; return (_a = context.properties.Status) !== null && _a !== void 0 ? _a : ''; }));
410
+ this.isEditMode$ = this.quoteDraftService.isEditMode$();
411
+ this.products$ = this.flowConfiguration.get().pipe(map(lineItems => this.generateProducts(lineItems)));
412
+ this.isConfigurationRoute$ = this.routerService.isConfigurationRoute$();
413
+ this.isCartRoute$ = this.routerService.isCartRoute$();
414
+ this.isCatalogRoute$ = this.routerService.isCatalogRoute$();
415
+ }
416
+ ngOnInit() {
417
+ this.populateObjectDetails();
418
+ }
419
+ ngOnDestroy() {
420
+ this.destroyed$.next();
421
+ this.destroyed$.complete();
422
+ }
423
+ get isAccountMode() {
424
+ return this.mode === ConfigurationContextMode.ACCOUNT;
425
+ }
426
+ get isQuoteMode() {
427
+ return this.mode === ConfigurationContextMode.QUOTE;
428
+ }
429
+ back() {
430
+ const objectId = this.contextService.resolve().headerId;
431
+ if (objectId) {
432
+ window.VELO_BACK_FN.apply(null, [objectId]);
433
+ }
434
+ }
435
+ getSalesforceObjectLink(objectId) {
436
+ if (!objectId) {
437
+ return '';
438
+ }
439
+ return `${window.location.origin}/${objectId}`;
440
+ }
441
+ navigateToShoppingCart() {
442
+ this.routerService.navigateToShoppingCart();
443
+ }
444
+ navigateToCatalog() {
445
+ this.routerService.navigateToCatalog();
446
+ }
447
+ saveButtonClickHandler() {
448
+ if (!this.quoteDraftService.isEditMode()) {
449
+ if (this.mode === ConfigurationContextMode.QUOTE) {
450
+ this.dialogService.showQuoteReadonlyModeDialog().subscribe();
451
+ }
452
+ else {
453
+ this.dialogService.showReadonlyModeDialog().subscribe();
454
+ }
455
+ return;
456
+ }
457
+ if (this.mode === ConfigurationContextMode.ACCOUNT && !this.quoteDraftService.hasUnsavedChanges) {
458
+ this.dialogService.showAccountNoChangesDialog().subscribe();
459
+ return;
460
+ }
461
+ const lineItems = this.flowConfiguration.getSnapshot();
462
+ if (!lineItems.length) {
463
+ this.dialogService.showEmptyCartDialog().subscribe();
464
+ return;
465
+ }
466
+ const quoteDraft = this.quoteDraftService.quoteSnapshot;
467
+ if (!quoteDraft) {
468
+ return;
469
+ }
470
+ this.isSaveInProgress$.next(true);
471
+ this.quoteApiService
472
+ .upsertQuote(quoteDraft)
473
+ .pipe(tap(() => {
474
+ // navigate back to quote on successful save
475
+ if (this.mode === ConfigurationContextMode.QUOTE) {
476
+ this.back();
477
+ }
478
+ }), finalize(() => this.isSaveInProgress$.next(false)))
479
+ .subscribe();
480
+ }
481
+ submitButtonClickHandler() {
482
+ if (this.mode === ConfigurationContextMode.QUOTE && !this.quoteDraftService.isEditMode()) {
483
+ this.dialogService.showReadonlyQuoteSubmitFailureDialog();
484
+ return;
485
+ }
486
+ if (this.mode === ConfigurationContextMode.ACCOUNT) {
487
+ this.dialogService.showAccountSubmitFailureDialog();
488
+ return;
489
+ }
490
+ const quoteDraft = this.quoteDraftService.quoteSnapshot;
491
+ if (!quoteDraft) {
492
+ return;
493
+ }
494
+ this.isSubmitInProgress$.next(true);
495
+ this.quoteApiService
496
+ .submitQuote(quoteDraft)
497
+ .pipe(switchMap(() => this.quoteApiService.getQuoteDraft(quoteDraft.quoteId)), tap(updatedQuoteDraft => this.contextService.update({ properties: updatedQuoteDraft.context.properties })), finalize(() => this.isSubmitInProgress$.next(false)), takeUntil(this.destroyed$))
498
+ .subscribe();
499
+ }
500
+ queryName$(objectName, id) {
501
+ if (!id) {
502
+ return of('');
503
+ }
504
+ const searchRequest = {
505
+ count: 1,
506
+ rawCondition: `Id = '${id}'`,
507
+ fields: ['Name'],
508
+ };
509
+ 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$));
510
+ }
511
+ populateObjectDetails() {
512
+ var _a, _b;
513
+ const accountId = this.isAccountMode ? this.contextProperties.Id : this.contextProperties.AccountId;
514
+ const opportunityId = this.contextProperties.OpportunityId;
515
+ const quoteId = this.isQuoteMode ? this.contextProperties.Id : undefined;
516
+ const quoteName = this.isQuoteMode ? this.contextProperties.Name : undefined;
517
+ const quoteNumber = this.isQuoteMode ? (_a = this.contextProperties.QuoteNumber) === null || _a === void 0 ? void 0 : _a.replace(/^0+/, '') : undefined;
518
+ const priceListName = (_b = this.quoteDraftService.quotePriceList) === null || _b === void 0 ? void 0 : _b.name;
519
+ this.objectDetails$.next(Object.assign(Object.assign({}, this.objectDetails$.value), { accountId,
520
+ opportunityId,
521
+ quoteId,
522
+ quoteName,
523
+ quoteNumber,
524
+ priceListName }));
525
+ this.queryName$('Account', accountId).subscribe(accountName => this.objectDetails$.next(Object.assign(Object.assign({}, this.objectDetails$.value), { accountName })));
526
+ this.queryName$('Opportunity', opportunityId).subscribe(opportunityName => this.objectDetails$.next(Object.assign(Object.assign({}, this.objectDetails$.value), { opportunityName })));
527
+ }
528
+ generateProducts(lineItems) {
529
+ const date = new Date();
530
+ date.setHours(0, 0, 0, 0);
531
+ const now = date.getTime();
532
+ return lineItems.reduce((result, li) => {
533
+ // find main term line item
534
+ if (li.rampInstanceId) {
535
+ return result;
536
+ }
537
+ // find current term line item
538
+ let target = li;
539
+ while (target && target.endDate && new Date(target.endDate).getTime() <= now) {
540
+ target = lineItems.find(sub => sub.rampInstanceId === li.id);
541
+ }
542
+ if (target && target.productId) {
543
+ return [
544
+ ...result,
545
+ {
546
+ id: target.id,
547
+ productId: target.productId,
548
+ name: target.name,
549
+ configurable: target.properties['#configurable'] === 'true',
550
+ qty: target.qty,
551
+ mrr: 0,
552
+ nrr: 0,
553
+ },
554
+ ];
555
+ }
556
+ return result;
557
+ }, []);
558
+ }
559
+ }
560
+ FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i2$1.ContextService }, { token: i2$1.QuoteDraftService }, { token: i1$2.QuoteApiService }, { token: i1$2.SalesforceApiService }, { token: i2$1.FlowConfigurationService }, { token: FlowRouterService }, { token: FlowDialogService }], target: i0.ɵɵFactoryTarget.Component });
561
+ FlowHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: FlowHeaderComponent, selector: "vl-flow-header", ngImport: i0, template: "<div class=\"flow-info\" *vlLet=\"objectDetails$ | async as details\">\n <nav class=\"nav-item nav-back\" (click)=\"back()\">\n <i class=\"nav-icon vl-icon vl-icon-arrow-left\"></i>\n\n <span> Back </span>\n <span *ngIf=\"objectName\" class=\"object-name\">&nbsp;To {{ objectName }}</span>\n </nav>\n\n <ng-container *ngIf=\"isAccountMode\">\n <span class=\"dot-separator\"></span>\n\n <span>Account name</span>\n\n <nav class=\"account-name\" [pTooltip]=\"contextProperties.Name ?? ''\" tooltipPosition=\"bottom\" [showDelay]=\"1000\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(contextProperties.Id)\">{{ contextProperties.Name }}</a>\n </nav>\n </ng-container>\n\n <ng-container *ngIf=\"isQuoteMode\">\n <span class=\"dot-separator\"></span>\n\n <span>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-icon-chevron-down icon-with-margin\"></i>\n <i *ngIf=\"quoteDetails.overlayVisible\" class=\"vl-icon vl-icon-chevron-up icon-with-margin\"></i>\n </nav>\n\n <p-overlayPanel styleClass=\"navigation-settings-overlay flow-header-overlay center\" #quoteDetails>\n <ng-template pTemplate>\n <div class=\"flow-header-overlay__wrapper\">\n <h2 class=\"flow-header-overlay__title\">\n <span>Quote Information</span>\n <i class=\"vl-icon vl-icon-close close-icon\" (click)=\"quoteDetails.hide()\"></i>\n </h2>\n\n <ul class=\"info-list\">\n <li class=\"info-list__row\">\n <span>Account Name:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.accountId)\">{{ details.accountName }}</a>\n </li>\n <li class=\"info-list__row\">\n <span>Opportunity Name:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.opportunityId)\">{{\n details.opportunityName\n }}</a>\n </li>\n <li class=\"info-list__row\">\n <span>Quote Name:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.quoteId)\">{{ details.quoteName }}</a>\n </li>\n </ul>\n </div>\n </ng-template>\n </p-overlayPanel>\n </ng-container>\n</div>\n\n<div class=\"flow-navigation\">\n <nav class=\"nav-item\" [ngClass]=\"{ active: isCatalogRoute$ | async }\" (click)=\"navigateToCatalog()\">Catalog</nav>\n <nav class=\"nav-item disabled\" [ngClass]=\"{ active: isConfigurationRoute$ | async }\">Configurator</nav>\n <ng-container *vlLet=\"products$ | async as products\">\n <nav class=\"nav-item\" [ngClass]=\"{ active: isCartRoute$ | async }\" (click)=\"navigateToShoppingCart()\">\n Shopping Cart ({{ products.length }})\n </nav>\n\n <nav class=\"nav-popover-toggle active\" (click)=\"cart?.overlayPanel?.toggle($event)\">\n <i *ngIf=\"!cart?.overlayPanel?.overlayVisible\" class=\"vl-icon vl-icon-chevron-down icon-with-margin\"></i>\n <i *ngIf=\"cart?.overlayPanel?.overlayVisible\" class=\"vl-icon vl-icon-chevron-up icon-with-margin\"></i>\n </nav>\n\n <vl-cart-preview #cart [products]=\"products\"></vl-cart-preview>\n </ng-container>\n</div>\n\n<div class=\"flow-controls\" *vlLet=\"objectDetails$ | async as details\">\n <ng-container *ngIf=\"isQuoteMode\">\n <span *ngIf=\"details.priceListName\">{{ details.priceListName }}</span>\n <span *ngIf=\"contextProperties.StartDate\">{{ contextProperties.StartDate | date: 'MM.dd.yyyy' }}</span>\n\n <span class=\"slash-separator\"></span>\n\n <span>MRR: <span class=\"font-semibold\">$0.00</span></span>\n <span>NRR: <span class=\"font-semibold\">$0.00</span></span>\n </ng-container>\n\n <ng-container *vlLet=\"isCartRoute$ | async as isCartRoute\">\n <p-button\n styleClass=\"p-button-outlined\"\n label=\"Generate Doc\"\n [disabled]=\"!isCartRoute\"\n tooltipPosition=\"bottom\"\n [showDelay]=\"300\"\n [pTooltip]=\"isCartRoute ? '' : disabledActionButtonTooltip\"\n ></p-button>\n\n <p-button\n *vlLet=\"isSaveInProgress$ | async as isSaveInProgress\"\n class=\"save-button\"\n styleClass=\"p-button-outlined\"\n [label]=\"isSaveInProgress ? 'Saving' : 'Save to Quote'\"\n (onClick)=\"saveButtonClickHandler()\"\n [loading]=\"isSaveInProgress\"\n ></p-button>\n\n <p-button\n *vlLet=\"isSubmitInProgress$ | async as isSubmitInProgress\"\n class=\"submit-button\"\n styleClass=\"p-button\"\n [label]=\"isSubmitInProgress ? 'Submitting' : 'Submit For Approval'\"\n [disabled]=\"!isCartRoute\"\n tooltipPosition=\"bottom\"\n [showDelay]=\"300\"\n [pTooltip]=\"isCartRoute ? '' : disabledActionButtonTooltip\"\n (onClick)=\"submitButtonClickHandler()\"\n [loading]=\"isSubmitInProgress\"\n ></p-button>\n </ng-container>\n</div>\n", styles: [":host{display:flex;align-items:center;height:48px;width:100%;background-color:var(--vl-primary-color);color:#fff;padding:0 32px;flex-shrink:0}::ng-deep .p-overlaypanel.flow-header-overlay .p-overlaypanel-content{background-color:#fff;padding:16px}::ng-deep .p-overlaypanel.flow-header-overlay.left:before{left:6px!important}::ng-deep .p-overlaypanel.flow-header-overlay.right:before{right:6px!important}::ng-deep .p-overlaypanel.flow-header-overlay.left .p-overlaypanel-content{margin-left:-16px}::ng-deep .p-overlaypanel.flow-header-overlay.right .p-overlaypanel-content{margin-right:-16px}::ng-deep .p-overlaypanel.flow-header-overlay:before{background-color:#fff}:host ::ng-deep .p-button{padding:5px 15px;font-size:12px}:host ::ng-deep .p-button{color:var(--vl-primary-color);background-color:#fff;border-color:#fff}:host ::ng-deep .p-button:enabled:hover{background-color:var(--vl-primary-color);color:#fff;border-color:#fff}:host ::ng-deep .p-button.p-button-outlined{background-color:var(--vl-primary-color);color:#fff;border-color:#fff}:host ::ng-deep .p-button.p-button-outlined:enabled:hover{color:var(--vl-primary-color);background-color:#fff;border-color:#fff}:host ::ng-deep .p-button .p-button-label{white-space:nowrap}:host ::ng-deep .save-button .p-button{width:120px}:host ::ng-deep .submit-button .p-button{width:160px}.vl-icon{display:inline-block}.flow-info{flex-shrink:0;display:flex;grid-gap:8px;gap:8px;align-items:center}.flow-info .nav-popover-toggle{margin-left:-8px}.flow-info .object-name{text-transform:capitalize}.flow-info .nav-back{font-weight:bold}.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;padding:4px 0}nav.disabled{opacity:.6;cursor:default}nav .nav-icon{margin-right:10px}nav .icon-with-margin{margin:0 4px}nav a{color:#fff}nav.account-name{margin-left:4px;display:block;max-width:200px;overflow:hidden;text-overflow:ellipsis}nav.nav-popover-toggle{width:24px;display:flex;justify-content:center}nav.nav-popover-toggle i{pointer-events:none;margin:0}nav i{pointer-events:none}.dot-separator:after{content:\"\";display:block;width:4px;height:4px;border-radius:50%;background:#fff}.slash-separator:after{content:\"\";display:block;background:#fff;width:1px;height:16px}.flow-header-overlay__wrapper{width:360px}.flow-header-overlay__wrapper .close-icon{cursor:pointer}.flow-header-overlay__wrapper .info-list{list-style:none;padding:0;font-size:12px}.flow-header-overlay__wrapper .info-list__row{padding:8px 0;display:flex;justify-content:space-between}.flow-header-overlay__title{display:flex;justify-content:space-between;align-items:center;margin:0 0 24px}.flow-navigation{flex-grow:1;display:flex;grid-gap:16px;gap:16px;justify-content:center;font-weight:600}.flow-navigation .cart-nav-container{display:flex}.flow-navigation .nav-popover-toggle{margin-left:-14px}.flow-navigation .nav-item,.flow-navigation .nav-popover-toggle{opacity:.6}.flow-navigation .nav-item.active,.flow-navigation .nav-item:not(.disabled):hover,.flow-navigation .nav-popover-toggle.active,.flow-navigation .nav-popover-toggle:not(.disabled):hover{opacity:1}.flow-controls{flex-shrink:0;display:flex;align-items:center;grid-gap:8px;gap:8px}\n"], components: [{ type: i3.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { type: CartPreviewComponent, selector: "vl-cart-preview", inputs: ["products"] }, { type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }], directives: [{ type: i3$1.LetDirective, selector: "[vlLet]", inputs: ["vlLet"] }, { type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { type: i2$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i9.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "async": i9.AsyncPipe, "date": i9.DatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
562
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowHeaderComponent, decorators: [{
563
+ type: Component,
564
+ args: [{
565
+ selector: 'vl-flow-header',
566
+ templateUrl: './header.component.html',
567
+ styleUrls: ['./header.component.scss'],
568
+ changeDetection: ChangeDetectionStrategy.OnPush,
569
+ }]
570
+ }], ctorParameters: function () { return [{ type: i2$1.ContextService }, { type: i2$1.QuoteDraftService }, { type: i1$2.QuoteApiService }, { type: i1$2.SalesforceApiService }, { type: i2$1.FlowConfigurationService }, { type: FlowRouterService }, { type: FlowDialogService }]; } });
571
+
572
+ class FlowHeaderModule {
573
+ }
574
+ FlowHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
575
+ FlowHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowHeaderModule, declarations: [FlowHeaderComponent], imports: [CommonModule, OverlayPanelModule, LetDirectiveModule, TooltipModule, ButtonModule, CartPreviewModule], exports: [FlowHeaderComponent] });
576
+ FlowHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowHeaderModule, imports: [[CommonModule, OverlayPanelModule, LetDirectiveModule, TooltipModule, ButtonModule, CartPreviewModule]] });
577
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowHeaderModule, decorators: [{
578
+ type: NgModule,
579
+ args: [{
580
+ declarations: [FlowHeaderComponent],
581
+ imports: [CommonModule, OverlayPanelModule, LetDirectiveModule, TooltipModule, ButtonModule, CartPreviewModule],
582
+ exports: [FlowHeaderComponent],
583
+ }]
584
+ }] });
585
+
586
+ class FlowService {
587
+ constructor(integrationState, flowRouterService, quoteDraftService, configurationService, flowConfigurationService) {
588
+ this.integrationState = integrationState;
589
+ this.flowRouterService = flowRouterService;
590
+ this.quoteDraftService = quoteDraftService;
591
+ this.configurationService = configurationService;
592
+ this.flowConfigurationService = flowConfigurationService;
593
+ this.cleanup$ = new Subject();
594
+ }
595
+ initSubscriptions() {
596
+ this.integrationState
597
+ .listen$(FlowAction.FLOW_CONFIGURE_PRODUCT)
598
+ .pipe(takeUntil(this.cleanup$), tap(payload => {
599
+ var _a, _b, _c;
600
+ const productId = (_a = payload.productId) !== null && _a !== void 0 ? _a : (_c = (_b = this.quoteDraftService.quoteSnapshot) === null || _b === void 0 ? void 0 : _b.currentState.find(li => li.id === payload.lineItemId)) === null || _c === void 0 ? void 0 : _c.productId;
601
+ if (productId) {
602
+ this.flowRouterService.navigateToProductConfiguration(productId, payload.lineItemId);
603
+ }
604
+ else {
605
+ console.warn("Parameter 'productId' is needed to start configuration");
606
+ }
607
+ }))
608
+ .subscribe();
609
+ this.integrationState
610
+ .listen$(FlowAction.FLOW_NAVIGATE_BACK)
611
+ .pipe(takeUntil(this.cleanup$), tap(() => this.flowRouterService.navigateBack()))
612
+ .subscribe();
613
+ this.integrationState
614
+ .listen$(FlowAction.FLOW_APPLY_PRODUCT_CONFIGURATION)
615
+ .pipe(takeUntil(this.cleanup$), switchMap(() => {
616
+ const lineItem = this.configurationService.getSnapshot();
617
+ if (!lineItem) {
618
+ return of(undefined);
619
+ }
620
+ const currentState = this.flowConfigurationService.getSnapshot();
621
+ const isNewLineItem = currentState.every(li => li.id !== lineItem.id);
622
+ let updatedState;
623
+ if (isNewLineItem) {
624
+ updatedState = [...currentState, lineItem];
625
+ }
626
+ else {
627
+ updatedState = currentState.map(li => (li.id === lineItem.id ? lineItem : li));
628
+ }
629
+ return this.flowConfigurationService.calculate$(updatedState);
630
+ }), tap(() => {
631
+ this.configurationService.hasUnsavedChanges = false;
632
+ this.flowRouterService.navigateToShoppingCart();
633
+ }))
634
+ .subscribe();
635
+ }
636
+ cleanup() {
637
+ this.cleanup$.next();
638
+ }
639
+ }
640
+ FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowService, deps: [{ token: i4.IntegrationState }, { token: FlowRouterService }, { token: i2$1.QuoteDraftService }, { token: i2$1.ConfigurationService }, { token: i2$1.FlowConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable });
641
+ FlowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowService });
642
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowService, decorators: [{
643
+ type: Injectable
644
+ }], ctorParameters: function () { return [{ type: i4.IntegrationState }, { type: FlowRouterService }, { type: i2$1.QuoteDraftService }, { type: i2$1.ConfigurationService }, { type: i2$1.FlowConfigurationService }]; } });
645
+
646
+ class FlowComponent {
647
+ constructor(routerService, quoteDraftService, flowService) {
648
+ this.routerService = routerService;
649
+ this.quoteDraftService = quoteDraftService;
650
+ this.flowService = flowService;
651
+ this.isLoading$ = this.routerService.loading$;
652
+ this.showHeader$ = this.routerService.route$.pipe(map(route => route.data.showHeader && !this.quoteDraftService.isStandalone));
653
+ this.flowService.initSubscriptions();
654
+ }
655
+ ngOnDestroy() {
656
+ this.flowService.cleanup();
657
+ }
658
+ }
659
+ FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: i2$1.QuoteDraftService }, { token: FlowService }], target: i0.ɵɵFactoryTarget.Component });
660
+ FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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</div>\n", styles: [":host{display:flex;flex-direction:column;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;left:0;right:0;top:0;bottom:0;background-color:#ffffff80;z-index:4}\n"], components: [{ type: FlowHeaderComponent, selector: "vl-flow-header" }, { type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowComponent, decorators: [{
662
+ type: Component,
663
+ args: [{
664
+ selector: 'vl-flow',
665
+ templateUrl: './flow.component.html',
666
+ styleUrls: ['./flow.component.scss'],
667
+ changeDetection: ChangeDetectionStrategy.OnPush,
668
+ }]
669
+ }], ctorParameters: function () { return [{ type: FlowRouterService }, { type: i2$1.QuoteDraftService }, { type: FlowService }]; } });
670
+
671
+ class ContextGuard {
672
+ constructor(router, routerService, contextService) {
673
+ this.router = router;
674
+ this.routerService = routerService;
675
+ this.contextService = contextService;
676
+ }
677
+ checkActivation(route) {
678
+ var _a, _b;
679
+ const { queryParams } = route;
680
+ const { accountId, quoteId, orderId } = queryParams;
681
+ const rpcMessage = window.RPC_MESSAGE;
682
+ const mode = this.getConfigurationContextMode(accountId, quoteId, orderId, rpcMessage);
683
+ // Restrict if mode is not defined
684
+ if (mode == null) {
685
+ return this.handleError(route, 'Mode is undefined');
686
+ }
687
+ const rpcMessageId = rpcMessage && ((_b = (_a = JSON.parse(rpcMessage)) === null || _a === void 0 ? void 0 : _a.quote) === null || _b === void 0 ? void 0 : _b.Id);
688
+ const headerId = accountId || quoteId || orderId || rpcMessageId || 'empty-for-test-mode';
689
+ // Allow if context is already initialized with the same headerId
690
+ if (this.contextService.isInitialized) {
691
+ const currentContext = this.contextService.resolve();
692
+ if (headerId && currentContext.headerId === headerId) {
693
+ return of(true);
694
+ }
695
+ }
696
+ // Initialize context
697
+ return this.contextService.create(headerId, mode).pipe(tap((context) => {
698
+ // Update context with queryParams
699
+ this.contextService.update(Object.assign(Object.assign({}, context), { properties: Object.assign(Object.assign({}, context.properties), (queryParams !== null && queryParams !== void 0 ? queryParams : {})) }));
700
+ }), map(() => true), catchError(e => {
701
+ const message = e instanceof HttpErrorResponse ? e.error.message : e;
702
+ return this.handleError(route, message);
703
+ }));
704
+ }
705
+ canActivate(route) {
706
+ return this.checkActivation(route);
707
+ }
708
+ canActivateChild(childRoute) {
709
+ return this.checkActivation(childRoute);
710
+ }
711
+ getConfigurationContextMode(accountId, quoteId, orderId, rpcMessage) {
712
+ if (accountId) {
713
+ return ConfigurationContextMode.ACCOUNT;
714
+ }
715
+ if (quoteId) {
716
+ return ConfigurationContextMode.QUOTE;
717
+ }
718
+ if (orderId) {
719
+ return ConfigurationContextMode.ORDER;
720
+ }
721
+ if (rpcMessage) {
722
+ return ConfigurationContextMode.REMOTE;
723
+ }
724
+ return;
725
+ }
726
+ handleError(route, message) {
727
+ this.contextService.delete();
728
+ const parentUrl = this.routerService.getFlowRootPath(route);
729
+ return from(this.router.navigate([parentUrl, '404'], { state: { message } })).pipe(map(() => false));
730
+ }
731
+ }
732
+ ContextGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ContextGuard, deps: [{ token: i1$1.Router }, { token: FlowRouterService }, { token: i2$1.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
733
+ ContextGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ContextGuard });
734
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ContextGuard, decorators: [{
735
+ type: Injectable
736
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: FlowRouterService }, { type: i2$1.ContextService }]; } });
737
+
738
+ class ProductUnloadGuard {
739
+ constructor(router, contextService, quoteDraftService, configurationService, flowDialogService) {
740
+ this.router = router;
741
+ this.contextService = contextService;
742
+ this.quoteDraftService = quoteDraftService;
743
+ this.configurationService = configurationService;
744
+ this.flowDialogService = flowDialogService;
745
+ }
746
+ canDeactivate(_, route, currentState, nextState) {
747
+ let observable = of(true);
748
+ if (!this.quoteDraftService.isStandalone && this.configurationService.hasUnsavedChanges) {
749
+ observable = this.flowDialogService.showUnsavedChangesDialog().pipe(map(confirmed => !confirmed));
750
+ }
751
+ return observable.pipe(map(unload => {
752
+ if (unload) {
753
+ this.configurationService.reset();
754
+ this.contextService.update({ properties: { productId: undefined, lineItemId: undefined } });
755
+ if (!nextState || currentState.url === nextState.url) {
756
+ return true;
757
+ }
758
+ // clear obsolete queryParams
759
+ const urlTree = this.router.parseUrl(nextState.url);
760
+ delete urlTree.queryParams.productId;
761
+ // replace url after deactivation has finished
762
+ setTimeout(() => this.router.navigateByUrl(urlTree.toString(), { replaceUrl: true }));
763
+ return true;
764
+ }
765
+ return false;
766
+ }));
767
+ }
768
+ }
769
+ ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$1.Router }, { token: i2$1.ContextService }, { token: i2$1.QuoteDraftService }, { token: i2$1.ConfigurationService }, { token: FlowDialogService }], target: i0.ɵɵFactoryTarget.Injectable });
770
+ ProductUnloadGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductUnloadGuard });
771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductUnloadGuard, decorators: [{
772
+ type: Injectable
773
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i2$1.ContextService }, { type: i2$1.QuoteDraftService }, { type: i2$1.ConfigurationService }, { type: FlowDialogService }]; } });
774
+
775
+ class RootGuard {
776
+ constructor(router, routerService) {
777
+ this.router = router;
778
+ this.routerService = routerService;
779
+ this.initialized = false;
780
+ this.navToRestore = null;
781
+ }
782
+ canActivate(route) {
783
+ // We always need to initialize root component first, and only then start checking guards/resolvers
784
+ var _a;
785
+ if (!this.initialized) {
786
+ this.initialized = true;
787
+ this.navToRestore = this.router.getCurrentNavigation();
788
+ const rootUrl = this.routerService.getFlowRootPath(route);
789
+ this.router.navigate([rootUrl], { replaceUrl: !((_a = this.navToRestore) === null || _a === void 0 ? void 0 : _a.previousNavigation) });
790
+ }
791
+ else if (this.navToRestore) {
792
+ const nav = this.navToRestore;
793
+ setTimeout(() => {
794
+ this.router.navigateByUrl(nav.extractedUrl, nav.extras);
795
+ this.navToRestore = null;
796
+ });
797
+ }
798
+ return true;
799
+ }
800
+ canDeactivate() {
801
+ this.initialized = false;
802
+ return true;
803
+ }
804
+ }
805
+ RootGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RootGuard, deps: [{ token: i1$1.Router }, { token: FlowRouterService }], target: i0.ɵɵFactoryTarget.Injectable });
806
+ RootGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RootGuard, providedIn: 'root' });
807
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RootGuard, decorators: [{
808
+ type: Injectable,
809
+ args: [{ providedIn: 'root' }]
810
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: FlowRouterService }]; } });
811
+
812
+ const FLOW_CUSTOMIZATION = new InjectionToken('FLOW_CUSTOMIZATION');
813
+
814
+ class CatalogComponent {
815
+ constructor(templatesApi, contextService, cdr, toastService, customizationService) {
816
+ var _a;
817
+ this.templatesApi = templatesApi;
818
+ this.contextService = contextService;
819
+ this.cdr = cdr;
820
+ this.toastService = toastService;
821
+ this.customizationService = customizationService;
822
+ this.uiDefinition = undefined;
823
+ this.state$ = new BehaviorSubject({ loading: true, failure: false });
824
+ this.templateApiName = '';
825
+ this.destroyed$ = new Subject();
826
+ this.templateApiName = (_a = this.contextService.resolve().properties.catalogTemplateApiName) !== null && _a !== void 0 ? _a : '';
827
+ }
828
+ ngOnInit() {
829
+ this.generateUIDefinition$()
830
+ .pipe(tap(uiDef => {
831
+ if (!uiDef) {
832
+ throw new Error(`Component with name '${this.templateApiName}' not found.`);
833
+ }
834
+ this.uiDefinition = uiDef;
835
+ this.state$.next({ loading: false, failure: false });
836
+ }), catchError(err => {
837
+ var _a;
838
+ const message = 'Failed to resolve Catalog component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
839
+ this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
840
+ this.uiDefinition = undefined;
841
+ this.state$.next({ loading: false, failure: true });
842
+ return of();
843
+ }), takeUntil(this.destroyed$))
844
+ .subscribe(() => this.cdr.detectChanges());
845
+ }
846
+ ngOnDestroy() {
847
+ this.destroyed$.next();
848
+ this.destroyed$.complete();
849
+ }
850
+ getTemplateRootComponent$(template) {
851
+ return this.templatesApi
852
+ .fetchComponents$(template.id)
853
+ .pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
854
+ }
855
+ getLocalCatalogComponentMeta$() {
856
+ var _a, _b;
857
+ if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getCatalogComponent)) {
858
+ return of(undefined);
859
+ }
860
+ return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getCatalogComponent(this.templateApiName).pipe(map(component => {
861
+ if (!component) {
862
+ return;
863
+ }
864
+ return {
865
+ html: component.html,
866
+ css: component.css,
867
+ js: component.js,
868
+ json: component.json,
869
+ };
870
+ }));
871
+ }
872
+ getCatalogComponentMeta$() {
873
+ return this.templatesApi.fetchTemplates$().pipe(map(templates => templates.find(template => template.type === UITemplateType.CATALOG && template.name === this.templateApiName)), switchMap(template => (template ? this.getTemplateRootComponent$(template) : of(undefined))), switchMap(component => component ? this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : of(undefined)));
874
+ }
875
+ generateUIDefinition$() {
876
+ return of(undefined).pipe(tap(() => {
877
+ if (!this.templateApiName) {
878
+ throw new Error("Flow Query parameter 'catalogTemplateApiName' is missing.");
879
+ }
880
+ }), switchMap(() => this.getLocalCatalogComponentMeta$()), switchMap(meta => (meta ? of(meta) : this.getCatalogComponentMeta$())), map(meta => {
881
+ if (!meta) {
882
+ return;
883
+ }
884
+ const uiDef = {
885
+ name: '',
886
+ createdTimestamp: 0,
887
+ primary: true,
888
+ type: 'DEFAULT',
889
+ version: 2,
890
+ children: [
891
+ {
892
+ children: [],
893
+ template: meta.html && btoa(meta.html),
894
+ script: meta.js && btoa(meta.js),
895
+ styles: meta.css && btoa(meta.css),
896
+ },
897
+ ],
898
+ };
899
+ return uiDef;
900
+ }));
901
+ }
902
+ }
903
+ CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogComponent, deps: [{ token: i1$2.UITemplatesApiService }, { token: i2$1.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
904
+ CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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: [""], components: [{ type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: i4.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "clearState"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
905
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogComponent, decorators: [{
906
+ type: Component,
907
+ args: [{
908
+ selector: 'vl-flow-catalog',
909
+ templateUrl: './catalog.component.html',
910
+ styleUrls: ['./catalog.component.scss'],
911
+ changeDetection: ChangeDetectionStrategy.OnPush,
912
+ }]
913
+ }], ctorParameters: function () { return [{ type: i1$2.UITemplatesApiService }, { type: i2$1.ContextService }, { type: i0.ChangeDetectorRef }, { type: i3$1.ToastService }, { type: undefined, decorators: [{
914
+ type: Optional
915
+ }, {
916
+ type: Inject,
917
+ args: [FLOW_CUSTOMIZATION]
918
+ }] }]; } });
919
+
920
+ class CatalogModule {
921
+ }
922
+ CatalogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
923
+ CatalogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogModule, declarations: [CatalogComponent], imports: [CommonModule, PreviewModule, LoaderModule], exports: [CatalogComponent] });
924
+ CatalogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogModule, imports: [[CommonModule, PreviewModule, LoaderModule]] });
925
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogModule, decorators: [{
926
+ type: NgModule,
927
+ args: [{
928
+ declarations: [CatalogComponent],
929
+ imports: [CommonModule, PreviewModule, LoaderModule],
930
+ exports: [CatalogComponent],
931
+ }]
932
+ }] });
933
+
934
+ const getFlowObjectIdPropertyName = (objectName) => {
935
+ switch (objectName) {
936
+ case 'Account':
937
+ return 'accountId';
938
+ case 'Order':
939
+ return 'orderId';
940
+ case 'Quote':
941
+ default:
942
+ return 'quoteId';
943
+ }
944
+ };
945
+
946
+ class DebugComponent {
947
+ constructor(flowsApiService, router, activatedRoute, context, flowConfiguration, quoteDraftService) {
948
+ this.flowsApiService = flowsApiService;
949
+ this.router = router;
950
+ this.activatedRoute = activatedRoute;
951
+ this.context = context;
952
+ this.flowConfiguration = flowConfiguration;
953
+ this.quoteDraftService = quoteDraftService;
954
+ this.objectNames = ['Account', 'Quote', 'Order'];
955
+ this.form = new FormGroup({
956
+ id: new FormControl(''),
957
+ name: new FormControl('Quote'),
958
+ });
959
+ this.flows$ = this.flowsApiService.fetchFlows().pipe(map(flows => flows.map(flow => {
960
+ var _a, _b, _c;
961
+ const queryParams = (_b = (_a = flow === null || flow === void 0 ? void 0 : flow.properties) === null || _a === void 0 ? void 0 : _a.queryParams) !== null && _b !== void 0 ? _b : {};
962
+ return {
963
+ id: flow.id,
964
+ entryPath: (_c = flow === null || flow === void 0 ? void 0 : flow.properties) === null || _c === void 0 ? void 0 : _c.entryPath,
965
+ queryParams,
966
+ queryParamsStr: JSON.stringify(queryParams),
967
+ };
968
+ })), shareReplay());
969
+ }
970
+ runFlow() {
971
+ const { id, name } = this.form.value;
972
+ const objectPropertyName = getFlowObjectIdPropertyName(name);
973
+ if (!id || !this.selectedFlow) {
974
+ return;
975
+ }
976
+ // Delete context before starting a new flow
977
+ this.context.delete();
978
+ this.quoteDraftService.reset();
979
+ this.router.navigate(['..', 'flows'], {
980
+ queryParams: Object.assign({ flowId: this.selectedFlow.id, [objectPropertyName]: id }, this.selectedFlow.queryParams),
981
+ relativeTo: this.activatedRoute,
982
+ });
983
+ }
984
+ }
985
+ DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DebugComponent, deps: [{ token: i1$2.FlowsApiService }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i2$1.ContextService }, { token: i2$1.FlowConfigurationService }, { token: i2$1.QuoteDraftService }], target: i0.ɵɵFactoryTarget.Component });
986
+ DebugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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\n <div class=\"field\">\n <label>SF Object Name</label>\n <p-dropdown\n appendTo=\"body\"\n formControlName=\"name\"\n [autoDisplayFirst]=\"false\"\n [options]=\"objectNames\"\n ></p-dropdown>\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 </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.entryPath }}</td>\n <td>{{ flow.queryParamsStr }}</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;grid-gap:24px;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}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}\n"], components: [{ type: i4$1.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }, { type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i6.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }], directives: [{ type: i7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i8.InputText, selector: "[pInputText]" }, { type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
987
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DebugComponent, decorators: [{
988
+ type: Component,
989
+ args: [{
990
+ selector: 'vl-flow-debug',
991
+ templateUrl: './debug.component.html',
992
+ styleUrls: ['./debug.component.scss'],
993
+ changeDetection: ChangeDetectionStrategy.OnPush,
994
+ }]
995
+ }], ctorParameters: function () { return [{ type: i1$2.FlowsApiService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i2$1.ContextService }, { type: i2$1.FlowConfigurationService }, { type: i2$1.QuoteDraftService }]; } });
996
+
997
+ const routes$1 = [{ path: '', component: DebugComponent }];
998
+ class DebugModule {
999
+ }
1000
+ DebugModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DebugModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1001
+ DebugModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DebugModule, declarations: [DebugComponent], imports: [CommonModule,
1002
+ FormsModule,
1003
+ ReactiveFormsModule, i1$1.RouterModule, RadioButtonModule,
1004
+ ButtonModule,
1005
+ InputTextModule,
1006
+ DropdownModule] });
1007
+ DebugModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DebugModule, imports: [[
1008
+ CommonModule,
1009
+ FormsModule,
1010
+ ReactiveFormsModule,
1011
+ RouterModule.forChild(routes$1),
1012
+ RadioButtonModule,
1013
+ ButtonModule,
1014
+ InputTextModule,
1015
+ DropdownModule,
1016
+ ]] });
1017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DebugModule, decorators: [{
1018
+ type: NgModule,
1019
+ args: [{
1020
+ declarations: [DebugComponent],
1021
+ imports: [
1022
+ CommonModule,
1023
+ FormsModule,
1024
+ ReactiveFormsModule,
1025
+ RouterModule.forChild(routes$1),
1026
+ RadioButtonModule,
1027
+ ButtonModule,
1028
+ InputTextModule,
1029
+ DropdownModule,
1030
+ ],
1031
+ }]
1032
+ }] });
1033
+
1034
+ class LegacyProductComponent {
1035
+ constructor(route, quoteDraftService, quoteApiService, contextService, runtimeContextService, runtimeService, currentStateService, customizationService) {
1036
+ this.route = route;
1037
+ this.quoteDraftService = quoteDraftService;
1038
+ this.quoteApiService = quoteApiService;
1039
+ this.contextService = contextService;
1040
+ this.runtimeContextService = runtimeContextService;
1041
+ this.runtimeService = runtimeService;
1042
+ this.currentStateService = currentStateService;
1043
+ this.customizationService = customizationService;
1044
+ this.destroyed$ = new Subject();
1045
+ }
1046
+ ngOnInit() {
1047
+ this.quoteDraftService.quote$
1048
+ .pipe(first(), takeUntil$1(this.destroyed$))
1049
+ .subscribe(quote => this.init(quote, this.route.snapshot.queryParams));
1050
+ this.runtimeService.onSolutionStopEvent.pipe(take(1)).subscribe(lineItem => this.onSolutionStop(lineItem));
1051
+ this.runtimeService.onSolutionReadyEvent.pipe(take(1)).subscribe(event => this.onSolutionReady(event));
1052
+ this.runtimeService.onSolutionCancelEvent.pipe(take(1)).subscribe(() => this.onSolutionCancel());
1053
+ }
1054
+ ngOnDestroy() {
1055
+ this.destroyed$.next();
1056
+ this.destroyed$.complete();
1057
+ }
1058
+ onSolutionReady(lineItem) {
1059
+ var _a;
1060
+ lineItem.actionCode = (_a = lineItem.actionCode) !== null && _a !== void 0 ? _a : 'ADD';
1061
+ }
1062
+ onSolutionCancel() {
1063
+ this.quoteDraftService.quote$.pipe(first(), takeUntil$1(this.destroyed$)).subscribe(quote => {
1064
+ window['VELO_BACK_FN'].apply(null, [quote.quoteId]);
1065
+ });
1066
+ }
1067
+ onSolutionUpdated(lineItem) {
1068
+ const states = {
1069
+ configurableRamp: lineItem,
1070
+ currentState: this.currentStateService.currentState,
1071
+ asset: this.getAsset(lineItem),
1072
+ };
1073
+ this.runtimeService.updateRuntime(states);
1074
+ }
1075
+ onSolutionStop(lineItem) {
1076
+ this.quoteDraftService.quote$.pipe(first(), takeUntil$1(this.destroyed$)).subscribe(quote => {
1077
+ const quoteToUpsert = Object.assign(Object.assign({}, quote), { context: this.contextService.resolve(), currentState: [...(this.currentStateService.currentState || []).filter(li => li.id !== lineItem.id), lineItem] });
1078
+ this.quoteApiService
1079
+ .upsertQuote(quoteToUpsert)
1080
+ .pipe(take(1))
1081
+ .subscribe(quote => {
1082
+ window['VELO_BACK_FN'].apply(null, [quote.quoteId]);
1083
+ });
1084
+ });
1085
+ }
1086
+ init(quote, queryParams) {
1087
+ const productId = queryParams['productId'];
1088
+ const lineItemId = this.getLineItemId(quote, queryParams);
1089
+ this.assets = quote.initialState;
1090
+ lineItemId && quote.currentState ? this.reConfigure(lineItemId, quote.currentState) : this.configure(productId);
1091
+ }
1092
+ getLineItemId(quote, queryParams) {
1093
+ if (EntityUtil.isPresent(queryParams['lineItemId'])) {
1094
+ return queryParams['lineItemId'];
1095
+ }
1096
+ return quote.currentState
1097
+ .filter(lineItem => lineItem.productId === queryParams['productId'])
1098
+ .map(lineItem => lineItem.id)
1099
+ .find(id => id);
1100
+ }
1101
+ configure(productId) {
1102
+ const runtimeContext = this.getRuntimeContext(productId, '', RuntimeOperation.INIT);
1103
+ this.startRuntime({}, runtimeContext);
1104
+ }
1105
+ reConfigure(lineItemId, currentState) {
1106
+ const currentStateItem = EntityUtil.findById(lineItemId, currentState);
1107
+ const runtimeContext = this.getRuntimeContext(currentStateItem.productId, currentStateItem.offeringId, RuntimeOperation.UPDATE);
1108
+ const states = {
1109
+ configurableRamp: currentStateItem,
1110
+ currentState,
1111
+ asset: this.getAsset(currentStateItem),
1112
+ };
1113
+ this.currentStateService.update(currentState);
1114
+ this.startRuntime(states, runtimeContext);
1115
+ }
1116
+ getAsset(lineItem) {
1117
+ return this.assets && this.assets.find(a => a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId);
1118
+ }
1119
+ startRuntime(states, runtimeContext$) {
1120
+ runtimeContext$
1121
+ .pipe(take(1), map$1(runtimeContext => {
1122
+ this.runtimeService.startRuntime(runtimeContext, states);
1123
+ }))
1124
+ .subscribe();
1125
+ }
1126
+ customizeContext(productId, context) {
1127
+ var _a;
1128
+ if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getLegacyUiDefinition)) {
1129
+ return of(context);
1130
+ }
1131
+ return this.customizationService.getLegacyUiDefinition(productId).pipe(map$1(uiDef => (Object.assign(Object.assign({}, context), { uiDefinition: uiDef !== null && uiDef !== void 0 ? uiDef : context.uiDefinition }))));
1132
+ }
1133
+ getRuntimeContext(productId, offeringId, runtimeOperation) {
1134
+ return this.runtimeContextService.getRuntimeContext(productId, offeringId).pipe(map$1(runtimeContext => {
1135
+ runtimeContext.invocationContext = { runtimeOperation: RuntimeOperation[runtimeOperation] };
1136
+ return runtimeContext;
1137
+ }), switchMap$1(runtimeContext => this.customizeContext(productId, runtimeContext)));
1138
+ }
1139
+ }
1140
+ LegacyProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i2$1.QuoteDraftService }, { token: i1$2.QuoteApiService }, { token: i2$1.ContextService }, { token: i4$2.RuntimeContextService }, { token: i4$2.RuntimeService }, { token: i4$2.CurrentStateService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1141
+ LegacyProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: LegacyProductComponent, selector: "ng-component", ngImport: i0, template: "<vl-runtime #runtimeView (solutionUpdated)=\"onSolutionUpdated($event)\"></vl-runtime>\n", styles: [":host{display:block;height:100%}\n"], components: [{ type: i4$2.RuntimeComponent, selector: "vl-runtime", outputs: ["solutionUpdated"] }] });
1142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductComponent, decorators: [{
1143
+ type: Component,
1144
+ args: [{
1145
+ templateUrl: './legacy-product.component.html',
1146
+ styleUrls: ['./legacy-product.component.scss'],
1147
+ }]
1148
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i2$1.QuoteDraftService }, { type: i1$2.QuoteApiService }, { type: i2$1.ContextService }, { type: i4$2.RuntimeContextService }, { type: i4$2.RuntimeService }, { type: i4$2.CurrentStateService }, { type: undefined, decorators: [{
1149
+ type: Optional
1150
+ }, {
1151
+ type: Inject,
1152
+ args: [FLOW_CUSTOMIZATION]
1153
+ }] }]; } });
1154
+
1155
+ class LegacyProductModule {
1156
+ }
1157
+ LegacyProductModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1158
+ LegacyProductModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductModule, declarations: [LegacyProductComponent], imports: [CommonModule, RuntimeModule, i1$3.TooltipModule], exports: [LegacyProductComponent] });
1159
+ LegacyProductModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductModule, imports: [[CommonModule, RuntimeModule, TooltipModule$1.forRoot()]] });
1160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductModule, decorators: [{
1161
+ type: NgModule,
1162
+ args: [{
1163
+ declarations: [LegacyProductComponent],
1164
+ imports: [CommonModule, RuntimeModule, TooltipModule$1.forRoot()],
1165
+ exports: [LegacyProductComponent],
1166
+ }]
1167
+ }] });
1168
+
1169
+ class ProductComponent {
1170
+ constructor(contextService, runtimeService, conigurationService, quoteDraftService, messageService, customizationService) {
1171
+ this.contextService = contextService;
1172
+ this.runtimeService = runtimeService;
1173
+ this.conigurationService = conigurationService;
1174
+ this.quoteDraftService = quoteDraftService;
1175
+ this.messageService = messageService;
1176
+ this.customizationService = customizationService;
1177
+ this.destroy$ = new Subject();
1178
+ this.state$ = new BehaviorSubject({ loading: true, failure: false });
1179
+ }
1180
+ ngOnInit() {
1181
+ this.quoteDraftService.quote$.pipe(first$1(), takeUntil(this.destroy$)).subscribe(quote => this.init(quote));
1182
+ }
1183
+ ngOnDestroy() {
1184
+ this.destroy$.next();
1185
+ this.destroy$.complete();
1186
+ }
1187
+ customize(productId) {
1188
+ var _a;
1189
+ if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getUiDefinition)) {
1190
+ return of(null);
1191
+ }
1192
+ return this.customizationService.getUiDefinition(productId).pipe(tap(uiDef => {
1193
+ var _a;
1194
+ if (uiDef) {
1195
+ this.uiDefinition = uiDef;
1196
+ this.runtimeService.uiDefinitionProperties = (_a = uiDef.properties) !== null && _a !== void 0 ? _a : {};
1197
+ }
1198
+ }));
1199
+ }
1200
+ init(quote) {
1201
+ const contextProperties = this.contextService.resolve().properties;
1202
+ const productId = contextProperties.productId;
1203
+ if (!productId) {
1204
+ return;
1205
+ }
1206
+ const lineItemId = this.getLineItemId(quote, productId, contextProperties.lineItemId);
1207
+ const currentStateItem = EntityUtil.findById(lineItemId, quote.currentState);
1208
+ const { offeringId } = currentStateItem !== null && currentStateItem !== void 0 ? currentStateItem : {};
1209
+ if (currentStateItem) {
1210
+ this.conigurationService.updateCurrentStates({
1211
+ configurableRamp: currentStateItem,
1212
+ currentState: quote.currentState,
1213
+ });
1214
+ }
1215
+ this.runtimeService
1216
+ .init({ productId, offeringId })
1217
+ .pipe(tap(context => (this.uiDefinition = context === null || context === void 0 ? void 0 : context.uiDefinition)), switchMap(() => this.customize(productId)), switchMap(() => this.conigurationService.configure()), tap(() => this.state$.next({ loading: false, failure: false })), catchError(error => {
1218
+ var _a, _b;
1219
+ if (!((_b = (_a = this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
1220
+ this.messageService.add({ severity: 'error', summary: error });
1221
+ }
1222
+ this.state$.next({ loading: false, failure: true });
1223
+ return of();
1224
+ }), takeUntil(this.destroy$))
1225
+ .subscribe();
1226
+ }
1227
+ getLineItemId(quote, productId, lineItemId) {
1228
+ var _a, _b;
1229
+ // search by lineItemId first
1230
+ let id = (_a = quote.currentState.find(li => li.id === lineItemId)) === null || _a === void 0 ? void 0 : _a.id;
1231
+ if (!id) {
1232
+ id = (_b = quote.currentState.find(li => li.productId === productId)) === null || _b === void 0 ? void 0 : _b.id;
1233
+ }
1234
+ return id;
1235
+ }
1236
+ }
1237
+ ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductComponent, deps: [{ token: i2$1.ContextService }, { token: i2$1.ConfigurationRuntimeService }, { token: i2$1.ConfigurationService }, { token: i2$1.QuoteDraftService }, { token: i2$2.MessageService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1238
+ ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: ProductComponent, selector: "vl-flow-product", 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: [""], components: [{ type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: i4.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "clearState"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1239
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductComponent, decorators: [{
1240
+ type: Component,
1241
+ args: [{
1242
+ selector: 'vl-flow-product',
1243
+ templateUrl: './product.component.html',
1244
+ styleUrls: ['./product.component.scss'],
1245
+ changeDetection: ChangeDetectionStrategy.OnPush,
1246
+ }]
1247
+ }], ctorParameters: function () { return [{ type: i2$1.ContextService }, { type: i2$1.ConfigurationRuntimeService }, { type: i2$1.ConfigurationService }, { type: i2$1.QuoteDraftService }, { type: i2$2.MessageService }, { type: undefined, decorators: [{
1248
+ type: Optional
1249
+ }, {
1250
+ type: Inject,
1251
+ args: [FLOW_CUSTOMIZATION]
1252
+ }] }]; } });
1253
+
1254
+ class ProductModule {
1255
+ }
1256
+ ProductModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1257
+ ProductModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductModule, declarations: [ProductComponent], imports: [CommonModule, PreviewModule, LoaderModule], exports: [ProductComponent] });
1258
+ ProductModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductModule, imports: [[CommonModule, PreviewModule, LoaderModule]] });
1259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductModule, decorators: [{
1260
+ type: NgModule,
1261
+ args: [{
1262
+ declarations: [ProductComponent],
1263
+ imports: [CommonModule, PreviewModule, LoaderModule],
1264
+ exports: [ProductComponent],
1265
+ }]
1266
+ }] });
1267
+
1268
+ class RecordNotFoundComponent {
1269
+ constructor(router, route) {
1270
+ this.router = router;
1271
+ this.route = route;
1272
+ this.subMessage = '';
1273
+ const navigation = this.router.getCurrentNavigation();
1274
+ const { state } = (navigation === null || navigation === void 0 ? void 0 : navigation.extras) || {};
1275
+ this.message = state === null || state === void 0 ? void 0 : state.message;
1276
+ if (typeof this.message === 'string') {
1277
+ this.subMessage = this.message.includes('/describe') ? 'A potential problem with permissions' : '';
1278
+ }
1279
+ }
1280
+ }
1281
+ RecordNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RecordNotFoundComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
1282
+ RecordNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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"], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1283
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RecordNotFoundComponent, decorators: [{
1284
+ type: Component,
1285
+ args: [{
1286
+ selector: 'vl-flow-record-not-found',
1287
+ templateUrl: './record-not-found.component.html',
1288
+ styleUrls: ['./record-not-found.component.scss'],
1289
+ changeDetection: ChangeDetectionStrategy.OnPush,
1290
+ }]
1291
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
1292
+
1293
+ const routes = [{ path: '', component: RecordNotFoundComponent }];
1294
+ class RecordNotFoundModule {
1295
+ }
1296
+ RecordNotFoundModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RecordNotFoundModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1297
+ RecordNotFoundModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RecordNotFoundModule, declarations: [RecordNotFoundComponent], imports: [CommonModule, i1$1.RouterModule] });
1298
+ RecordNotFoundModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RecordNotFoundModule, imports: [[CommonModule, RouterModule.forChild(routes)]] });
1299
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RecordNotFoundModule, decorators: [{
1300
+ type: NgModule,
1301
+ args: [{
1302
+ declarations: [RecordNotFoundComponent],
1303
+ imports: [CommonModule, RouterModule.forChild(routes)],
1304
+ }]
1305
+ }] });
1306
+
1307
+ class ShoppingCartComponent {
1308
+ constructor(templatesApi, contextService, cdr, toastService, customizationService) {
1309
+ var _a;
1310
+ this.templatesApi = templatesApi;
1311
+ this.contextService = contextService;
1312
+ this.cdr = cdr;
1313
+ this.toastService = toastService;
1314
+ this.customizationService = customizationService;
1315
+ this.uiDefinition = undefined;
1316
+ this.state$ = new BehaviorSubject({ loading: true, failure: false });
1317
+ this.templateApiName = '';
1318
+ this.destroyed$ = new Subject();
1319
+ this.templateApiName = (_a = this.contextService.resolve().properties.cartTemplateApiName) !== null && _a !== void 0 ? _a : '';
1320
+ }
1321
+ ngOnInit() {
1322
+ this.generateUIDefinition$()
1323
+ .pipe(tap(uiDef => {
1324
+ if (!uiDef) {
1325
+ throw new Error(`Component with name '${this.templateApiName}' not found.`);
1326
+ }
1327
+ this.uiDefinition = uiDef;
1328
+ this.state$.next({ loading: false, failure: false });
1329
+ }), catchError(err => {
1330
+ var _a;
1331
+ const message = 'Failed to resolve Shopping cart component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
1332
+ this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
1333
+ this.uiDefinition = undefined;
1334
+ this.state$.next({ loading: false, failure: true });
1335
+ return of();
1336
+ }), takeUntil(this.destroyed$))
1337
+ .subscribe(() => this.cdr.detectChanges());
1338
+ }
1339
+ ngOnDestroy() {
1340
+ this.destroyed$.next();
1341
+ this.destroyed$.complete();
1342
+ }
1343
+ getTemplateRootComponent$(template) {
1344
+ return this.templatesApi
1345
+ .fetchComponents$(template.id)
1346
+ .pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
1347
+ }
1348
+ getLocalShoppingCartComponentMeta$() {
1349
+ var _a, _b;
1350
+ if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getShoppingCartComponent)) {
1351
+ return of(undefined);
1352
+ }
1353
+ return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getShoppingCartComponent(this.templateApiName).pipe(map(component => {
1354
+ if (!component) {
1355
+ return;
1356
+ }
1357
+ return {
1358
+ html: component.html,
1359
+ css: component.css,
1360
+ js: component.js,
1361
+ json: component.json,
1362
+ };
1363
+ }));
1364
+ }
1365
+ getShoppingCartComponentMeta$() {
1366
+ return this.templatesApi.fetchTemplates$().pipe(map(templates => templates.find(template => template.type === UITemplateType.SHOPPING_CART && template.name === this.templateApiName)), switchMap(template => (template ? this.getTemplateRootComponent$(template) : of(undefined))), switchMap(component => component ? this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : of(undefined)));
1367
+ }
1368
+ generateUIDefinition$() {
1369
+ return of(undefined).pipe(tap(() => {
1370
+ if (!this.templateApiName) {
1371
+ throw new Error("Flow Query parameter 'cartTemplateApiName' is missing.");
1372
+ }
1373
+ }), switchMap(() => this.getLocalShoppingCartComponentMeta$()), switchMap(meta => (meta ? of(meta) : this.getShoppingCartComponentMeta$())), map(meta => {
1374
+ if (!meta) {
1375
+ return;
1376
+ }
1377
+ const uiDef = {
1378
+ name: '',
1379
+ createdTimestamp: 0,
1380
+ primary: true,
1381
+ type: 'DEFAULT',
1382
+ version: 2,
1383
+ children: [
1384
+ {
1385
+ children: [],
1386
+ template: meta.html && btoa(meta.html),
1387
+ script: meta.js && btoa(meta.js),
1388
+ styles: meta.css && btoa(meta.css),
1389
+ },
1390
+ ],
1391
+ };
1392
+ return uiDef;
1393
+ }));
1394
+ }
1395
+ }
1396
+ ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i1$2.UITemplatesApiService }, { token: i2$1.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1397
+ ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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: [""], components: [{ type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: i4.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "clearState"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1398
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ShoppingCartComponent, decorators: [{
1399
+ type: Component,
1400
+ args: [{
1401
+ selector: 'vl-flow-shopping-cart',
1402
+ templateUrl: './shopping-cart.component.html',
1403
+ styleUrls: ['./shopping-cart.component.scss'],
1404
+ changeDetection: ChangeDetectionStrategy.OnPush,
1405
+ }]
1406
+ }], ctorParameters: function () { return [{ type: i1$2.UITemplatesApiService }, { type: i2$1.ContextService }, { type: i0.ChangeDetectorRef }, { type: i3$1.ToastService }, { type: undefined, decorators: [{
1407
+ type: Optional
1408
+ }, {
1409
+ type: Inject,
1410
+ args: [FLOW_CUSTOMIZATION]
1411
+ }] }]; } });
1412
+
1413
+ class ShoppingCartModule {
1414
+ }
1415
+ ShoppingCartModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ShoppingCartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1416
+ ShoppingCartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ShoppingCartModule, declarations: [ShoppingCartComponent], imports: [CommonModule, PreviewModule, LoaderModule], exports: [ShoppingCartComponent] });
1417
+ ShoppingCartModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ShoppingCartModule, imports: [[CommonModule, PreviewModule, LoaderModule]] });
1418
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ShoppingCartModule, decorators: [{
1419
+ type: NgModule,
1420
+ args: [{
1421
+ declarations: [ShoppingCartComponent],
1422
+ imports: [CommonModule, PreviewModule, LoaderModule],
1423
+ exports: [ShoppingCartComponent],
1424
+ }]
1425
+ }] });
1426
+
1427
+ class FlowResolver {
1428
+ constructor(router, flowsApiService, routerService) {
1429
+ this.router = router;
1430
+ this.flowsApiService = flowsApiService;
1431
+ this.routerService = routerService;
1432
+ }
1433
+ handleError(route, message, queryParams) {
1434
+ const parentUrl = this.routerService.getFlowRootPath(route);
1435
+ return this.router.navigate([parentUrl, '404'], {
1436
+ queryParams,
1437
+ state: {
1438
+ message: message,
1439
+ },
1440
+ });
1441
+ }
1442
+ resolve(route) {
1443
+ const { queryParams } = route;
1444
+ const { flowId } = queryParams;
1445
+ if (!flowId) {
1446
+ return this.handleError(route);
1447
+ }
1448
+ return this.flowsApiService.getFlow(flowId).pipe(map$1(flow => {
1449
+ if (!flow) {
1450
+ return this.handleError(route, `Flow with flowId=${flowId} is not defined`);
1451
+ }
1452
+ const { properties } = flow;
1453
+ const { queryParams: flowQueryParams, entryPath } = properties;
1454
+ const isProductFlow = entryPath.includes('/product');
1455
+ const mergedParams = Object.assign(Object.assign(Object.assign({}, queryParams), flowQueryParams), Object.assign({}, (isProductFlow && { standalone: true })));
1456
+ const parentUrl = this.routerService.getFlowRootPath(route);
1457
+ const entryUrl = String(entryPath !== null && entryPath !== void 0 ? entryPath : '')
1458
+ .split('/')
1459
+ .filter(Boolean);
1460
+ return this.router
1461
+ .navigate([parentUrl, ...entryUrl], {
1462
+ queryParams: mergedParams,
1463
+ replaceUrl: true,
1464
+ })
1465
+ .catch(e => {
1466
+ const message = e instanceof HttpErrorResponse ? e.error.message : e;
1467
+ return this.handleError(route, message, mergedParams);
1468
+ });
1469
+ }));
1470
+ }
1471
+ }
1472
+ FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowResolver, deps: [{ token: i1$1.Router }, { token: i1$2.FlowsApiService }, { token: FlowRouterService }], target: i0.ɵɵFactoryTarget.Injectable });
1473
+ FlowResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowResolver });
1474
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowResolver, decorators: [{
1475
+ type: Injectable
1476
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$2.FlowsApiService }, { type: FlowRouterService }]; } });
1477
+
1478
+ class QuoteResolver {
1479
+ constructor(router, quoteDraftService, routerService, contextService, flowConfiguration) {
1480
+ this.router = router;
1481
+ this.quoteDraftService = quoteDraftService;
1482
+ this.routerService = routerService;
1483
+ this.contextService = contextService;
1484
+ this.flowConfiguration = flowConfiguration;
1485
+ }
1486
+ handleError(route, message) {
1487
+ const parentUrl = this.routerService.getFlowRootPath(route);
1488
+ return from(this.router.navigate([parentUrl, '404'], { state: { message } }));
1489
+ }
1490
+ initFlow$() {
1491
+ if (this.quoteDraftService.isStandalone) {
1492
+ return of(undefined);
1493
+ }
1494
+ return this.flowConfiguration.initialize$();
1495
+ }
1496
+ resolve(route) {
1497
+ const { headerId } = this.contextService.resolve();
1498
+ const quote = this.quoteDraftService.quoteSnapshot;
1499
+ if (quote && quote.quoteId === headerId) {
1500
+ return of(true);
1501
+ }
1502
+ const { queryParams } = route;
1503
+ this.contextService.update({ properties: queryParams });
1504
+ return this.quoteDraftService.init(headerId, queryParams).pipe(switchMap(() => this.initFlow$()), catchError(e => {
1505
+ const message = e instanceof HttpErrorResponse ? e.error.message : e;
1506
+ return this.handleError(route, message);
1507
+ }));
1508
+ }
1509
+ }
1510
+ QuoteResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: QuoteResolver, deps: [{ token: i1$1.Router }, { token: i2$1.QuoteDraftService }, { token: FlowRouterService }, { token: i2$1.ContextService }, { token: i2$1.FlowConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable });
1511
+ QuoteResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: QuoteResolver });
1512
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: QuoteResolver, decorators: [{
1513
+ type: Injectable
1514
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i2$1.QuoteDraftService }, { type: FlowRouterService }, { type: i2$1.ContextService }, { type: i2$1.FlowConfigurationService }]; } });
1515
+
1516
+ const rootRoute = {
1517
+ id: VELOCE_FLOW_ROOT_ROUTE,
1518
+ path: '',
1519
+ component: FlowComponent,
1520
+ canActivate: [RootGuard],
1521
+ canDeactivate: [RootGuard],
1522
+ children: [
1523
+ {
1524
+ path: 'flows',
1525
+ runGuardsAndResolvers: 'paramsOrQueryParamsChange',
1526
+ resolve: { quote: FlowResolver },
1527
+ canActivate: [ContextGuard],
1528
+ children: [],
1529
+ },
1530
+ {
1531
+ path: 'legacy',
1532
+ children: [
1533
+ {
1534
+ path: 'product',
1535
+ component: LegacyProductComponent,
1536
+ runGuardsAndResolvers: 'paramsOrQueryParamsChange',
1537
+ resolve: { quote: QuoteResolver },
1538
+ canActivate: [ContextGuard],
1539
+ },
1540
+ ],
1541
+ },
1542
+ {
1543
+ path: 'product',
1544
+ component: ProductComponent,
1545
+ runGuardsAndResolvers: 'paramsOrQueryParamsChange',
1546
+ resolve: { quote: QuoteResolver },
1547
+ canActivate: [ContextGuard],
1548
+ canDeactivate: [ProductUnloadGuard],
1549
+ data: { showHeader: true },
1550
+ },
1551
+ {
1552
+ path: 'cart',
1553
+ component: ShoppingCartComponent,
1554
+ runGuardsAndResolvers: 'paramsOrQueryParamsChange',
1555
+ resolve: { quote: QuoteResolver },
1556
+ canActivate: [ContextGuard],
1557
+ data: { showHeader: true },
1558
+ },
1559
+ {
1560
+ path: 'catalog',
1561
+ component: CatalogComponent,
1562
+ runGuardsAndResolvers: 'paramsOrQueryParamsChange',
1563
+ resolve: { quote: QuoteResolver },
1564
+ canActivate: [ContextGuard],
1565
+ data: { showHeader: true },
1566
+ },
1567
+ {
1568
+ path: 'debug',
1569
+ loadChildren: () => DebugModule,
1570
+ },
1571
+ {
1572
+ path: '404',
1573
+ loadChildren: () => RecordNotFoundModule,
1574
+ },
1575
+ ],
1576
+ };
1577
+ class FlowRoutingModule {
1578
+ }
1579
+ FlowRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1580
+ FlowRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRoutingModule, imports: [i1$1.RouterModule, ProductModule, LegacyProductModule, ShoppingCartModule, CatalogModule], exports: [RouterModule] });
1581
+ FlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRoutingModule, providers: [FlowRouterService, RootGuard, ContextGuard, ProductUnloadGuard, FlowResolver, QuoteResolver], imports: [[RouterModule.forChild([rootRoute]), ProductModule, LegacyProductModule, ShoppingCartModule, CatalogModule], RouterModule] });
1582
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRoutingModule, decorators: [{
1583
+ type: NgModule,
1584
+ args: [{
1585
+ imports: [RouterModule.forChild([rootRoute]), ProductModule, LegacyProductModule, ShoppingCartModule, CatalogModule],
1586
+ exports: [RouterModule],
1587
+ providers: [FlowRouterService, RootGuard, ContextGuard, ProductUnloadGuard, FlowResolver, QuoteResolver],
1588
+ }]
1589
+ }] });
1590
+
1591
+ class FlowModule {
1592
+ }
1593
+ FlowModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1594
+ FlowModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowModule, declarations: [FlowComponent], imports: [CommonModule,
1595
+ FlowRoutingModule,
1596
+ ApiModule,
1597
+ LauncherModule,
1598
+ LoaderModule,
1599
+ FlowHeaderModule,
1600
+ FlowDialogModule,
1601
+ SdkCoreModule] });
1602
+ FlowModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowModule, providers: [FlowService, FlowDialogService], imports: [[
1603
+ CommonModule,
1604
+ FlowRoutingModule,
1605
+ ApiModule,
1606
+ LauncherModule,
1607
+ LoaderModule,
1608
+ FlowHeaderModule,
1609
+ FlowDialogModule,
1610
+ SdkCoreModule,
1611
+ ]] });
1612
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowModule, decorators: [{
1613
+ type: NgModule,
1614
+ args: [{
1615
+ declarations: [FlowComponent],
1616
+ imports: [
1617
+ CommonModule,
1618
+ FlowRoutingModule,
1619
+ ApiModule,
1620
+ LauncherModule,
1621
+ LoaderModule,
1622
+ FlowHeaderModule,
1623
+ FlowDialogModule,
1624
+ SdkCoreModule,
1625
+ ],
1626
+ providers: [FlowService, FlowDialogService],
1627
+ }]
1628
+ }] });
1629
+
1630
+ /**
1631
+ * Generated bundle index. Do not edit.
1632
+ */
1633
+
1634
+ export { ContextGuard, FLOW_CUSTOMIZATION, FlowModule, FlowService, VELOCE_FLOW_ROOT_ROUTE, getFlowObjectIdPropertyName };
1635
+ //# sourceMappingURL=veloce-sdk.js.map