@veloceapps/sdk 12.0.0-13 → 12.0.0-14
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.
- package/cms/index.d.ts +921 -15
- package/core/index.d.ts +525 -8
- package/fesm2022/veloceapps-sdk-cms.mjs +2617 -0
- package/fesm2022/veloceapps-sdk-cms.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/veloceapps-sdk-core.mjs +117 -112
- package/fesm2022/veloceapps-sdk-core.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/veloceapps-sdk.mjs +170 -170
- package/fesm2022/veloceapps-sdk.mjs.map +1 -0
- package/index.d.ts +330 -1
- package/package.json +17 -34
- package/cms/cms.actions.d.ts +0 -154
- package/cms/cms.default.d.ts +0 -5
- package/cms/cms.elements.d.ts +0 -4
- package/cms/cms.layouts.d.ts +0 -4
- package/cms/components/element-children/element-children.component.d.ts +0 -22
- package/cms/components/element-children/element-children.module.d.ts +0 -11
- package/cms/components/element-drop-handle/element-drop-handle.component.d.ts +0 -12
- package/cms/components/element-drop-handle/element-drop-handle.module.d.ts +0 -9
- package/cms/components/element-renderer/element-renderer.component.d.ts +0 -29
- package/cms/components/element-renderer/element-renderer.module.d.ts +0 -7
- package/cms/components/element-tools-panel/element-tools-panel.component.d.ts +0 -14
- package/cms/components/element.component.d.ts +0 -17
- package/cms/components/index.d.ts +0 -1
- package/cms/components/plugin.component.d.ts +0 -15
- package/cms/components/preview/index.d.ts +0 -3
- package/cms/components/preview/preview.component.d.ts +0 -32
- package/cms/components/preview/preview.module.d.ts +0 -13
- package/cms/components/preview/preview.types.d.ts +0 -20
- package/cms/decorators/element.decorator.d.ts +0 -2
- package/cms/decorators/index.d.ts +0 -1
- package/cms/definitions/index.d.ts +0 -1
- package/cms/definitions/ui-builder.definitions.d.ts +0 -6
- package/cms/directives/custom-template.directive.d.ts +0 -17
- package/cms/engine/models/entity.d.ts +0 -11
- package/cms/engine/models/plugin.d.ts +0 -5
- package/cms/injection-tokens.d.ts +0 -9
- package/cms/launcher.module.d.ts +0 -12
- package/cms/modules/federated/default-options.d.ts +0 -4
- package/cms/modules/federated/export.d.ts +0 -1
- package/cms/modules/federated/federated-host.directive.d.ts +0 -8
- package/cms/modules/federated/federated.component.d.ts +0 -25
- package/cms/modules/federated/federated.module.d.ts +0 -10
- package/cms/modules/federated/federated.types.d.ts +0 -26
- package/cms/modules/migrations/index.d.ts +0 -2
- package/cms/modules/migrations/migrations.d.ts +0 -2
- package/cms/modules/migrations/migrations.module.d.ts +0 -6
- package/cms/modules/migrations/services/migrations.service.d.ts +0 -10
- package/cms/modules/migrations/types/migrations.types.d.ts +0 -2
- package/cms/modules/runtime/index.d.ts +0 -3
- package/cms/modules/runtime/runtime.module.d.ts +0 -8
- package/cms/modules/runtime/services/compilation.service.d.ts +0 -19
- package/cms/modules/runtime/services/runtime-editor.service.d.ts +0 -20
- package/cms/modules/runtime/services/runtime.service.d.ts +0 -33
- package/cms/modules/runtime/tokens.d.ts +0 -3
- package/cms/modules/runtime/types/compilation.types.d.ts +0 -8
- package/cms/modules/runtime/types/runtime.actions.d.ts +0 -12
- package/cms/plugins/element-hover.plugin.d.ts +0 -33
- package/cms/plugins/io.plugin.d.ts +0 -9
- package/cms/plugins/page.plugin.d.ts +0 -15
- package/cms/plugins/region.plugin.d.ts +0 -17
- package/cms/plugins/script.plugin.d.ts +0 -10
- package/cms/services/element-context.service.d.ts +0 -7
- package/cms/services/index.d.ts +0 -2
- package/cms/services/io-provider.service.d.ts +0 -15
- package/cms/services/resources.service.d.ts +0 -21
- package/cms/services/templates.service.d.ts +0 -14
- package/cms/types/common.types.d.ts +0 -130
- package/cms/types/elements.types.d.ts +0 -2
- package/cms/types/index.d.ts +0 -6
- package/cms/types/layouts.types.d.ts +0 -102
- package/cms/types/pages.types.d.ts +0 -1
- package/cms/types/path.types.d.ts +0 -11
- package/cms/utils/element-metadata-worker.d.ts +0 -11
- package/cms/utils/element.utils.d.ts +0 -20
- package/cms/utils/elements-resolver.d.ts +0 -28
- package/cms/utils/encoding.utils.d.ts +0 -2
- package/cms/utils/index.d.ts +0 -9
- package/cms/utils/inject.d.ts +0 -1
- package/cms/utils/path.utils.d.ts +0 -3
- package/cms/utils/script.utils.d.ts +0 -2
- package/cms/utils/transpilation-worker.d.ts +0 -13
- package/cms/utils/ui-builder-layout.utils.d.ts +0 -4
- package/cms/utils/ui-definition.utils.d.ts +0 -6
- package/cms/vendor-map.d.ts +0 -86
- package/core/core.module.d.ts +0 -10
- package/core/directives/directives.module.d.ts +0 -7
- package/core/directives/index.d.ts +0 -2
- package/core/directives/primeng-calendar.directive.d.ts +0 -14
- package/core/modules/configuration/configuration.module.d.ts +0 -8
- package/core/modules/configuration/index.d.ts +0 -6
- package/core/modules/configuration/services/configuration-runtime.service.d.ts +0 -19
- package/core/modules/configuration/services/configuration-state.service.d.ts +0 -60
- package/core/modules/configuration/services/configuration.service.d.ts +0 -38
- package/core/modules/configuration/services/guided-selling.service.d.ts +0 -15
- package/core/modules/configuration/services/test-mode-configuration.service.d.ts +0 -26
- package/core/modules/configuration/types/configuration-runtime.types.d.ts +0 -3
- package/core/modules/configuration/types/configuration.types.d.ts +0 -20
- package/core/modules/configuration/types/index.d.ts +0 -2
- package/core/modules/flow-configuration/flow-configuration.module.d.ts +0 -7
- package/core/modules/flow-configuration/index.d.ts +0 -1
- package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +0 -23
- package/core/modules/index.d.ts +0 -2
- package/core/operators/filter-successful-execute.operator.d.ts +0 -3
- package/core/operators/index.d.ts +0 -1
- package/core/pipes/action-code.pipe.d.ts +0 -8
- package/core/pipes/date.pipe.d.ts +0 -13
- package/core/pipes/index.d.ts +0 -5
- package/core/pipes/number.pipe.d.ts +0 -10
- package/core/pipes/pipes.module.d.ts +0 -10
- package/core/pipes/price.pipe.d.ts +0 -10
- package/core/services/catalog-products.service.d.ts +0 -11
- package/core/services/flow-info.service.d.ts +0 -44
- package/core/services/flow-state-configuration.service.d.ts +0 -25
- package/core/services/flow-state.service.d.ts +0 -70
- package/core/services/index.d.ts +0 -8
- package/core/services/integration.state.d.ts +0 -16
- package/core/services/product-images.service.d.ts +0 -12
- package/core/services/runtime-settings.service.d.ts +0 -24
- package/core/services/sales-transaction.service.d.ts +0 -27
- package/core/types/flow-customization.types.d.ts +0 -10
- package/core/types/flow-state.types.d.ts +0 -12
- package/core/types/formatting-settings.types.d.ts +0 -13
- package/core/types/index.d.ts +0 -5
- package/core/types/integration.types.d.ts +0 -10
- package/core/types/pipe.types.d.ts +0 -1
- package/core/types/ui-definition.types.d.ts +0 -1
- package/core/utils/index.d.ts +0 -4
- package/core/utils/pcm.utils.d.ts +0 -5
- package/core/utils/transaction-item.utils.d.ts +0 -10
- package/core/utils/transaction-item.worker.d.ts +0 -8
- package/core/utils/ui-definition.utils.d.ts +0 -2
- package/esm2020/cms/cms.actions.mjs +0 -151
- package/esm2020/cms/cms.default.mjs +0 -5
- package/esm2020/cms/cms.elements.mjs +0 -52
- package/esm2020/cms/cms.layouts.mjs +0 -239
- package/esm2020/cms/components/element-children/element-children.component.mjs +0 -41
- package/esm2020/cms/components/element-children/element-children.module.mjs +0 -21
- package/esm2020/cms/components/element-drop-handle/element-drop-handle.component.mjs +0 -28
- package/esm2020/cms/components/element-drop-handle/element-drop-handle.module.mjs +0 -19
- package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +0 -117
- package/esm2020/cms/components/element-renderer/element-renderer.module.mjs +0 -16
- package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +0 -35
- package/esm2020/cms/components/element.component.mjs +0 -45
- package/esm2020/cms/components/index.mjs +0 -2
- package/esm2020/cms/components/plugin.component.mjs +0 -17
- package/esm2020/cms/components/preview/index.mjs +0 -4
- package/esm2020/cms/components/preview/preview.component.mjs +0 -75
- package/esm2020/cms/components/preview/preview.module.mjs +0 -42
- package/esm2020/cms/components/preview/preview.types.mjs +0 -2
- package/esm2020/cms/decorators/element.decorator.mjs +0 -6
- package/esm2020/cms/decorators/index.mjs +0 -2
- package/esm2020/cms/definitions/index.mjs +0 -2
- package/esm2020/cms/definitions/ui-builder.definitions.mjs +0 -18
- package/esm2020/cms/directives/custom-template.directive.mjs +0 -38
- package/esm2020/cms/engine/models/entity.mjs +0 -17
- package/esm2020/cms/engine/models/plugin.mjs +0 -6
- package/esm2020/cms/index.mjs +0 -16
- package/esm2020/cms/injection-tokens.mjs +0 -7
- package/esm2020/cms/launcher.module.mjs +0 -24
- package/esm2020/cms/modules/federated/default-options.mjs +0 -5
- package/esm2020/cms/modules/federated/export.mjs +0 -2
- package/esm2020/cms/modules/federated/federated-host.directive.mjs +0 -16
- package/esm2020/cms/modules/federated/federated.component.mjs +0 -74
- package/esm2020/cms/modules/federated/federated.module.mjs +0 -20
- package/esm2020/cms/modules/federated/federated.types.mjs +0 -2
- package/esm2020/cms/modules/migrations/index.mjs +0 -3
- package/esm2020/cms/modules/migrations/migrations.mjs +0 -22
- package/esm2020/cms/modules/migrations/migrations.module.mjs +0 -15
- package/esm2020/cms/modules/migrations/services/migrations.service.mjs +0 -47
- package/esm2020/cms/modules/migrations/types/migrations.types.mjs +0 -2
- package/esm2020/cms/modules/runtime/index.mjs +0 -4
- package/esm2020/cms/modules/runtime/runtime.module.mjs +0 -32
- package/esm2020/cms/modules/runtime/services/compilation.service.mjs +0 -93
- package/esm2020/cms/modules/runtime/services/runtime-editor.service.mjs +0 -30
- package/esm2020/cms/modules/runtime/services/runtime.service.mjs +0 -117
- package/esm2020/cms/modules/runtime/tokens.mjs +0 -3
- package/esm2020/cms/modules/runtime/types/compilation.types.mjs +0 -2
- package/esm2020/cms/modules/runtime/types/runtime.actions.mjs +0 -2
- package/esm2020/cms/plugins/element-hover.plugin.mjs +0 -121
- package/esm2020/cms/plugins/io.plugin.mjs +0 -45
- package/esm2020/cms/plugins/page.plugin.mjs +0 -37
- package/esm2020/cms/plugins/region.plugin.mjs +0 -59
- package/esm2020/cms/plugins/script.plugin.mjs +0 -31
- package/esm2020/cms/services/element-context.service.mjs +0 -10
- package/esm2020/cms/services/index.mjs +0 -3
- package/esm2020/cms/services/io-provider.service.mjs +0 -53
- package/esm2020/cms/services/resources.service.mjs +0 -71
- package/esm2020/cms/services/templates.service.mjs +0 -32
- package/esm2020/cms/types/common.types.mjs +0 -2
- package/esm2020/cms/types/elements.types.mjs +0 -2
- package/esm2020/cms/types/index.mjs +0 -7
- package/esm2020/cms/types/layouts.types.mjs +0 -71
- package/esm2020/cms/types/pages.types.mjs +0 -2
- package/esm2020/cms/types/path.types.mjs +0 -2
- package/esm2020/cms/utils/element-metadata-worker.mjs +0 -31
- package/esm2020/cms/utils/element.utils.mjs +0 -182
- package/esm2020/cms/utils/elements-resolver.mjs +0 -206
- package/esm2020/cms/utils/encoding.utils.mjs +0 -29
- package/esm2020/cms/utils/index.mjs +0 -10
- package/esm2020/cms/utils/inject.mjs +0 -27
- package/esm2020/cms/utils/path.utils.mjs +0 -44
- package/esm2020/cms/utils/script.utils.mjs +0 -46
- package/esm2020/cms/utils/transpilation-worker.mjs +0 -52
- package/esm2020/cms/utils/ui-builder-layout.utils.mjs +0 -46
- package/esm2020/cms/utils/ui-definition.utils.mjs +0 -85
- package/esm2020/cms/veloceapps-sdk-cms.mjs +0 -5
- package/esm2020/cms/vendor-map.mjs +0 -83
- package/esm2020/core/core.module.mjs +0 -54
- package/esm2020/core/directives/directives.module.mjs +0 -16
- package/esm2020/core/directives/index.mjs +0 -3
- package/esm2020/core/directives/primeng-calendar.directive.mjs +0 -41
- package/esm2020/core/index.mjs +0 -9
- package/esm2020/core/modules/configuration/configuration.module.mjs +0 -34
- package/esm2020/core/modules/configuration/index.mjs +0 -7
- package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +0 -38
- package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +0 -381
- package/esm2020/core/modules/configuration/services/configuration.service.mjs +0 -172
- package/esm2020/core/modules/configuration/services/guided-selling.service.mjs +0 -62
- package/esm2020/core/modules/configuration/services/test-mode-configuration.service.mjs +0 -97
- package/esm2020/core/modules/configuration/types/configuration-runtime.types.mjs +0 -2
- package/esm2020/core/modules/configuration/types/configuration.types.mjs +0 -2
- package/esm2020/core/modules/configuration/types/index.mjs +0 -3
- package/esm2020/core/modules/flow-configuration/flow-configuration.module.mjs +0 -17
- package/esm2020/core/modules/flow-configuration/index.mjs +0 -2
- package/esm2020/core/modules/flow-configuration/services/flow-configuration.service.mjs +0 -80
- package/esm2020/core/modules/index.mjs +0 -3
- package/esm2020/core/operators/filter-successful-execute.operator.mjs +0 -5
- package/esm2020/core/operators/index.mjs +0 -2
- package/esm2020/core/pipes/action-code.pipe.mjs +0 -20
- package/esm2020/core/pipes/date.pipe.mjs +0 -44
- package/esm2020/core/pipes/index.mjs +0 -6
- package/esm2020/core/pipes/number.pipe.mjs +0 -27
- package/esm2020/core/pipes/pipes.module.mjs +0 -19
- package/esm2020/core/pipes/price.pipe.mjs +0 -30
- package/esm2020/core/services/catalog-products.service.mjs +0 -25
- package/esm2020/core/services/flow-info.service.mjs +0 -146
- package/esm2020/core/services/flow-state-configuration.service.mjs +0 -120
- package/esm2020/core/services/flow-state.service.mjs +0 -417
- package/esm2020/core/services/index.mjs +0 -9
- package/esm2020/core/services/integration.state.mjs +0 -36
- package/esm2020/core/services/product-images.service.mjs +0 -30
- package/esm2020/core/services/runtime-settings.service.mjs +0 -112
- package/esm2020/core/services/sales-transaction.service.mjs +0 -67
- package/esm2020/core/types/flow-customization.types.mjs +0 -3
- package/esm2020/core/types/flow-state.types.mjs +0 -2
- package/esm2020/core/types/formatting-settings.types.mjs +0 -3
- package/esm2020/core/types/index.mjs +0 -6
- package/esm2020/core/types/integration.types.mjs +0 -2
- package/esm2020/core/types/pipe.types.mjs +0 -2
- package/esm2020/core/types/ui-definition.types.mjs +0 -2
- package/esm2020/core/utils/index.mjs +0 -5
- package/esm2020/core/utils/pcm.utils.mjs +0 -15
- package/esm2020/core/utils/transaction-item.utils.mjs +0 -144
- package/esm2020/core/utils/transaction-item.worker.mjs +0 -16
- package/esm2020/core/utils/ui-definition.utils.mjs +0 -9
- package/esm2020/core/veloceapps-sdk-core.mjs +0 -5
- package/esm2020/index.mjs +0 -2
- package/esm2020/src/components/dialog/dialog.component.mjs +0 -36
- package/esm2020/src/components/dialog/dialog.module.mjs +0 -19
- package/esm2020/src/components/dialog/dialog.types.mjs +0 -2
- package/esm2020/src/components/flow-header/flow-header.component.mjs +0 -107
- package/esm2020/src/components/flow-header/flow-header.module.mjs +0 -19
- package/esm2020/src/components/flow-header/index.mjs +0 -2
- package/esm2020/src/components/guided-selling/guided-selling.component.mjs +0 -107
- package/esm2020/src/components/guided-selling/guided-selling.module.mjs +0 -19
- package/esm2020/src/configure-primeng.mjs +0 -33
- package/esm2020/src/constants.mjs +0 -2
- package/esm2020/src/flow-routing.module.mjs +0 -97
- package/esm2020/src/flow.component.mjs +0 -39
- package/esm2020/src/flow.module.mjs +0 -60
- package/esm2020/src/guards/flow.guard.mjs +0 -35
- package/esm2020/src/guards/product-unload.guard.mjs +0 -49
- package/esm2020/src/guards/root.guard.mjs +0 -46
- package/esm2020/src/index.mjs +0 -5
- package/esm2020/src/pages/assets/assets.component.mjs +0 -106
- package/esm2020/src/pages/assets/assets.module.mjs +0 -20
- package/esm2020/src/pages/catalog/catalog.component.mjs +0 -106
- package/esm2020/src/pages/catalog/catalog.module.mjs +0 -20
- package/esm2020/src/pages/debug/debug.component.mjs +0 -49
- package/esm2020/src/pages/debug/debug.module.mjs +0 -46
- package/esm2020/src/pages/product/product.component.mjs +0 -55
- package/esm2020/src/pages/product/product.module.mjs +0 -20
- package/esm2020/src/pages/record-not-found/record-not-found.component.mjs +0 -27
- package/esm2020/src/pages/record-not-found/record-not-found.module.mjs +0 -20
- package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +0 -106
- package/esm2020/src/pages/shopping-cart/shopping-cart.module.mjs +0 -20
- package/esm2020/src/resolvers/flow.resolver.mjs +0 -50
- package/esm2020/src/resolvers/pcm-model.resolver.mjs +0 -12
- package/esm2020/src/resolvers/sales-transaction.resolver.mjs +0 -64
- package/esm2020/src/resolvers/ui-definition.resolver.mjs +0 -44
- package/esm2020/src/services/flow-dialog.service.mjs +0 -91
- package/esm2020/src/services/flow-router.service.mjs +0 -173
- package/esm2020/src/services/flow.service.mjs +0 -102
- package/esm2020/src/services/guided-selling.service.mjs +0 -34
- package/esm2020/src/services/index.mjs +0 -4
- package/esm2020/src/types/index.mjs +0 -2
- package/esm2020/src/types/route.types.mjs +0 -2
- package/esm2020/veloceapps-sdk.mjs +0 -5
- package/fesm2015/veloceapps-sdk-cms.mjs +0 -2514
- package/fesm2015/veloceapps-sdk-cms.mjs.map +0 -1
- package/fesm2015/veloceapps-sdk-core.mjs +0 -2104
- package/fesm2015/veloceapps-sdk-core.mjs.map +0 -1
- package/fesm2015/veloceapps-sdk.mjs +0 -1598
- package/fesm2015/veloceapps-sdk.mjs.map +0 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +0 -2613
- package/fesm2020/veloceapps-sdk-cms.mjs.map +0 -1
- package/fesm2020/veloceapps-sdk-core.mjs.map +0 -1
- package/fesm2020/veloceapps-sdk.mjs.map +0 -1
- package/src/components/dialog/dialog.component.d.ts +0 -13
- package/src/components/dialog/dialog.module.d.ts +0 -9
- package/src/components/dialog/dialog.types.d.ts +0 -7
- package/src/components/flow-header/flow-header.component.d.ts +0 -25
- package/src/components/flow-header/flow-header.module.d.ts +0 -9
- package/src/components/flow-header/index.d.ts +0 -1
- package/src/components/guided-selling/guided-selling.component.d.ts +0 -25
- package/src/components/guided-selling/guided-selling.module.d.ts +0 -9
- package/src/configure-primeng.d.ts +0 -1
- package/src/constants.d.ts +0 -1
- package/src/flow-routing.module.d.ts +0 -11
- package/src/flow.component.d.ts +0 -21
- package/src/flow.module.d.ts +0 -16
- package/src/guards/flow.guard.d.ts +0 -2
- package/src/guards/product-unload.guard.d.ts +0 -16
- package/src/guards/root.guard.d.ts +0 -14
- package/src/index.d.ts +0 -4
- package/src/pages/assets/assets.component.d.ts +0 -31
- package/src/pages/assets/assets.module.d.ts +0 -10
- package/src/pages/catalog/catalog.component.d.ts +0 -31
- package/src/pages/catalog/catalog.module.d.ts +0 -10
- package/src/pages/debug/debug.component.d.ts +0 -21
- package/src/pages/debug/debug.module.d.ts +0 -14
- package/src/pages/product/product.component.d.ts +0 -24
- package/src/pages/product/product.module.d.ts +0 -10
- package/src/pages/record-not-found/record-not-found.component.d.ts +0 -12
- package/src/pages/record-not-found/record-not-found.module.d.ts +0 -9
- package/src/pages/shopping-cart/shopping-cart.component.d.ts +0 -31
- package/src/pages/shopping-cart/shopping-cart.module.d.ts +0 -10
- package/src/resolvers/flow.resolver.d.ts +0 -14
- package/src/resolvers/pcm-model.resolver.d.ts +0 -3
- package/src/resolvers/sales-transaction.resolver.d.ts +0 -18
- package/src/resolvers/ui-definition.resolver.d.ts +0 -3
- package/src/services/flow-dialog.service.d.ts +0 -23
- package/src/services/flow-router.service.d.ts +0 -42
- package/src/services/flow.service.d.ts +0 -21
- package/src/services/guided-selling.service.d.ts +0 -13
- package/src/services/index.d.ts +0 -3
- package/src/types/index.d.ts +0 -1
- package/src/types/route.types.d.ts +0 -4
@@ -1,1598 +0,0 @@
|
|
1
|
-
import * as i4 from '@angular/common';
|
2
|
-
import { CommonModule } from '@angular/common';
|
3
|
-
import * as i0 from '@angular/core';
|
4
|
-
import { Component, ChangeDetectionStrategy, NgModule, Optional, Inject, Injectable, inject } from '@angular/core';
|
5
|
-
import { ApiModule } from '@veloceapps/api';
|
6
|
-
import * as i2 from '@veloceapps/components';
|
7
|
-
import { ToastType, LoaderModule, LetDirectiveModule } from '@veloceapps/components';
|
8
|
-
import * as i5 from '@veloceapps/sdk/cms';
|
9
|
-
import { btoaSafe, PreviewModule, FlowAction, LauncherModule } from '@veloceapps/sdk/cms';
|
10
|
-
import * as i3$1 from '@veloceapps/sdk/core';
|
11
|
-
import { FLOW_CUSTOMIZATION, RuntimeSettingsService, FlowStateService, FlowInfoService, SalesTransactionService, ConfigurationService, IntegrationState, ConfigurationRuntimeService, SdkCoreModule } from '@veloceapps/sdk/core';
|
12
|
-
import * as i3 from 'primeng/button';
|
13
|
-
import { ButtonModule } from 'primeng/button';
|
14
|
-
import * as i1 from 'primeng/dynamicdialog';
|
15
|
-
import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest } from 'rxjs';
|
16
|
-
import * as i1$1 from '@veloceapps/api/v2';
|
17
|
-
import { UIDefinitionsAdminApiService } from '@veloceapps/api/v2';
|
18
|
-
import { DomHandler } from 'primeng/dom';
|
19
|
-
import * as i1$2 from '@angular/router';
|
20
|
-
import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
|
21
|
-
import { SalesforceIdUtils, mapShoppingCartSettings, getMaxRenewalTermsValue, UITemplateType, isVeloceError, extractErrorDetails } from '@veloceapps/core';
|
22
|
-
import { HttpErrorResponse, HttpParams } from '@angular/common/http';
|
23
|
-
import * as i4$1 from '@angular/forms';
|
24
|
-
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
25
|
-
import { DropdownModule } from 'primeng/dropdown';
|
26
|
-
import * as i7 from 'primeng/inputtext';
|
27
|
-
import { InputTextModule } from 'primeng/inputtext';
|
28
|
-
import * as i5$1 from 'primeng/radiobutton';
|
29
|
-
import { RadioButtonModule } from 'primeng/radiobutton';
|
30
|
-
import { catchError as catchError$1 } from 'rxjs/operators';
|
31
|
-
|
32
|
-
const VELOCE_FLOW_ROOT_ROUTE = 'VELOCE_FLOW_ROOT_ROUTE';
|
33
|
-
|
34
|
-
class FlowDialogComponent {
|
35
|
-
constructor(dialogConfig, ref) {
|
36
|
-
this.dialogConfig = dialogConfig;
|
37
|
-
this.ref = ref;
|
38
|
-
this.config = this.dialogConfig.data.config;
|
39
|
-
}
|
40
|
-
cancelHandler() {
|
41
|
-
if (this.config.oppositeButtonActions) {
|
42
|
-
this.ref.close(true);
|
43
|
-
}
|
44
|
-
else {
|
45
|
-
this.ref.close();
|
46
|
-
}
|
47
|
-
}
|
48
|
-
confirmHandler() {
|
49
|
-
if (this.config.oppositeButtonActions) {
|
50
|
-
this.ref.close();
|
51
|
-
}
|
52
|
-
else {
|
53
|
-
this.ref.close(true);
|
54
|
-
}
|
55
|
-
}
|
56
|
-
}
|
57
|
-
FlowDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogComponent, deps: [{ token: i1.DynamicDialogConfig }, { token: i1.DynamicDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
58
|
-
FlowDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowDialogComponent, selector: "vl-flow-dialog", ngImport: i0, template: "<div class=\"header\">\n <div class=\"title\">\n {{ config.title }}\n </div>\n\n <i class=\"vl-icon vl-cross\" (click)=\"cancelHandler()\"></i>\n</div>\n\n<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 *{font-family:var(--cg-font-family)}:host .header{display:flex;justify-content:space-between;align-items:center;padding:16px 16px 8px}:host .header .title{color:var(--cg-black);font-size:16px;font-style:normal;font-weight:500;line-height:20px}:host .header .vl-icon{cursor:pointer}:host .description{flex:1;padding:0 16px 16px;color:var(--cg-black);font-size:12px;font-style:normal;font-weight:300;line-height:16px;letter-spacing:.3px}:host .form-actions{background:var(--cg-bg-color);padding:12px 16px;display:flex;justify-content:flex-end;width:100%;gap:16px}:host p-button ::ng-deep button{border-radius:24px;width:100%;font-size:12px;font-family:var(--cg-font-family);font-weight:300;line-height:16px;letter-spacing:.3px;white-space:nowrap}:host p-button ::ng-deep .p-button-outlined{background-color:var(--cg-white);color:var(--cg-primary-color)}:host p-button ::ng-deep .p-button-outlined:hover{background-color:var(--cg-primary-color);color:var(--cg-white)}:host p-button ::ng-deep .p-button-filled{background-color:var(--cg-primary-color);color:var(--cg-white);border:1px solid var(--cg-primary-color)}:host p-button ::ng-deep .p-button-filled:hover{background-color:var(--cg-primary-color-hover);border-color:var(--cg-primary-color-hover)}::ng-deep .p-dialog.flow-dialog{border-radius:8px;box-shadow:0 8px 32px #0000001a}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogComponent, decorators: [{
|
60
|
-
type: Component,
|
61
|
-
args: [{ selector: 'vl-flow-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"header\">\n <div class=\"title\">\n {{ config.title }}\n </div>\n\n <i class=\"vl-icon vl-cross\" (click)=\"cancelHandler()\"></i>\n</div>\n\n<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 *{font-family:var(--cg-font-family)}:host .header{display:flex;justify-content:space-between;align-items:center;padding:16px 16px 8px}:host .header .title{color:var(--cg-black);font-size:16px;font-style:normal;font-weight:500;line-height:20px}:host .header .vl-icon{cursor:pointer}:host .description{flex:1;padding:0 16px 16px;color:var(--cg-black);font-size:12px;font-style:normal;font-weight:300;line-height:16px;letter-spacing:.3px}:host .form-actions{background:var(--cg-bg-color);padding:12px 16px;display:flex;justify-content:flex-end;width:100%;gap:16px}:host p-button ::ng-deep button{border-radius:24px;width:100%;font-size:12px;font-family:var(--cg-font-family);font-weight:300;line-height:16px;letter-spacing:.3px;white-space:nowrap}:host p-button ::ng-deep .p-button-outlined{background-color:var(--cg-white);color:var(--cg-primary-color)}:host p-button ::ng-deep .p-button-outlined:hover{background-color:var(--cg-primary-color);color:var(--cg-white)}:host p-button ::ng-deep .p-button-filled{background-color:var(--cg-primary-color);color:var(--cg-white);border:1px solid var(--cg-primary-color)}:host p-button ::ng-deep .p-button-filled:hover{background-color:var(--cg-primary-color-hover);border-color:var(--cg-primary-color-hover)}::ng-deep .p-dialog.flow-dialog{border-radius:8px;box-shadow:0 8px 32px #0000001a}\n"] }]
|
62
|
-
}], ctorParameters: function () { return [{ type: i1.DynamicDialogConfig }, { type: i1.DynamicDialogRef }]; } });
|
63
|
-
|
64
|
-
class FlowDialogModule {
|
65
|
-
}
|
66
|
-
FlowDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
67
|
-
FlowDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogModule, declarations: [FlowDialogComponent], imports: [CommonModule, ButtonModule], exports: [FlowDialogComponent] });
|
68
|
-
FlowDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogModule, imports: [CommonModule, ButtonModule] });
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogModule, decorators: [{
|
70
|
-
type: NgModule,
|
71
|
-
args: [{
|
72
|
-
declarations: [FlowDialogComponent],
|
73
|
-
imports: [CommonModule, ButtonModule],
|
74
|
-
exports: [FlowDialogComponent],
|
75
|
-
}]
|
76
|
-
}] });
|
77
|
-
|
78
|
-
class FlowHeaderComponent {
|
79
|
-
constructor(templatesAdminApiService, flowStateService, flowInfo, toastService, customizationService) {
|
80
|
-
this.templatesAdminApiService = templatesAdminApiService;
|
81
|
-
this.flowStateService = flowStateService;
|
82
|
-
this.flowInfo = flowInfo;
|
83
|
-
this.toastService = toastService;
|
84
|
-
this.customizationService = customizationService;
|
85
|
-
this.uiDefinition$ = new BehaviorSubject(null);
|
86
|
-
this.templateApiName = '';
|
87
|
-
this.destroy$ = new Subject();
|
88
|
-
// wait until flow is initialized
|
89
|
-
this.flowStateService
|
90
|
-
.isInitialized$()
|
91
|
-
.pipe(filter(Boolean), first(), tap(() => this.initialize()), takeUntil(this.destroy$))
|
92
|
-
.subscribe();
|
93
|
-
}
|
94
|
-
ngOnDestroy() {
|
95
|
-
this.destroy$.next();
|
96
|
-
this.destroy$.complete();
|
97
|
-
}
|
98
|
-
initialize() {
|
99
|
-
var _a, _b, _c;
|
100
|
-
this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.flowHeader) !== null && _c !== void 0 ? _c : '';
|
101
|
-
this.generateUIDefinition$()
|
102
|
-
.pipe(tap(uiDef => {
|
103
|
-
if (!uiDef) {
|
104
|
-
throw new Error(`Component with name '${this.templateApiName}' not found.`);
|
105
|
-
}
|
106
|
-
this.uiDefinition$.next(uiDef);
|
107
|
-
}), catchError(err => {
|
108
|
-
var _a;
|
109
|
-
const message = 'Failed to resolve Flow Header component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
|
110
|
-
this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
|
111
|
-
return of();
|
112
|
-
}), takeUntil(this.destroy$))
|
113
|
-
.subscribe();
|
114
|
-
}
|
115
|
-
getLocalMeta$() {
|
116
|
-
var _a, _b;
|
117
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
118
|
-
return of(undefined);
|
119
|
-
}
|
120
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
121
|
-
if (!components) {
|
122
|
-
return;
|
123
|
-
}
|
124
|
-
return components.map(component => ({
|
125
|
-
html: component.html,
|
126
|
-
css: component.css,
|
127
|
-
js: component.js,
|
128
|
-
json: component.json,
|
129
|
-
}));
|
130
|
-
}));
|
131
|
-
}
|
132
|
-
getOrgMeta$() {
|
133
|
-
const template = this.flowInfo.templates.FLOW_HEADER;
|
134
|
-
if (!template) {
|
135
|
-
return of(undefined);
|
136
|
-
}
|
137
|
-
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
138
|
-
}
|
139
|
-
generateUIDefinition$() {
|
140
|
-
return of(undefined).pipe(tap(() => {
|
141
|
-
if (!this.templateApiName) {
|
142
|
-
throw new Error("Flow 'flowHeader' template is not defined.");
|
143
|
-
}
|
144
|
-
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
145
|
-
if (!metaList) {
|
146
|
-
return;
|
147
|
-
}
|
148
|
-
const uiDef = {
|
149
|
-
name: '',
|
150
|
-
createdTimestamp: 0,
|
151
|
-
type: 'DEFAULT',
|
152
|
-
version: 2,
|
153
|
-
children: metaList.map(meta => ({
|
154
|
-
children: [],
|
155
|
-
template: meta.html && btoaSafe(meta.html),
|
156
|
-
script: meta.js && btoaSafe(meta.js),
|
157
|
-
styles: meta.css && btoaSafe(meta.css),
|
158
|
-
})),
|
159
|
-
};
|
160
|
-
return uiDef;
|
161
|
-
}));
|
162
|
-
}
|
163
|
-
}
|
164
|
-
FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i3$1.FlowStateService }, { token: i3$1.FlowInfoService }, { token: i2.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
165
|
-
FlowHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowHeaderComponent, selector: "vl-flow-new-header", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, decorators: [{
|
167
|
-
type: Component,
|
168
|
-
args: [{ selector: 'vl-flow-new-header', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
|
169
|
-
}], ctorParameters: function () {
|
170
|
-
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }, { type: i2.ToastService }, { type: undefined, decorators: [{
|
171
|
-
type: Optional
|
172
|
-
}, {
|
173
|
-
type: Inject,
|
174
|
-
args: [FLOW_CUSTOMIZATION]
|
175
|
-
}] }];
|
176
|
-
} });
|
177
|
-
|
178
|
-
class FlowNewHeaderModule {
|
179
|
-
}
|
180
|
-
FlowNewHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowNewHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
181
|
-
FlowNewHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowNewHeaderModule, declarations: [FlowHeaderComponent], imports: [CommonModule, PreviewModule], exports: [FlowHeaderComponent] });
|
182
|
-
FlowNewHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowNewHeaderModule, imports: [CommonModule, PreviewModule] });
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowNewHeaderModule, decorators: [{
|
184
|
-
type: NgModule,
|
185
|
-
args: [{
|
186
|
-
declarations: [FlowHeaderComponent],
|
187
|
-
imports: [CommonModule, PreviewModule],
|
188
|
-
exports: [FlowHeaderComponent],
|
189
|
-
}]
|
190
|
-
}] });
|
191
|
-
|
192
|
-
class GuidedSellingComponent {
|
193
|
-
constructor(templatesAdminApiService, flowStateService, flowInfo, toastService, customizationService) {
|
194
|
-
this.templatesAdminApiService = templatesAdminApiService;
|
195
|
-
this.flowStateService = flowStateService;
|
196
|
-
this.flowInfo = flowInfo;
|
197
|
-
this.toastService = toastService;
|
198
|
-
this.customizationService = customizationService;
|
199
|
-
this.uiDefinition$ = new BehaviorSubject(null);
|
200
|
-
this.templateApiName = '';
|
201
|
-
this.destroy$ = new Subject();
|
202
|
-
// wait until flow is initialized
|
203
|
-
this.flowStateService
|
204
|
-
.isInitialized$()
|
205
|
-
.pipe(filter(Boolean), first(), tap(() => this.initialize()), takeUntil(this.destroy$))
|
206
|
-
.subscribe();
|
207
|
-
}
|
208
|
-
ngOnDestroy() {
|
209
|
-
this.destroy$.next();
|
210
|
-
this.destroy$.complete();
|
211
|
-
}
|
212
|
-
initialize() {
|
213
|
-
var _a, _b, _c;
|
214
|
-
this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.guidedSelling) !== null && _c !== void 0 ? _c : '';
|
215
|
-
this.generateUIDefinition$()
|
216
|
-
.pipe(tap(uiDef => {
|
217
|
-
if (!uiDef) {
|
218
|
-
throw new Error(`Component with name '${this.templateApiName}' not found.`);
|
219
|
-
}
|
220
|
-
this.uiDefinition$.next(uiDef);
|
221
|
-
}), catchError(err => {
|
222
|
-
var _a;
|
223
|
-
const message = 'Failed to resolve Guided Selling component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
|
224
|
-
this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
|
225
|
-
return of();
|
226
|
-
}), takeUntil(this.destroy$))
|
227
|
-
.subscribe();
|
228
|
-
}
|
229
|
-
getLocalMeta$() {
|
230
|
-
var _a, _b;
|
231
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
232
|
-
return of(undefined);
|
233
|
-
}
|
234
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
235
|
-
if (!components) {
|
236
|
-
return;
|
237
|
-
}
|
238
|
-
return components.map(component => ({
|
239
|
-
html: component.html,
|
240
|
-
css: component.css,
|
241
|
-
js: component.js,
|
242
|
-
json: component.json,
|
243
|
-
}));
|
244
|
-
}));
|
245
|
-
}
|
246
|
-
getOrgMeta$() {
|
247
|
-
const template = this.flowInfo.templates.GUIDED_SELLING;
|
248
|
-
if (!template) {
|
249
|
-
return of(undefined);
|
250
|
-
}
|
251
|
-
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
252
|
-
}
|
253
|
-
generateUIDefinition$() {
|
254
|
-
return of(undefined).pipe(tap(() => {
|
255
|
-
if (!this.templateApiName) {
|
256
|
-
throw new Error("Flow 'guidedSelling' template is not defined.");
|
257
|
-
}
|
258
|
-
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
259
|
-
if (!metaList) {
|
260
|
-
return;
|
261
|
-
}
|
262
|
-
const uiDef = {
|
263
|
-
name: '',
|
264
|
-
createdTimestamp: 0,
|
265
|
-
type: 'DEFAULT',
|
266
|
-
version: 2,
|
267
|
-
children: metaList.map(meta => ({
|
268
|
-
children: [],
|
269
|
-
template: meta.html && btoaSafe(meta.html),
|
270
|
-
script: meta.js && btoaSafe(meta.js),
|
271
|
-
styles: meta.css && btoaSafe(meta.css),
|
272
|
-
})),
|
273
|
-
};
|
274
|
-
return uiDef;
|
275
|
-
}));
|
276
|
-
}
|
277
|
-
}
|
278
|
-
GuidedSellingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i3$1.FlowStateService }, { token: i3$1.FlowInfoService }, { token: i2.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
279
|
-
GuidedSellingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: GuidedSellingComponent, selector: "vl-flow-guided-selling", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
280
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, decorators: [{
|
281
|
-
type: Component,
|
282
|
-
args: [{ selector: 'vl-flow-guided-selling', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
|
283
|
-
}], ctorParameters: function () {
|
284
|
-
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }, { type: i2.ToastService }, { type: undefined, decorators: [{
|
285
|
-
type: Optional
|
286
|
-
}, {
|
287
|
-
type: Inject,
|
288
|
-
args: [FLOW_CUSTOMIZATION]
|
289
|
-
}] }];
|
290
|
-
} });
|
291
|
-
|
292
|
-
class GuidedSellingModule {
|
293
|
-
}
|
294
|
-
GuidedSellingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
295
|
-
GuidedSellingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingModule, declarations: [GuidedSellingComponent], imports: [CommonModule, PreviewModule], exports: [GuidedSellingComponent] });
|
296
|
-
GuidedSellingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingModule, imports: [CommonModule, PreviewModule] });
|
297
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingModule, decorators: [{
|
298
|
-
type: NgModule,
|
299
|
-
args: [{
|
300
|
-
declarations: [GuidedSellingComponent],
|
301
|
-
imports: [CommonModule, PreviewModule],
|
302
|
-
exports: [GuidedSellingComponent],
|
303
|
-
}]
|
304
|
-
}] });
|
305
|
-
|
306
|
-
const configurePrimengShadowDOM = () => {
|
307
|
-
DomHandler.getScrollableParents = (element) => {
|
308
|
-
const scrollableParents = [];
|
309
|
-
if (element) {
|
310
|
-
const parents = DomHandler.getParents(element).filter((item) => !(item instanceof ShadowRoot));
|
311
|
-
const overflowRegex = /(auto|scroll)/;
|
312
|
-
const overflowCheck = (node) => {
|
313
|
-
const styleDeclaration = window['getComputedStyle'](node, null);
|
314
|
-
return (overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) ||
|
315
|
-
overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) ||
|
316
|
-
overflowRegex.test(styleDeclaration.getPropertyValue('overflowY')));
|
317
|
-
};
|
318
|
-
for (const parent of parents) {
|
319
|
-
const scrollSelectors = parent.nodeType === 1 && parent.dataset['scrollselectors'];
|
320
|
-
if (scrollSelectors) {
|
321
|
-
const selectors = scrollSelectors.split(',');
|
322
|
-
for (const selector of selectors) {
|
323
|
-
const el = DomHandler.findSingle(parent, selector);
|
324
|
-
if (el && overflowCheck(el)) {
|
325
|
-
scrollableParents.push(el);
|
326
|
-
}
|
327
|
-
}
|
328
|
-
}
|
329
|
-
if (parent.nodeType !== 9 && overflowCheck(parent)) {
|
330
|
-
scrollableParents.push(parent);
|
331
|
-
}
|
332
|
-
}
|
333
|
-
}
|
334
|
-
return scrollableParents;
|
335
|
-
};
|
336
|
-
};
|
337
|
-
|
338
|
-
class FlowRouterService {
|
339
|
-
constructor(router, route, integrationState, flowInfoService) {
|
340
|
-
this.router = router;
|
341
|
-
this.route = route;
|
342
|
-
this.integrationState = integrationState;
|
343
|
-
this.flowInfoService = flowInfoService;
|
344
|
-
this.urlHistory = [];
|
345
|
-
this.getLastChildRoute = (route) => {
|
346
|
-
return route.firstChild ? this.getLastChildRoute(route.firstChild) : route;
|
347
|
-
};
|
348
|
-
this.getNthChildRoute = (route, index) => {
|
349
|
-
if (index <= 0) {
|
350
|
-
return route;
|
351
|
-
}
|
352
|
-
return route.firstChild ? this.getNthChildRoute(route.firstChild, index - 1) : route;
|
353
|
-
};
|
354
|
-
this.getLastChildRouteSnapshot = (route) => {
|
355
|
-
return route.firstChild ? this.getLastChildRouteSnapshot(route.firstChild) : route;
|
356
|
-
};
|
357
|
-
this.watchLastChildRoute$ = (route) => {
|
358
|
-
return this.routeChange$.pipe(map(() => this.getLastChildRouteSnapshot(route.snapshot)));
|
359
|
-
};
|
360
|
-
this.getLastChildParams = (route) => {
|
361
|
-
return route.firstChild ? this.getLastChildParams(route.firstChild) : route.params;
|
362
|
-
};
|
363
|
-
this.watchLastChildParams$ = (route) => {
|
364
|
-
return this.routeChange$.pipe(map(() => this.getLastChildParams(route.snapshot)));
|
365
|
-
};
|
366
|
-
this.getFlowSubpath$ = () => {
|
367
|
-
return this.route$.pipe(map(route => {
|
368
|
-
const url = route.url.join('/');
|
369
|
-
const flowRootUrl = this.getFlowRootPath(route);
|
370
|
-
return url.replace(flowRootUrl, '');
|
371
|
-
}));
|
372
|
-
};
|
373
|
-
this.routeChange$ = this.router.events.pipe(filter(e => e instanceof NavigationEnd), shareReplay());
|
374
|
-
this.lastChildParams$ = this.watchLastChildParams$(this.route).pipe(startWith(this.getLastChildParams(this.route.snapshot)), shareReplay());
|
375
|
-
this.lastChildRoute$ = this.watchLastChildRoute$(this.route).pipe(startWith(this.getLastChildRouteSnapshot(this.route.snapshot)), shareReplay());
|
376
|
-
this.loading$ = this.router.events.pipe(filter(e => e instanceof NavigationStart ||
|
377
|
-
e instanceof NavigationCancel ||
|
378
|
-
e instanceof NavigationEnd ||
|
379
|
-
e instanceof NavigationError), map(e => e instanceof NavigationStart), startWith(false), distinctUntilChanged());
|
380
|
-
this.routeChange$.subscribe(() => {
|
381
|
-
this.urlHistory.push(this.router.url);
|
382
|
-
// Close Guided Selling when user navigates to another flow page
|
383
|
-
this.integrationState.dispatch(FlowAction.CloseGuidedSelling({ keepState: true }));
|
384
|
-
});
|
385
|
-
}
|
386
|
-
get route$() {
|
387
|
-
return this.lastChildRoute$;
|
388
|
-
}
|
389
|
-
get params$() {
|
390
|
-
return this.lastChildParams$;
|
391
|
-
}
|
392
|
-
get params() {
|
393
|
-
return this.getLastChildParams(this.route.snapshot);
|
394
|
-
}
|
395
|
-
getFlowRootRoute(route) {
|
396
|
-
var _a;
|
397
|
-
const path = [...route.pathFromRoot];
|
398
|
-
while (path.length) {
|
399
|
-
const parent = path.pop();
|
400
|
-
if (!parent) {
|
401
|
-
break;
|
402
|
-
}
|
403
|
-
if (((_a = parent.routeConfig) === null || _a === void 0 ? void 0 : _a.id) === VELOCE_FLOW_ROOT_ROUTE) {
|
404
|
-
return parent;
|
405
|
-
}
|
406
|
-
}
|
407
|
-
return;
|
408
|
-
}
|
409
|
-
getFlowRootPath(route) {
|
410
|
-
const rootRoute = this.getFlowRootRoute(route);
|
411
|
-
if (!rootRoute) {
|
412
|
-
return '';
|
413
|
-
}
|
414
|
-
const path = rootRoute.pathFromRoot
|
415
|
-
.map(r => r.url[0])
|
416
|
-
.filter(Boolean)
|
417
|
-
.join('/');
|
418
|
-
return '/' + path;
|
419
|
-
}
|
420
|
-
isConfigurationRoute$() {
|
421
|
-
return this.getFlowSubpath$().pipe(map(url => url.startsWith('product')));
|
422
|
-
}
|
423
|
-
isCartRoute$() {
|
424
|
-
return this.getFlowSubpath$().pipe(map(url => url.startsWith('cart')));
|
425
|
-
}
|
426
|
-
isCatalogRoute$() {
|
427
|
-
return this.getFlowSubpath$().pipe(map(url => url.startsWith('catalog')));
|
428
|
-
}
|
429
|
-
isAssetsRoute$() {
|
430
|
-
return this.getFlowSubpath$().pipe(map(url => url.startsWith('assets')));
|
431
|
-
}
|
432
|
-
navigateBack() {
|
433
|
-
const prevUrl = this.urlHistory[this.urlHistory.length - 2];
|
434
|
-
if (prevUrl) {
|
435
|
-
this.router.navigateByUrl(prevUrl);
|
436
|
-
}
|
437
|
-
}
|
438
|
-
navigateTo(path, productId, transactionItemId) {
|
439
|
-
if (path === 'shopping-cart') {
|
440
|
-
this.navigateToShoppingCart();
|
441
|
-
}
|
442
|
-
else if (path === 'catalog') {
|
443
|
-
this.navigateToCatalog();
|
444
|
-
}
|
445
|
-
else if (path === 'assets') {
|
446
|
-
this.navigateToAssets();
|
447
|
-
}
|
448
|
-
else if (path === 'product' && productId) {
|
449
|
-
this.navigateToProductConfiguration(productId, transactionItemId);
|
450
|
-
}
|
451
|
-
}
|
452
|
-
navigateToProductConfiguration(productId, transactionItemId) {
|
453
|
-
this.flowInfoService.updateContext({ productId, transactionItemId });
|
454
|
-
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
455
|
-
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
456
|
-
this.router.navigate([flowRouteUrl, 'product'], {
|
457
|
-
queryParams: Object.assign(Object.assign({}, routeSnapshot.queryParams), { productId, transactionItemId }),
|
458
|
-
});
|
459
|
-
}
|
460
|
-
navigateToShoppingCart() {
|
461
|
-
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
462
|
-
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
463
|
-
this.router.navigate([flowRouteUrl, 'cart'], { queryParams: routeSnapshot.queryParams });
|
464
|
-
}
|
465
|
-
navigateToCatalog() {
|
466
|
-
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
467
|
-
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
468
|
-
this.router.navigate([flowRouteUrl, 'catalog'], { queryParams: routeSnapshot.queryParams });
|
469
|
-
}
|
470
|
-
navigateToAssets() {
|
471
|
-
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
472
|
-
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
473
|
-
this.router.navigate([flowRouteUrl, 'assets'], { queryParams: routeSnapshot.queryParams });
|
474
|
-
}
|
475
|
-
showErrorPage$(message, details) {
|
476
|
-
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
477
|
-
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
478
|
-
return from(this.router.navigate([flowRouteUrl, '404'], {
|
479
|
-
state: Object.assign({ message, type: 'error' }, (details && { details })),
|
480
|
-
replaceUrl: true,
|
481
|
-
})).pipe(map(() => false));
|
482
|
-
}
|
483
|
-
switchObject(id) {
|
484
|
-
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
485
|
-
const route = this.getLastChildRoute(this.route);
|
486
|
-
const objName = SalesforceIdUtils.getSfObjectNameById(id);
|
487
|
-
const queryParams = {
|
488
|
-
quoteId: objName === 'Quote' ? id : undefined,
|
489
|
-
accountId: objName === 'Account' ? id : undefined,
|
490
|
-
orderId: objName === 'Order' ? id : undefined,
|
491
|
-
};
|
492
|
-
this.router.navigate([], { relativeTo: route, queryParams: Object.assign(Object.assign({}, routeSnapshot.queryParams), queryParams) });
|
493
|
-
}
|
494
|
-
}
|
495
|
-
FlowRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: i3$1.IntegrationState }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
|
496
|
-
FlowRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, providedIn: 'root' });
|
497
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, decorators: [{
|
498
|
-
type: Injectable,
|
499
|
-
args: [{ providedIn: 'root' }]
|
500
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i3$1.IntegrationState }, { type: i3$1.FlowInfoService }]; } });
|
501
|
-
|
502
|
-
class FlowDialogService {
|
503
|
-
constructor(dialogService, runtimeSettings, flowInfoService) {
|
504
|
-
this.dialogService = dialogService;
|
505
|
-
this.runtimeSettings = runtimeSettings;
|
506
|
-
this.flowInfoService = flowInfoService;
|
507
|
-
}
|
508
|
-
show(config) {
|
509
|
-
return this.dialogService.open(FlowDialogComponent, {
|
510
|
-
dismissableMask: true,
|
511
|
-
closeOnEscape: true,
|
512
|
-
closable: true,
|
513
|
-
showHeader: false,
|
514
|
-
width: '320px',
|
515
|
-
data: { config },
|
516
|
-
styleClass: 'flow-dialog',
|
517
|
-
}).onClose;
|
518
|
-
}
|
519
|
-
showEmptyCartDialog() {
|
520
|
-
return this.show({
|
521
|
-
title: 'No Products in Quote',
|
522
|
-
description: 'There are no products in your Quote. To save a Quote, add at least one product.',
|
523
|
-
primaryButton: 'Ok',
|
524
|
-
});
|
525
|
-
}
|
526
|
-
showReadonlyModeDialog() {
|
527
|
-
var _a;
|
528
|
-
const mode = this.flowInfoService.context.mode;
|
529
|
-
const objectName = mode ? ((_a = mode[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) + mode.substring(1).toLowerCase() : 'Object';
|
530
|
-
return this.show({
|
531
|
-
title: 'Error',
|
532
|
-
description: `${objectName} Cannot be Saved`,
|
533
|
-
primaryButton: 'Ok',
|
534
|
-
});
|
535
|
-
}
|
536
|
-
showQuoteReadonlyModeDialog() {
|
537
|
-
return this.show({
|
538
|
-
title: 'Quote Cannot be Saved',
|
539
|
-
description: 'It is only possible to save quotes with the “Draft” status. Please create a new quote to make and save changes.',
|
540
|
-
primaryButton: 'Ok',
|
541
|
-
});
|
542
|
-
}
|
543
|
-
showQuoteInConfiguratorDialog() {
|
544
|
-
return this.show({
|
545
|
-
title: 'Quote Cannot be Saved',
|
546
|
-
description: 'It not possible to save quotes from the Configurator. To proceed, finish configuring product.',
|
547
|
-
primaryButton: 'Ok',
|
548
|
-
});
|
549
|
-
}
|
550
|
-
showAccountNoChangesDialog() {
|
551
|
-
return this.show({
|
552
|
-
title: 'No Changes to Save',
|
553
|
-
description: 'There are no changes since the last update. Please make changes to proceed.',
|
554
|
-
primaryButton: 'Ok',
|
555
|
-
});
|
556
|
-
}
|
557
|
-
showUnsavedChangesDialog() {
|
558
|
-
return this.show({
|
559
|
-
title: 'Unsaved Changes',
|
560
|
-
description: 'Are you sure you want to leave this page and discard your unsaved changes?',
|
561
|
-
primaryButton: 'Keep Editing',
|
562
|
-
secondaryButton: 'Discard Changes',
|
563
|
-
oppositeButtonActions: true,
|
564
|
-
});
|
565
|
-
}
|
566
|
-
showTermsLimitReachedDialog() {
|
567
|
-
const shoppingCartSettings = mapShoppingCartSettings(this.runtimeSettings.getShoppingCartSettings() || []);
|
568
|
-
const maxRenewalTerms = getMaxRenewalTermsValue(shoppingCartSettings);
|
569
|
-
return this.show({
|
570
|
-
title: 'Terms Limit Reached',
|
571
|
-
description: `You have reached the term quantity limit: ${maxRenewalTerms}. You can increase the limit in the Shopping Cart Settings.`,
|
572
|
-
primaryButton: 'Ok',
|
573
|
-
});
|
574
|
-
}
|
575
|
-
showDialog(dialog) {
|
576
|
-
const dialogFunction = this[dialog].bind(this);
|
577
|
-
return dialogFunction(dialog);
|
578
|
-
}
|
579
|
-
}
|
580
|
-
FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token: i3$1.RuntimeSettingsService }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
|
581
|
-
FlowDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService });
|
582
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, decorators: [{
|
583
|
-
type: Injectable
|
584
|
-
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i3$1.RuntimeSettingsService }, { type: i3$1.FlowInfoService }]; } });
|
585
|
-
|
586
|
-
class FlowService {
|
587
|
-
constructor(integrationState, flowRouterService, configurationService, configurationStateService, flowDialogService, flowStateService, flowInfoService) {
|
588
|
-
this.integrationState = integrationState;
|
589
|
-
this.flowRouterService = flowRouterService;
|
590
|
-
this.configurationService = configurationService;
|
591
|
-
this.configurationStateService = configurationStateService;
|
592
|
-
this.flowDialogService = flowDialogService;
|
593
|
-
this.flowStateService = flowStateService;
|
594
|
-
this.flowInfoService = flowInfoService;
|
595
|
-
this.cleanup$ = new Subject();
|
596
|
-
}
|
597
|
-
cleanup() {
|
598
|
-
this.cleanup$.next();
|
599
|
-
}
|
600
|
-
initSubscriptions() {
|
601
|
-
this.integrationState
|
602
|
-
.listen$(FlowAction.FLOW_CONFIGURE_PRODUCT)
|
603
|
-
.pipe(tap(payload => {
|
604
|
-
if (payload.productId) {
|
605
|
-
this.flowInfoService.updateContext({ newProductQty: payload.qty });
|
606
|
-
this.flowRouterService.navigateToProductConfiguration(payload.productId, payload.transactionItemId);
|
607
|
-
}
|
608
|
-
else {
|
609
|
-
console.warn("Parameter 'productId' is needed to start configuration");
|
610
|
-
}
|
611
|
-
}), takeUntil(this.cleanup$))
|
612
|
-
.subscribe();
|
613
|
-
this.integrationState
|
614
|
-
.listen$(FlowAction.FLOW_SWITCH_OBJECT)
|
615
|
-
.pipe(tap(payload => {
|
616
|
-
this.flowRouterService.switchObject(payload.id);
|
617
|
-
}), takeUntil(this.cleanup$))
|
618
|
-
.subscribe();
|
619
|
-
this.integrationState
|
620
|
-
.listen$(FlowAction.FLOW_NAVIGATE_BACK)
|
621
|
-
.pipe(switchMap(() => this.configurationStateService.cancelConfiguration()), tap(() => this.flowRouterService.navigateBack()), takeUntil(this.cleanup$))
|
622
|
-
.subscribe();
|
623
|
-
this.integrationState
|
624
|
-
.listen$(FlowAction.FLOW_NAVIGATE_TO)
|
625
|
-
.pipe(switchMap(payload => this.configurationStateService.cancelConfiguration().pipe(map(() => payload))), tap(payload => {
|
626
|
-
if (payload.path === 'product') {
|
627
|
-
this.integrationState.dispatch(FlowAction.ConfigureProductAction(payload));
|
628
|
-
}
|
629
|
-
else {
|
630
|
-
this.flowRouterService.navigateTo(payload.path, payload.productId, payload.transactionItemId);
|
631
|
-
}
|
632
|
-
}), takeUntil(this.cleanup$))
|
633
|
-
.subscribe();
|
634
|
-
this.integrationState
|
635
|
-
.listen$(FlowAction.OPEN_DIALOG)
|
636
|
-
.pipe(switchMap(payload => this.flowDialogService.showDialog(payload.dialog).pipe(take(1))), takeUntil(this.cleanup$))
|
637
|
-
.subscribe(dialogResult => {
|
638
|
-
this.integrationState.patchState({ dialogResult });
|
639
|
-
});
|
640
|
-
this.integrationState
|
641
|
-
.listen$(FlowAction.FLOW_NAVIGATE_TO_CATALOG)
|
642
|
-
.pipe(tap(() => this.flowRouterService.navigateToCatalog()), takeUntil(this.cleanup$))
|
643
|
-
.subscribe();
|
644
|
-
this.integrationState
|
645
|
-
.listen$(FlowAction.FLOW_NAVIGATE_TO_SHOPPING_CART)
|
646
|
-
.pipe(tap(() => this.flowRouterService.navigateToShoppingCart()), takeUntil(this.cleanup$))
|
647
|
-
.subscribe();
|
648
|
-
this.integrationState
|
649
|
-
.listen$(FlowAction.FLOW_APPLY_PRODUCT_CONFIGURATION)
|
650
|
-
.pipe(switchMap(() => this.configurationStateService.saveConfiguration()), switchMap(() => this.configurationStateService.cancelConfiguration()), switchMap(() => this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'MODIFY_ASSETS', {
|
651
|
-
addConfiguringAssetId: true,
|
652
|
-
enable: true,
|
653
|
-
})), tap(() => {
|
654
|
-
this.configurationService.hasUnsavedChanges = false;
|
655
|
-
this.flowRouterService.navigateToShoppingCart();
|
656
|
-
}), takeUntil(this.cleanup$))
|
657
|
-
.subscribe();
|
658
|
-
this.updateFlowParams();
|
659
|
-
}
|
660
|
-
updateFlowParams() {
|
661
|
-
this.flowRouterService
|
662
|
-
.getFlowSubpath$()
|
663
|
-
.pipe(map(path => { var _a; return (_a = path.split('/')) === null || _a === void 0 ? void 0 : _a[0]; }), takeUntil(this.cleanup$))
|
664
|
-
.subscribe(flowPath => this.integrationState.patchState({ flowPath }));
|
665
|
-
this.flowRouterService.route$
|
666
|
-
.pipe(map(path => path.queryParams['productId']), takeUntil(this.cleanup$))
|
667
|
-
.subscribe(productId => this.integrationState.patchState({ productId }));
|
668
|
-
}
|
669
|
-
}
|
670
|
-
FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, deps: [{ token: i5.IntegrationState }, { token: FlowRouterService }, { token: i3$1.ConfigurationService }, { token: i3$1.ConfigurationStateService }, { token: FlowDialogService }, { token: i3$1.FlowStateService }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
|
671
|
-
FlowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService });
|
672
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, decorators: [{
|
673
|
-
type: Injectable
|
674
|
-
}], ctorParameters: function () { return [{ type: i5.IntegrationState }, { type: FlowRouterService }, { type: i3$1.ConfigurationService }, { type: i3$1.ConfigurationStateService }, { type: FlowDialogService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }]; } });
|
675
|
-
|
676
|
-
class FlowGuidedSellingService {
|
677
|
-
constructor(integrationState) {
|
678
|
-
this.integrationState = integrationState;
|
679
|
-
this.cleanup$ = new Subject();
|
680
|
-
this.isVisibleSubj$ = new BehaviorSubject(false);
|
681
|
-
this.isVisible$ = this.isVisibleSubj$.asObservable();
|
682
|
-
this.initSubscriptions();
|
683
|
-
}
|
684
|
-
cleanup() {
|
685
|
-
this.cleanup$.next();
|
686
|
-
}
|
687
|
-
initSubscriptions() {
|
688
|
-
this.integrationState
|
689
|
-
.listen$(FlowAction.OPEN_GUIDED_SELLING)
|
690
|
-
.pipe(tap(() => this.isVisibleSubj$.next(true)), takeUntil(this.cleanup$))
|
691
|
-
.subscribe();
|
692
|
-
this.integrationState
|
693
|
-
.listen$(FlowAction.CLOSE_GUIDED_SELLING)
|
694
|
-
.pipe(tap(() => this.isVisibleSubj$.next(false)), takeUntil(this.cleanup$))
|
695
|
-
.subscribe();
|
696
|
-
}
|
697
|
-
}
|
698
|
-
FlowGuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, deps: [{ token: i3$1.IntegrationState }], target: i0.ɵɵFactoryTarget.Injectable });
|
699
|
-
FlowGuidedSellingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService });
|
700
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, decorators: [{
|
701
|
-
type: Injectable
|
702
|
-
}], ctorParameters: function () { return [{ type: i3$1.IntegrationState }]; } });
|
703
|
-
|
704
|
-
class FlowComponent {
|
705
|
-
constructor(routerService, flowService, flowInfoService, guidedSellingService) {
|
706
|
-
this.routerService = routerService;
|
707
|
-
this.flowService = flowService;
|
708
|
-
this.flowInfoService = flowInfoService;
|
709
|
-
this.guidedSellingService = guidedSellingService;
|
710
|
-
this.isLoading$ = this.routerService.loading$;
|
711
|
-
this.showHeader$ = combineLatest([this.routerService.route$, this.flowInfoService.flow$]).pipe(map(([route, flow]) => route.data['showHeader'] && !(flow === null || flow === void 0 ? void 0 : flow.properties.standalone)));
|
712
|
-
this.isStandalone$ = this.flowInfoService.flow$.pipe(map(flow => Boolean(flow === null || flow === void 0 ? void 0 : flow.properties.standalone)));
|
713
|
-
this.guidedSellingVisible$ = this.guidedSellingService.isVisible$;
|
714
|
-
this.flowService.initSubscriptions();
|
715
|
-
}
|
716
|
-
ngOnDestroy() {
|
717
|
-
this.flowService.cleanup();
|
718
|
-
}
|
719
|
-
}
|
720
|
-
FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: FlowService }, { token: i3$1.FlowInfoService }, { token: FlowGuidedSellingService }], target: i0.ɵɵFactoryTarget.Component });
|
721
|
-
FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowComponent, selector: "vl-flow", ngImport: i0, template: "<vl-flow-new-header *ngIf=\"showHeader$ | async\"></vl-flow-new-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <div class=\"guided-selling\" [ngClass]=\"{ hidden: (guidedSellingVisible$ | async) === false }\">\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}.guided-selling{position:absolute;top:0;width:100%;height:100%;z-index:100}.hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "component", type: FlowHeaderComponent, selector: "vl-flow-new-header" }, { kind: "component", type: GuidedSellingComponent, selector: "vl-flow-guided-selling" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
722
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, decorators: [{
|
723
|
-
type: Component,
|
724
|
-
args: [{ selector: 'vl-flow', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-flow-new-header *ngIf=\"showHeader$ | async\"></vl-flow-new-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <div class=\"guided-selling\" [ngClass]=\"{ hidden: (guidedSellingVisible$ | async) === false }\">\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}.guided-selling{position:absolute;top:0;width:100%;height:100%;z-index:100}.hidden{display:none}\n"] }]
|
725
|
-
}], ctorParameters: function () { return [{ type: FlowRouterService }, { type: FlowService }, { type: i3$1.FlowInfoService }, { type: FlowGuidedSellingService }]; } });
|
726
|
-
|
727
|
-
const keepFlowInitialized = (route) => {
|
728
|
-
const routerService = inject(FlowRouterService);
|
729
|
-
const runtimeSettingsService = inject(RuntimeSettingsService);
|
730
|
-
const flowState = inject(FlowStateService);
|
731
|
-
const flowInfoService = inject(FlowInfoService);
|
732
|
-
const salesTrasnsactionService = inject(SalesTransactionService);
|
733
|
-
const configurationService = inject(ConfigurationService);
|
734
|
-
const integrationState = inject(IntegrationState);
|
735
|
-
const { flowId } = route.queryParams;
|
736
|
-
if (flowInfoService.isFlowInitialized && flowInfoService.flow.id === flowId) {
|
737
|
-
return true;
|
738
|
-
}
|
739
|
-
// Cleanup
|
740
|
-
flowState.reset();
|
741
|
-
salesTrasnsactionService.reset();
|
742
|
-
configurationService.reset();
|
743
|
-
integrationState.reset();
|
744
|
-
flowInfoService.reset();
|
745
|
-
if (!flowId) {
|
746
|
-
return true;
|
747
|
-
}
|
748
|
-
return runtimeSettingsService.create().pipe(tap(() => runtimeSettingsService.initCurrency('USD')), switchMap(() => flowInfoService.init$(flowId, route.queryParams)), map(() => true), catchError(e => {
|
749
|
-
console.error(e);
|
750
|
-
const message = e instanceof HttpErrorResponse ? e.error.message : e;
|
751
|
-
const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
|
752
|
-
return routerService.showErrorPage$(message, errorDetails);
|
753
|
-
}));
|
754
|
-
};
|
755
|
-
|
756
|
-
class ProductUnloadGuard {
|
757
|
-
constructor(router, flowInfoService, configurationService, flowDialogService) {
|
758
|
-
this.router = router;
|
759
|
-
this.flowInfoService = flowInfoService;
|
760
|
-
this.configurationService = configurationService;
|
761
|
-
this.flowDialogService = flowDialogService;
|
762
|
-
}
|
763
|
-
canDeactivate(_, route, currentState, nextState) {
|
764
|
-
let observable = of(true);
|
765
|
-
if (!this.flowInfoService.flow.properties.standalone && this.configurationService.hasUnsavedChanges) {
|
766
|
-
observable = this.flowDialogService.showUnsavedChangesDialog();
|
767
|
-
}
|
768
|
-
return observable.pipe(map(unload => {
|
769
|
-
var _a;
|
770
|
-
if (unload) {
|
771
|
-
this.configurationService.reset();
|
772
|
-
const currentUrl = currentState.url.split('?')[0];
|
773
|
-
const nextUrl = ((_a = nextState === null || nextState === void 0 ? void 0 : nextState.url) !== null && _a !== void 0 ? _a : '').split('?')[0];
|
774
|
-
if (!nextState || currentUrl === nextUrl) {
|
775
|
-
return true;
|
776
|
-
}
|
777
|
-
// clear obsolete queryParams
|
778
|
-
const urlTree = this.router.parseUrl(nextState.url);
|
779
|
-
if (!urlTree.queryParams['productId']) {
|
780
|
-
return true;
|
781
|
-
}
|
782
|
-
delete urlTree.queryParams['productId'];
|
783
|
-
// replace url after deactivation has finished
|
784
|
-
setTimeout(() => this.router.navigateByUrl(urlTree.toString(), { replaceUrl: true }));
|
785
|
-
return true;
|
786
|
-
}
|
787
|
-
return false;
|
788
|
-
}));
|
789
|
-
}
|
790
|
-
}
|
791
|
-
ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$2.Router }, { token: i3$1.FlowInfoService }, { token: i3$1.ConfigurationService }, { token: FlowDialogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
792
|
-
ProductUnloadGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard });
|
793
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, decorators: [{
|
794
|
-
type: Injectable
|
795
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i3$1.FlowInfoService }, { type: i3$1.ConfigurationService }, { type: FlowDialogService }]; } });
|
796
|
-
|
797
|
-
class RootGuard {
|
798
|
-
constructor(router, routerService) {
|
799
|
-
this.router = router;
|
800
|
-
this.routerService = routerService;
|
801
|
-
this.initialized = false;
|
802
|
-
}
|
803
|
-
canActivate(route) {
|
804
|
-
// We always need to initialize root component first, and only then start checking guards/resolvers
|
805
|
-
if (!this.initialized) {
|
806
|
-
this.initialized = true;
|
807
|
-
const navToRestore = this.router.getCurrentNavigation();
|
808
|
-
const rootUrl = this.routerService.getFlowRootPath(route);
|
809
|
-
this.router
|
810
|
-
.navigate([rootUrl], {
|
811
|
-
replaceUrl: !(navToRestore === null || navToRestore === void 0 ? void 0 : navToRestore.previousNavigation),
|
812
|
-
skipLocationChange: true,
|
813
|
-
})
|
814
|
-
.then(success => {
|
815
|
-
if (!success || !navToRestore) {
|
816
|
-
return;
|
817
|
-
}
|
818
|
-
setTimeout(() => {
|
819
|
-
this.router.navigateByUrl(navToRestore.extractedUrl, navToRestore.extras);
|
820
|
-
});
|
821
|
-
});
|
822
|
-
}
|
823
|
-
return true;
|
824
|
-
}
|
825
|
-
canDeactivate() {
|
826
|
-
this.initialized = false;
|
827
|
-
return true;
|
828
|
-
}
|
829
|
-
}
|
830
|
-
RootGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RootGuard, deps: [{ token: i1$2.Router }, { token: FlowRouterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
831
|
-
RootGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RootGuard, providedIn: 'root' });
|
832
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RootGuard, decorators: [{
|
833
|
-
type: Injectable,
|
834
|
-
args: [{ providedIn: 'root' }]
|
835
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }]; } });
|
836
|
-
|
837
|
-
class AssetsComponent {
|
838
|
-
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
839
|
-
var _a, _b, _c;
|
840
|
-
this.templatesAdminApiService = templatesAdminApiService;
|
841
|
-
this.cdr = cdr;
|
842
|
-
this.toastService = toastService;
|
843
|
-
this.flowInfo = flowInfo;
|
844
|
-
this.customizationService = customizationService;
|
845
|
-
this.uiDefinition = undefined;
|
846
|
-
this.state$ = new BehaviorSubject({ loading: true, failure: false });
|
847
|
-
this.templateApiName = '';
|
848
|
-
this.destroyed$ = new Subject();
|
849
|
-
this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.assets) !== null && _c !== void 0 ? _c : '';
|
850
|
-
}
|
851
|
-
ngOnInit() {
|
852
|
-
this.generateUIDefinition$()
|
853
|
-
.pipe(tap(uiDef => {
|
854
|
-
if (!uiDef) {
|
855
|
-
throw new Error(`Component with name '${this.templateApiName}' not found.`);
|
856
|
-
}
|
857
|
-
this.uiDefinition = uiDef;
|
858
|
-
this.state$.next({ loading: false, failure: false });
|
859
|
-
}), catchError(err => {
|
860
|
-
var _a;
|
861
|
-
const message = 'Failed to resolve Assets component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
|
862
|
-
this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
|
863
|
-
this.uiDefinition = undefined;
|
864
|
-
this.state$.next({ loading: false, failure: true });
|
865
|
-
return of();
|
866
|
-
}), takeUntil(this.destroyed$))
|
867
|
-
.subscribe(() => this.cdr.detectChanges());
|
868
|
-
}
|
869
|
-
ngOnDestroy() {
|
870
|
-
this.destroyed$.next();
|
871
|
-
this.destroyed$.complete();
|
872
|
-
}
|
873
|
-
getLocalMeta$() {
|
874
|
-
var _a, _b;
|
875
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
876
|
-
return of(undefined);
|
877
|
-
}
|
878
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
879
|
-
if (!components) {
|
880
|
-
return;
|
881
|
-
}
|
882
|
-
return components.map(component => ({
|
883
|
-
html: component.html,
|
884
|
-
css: component.css,
|
885
|
-
js: component.js,
|
886
|
-
json: component.json,
|
887
|
-
}));
|
888
|
-
}));
|
889
|
-
}
|
890
|
-
getOrgMeta$() {
|
891
|
-
const template = this.flowInfo.templates.SHOPPING_CART;
|
892
|
-
if (!template) {
|
893
|
-
return of(undefined);
|
894
|
-
}
|
895
|
-
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
896
|
-
}
|
897
|
-
generateUIDefinition$() {
|
898
|
-
return of(undefined).pipe(tap(() => {
|
899
|
-
if (!this.templateApiName) {
|
900
|
-
throw new Error("Flow 'assets' template is not defined.");
|
901
|
-
}
|
902
|
-
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
903
|
-
if (!metaList) {
|
904
|
-
return;
|
905
|
-
}
|
906
|
-
const uiDef = {
|
907
|
-
name: '',
|
908
|
-
createdTimestamp: 0,
|
909
|
-
type: 'DEFAULT',
|
910
|
-
version: 2,
|
911
|
-
children: metaList.map(meta => ({
|
912
|
-
children: [],
|
913
|
-
template: meta.html && btoaSafe(meta.html),
|
914
|
-
script: meta.js && btoaSafe(meta.js),
|
915
|
-
styles: meta.css && btoaSafe(meta.css),
|
916
|
-
})),
|
917
|
-
};
|
918
|
-
return uiDef;
|
919
|
-
}));
|
920
|
-
}
|
921
|
-
}
|
922
|
-
AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i0.ChangeDetectorRef }, { token: i2.ToastService }, { token: i3$1.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
923
|
-
AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: AssetsComponent, selector: "vl-flow-assets", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
924
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, decorators: [{
|
925
|
-
type: Component,
|
926
|
-
args: [{ selector: 'vl-flow-assets', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
|
927
|
-
}], ctorParameters: function () {
|
928
|
-
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
929
|
-
type: Optional
|
930
|
-
}, {
|
931
|
-
type: Inject,
|
932
|
-
args: [FLOW_CUSTOMIZATION]
|
933
|
-
}] }];
|
934
|
-
} });
|
935
|
-
|
936
|
-
class AssetsModule {
|
937
|
-
}
|
938
|
-
AssetsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
939
|
-
AssetsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: AssetsModule, declarations: [AssetsComponent], imports: [CommonModule, PreviewModule, LoaderModule], exports: [AssetsComponent] });
|
940
|
-
AssetsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsModule, imports: [CommonModule, PreviewModule, LoaderModule] });
|
941
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsModule, decorators: [{
|
942
|
-
type: NgModule,
|
943
|
-
args: [{
|
944
|
-
declarations: [AssetsComponent],
|
945
|
-
imports: [CommonModule, PreviewModule, LoaderModule],
|
946
|
-
exports: [AssetsComponent],
|
947
|
-
}]
|
948
|
-
}] });
|
949
|
-
|
950
|
-
class CatalogComponent {
|
951
|
-
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
952
|
-
var _a, _b, _c;
|
953
|
-
this.templatesAdminApiService = templatesAdminApiService;
|
954
|
-
this.cdr = cdr;
|
955
|
-
this.toastService = toastService;
|
956
|
-
this.flowInfo = flowInfo;
|
957
|
-
this.customizationService = customizationService;
|
958
|
-
this.uiDefinition = undefined;
|
959
|
-
this.state$ = new BehaviorSubject({ loading: true, failure: false });
|
960
|
-
this.templateApiName = '';
|
961
|
-
this.destroyed$ = new Subject();
|
962
|
-
this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.catalog) !== null && _c !== void 0 ? _c : '';
|
963
|
-
}
|
964
|
-
ngOnInit() {
|
965
|
-
this.generateUIDefinition$()
|
966
|
-
.pipe(tap(uiDef => {
|
967
|
-
if (!uiDef) {
|
968
|
-
throw new Error(`Component with name '${this.templateApiName}' not found.`);
|
969
|
-
}
|
970
|
-
this.uiDefinition = uiDef;
|
971
|
-
this.state$.next({ loading: false, failure: false });
|
972
|
-
}), catchError(err => {
|
973
|
-
var _a;
|
974
|
-
const message = 'Failed to resolve Catalog component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
|
975
|
-
this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
|
976
|
-
this.uiDefinition = undefined;
|
977
|
-
this.state$.next({ loading: false, failure: true });
|
978
|
-
return of();
|
979
|
-
}), takeUntil(this.destroyed$))
|
980
|
-
.subscribe(() => this.cdr.detectChanges());
|
981
|
-
}
|
982
|
-
ngOnDestroy() {
|
983
|
-
this.destroyed$.next();
|
984
|
-
this.destroyed$.complete();
|
985
|
-
}
|
986
|
-
getLocalMeta$() {
|
987
|
-
var _a, _b;
|
988
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
989
|
-
return of(undefined);
|
990
|
-
}
|
991
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
992
|
-
if (!components) {
|
993
|
-
return;
|
994
|
-
}
|
995
|
-
return components.map(component => ({
|
996
|
-
html: component.html,
|
997
|
-
css: component.css,
|
998
|
-
js: component.js,
|
999
|
-
json: component.json,
|
1000
|
-
}));
|
1001
|
-
}));
|
1002
|
-
}
|
1003
|
-
getOrgMeta$() {
|
1004
|
-
const template = this.flowInfo.templates.CATALOG;
|
1005
|
-
if (!template) {
|
1006
|
-
return of(undefined);
|
1007
|
-
}
|
1008
|
-
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
1009
|
-
}
|
1010
|
-
generateUIDefinition$() {
|
1011
|
-
return of(undefined).pipe(tap(() => {
|
1012
|
-
if (!this.templateApiName) {
|
1013
|
-
throw new Error("Flow 'catalog' template is not defined.");
|
1014
|
-
}
|
1015
|
-
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
1016
|
-
if (!metaList) {
|
1017
|
-
return;
|
1018
|
-
}
|
1019
|
-
const uiDef = {
|
1020
|
-
name: '',
|
1021
|
-
createdTimestamp: 0,
|
1022
|
-
type: 'DEFAULT',
|
1023
|
-
version: 2,
|
1024
|
-
children: metaList.map(meta => ({
|
1025
|
-
children: [],
|
1026
|
-
template: meta.html && btoaSafe(meta.html),
|
1027
|
-
script: meta.js && btoaSafe(meta.js),
|
1028
|
-
styles: meta.css && btoaSafe(meta.css),
|
1029
|
-
})),
|
1030
|
-
};
|
1031
|
-
return uiDef;
|
1032
|
-
}));
|
1033
|
-
}
|
1034
|
-
}
|
1035
|
-
CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i0.ChangeDetectorRef }, { token: i2.ToastService }, { token: i3$1.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
1036
|
-
CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CatalogComponent, selector: "vl-flow-catalog", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1037
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, decorators: [{
|
1038
|
-
type: Component,
|
1039
|
-
args: [{ selector: 'vl-flow-catalog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
|
1040
|
-
}], ctorParameters: function () {
|
1041
|
-
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
1042
|
-
type: Optional
|
1043
|
-
}, {
|
1044
|
-
type: Inject,
|
1045
|
-
args: [FLOW_CUSTOMIZATION]
|
1046
|
-
}] }];
|
1047
|
-
} });
|
1048
|
-
|
1049
|
-
class CatalogModule {
|
1050
|
-
}
|
1051
|
-
CatalogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1052
|
-
CatalogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: CatalogModule, declarations: [CatalogComponent], imports: [CommonModule, PreviewModule, LoaderModule], exports: [CatalogComponent] });
|
1053
|
-
CatalogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogModule, imports: [CommonModule, PreviewModule, LoaderModule] });
|
1054
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogModule, decorators: [{
|
1055
|
-
type: NgModule,
|
1056
|
-
args: [{
|
1057
|
-
declarations: [CatalogComponent],
|
1058
|
-
imports: [CommonModule, PreviewModule, LoaderModule],
|
1059
|
-
exports: [CatalogComponent],
|
1060
|
-
}]
|
1061
|
-
}] });
|
1062
|
-
|
1063
|
-
class DebugComponent {
|
1064
|
-
constructor(flowsApiService, router, activatedRoute) {
|
1065
|
-
this.flowsApiService = flowsApiService;
|
1066
|
-
this.router = router;
|
1067
|
-
this.activatedRoute = activatedRoute;
|
1068
|
-
this.form = new FormGroup({
|
1069
|
-
id: new FormControl(''),
|
1070
|
-
});
|
1071
|
-
this.flows$ = this.flowsApiService.fetchFlows().pipe(shareReplay());
|
1072
|
-
}
|
1073
|
-
runFlow() {
|
1074
|
-
const { id } = this.form.value;
|
1075
|
-
if (!id || !this.selectedFlow) {
|
1076
|
-
return;
|
1077
|
-
}
|
1078
|
-
this.router.navigate(['..', 'flows'], {
|
1079
|
-
queryParams: Object.assign({ flowId: this.selectedFlow.id, headerId: id }, this.selectedFlow.properties.queryParams),
|
1080
|
-
relativeTo: this.activatedRoute,
|
1081
|
-
});
|
1082
|
-
}
|
1083
|
-
getQueryParamsString(params) {
|
1084
|
-
return new HttpParams({ fromObject: params }).toString();
|
1085
|
-
}
|
1086
|
-
}
|
1087
|
-
DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, deps: [{ token: i1$1.FlowsApiService }, { token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
1088
|
-
DebugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: DebugComponent, selector: "vl-flow-debug", ngImport: i0, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tbody>tr{cursor:pointer}tbody>tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5$1.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i7.InputText, selector: "[pInputText]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1089
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, decorators: [{
|
1090
|
-
type: Component,
|
1091
|
-
args: [{ selector: 'vl-flow-debug', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tbody>tr{cursor:pointer}tbody>tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"] }]
|
1092
|
-
}], ctorParameters: function () { return [{ type: i1$1.FlowsApiService }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }]; } });
|
1093
|
-
|
1094
|
-
const routes$1 = [{ path: '', component: DebugComponent }];
|
1095
|
-
class DebugModule {
|
1096
|
-
}
|
1097
|
-
DebugModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1098
|
-
DebugModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DebugModule, declarations: [DebugComponent], imports: [CommonModule,
|
1099
|
-
FormsModule,
|
1100
|
-
ReactiveFormsModule, i1$2.RouterModule, RadioButtonModule,
|
1101
|
-
ButtonModule,
|
1102
|
-
InputTextModule,
|
1103
|
-
DropdownModule] });
|
1104
|
-
DebugModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugModule, imports: [CommonModule,
|
1105
|
-
FormsModule,
|
1106
|
-
ReactiveFormsModule,
|
1107
|
-
RouterModule.forChild(routes$1),
|
1108
|
-
RadioButtonModule,
|
1109
|
-
ButtonModule,
|
1110
|
-
InputTextModule,
|
1111
|
-
DropdownModule] });
|
1112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugModule, decorators: [{
|
1113
|
-
type: NgModule,
|
1114
|
-
args: [{
|
1115
|
-
declarations: [DebugComponent],
|
1116
|
-
imports: [
|
1117
|
-
CommonModule,
|
1118
|
-
FormsModule,
|
1119
|
-
ReactiveFormsModule,
|
1120
|
-
RouterModule.forChild(routes$1),
|
1121
|
-
RadioButtonModule,
|
1122
|
-
ButtonModule,
|
1123
|
-
InputTextModule,
|
1124
|
-
DropdownModule,
|
1125
|
-
],
|
1126
|
-
}]
|
1127
|
-
}] });
|
1128
|
-
|
1129
|
-
class ProductComponent {
|
1130
|
-
constructor(configurationRuntimeService, configurationStateService, flowService, route) {
|
1131
|
-
this.configurationRuntimeService = configurationRuntimeService;
|
1132
|
-
this.configurationStateService = configurationStateService;
|
1133
|
-
this.flowService = flowService;
|
1134
|
-
this.route = route;
|
1135
|
-
this.uiDefinitionContainer$ = new BehaviorSubject(null);
|
1136
|
-
this.showNotFound$ = new BehaviorSubject(false);
|
1137
|
-
this.isInitialized$ = new BehaviorSubject(true);
|
1138
|
-
this.destroy$ = new Subject();
|
1139
|
-
this.uiDefinitionContainer$.next(this.configurationRuntimeService.uiDefinitionContainer);
|
1140
|
-
this.config = {
|
1141
|
-
init$: () => this.init$(),
|
1142
|
-
};
|
1143
|
-
}
|
1144
|
-
ngOnInit() {
|
1145
|
-
let prevParams;
|
1146
|
-
this.route.queryParams
|
1147
|
-
.pipe(tap(params => {
|
1148
|
-
if (prevParams && prevParams['productId'] !== params['productId']) {
|
1149
|
-
this.isInitialized$.next(false);
|
1150
|
-
setTimeout(() => {
|
1151
|
-
this.isInitialized$.next(true);
|
1152
|
-
}, 0);
|
1153
|
-
}
|
1154
|
-
prevParams = params;
|
1155
|
-
}))
|
1156
|
-
.subscribe();
|
1157
|
-
}
|
1158
|
-
ngOnDestroy() {
|
1159
|
-
this.destroy$.next();
|
1160
|
-
this.destroy$.complete();
|
1161
|
-
}
|
1162
|
-
init$() {
|
1163
|
-
return this.configurationStateService.init$().pipe(tap(() => {
|
1164
|
-
this.showNotFound$.next(Boolean(!this.uiDefinitionContainer$.value));
|
1165
|
-
}));
|
1166
|
-
}
|
1167
|
-
}
|
1168
|
-
ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, deps: [{ token: i3$1.ConfigurationRuntimeService }, { token: i3$1.ConfigurationStateService }, { token: i3$1.FlowInfoService }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
1169
|
-
ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<vl-cms-preview\n *ngIf=\"isInitialized$ | async\"\n [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"\n [config]=\"config\"\n></vl-cms-preview>\n\n<div *ngIf=\"showNotFound$ | async\" class=\"not-found-wrapper\">\n <div class=\"not-found\">\n <div class=\"icon\"></div>\n <div class=\"message\">\n This product doesn't have a linked Configuration UI. <br />\n Please contact your system administrator for further assistance.\n </div>\n </div>\n</div>\n", styles: [".not-found-wrapper{position:absolute;top:0;display:flex;width:100%;height:100%;justify-content:center;align-items:center;background-color:#fff;z-index:1000}.not-found{display:flex;align-items:center;padding:16px;border-radius:8px;gap:8px;background-color:#f5f5f5}.not-found .icon{width:48px;height:42px;background-image:url(\"data:image/svg+xml,%3Csvg width='48' height='42' viewBox='0 0 48 42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='24.0798' cy='32.6052' rx='2.85714' ry='2.63158' fill='%231F2029'/%3E%3Cpath d='M22.285 3.35831C23.0618 2.06363 24.9382 2.06363 25.715 3.35831L46.1826 37.471C46.9824 38.8041 46.0222 40.5 44.4676 40.5L3.53238 40.5C1.97779 40.5 1.01757 38.8041 1.8174 37.471L22.285 3.35831Z' stroke='%23141414' stroke-width='2'/%3E%3Cpath d='M24 17.342V26.8157' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E%0A\")}.not-found .message{font-size:14px;color:#141414;font-weight:300}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, decorators: [{
|
1171
|
-
type: Component,
|
1172
|
-
args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview\n *ngIf=\"isInitialized$ | async\"\n [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"\n [config]=\"config\"\n></vl-cms-preview>\n\n<div *ngIf=\"showNotFound$ | async\" class=\"not-found-wrapper\">\n <div class=\"not-found\">\n <div class=\"icon\"></div>\n <div class=\"message\">\n This product doesn't have a linked Configuration UI. <br />\n Please contact your system administrator for further assistance.\n </div>\n </div>\n</div>\n", styles: [".not-found-wrapper{position:absolute;top:0;display:flex;width:100%;height:100%;justify-content:center;align-items:center;background-color:#fff;z-index:1000}.not-found{display:flex;align-items:center;padding:16px;border-radius:8px;gap:8px;background-color:#f5f5f5}.not-found .icon{width:48px;height:42px;background-image:url(\"data:image/svg+xml,%3Csvg width='48' height='42' viewBox='0 0 48 42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='24.0798' cy='32.6052' rx='2.85714' ry='2.63158' fill='%231F2029'/%3E%3Cpath d='M22.285 3.35831C23.0618 2.06363 24.9382 2.06363 25.715 3.35831L46.1826 37.471C46.9824 38.8041 46.0222 40.5 44.4676 40.5L3.53238 40.5C1.97779 40.5 1.01757 38.8041 1.8174 37.471L22.285 3.35831Z' stroke='%23141414' stroke-width='2'/%3E%3Cpath d='M24 17.342V26.8157' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E%0A\")}.not-found .message{font-size:14px;color:#141414;font-weight:300}\n"] }]
|
1173
|
-
}], ctorParameters: function () { return [{ type: i3$1.ConfigurationRuntimeService }, { type: i3$1.ConfigurationStateService }, { type: i3$1.FlowInfoService }, { type: i1$2.ActivatedRoute }]; } });
|
1174
|
-
|
1175
|
-
class ProductModule {
|
1176
|
-
}
|
1177
|
-
ProductModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1178
|
-
ProductModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ProductModule, declarations: [ProductComponent], imports: [CommonModule, PreviewModule, LoaderModule, LetDirectiveModule], exports: [ProductComponent] });
|
1179
|
-
ProductModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModule, imports: [CommonModule, PreviewModule, LoaderModule, LetDirectiveModule] });
|
1180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModule, decorators: [{
|
1181
|
-
type: NgModule,
|
1182
|
-
args: [{
|
1183
|
-
declarations: [ProductComponent],
|
1184
|
-
imports: [CommonModule, PreviewModule, LoaderModule, LetDirectiveModule],
|
1185
|
-
exports: [ProductComponent],
|
1186
|
-
}]
|
1187
|
-
}] });
|
1188
|
-
|
1189
|
-
class RecordNotFoundComponent {
|
1190
|
-
constructor(router) {
|
1191
|
-
this.router = router;
|
1192
|
-
this.subMessage = '';
|
1193
|
-
this.type = '';
|
1194
|
-
const navigation = this.router.getCurrentNavigation();
|
1195
|
-
const { state } = (navigation === null || navigation === void 0 ? void 0 : navigation.extras) || {};
|
1196
|
-
this.message = state === null || state === void 0 ? void 0 : state['message'];
|
1197
|
-
this.type = (state === null || state === void 0 ? void 0 : state['type']) || '';
|
1198
|
-
this.details = state === null || state === void 0 ? void 0 : state['details'];
|
1199
|
-
if (typeof this.message === 'string') {
|
1200
|
-
this.subMessage = this.message.includes('/describe') ? 'A potential problem with permissions' : '';
|
1201
|
-
}
|
1202
|
-
}
|
1203
|
-
}
|
1204
|
-
RecordNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component });
|
1205
|
-
RecordNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RecordNotFoundComponent, selector: "vl-flow-record-not-found", ngImport: i0, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div *ngIf=\"message; else defaultMessage\">\n <p class=\"text message-text\" [class]=\"type\">{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"text\">{{ subMessage }}</p>\n\n <div *ngIf=\"details && details.length > 0\">\n <div *ngFor=\"let detail of details\" class=\"text\">{{ detail }}</div>\n </div>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;padding:24px 54px}:host .text{white-space:pre-line;word-break:break-word}:host .message-text.error{color:var(--vl-error-text-color)}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1206
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, decorators: [{
|
1207
|
-
type: Component,
|
1208
|
-
args: [{ selector: 'vl-flow-record-not-found', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div *ngIf=\"message; else defaultMessage\">\n <p class=\"text message-text\" [class]=\"type\">{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"text\">{{ subMessage }}</p>\n\n <div *ngIf=\"details && details.length > 0\">\n <div *ngFor=\"let detail of details\" class=\"text\">{{ detail }}</div>\n </div>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;padding:24px 54px}:host .text{white-space:pre-line;word-break:break-word}:host .message-text.error{color:var(--vl-error-text-color)}\n"] }]
|
1209
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }]; } });
|
1210
|
-
|
1211
|
-
const routes = [{ path: '', component: RecordNotFoundComponent }];
|
1212
|
-
class RecordNotFoundModule {
|
1213
|
-
}
|
1214
|
-
RecordNotFoundModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1215
|
-
RecordNotFoundModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundModule, declarations: [RecordNotFoundComponent], imports: [CommonModule, i1$2.RouterModule] });
|
1216
|
-
RecordNotFoundModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundModule, imports: [CommonModule, RouterModule.forChild(routes)] });
|
1217
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundModule, decorators: [{
|
1218
|
-
type: NgModule,
|
1219
|
-
args: [{
|
1220
|
-
declarations: [RecordNotFoundComponent],
|
1221
|
-
imports: [CommonModule, RouterModule.forChild(routes)],
|
1222
|
-
}]
|
1223
|
-
}] });
|
1224
|
-
|
1225
|
-
class ShoppingCartComponent {
|
1226
|
-
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
1227
|
-
var _a, _b, _c;
|
1228
|
-
this.templatesAdminApiService = templatesAdminApiService;
|
1229
|
-
this.cdr = cdr;
|
1230
|
-
this.toastService = toastService;
|
1231
|
-
this.flowInfo = flowInfo;
|
1232
|
-
this.customizationService = customizationService;
|
1233
|
-
this.uiDefinition = undefined;
|
1234
|
-
this.state$ = new BehaviorSubject({ loading: true, failure: false });
|
1235
|
-
this.templateApiName = '';
|
1236
|
-
this.destroyed$ = new Subject();
|
1237
|
-
this.templateApiName = (_c = (_b = (_a = this.flowInfo.flow) === null || _a === void 0 ? void 0 : _a.properties.templates) === null || _b === void 0 ? void 0 : _b.shoppingCart) !== null && _c !== void 0 ? _c : '';
|
1238
|
-
}
|
1239
|
-
ngOnInit() {
|
1240
|
-
this.generateUIDefinition$()
|
1241
|
-
.pipe(tap(uiDef => {
|
1242
|
-
if (!uiDef) {
|
1243
|
-
throw new Error(`Component with name '${this.templateApiName}' not found.`);
|
1244
|
-
}
|
1245
|
-
this.uiDefinition = uiDef;
|
1246
|
-
this.state$.next({ loading: false, failure: false });
|
1247
|
-
}), catchError(err => {
|
1248
|
-
var _a;
|
1249
|
-
const message = 'Failed to resolve Shopping Cart component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
|
1250
|
-
this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
|
1251
|
-
this.uiDefinition = undefined;
|
1252
|
-
this.state$.next({ loading: false, failure: true });
|
1253
|
-
return of();
|
1254
|
-
}), takeUntil(this.destroyed$))
|
1255
|
-
.subscribe(() => this.cdr.detectChanges());
|
1256
|
-
}
|
1257
|
-
ngOnDestroy() {
|
1258
|
-
this.destroyed$.next();
|
1259
|
-
this.destroyed$.complete();
|
1260
|
-
}
|
1261
|
-
getLocalMeta$() {
|
1262
|
-
var _a, _b;
|
1263
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
1264
|
-
return of(undefined);
|
1265
|
-
}
|
1266
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
1267
|
-
if (!components) {
|
1268
|
-
return;
|
1269
|
-
}
|
1270
|
-
return components.map(component => ({
|
1271
|
-
html: component.html,
|
1272
|
-
css: component.css,
|
1273
|
-
js: component.js,
|
1274
|
-
json: component.json,
|
1275
|
-
}));
|
1276
|
-
}));
|
1277
|
-
}
|
1278
|
-
getOrgMeta$() {
|
1279
|
-
const template = this.flowInfo.templates.SHOPPING_CART;
|
1280
|
-
if (!template) {
|
1281
|
-
return of(undefined);
|
1282
|
-
}
|
1283
|
-
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
1284
|
-
}
|
1285
|
-
generateUIDefinition$() {
|
1286
|
-
return of(undefined).pipe(tap(() => {
|
1287
|
-
if (!this.templateApiName) {
|
1288
|
-
throw new Error("Flow 'shoppingCart' template is not defined.");
|
1289
|
-
}
|
1290
|
-
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
1291
|
-
if (!metaList) {
|
1292
|
-
return;
|
1293
|
-
}
|
1294
|
-
const uiDef = {
|
1295
|
-
name: '',
|
1296
|
-
createdTimestamp: 0,
|
1297
|
-
type: 'DEFAULT',
|
1298
|
-
version: 2,
|
1299
|
-
children: metaList.map(meta => ({
|
1300
|
-
children: [],
|
1301
|
-
template: meta.html && btoaSafe(meta.html),
|
1302
|
-
script: meta.js && btoaSafe(meta.js),
|
1303
|
-
styles: meta.css && btoaSafe(meta.css),
|
1304
|
-
})),
|
1305
|
-
};
|
1306
|
-
return uiDef;
|
1307
|
-
}));
|
1308
|
-
}
|
1309
|
-
}
|
1310
|
-
ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i0.ChangeDetectorRef }, { token: i2.ToastService }, { token: i3$1.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
1311
|
-
ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1312
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, decorators: [{
|
1313
|
-
type: Component,
|
1314
|
-
args: [{ selector: 'vl-flow-shopping-cart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
|
1315
|
-
}], ctorParameters: function () {
|
1316
|
-
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
1317
|
-
type: Optional
|
1318
|
-
}, {
|
1319
|
-
type: Inject,
|
1320
|
-
args: [FLOW_CUSTOMIZATION]
|
1321
|
-
}] }];
|
1322
|
-
} });
|
1323
|
-
|
1324
|
-
class ShoppingCartModule {
|
1325
|
-
}
|
1326
|
-
ShoppingCartModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1327
|
-
ShoppingCartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartModule, declarations: [ShoppingCartComponent], imports: [CommonModule, PreviewModule, LoaderModule], exports: [ShoppingCartComponent] });
|
1328
|
-
ShoppingCartModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartModule, imports: [CommonModule, PreviewModule, LoaderModule] });
|
1329
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartModule, decorators: [{
|
1330
|
-
type: NgModule,
|
1331
|
-
args: [{
|
1332
|
-
declarations: [ShoppingCartComponent],
|
1333
|
-
imports: [CommonModule, PreviewModule, LoaderModule],
|
1334
|
-
exports: [ShoppingCartComponent],
|
1335
|
-
}]
|
1336
|
-
}] });
|
1337
|
-
|
1338
|
-
class FlowResolver {
|
1339
|
-
constructor(router, routerService, flowInfoService) {
|
1340
|
-
this.router = router;
|
1341
|
-
this.routerService = routerService;
|
1342
|
-
this.flowInfoService = flowInfoService;
|
1343
|
-
}
|
1344
|
-
resolve(route) {
|
1345
|
-
if (!this.flowInfoService.isFlowInitialized) {
|
1346
|
-
return of(false);
|
1347
|
-
}
|
1348
|
-
const { queryParams } = route;
|
1349
|
-
const { properties } = this.flowInfoService.flow;
|
1350
|
-
const { queryParams: flowQueryParams, entryPath } = properties;
|
1351
|
-
const mergedQueryParams = Object.assign(Object.assign({}, queryParams), flowQueryParams);
|
1352
|
-
const parentUrl = this.routerService.getFlowRootPath(route);
|
1353
|
-
const entryUrl = String(entryPath !== null && entryPath !== void 0 ? entryPath : '')
|
1354
|
-
.split('/')
|
1355
|
-
.filter(Boolean);
|
1356
|
-
return from(this.router.navigate([parentUrl, ...entryUrl], {
|
1357
|
-
queryParams: mergedQueryParams,
|
1358
|
-
replaceUrl: true,
|
1359
|
-
})).pipe(catchError$1(e => {
|
1360
|
-
console.error(e);
|
1361
|
-
const message = e instanceof HttpErrorResponse ? e.error.message : e;
|
1362
|
-
const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
|
1363
|
-
return this.routerService.showErrorPage$(message, errorDetails);
|
1364
|
-
}));
|
1365
|
-
}
|
1366
|
-
}
|
1367
|
-
FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1368
|
-
FlowResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver });
|
1369
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, decorators: [{
|
1370
|
-
type: Injectable
|
1371
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i3$1.FlowInfoService }]; } });
|
1372
|
-
|
1373
|
-
const resolvePCMModel = () => {
|
1374
|
-
const flowInfoService = inject(FlowInfoService);
|
1375
|
-
const configurationRuntimeService = inject(ConfigurationRuntimeService);
|
1376
|
-
const { productId } = flowInfoService.context;
|
1377
|
-
if (!productId) {
|
1378
|
-
throw new Error(`Unable to start configuration for 'productId == null'`);
|
1379
|
-
}
|
1380
|
-
return configurationRuntimeService.init$({ productId });
|
1381
|
-
};
|
1382
|
-
|
1383
|
-
class SalesTransactionResolver {
|
1384
|
-
constructor(router, routerService, flowInfoService, flowStateService, salesTransactionService) {
|
1385
|
-
this.router = router;
|
1386
|
-
this.routerService = routerService;
|
1387
|
-
this.flowInfoService = flowInfoService;
|
1388
|
-
this.flowStateService = flowStateService;
|
1389
|
-
this.salesTransactionService = salesTransactionService;
|
1390
|
-
}
|
1391
|
-
resolve(route) {
|
1392
|
-
const flow = this.flowInfoService.flow;
|
1393
|
-
if (!flow) {
|
1394
|
-
return of(false);
|
1395
|
-
}
|
1396
|
-
if (this.flowStateService.isInitialized()) {
|
1397
|
-
return of(true);
|
1398
|
-
}
|
1399
|
-
return this.flowStateService.init$().pipe(switchMap(() => this.checkDynamicNavigation$(route)), catchError(e => {
|
1400
|
-
console.error(e);
|
1401
|
-
const message = e instanceof HttpErrorResponse ? e.error.message : e;
|
1402
|
-
const errorDetails = isVeloceError(e.error) ? extractErrorDetails(e.error) : [];
|
1403
|
-
return this.routerService.showErrorPage$(message, errorDetails);
|
1404
|
-
}));
|
1405
|
-
}
|
1406
|
-
checkDynamicNavigation$(route) {
|
1407
|
-
const flow = this.flowInfoService.flow;
|
1408
|
-
if (!flow) {
|
1409
|
-
return of(true);
|
1410
|
-
}
|
1411
|
-
if (flow.properties.suppressInitialNavigation || flow.properties.standalone) {
|
1412
|
-
return of(true);
|
1413
|
-
}
|
1414
|
-
return this.getNavigateTo().pipe(switchMap(navigateTo => {
|
1415
|
-
if (!navigateTo) {
|
1416
|
-
return of(true);
|
1417
|
-
}
|
1418
|
-
const parentUrl = this.routerService.getFlowRootPath(route);
|
1419
|
-
return from(this.router.navigate([parentUrl + navigateTo], {
|
1420
|
-
queryParams: route.queryParams,
|
1421
|
-
replaceUrl: true,
|
1422
|
-
}));
|
1423
|
-
}));
|
1424
|
-
}
|
1425
|
-
getNavigateTo() {
|
1426
|
-
// Implement when needed
|
1427
|
-
return of('');
|
1428
|
-
}
|
1429
|
-
}
|
1430
|
-
SalesTransactionResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i3$1.FlowInfoService }, { token: i3$1.FlowStateService }, { token: i3$1.SalesTransactionService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1431
|
-
SalesTransactionResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver });
|
1432
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver, decorators: [{
|
1433
|
-
type: Injectable
|
1434
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i3$1.FlowInfoService }, { type: i3$1.FlowStateService }, { type: i3$1.SalesTransactionService }]; } });
|
1435
|
-
|
1436
|
-
const resolveUIDefinition = () => {
|
1437
|
-
const customizationService = inject(FLOW_CUSTOMIZATION, { optional: true });
|
1438
|
-
const flowInfoService = inject(FlowInfoService);
|
1439
|
-
const uiDefinitionsAdminApiService = inject(UIDefinitionsAdminApiService);
|
1440
|
-
const configurationRuntimeService = inject(ConfigurationRuntimeService);
|
1441
|
-
const { productId } = flowInfoService.context;
|
1442
|
-
if (!productId) {
|
1443
|
-
throw new Error(`Unable to start configuration for 'productId == null'`);
|
1444
|
-
}
|
1445
|
-
return of(undefined).pipe(switchMap(() => {
|
1446
|
-
// Try resolving via customization service
|
1447
|
-
if (!productId || !(customizationService === null || customizationService === void 0 ? void 0 : customizationService.getUiDefinition)) {
|
1448
|
-
return of(undefined);
|
1449
|
-
}
|
1450
|
-
return customizationService.getUiDefinition(flowInfoService.context);
|
1451
|
-
}), switchMap(uiDefContainer => {
|
1452
|
-
// Resolve UIDefinition from the org
|
1453
|
-
if (uiDefContainer) {
|
1454
|
-
return of(uiDefContainer);
|
1455
|
-
}
|
1456
|
-
if (flowInfoService.context.requiredUIDefinitionId) {
|
1457
|
-
return uiDefinitionsAdminApiService.fetch$(flowInfoService.context.requiredUIDefinitionId, {
|
1458
|
-
skipErrorHandler: true,
|
1459
|
-
});
|
1460
|
-
}
|
1461
|
-
return uiDefinitionsAdminApiService
|
1462
|
-
.fetchAll$({
|
1463
|
-
productId,
|
1464
|
-
defaultUIDefinitionId: flowInfoService.context.defaultUIDefinitionId,
|
1465
|
-
}, { skipErrorHandler: true })
|
1466
|
-
.pipe(map((uiDefinitionContainers) => {
|
1467
|
-
const uiDefContainer = uiDefinitionContainers[0];
|
1468
|
-
if (!uiDefContainer) {
|
1469
|
-
throw new Error(`UI Definition for productId=${productId} is not resolved`);
|
1470
|
-
}
|
1471
|
-
return uiDefContainer;
|
1472
|
-
}));
|
1473
|
-
}), catchError(() => of(null)), tap(uiDefContainer => (configurationRuntimeService.uiDefinitionContainer = uiDefContainer)));
|
1474
|
-
};
|
1475
|
-
|
1476
|
-
const rootRoute = {
|
1477
|
-
id: VELOCE_FLOW_ROOT_ROUTE,
|
1478
|
-
path: '',
|
1479
|
-
component: FlowComponent,
|
1480
|
-
canActivate: [RootGuard],
|
1481
|
-
canDeactivate: [RootGuard],
|
1482
|
-
children: [
|
1483
|
-
{
|
1484
|
-
path: '',
|
1485
|
-
canActivate: [keepFlowInitialized],
|
1486
|
-
runGuardsAndResolvers: 'always',
|
1487
|
-
children: [
|
1488
|
-
{
|
1489
|
-
path: 'flows',
|
1490
|
-
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1491
|
-
resolve: { flow: FlowResolver },
|
1492
|
-
children: [],
|
1493
|
-
},
|
1494
|
-
{
|
1495
|
-
path: 'product',
|
1496
|
-
component: ProductComponent,
|
1497
|
-
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1498
|
-
resolve: { salesTransaction: SalesTransactionResolver, uiDef: resolveUIDefinition, pcm: resolvePCMModel },
|
1499
|
-
canDeactivate: [ProductUnloadGuard],
|
1500
|
-
data: { showHeader: true },
|
1501
|
-
},
|
1502
|
-
{
|
1503
|
-
path: 'cart',
|
1504
|
-
component: ShoppingCartComponent,
|
1505
|
-
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1506
|
-
resolve: { salesTransaction: SalesTransactionResolver },
|
1507
|
-
data: { showHeader: true },
|
1508
|
-
},
|
1509
|
-
{
|
1510
|
-
path: 'catalog',
|
1511
|
-
component: CatalogComponent,
|
1512
|
-
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1513
|
-
resolve: { salesTransaction: SalesTransactionResolver },
|
1514
|
-
data: { showHeader: true },
|
1515
|
-
},
|
1516
|
-
{
|
1517
|
-
path: 'assets',
|
1518
|
-
component: AssetsComponent,
|
1519
|
-
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1520
|
-
resolve: { salesTransaction: SalesTransactionResolver },
|
1521
|
-
data: { showHeader: true },
|
1522
|
-
},
|
1523
|
-
{
|
1524
|
-
path: 'debug',
|
1525
|
-
loadChildren: () => DebugModule,
|
1526
|
-
},
|
1527
|
-
{
|
1528
|
-
path: '404',
|
1529
|
-
loadChildren: () => RecordNotFoundModule,
|
1530
|
-
},
|
1531
|
-
],
|
1532
|
-
},
|
1533
|
-
],
|
1534
|
-
};
|
1535
|
-
class FlowRoutingModule {
|
1536
|
-
}
|
1537
|
-
FlowRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1538
|
-
FlowRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, imports: [i1$2.RouterModule, ProductModule, ShoppingCartModule, CatalogModule, AssetsModule], exports: [RouterModule] });
|
1539
|
-
FlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver, SalesTransactionResolver], imports: [RouterModule.forChild([rootRoute]), ProductModule, ShoppingCartModule, CatalogModule, AssetsModule, RouterModule] });
|
1540
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, decorators: [{
|
1541
|
-
type: NgModule,
|
1542
|
-
args: [{
|
1543
|
-
imports: [RouterModule.forChild([rootRoute]), ProductModule, ShoppingCartModule, CatalogModule, AssetsModule],
|
1544
|
-
exports: [RouterModule],
|
1545
|
-
providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver, SalesTransactionResolver],
|
1546
|
-
}]
|
1547
|
-
}] });
|
1548
|
-
|
1549
|
-
configurePrimengShadowDOM();
|
1550
|
-
class FlowModule {
|
1551
|
-
}
|
1552
|
-
FlowModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1553
|
-
FlowModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowModule, declarations: [FlowComponent], imports: [CommonModule,
|
1554
|
-
LetDirectiveModule,
|
1555
|
-
FlowRoutingModule,
|
1556
|
-
ApiModule,
|
1557
|
-
LauncherModule,
|
1558
|
-
LoaderModule,
|
1559
|
-
FlowNewHeaderModule,
|
1560
|
-
FlowDialogModule,
|
1561
|
-
SdkCoreModule,
|
1562
|
-
GuidedSellingModule] });
|
1563
|
-
FlowModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowModule, providers: [FlowService, FlowDialogService, FlowGuidedSellingService], imports: [CommonModule,
|
1564
|
-
LetDirectiveModule,
|
1565
|
-
FlowRoutingModule,
|
1566
|
-
ApiModule,
|
1567
|
-
LauncherModule,
|
1568
|
-
LoaderModule,
|
1569
|
-
FlowNewHeaderModule,
|
1570
|
-
FlowDialogModule,
|
1571
|
-
SdkCoreModule,
|
1572
|
-
GuidedSellingModule] });
|
1573
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowModule, decorators: [{
|
1574
|
-
type: NgModule,
|
1575
|
-
args: [{
|
1576
|
-
declarations: [FlowComponent],
|
1577
|
-
imports: [
|
1578
|
-
CommonModule,
|
1579
|
-
LetDirectiveModule,
|
1580
|
-
FlowRoutingModule,
|
1581
|
-
ApiModule,
|
1582
|
-
LauncherModule,
|
1583
|
-
LoaderModule,
|
1584
|
-
FlowNewHeaderModule,
|
1585
|
-
FlowDialogModule,
|
1586
|
-
SdkCoreModule,
|
1587
|
-
GuidedSellingModule,
|
1588
|
-
],
|
1589
|
-
providers: [FlowService, FlowDialogService, FlowGuidedSellingService],
|
1590
|
-
}]
|
1591
|
-
}] });
|
1592
|
-
|
1593
|
-
/**
|
1594
|
-
* Generated bundle index. Do not edit.
|
1595
|
-
*/
|
1596
|
-
|
1597
|
-
export { FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE };
|
1598
|
-
//# sourceMappingURL=veloceapps-sdk.mjs.map
|