@saasquatch/mint-components 1.15.5-5 → 1.15.6
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/cjs/{ShadowViewAddon-28865623.js → ShadowViewAddon-e9dc77e3.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_17.cjs.entry.js +234 -384
- package/dist/cjs/{sqm-base-registration-form-view-8029d30e.js → sqm-base-registration-form-view-66f99821.js} +9 -4
- package/dist/cjs/sqm-big-stat_43.cjs.entry.js +10 -150
- package/dist/cjs/sqm-header-logo.cjs.entry.js +1 -8
- package/dist/cjs/{sqm-invoice-table-view-3f60fba9.js → sqm-invoice-table-view-5c74607f.js} +0 -1
- package/dist/cjs/sqm-portal-google-registration-form.cjs.entry.js +25 -18
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +8 -5
- package/dist/cjs/{usePayoutStatus-7892433f.js → usePayoutStatus-1ffd1cd4.js} +4 -176
- package/dist/collection/components/sqm-base-registration/BaseRegistrationForm.stories.js +2 -2
- package/dist/collection/components/sqm-base-registration/sqm-base-registration-form-view.js +9 -4
- package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +1 -1
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field.js +1 -1
- package/dist/collection/components/sqm-header-logo/sqm-header-logo.js +3 -73
- package/dist/collection/components/sqm-input-field/sqm-input-field.js +1 -1
- package/dist/collection/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.js +1 -1
- package/dist/collection/components/sqm-name-fields/NameFields.stories.js +2 -0
- package/dist/collection/components/sqm-name-fields/sqm-name-fields-view.js +3 -3
- package/dist/collection/components/sqm-name-fields/sqm-name-fields.js +31 -1
- package/dist/collection/components/sqm-name-fields/useNameFields.js +1 -0
- package/dist/collection/components/sqm-password-field/sqm-password-field.js +2 -2
- package/dist/collection/components/sqm-portal-google-registration-form/PortalGoogleRegistrationForm.stories.js +1 -0
- package/dist/collection/components/sqm-portal-google-registration-form/sqm-portal-google-registration-form.js +4 -4
- package/dist/collection/components/sqm-portal-google-registration-form/usePortalGoogleRegistrationForm.js +22 -15
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +0 -1
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +40 -46
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +2 -90
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +0 -353
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +5 -36
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +0 -300
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +2 -92
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +0 -300
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +12 -23
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +1 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +9 -92
- package/dist/esm/{ShadowViewAddon-f2176779.js → ShadowViewAddon-e0d5f1c9.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_17.entry.js +189 -339
- package/dist/esm/{sqm-base-registration-form-view-dafba287.js → sqm-base-registration-form-view-d81e316a.js} +9 -4
- package/dist/esm/sqm-big-stat_43.entry.js +11 -151
- package/dist/esm/sqm-header-logo.entry.js +1 -8
- package/dist/esm/{sqm-invoice-table-view-01453fa3.js → sqm-invoice-table-view-3491dd80.js} +0 -1
- package/dist/esm/sqm-portal-google-registration-form.entry.js +25 -18
- package/dist/esm/sqm-stencilbook.entry.js +8 -5
- package/dist/esm/{usePayoutStatus-c21ef382.js → usePayoutStatus-f09f2ec8.js} +6 -163
- package/dist/esm-es5/{ShadowViewAddon-f2176779.js → ShadowViewAddon-e0d5f1c9.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_17.entry.js +1 -1
- package/dist/esm-es5/sqm-base-registration-form-view-d81e316a.js +1 -0
- package/dist/esm-es5/sqm-big-stat_43.entry.js +1 -1
- package/dist/esm-es5/sqm-header-logo.entry.js +1 -1
- package/dist/esm-es5/sqm-invoice-table-view-3491dd80.js +1 -0
- package/dist/esm-es5/sqm-portal-google-registration-form.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/usePayoutStatus-f09f2ec8.js +6 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-15364635.entry.js +273 -0
- package/dist/mint-components/{p-4a731079.entry.js → p-1edebab1.entry.js} +2 -2
- package/dist/mint-components/p-2d8045c2.entry.js +220 -0
- package/dist/mint-components/p-3439af2f.system.entry.js +1 -0
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/{p-02832118.system.entry.js → p-3ac8613d.system.entry.js} +1 -1
- package/dist/mint-components/{p-c1b074b6.js → p-3b6dccec.js} +1 -1
- package/dist/mint-components/p-3df72337.js +46 -0
- package/dist/mint-components/p-43e274e9.entry.js +1 -0
- package/dist/mint-components/p-49932f12.system.js +1 -0
- package/dist/mint-components/p-5cda9960.system.entry.js +1 -0
- package/dist/mint-components/p-7dabdca6.system.entry.js +1 -0
- package/dist/mint-components/p-8db18561.system.entry.js +1 -0
- package/dist/mint-components/p-9308221f.js +1 -0
- package/dist/mint-components/p-bc021969.system.js +1 -0
- package/dist/mint-components/{p-0d939b73.system.js → p-d15b642f.system.js} +1 -1
- package/dist/mint-components/p-e8e48982.js +1 -0
- package/dist/mint-components/p-f82e3152.system.js +6 -0
- package/dist/mint-components/p-faba3198.entry.js +1 -0
- package/dist/types/components/sqm-base-registration/sqm-base-registration-form-view.d.ts +2 -1
- package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +1 -1
- package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field.d.ts +1 -1
- package/dist/types/components/sqm-header-logo/sqm-header-logo.d.ts +1 -14
- package/dist/types/components/sqm-input-field/sqm-input-field.d.ts +1 -1
- package/dist/types/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.d.ts +1 -1
- package/dist/types/components/sqm-name-fields/sqm-name-fields-view.d.ts +1 -0
- package/dist/types/components/sqm-name-fields/sqm-name-fields.d.ts +5 -0
- package/dist/types/components/sqm-name-fields/useNameFields.d.ts +1 -0
- package/dist/types/components/sqm-password-field/sqm-password-field.d.ts +1 -1
- package/dist/types/components/sqm-portal-google-registration-form/usePortalGoogleRegistrationForm.d.ts +2 -1
- package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +0 -23
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +0 -16
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +0 -57
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +1 -3
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +0 -48
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +0 -12
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +0 -48
- package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +0 -2
- package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +0 -1
- package/dist/types/components.d.ts +11 -331
- package/dist/types/global/android.d.ts +7 -0
- package/dist/types/global/demo.d.ts +2 -0
- package/dist/types/stories/features.d.ts +4 -0
- package/dist/types/stories/templates.d.ts +4 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/sqm-base-registration-form-view-dafba287.js +0 -1
- package/dist/esm-es5/sqm-invoice-table-view-01453fa3.js +0 -1
- package/dist/esm-es5/usePayoutStatus-c21ef382.js +0 -6
- package/dist/mint-components/p-2651ef99.system.js +0 -1
- package/dist/mint-components/p-35701119.js +0 -1
- package/dist/mint-components/p-48552798.system.entry.js +0 -1
- package/dist/mint-components/p-498bbce7.system.entry.js +0 -1
- package/dist/mint-components/p-59fe6066.js +0 -1
- package/dist/mint-components/p-67035b70.system.entry.js +0 -1
- package/dist/mint-components/p-86a5db85.system.js +0 -1
- package/dist/mint-components/p-9c4f4cd6.entry.js +0 -1
- package/dist/mint-components/p-a3647f70.system.entry.js +0 -1
- package/dist/mint-components/p-aa595246.system.js +0 -6
- package/dist/mint-components/p-bdbf26da.entry.js +0 -273
- package/dist/mint-components/p-cb87eadd.entry.js +0 -1
- package/dist/mint-components/p-d289d251.entry.js +0 -109
- package/dist/mint-components/p-d9da598f.js +0 -157
|
@@ -18,12 +18,139 @@ const luxon = require('./luxon-2926d85f.js');
|
|
|
18
18
|
const useReferralTable = require('./useReferralTable-7c3f9600.js');
|
|
19
19
|
const sqmTextSpanView = require('./sqm-text-span-view-0aa82125.js');
|
|
20
20
|
const ErrorView = require('./ErrorView-b2fcf954.js');
|
|
21
|
-
const sqmInvoiceTableView = require('./sqm-invoice-table-view-
|
|
21
|
+
const sqmInvoiceTableView = require('./sqm-invoice-table-view-5c74607f.js');
|
|
22
22
|
const extractProps = require('./extractProps-fd93ba62.js');
|
|
23
23
|
const keys = require('./keys-cff24974.js');
|
|
24
|
-
const usePayoutStatus = require('./usePayoutStatus-
|
|
24
|
+
const usePayoutStatus = require('./usePayoutStatus-1ffd1cd4.js');
|
|
25
25
|
const useVerificationEmail = require('./useVerificationEmail-95a82767.js');
|
|
26
26
|
|
|
27
|
+
const TAX_CONTEXT_NAMESPACE = "sq:tax-and-cash";
|
|
28
|
+
const TAX_FORM_CONTEXT_NAMESPACE = "sq:tax-form-context";
|
|
29
|
+
const USER_QUERY_NAMESPACE = "sq:user-info-query";
|
|
30
|
+
const USER_FORM_CONTEXT_NAMESPACE = "sq:user-form-context";
|
|
31
|
+
const FINANCE_NETWORK_SETTINGS_NAMESPACE = "sq:finance-network-settings";
|
|
32
|
+
const COUNTRIES_NAMESPACE = "sq:countries:list";
|
|
33
|
+
const SORTED_COUNTRIES_NAMESPACE = "sq:countries:sorted";
|
|
34
|
+
const COUNTRIES_QUERY_NAMESPACE = "sq:countries:query";
|
|
35
|
+
const CURRENCIES_NAMESPACE = "sq:currencies:list";
|
|
36
|
+
const CURRENCIES_QUERY_NAMESPACE = "sq:currencies:query";
|
|
37
|
+
const GET_USER = index_module.dist.gql `
|
|
38
|
+
query getUserTaxInfo {
|
|
39
|
+
user: viewer {
|
|
40
|
+
... on User {
|
|
41
|
+
id
|
|
42
|
+
firstName
|
|
43
|
+
lastName
|
|
44
|
+
email
|
|
45
|
+
countryCode
|
|
46
|
+
customFields
|
|
47
|
+
rewards(limit: 1000) {
|
|
48
|
+
data {
|
|
49
|
+
statuses
|
|
50
|
+
partnerFundsTransfer {
|
|
51
|
+
id
|
|
52
|
+
status
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
managedIdentity {
|
|
57
|
+
uid
|
|
58
|
+
email
|
|
59
|
+
emailVerified
|
|
60
|
+
}
|
|
61
|
+
impactConnection {
|
|
62
|
+
connected
|
|
63
|
+
user {
|
|
64
|
+
firstName
|
|
65
|
+
lastName
|
|
66
|
+
}
|
|
67
|
+
publisher {
|
|
68
|
+
id
|
|
69
|
+
brandedSignup
|
|
70
|
+
countryCode
|
|
71
|
+
currency
|
|
72
|
+
billingAddress
|
|
73
|
+
billingCity
|
|
74
|
+
billingState
|
|
75
|
+
billingCountryCode
|
|
76
|
+
billingPostalCode
|
|
77
|
+
phoneNumberCountryCode
|
|
78
|
+
phoneNumber
|
|
79
|
+
taxInformation {
|
|
80
|
+
indirectTaxId
|
|
81
|
+
indirectTaxCountryCode
|
|
82
|
+
indirectTaxRegion
|
|
83
|
+
additionalTaxId
|
|
84
|
+
withholdingTaxId
|
|
85
|
+
withholdingTaxCountryCode
|
|
86
|
+
}
|
|
87
|
+
requiredTaxDocumentType
|
|
88
|
+
currentTaxDocument {
|
|
89
|
+
status
|
|
90
|
+
type
|
|
91
|
+
dateCreated
|
|
92
|
+
}
|
|
93
|
+
withdrawalSettings {
|
|
94
|
+
paymentMethod
|
|
95
|
+
paypalEmailAddress
|
|
96
|
+
bankCountry
|
|
97
|
+
bankAccountNumber
|
|
98
|
+
paymentSchedulingType
|
|
99
|
+
paymentThreshold
|
|
100
|
+
paymentDay
|
|
101
|
+
}
|
|
102
|
+
payoutsAccount {
|
|
103
|
+
hold
|
|
104
|
+
holdReasons
|
|
105
|
+
balance
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
const GET_COUNTRIES = index_module.dist.gql `
|
|
114
|
+
query getCountries {
|
|
115
|
+
impactPayoutCountries(limit: 1000) {
|
|
116
|
+
data {
|
|
117
|
+
countryCode
|
|
118
|
+
displayName
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
`;
|
|
123
|
+
const GET_CURRENCIES = index_module.dist.gql `
|
|
124
|
+
query currencies($locale: RSLocale) {
|
|
125
|
+
currencies(limit: 300) {
|
|
126
|
+
data {
|
|
127
|
+
displayName(locale: $locale)
|
|
128
|
+
currencyCode
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
133
|
+
const GET_FINANCE_NETWORK_SETTINGS = index_module.dist.gql `
|
|
134
|
+
query impactFinanceNetworkSettings(
|
|
135
|
+
$filter: ImpactFinanceNetworkSettingsFilterInput
|
|
136
|
+
) {
|
|
137
|
+
impactFinanceNetworkSettings(filter: $filter, limit: 1000) {
|
|
138
|
+
data {
|
|
139
|
+
countryCode
|
|
140
|
+
currency
|
|
141
|
+
defaultFinancePaymentMethodId
|
|
142
|
+
thresholdOptions
|
|
143
|
+
withdrawalSettingId
|
|
144
|
+
internationalEftFee
|
|
145
|
+
foreignFxFee
|
|
146
|
+
defaultFxFee
|
|
147
|
+
}
|
|
148
|
+
totalCount
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`;
|
|
152
|
+
const FORM_STEPS = 4;
|
|
153
|
+
|
|
27
154
|
function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
28
155
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32;
|
|
29
156
|
const { errors, ...formState } = props.states.formState;
|
|
@@ -777,7 +904,7 @@ const BankingInfoFormView = (props) => {
|
|
|
777
904
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
778
905
|
id: "formStep",
|
|
779
906
|
defaultMessage: text.formStep,
|
|
780
|
-
}, { step: states.step, count:
|
|
907
|
+
}, { step: states.step, count: FORM_STEPS }))),
|
|
781
908
|
index.h("h3", { style: { fontSize: "24px" } }, text.taxAndPayouts),
|
|
782
909
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription)),
|
|
783
910
|
((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "warning", open: true, class: sheet.classes.AlertContainer },
|
|
@@ -918,12 +1045,12 @@ function useBankingInfoForm(props) {
|
|
|
918
1045
|
const host = index_module._();
|
|
919
1046
|
const locale = index_module.L();
|
|
920
1047
|
const user = index_module.J();
|
|
921
|
-
const [step, setStep] = index_module.Pn(
|
|
922
|
-
const context = index_module.Fn(
|
|
923
|
-
const countries = index_module.Fn(
|
|
1048
|
+
const [step, setStep] = index_module.Pn(TAX_CONTEXT_NAMESPACE);
|
|
1049
|
+
const context = index_module.Fn(TAX_FORM_CONTEXT_NAMESPACE);
|
|
1050
|
+
const countries = index_module.Fn(SORTED_COUNTRIES_NAMESPACE);
|
|
924
1051
|
const formRef = stencilHooks_module.useRef(null);
|
|
925
|
-
const { data: paymentOptionsData, loading: paymentOptionsLoading, errors: paymentOptionsError, } = index_module.$n(
|
|
926
|
-
const { data: userData, refetch, errors: userError, } = index_module.$n(
|
|
1052
|
+
const { data: paymentOptionsData, loading: paymentOptionsLoading, errors: paymentOptionsError, } = index_module.$n(FINANCE_NETWORK_SETTINGS_NAMESPACE);
|
|
1053
|
+
const { data: userData, refetch, errors: userError, } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
927
1054
|
const [saveWithdrawalSettings] = index_module.$e(SAVE_WITHDRAWAL_SETTINGS);
|
|
928
1055
|
const [updateWithdrawalSettings] = index_module.$e(UPDATE_WITHDRAWAL_SETTINGS);
|
|
929
1056
|
const [showVerification, setShowVerification] = stencilHooks_module.useState(false);
|
|
@@ -1619,7 +1746,7 @@ function useDemoBankingInfoForm(props) {
|
|
|
1619
1746
|
const defaultPaymentScheduleChecked = (_f = (_e = (_d = props.demoData) === null || _d === void 0 ? void 0 : _d.states) === null || _e === void 0 ? void 0 : _e.formState) === null || _f === void 0 ? void 0 : _f.paymentScheduleChecked;
|
|
1620
1747
|
const defaultCurrency = (_h = (_g = props.demoData) === null || _g === void 0 ? void 0 : _g.states) === null || _h === void 0 ? void 0 : _h.currency;
|
|
1621
1748
|
const defaultCountry = (_l = (_k = (_j = props.demoData) === null || _j === void 0 ? void 0 : _j.states) === null || _k === void 0 ? void 0 : _k.formState) === null || _l === void 0 ? void 0 : _l.bankCountry;
|
|
1622
|
-
const setStep = index_module.En(
|
|
1749
|
+
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
1623
1750
|
const [paymentMethodChecked, setPaymentMethodChecked] = stencilHooks_module.useState(undefined);
|
|
1624
1751
|
const [paymentScheduleChecked, setPaymentScheduleChecked] = stencilHooks_module.useState(undefined);
|
|
1625
1752
|
const [currency, setCurrency] = stencilHooks_module.useState(defaultCurrency);
|
|
@@ -2068,9 +2195,9 @@ const DOCUSIGN_EXPIRED_STATES = ["ttl_expired", "session_timeout"];
|
|
|
2068
2195
|
function useDocusignForm(props) {
|
|
2069
2196
|
var _a, _b, _c;
|
|
2070
2197
|
const user = index_module.J();
|
|
2071
|
-
const context = index_module.Fn(
|
|
2072
|
-
const [step, setStep] = index_module.Pn(
|
|
2073
|
-
const { data, loading: userLoading, refetch, } = index_module.$n(
|
|
2198
|
+
const context = index_module.Fn(TAX_FORM_CONTEXT_NAMESPACE);
|
|
2199
|
+
const [step, setStep] = index_module.Pn(TAX_CONTEXT_NAMESPACE);
|
|
2200
|
+
const { data, loading: userLoading, refetch, } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
2074
2201
|
const publisher = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
2075
2202
|
const [createTaxDocument, { loading: documentLoading, data: document, errors: documentErrors },] = index_module.$e(GET_TAX_DOCUMENT);
|
|
2076
2203
|
const [completeTaxDocument, { loading: completeDocumentLoading, data: completeData, errors: completeErrors, },] = index_module.$e(COMPLETE_TAX_DOCUMENT);
|
|
@@ -2494,7 +2621,7 @@ const DocusignFormView = (props) => {
|
|
|
2494
2621
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
2495
2622
|
id: "formStep",
|
|
2496
2623
|
defaultMessage: text.formStep,
|
|
2497
|
-
}, { step: states.step, count:
|
|
2624
|
+
}, { step: states.step, count: FORM_STEPS }))),
|
|
2498
2625
|
index.h("h3", null, text.taxForm),
|
|
2499
2626
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
|
|
2500
2627
|
states.loadingError && (index.h("div", null,
|
|
@@ -2691,7 +2818,7 @@ const DocusignForm = class {
|
|
|
2691
2818
|
get el() { return index.getElement(this); }
|
|
2692
2819
|
};
|
|
2693
2820
|
function useDocusignFormDemo(props) {
|
|
2694
|
-
const setStep = index_module.En(
|
|
2821
|
+
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
2695
2822
|
return cjs.cjs({
|
|
2696
2823
|
text: props.getTextProps(),
|
|
2697
2824
|
states: {
|
|
@@ -2882,7 +3009,7 @@ const IndirectTaxFormView = (props) => {
|
|
|
2882
3009
|
global.intl.formatMessage({
|
|
2883
3010
|
id: "formStep",
|
|
2884
3011
|
defaultMessage: text.formStep,
|
|
2885
|
-
}, { step: states.step, count:
|
|
3012
|
+
}, { step: states.step, count: FORM_STEPS }))),
|
|
2886
3013
|
index.h("h3", null, text.indirectTax),
|
|
2887
3014
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription),
|
|
2888
3015
|
index.h("p", { class: classes.DescriptionText }, text.indirectTaxDescription)),
|
|
@@ -2985,12 +3112,12 @@ function useIndirectTaxForm(props) {
|
|
|
2985
3112
|
const user = index_module.J();
|
|
2986
3113
|
const locale = index_module.L();
|
|
2987
3114
|
const formRef = stencilHooks_module.useRef(null);
|
|
2988
|
-
const context = index_module.Fn(
|
|
2989
|
-
const [step, setStep] = index_module.Pn(
|
|
3115
|
+
const context = index_module.Fn(TAX_FORM_CONTEXT_NAMESPACE);
|
|
3116
|
+
const [step, setStep] = index_module.Pn(TAX_CONTEXT_NAMESPACE);
|
|
2990
3117
|
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = index_module.$e(CONNECT_PARTNER);
|
|
2991
|
-
const userForm = index_module.Fn(
|
|
2992
|
-
const { data: userData, refetch, errors: userError, } = index_module.$n(
|
|
2993
|
-
const { data: _countriesRes, loading: countriesLoading } = index_module.$n(
|
|
3118
|
+
const userForm = index_module.Fn(USER_FORM_CONTEXT_NAMESPACE);
|
|
3119
|
+
const { data: userData, refetch, errors: userError, } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
3120
|
+
const { data: _countriesRes, loading: countriesLoading } = index_module.$n(COUNTRIES_QUERY_NAMESPACE);
|
|
2994
3121
|
const intlLocale = (locale === null || locale === void 0 ? void 0 : locale.replace("_", "-")) || "en";
|
|
2995
3122
|
const _countries = stencilHooks_module.useMemo(() => { var _a, _b; return (_b = (_a = _countriesRes === null || _countriesRes === void 0 ? void 0 : _countriesRes.impactPayoutCountries) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.map((country) => sqmInvoiceTableView.getCountryObj({ countryCode: country.countryCode, locale: intlLocale })); }, [(_a = _countriesRes === null || _countriesRes === void 0 ? void 0 : _countriesRes.impactPayoutCountries) === null || _a === void 0 ? void 0 : _a.data]);
|
|
2996
3123
|
const [loading, setLoading] = stencilHooks_module.useState(false);
|
|
@@ -3049,51 +3176,8 @@ function useIndirectTaxForm(props) {
|
|
|
3049
3176
|
console.error("Could not detect select change");
|
|
3050
3177
|
setFormState((p) => ({ ...p, [field]: value }));
|
|
3051
3178
|
};
|
|
3052
|
-
async function connectPartner(formData) {
|
|
3053
|
-
var _a, _b, _c, _d, _e;
|
|
3054
|
-
const vars = {
|
|
3055
|
-
user: {
|
|
3056
|
-
id: user.id,
|
|
3057
|
-
accountId: user.accountId,
|
|
3058
|
-
},
|
|
3059
|
-
firstName: userForm.firstName,
|
|
3060
|
-
lastName: userForm.lastName,
|
|
3061
|
-
countryCode: userForm.countryCode,
|
|
3062
|
-
currency: userForm.currency,
|
|
3063
|
-
address: userForm.address,
|
|
3064
|
-
city: userForm.city,
|
|
3065
|
-
state: userForm.state,
|
|
3066
|
-
postalCode: userForm.postalCode,
|
|
3067
|
-
phoneNumber: userForm.phoneNumber,
|
|
3068
|
-
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
3069
|
-
indirectTaxCountryCode: formData.selectedRegion,
|
|
3070
|
-
indirectTaxRegion: formData.province || formData.subRegion,
|
|
3071
|
-
indirectTaxId: formData.indirectTaxNumber,
|
|
3072
|
-
additionalTaxId: formData.qstNumber,
|
|
3073
|
-
withholdingTaxId: formData.subRegionTaxNumber,
|
|
3074
|
-
};
|
|
3075
|
-
const result = await connectImpactPartner({
|
|
3076
|
-
vars,
|
|
3077
|
-
});
|
|
3078
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
3079
|
-
throw new Error();
|
|
3080
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
3081
|
-
// Output backend errors to console for now
|
|
3082
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
3083
|
-
throw new Error();
|
|
3084
|
-
}
|
|
3085
|
-
await refetch();
|
|
3086
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
3087
|
-
.createImpactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher;
|
|
3088
|
-
const hasValidCurrentDocument = sqmInvoiceTableView.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
3089
|
-
// Fire form change event
|
|
3090
|
-
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
3091
|
-
return {
|
|
3092
|
-
resultPublisher,
|
|
3093
|
-
hasValidCurrentDocument,
|
|
3094
|
-
};
|
|
3095
|
-
}
|
|
3096
3179
|
const onSubmit = async (event) => {
|
|
3180
|
+
var _a, _b, _c, _d, _e;
|
|
3097
3181
|
if (!option) {
|
|
3098
3182
|
setErrors({ taxDetails: true });
|
|
3099
3183
|
return;
|
|
@@ -3119,7 +3203,44 @@ function useIndirectTaxForm(props) {
|
|
|
3119
3203
|
}
|
|
3120
3204
|
setLoading(true);
|
|
3121
3205
|
try {
|
|
3122
|
-
const
|
|
3206
|
+
const vars = {
|
|
3207
|
+
user: {
|
|
3208
|
+
id: user.id,
|
|
3209
|
+
accountId: user.accountId,
|
|
3210
|
+
},
|
|
3211
|
+
firstName: userForm.firstName,
|
|
3212
|
+
lastName: userForm.lastName,
|
|
3213
|
+
countryCode: userForm.countryCode,
|
|
3214
|
+
currency: userForm.currency,
|
|
3215
|
+
address: userForm.address,
|
|
3216
|
+
city: userForm.city,
|
|
3217
|
+
state: userForm.state,
|
|
3218
|
+
postalCode: userForm.postalCode,
|
|
3219
|
+
phoneNumber: userForm.phoneNumber,
|
|
3220
|
+
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
3221
|
+
indirectTaxCountryCode: formData.selectedRegion,
|
|
3222
|
+
indirectTaxRegion: formData.province || formData.subRegion,
|
|
3223
|
+
indirectTaxId: formData.indirectTaxNumber,
|
|
3224
|
+
additionalTaxId: formData.qstNumber,
|
|
3225
|
+
withholdingTaxId: formData.subRegionTaxNumber,
|
|
3226
|
+
};
|
|
3227
|
+
const result = await connectImpactPartner({
|
|
3228
|
+
vars,
|
|
3229
|
+
});
|
|
3230
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
3231
|
+
throw new Error();
|
|
3232
|
+
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
3233
|
+
// Output backend errors to console for now
|
|
3234
|
+
console.error("Failed to create Impact connection: ", result.createImpactConnection
|
|
3235
|
+
.validationErrors);
|
|
3236
|
+
throw new Error();
|
|
3237
|
+
}
|
|
3238
|
+
await refetch();
|
|
3239
|
+
const resultPublisher = (_e = (_d = (_c = result
|
|
3240
|
+
.createImpactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher;
|
|
3241
|
+
const hasValidCurrentDocument = sqmInvoiceTableView.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
3242
|
+
// Fire form change event
|
|
3243
|
+
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
3123
3244
|
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
3124
3245
|
!hasValidCurrentDocument) {
|
|
3125
3246
|
// Go to docusign form
|
|
@@ -3395,7 +3516,7 @@ const IndirectTaxForm = class {
|
|
|
3395
3516
|
}
|
|
3396
3517
|
};
|
|
3397
3518
|
function useDemoIndirectTaxForm(props) {
|
|
3398
|
-
const setStep = index_module.En(
|
|
3519
|
+
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
3399
3520
|
const [option, setOption] = stencilHooks_module.useState(null);
|
|
3400
3521
|
const [demoFormState, setDemoFormState] = stencilHooks_module.useState({});
|
|
3401
3522
|
return cjs.cjs({
|
|
@@ -4077,7 +4198,7 @@ function PayoutDetailsCardView(props) {
|
|
|
4077
4198
|
|
|
4078
4199
|
function usePayoutDetailsCard(props) {
|
|
4079
4200
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
4080
|
-
const { data, loading } = index_module.$n(
|
|
4201
|
+
const { data, loading } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
4081
4202
|
const publisher = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
4082
4203
|
function getPayoutDetailedStatusText(paymentDay) {
|
|
4083
4204
|
var _a;
|
|
@@ -4244,17 +4365,17 @@ function useTaxAndCash() {
|
|
|
4244
4365
|
const locale = index_module.L();
|
|
4245
4366
|
// State for current step of form
|
|
4246
4367
|
const [step, setStep] = index_module.In({
|
|
4247
|
-
namespace:
|
|
4368
|
+
namespace: TAX_CONTEXT_NAMESPACE,
|
|
4248
4369
|
initialValue: "/loading",
|
|
4249
4370
|
});
|
|
4250
4371
|
// State for when to hide steps, or override certain actions
|
|
4251
4372
|
const [context, _setContext] = index_module.In({
|
|
4252
|
-
namespace:
|
|
4373
|
+
namespace: TAX_FORM_CONTEXT_NAMESPACE,
|
|
4253
4374
|
initialValue: {},
|
|
4254
4375
|
});
|
|
4255
4376
|
// State to carry user form information into step 2
|
|
4256
4377
|
const [userFormContext, _setUserFormContext] = index_module.In({
|
|
4257
|
-
namespace:
|
|
4378
|
+
namespace: USER_FORM_CONTEXT_NAMESPACE,
|
|
4258
4379
|
initialValue: {
|
|
4259
4380
|
firstName: undefined,
|
|
4260
4381
|
lastName: undefined,
|
|
@@ -4264,20 +4385,20 @@ function useTaxAndCash() {
|
|
|
4264
4385
|
},
|
|
4265
4386
|
});
|
|
4266
4387
|
const [_currenciesContext, setCurrenciesContext] = index_module.In({
|
|
4267
|
-
namespace:
|
|
4388
|
+
namespace: CURRENCIES_NAMESPACE,
|
|
4268
4389
|
initialValue: [],
|
|
4269
4390
|
});
|
|
4270
4391
|
const [_countriesContext, _setCountriesContext] = index_module.In({
|
|
4271
|
-
namespace:
|
|
4392
|
+
namespace: COUNTRIES_NAMESPACE,
|
|
4272
4393
|
initialValue: [],
|
|
4273
4394
|
});
|
|
4274
4395
|
const [_sortedCountriesContext, setSortedCountriesContext] = index_module.In({
|
|
4275
|
-
namespace:
|
|
4396
|
+
namespace: SORTED_COUNTRIES_NAMESPACE,
|
|
4276
4397
|
initialValue: [],
|
|
4277
4398
|
});
|
|
4278
4399
|
const { data, errors } = index_module.Sn({
|
|
4279
|
-
namespace:
|
|
4280
|
-
query:
|
|
4400
|
+
namespace: USER_QUERY_NAMESPACE,
|
|
4401
|
+
query: GET_USER,
|
|
4281
4402
|
skip: !user,
|
|
4282
4403
|
options: {
|
|
4283
4404
|
batch: false,
|
|
@@ -4286,21 +4407,21 @@ function useTaxAndCash() {
|
|
|
4286
4407
|
const countryCode = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher) === null || _c === void 0 ? void 0 : _c.countryCode) ||
|
|
4287
4408
|
userFormContext.countryCode;
|
|
4288
4409
|
index_module.Sn({
|
|
4289
|
-
namespace:
|
|
4290
|
-
query:
|
|
4410
|
+
namespace: COUNTRIES_QUERY_NAMESPACE,
|
|
4411
|
+
query: GET_COUNTRIES,
|
|
4291
4412
|
skip: !user,
|
|
4292
4413
|
});
|
|
4293
4414
|
const { data: financeNetworkData, refetch } = index_module.Sn({
|
|
4294
|
-
namespace:
|
|
4295
|
-
query:
|
|
4415
|
+
namespace: FINANCE_NETWORK_SETTINGS_NAMESPACE,
|
|
4416
|
+
query: GET_FINANCE_NETWORK_SETTINGS,
|
|
4296
4417
|
skip: !user,
|
|
4297
4418
|
variables: {
|
|
4298
4419
|
filter: getFinanceNetworkFilter(),
|
|
4299
4420
|
},
|
|
4300
4421
|
});
|
|
4301
4422
|
const { data: currenciesData } = index_module.Sn({
|
|
4302
|
-
namespace:
|
|
4303
|
-
query:
|
|
4423
|
+
namespace: CURRENCIES_QUERY_NAMESPACE,
|
|
4424
|
+
query: GET_CURRENCIES,
|
|
4304
4425
|
skip: !user,
|
|
4305
4426
|
variables: {
|
|
4306
4427
|
locale,
|
|
@@ -4379,7 +4500,7 @@ function useTaxAndCash() {
|
|
|
4379
4500
|
step,
|
|
4380
4501
|
setStep,
|
|
4381
4502
|
context,
|
|
4382
|
-
namespace: index_module.Mn(
|
|
4503
|
+
namespace: index_module.Mn(TAX_CONTEXT_NAMESPACE),
|
|
4383
4504
|
loading: step === "/loading",
|
|
4384
4505
|
};
|
|
4385
4506
|
}
|
|
@@ -5311,54 +5432,6 @@ const TaxAndCashMonolith = class {
|
|
|
5311
5432
|
* @uiName Account review alert description
|
|
5312
5433
|
*/
|
|
5313
5434
|
this.dashboard_accountReviewDescription = "This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.";
|
|
5314
|
-
/**
|
|
5315
|
-
* @uiName Payment on hold alert header
|
|
5316
|
-
*/
|
|
5317
|
-
this.dashboard_paymentOnHoldHeader = "We are reviewing your new payout settings";
|
|
5318
|
-
/**
|
|
5319
|
-
* @uiName Payment on hold alert description
|
|
5320
|
-
*/
|
|
5321
|
-
this.dashboard_paymentOnHoldDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
5322
|
-
/**
|
|
5323
|
-
* @uiName Beneficiary name invalid alert header
|
|
5324
|
-
*/
|
|
5325
|
-
this.dashboard_beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
5326
|
-
/**
|
|
5327
|
-
* @uiName Beneficiary name invalid description
|
|
5328
|
-
*/
|
|
5329
|
-
this.dashboard_beneficiaryNameInvalidDescription = "The beneficiary name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
5330
|
-
/**
|
|
5331
|
-
* @uiName Beneficiary name mismatch alert header
|
|
5332
|
-
*/
|
|
5333
|
-
this.dashboard_beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
5334
|
-
/**
|
|
5335
|
-
* @uiName Beneficiary name mismatch alert description
|
|
5336
|
-
*/
|
|
5337
|
-
this.dashboard_beneficiaryNameMismatchDescription = "The beneficiary name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
5338
|
-
/**
|
|
5339
|
-
* @uiName Bank name mismatch alert header
|
|
5340
|
-
*/
|
|
5341
|
-
this.dashboard_bankNameMismatchHeader = "Your payment information does not match your tax form";
|
|
5342
|
-
/**
|
|
5343
|
-
* @uiName Bank name mismatch alert description
|
|
5344
|
-
*/
|
|
5345
|
-
this.dashboard_bankNameMismatchDescription = "The bank name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
5346
|
-
/**
|
|
5347
|
-
* @uiName Withdrawal settings invalid alert header
|
|
5348
|
-
*/
|
|
5349
|
-
this.dashboard_withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
5350
|
-
/**
|
|
5351
|
-
* @uiName Withdrawal settings invalid alert description
|
|
5352
|
-
*/
|
|
5353
|
-
this.dashboard_withdrawalSettingsInvalidDescription = "There are invalid characters in your payment information. Please review your information and make sure it is correct with no invalid characters. Your payouts are on hold until this is resolved.";
|
|
5354
|
-
/**
|
|
5355
|
-
* @uiName Payment returned alert header
|
|
5356
|
-
*/
|
|
5357
|
-
this.dashboard_paymentReturnedHeader = "Payout unsuccessful";
|
|
5358
|
-
/**
|
|
5359
|
-
* @uiName Payment returned alert description
|
|
5360
|
-
*/
|
|
5361
|
-
this.dashboard_paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
5362
5435
|
/**
|
|
5363
5436
|
* @uiName Terms and Conditions text
|
|
5364
5437
|
* @uiGroup Dashboard Properties
|
|
@@ -5539,7 +5612,7 @@ const TaxAndCashMonolith = class {
|
|
|
5539
5612
|
};
|
|
5540
5613
|
function useDemoTaxAndCash(props) {
|
|
5541
5614
|
const [step, setStep] = index_module.In({
|
|
5542
|
-
namespace:
|
|
5615
|
+
namespace: TAX_CONTEXT_NAMESPACE,
|
|
5543
5616
|
initialValue: "/1",
|
|
5544
5617
|
});
|
|
5545
5618
|
return cjs.cjs({
|
|
@@ -5830,7 +5903,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5830
5903
|
icon: "exclamation-octagon",
|
|
5831
5904
|
class: sheet$5.classes.ErrorHoldAlertContainer,
|
|
5832
5905
|
};
|
|
5833
|
-
case "
|
|
5906
|
+
case "ACCOUNT_REVIEW":
|
|
5834
5907
|
return {
|
|
5835
5908
|
header: text.accountReviewHeader,
|
|
5836
5909
|
description: global.intl.formatMessage({
|
|
@@ -5844,96 +5917,6 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5844
5917
|
icon: "exclamation-triangle",
|
|
5845
5918
|
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5846
5919
|
};
|
|
5847
|
-
case "PAYMENT_HOLD_ON_CHANGE":
|
|
5848
|
-
return {
|
|
5849
|
-
header: text.paymentHoldOnChangeHeader,
|
|
5850
|
-
description: global.intl.formatMessage({
|
|
5851
|
-
id: "accountReviewDescription",
|
|
5852
|
-
defaultMessage: text.paymentHoldOnChangeDescription,
|
|
5853
|
-
}, {
|
|
5854
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5855
|
-
}),
|
|
5856
|
-
buttonText: null,
|
|
5857
|
-
alertType: "warning",
|
|
5858
|
-
icon: "exclamation-triangle",
|
|
5859
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5860
|
-
};
|
|
5861
|
-
case "BENEFICIARY_NAME_INVALID":
|
|
5862
|
-
return {
|
|
5863
|
-
header: text.beneficiaryNameInvalidHeader,
|
|
5864
|
-
description: global.intl.formatMessage({
|
|
5865
|
-
id: "accountReviewDescription",
|
|
5866
|
-
defaultMessage: text.beneficiaryNameInvalidDescription,
|
|
5867
|
-
}, {
|
|
5868
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5869
|
-
}),
|
|
5870
|
-
button: (index.h(index.Fragment, null,
|
|
5871
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
5872
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
5873
|
-
alertType: "warning",
|
|
5874
|
-
icon: "exclamation-triangle",
|
|
5875
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5876
|
-
};
|
|
5877
|
-
case "BENEFICIARY_NAME_MISMATCH":
|
|
5878
|
-
return {
|
|
5879
|
-
header: text.beneficiaryNameMismatchHeader,
|
|
5880
|
-
description: global.intl.formatMessage({
|
|
5881
|
-
id: "accountReviewDescription",
|
|
5882
|
-
defaultMessage: text.beneficiaryNameMismatchDescription,
|
|
5883
|
-
}, {
|
|
5884
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5885
|
-
}),
|
|
5886
|
-
button: (index.h(index.Fragment, null,
|
|
5887
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
5888
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
5889
|
-
alertType: "warning",
|
|
5890
|
-
icon: "exclamation-triangle",
|
|
5891
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5892
|
-
};
|
|
5893
|
-
case "BANK_TAX_NAME_MISMATCH":
|
|
5894
|
-
return {
|
|
5895
|
-
header: text.bankTaxNameMismatchHeader,
|
|
5896
|
-
description: global.intl.formatMessage({
|
|
5897
|
-
id: "accountReviewDescription",
|
|
5898
|
-
defaultMessage: text.bankTaxNameMismatchDescription,
|
|
5899
|
-
}, {
|
|
5900
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5901
|
-
}),
|
|
5902
|
-
button: (index.h(index.Fragment, null,
|
|
5903
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
5904
|
-
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
5905
|
-
alertType: "warning",
|
|
5906
|
-
icon: "exclamation-triangle",
|
|
5907
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5908
|
-
};
|
|
5909
|
-
case "WITHDRAWAL_SETTINGS_INVALID":
|
|
5910
|
-
return {
|
|
5911
|
-
header: text.withdrawalSettingsInvalidHeader,
|
|
5912
|
-
description: global.intl.formatMessage({
|
|
5913
|
-
id: "accountReviewDescription",
|
|
5914
|
-
defaultMessage: text.withdrawalSettingsInvalidDescription,
|
|
5915
|
-
}, {
|
|
5916
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5917
|
-
}),
|
|
5918
|
-
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5919
|
-
alertType: "warning",
|
|
5920
|
-
icon: "exclamation-triangle",
|
|
5921
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5922
|
-
};
|
|
5923
|
-
case "PAYMENT_RETURNED":
|
|
5924
|
-
return {
|
|
5925
|
-
header: text.paymentReturnedHeader,
|
|
5926
|
-
description: global.intl.formatMessage({
|
|
5927
|
-
id: "accountReviewDescription",
|
|
5928
|
-
defaultMessage: text.paymentReturnedDescription,
|
|
5929
|
-
}, {
|
|
5930
|
-
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5931
|
-
}),
|
|
5932
|
-
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5933
|
-
alertType: "warning",
|
|
5934
|
-
icon: "exclamation-triangle",
|
|
5935
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5936
|
-
};
|
|
5937
5920
|
case "HOLD":
|
|
5938
5921
|
return {
|
|
5939
5922
|
header: text.payoutHoldAlertHeader,
|
|
@@ -6180,8 +6163,8 @@ function getIndirectTaxType(taxInformation) {
|
|
|
6180
6163
|
}
|
|
6181
6164
|
const useTaxAndCashDashboard = (props) => {
|
|
6182
6165
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
6183
|
-
const setStep = index_module.En(
|
|
6184
|
-
const setContext = index_module.En(
|
|
6166
|
+
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
6167
|
+
const setContext = index_module.En(TAX_FORM_CONTEXT_NAMESPACE);
|
|
6185
6168
|
const [showDialog, setShowDialog] = stencilHooks_module.useState(false);
|
|
6186
6169
|
const { render, loading: veriffLoading, errors: veriffErrors, } = usePayoutStatus.useVeriffApp();
|
|
6187
6170
|
const { data: taxSettingRes } = index_module.wn(GET_TAX_SETTING, {});
|
|
@@ -6192,7 +6175,7 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
6192
6175
|
if (window.location.hash)
|
|
6193
6176
|
setStep(`/${window.location.hash.replace("#", "")}`);
|
|
6194
6177
|
}, []);
|
|
6195
|
-
const { data, loading, errors: userError, refetch, } = index_module.$n(
|
|
6178
|
+
const { data, loading, errors: userError, refetch, } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
6196
6179
|
const publisher = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
6197
6180
|
const documentType = publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType;
|
|
6198
6181
|
const submissionDate = (_c = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _c === void 0 ? void 0 : _c.dateCreated;
|
|
@@ -6503,54 +6486,6 @@ const TaxAndCashDashboard = class {
|
|
|
6503
6486
|
* @uiName Account review alert description
|
|
6504
6487
|
*/
|
|
6505
6488
|
this.accountReviewDescription = "This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.";
|
|
6506
|
-
/**
|
|
6507
|
-
* @uiName Payment hold on change alert header
|
|
6508
|
-
*/
|
|
6509
|
-
this.paymentHoldOnChangeHeader = "We are reviewing your new payout settings";
|
|
6510
|
-
/**
|
|
6511
|
-
* @uiName Payment hold on change alert description
|
|
6512
|
-
*/
|
|
6513
|
-
this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
6514
|
-
/**
|
|
6515
|
-
* @uiName Beneficiary name invalid alert header
|
|
6516
|
-
*/
|
|
6517
|
-
this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
6518
|
-
/**
|
|
6519
|
-
* @uiName Beneficiary name invalid description
|
|
6520
|
-
*/
|
|
6521
|
-
this.beneficiaryNameInvalidDescription = "The beneficiary name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
6522
|
-
/**
|
|
6523
|
-
* @uiName Beneficiary name mismatch alert header
|
|
6524
|
-
*/
|
|
6525
|
-
this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
6526
|
-
/**
|
|
6527
|
-
* @uiName Beneficiary name mismatch alert description
|
|
6528
|
-
*/
|
|
6529
|
-
this.beneficiaryNameMismatchDescription = "The beneficiary name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
6530
|
-
/**
|
|
6531
|
-
* @uiName Bank name mismatch alert header
|
|
6532
|
-
*/
|
|
6533
|
-
this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
|
|
6534
|
-
/**
|
|
6535
|
-
* @uiName Bank name mismatch alert description
|
|
6536
|
-
*/
|
|
6537
|
-
this.bankTaxNameMismatchDescription = "The bank name in your payment information does not match what was submitted in your tax form. Please review and update your payment information or tax form so that they match exactly and do not include any invalid characters. Your payouts are on hold until this is resolved.";
|
|
6538
|
-
/**
|
|
6539
|
-
* @uiName Withdrawal settings invalid alert header
|
|
6540
|
-
*/
|
|
6541
|
-
this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
6542
|
-
/**
|
|
6543
|
-
* @uiName Withdrawal settings invalid alert description
|
|
6544
|
-
*/
|
|
6545
|
-
this.withdrawalSettingsInvalidDescription = "There are invalid characters in your payment information. Please review your information and make sure it is correct with no invalid characters. Your payouts are on hold until this is resolved.";
|
|
6546
|
-
/**
|
|
6547
|
-
* @uiName Payment returned alert header
|
|
6548
|
-
*/
|
|
6549
|
-
this.paymentReturnedHeader = "Payout unsuccessful";
|
|
6550
|
-
/**
|
|
6551
|
-
* @uiName Payment returned alert description
|
|
6552
|
-
*/
|
|
6553
|
-
this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
6554
6489
|
/**
|
|
6555
6490
|
* @uiName Terms and Conditions text
|
|
6556
6491
|
*/
|
|
@@ -7816,12 +7751,6 @@ const UserInfoFormView = (props) => {
|
|
|
7816
7751
|
default:
|
|
7817
7752
|
regionLabel = text.state;
|
|
7818
7753
|
}
|
|
7819
|
-
function isDisabledInput(field) {
|
|
7820
|
-
var _a;
|
|
7821
|
-
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
7822
|
-
return true;
|
|
7823
|
-
return false;
|
|
7824
|
-
}
|
|
7825
7754
|
return (index.h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
7826
7755
|
index.h("style", { type: "text/css" },
|
|
7827
7756
|
styleString$6,
|
|
@@ -7844,7 +7773,7 @@ const UserInfoFormView = (props) => {
|
|
|
7844
7773
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
7845
7774
|
id: "formStep",
|
|
7846
7775
|
defaultMessage: text.formStep,
|
|
7847
|
-
}, { step: states.step, count:
|
|
7776
|
+
}, { step: states.step, count: FORM_STEPS }))),
|
|
7848
7777
|
index.h("h3", null, text.personalInformation),
|
|
7849
7778
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
|
|
7850
7779
|
((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "warning", open: true, class: sheet$6.classes.AlertContainer },
|
|
@@ -7869,22 +7798,18 @@ const UserInfoFormView = (props) => {
|
|
|
7869
7798
|
}))),
|
|
7870
7799
|
index.h("div", null,
|
|
7871
7800
|
index.h("div", { class: classes.InputContainer },
|
|
7872
|
-
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
7873
|
-
states.isUser ||
|
|
7874
|
-
isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
7801
|
+
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled || states.isUser || states.isPartner }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
7875
7802
|
class: classes.ErrorInput,
|
|
7876
7803
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
7877
7804
|
}
|
|
7878
7805
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
7879
|
-
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
7880
|
-
states.isUser ||
|
|
7881
|
-
isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
7806
|
+
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled || states.isUser || states.isPartner }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
7882
7807
|
class: classes.ErrorInput,
|
|
7883
7808
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
7884
7809
|
}
|
|
7885
7810
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
7886
7811
|
index.h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
|
|
7887
|
-
index.h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled ||
|
|
7812
|
+
index.h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled || states.isPartner }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
|
|
7888
7813
|
class: classes.ErrorInput,
|
|
7889
7814
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.country, formState.errors.countryCode),
|
|
7890
7815
|
}
|
|
@@ -7900,8 +7825,7 @@ const UserInfoFormView = (props) => {
|
|
|
7900
7825
|
index.h("div", { class: classes.PhoneInputsSection },
|
|
7901
7826
|
index.h("p", null, text.phoneNumber),
|
|
7902
7827
|
index.h("div", { class: classes.PhoneInputsContainer },
|
|
7903
|
-
index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
7904
|
-
isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
7828
|
+
index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled || states.isPartner, ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
7905
7829
|
class: classes.ErrorInput,
|
|
7906
7830
|
}
|
|
7907
7831
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -7927,7 +7851,7 @@ const UserInfoFormView = (props) => {
|
|
|
7927
7851
|
// Naive phone number validation
|
|
7928
7852
|
sqmInvoiceTableView.validateBillingField(/[a-zA-Z]+/, value) &&
|
|
7929
7853
|
sqmInvoiceTableView.formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
7930
|
-
}, disabled: states.disabled ||
|
|
7854
|
+
}, disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
7931
7855
|
class: classes.ErrorInput,
|
|
7932
7856
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
7933
7857
|
}
|
|
@@ -7935,7 +7859,7 @@ const UserInfoFormView = (props) => {
|
|
|
7935
7859
|
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
7936
7860
|
// Checks for non-ASCII characters
|
|
7937
7861
|
!sqmInvoiceTableView.validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
7938
|
-
sqmInvoiceTableView.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
7862
|
+
sqmInvoiceTableView.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
7939
7863
|
class: classes.ErrorInput,
|
|
7940
7864
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.address, formState.errors.address),
|
|
7941
7865
|
}
|
|
@@ -7943,22 +7867,22 @@ const UserInfoFormView = (props) => {
|
|
|
7943
7867
|
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
|
|
7944
7868
|
// Checks for non-ASCII characters
|
|
7945
7869
|
!sqmInvoiceTableView.validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
7946
|
-
sqmInvoiceTableView.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
7870
|
+
sqmInvoiceTableView.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
7947
7871
|
class: classes.ErrorInput,
|
|
7948
7872
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.city, formState.errors.city),
|
|
7949
7873
|
}
|
|
7950
7874
|
: {}), { required: true })),
|
|
7951
|
-
!states.hideState && (index.h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled ||
|
|
7875
|
+
!states.hideState && (index.h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || states.isPartner }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
|
|
7952
7876
|
class: classes.ErrorInput,
|
|
7953
7877
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.state, formState.errors.state),
|
|
7954
7878
|
}
|
|
7955
7879
|
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (index.h("sl-menu-item", { value: r.value }, r.label))))),
|
|
7956
|
-
index.h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled ||
|
|
7880
|
+
index.h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled || states.isPartner }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
|
|
7957
7881
|
class: classes.ErrorInput,
|
|
7958
7882
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
7959
7883
|
}
|
|
7960
7884
|
: {}), { required: true })),
|
|
7961
|
-
index.h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled ||
|
|
7885
|
+
index.h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled || states.isPartner, helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
|
|
7962
7886
|
class: classes.ErrorInput,
|
|
7963
7887
|
helpText: sqmInvoiceTableView.formatErrorMessage(text.currency, formState.errors.currency),
|
|
7964
7888
|
}
|
|
@@ -7980,24 +7904,22 @@ const UserInfoFormView = (props) => {
|
|
|
7980
7904
|
index.h("div", { class: classes.CheckboxWrapper },
|
|
7981
7905
|
index.h("sl-checkbox", { exportparts: "label: input-label, base: input-base", checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
7982
7906
|
e.target.value = e.target.checked;
|
|
7983
|
-
}, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
7907
|
+
}, disabled: states.isPartner ? false : states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
7984
7908
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (index.h("p", { class: classes.ErrorText }, sqmInvoiceTableView.formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
7985
|
-
index.h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
7909
|
+
index.h("sl-button", { type: "primary", disabled: states.isPartner ? false : states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
7986
7910
|
};
|
|
7987
7911
|
|
|
7988
7912
|
function useUserInfoForm(props) {
|
|
7989
|
-
var _a, _b, _c, _d
|
|
7913
|
+
var _a, _b, _c, _d;
|
|
7990
7914
|
const currencyRef = stencilHooks_module.useRef(undefined);
|
|
7991
7915
|
const phoneCountryRef = stencilHooks_module.useRef(undefined);
|
|
7992
7916
|
const formRef = stencilHooks_module.useRef(null);
|
|
7993
|
-
const context = index_module.Fn(
|
|
7994
|
-
const countries = index_module.Fn(
|
|
7995
|
-
const [step, setStep] = index_module.Pn(
|
|
7996
|
-
const [userFormContext, setUserFormContext] = index_module.Pn(
|
|
7997
|
-
const
|
|
7998
|
-
const
|
|
7999
|
-
const { data, loading, refetch, errors: userError, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
8000
|
-
const _currencies = index_module.Fn(usePayoutStatus.CURRENCIES_NAMESPACE);
|
|
7917
|
+
const context = index_module.Fn(TAX_FORM_CONTEXT_NAMESPACE);
|
|
7918
|
+
const countries = index_module.Fn(SORTED_COUNTRIES_NAMESPACE);
|
|
7919
|
+
const [step, setStep] = index_module.Pn(TAX_CONTEXT_NAMESPACE);
|
|
7920
|
+
const [userFormContext, setUserFormContext] = index_module.Pn(USER_FORM_CONTEXT_NAMESPACE);
|
|
7921
|
+
const { data, loading, errors: userError, } = index_module.$n(USER_QUERY_NAMESPACE);
|
|
7922
|
+
const _currencies = index_module.Fn(CURRENCIES_NAMESPACE);
|
|
8001
7923
|
const currencies = stencilHooks_module.useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
|
|
8002
7924
|
const [countrySearch, setCountrySearch] = stencilHooks_module.useState("");
|
|
8003
7925
|
const [phoneCountrySearch, setPhoneCountrySearch] = stencilHooks_module.useState("");
|
|
@@ -8098,45 +8020,6 @@ function useUserInfoForm(props) {
|
|
|
8098
8020
|
setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
|
|
8099
8021
|
}
|
|
8100
8022
|
}, [currencySearch, currencies]);
|
|
8101
|
-
async function connectPartner(formData) {
|
|
8102
|
-
var _a, _b, _c, _d, _e;
|
|
8103
|
-
const vars = {
|
|
8104
|
-
user: {
|
|
8105
|
-
id: user.id,
|
|
8106
|
-
accountId: user.accountId,
|
|
8107
|
-
},
|
|
8108
|
-
firstName: formData.firstName,
|
|
8109
|
-
lastName: formData.lastName,
|
|
8110
|
-
countryCode: formData.countryCode,
|
|
8111
|
-
currency: formData.currency,
|
|
8112
|
-
address: formData.address,
|
|
8113
|
-
city: formData.city,
|
|
8114
|
-
state: formData.state,
|
|
8115
|
-
postalCode: formData.postalCode,
|
|
8116
|
-
phoneNumber: formData.phoneNumber,
|
|
8117
|
-
phoneNumberCountryCode: formData.phoneNumberCountryCode,
|
|
8118
|
-
};
|
|
8119
|
-
const result = await connectImpactPartner({
|
|
8120
|
-
vars,
|
|
8121
|
-
});
|
|
8122
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
8123
|
-
throw new Error();
|
|
8124
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
8125
|
-
// Output backend errors to console for now
|
|
8126
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
8127
|
-
throw new Error();
|
|
8128
|
-
}
|
|
8129
|
-
await refetch();
|
|
8130
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
8131
|
-
.createImpactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher;
|
|
8132
|
-
const hasValidCurrentDocument = sqmInvoiceTableView.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
8133
|
-
// Fire form change event
|
|
8134
|
-
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
8135
|
-
return {
|
|
8136
|
-
resultPublisher,
|
|
8137
|
-
hasValidCurrentDocument,
|
|
8138
|
-
};
|
|
8139
|
-
}
|
|
8140
8023
|
async function onSubmit(event) {
|
|
8141
8024
|
let formControls = event.target.getFormControls();
|
|
8142
8025
|
let formData = {};
|
|
@@ -8179,41 +8062,9 @@ function useUserInfoForm(props) {
|
|
|
8179
8062
|
postalCode: userData.postalCode,
|
|
8180
8063
|
currency: userData.currency,
|
|
8181
8064
|
});
|
|
8182
|
-
const
|
|
8183
|
-
console.log({ skipNextStep });
|
|
8184
|
-
if (skipNextStep) {
|
|
8185
|
-
try {
|
|
8186
|
-
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
8187
|
-
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
8188
|
-
!hasValidCurrentDocument) {
|
|
8189
|
-
// Go to docusign form
|
|
8190
|
-
setStep("/3");
|
|
8191
|
-
}
|
|
8192
|
-
else {
|
|
8193
|
-
if (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.brandedSignup) {
|
|
8194
|
-
// Go to banking information form
|
|
8195
|
-
setStep("/4");
|
|
8196
|
-
}
|
|
8197
|
-
else {
|
|
8198
|
-
// Go right to the dashboard
|
|
8199
|
-
setStep("/dashboard");
|
|
8200
|
-
}
|
|
8201
|
-
}
|
|
8202
|
-
return;
|
|
8203
|
-
}
|
|
8204
|
-
catch (e) {
|
|
8205
|
-
setErrors({ general: true });
|
|
8206
|
-
return;
|
|
8207
|
-
}
|
|
8208
|
-
}
|
|
8209
|
-
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
8065
|
+
const nextStep = context.overrideNextStep || "/2";
|
|
8210
8066
|
setStep(nextStep);
|
|
8211
8067
|
}
|
|
8212
|
-
function getSkipNextStep(userData) {
|
|
8213
|
-
if (userData.countryCode === "US")
|
|
8214
|
-
return true;
|
|
8215
|
-
return true;
|
|
8216
|
-
}
|
|
8217
8068
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
8218
8069
|
const regionObj = hasStates
|
|
8219
8070
|
? sqmInvoiceTableView.ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -8241,17 +8092,16 @@ function useUserInfoForm(props) {
|
|
|
8241
8092
|
allCountries: countries,
|
|
8242
8093
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
8243
8094
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
8244
|
-
partnerData: (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher,
|
|
8245
8095
|
},
|
|
8246
8096
|
states: {
|
|
8247
8097
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
8248
8098
|
hideState: !hasStates,
|
|
8249
8099
|
hideSteps: !!context.hideSteps,
|
|
8250
|
-
disabled: loading
|
|
8100
|
+
disabled: loading,
|
|
8251
8101
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
8252
|
-
loading: loading
|
|
8253
|
-
isPartner: !!((
|
|
8254
|
-
isUser: !!((
|
|
8102
|
+
loading: loading,
|
|
8103
|
+
isPartner: !!((_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher),
|
|
8104
|
+
isUser: !!((_d = (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.user),
|
|
8255
8105
|
formState: {
|
|
8256
8106
|
...userFormContext,
|
|
8257
8107
|
errors: formErrors,
|
|
@@ -8443,7 +8293,7 @@ const TaxForm = class {
|
|
|
8443
8293
|
}
|
|
8444
8294
|
};
|
|
8445
8295
|
function useDemoUserInfoForm(props) {
|
|
8446
|
-
const setStep = index_module.En(
|
|
8296
|
+
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
8447
8297
|
return cjs.cjs({
|
|
8448
8298
|
setStep,
|
|
8449
8299
|
onSubmit: () => {
|