@saasquatch/mint-components 1.15.5-3 → 1.15.5
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 -378
- 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 -143
- 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-fc4e609e.js → usePayoutStatus-733ef29a.js} +2 -167
- 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-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 +1 -87
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +0 -327
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +3 -27
- 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 +1 -85
- 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 +188 -332
- 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 +10 -143
- 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-b4bdbfa7.js → usePayoutStatus-b89e8c49.js} +4 -154
- 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-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-b89e8c49.js +6 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-021b0540.js +46 -0
- package/dist/mint-components/{p-4a731079.entry.js → p-1edebab1.entry.js} +2 -2
- 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-3d73cd84.entry.js +220 -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-8db18561.system.entry.js +1 -0
- package/dist/mint-components/p-9308221f.js +1 -0
- package/dist/mint-components/p-959c42b2.system.entry.js +1 -0
- package/dist/mint-components/p-a6494752.system.js +6 -0
- package/dist/mint-components/p-bc021969.system.js +1 -0
- package/dist/mint-components/p-c78e6066.entry.js +273 -0
- package/dist/mint-components/{p-0d939b73.system.js → p-d15b642f.system.js} +1 -1
- package/dist/mint-components/p-e64e8354.system.entry.js +1 -0
- package/dist/mint-components/p-e8e48982.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-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 -14
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +0 -53
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +1 -2
- 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 +10 -296
- 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-b4bdbfa7.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-50988798.system.entry.js +0 -1
- package/dist/mint-components/p-59fe6066.js +0 -1
- package/dist/mint-components/p-86a5db85.system.js +0 -1
- package/dist/mint-components/p-93db61eb.system.js +0 -6
- 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-a4f494ee.system.entry.js +0 -1
- package/dist/mint-components/p-e3deed72.entry.js +0 -273
- package/dist/mint-components/p-e8981f26.entry.js +0 -109
- package/dist/mint-components/p-fde41ad1.js +0 -157
|
@@ -14,12 +14,139 @@ import { l as luxon } from './luxon-8d51c92b.js';
|
|
|
14
14
|
import { g as generateUserError } from './useReferralTable-b3876ed6.js';
|
|
15
15
|
import { T as TextSpanView } from './sqm-text-span-view-ca32495e.js';
|
|
16
16
|
import { E as ErrorView } from './ErrorView-48e2b969.js';
|
|
17
|
-
import { t as taxTypeToName, v as validTaxDocument, a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, g as getCountryObj, O as OtherRegionSlotView, I as InvoiceTableView, L as LoadingView, c as vatLabels, G as GeneralLoadingView, f as formatErrorMessage, d as validateBillingField, o as objectIsFull, A as ADDRESS_REGIONS } from './sqm-invoice-table-view-
|
|
17
|
+
import { t as taxTypeToName, v as validTaxDocument, a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, g as getCountryObj, O as OtherRegionSlotView, I as InvoiceTableView, L as LoadingView, c as vatLabels, G as GeneralLoadingView, f as formatErrorMessage, d as validateBillingField, o as objectIsFull, A as ADDRESS_REGIONS } from './sqm-invoice-table-view-3491dd80.js';
|
|
18
18
|
import { e as extractProps } from './extractProps-ae1afbb3.js';
|
|
19
19
|
import { b as VERIFICATION_EVENT_KEY, V as VERIFICATION_EMAIL_NAMESPACE, S as SHOW_CODE_NAMESPACE, a as VERIFICATION_PARENT_NAMESPACE } from './keys-406491dc.js';
|
|
20
|
-
import {
|
|
20
|
+
import { T as TAX_FORM_UPDATED_EVENT_KEY, a as useVeriffApp, g as getStatus, V as VERIFF_COMPLETE_EVENT_KEY } from './usePayoutStatus-b89e8c49.js';
|
|
21
21
|
import { u as useVerificationEmail } from './useVerificationEmail-edc318cb.js';
|
|
22
22
|
|
|
23
|
+
const TAX_CONTEXT_NAMESPACE = "sq:tax-and-cash";
|
|
24
|
+
const TAX_FORM_CONTEXT_NAMESPACE = "sq:tax-form-context";
|
|
25
|
+
const USER_QUERY_NAMESPACE = "sq:user-info-query";
|
|
26
|
+
const USER_FORM_CONTEXT_NAMESPACE = "sq:user-form-context";
|
|
27
|
+
const FINANCE_NETWORK_SETTINGS_NAMESPACE = "sq:finance-network-settings";
|
|
28
|
+
const COUNTRIES_NAMESPACE = "sq:countries:list";
|
|
29
|
+
const SORTED_COUNTRIES_NAMESPACE = "sq:countries:sorted";
|
|
30
|
+
const COUNTRIES_QUERY_NAMESPACE = "sq:countries:query";
|
|
31
|
+
const CURRENCIES_NAMESPACE = "sq:currencies:list";
|
|
32
|
+
const CURRENCIES_QUERY_NAMESPACE = "sq:currencies:query";
|
|
33
|
+
const GET_USER = dist.gql `
|
|
34
|
+
query getUserTaxInfo {
|
|
35
|
+
user: viewer {
|
|
36
|
+
... on User {
|
|
37
|
+
id
|
|
38
|
+
firstName
|
|
39
|
+
lastName
|
|
40
|
+
email
|
|
41
|
+
countryCode
|
|
42
|
+
customFields
|
|
43
|
+
rewards(limit: 1000) {
|
|
44
|
+
data {
|
|
45
|
+
statuses
|
|
46
|
+
partnerFundsTransfer {
|
|
47
|
+
id
|
|
48
|
+
status
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
managedIdentity {
|
|
53
|
+
uid
|
|
54
|
+
email
|
|
55
|
+
emailVerified
|
|
56
|
+
}
|
|
57
|
+
impactConnection {
|
|
58
|
+
connected
|
|
59
|
+
user {
|
|
60
|
+
firstName
|
|
61
|
+
lastName
|
|
62
|
+
}
|
|
63
|
+
publisher {
|
|
64
|
+
id
|
|
65
|
+
brandedSignup
|
|
66
|
+
countryCode
|
|
67
|
+
currency
|
|
68
|
+
billingAddress
|
|
69
|
+
billingCity
|
|
70
|
+
billingState
|
|
71
|
+
billingCountryCode
|
|
72
|
+
billingPostalCode
|
|
73
|
+
phoneNumberCountryCode
|
|
74
|
+
phoneNumber
|
|
75
|
+
taxInformation {
|
|
76
|
+
indirectTaxId
|
|
77
|
+
indirectTaxCountryCode
|
|
78
|
+
indirectTaxRegion
|
|
79
|
+
additionalTaxId
|
|
80
|
+
withholdingTaxId
|
|
81
|
+
withholdingTaxCountryCode
|
|
82
|
+
}
|
|
83
|
+
requiredTaxDocumentType
|
|
84
|
+
currentTaxDocument {
|
|
85
|
+
status
|
|
86
|
+
type
|
|
87
|
+
dateCreated
|
|
88
|
+
}
|
|
89
|
+
withdrawalSettings {
|
|
90
|
+
paymentMethod
|
|
91
|
+
paypalEmailAddress
|
|
92
|
+
bankCountry
|
|
93
|
+
bankAccountNumber
|
|
94
|
+
paymentSchedulingType
|
|
95
|
+
paymentThreshold
|
|
96
|
+
paymentDay
|
|
97
|
+
}
|
|
98
|
+
payoutsAccount {
|
|
99
|
+
hold
|
|
100
|
+
holdReasons
|
|
101
|
+
balance
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`;
|
|
109
|
+
const GET_COUNTRIES = dist.gql `
|
|
110
|
+
query getCountries {
|
|
111
|
+
impactPayoutCountries(limit: 1000) {
|
|
112
|
+
data {
|
|
113
|
+
countryCode
|
|
114
|
+
displayName
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
119
|
+
const GET_CURRENCIES = dist.gql `
|
|
120
|
+
query currencies($locale: RSLocale) {
|
|
121
|
+
currencies(limit: 300) {
|
|
122
|
+
data {
|
|
123
|
+
displayName(locale: $locale)
|
|
124
|
+
currencyCode
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
const GET_FINANCE_NETWORK_SETTINGS = dist.gql `
|
|
130
|
+
query impactFinanceNetworkSettings(
|
|
131
|
+
$filter: ImpactFinanceNetworkSettingsFilterInput
|
|
132
|
+
) {
|
|
133
|
+
impactFinanceNetworkSettings(filter: $filter, limit: 1000) {
|
|
134
|
+
data {
|
|
135
|
+
countryCode
|
|
136
|
+
currency
|
|
137
|
+
defaultFinancePaymentMethodId
|
|
138
|
+
thresholdOptions
|
|
139
|
+
withdrawalSettingId
|
|
140
|
+
internationalEftFee
|
|
141
|
+
foreignFxFee
|
|
142
|
+
defaultFxFee
|
|
143
|
+
}
|
|
144
|
+
totalCount
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
`;
|
|
148
|
+
const FORM_STEPS = 4;
|
|
149
|
+
|
|
23
150
|
function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
24
151
|
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;
|
|
25
152
|
const { errors, ...formState } = props.states.formState;
|
|
@@ -3045,51 +3172,8 @@ function useIndirectTaxForm(props) {
|
|
|
3045
3172
|
console.error("Could not detect select change");
|
|
3046
3173
|
setFormState((p) => ({ ...p, [field]: value }));
|
|
3047
3174
|
};
|
|
3048
|
-
async function connectPartner(formData) {
|
|
3049
|
-
var _a, _b, _c, _d, _e;
|
|
3050
|
-
const vars = {
|
|
3051
|
-
user: {
|
|
3052
|
-
id: user.id,
|
|
3053
|
-
accountId: user.accountId,
|
|
3054
|
-
},
|
|
3055
|
-
firstName: userForm.firstName,
|
|
3056
|
-
lastName: userForm.lastName,
|
|
3057
|
-
countryCode: userForm.countryCode,
|
|
3058
|
-
currency: userForm.currency,
|
|
3059
|
-
address: userForm.address,
|
|
3060
|
-
city: userForm.city,
|
|
3061
|
-
state: userForm.state,
|
|
3062
|
-
postalCode: userForm.postalCode,
|
|
3063
|
-
phoneNumber: userForm.phoneNumber,
|
|
3064
|
-
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
3065
|
-
indirectTaxCountryCode: formData.selectedRegion,
|
|
3066
|
-
indirectTaxRegion: formData.province || formData.subRegion,
|
|
3067
|
-
indirectTaxId: formData.indirectTaxNumber,
|
|
3068
|
-
additionalTaxId: formData.qstNumber,
|
|
3069
|
-
withholdingTaxId: formData.subRegionTaxNumber,
|
|
3070
|
-
};
|
|
3071
|
-
const result = await connectImpactPartner({
|
|
3072
|
-
vars,
|
|
3073
|
-
});
|
|
3074
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
3075
|
-
throw new Error();
|
|
3076
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
3077
|
-
// Output backend errors to console for now
|
|
3078
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
3079
|
-
throw new Error();
|
|
3080
|
-
}
|
|
3081
|
-
await refetch();
|
|
3082
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
3083
|
-
.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;
|
|
3084
|
-
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
3085
|
-
// Fire form change event
|
|
3086
|
-
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
3087
|
-
return {
|
|
3088
|
-
resultPublisher,
|
|
3089
|
-
hasValidCurrentDocument,
|
|
3090
|
-
};
|
|
3091
|
-
}
|
|
3092
3175
|
const onSubmit = async (event) => {
|
|
3176
|
+
var _a, _b, _c, _d, _e;
|
|
3093
3177
|
if (!option) {
|
|
3094
3178
|
setErrors({ taxDetails: true });
|
|
3095
3179
|
return;
|
|
@@ -3115,7 +3199,44 @@ function useIndirectTaxForm(props) {
|
|
|
3115
3199
|
}
|
|
3116
3200
|
setLoading(true);
|
|
3117
3201
|
try {
|
|
3118
|
-
const
|
|
3202
|
+
const vars = {
|
|
3203
|
+
user: {
|
|
3204
|
+
id: user.id,
|
|
3205
|
+
accountId: user.accountId,
|
|
3206
|
+
},
|
|
3207
|
+
firstName: userForm.firstName,
|
|
3208
|
+
lastName: userForm.lastName,
|
|
3209
|
+
countryCode: userForm.countryCode,
|
|
3210
|
+
currency: userForm.currency,
|
|
3211
|
+
address: userForm.address,
|
|
3212
|
+
city: userForm.city,
|
|
3213
|
+
state: userForm.state,
|
|
3214
|
+
postalCode: userForm.postalCode,
|
|
3215
|
+
phoneNumber: userForm.phoneNumber,
|
|
3216
|
+
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
3217
|
+
indirectTaxCountryCode: formData.selectedRegion,
|
|
3218
|
+
indirectTaxRegion: formData.province || formData.subRegion,
|
|
3219
|
+
indirectTaxId: formData.indirectTaxNumber,
|
|
3220
|
+
additionalTaxId: formData.qstNumber,
|
|
3221
|
+
withholdingTaxId: formData.subRegionTaxNumber,
|
|
3222
|
+
};
|
|
3223
|
+
const result = await connectImpactPartner({
|
|
3224
|
+
vars,
|
|
3225
|
+
});
|
|
3226
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
3227
|
+
throw new Error();
|
|
3228
|
+
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
3229
|
+
// Output backend errors to console for now
|
|
3230
|
+
console.error("Failed to create Impact connection: ", result.createImpactConnection
|
|
3231
|
+
.validationErrors);
|
|
3232
|
+
throw new Error();
|
|
3233
|
+
}
|
|
3234
|
+
await refetch();
|
|
3235
|
+
const resultPublisher = (_e = (_d = (_c = result
|
|
3236
|
+
.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;
|
|
3237
|
+
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
3238
|
+
// Fire form change event
|
|
3239
|
+
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
3119
3240
|
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
3120
3241
|
!hasValidCurrentDocument) {
|
|
3121
3242
|
// Go to docusign form
|
|
@@ -5307,54 +5428,6 @@ const TaxAndCashMonolith = class {
|
|
|
5307
5428
|
* @uiName Account review alert description
|
|
5308
5429
|
*/
|
|
5309
5430
|
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}.";
|
|
5310
|
-
/**
|
|
5311
|
-
* @uiName Payment on hold alert header
|
|
5312
|
-
*/
|
|
5313
|
-
this.dashboard_paymentOnHoldHeader = "We are reviewing your new payout settings";
|
|
5314
|
-
/**
|
|
5315
|
-
* @uiName Payment on hold alert description
|
|
5316
|
-
*/
|
|
5317
|
-
this.dashboard_paymentOnHoldDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
5318
|
-
/**
|
|
5319
|
-
* @uiName Beneficiary name invalid alert header
|
|
5320
|
-
*/
|
|
5321
|
-
this.dashboard_beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
5322
|
-
/**
|
|
5323
|
-
* @uiName Beneficiary name invalid description
|
|
5324
|
-
*/
|
|
5325
|
-
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.";
|
|
5326
|
-
/**
|
|
5327
|
-
* @uiName Beneficiary name mismatch alert header
|
|
5328
|
-
*/
|
|
5329
|
-
this.dashboard_beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
5330
|
-
/**
|
|
5331
|
-
* @uiName Beneficiary name mismatch alert description
|
|
5332
|
-
*/
|
|
5333
|
-
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.";
|
|
5334
|
-
/**
|
|
5335
|
-
* @uiName Bank name mismatch alert header
|
|
5336
|
-
*/
|
|
5337
|
-
this.dashboard_bankNameMismatchHeader = "Your payment information does not match your tax form";
|
|
5338
|
-
/**
|
|
5339
|
-
* @uiName Bank name mismatch alert description
|
|
5340
|
-
*/
|
|
5341
|
-
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.";
|
|
5342
|
-
/**
|
|
5343
|
-
* @uiName Withdrawal settings invalid alert header
|
|
5344
|
-
*/
|
|
5345
|
-
this.dashboard_withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
5346
|
-
/**
|
|
5347
|
-
* @uiName Withdrawal settings invalid alert description
|
|
5348
|
-
*/
|
|
5349
|
-
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.";
|
|
5350
|
-
/**
|
|
5351
|
-
* @uiName Payment returned alert header
|
|
5352
|
-
*/
|
|
5353
|
-
this.dashboard_paymentReturnedHeader = "Payout unsuccessful";
|
|
5354
|
-
/**
|
|
5355
|
-
* @uiName Payment returned alert description
|
|
5356
|
-
*/
|
|
5357
|
-
this.dashboard_paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
5358
5431
|
/**
|
|
5359
5432
|
* @uiName Terms and Conditions text
|
|
5360
5433
|
* @uiGroup Dashboard Properties
|
|
@@ -5826,7 +5899,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5826
5899
|
icon: "exclamation-octagon",
|
|
5827
5900
|
class: sheet$5.classes.ErrorHoldAlertContainer,
|
|
5828
5901
|
};
|
|
5829
|
-
case "
|
|
5902
|
+
case "ACCOUNT_REVIEW":
|
|
5830
5903
|
return {
|
|
5831
5904
|
header: text.accountReviewHeader,
|
|
5832
5905
|
description: intl.formatMessage({
|
|
@@ -5840,90 +5913,6 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5840
5913
|
icon: "exclamation-triangle",
|
|
5841
5914
|
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5842
5915
|
};
|
|
5843
|
-
case "PAYMENT_HOLD_ON_CHANGE":
|
|
5844
|
-
return {
|
|
5845
|
-
header: text.paymentHoldOnChangeHeader,
|
|
5846
|
-
description: intl.formatMessage({
|
|
5847
|
-
id: "accountReviewDescription",
|
|
5848
|
-
defaultMessage: text.paymentHoldOnChangeDescription,
|
|
5849
|
-
}, {
|
|
5850
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5851
|
-
}),
|
|
5852
|
-
buttonText: null,
|
|
5853
|
-
alertType: "warning",
|
|
5854
|
-
icon: "exclamation-triangle",
|
|
5855
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5856
|
-
};
|
|
5857
|
-
case "BENEFICIARY_NAME_INVALID":
|
|
5858
|
-
return {
|
|
5859
|
-
header: text.beneficiaryNameInvalidHeader,
|
|
5860
|
-
description: intl.formatMessage({
|
|
5861
|
-
id: "accountReviewDescription",
|
|
5862
|
-
defaultMessage: text.beneficiaryNameInvalidDescription,
|
|
5863
|
-
}, {
|
|
5864
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5865
|
-
}),
|
|
5866
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5867
|
-
alertType: "warning",
|
|
5868
|
-
icon: "exclamation-triangle",
|
|
5869
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5870
|
-
};
|
|
5871
|
-
case "BENEFICIARY_NAME_MISMATCH":
|
|
5872
|
-
return {
|
|
5873
|
-
header: text.beneficiaryNameMismatchHeader,
|
|
5874
|
-
description: intl.formatMessage({
|
|
5875
|
-
id: "accountReviewDescription",
|
|
5876
|
-
defaultMessage: text.beneficiaryNameMismatchDescription,
|
|
5877
|
-
}, {
|
|
5878
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5879
|
-
}),
|
|
5880
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5881
|
-
alertType: "warning",
|
|
5882
|
-
icon: "exclamation-triangle",
|
|
5883
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5884
|
-
};
|
|
5885
|
-
case "BANK_TAX_NAME_MISMATCH":
|
|
5886
|
-
return {
|
|
5887
|
-
header: text.bankTaxNameMismatchHeader,
|
|
5888
|
-
description: intl.formatMessage({
|
|
5889
|
-
id: "accountReviewDescription",
|
|
5890
|
-
defaultMessage: text.bankTaxNameMismatchDescription,
|
|
5891
|
-
}, {
|
|
5892
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5893
|
-
}),
|
|
5894
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5895
|
-
alertType: "warning",
|
|
5896
|
-
icon: "exclamation-triangle",
|
|
5897
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5898
|
-
};
|
|
5899
|
-
case "WITHDRAWAL_SETTINGS_INVALID":
|
|
5900
|
-
return {
|
|
5901
|
-
header: text.withdrawalSettingsInvalidHeader,
|
|
5902
|
-
description: intl.formatMessage({
|
|
5903
|
-
id: "accountReviewDescription",
|
|
5904
|
-
defaultMessage: text.withdrawalSettingsInvalidDescription,
|
|
5905
|
-
}, {
|
|
5906
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5907
|
-
}),
|
|
5908
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5909
|
-
alertType: "warning",
|
|
5910
|
-
icon: "exclamation-triangle",
|
|
5911
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5912
|
-
};
|
|
5913
|
-
case "PAYMENT_RETURNED":
|
|
5914
|
-
return {
|
|
5915
|
-
header: text.paymentReturnedHeader,
|
|
5916
|
-
description: intl.formatMessage({
|
|
5917
|
-
id: "accountReviewDescription",
|
|
5918
|
-
defaultMessage: text.paymentReturnedDescription,
|
|
5919
|
-
}, {
|
|
5920
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5921
|
-
}),
|
|
5922
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5923
|
-
alertType: "warning",
|
|
5924
|
-
icon: "exclamation-triangle",
|
|
5925
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5926
|
-
};
|
|
5927
5916
|
case "HOLD":
|
|
5928
5917
|
return {
|
|
5929
5918
|
header: text.payoutHoldAlertHeader,
|
|
@@ -6493,54 +6482,6 @@ const TaxAndCashDashboard = class {
|
|
|
6493
6482
|
* @uiName Account review alert description
|
|
6494
6483
|
*/
|
|
6495
6484
|
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}.";
|
|
6496
|
-
/**
|
|
6497
|
-
* @uiName Payment hold on change alert header
|
|
6498
|
-
*/
|
|
6499
|
-
this.paymentHoldOnChangeHeader = "We are reviewing your new payout settings";
|
|
6500
|
-
/**
|
|
6501
|
-
* @uiName Payment hold on change alert description
|
|
6502
|
-
*/
|
|
6503
|
-
this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
6504
|
-
/**
|
|
6505
|
-
* @uiName Beneficiary name invalid alert header
|
|
6506
|
-
*/
|
|
6507
|
-
this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
6508
|
-
/**
|
|
6509
|
-
* @uiName Beneficiary name invalid description
|
|
6510
|
-
*/
|
|
6511
|
-
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.";
|
|
6512
|
-
/**
|
|
6513
|
-
* @uiName Beneficiary name mismatch alert header
|
|
6514
|
-
*/
|
|
6515
|
-
this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
6516
|
-
/**
|
|
6517
|
-
* @uiName Beneficiary name mismatch alert description
|
|
6518
|
-
*/
|
|
6519
|
-
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.";
|
|
6520
|
-
/**
|
|
6521
|
-
* @uiName Bank name mismatch alert header
|
|
6522
|
-
*/
|
|
6523
|
-
this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
|
|
6524
|
-
/**
|
|
6525
|
-
* @uiName Bank name mismatch alert description
|
|
6526
|
-
*/
|
|
6527
|
-
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.";
|
|
6528
|
-
/**
|
|
6529
|
-
* @uiName Withdrawal settings invalid alert header
|
|
6530
|
-
*/
|
|
6531
|
-
this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
6532
|
-
/**
|
|
6533
|
-
* @uiName Withdrawal settings invalid alert description
|
|
6534
|
-
*/
|
|
6535
|
-
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.";
|
|
6536
|
-
/**
|
|
6537
|
-
* @uiName Payment returned alert header
|
|
6538
|
-
*/
|
|
6539
|
-
this.paymentReturnedHeader = "Payout unsuccessful";
|
|
6540
|
-
/**
|
|
6541
|
-
* @uiName Payment returned alert description
|
|
6542
|
-
*/
|
|
6543
|
-
this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
6544
6485
|
/**
|
|
6545
6486
|
* @uiName Terms and Conditions text
|
|
6546
6487
|
*/
|
|
@@ -7806,12 +7747,6 @@ const UserInfoFormView = (props) => {
|
|
|
7806
7747
|
default:
|
|
7807
7748
|
regionLabel = text.state;
|
|
7808
7749
|
}
|
|
7809
|
-
function isDisabledInput(field) {
|
|
7810
|
-
var _a;
|
|
7811
|
-
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
7812
|
-
return true;
|
|
7813
|
-
return false;
|
|
7814
|
-
}
|
|
7815
7750
|
return (h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
7816
7751
|
h("style", { type: "text/css" },
|
|
7817
7752
|
styleString$6,
|
|
@@ -7859,22 +7794,18 @@ const UserInfoFormView = (props) => {
|
|
|
7859
7794
|
}))),
|
|
7860
7795
|
h("div", null,
|
|
7861
7796
|
h("div", { class: classes.InputContainer },
|
|
7862
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
7863
|
-
states.isUser ||
|
|
7864
|
-
isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
7797
|
+
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) ? {
|
|
7865
7798
|
class: classes.ErrorInput,
|
|
7866
7799
|
helpText: formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
7867
7800
|
}
|
|
7868
7801
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
7869
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
7870
|
-
states.isUser ||
|
|
7871
|
-
isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
7802
|
+
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) ? {
|
|
7872
7803
|
class: classes.ErrorInput,
|
|
7873
7804
|
helpText: formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
7874
7805
|
}
|
|
7875
7806
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
7876
7807
|
h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
|
|
7877
|
-
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 ||
|
|
7808
|
+
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) ? {
|
|
7878
7809
|
class: classes.ErrorInput,
|
|
7879
7810
|
helpText: formatErrorMessage(text.country, formState.errors.countryCode),
|
|
7880
7811
|
}
|
|
@@ -7890,8 +7821,7 @@ const UserInfoFormView = (props) => {
|
|
|
7890
7821
|
h("div", { class: classes.PhoneInputsSection },
|
|
7891
7822
|
h("p", null, text.phoneNumber),
|
|
7892
7823
|
h("div", { class: classes.PhoneInputsContainer },
|
|
7893
|
-
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
7894
|
-
isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
7824
|
+
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) ? {
|
|
7895
7825
|
class: classes.ErrorInput,
|
|
7896
7826
|
}
|
|
7897
7827
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -7917,7 +7847,7 @@ const UserInfoFormView = (props) => {
|
|
|
7917
7847
|
// Naive phone number validation
|
|
7918
7848
|
validateBillingField(/[a-zA-Z]+/, value) &&
|
|
7919
7849
|
formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
7920
|
-
}, disabled: states.disabled ||
|
|
7850
|
+
}, disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
7921
7851
|
class: classes.ErrorInput,
|
|
7922
7852
|
helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
7923
7853
|
}
|
|
@@ -7925,7 +7855,7 @@ const UserInfoFormView = (props) => {
|
|
|
7925
7855
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
7926
7856
|
// Checks for non-ASCII characters
|
|
7927
7857
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
7928
|
-
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
7858
|
+
formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
7929
7859
|
class: classes.ErrorInput,
|
|
7930
7860
|
helpText: formatErrorMessage(text.address, formState.errors.address),
|
|
7931
7861
|
}
|
|
@@ -7933,22 +7863,22 @@ const UserInfoFormView = (props) => {
|
|
|
7933
7863
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
|
|
7934
7864
|
// Checks for non-ASCII characters
|
|
7935
7865
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
7936
|
-
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
7866
|
+
formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || states.isPartner }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
7937
7867
|
class: classes.ErrorInput,
|
|
7938
7868
|
helpText: formatErrorMessage(text.city, formState.errors.city),
|
|
7939
7869
|
}
|
|
7940
7870
|
: {}), { required: true })),
|
|
7941
|
-
!states.hideState && (h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled ||
|
|
7871
|
+
!states.hideState && (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) ? {
|
|
7942
7872
|
class: classes.ErrorInput,
|
|
7943
7873
|
helpText: formatErrorMessage(text.state, formState.errors.state),
|
|
7944
7874
|
}
|
|
7945
7875
|
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (h("sl-menu-item", { value: r.value }, r.label))))),
|
|
7946
|
-
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 ||
|
|
7876
|
+
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) ? {
|
|
7947
7877
|
class: classes.ErrorInput,
|
|
7948
7878
|
helpText: formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
7949
7879
|
}
|
|
7950
7880
|
: {}), { required: true })),
|
|
7951
|
-
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 ||
|
|
7881
|
+
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) ? {
|
|
7952
7882
|
class: classes.ErrorInput,
|
|
7953
7883
|
helpText: formatErrorMessage(text.currency, formState.errors.currency),
|
|
7954
7884
|
}
|
|
@@ -7970,13 +7900,13 @@ const UserInfoFormView = (props) => {
|
|
|
7970
7900
|
h("div", { class: classes.CheckboxWrapper },
|
|
7971
7901
|
h("sl-checkbox", { exportparts: "label: input-label, base: input-base", checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
7972
7902
|
e.target.value = e.target.checked;
|
|
7973
|
-
}, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
7903
|
+
}, disabled: states.isPartner ? false : states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
7974
7904
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (h("p", { class: classes.ErrorText }, formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
7975
|
-
h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
7905
|
+
h("sl-button", { type: "primary", disabled: states.isPartner ? false : states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
7976
7906
|
};
|
|
7977
7907
|
|
|
7978
7908
|
function useUserInfoForm(props) {
|
|
7979
|
-
var _a, _b, _c, _d
|
|
7909
|
+
var _a, _b, _c, _d;
|
|
7980
7910
|
const currencyRef = useRef(undefined);
|
|
7981
7911
|
const phoneCountryRef = useRef(undefined);
|
|
7982
7912
|
const formRef = useRef(null);
|
|
@@ -7984,9 +7914,7 @@ function useUserInfoForm(props) {
|
|
|
7984
7914
|
const countries = Fn(SORTED_COUNTRIES_NAMESPACE);
|
|
7985
7915
|
const [step, setStep] = Pn(TAX_CONTEXT_NAMESPACE);
|
|
7986
7916
|
const [userFormContext, setUserFormContext] = Pn(USER_FORM_CONTEXT_NAMESPACE);
|
|
7987
|
-
const
|
|
7988
|
-
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = $e(CONNECT_PARTNER);
|
|
7989
|
-
const { data, loading, refetch, errors: userError, } = $n(USER_QUERY_NAMESPACE);
|
|
7917
|
+
const { data, loading, errors: userError, } = $n(USER_QUERY_NAMESPACE);
|
|
7990
7918
|
const _currencies = Fn(CURRENCIES_NAMESPACE);
|
|
7991
7919
|
const currencies = useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
|
|
7992
7920
|
const [countrySearch, setCountrySearch] = useState("");
|
|
@@ -8088,45 +8016,6 @@ function useUserInfoForm(props) {
|
|
|
8088
8016
|
setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
|
|
8089
8017
|
}
|
|
8090
8018
|
}, [currencySearch, currencies]);
|
|
8091
|
-
async function connectPartner(formData) {
|
|
8092
|
-
var _a, _b, _c, _d, _e;
|
|
8093
|
-
const vars = {
|
|
8094
|
-
user: {
|
|
8095
|
-
id: user.id,
|
|
8096
|
-
accountId: user.accountId,
|
|
8097
|
-
},
|
|
8098
|
-
firstName: formData.firstName,
|
|
8099
|
-
lastName: formData.lastName,
|
|
8100
|
-
countryCode: formData.countryCode,
|
|
8101
|
-
currency: formData.currency,
|
|
8102
|
-
address: formData.address,
|
|
8103
|
-
city: formData.city,
|
|
8104
|
-
state: formData.state,
|
|
8105
|
-
postalCode: formData.postalCode,
|
|
8106
|
-
phoneNumber: formData.phoneNumber,
|
|
8107
|
-
phoneNumberCountryCode: formData.phoneNumberCountryCode,
|
|
8108
|
-
};
|
|
8109
|
-
const result = await connectImpactPartner({
|
|
8110
|
-
vars,
|
|
8111
|
-
});
|
|
8112
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
8113
|
-
throw new Error();
|
|
8114
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
8115
|
-
// Output backend errors to console for now
|
|
8116
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
8117
|
-
throw new Error();
|
|
8118
|
-
}
|
|
8119
|
-
await refetch();
|
|
8120
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
8121
|
-
.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;
|
|
8122
|
-
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
8123
|
-
// Fire form change event
|
|
8124
|
-
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
8125
|
-
return {
|
|
8126
|
-
resultPublisher,
|
|
8127
|
-
hasValidCurrentDocument,
|
|
8128
|
-
};
|
|
8129
|
-
}
|
|
8130
8019
|
async function onSubmit(event) {
|
|
8131
8020
|
let formControls = event.target.getFormControls();
|
|
8132
8021
|
let formData = {};
|
|
@@ -8169,41 +8058,9 @@ function useUserInfoForm(props) {
|
|
|
8169
8058
|
postalCode: userData.postalCode,
|
|
8170
8059
|
currency: userData.currency,
|
|
8171
8060
|
});
|
|
8172
|
-
const
|
|
8173
|
-
console.log({ skipNextStep });
|
|
8174
|
-
if (skipNextStep) {
|
|
8175
|
-
try {
|
|
8176
|
-
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
8177
|
-
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
8178
|
-
!hasValidCurrentDocument) {
|
|
8179
|
-
// Go to docusign form
|
|
8180
|
-
setStep("/3");
|
|
8181
|
-
}
|
|
8182
|
-
else {
|
|
8183
|
-
if (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.brandedSignup) {
|
|
8184
|
-
// Go to banking information form
|
|
8185
|
-
setStep("/4");
|
|
8186
|
-
}
|
|
8187
|
-
else {
|
|
8188
|
-
// Go right to the dashboard
|
|
8189
|
-
setStep("/dashboard");
|
|
8190
|
-
}
|
|
8191
|
-
}
|
|
8192
|
-
return;
|
|
8193
|
-
}
|
|
8194
|
-
catch (e) {
|
|
8195
|
-
setErrors({ general: true });
|
|
8196
|
-
return;
|
|
8197
|
-
}
|
|
8198
|
-
}
|
|
8199
|
-
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
8061
|
+
const nextStep = context.overrideNextStep || "/2";
|
|
8200
8062
|
setStep(nextStep);
|
|
8201
8063
|
}
|
|
8202
|
-
function getSkipNextStep(userData) {
|
|
8203
|
-
if (userData.countryCode === "US")
|
|
8204
|
-
return true;
|
|
8205
|
-
return true;
|
|
8206
|
-
}
|
|
8207
8064
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
8208
8065
|
const regionObj = hasStates
|
|
8209
8066
|
? ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -8231,17 +8088,16 @@ function useUserInfoForm(props) {
|
|
|
8231
8088
|
allCountries: countries,
|
|
8232
8089
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
8233
8090
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
8234
|
-
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,
|
|
8235
8091
|
},
|
|
8236
8092
|
states: {
|
|
8237
8093
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
8238
8094
|
hideState: !hasStates,
|
|
8239
8095
|
hideSteps: !!context.hideSteps,
|
|
8240
|
-
disabled: loading
|
|
8096
|
+
disabled: loading,
|
|
8241
8097
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
8242
|
-
loading: loading
|
|
8243
|
-
isPartner: !!((
|
|
8244
|
-
isUser: !!((
|
|
8098
|
+
loading: loading,
|
|
8099
|
+
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),
|
|
8100
|
+
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),
|
|
8245
8101
|
formState: {
|
|
8246
8102
|
...userFormContext,
|
|
8247
8103
|
errors: formErrors,
|