@saasquatch/mint-components 1.15.5-2 → 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 -377
- 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 -47
- 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 -90
- 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 -331
- 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 -31
- 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/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-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-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-ba14b5f7.system.entry.js +0 -1
- package/dist/mint-components/p-d0b404d5.entry.js +0 -109
- package/dist/mint-components/p-e3deed72.entry.js +0 -273
- 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
|
|
@@ -3166,7 +3287,6 @@ function useIndirectTaxForm(props) {
|
|
|
3166
3287
|
...p,
|
|
3167
3288
|
hasSubRegionTaxNumber: !p.hasSubRegionTaxNumber,
|
|
3168
3289
|
})),
|
|
3169
|
-
connectPartner,
|
|
3170
3290
|
},
|
|
3171
3291
|
data: {
|
|
3172
3292
|
esRegions: INDIRECT_TAX_SPAIN_REGIONS,
|
|
@@ -5308,54 +5428,6 @@ const TaxAndCashMonolith = class {
|
|
|
5308
5428
|
* @uiName Account review alert description
|
|
5309
5429
|
*/
|
|
5310
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}.";
|
|
5311
|
-
/**
|
|
5312
|
-
* @uiName Payment on hold alert header
|
|
5313
|
-
*/
|
|
5314
|
-
this.dashboard_paymentOnHoldHeader = "We are reviewing your new payout settings";
|
|
5315
|
-
/**
|
|
5316
|
-
* @uiName Payment on hold alert description
|
|
5317
|
-
*/
|
|
5318
|
-
this.dashboard_paymentOnHoldDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
5319
|
-
/**
|
|
5320
|
-
* @uiName Beneficiary name invalid alert header
|
|
5321
|
-
*/
|
|
5322
|
-
this.dashboard_beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
5323
|
-
/**
|
|
5324
|
-
* @uiName Beneficiary name invalid description
|
|
5325
|
-
*/
|
|
5326
|
-
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.";
|
|
5327
|
-
/**
|
|
5328
|
-
* @uiName Beneficiary name mismatch alert header
|
|
5329
|
-
*/
|
|
5330
|
-
this.dashboard_beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
5331
|
-
/**
|
|
5332
|
-
* @uiName Beneficiary name mismatch alert description
|
|
5333
|
-
*/
|
|
5334
|
-
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.";
|
|
5335
|
-
/**
|
|
5336
|
-
* @uiName Bank name mismatch alert header
|
|
5337
|
-
*/
|
|
5338
|
-
this.dashboard_bankNameMismatchHeader = "Your payment information does not match your tax form";
|
|
5339
|
-
/**
|
|
5340
|
-
* @uiName Bank name mismatch alert description
|
|
5341
|
-
*/
|
|
5342
|
-
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.";
|
|
5343
|
-
/**
|
|
5344
|
-
* @uiName Withdrawal settings invalid alert header
|
|
5345
|
-
*/
|
|
5346
|
-
this.dashboard_withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
5347
|
-
/**
|
|
5348
|
-
* @uiName Withdrawal settings invalid alert description
|
|
5349
|
-
*/
|
|
5350
|
-
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.";
|
|
5351
|
-
/**
|
|
5352
|
-
* @uiName Payment returned alert header
|
|
5353
|
-
*/
|
|
5354
|
-
this.dashboard_paymentReturnedHeader = "Payout unsuccessful";
|
|
5355
|
-
/**
|
|
5356
|
-
* @uiName Payment returned alert description
|
|
5357
|
-
*/
|
|
5358
|
-
this.dashboard_paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
5359
5431
|
/**
|
|
5360
5432
|
* @uiName Terms and Conditions text
|
|
5361
5433
|
* @uiGroup Dashboard Properties
|
|
@@ -5827,7 +5899,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5827
5899
|
icon: "exclamation-octagon",
|
|
5828
5900
|
class: sheet$5.classes.ErrorHoldAlertContainer,
|
|
5829
5901
|
};
|
|
5830
|
-
case "
|
|
5902
|
+
case "ACCOUNT_REVIEW":
|
|
5831
5903
|
return {
|
|
5832
5904
|
header: text.accountReviewHeader,
|
|
5833
5905
|
description: intl.formatMessage({
|
|
@@ -5841,90 +5913,6 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5841
5913
|
icon: "exclamation-triangle",
|
|
5842
5914
|
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5843
5915
|
};
|
|
5844
|
-
case "PAYMENT_HOLD_ON_CHANGE":
|
|
5845
|
-
return {
|
|
5846
|
-
header: text.paymentHoldOnChangeHeader,
|
|
5847
|
-
description: intl.formatMessage({
|
|
5848
|
-
id: "accountReviewDescription",
|
|
5849
|
-
defaultMessage: text.paymentHoldOnChangeDescription,
|
|
5850
|
-
}, {
|
|
5851
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5852
|
-
}),
|
|
5853
|
-
buttonText: null,
|
|
5854
|
-
alertType: "warning",
|
|
5855
|
-
icon: "exclamation-triangle",
|
|
5856
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5857
|
-
};
|
|
5858
|
-
case "BENEFICIARY_NAME_INVALID":
|
|
5859
|
-
return {
|
|
5860
|
-
header: text.beneficiaryNameInvalidHeader,
|
|
5861
|
-
description: intl.formatMessage({
|
|
5862
|
-
id: "accountReviewDescription",
|
|
5863
|
-
defaultMessage: text.beneficiaryNameInvalidDescription,
|
|
5864
|
-
}, {
|
|
5865
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5866
|
-
}),
|
|
5867
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5868
|
-
alertType: "warning",
|
|
5869
|
-
icon: "exclamation-triangle",
|
|
5870
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5871
|
-
};
|
|
5872
|
-
case "BENEFICIARY_NAME_MISMATCH":
|
|
5873
|
-
return {
|
|
5874
|
-
header: text.beneficiaryNameMismatchHeader,
|
|
5875
|
-
description: intl.formatMessage({
|
|
5876
|
-
id: "accountReviewDescription",
|
|
5877
|
-
defaultMessage: text.beneficiaryNameMismatchDescription,
|
|
5878
|
-
}, {
|
|
5879
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5880
|
-
}),
|
|
5881
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5882
|
-
alertType: "warning",
|
|
5883
|
-
icon: "exclamation-triangle",
|
|
5884
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5885
|
-
};
|
|
5886
|
-
case "BANK_TAX_NAME_MISMATCH":
|
|
5887
|
-
return {
|
|
5888
|
-
header: text.bankTaxNameMismatchHeader,
|
|
5889
|
-
description: intl.formatMessage({
|
|
5890
|
-
id: "accountReviewDescription",
|
|
5891
|
-
defaultMessage: text.bankTaxNameMismatchDescription,
|
|
5892
|
-
}, {
|
|
5893
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5894
|
-
}),
|
|
5895
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5896
|
-
alertType: "warning",
|
|
5897
|
-
icon: "exclamation-triangle",
|
|
5898
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5899
|
-
};
|
|
5900
|
-
case "WITHDRAWAL_SETTINGS_INVALID":
|
|
5901
|
-
return {
|
|
5902
|
-
header: text.withdrawalSettingsInvalidHeader,
|
|
5903
|
-
description: intl.formatMessage({
|
|
5904
|
-
id: "accountReviewDescription",
|
|
5905
|
-
defaultMessage: text.withdrawalSettingsInvalidDescription,
|
|
5906
|
-
}, {
|
|
5907
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5908
|
-
}),
|
|
5909
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5910
|
-
alertType: "warning",
|
|
5911
|
-
icon: "exclamation-triangle",
|
|
5912
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5913
|
-
};
|
|
5914
|
-
case "PAYMENT_RETURNED":
|
|
5915
|
-
return {
|
|
5916
|
-
header: text.paymentReturnedHeader,
|
|
5917
|
-
description: intl.formatMessage({
|
|
5918
|
-
id: "accountReviewDescription",
|
|
5919
|
-
defaultMessage: text.paymentReturnedDescription,
|
|
5920
|
-
}, {
|
|
5921
|
-
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5922
|
-
}),
|
|
5923
|
-
button: (h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$5.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
5924
|
-
alertType: "warning",
|
|
5925
|
-
icon: "exclamation-triangle",
|
|
5926
|
-
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5927
|
-
};
|
|
5928
5916
|
case "HOLD":
|
|
5929
5917
|
return {
|
|
5930
5918
|
header: text.payoutHoldAlertHeader,
|
|
@@ -6494,54 +6482,6 @@ const TaxAndCashDashboard = class {
|
|
|
6494
6482
|
* @uiName Account review alert description
|
|
6495
6483
|
*/
|
|
6496
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}.";
|
|
6497
|
-
/**
|
|
6498
|
-
* @uiName Payment hold on change alert header
|
|
6499
|
-
*/
|
|
6500
|
-
this.paymentHoldOnChangeHeader = "We are reviewing your new payout settings";
|
|
6501
|
-
/**
|
|
6502
|
-
* @uiName Payment hold on change alert description
|
|
6503
|
-
*/
|
|
6504
|
-
this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
6505
|
-
/**
|
|
6506
|
-
* @uiName Beneficiary name invalid alert header
|
|
6507
|
-
*/
|
|
6508
|
-
this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
6509
|
-
/**
|
|
6510
|
-
* @uiName Beneficiary name invalid description
|
|
6511
|
-
*/
|
|
6512
|
-
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.";
|
|
6513
|
-
/**
|
|
6514
|
-
* @uiName Beneficiary name mismatch alert header
|
|
6515
|
-
*/
|
|
6516
|
-
this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
6517
|
-
/**
|
|
6518
|
-
* @uiName Beneficiary name mismatch alert description
|
|
6519
|
-
*/
|
|
6520
|
-
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.";
|
|
6521
|
-
/**
|
|
6522
|
-
* @uiName Bank name mismatch alert header
|
|
6523
|
-
*/
|
|
6524
|
-
this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
|
|
6525
|
-
/**
|
|
6526
|
-
* @uiName Bank name mismatch alert description
|
|
6527
|
-
*/
|
|
6528
|
-
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.";
|
|
6529
|
-
/**
|
|
6530
|
-
* @uiName Withdrawal settings invalid alert header
|
|
6531
|
-
*/
|
|
6532
|
-
this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
6533
|
-
/**
|
|
6534
|
-
* @uiName Withdrawal settings invalid alert description
|
|
6535
|
-
*/
|
|
6536
|
-
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.";
|
|
6537
|
-
/**
|
|
6538
|
-
* @uiName Payment returned alert header
|
|
6539
|
-
*/
|
|
6540
|
-
this.paymentReturnedHeader = "Payout unsuccessful";
|
|
6541
|
-
/**
|
|
6542
|
-
* @uiName Payment returned alert description
|
|
6543
|
-
*/
|
|
6544
|
-
this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
6545
6485
|
/**
|
|
6546
6486
|
* @uiName Terms and Conditions text
|
|
6547
6487
|
*/
|
|
@@ -7807,12 +7747,6 @@ const UserInfoFormView = (props) => {
|
|
|
7807
7747
|
default:
|
|
7808
7748
|
regionLabel = text.state;
|
|
7809
7749
|
}
|
|
7810
|
-
function isDisabledInput(field) {
|
|
7811
|
-
var _a;
|
|
7812
|
-
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
7813
|
-
return true;
|
|
7814
|
-
return false;
|
|
7815
|
-
}
|
|
7816
7750
|
return (h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
7817
7751
|
h("style", { type: "text/css" },
|
|
7818
7752
|
styleString$6,
|
|
@@ -7860,22 +7794,18 @@ const UserInfoFormView = (props) => {
|
|
|
7860
7794
|
}))),
|
|
7861
7795
|
h("div", null,
|
|
7862
7796
|
h("div", { class: classes.InputContainer },
|
|
7863
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
7864
|
-
states.isUser ||
|
|
7865
|
-
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) ? {
|
|
7866
7798
|
class: classes.ErrorInput,
|
|
7867
7799
|
helpText: formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
7868
7800
|
}
|
|
7869
7801
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
7870
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
7871
|
-
states.isUser ||
|
|
7872
|
-
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) ? {
|
|
7873
7803
|
class: classes.ErrorInput,
|
|
7874
7804
|
helpText: formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
7875
7805
|
}
|
|
7876
7806
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
7877
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 }),
|
|
7878
|
-
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) ? {
|
|
7879
7809
|
class: classes.ErrorInput,
|
|
7880
7810
|
helpText: formatErrorMessage(text.country, formState.errors.countryCode),
|
|
7881
7811
|
}
|
|
@@ -7891,8 +7821,7 @@ const UserInfoFormView = (props) => {
|
|
|
7891
7821
|
h("div", { class: classes.PhoneInputsSection },
|
|
7892
7822
|
h("p", null, text.phoneNumber),
|
|
7893
7823
|
h("div", { class: classes.PhoneInputsContainer },
|
|
7894
|
-
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
7895
|
-
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) ? {
|
|
7896
7825
|
class: classes.ErrorInput,
|
|
7897
7826
|
}
|
|
7898
7827
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -7918,7 +7847,7 @@ const UserInfoFormView = (props) => {
|
|
|
7918
7847
|
// Naive phone number validation
|
|
7919
7848
|
validateBillingField(/[a-zA-Z]+/, value) &&
|
|
7920
7849
|
formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
7921
|
-
}, disabled: states.disabled ||
|
|
7850
|
+
}, disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
7922
7851
|
class: classes.ErrorInput,
|
|
7923
7852
|
helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
7924
7853
|
}
|
|
@@ -7926,7 +7855,7 @@ const UserInfoFormView = (props) => {
|
|
|
7926
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 }) =>
|
|
7927
7856
|
// Checks for non-ASCII characters
|
|
7928
7857
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
7929
|
-
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) ? {
|
|
7930
7859
|
class: classes.ErrorInput,
|
|
7931
7860
|
helpText: formatErrorMessage(text.address, formState.errors.address),
|
|
7932
7861
|
}
|
|
@@ -7934,22 +7863,22 @@ const UserInfoFormView = (props) => {
|
|
|
7934
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 }) =>
|
|
7935
7864
|
// Checks for non-ASCII characters
|
|
7936
7865
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
7937
|
-
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) ? {
|
|
7938
7867
|
class: classes.ErrorInput,
|
|
7939
7868
|
helpText: formatErrorMessage(text.city, formState.errors.city),
|
|
7940
7869
|
}
|
|
7941
7870
|
: {}), { required: true })),
|
|
7942
|
-
!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) ? {
|
|
7943
7872
|
class: classes.ErrorInput,
|
|
7944
7873
|
helpText: formatErrorMessage(text.state, formState.errors.state),
|
|
7945
7874
|
}
|
|
7946
7875
|
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (h("sl-menu-item", { value: r.value }, r.label))))),
|
|
7947
|
-
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) ? {
|
|
7948
7877
|
class: classes.ErrorInput,
|
|
7949
7878
|
helpText: formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
7950
7879
|
}
|
|
7951
7880
|
: {}), { required: true })),
|
|
7952
|
-
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) ? {
|
|
7953
7882
|
class: classes.ErrorInput,
|
|
7954
7883
|
helpText: formatErrorMessage(text.currency, formState.errors.currency),
|
|
7955
7884
|
}
|
|
@@ -7971,13 +7900,13 @@ const UserInfoFormView = (props) => {
|
|
|
7971
7900
|
h("div", { class: classes.CheckboxWrapper },
|
|
7972
7901
|
h("sl-checkbox", { exportparts: "label: input-label, base: input-base", checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
7973
7902
|
e.target.value = e.target.checked;
|
|
7974
|
-
}, 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),
|
|
7975
7904
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (h("p", { class: classes.ErrorText }, formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
7976
|
-
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))))));
|
|
7977
7906
|
};
|
|
7978
7907
|
|
|
7979
7908
|
function useUserInfoForm(props) {
|
|
7980
|
-
var _a, _b, _c, _d
|
|
7909
|
+
var _a, _b, _c, _d;
|
|
7981
7910
|
const currencyRef = useRef(undefined);
|
|
7982
7911
|
const phoneCountryRef = useRef(undefined);
|
|
7983
7912
|
const formRef = useRef(null);
|
|
@@ -7985,9 +7914,7 @@ function useUserInfoForm(props) {
|
|
|
7985
7914
|
const countries = Fn(SORTED_COUNTRIES_NAMESPACE);
|
|
7986
7915
|
const [step, setStep] = Pn(TAX_CONTEXT_NAMESPACE);
|
|
7987
7916
|
const [userFormContext, setUserFormContext] = Pn(USER_FORM_CONTEXT_NAMESPACE);
|
|
7988
|
-
const
|
|
7989
|
-
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = $e(CONNECT_PARTNER);
|
|
7990
|
-
const { data, loading, refetch, errors: userError, } = $n(USER_QUERY_NAMESPACE);
|
|
7917
|
+
const { data, loading, errors: userError, } = $n(USER_QUERY_NAMESPACE);
|
|
7991
7918
|
const _currencies = Fn(CURRENCIES_NAMESPACE);
|
|
7992
7919
|
const currencies = useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
|
|
7993
7920
|
const [countrySearch, setCountrySearch] = useState("");
|
|
@@ -8089,45 +8016,6 @@ function useUserInfoForm(props) {
|
|
|
8089
8016
|
setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
|
|
8090
8017
|
}
|
|
8091
8018
|
}, [currencySearch, currencies]);
|
|
8092
|
-
async function connectPartner(formData) {
|
|
8093
|
-
var _a, _b, _c, _d, _e;
|
|
8094
|
-
const vars = {
|
|
8095
|
-
user: {
|
|
8096
|
-
id: user.id,
|
|
8097
|
-
accountId: user.accountId,
|
|
8098
|
-
},
|
|
8099
|
-
firstName: formData.firstName,
|
|
8100
|
-
lastName: formData.lastName,
|
|
8101
|
-
countryCode: formData.countryCode,
|
|
8102
|
-
currency: formData.currency,
|
|
8103
|
-
address: formData.address,
|
|
8104
|
-
city: formData.city,
|
|
8105
|
-
state: formData.state,
|
|
8106
|
-
postalCode: formData.postalCode,
|
|
8107
|
-
phoneNumber: formData.phoneNumber,
|
|
8108
|
-
phoneNumberCountryCode: formData.phoneNumberCountryCode,
|
|
8109
|
-
};
|
|
8110
|
-
const result = await connectImpactPartner({
|
|
8111
|
-
vars,
|
|
8112
|
-
});
|
|
8113
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
8114
|
-
throw new Error();
|
|
8115
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
8116
|
-
// Output backend errors to console for now
|
|
8117
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
8118
|
-
throw new Error();
|
|
8119
|
-
}
|
|
8120
|
-
await refetch();
|
|
8121
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
8122
|
-
.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;
|
|
8123
|
-
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
8124
|
-
// Fire form change event
|
|
8125
|
-
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
8126
|
-
return {
|
|
8127
|
-
resultPublisher,
|
|
8128
|
-
hasValidCurrentDocument,
|
|
8129
|
-
};
|
|
8130
|
-
}
|
|
8131
8019
|
async function onSubmit(event) {
|
|
8132
8020
|
let formControls = event.target.getFormControls();
|
|
8133
8021
|
let formData = {};
|
|
@@ -8170,39 +8058,9 @@ function useUserInfoForm(props) {
|
|
|
8170
8058
|
postalCode: userData.postalCode,
|
|
8171
8059
|
currency: userData.currency,
|
|
8172
8060
|
});
|
|
8173
|
-
const
|
|
8174
|
-
console.log({ skipNextStep });
|
|
8175
|
-
if (skipNextStep) {
|
|
8176
|
-
try {
|
|
8177
|
-
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
8178
|
-
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
8179
|
-
!hasValidCurrentDocument) {
|
|
8180
|
-
// Go to docusign form
|
|
8181
|
-
setStep("/3");
|
|
8182
|
-
}
|
|
8183
|
-
else {
|
|
8184
|
-
if (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.brandedSignup) {
|
|
8185
|
-
// Go to banking information form
|
|
8186
|
-
setStep("/4");
|
|
8187
|
-
}
|
|
8188
|
-
else {
|
|
8189
|
-
// Go right to the dashboard
|
|
8190
|
-
setStep("/dashboard");
|
|
8191
|
-
}
|
|
8192
|
-
}
|
|
8193
|
-
}
|
|
8194
|
-
catch (e) {
|
|
8195
|
-
setErrors({ general: true });
|
|
8196
|
-
}
|
|
8197
|
-
}
|
|
8198
|
-
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
8061
|
+
const nextStep = context.overrideNextStep || "/2";
|
|
8199
8062
|
setStep(nextStep);
|
|
8200
8063
|
}
|
|
8201
|
-
function getSkipNextStep(userData) {
|
|
8202
|
-
if (userData.countryCode === "US")
|
|
8203
|
-
return true;
|
|
8204
|
-
return true;
|
|
8205
|
-
}
|
|
8206
8064
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
8207
8065
|
const regionObj = hasStates
|
|
8208
8066
|
? ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -8230,17 +8088,16 @@ function useUserInfoForm(props) {
|
|
|
8230
8088
|
allCountries: countries,
|
|
8231
8089
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
8232
8090
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
8233
|
-
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,
|
|
8234
8091
|
},
|
|
8235
8092
|
states: {
|
|
8236
8093
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
8237
8094
|
hideState: !hasStates,
|
|
8238
8095
|
hideSteps: !!context.hideSteps,
|
|
8239
|
-
disabled: loading
|
|
8096
|
+
disabled: loading,
|
|
8240
8097
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
8241
|
-
loading: loading
|
|
8242
|
-
isPartner: !!((
|
|
8243
|
-
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),
|
|
8244
8101
|
formState: {
|
|
8245
8102
|
...userFormContext,
|
|
8246
8103
|
errors: formErrors,
|