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