@flarehr/apollo-super-selection 5.24.54264 → 5.25.54575
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/dist/lib/apollo-super-selection/apollo-super-selection.css +1 -1
- package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
- package/dist/lib/apollo-super-selection/p-64e00db6.entry.js +14 -0
- package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -1
- package/dist/lib/apollo-super-selection/p-cf19c194.system.entry.js +69 -0
- package/dist/lib/cjs/apollo-super-selection.cjs.js +1 -1
- package/dist/lib/cjs/loader.cjs.js +1 -1
- package/dist/lib/cjs/{sss-button_43.cjs.entry.js → sss-button_31.cjs.entry.js} +947 -2250
- package/dist/lib/collection/apollo-super-selection.css +1 -1
- package/dist/lib/collection/collection-manifest.json +1 -25
- package/dist/lib/collection/components/super-campaign/super-campaign.js +8 -16
- package/dist/lib/collection/components/super-selection-app/api/super-selection.api.dto.js +26 -25
- package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +0 -9
- package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +5 -9
- package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.js +9 -13
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/api/slate.js +4 -0
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.js +3 -3
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-smsf.js +2 -2
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-my-own-fund.js +3 -3
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-smsf.js +3 -3
- package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill.js +1 -1
- package/dist/lib/collection/components/super-selection-app/services/existing-super-choice-info.service.js +4 -16
- package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +1 -9
- package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +1 -35
- package/dist/lib/collection/components/super-selection-app/services/super-selection.store.js +1 -3
- package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.js +16 -13
- package/dist/lib/collection/components/super-selection-app/super-selection-app.js +3 -17
- package/dist/lib/esm/apollo-super-selection.js +1 -1
- package/dist/lib/esm/loader.js +1 -1
- package/dist/lib/esm/{sss-button_43.entry.js → sss-button_31.entry.js} +948 -2239
- package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
- package/dist/lib/esm-es5/loader.js +1 -1
- package/dist/lib/esm-es5/sss-button_31.entry.js +69 -0
- package/dist/lib/types/components/super-campaign/super-campaign-types.d.ts +4 -0
- package/dist/lib/types/components/super-campaign/super-campaign.d.ts +0 -1
- package/dist/lib/types/components/super-selection-app/api/super-selection.api.d.ts +1 -2
- package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +1 -10
- package/dist/lib/types/components/super-selection-app/footer-section/footer-section.d.ts +1 -2
- package/dist/lib/types/components/super-selection-app/funds/slate-super/api/slate.d.ts +4 -0
- package/dist/lib/types/components/super-selection-app/services/super-selection-app.routes.d.ts +0 -4
- package/dist/lib/types/components/super-selection-app/services/super-selection-app.service.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/services/super-selection.store.d.ts +1 -3
- package/dist/lib/types/components/super-selection-app/super-selection-app.d.ts +0 -2
- package/dist/lib/types/components.d.ts +2 -203
- package/package.json +1 -1
- package/dist/lib/apollo-super-selection/assets/icon-check.svg +0 -3
- package/dist/lib/apollo-super-selection/assets/logo-active.svg +0 -1
- package/dist/lib/apollo-super-selection/assets/logo-art.svg +0 -7
- package/dist/lib/apollo-super-selection/assets/logo-aus-eth.svg +0 -31
- package/dist/lib/apollo-super-selection/assets/logo-aware.svg +0 -58
- package/dist/lib/apollo-super-selection/assets/logo-first.svg +0 -15
- package/dist/lib/apollo-super-selection/assets/logo-hesta.svg +0 -5
- package/dist/lib/apollo-super-selection/assets/logo-mercer-mychoice.svg +0 -1
- package/dist/lib/apollo-super-selection/assets/logo-rei.svg +0 -27
- package/dist/lib/apollo-super-selection/assets/logo-slate.png +0 -0
- package/dist/lib/apollo-super-selection/assets/logo-spirit.svg +0 -141
- package/dist/lib/apollo-super-selection/assets/logo-unisuper.svg +0 -15
- package/dist/lib/apollo-super-selection/assets/logo-virgin.svg +0 -8
- package/dist/lib/apollo-super-selection/assets/unisuper-default-badge1.svg +0 -25
- package/dist/lib/apollo-super-selection/assets/unisuper-default-badge2.svg +0 -109
- package/dist/lib/apollo-super-selection/assets/unisuper-default-badge3.svg +0 -102
- package/dist/lib/apollo-super-selection/p-203c74a8.entry.js +0 -14
- package/dist/lib/apollo-super-selection/p-b0120851.system.entry.js +0 -69
- package/dist/lib/collection/components/super-selection-app/assets/icon-check.svg +0 -3
- package/dist/lib/collection/components/super-selection-app/consent/consent-wrapper.js +0 -32
- package/dist/lib/collection/components/super-selection-app/consent/consent.js +0 -88
- package/dist/lib/collection/components/super-selection-app/funds/constants.js +0 -43
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/active.js +0 -26
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/australian-ethical.js +0 -43
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/australian-retirement-trust.js +0 -32
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/aware.js +0 -38
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/first.js +0 -27
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/hesta-default.js +0 -34
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/mercermychoice.js +0 -33
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/rei.js +0 -33
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/slate.js +0 -32
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/spirit.js +0 -43
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/unisuper-default-v2.js +0 -56
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/unisuper-default.js +0 -49
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/virgin.js +0 -37
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-join-v1-page.js +0 -30
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-join-v2-page.js +0 -30
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund.store.js +0 -10
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v1-iframe-builder.js +0 -125
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v2-iframe-builder.js +0 -271
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v2-types.js +0 -1
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/types.js +0 -15
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/services/slate-iframe-builder.js +0 -143
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-join-page.js +0 -30
- package/dist/lib/collection/components/super-selection-app/loading-component/loading-component.js +0 -29
- package/dist/lib/collection/components/super-selection-app/loading-super-indicator/loading-super-indicator.js +0 -11
- package/dist/lib/collection/components/super-selection-app/misc/iframe-host.js +0 -32
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-active.svg +0 -1
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-art.svg +0 -7
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-aus-eth.svg +0 -31
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-aware.svg +0 -58
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-first.svg +0 -15
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-hesta.svg +0 -5
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-mercer-mychoice.svg +0 -1
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-rei.svg +0 -27
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-slate.png +0 -0
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-spirit.svg +0 -141
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-unisuper.svg +0 -15
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-virgin.svg +0 -8
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/unisuper-default-badge1.svg +0 -25
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/unisuper-default-badge2.svg +0 -109
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/unisuper-default-badge3.svg +0 -102
- package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.js +0 -112
- package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.js +0 -178
- package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page-wrapper.js +0 -32
- package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.js +0 -171
- package/dist/lib/esm-es5/sss-button_43.entry.js +0 -69
- package/dist/lib/types/components/super-selection-app/consent/consent-wrapper.d.ts +0 -5
- package/dist/lib/types/components/super-selection-app/consent/consent.d.ts +0 -9
- package/dist/lib/types/components/super-selection-app/funds/constants.d.ts +0 -9
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/active.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/australian-ethical.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/australian-retirement-trust.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/aware.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/first.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/hesta-default.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/mercermychoice.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/rei.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/slate.d.ts +0 -4
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/spirit.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/unisuper-default-v2.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/unisuper-default.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/virgin.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund-join-v1-page.d.ts +0 -5
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund-join-v2-page.d.ts +0 -5
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund.store.d.ts +0 -10
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v1-iframe-builder.d.ts +0 -10
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v2-iframe-builder.d.ts +0 -12
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v2-types.d.ts +0 -75
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/types.d.ts +0 -26
- package/dist/lib/types/components/super-selection-app/funds/slate-super/services/slate-iframe-builder.d.ts +0 -14
- package/dist/lib/types/components/super-selection-app/funds/slate-super/slate-join-page.d.ts +0 -5
- package/dist/lib/types/components/super-selection-app/loading-component/loading-component.d.ts +0 -4
- package/dist/lib/types/components/super-selection-app/loading-super-indicator/loading-super-indicator.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/misc/iframe-host.d.ts +0 -6
- package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.d.ts +0 -10
- package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.d.ts +0 -12
- package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-page-wrapper.d.ts +0 -5
- package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-page.d.ts +0 -10
package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/virgin.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { some } from 'fp-ts/lib/Option';
|
|
3
|
-
import { SuperSelectionAppRoutes } from '../../../services/super-selection-app.routes';
|
|
4
|
-
import { Link, pdsViewedAsync, PoweredByFlareFS } from '../types';
|
|
5
|
-
const name = 'Virgin Money Super';
|
|
6
|
-
const fund = {
|
|
7
|
-
fundId: 'virgin',
|
|
8
|
-
name,
|
|
9
|
-
logo: 'logo-virgin.svg',
|
|
10
|
-
route: SuperSelectionAppRoutes.PromotedFundJoinV2,
|
|
11
|
-
features: [
|
|
12
|
-
h("p", null,
|
|
13
|
-
"Returns above industry and retail super fund medians over the past 5 years",
|
|
14
|
-
h("sup", { class: "text-tiny" }, "1")),
|
|
15
|
-
h("p", null, "One of the lowest fees in the market"),
|
|
16
|
-
h("p", null,
|
|
17
|
-
"Virgin Money rewards you with Velocity Points on your contributions",
|
|
18
|
-
h("sup", { class: "text-tiny" }, "2"))
|
|
19
|
-
],
|
|
20
|
-
featureSubText: (h("div", { class: "m-4 pt-2" },
|
|
21
|
-
h("ol", { class: "list-decimal space-y-2" },
|
|
22
|
-
h("li", null,
|
|
23
|
-
h("span", null, "Past performance is not a reliable indicator of future performance. Source: SuperRatings Fund Crediting Rate Survey April 2022.")),
|
|
24
|
-
h("li", null,
|
|
25
|
-
h("span", null,
|
|
26
|
-
h(Link, { className: "underline underline-offset-2 hover:text-gray-600", href: "https://virginmoney.com.au/superannuation/forms-and-key-information/key-documents" }, "Eligibility and T&Cs apply")))))),
|
|
27
|
-
disclaimer: (h("p", null,
|
|
28
|
-
"Prepared by Virgin Money Financial Services Pty Ltd ABN 51 113 285 395 AFSL 286869 (\u2018Virgin Money\u2019). Virgin Money Super is a plan in the Mercer Super Trust ABN 19 905 422 981. Virgin Money Super is issued by Mercer Superannuation (Australia) Limited (MSAL) ABN 79 004 717 533 AFSL 235906 as trustee of the Mercer Super Trust. Consider the PDS and TMD at",
|
|
29
|
-
' ',
|
|
30
|
-
h(Link, { href: "https://virginmoney.com.au/superannuation/", onClick: () => pdsViewedAsync(name) }, "www.virginmoney.com.au"),
|
|
31
|
-
' ',
|
|
32
|
-
"before making a decision")),
|
|
33
|
-
footnoteTextOverride: some(PoweredByFlareFS),
|
|
34
|
-
dtoPropName: 'virgin',
|
|
35
|
-
extraBadge: (h("span", { class: "text-xs bg-green-100 text-green-800 font-medium rounded-xl py-0.5 px-2.5 mr-1" }, "Low fees"))
|
|
36
|
-
};
|
|
37
|
-
export default fund;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Component, h, Prop } from '@stencil/core';
|
|
2
|
-
import PromotedFundJoinV1IFrameBuilder from './services/promoted-fund-join-v1-iframe-builder';
|
|
3
|
-
export class PromotedFundJoinV1Page {
|
|
4
|
-
render() {
|
|
5
|
-
return (h("sss-iframe-host", { build: (iframe) => PromotedFundJoinV1IFrameBuilder.build(iframe, this.history) }));
|
|
6
|
-
}
|
|
7
|
-
static get is() { return "sss-promoted-fund-join-v1-page"; }
|
|
8
|
-
static get properties() { return {
|
|
9
|
-
"history": {
|
|
10
|
-
"type": "unknown",
|
|
11
|
-
"mutable": false,
|
|
12
|
-
"complexType": {
|
|
13
|
-
"original": "RouterHistory",
|
|
14
|
-
"resolved": "RouterHistory",
|
|
15
|
-
"references": {
|
|
16
|
-
"RouterHistory": {
|
|
17
|
-
"location": "import",
|
|
18
|
-
"path": "@stencil/router"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"required": false,
|
|
23
|
-
"optional": false,
|
|
24
|
-
"docs": {
|
|
25
|
-
"tags": [],
|
|
26
|
-
"text": ""
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}; }
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Component, h, Prop } from '@stencil/core';
|
|
2
|
-
import PromotedFundJoinV2IFrameBuilder from './services/promoted-fund-join-v2-iframe-builder';
|
|
3
|
-
export class PromotedFundJoinV2Page {
|
|
4
|
-
render() {
|
|
5
|
-
return (h("sss-iframe-host", { build: (iframe) => PromotedFundJoinV2IFrameBuilder.build(iframe, this.history) }));
|
|
6
|
-
}
|
|
7
|
-
static get is() { return "sss-promoted-fund-join-v2-page"; }
|
|
8
|
-
static get properties() { return {
|
|
9
|
-
"history": {
|
|
10
|
-
"type": "unknown",
|
|
11
|
-
"mutable": false,
|
|
12
|
-
"complexType": {
|
|
13
|
-
"original": "RouterHistory",
|
|
14
|
-
"resolved": "RouterHistory",
|
|
15
|
-
"references": {
|
|
16
|
-
"RouterHistory": {
|
|
17
|
-
"location": "import",
|
|
18
|
-
"path": "@stencil/router"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"required": false,
|
|
23
|
-
"optional": false,
|
|
24
|
-
"docs": {
|
|
25
|
-
"tags": [],
|
|
26
|
-
"text": ""
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}; }
|
|
30
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { pipe } from 'fp-ts/lib/function';
|
|
2
|
-
import * as O from 'fp-ts/lib/Option';
|
|
3
|
-
import iframeUtil from '../../../../../utils/iframe';
|
|
4
|
-
import navigationService from '../../../services/navigation.service';
|
|
5
|
-
import { SuperSelectionAppRoutes } from '../../../services/super-selection-app.routes';
|
|
6
|
-
import superSelectionAppService from '../../../services/super-selection-app.service';
|
|
7
|
-
import { getFundNameByFundId } from '../../constants';
|
|
8
|
-
import promotedFundChoiceApi from '../api/promoted-fund-choice.api';
|
|
9
|
-
import promotedFundState from '../promoted-fund.store';
|
|
10
|
-
import { reset as resetPromotedFundState } from '../promoted-fund.store';
|
|
11
|
-
class PromotedFundJoinV1IFrameBuilder {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.hostIsLocalSuperSelection = () => window.location.origin === 'http://localhost:7100';
|
|
14
|
-
this.environmentDiscriminator = () => {
|
|
15
|
-
return this.hostIsLocalSuperSelection()
|
|
16
|
-
? 'autodev-partner'
|
|
17
|
-
: window.location.hostname.toLowerCase().split('.')[0];
|
|
18
|
-
};
|
|
19
|
-
this.promotedFundJoinAppUrl = () => {
|
|
20
|
-
return `https://${this.environmentDiscriminator()}.flarehr.com/promoted-fund-join/embed/v1.0/web`;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
build(iframe, history) {
|
|
24
|
-
if (!(iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument))
|
|
25
|
-
return;
|
|
26
|
-
const postData = Object.assign(Object.assign({}, this.getMemberData()), { partnerId: superSelectionAppService.partnerIdOrDefault, accountId: superSelectionAppService.accountIdOrDefault, fundId: promotedFundState.fund.id, authToken: superSelectionAppService.jwt });
|
|
27
|
-
const handleMessage = (event) => {
|
|
28
|
-
const { data } = event;
|
|
29
|
-
if (!data) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (data.sender === 'promoted-fund-redirect') {
|
|
33
|
-
window.removeEventListener('message', handleMessage);
|
|
34
|
-
switch (data.type) {
|
|
35
|
-
case 'cancel':
|
|
36
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ChoicePage);
|
|
37
|
-
break;
|
|
38
|
-
case 'success':
|
|
39
|
-
if (data.memberNumber) {
|
|
40
|
-
const promotedFundId = promotedFundState.fund.id;
|
|
41
|
-
const fundName = pipe(getFundNameByFundId(promotedFundId), O.getOrElse(() => ''));
|
|
42
|
-
const usi = data.usi.replace(/ /g, '');
|
|
43
|
-
navigationService.navigateInternallyToStandardChoice({
|
|
44
|
-
history,
|
|
45
|
-
fundName,
|
|
46
|
-
fundDetails: {
|
|
47
|
-
type: 'promoted',
|
|
48
|
-
fundName,
|
|
49
|
-
fundUsi: usi,
|
|
50
|
-
memberNumber: data.memberNumber,
|
|
51
|
-
promotedFundId
|
|
52
|
-
},
|
|
53
|
-
handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync(Object.assign({ fundId: promotedFundId, memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, usi,
|
|
54
|
-
standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig)),
|
|
55
|
-
promotedFundId
|
|
56
|
-
});
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
/* falls through */
|
|
60
|
-
default:
|
|
61
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ChoicePage);
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
resetPromotedFundState();
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (data.sender === 'promoted-fund-join') {
|
|
68
|
-
switch (data.type) {
|
|
69
|
-
case 'contentResized':
|
|
70
|
-
iframe.height = data.height > 0 ? data.height : iframe.height;
|
|
71
|
-
iframe.width = data.width > 0 ? data.width : iframe.width;
|
|
72
|
-
break;
|
|
73
|
-
case 'pageNavigated':
|
|
74
|
-
window.scroll(iframe.offsetLeft, iframe.offsetTop);
|
|
75
|
-
iframeUtil.navigation(window.location.href);
|
|
76
|
-
break;
|
|
77
|
-
default:
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
window.addEventListener('message', handleMessage);
|
|
83
|
-
const iframeDoc = iframe.contentDocument;
|
|
84
|
-
iframeDoc.open();
|
|
85
|
-
const form = iframeDoc.createElement('form');
|
|
86
|
-
form.method = 'POST';
|
|
87
|
-
form.target = '_self';
|
|
88
|
-
form.action = this.promotedFundJoinAppUrl();
|
|
89
|
-
let prop;
|
|
90
|
-
for (prop in postData) {
|
|
91
|
-
const value = postData[prop];
|
|
92
|
-
if (value !== undefined) {
|
|
93
|
-
const input = document.createElement('input');
|
|
94
|
-
input.type = 'hidden';
|
|
95
|
-
input.name = prop;
|
|
96
|
-
input.value = value;
|
|
97
|
-
form.append(input);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
iframeDoc.appendChild(form);
|
|
101
|
-
iframeDoc.close();
|
|
102
|
-
form.submit();
|
|
103
|
-
}
|
|
104
|
-
getMemberData() {
|
|
105
|
-
var _a, _b;
|
|
106
|
-
const superBuyer = superSelectionAppService.superBuyer;
|
|
107
|
-
return {
|
|
108
|
-
title: superBuyer.userProfile.title,
|
|
109
|
-
firstName: superBuyer.userProfile.firstName,
|
|
110
|
-
middleName: superBuyer.userProfile.middleName,
|
|
111
|
-
lastName: superBuyer.userProfile.lastName,
|
|
112
|
-
dateOfBirth: superBuyer.userProfile.dateOfBirth,
|
|
113
|
-
gender: superBuyer.userProfile.gender,
|
|
114
|
-
email: superBuyer.userProfile.email,
|
|
115
|
-
mobilePhone: superBuyer.userProfile.mobilePhone,
|
|
116
|
-
taxFileNumber: (_a = superBuyer.tfn) !== null && _a !== void 0 ? _a : '',
|
|
117
|
-
addressLine1: superBuyer.userProfile.address.addressLine1,
|
|
118
|
-
addressLine2: (_b = superBuyer.userProfile.address.addressLine2) !== null && _b !== void 0 ? _b : '',
|
|
119
|
-
city: superBuyer.userProfile.address.city,
|
|
120
|
-
state: superBuyer.userProfile.address.state,
|
|
121
|
-
postCode: superBuyer.userProfile.address.postcode
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
export default new PromotedFundJoinV1IFrameBuilder();
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import { pipe } from 'fp-ts/lib/function';
|
|
2
|
-
import * as O from 'fp-ts/lib/Option';
|
|
3
|
-
import { assertExhaustive } from '../../../../../utils';
|
|
4
|
-
import iframeUtil from '../../../../../utils/iframe';
|
|
5
|
-
import appInsightsService from '../../../../app-host/services/appinsights.service';
|
|
6
|
-
import navigationService from '../../../services/navigation.service';
|
|
7
|
-
import { SuperSelectionAppRoutes } from '../../../services/super-selection-app.routes';
|
|
8
|
-
import superSelectionAppService from '../../../services/super-selection-app.service';
|
|
9
|
-
import { getFundNameByFundId } from '../../constants';
|
|
10
|
-
import customFundChoiceApi from '../../custom-fund/api/custom-fund-choice.api';
|
|
11
|
-
import promotedFundChoiceApi from '../api/promoted-fund-choice.api';
|
|
12
|
-
import promotedFundState from '../promoted-fund.store';
|
|
13
|
-
import { reset as resetPromotedFundState } from '../promoted-fund.store';
|
|
14
|
-
class PromotedFundJoinV2IFrameBuilder {
|
|
15
|
-
constructor() {
|
|
16
|
-
this.getFundName = (fundId) => {
|
|
17
|
-
return pipe(getFundNameByFundId(fundId), O.getOrElse(() => ''));
|
|
18
|
-
};
|
|
19
|
-
this.cleanUsi = (usi) => {
|
|
20
|
-
return usi.replace(/ /g, '');
|
|
21
|
-
};
|
|
22
|
-
this.stringIsNullOrEmtpty = (s) => {
|
|
23
|
-
return !(typeof s === 'string' && s.trim().length > 0);
|
|
24
|
-
};
|
|
25
|
-
this.environmentDiscriminator = () => {
|
|
26
|
-
const discriminator = window.location.hostname.toLowerCase().split('.')[0];
|
|
27
|
-
switch (discriminator) {
|
|
28
|
-
case 'autodev-partner':
|
|
29
|
-
case 'test-partner':
|
|
30
|
-
case 'partner':
|
|
31
|
-
case 'sandbox-partner':
|
|
32
|
-
return discriminator.replace('partner', '');
|
|
33
|
-
default:
|
|
34
|
-
return 'autodev-';
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
this.promotedFundJoinAppUrl = () => {
|
|
38
|
-
return `https://${this.environmentDiscriminator()}api.simplefinancialchoices.com/promoted-funds/embed`;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
build(iframe, history) {
|
|
42
|
-
if (!(iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument))
|
|
43
|
-
return;
|
|
44
|
-
const postData = Object.assign(Object.assign({}, this.getMemberData()), { partnerId: superSelectionAppService.partnerIdOrDefault, accountId: superSelectionAppService.accountIdOrDefault, fundId: promotedFundState.fund.id, authToken: superSelectionAppService.jwt, employerDefault: promotedFundState.fund.type === 'PromotedDefault', definedBenefitsEligibility: O.toUndefined(superSelectionAppService.isDefinedBenefitsEligible) });
|
|
45
|
-
const handleMessage = async (event) => {
|
|
46
|
-
const { data } = event;
|
|
47
|
-
if (!data) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (data.sender === 'promoted-fund-redirect') {
|
|
51
|
-
window.removeEventListener('message', handleMessage);
|
|
52
|
-
switch (data.type) {
|
|
53
|
-
case 'cancel':
|
|
54
|
-
if (promotedFundState.fund.type === 'DefinedBenefits') {
|
|
55
|
-
// Note: we don't expect a cancel event from Defined Benefits flow but just in case
|
|
56
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ConsentPage);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ChoicePage);
|
|
60
|
-
}
|
|
61
|
-
break;
|
|
62
|
-
case 'success': {
|
|
63
|
-
const promotedFundId = promotedFundState.fund.id;
|
|
64
|
-
const fundName = this.getFundName(promotedFundId);
|
|
65
|
-
const usi = this.cleanUsi(data.usi);
|
|
66
|
-
switch (promotedFundState.fund.type) {
|
|
67
|
-
case 'Promoted':
|
|
68
|
-
if (this.stringIsNullOrEmtpty(data.memberNumber) ||
|
|
69
|
-
this.stringIsNullOrEmtpty(data.usi)) {
|
|
70
|
-
appInsightsService.trackErrorTrace('PFJ C# did not return (Promoted) memberNumber and/or usi');
|
|
71
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ChoicePage);
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
navigationService.navigateInternallyToStandardChoice({
|
|
75
|
-
history,
|
|
76
|
-
fundName,
|
|
77
|
-
promotedFundId,
|
|
78
|
-
fundDetails: {
|
|
79
|
-
type: 'promoted',
|
|
80
|
-
fundName,
|
|
81
|
-
fundUsi: usi,
|
|
82
|
-
memberNumber: data.memberNumber,
|
|
83
|
-
promotedFundId
|
|
84
|
-
},
|
|
85
|
-
handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync(Object.assign({ fundId: promotedFundId, memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, usi: data.usi.replace(/ /g, ''), standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig))
|
|
86
|
-
});
|
|
87
|
-
break;
|
|
88
|
-
case 'PromotedDefault':
|
|
89
|
-
if (this.stringIsNullOrEmtpty(data.usi)) {
|
|
90
|
-
appInsightsService.trackErrorTrace('PFJ C# did not return (PromotedDefault) usi');
|
|
91
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ChoicePage);
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
navigationService.navigateInternallyToStandardChoice({
|
|
95
|
-
history,
|
|
96
|
-
fundName,
|
|
97
|
-
promotedFundId,
|
|
98
|
-
fundDetails: {
|
|
99
|
-
type: 'promotedDefault',
|
|
100
|
-
fundName,
|
|
101
|
-
fundUsi: usi,
|
|
102
|
-
promotedFundId
|
|
103
|
-
},
|
|
104
|
-
handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitDefaultChoiceAsync(Object.assign({ fundId: promotedFundId, usi,
|
|
105
|
-
standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig))
|
|
106
|
-
});
|
|
107
|
-
break;
|
|
108
|
-
case 'DefinedBenefits':
|
|
109
|
-
throw Error('DefinedBenefits is not supported in legacy "success" message');
|
|
110
|
-
case 'null':
|
|
111
|
-
throw Error('PromotedFundState.type was not set.');
|
|
112
|
-
default:
|
|
113
|
-
assertExhaustive(promotedFundState.fund.type);
|
|
114
|
-
}
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
case 'success-promoted': {
|
|
118
|
-
if (this.stringIsNullOrEmtpty(data.memberNumber) ||
|
|
119
|
-
this.stringIsNullOrEmtpty(data.usi)) {
|
|
120
|
-
appInsightsService.trackErrorTrace('PFJ C# did not return (Promoted) memberNumber and/or usi');
|
|
121
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ChoicePage);
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
const usi = this.cleanUsi(data.usi);
|
|
125
|
-
const fundName = this.getFundName(data.fundId);
|
|
126
|
-
navigationService.navigateInternallyToStandardChoice({
|
|
127
|
-
history,
|
|
128
|
-
fundName,
|
|
129
|
-
promotedFundId: data.fundId,
|
|
130
|
-
fundDetails: {
|
|
131
|
-
type: 'promoted',
|
|
132
|
-
fundName,
|
|
133
|
-
fundUsi: usi,
|
|
134
|
-
memberNumber: data.memberNumber,
|
|
135
|
-
promotedFundId: data.fundId
|
|
136
|
-
},
|
|
137
|
-
handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync(Object.assign({ fundId: data.fundId, memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, usi,
|
|
138
|
-
standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig))
|
|
139
|
-
});
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
case 'success-promoted-default': {
|
|
143
|
-
if (this.stringIsNullOrEmtpty(data.usi)) {
|
|
144
|
-
appInsightsService.trackErrorTrace('PFJ C# did not return (PromotedDefault) usi');
|
|
145
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ChoicePage);
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
const usi = this.cleanUsi(data.usi);
|
|
149
|
-
const fundName = this.getFundName(data.fundId);
|
|
150
|
-
navigationService.navigateInternallyToStandardChoice({
|
|
151
|
-
history,
|
|
152
|
-
fundName,
|
|
153
|
-
promotedFundId: data.fundId,
|
|
154
|
-
fundDetails: {
|
|
155
|
-
type: 'promotedDefault',
|
|
156
|
-
fundName,
|
|
157
|
-
fundUsi: usi,
|
|
158
|
-
promotedFundId: data.fundId
|
|
159
|
-
},
|
|
160
|
-
handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitDefaultChoiceAsync(Object.assign({ fundId: data.fundId, usi,
|
|
161
|
-
standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig))
|
|
162
|
-
});
|
|
163
|
-
break;
|
|
164
|
-
}
|
|
165
|
-
case 'success-promoted-default-with-join': {
|
|
166
|
-
if (this.stringIsNullOrEmtpty(data.memberNumber) ||
|
|
167
|
-
this.stringIsNullOrEmtpty(data.usi)) {
|
|
168
|
-
appInsightsService.trackErrorTrace('PFJ C# did not return (PromotedDefaultWithJoin) memberNumber and/or usi');
|
|
169
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ChoicePage);
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
const usi = this.cleanUsi(data.usi);
|
|
173
|
-
const fundName = this.getFundName(data.fundId);
|
|
174
|
-
navigationService.navigateInternallyToStandardChoice({
|
|
175
|
-
history,
|
|
176
|
-
fundName,
|
|
177
|
-
promotedFundId: data.fundId,
|
|
178
|
-
fundDetails: {
|
|
179
|
-
type: 'promotedDefaultWithJoin',
|
|
180
|
-
fundName,
|
|
181
|
-
fundUsi: usi,
|
|
182
|
-
memberNumber: data.memberNumber,
|
|
183
|
-
promotedFundId: data.fundId
|
|
184
|
-
},
|
|
185
|
-
handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitDefaultChoiceWithJoinAsync(Object.assign({ fundId: data.fundId, memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, usi,
|
|
186
|
-
standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig))
|
|
187
|
-
});
|
|
188
|
-
break;
|
|
189
|
-
}
|
|
190
|
-
case 'success-defined-benefits':
|
|
191
|
-
if (this.stringIsNullOrEmtpty(data.memberNumber) ||
|
|
192
|
-
this.stringIsNullOrEmtpty(data.usi)) {
|
|
193
|
-
appInsightsService.trackErrorTrace('PFJ C# did not return (DefinedBenefits) memberNumber and/or usi');
|
|
194
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ConsentPage);
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
await customFundChoiceApi.submitDefinedBenefitsChoiceAsync(Object.assign(Object.assign({ fundUsi: this.cleanUsi(data.usi) }, data), superSelectionAppService.promotedFundsConfig));
|
|
198
|
-
superSelectionAppService.markSuperSelectionAsSubmitted();
|
|
199
|
-
break;
|
|
200
|
-
/* falls through */
|
|
201
|
-
default:
|
|
202
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ChoicePage);
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
resetPromotedFundState();
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
if (data.sender === 'promoted-fund-join') {
|
|
209
|
-
switch (data.type) {
|
|
210
|
-
case 'contentResized':
|
|
211
|
-
iframe.height = data.height > 0 ? String(data.height) : iframe.height;
|
|
212
|
-
iframe.width = data.width > 0 ? String(data.width) : iframe.width;
|
|
213
|
-
break;
|
|
214
|
-
case 'pageNavigated':
|
|
215
|
-
window.scroll(iframe.offsetLeft, iframe.offsetTop);
|
|
216
|
-
iframeUtil.navigation(window.location.href);
|
|
217
|
-
break;
|
|
218
|
-
default:
|
|
219
|
-
break;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
window.addEventListener('message', handleMessage);
|
|
224
|
-
const iframeDoc = iframe.contentDocument;
|
|
225
|
-
iframeDoc.open();
|
|
226
|
-
const form = iframeDoc.createElement('form');
|
|
227
|
-
form.method = 'POST';
|
|
228
|
-
form.target = '_self';
|
|
229
|
-
form.action = this.promotedFundJoinAppUrl();
|
|
230
|
-
let prop;
|
|
231
|
-
for (prop in postData) {
|
|
232
|
-
const value = postData[prop];
|
|
233
|
-
if (value !== undefined) {
|
|
234
|
-
const input = document.createElement('input');
|
|
235
|
-
input.name = prop;
|
|
236
|
-
input.type = 'hidden';
|
|
237
|
-
if (typeof value === 'boolean') {
|
|
238
|
-
input.value = value ? 'true' : 'false';
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
input.value = value;
|
|
242
|
-
}
|
|
243
|
-
form.append(input);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
iframeDoc.appendChild(form);
|
|
247
|
-
iframeDoc.close();
|
|
248
|
-
form.submit();
|
|
249
|
-
}
|
|
250
|
-
getMemberData() {
|
|
251
|
-
var _a, _b;
|
|
252
|
-
const superBuyer = superSelectionAppService.superBuyer;
|
|
253
|
-
return {
|
|
254
|
-
title: superBuyer.userProfile.title,
|
|
255
|
-
firstName: superBuyer.userProfile.firstName,
|
|
256
|
-
middleName: superBuyer.userProfile.middleName,
|
|
257
|
-
lastName: superBuyer.userProfile.lastName,
|
|
258
|
-
dateOfBirth: superBuyer.userProfile.dateOfBirth,
|
|
259
|
-
gender: superBuyer.userProfile.gender,
|
|
260
|
-
email: superBuyer.userProfile.email,
|
|
261
|
-
mobilePhone: superBuyer.userProfile.mobilePhone,
|
|
262
|
-
taxFileNumber: (_a = superBuyer.tfn) !== null && _a !== void 0 ? _a : '',
|
|
263
|
-
addressLine1: superBuyer.userProfile.address.addressLine1,
|
|
264
|
-
addressLine2: (_b = superBuyer.userProfile.address.addressLine2) !== null && _b !== void 0 ? _b : '',
|
|
265
|
-
city: superBuyer.userProfile.address.city,
|
|
266
|
-
state: superBuyer.userProfile.address.state,
|
|
267
|
-
postCode: superBuyer.userProfile.address.postcode
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
export default new PromotedFundJoinV2IFrameBuilder();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { EventTrackingService } from '../../services/event-tracking.service';
|
|
3
|
-
import navigationService from '../../services/navigation.service';
|
|
4
|
-
export const Link = (props, children) => {
|
|
5
|
-
return (h("a", { class: props.className || 'font-medium underline underline-offset-2 hover:text-gray-600', target: "_blank", href: navigationService.toExternalUrl(props.href), onClick: props.onClick }, children));
|
|
6
|
-
};
|
|
7
|
-
export const PoweredByFlareFS = 'Powered by Flare FS';
|
|
8
|
-
export function pdsViewedAsync(name, usi) {
|
|
9
|
-
return EventTrackingService.Instance.TrackSuperFundPdsViewedAsync({
|
|
10
|
-
fundUsi: usi,
|
|
11
|
-
fundName: name,
|
|
12
|
-
pageName: 'Panel Fund Page',
|
|
13
|
-
superCampaignEnabled: false
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import * as O from 'fp-ts/lib/Option';
|
|
2
|
-
import interopQuery from '../../../../app-host/services/interop.query';
|
|
3
|
-
import navigationService from '../../../services/navigation.service';
|
|
4
|
-
import { SuperSelectionAppRoutes } from '../../../services/super-selection-app.routes';
|
|
5
|
-
import superSelectionAppService from '../../../services/super-selection-app.service';
|
|
6
|
-
import slate, { slateUsi } from '../../promoted-fund/funds/slate';
|
|
7
|
-
import { reset as resetPromotedFundState } from '../../promoted-fund/promoted-fund.store';
|
|
8
|
-
import slateChoiceApi from '../api/slate-choice.api';
|
|
9
|
-
class SlateIFrameBuilder {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.hostIsLocalSuperSelection = () => window.location.origin === 'http://localhost:7100';
|
|
12
|
-
this.hostIsDeployed = () => window.location.origin.endsWith('partner.flarehr.com');
|
|
13
|
-
this.skipConsolidation = () => (interopQuery.isReactNativeInteropEnabled() ? 'true' : 'false');
|
|
14
|
-
this.skipInsurance = () => (interopQuery.isReactNativeInteropEnabled() ? 'true' : 'false');
|
|
15
|
-
this.environmentDiscriminator = () => {
|
|
16
|
-
const discriminator = window.location.hostname.toLowerCase().split('.')[0];
|
|
17
|
-
switch (discriminator) {
|
|
18
|
-
case 'autodev-partner':
|
|
19
|
-
case 'test-partner':
|
|
20
|
-
case 'partner':
|
|
21
|
-
case 'sandbox-partner':
|
|
22
|
-
return discriminator.replace('partner', '');
|
|
23
|
-
default:
|
|
24
|
-
return 'autodev-';
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
this.slateJoinAppUrl = () => {
|
|
28
|
-
return `https://${this.environmentDiscriminator()}join.slatesuper.com.au/confirm`;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
build(iframe, history) {
|
|
32
|
-
if (!(iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument))
|
|
33
|
-
return;
|
|
34
|
-
const baseUrl = this.hostIsLocalSuperSelection() || this.hostIsDeployed()
|
|
35
|
-
? `${window.location.origin}/super-selection/embed/v1.0/app`
|
|
36
|
-
: 'https://autodev-partner.flarehr.com/super-selection/embed/v1.0/app';
|
|
37
|
-
const redirectUrl = `${baseUrl}/slate-redirect.html`;
|
|
38
|
-
const postData = Object.assign(Object.assign({}, this.getSlateJoinMemberData()), { successRedirectUrl: redirectUrl, cancelRedirectUrl: redirectUrl, skipConsolidation: this.skipConsolidation(), skipInsurance: this.skipInsurance() });
|
|
39
|
-
if (this.includeJwt()) {
|
|
40
|
-
postData.authToken = superSelectionAppService.jwt;
|
|
41
|
-
}
|
|
42
|
-
const handleMessage = (event) => {
|
|
43
|
-
const { data, origin } = event;
|
|
44
|
-
if (!data) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (data.sender === 'slate-redirect') {
|
|
48
|
-
window.removeEventListener('message', handleMessage);
|
|
49
|
-
switch (data.type) {
|
|
50
|
-
case 'success':
|
|
51
|
-
if (data.memberNumber) {
|
|
52
|
-
navigationService.navigateInternallyToStandardChoice({
|
|
53
|
-
history,
|
|
54
|
-
fundName: slate.name,
|
|
55
|
-
fundDetails: {
|
|
56
|
-
type: 'promoted',
|
|
57
|
-
fundName: slate.name,
|
|
58
|
-
fundUsi: slateUsi,
|
|
59
|
-
memberNumber: data.memberNumber,
|
|
60
|
-
promotedFundId: slate.fundId
|
|
61
|
-
},
|
|
62
|
-
handleSubmitFn: (standardChoiceFormSignature) => slateChoiceApi.submitSlateChoiceAsync(Object.assign({ memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig)),
|
|
63
|
-
promotedFundId: slate.fundId
|
|
64
|
-
});
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
/* falls through */
|
|
68
|
-
default:
|
|
69
|
-
navigationService.navigateInternally(history, SuperSelectionAppRoutes.ChoicePage);
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
resetPromotedFundState();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (data.sender === 'flare' && origin.endsWith('join.slatesuper.com.au')) {
|
|
76
|
-
switch (data.type) {
|
|
77
|
-
case 'contentResized':
|
|
78
|
-
iframe.height = data.height > 0 ? data.height : iframe.height;
|
|
79
|
-
iframe.width = data.width > 0 ? data.width : iframe.width;
|
|
80
|
-
break;
|
|
81
|
-
default:
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
window.addEventListener('message', handleMessage);
|
|
87
|
-
const iframeDoc = iframe.contentDocument;
|
|
88
|
-
iframeDoc.open();
|
|
89
|
-
const form = iframeDoc.createElement('form');
|
|
90
|
-
form.method = 'POST';
|
|
91
|
-
form.target = '_self';
|
|
92
|
-
form.action = this.slateJoinAppUrl();
|
|
93
|
-
let prop;
|
|
94
|
-
for (prop in postData) {
|
|
95
|
-
const value = postData[prop];
|
|
96
|
-
if (value !== undefined) {
|
|
97
|
-
const input = document.createElement('input');
|
|
98
|
-
input.type = 'hidden';
|
|
99
|
-
input.name = prop;
|
|
100
|
-
input.value = value;
|
|
101
|
-
form.append(input);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
iframeDoc.appendChild(form);
|
|
105
|
-
iframeDoc.close();
|
|
106
|
-
form.submit();
|
|
107
|
-
}
|
|
108
|
-
getSlateJoinMemberData() {
|
|
109
|
-
var _a, _b;
|
|
110
|
-
const superBuyer = superSelectionAppService.superBuyer;
|
|
111
|
-
const toSlateGender = (gender) => {
|
|
112
|
-
switch (gender) {
|
|
113
|
-
case 'Male':
|
|
114
|
-
return 'Male';
|
|
115
|
-
case 'Female':
|
|
116
|
-
return 'Female';
|
|
117
|
-
case 'Intersex':
|
|
118
|
-
return 'Intersex/Indeterminate';
|
|
119
|
-
default:
|
|
120
|
-
return 'Unknown';
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
return {
|
|
124
|
-
firstName: superBuyer.userProfile.firstName,
|
|
125
|
-
middleName: superBuyer.userProfile.middleName,
|
|
126
|
-
lastName: superBuyer.userProfile.lastName,
|
|
127
|
-
dateOfBirth: superBuyer.userProfile.dateOfBirth,
|
|
128
|
-
gender: toSlateGender(superBuyer.userProfile.gender),
|
|
129
|
-
email: superBuyer.userProfile.email,
|
|
130
|
-
mobilePhone: superBuyer.userProfile.mobilePhone,
|
|
131
|
-
taxFileNumber: (_a = superBuyer.tfn) !== null && _a !== void 0 ? _a : '',
|
|
132
|
-
addressLine1: superBuyer.userProfile.address.addressLine1,
|
|
133
|
-
addressLine2: (_b = superBuyer.userProfile.address.addressLine2) !== null && _b !== void 0 ? _b : '',
|
|
134
|
-
city: superBuyer.userProfile.address.city,
|
|
135
|
-
state: superBuyer.userProfile.address.state,
|
|
136
|
-
postCode: superBuyer.userProfile.address.postcode
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
includeJwt() {
|
|
140
|
-
return !this.slateJoinAppUrl().match(/autodev|sandbox/);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
export default new SlateIFrameBuilder();
|