@saasquatch/mint-components 2.0.2-6 → 2.0.2-8
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/{IndirectTaxDetailsView-dce2a79b.js → IndirectTaxDetailsView-e5f70b8b.js} +2 -2
- package/dist/cjs/{ShadowViewAddon-357bc625.js → ShadowViewAddon-925a8fa6.js} +8 -8
- package/dist/cjs/{global-3d01d469.js → global-8bba5b3a.js} +1 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mint-components.cjs.js +2 -2
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +345 -115
- package/dist/cjs/sqm-big-stat_47.cjs.entry.js +224 -29
- package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-email-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
- package/dist/cjs/sqm-header-logo.cjs.entry.js +14 -1
- package/dist/cjs/{sqm-lead-checkbox-field-view-ebb9ead9.js → sqm-lead-checkbox-field-view-340acad0.js} +1 -1
- package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-lead-input-field-view-62debb73.js → sqm-lead-input-field-view-06ed3632.js} +1 -1
- package/dist/cjs/sqm-lead-input-field.cjs.entry.js +3 -3
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +1 -1
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-email-verification-view-c280139a.js → sqm-portal-email-verification-view-5518eb0d.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-profile-view-7bca5749.js → sqm-portal-profile-view-615e6975.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +9 -8
- package/dist/cjs/{useLeadFormState-593f5d39.js → useLeadFormState-fd0445f9.js} +1 -1
- package/dist/cjs/{data-16106637.js → usePayoutStatus-9abe2de8.js} +158 -129
- package/dist/cjs/{utils-5167439f.js → utils-83d125fa.js} +1 -1
- package/dist/collection/components/sqm-header-logo/sqm-header-logo.js +80 -3
- package/dist/collection/components/sqm-portal-footer/sqm-portal-footer-view.js +3 -3
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +4 -4
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +1 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +2 -1
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +46 -40
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +90 -2
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +353 -0
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +33 -3
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +301 -1
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +92 -2
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +302 -2
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +23 -12
- 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 +92 -9
- package/dist/collection/global/styles.js +1 -5
- package/dist/collection/global/styles.ts +1 -5
- package/dist/esm/{IndirectTaxDetailsView-b7fa596b.js → IndirectTaxDetailsView-0a57b622.js} +2 -2
- package/dist/esm/{ShadowViewAddon-32559cba.js → ShadowViewAddon-aae27c2e.js} +8 -8
- package/dist/esm/{global-55e73040.js → global-1099f20d.js} +1 -5
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mint-components.js +2 -2
- package/dist/esm/sqm-banking-info-form_10.entry.js +296 -66
- package/dist/esm/sqm-big-stat_47.entry.js +202 -7
- package/dist/esm/sqm-code-verification.entry.js +1 -1
- package/dist/esm/sqm-email-verification.entry.js +1 -1
- package/dist/esm/sqm-empty_4.entry.js +1 -1
- package/dist/esm/sqm-header-logo.entry.js +14 -1
- package/dist/esm/{sqm-lead-checkbox-field-view-c359cc95.js → sqm-lead-checkbox-field-view-cbafee07.js} +1 -1
- package/dist/esm/sqm-lead-checkbox-field.entry.js +3 -3
- package/dist/esm/{sqm-lead-input-field-view-6fe71f32.js → sqm-lead-input-field-view-f3775c28.js} +1 -1
- package/dist/esm/sqm-lead-input-field.entry.js +3 -3
- package/dist/esm/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm/sqm-pagination_3.entry.js +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-176ddb91.js → sqm-portal-email-verification-view-7d86299c.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/{sqm-portal-profile-view-6a53716b.js → sqm-portal-profile-view-3ed13e4d.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +2 -2
- package/dist/esm/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +9 -8
- package/dist/esm/{useLeadFormState-d8667862.js → useLeadFormState-c379e5d7.js} +1 -1
- package/dist/esm/{data-acdb790f.js → usePayoutStatus-e0ef2374.js} +159 -130
- package/dist/esm/{utils-27fdc7d7.js → utils-6122971b.js} +1 -1
- package/dist/esm-es5/{IndirectTaxDetailsView-b7fa596b.js → IndirectTaxDetailsView-0a57b622.js} +1 -1
- package/dist/esm-es5/{ShadowViewAddon-32559cba.js → ShadowViewAddon-aae27c2e.js} +1 -1
- package/dist/esm-es5/{global-55e73040.js → global-1099f20d.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_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
- package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/sqm-header-logo.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-checkbox-field-view-c359cc95.js → sqm-lead-checkbox-field-view-cbafee07.js} +1 -1
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-input-field-view-6fe71f32.js → sqm-lead-input-field-view-f3775c28.js} +1 -1
- package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-176ddb91.js → sqm-portal-email-verification-view-7d86299c.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-6a53716b.js → sqm-portal-profile-view-3ed13e4d.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/{useLeadFormState-d8667862.js → useLeadFormState-c379e5d7.js} +1 -1
- package/dist/esm-es5/usePayoutStatus-e0ef2374.js +6 -0
- package/dist/esm-es5/{utils-27fdc7d7.js → utils-6122971b.js} +1 -1
- package/dist/mint-components/global/styles.ts +1 -5
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-c25e76f7.js → p-00bc7211.js} +1 -1
- package/dist/mint-components/p-0279c71d.system.entry.js +1 -0
- package/dist/mint-components/{p-3aba7c3a.system.entry.js → p-0649123a.system.entry.js} +1 -1
- package/dist/mint-components/p-09ab53fb.system.entry.js +1 -0
- package/dist/mint-components/{p-b9d63ca9.system.entry.js → p-14e813a7.system.entry.js} +1 -1
- package/dist/mint-components/{p-7a2375c3.system.entry.js → p-18720462.system.entry.js} +1 -1
- package/dist/mint-components/{p-6ec7b746.system.entry.js → p-22a9114f.system.entry.js} +1 -1
- package/dist/mint-components/p-27bc4daa.system.entry.js +1 -0
- package/dist/mint-components/{p-73fdd315.system.js → p-38f932ae.system.js} +1 -1
- package/dist/mint-components/{p-5a8911c7.entry.js → p-47c83656.entry.js} +1 -1
- package/dist/mint-components/{p-449314ca.entry.js → p-4c811d12.entry.js} +1 -1
- package/dist/mint-components/{p-745a27ee.system.entry.js → p-4ce51b1c.system.entry.js} +1 -1
- package/dist/mint-components/{p-9db05d78.js → p-4fed8672.js} +1 -1
- package/dist/mint-components/{p-b5905137.system.entry.js → p-511c87ce.system.entry.js} +1 -1
- package/dist/mint-components/{p-5b088b96.system.entry.js → p-56009bf0.system.entry.js} +1 -1
- package/dist/mint-components/{p-47b73018.js → p-57ce33dd.js} +2 -2
- package/dist/mint-components/p-59bb2d52.system.js +6 -0
- package/dist/mint-components/{p-da0a7fa5.entry.js → p-5d059c95.entry.js} +1 -1
- package/dist/mint-components/{p-2e0a3d84.entry.js → p-5f3eafd4.entry.js} +2 -2
- package/dist/mint-components/{p-4cfa1432.system.js → p-60465a2d.system.js} +1 -1
- package/dist/mint-components/{p-93f37676.entry.js → p-60c14cec.entry.js} +1 -1
- package/dist/mint-components/{p-709cdbf7.system.entry.js → p-6445e926.system.entry.js} +1 -1
- package/dist/mint-components/{p-c803eaed.entry.js → p-6c006998.entry.js} +1 -1
- package/dist/mint-components/{p-618d249d.js → p-6d5bd95a.js} +1 -1
- package/dist/mint-components/{p-757820a4.entry.js → p-6d9ce4e5.entry.js} +1 -1
- package/dist/mint-components/{p-959925bf.system.entry.js → p-717b6730.system.entry.js} +1 -1
- package/dist/mint-components/p-72bc9830.entry.js +273 -0
- package/dist/mint-components/{p-f9c3290d.system.js → p-74f43a08.system.js} +1 -1
- package/dist/mint-components/{p-ec0f9326.js → p-79a3344f.js} +1 -1
- package/dist/mint-components/{p-9504b639.js → p-7a268047.js} +1 -1
- package/dist/mint-components/p-8b5b2acc.entry.js +1 -0
- package/dist/mint-components/p-967a9040.system.js +1 -0
- package/dist/mint-components/{p-bcb8532f.entry.js → p-a217cc8d.entry.js} +1 -1
- package/dist/mint-components/{p-b427cf9e.entry.js → p-a5c63310.entry.js} +1 -1
- package/dist/mint-components/{p-271c092c.system.js → p-aa08457e.system.js} +1 -1
- package/dist/mint-components/{p-887e3b03.js → p-aa8c6332.js} +1 -1
- package/dist/mint-components/p-ab111e29.entry.js +1 -0
- package/dist/mint-components/{p-e8661eaa.system.js → p-ad4348c3.system.js} +1 -1
- package/dist/mint-components/{p-130fd1d8.entry.js → p-aefaec37.entry.js} +1 -1
- package/dist/mint-components/{p-54154ed4.system.entry.js → p-bec87ac9.system.entry.js} +1 -1
- package/dist/mint-components/p-c41108ae.js +157 -0
- package/dist/mint-components/{p-52123353.system.js → p-c85f204b.system.js} +1 -1
- package/dist/mint-components/{p-aeea89b4.system.js → p-c994512c.system.js} +1 -1
- package/dist/mint-components/{p-84632241.system.entry.js → p-d3120982.system.entry.js} +1 -1
- package/dist/mint-components/{p-1b7900ed.js → p-db1a0db1.js} +1 -1
- package/dist/mint-components/p-e09c13e3.entry.js +99 -0
- package/dist/mint-components/{p-bcc61fbe.system.js → p-e0a724dd.system.js} +1 -1
- package/dist/mint-components/p-ea0bc627.entry.js +1 -0
- package/dist/mint-components/{p-23c21cf4.js → p-ed16b35a.js} +1 -1
- package/dist/mint-components/{p-0c6259b2.system.js → p-f0eae4e6.system.js} +1 -1
- package/dist/mint-components/{p-46a22d08.system.entry.js → p-f401ef19.system.entry.js} +1 -1
- package/dist/types/components/sqm-header-logo/sqm-header-logo.d.ts +14 -1
- package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +24 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +16 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +57 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +3 -1
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +48 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +12 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +48 -0
- package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +2 -0
- package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +1 -0
- package/dist/types/components.d.ts +331 -41
- 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/data-acdb790f.js +0 -6
- package/dist/mint-components/p-17e3f564.system.entry.js +0 -1
- package/dist/mint-components/p-469a6450.system.js +0 -6
- package/dist/mint-components/p-8a2ec966.entry.js +0 -1
- package/dist/mint-components/p-8a458176.entry.js +0 -273
- package/dist/mint-components/p-9d4f1401.system.entry.js +0 -1
- package/dist/mint-components/p-9ff60e10.system.js +0 -1
- package/dist/mint-components/p-a7ee19dc.entry.js +0 -1
- package/dist/mint-components/p-c8bbd212.entry.js +0 -99
- package/dist/mint-components/p-e1e7d01c.js +0 -157
- package/dist/mint-components/p-eea87fdc.system.entry.js +0 -1
- package/dist/mint-components/p-fac02d24.entry.js +0 -1
- package/shoelace/assets/icons/twitter-x.svg +0 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-a43a63b4.js');
|
|
6
|
-
const global = require('./global-
|
|
6
|
+
const global = require('./global-8bba5b3a.js');
|
|
7
7
|
const domContextHooks_module = require('./dom-context-hooks.module-7fa676ae.js');
|
|
8
8
|
const index_module = require('./index.module-4f54e412.js');
|
|
9
9
|
const jsonpointer = require('./jsonpointer-11327262.js');
|
|
@@ -16,10 +16,10 @@ const reRender = require('./re-render-d516138a.js');
|
|
|
16
16
|
const useChildElements = require('./useChildElements-966c9041.js');
|
|
17
17
|
const luxon = require('./luxon-949beaf2.js');
|
|
18
18
|
const useReferralTable = require('./useReferralTable-90d4d6e9.js');
|
|
19
|
-
const IndirectTaxDetailsView = require('./IndirectTaxDetailsView-
|
|
20
|
-
const utils$1 = require('./utils-
|
|
19
|
+
const IndirectTaxDetailsView = require('./IndirectTaxDetailsView-e5f70b8b.js');
|
|
20
|
+
const utils$1 = require('./utils-83d125fa.js');
|
|
21
21
|
const keys = require('./keys-cff24974.js');
|
|
22
|
-
const
|
|
22
|
+
const usePayoutStatus = require('./usePayoutStatus-9abe2de8.js');
|
|
23
23
|
|
|
24
24
|
function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
25
25
|
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;
|
|
@@ -728,7 +728,7 @@ const BankingInfoFormView = (props) => {
|
|
|
728
728
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
729
729
|
id: "formStep",
|
|
730
730
|
defaultMessage: text.formStep,
|
|
731
|
-
}, { step: states.step, count:
|
|
731
|
+
}, { step: states.step, count: usePayoutStatus.FORM_STEPS }))),
|
|
732
732
|
index.h("h3", { style: { fontSize: "24px" } }, text.taxAndPayouts),
|
|
733
733
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription)),
|
|
734
734
|
((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sqm-form-message", { type: "error" },
|
|
@@ -865,12 +865,12 @@ function useBankingInfoForm(props) {
|
|
|
865
865
|
const host = index_module._();
|
|
866
866
|
const locale = index_module.L();
|
|
867
867
|
const user = index_module.J();
|
|
868
|
-
const [step, setStep] = index_module.Pn(
|
|
869
|
-
const context = index_module.Fn(
|
|
870
|
-
const countries = index_module.Fn(
|
|
868
|
+
const [step, setStep] = index_module.Pn(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
869
|
+
const context = index_module.Fn(usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE);
|
|
870
|
+
const countries = index_module.Fn(usePayoutStatus.SORTED_COUNTRIES_NAMESPACE);
|
|
871
871
|
const formRef = domContextHooks_module.useRef(null);
|
|
872
|
-
const { data: paymentOptionsData, loading: paymentOptionsLoading, errors: paymentOptionsError, } = index_module.$n(
|
|
873
|
-
const { data: userData, refetch, errors: userError, } = index_module.$n(
|
|
872
|
+
const { data: paymentOptionsData, loading: paymentOptionsLoading, errors: paymentOptionsError, } = index_module.$n(usePayoutStatus.FINANCE_NETWORK_SETTINGS_NAMESPACE);
|
|
873
|
+
const { data: userData, refetch, errors: userError, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
874
874
|
const [saveWithdrawalSettings] = index_module.$e(SAVE_WITHDRAWAL_SETTINGS);
|
|
875
875
|
const [updateWithdrawalSettings] = index_module.$e(UPDATE_WITHDRAWAL_SETTINGS);
|
|
876
876
|
const [showVerification, setShowVerification] = domContextHooks_module.useState(false);
|
|
@@ -905,7 +905,8 @@ function useBankingInfoForm(props) {
|
|
|
905
905
|
: _paymentMethodChecked;
|
|
906
906
|
domContextHooks_module.useEffect(() => {
|
|
907
907
|
// reset redirect hash
|
|
908
|
-
window.location.hash
|
|
908
|
+
if (window.location.hash !== "#4")
|
|
909
|
+
window.location.hash = "";
|
|
909
910
|
}, []);
|
|
910
911
|
domContextHooks_module.useEffect(() => {
|
|
911
912
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -1031,7 +1032,7 @@ function useBankingInfoForm(props) {
|
|
|
1031
1032
|
return;
|
|
1032
1033
|
}
|
|
1033
1034
|
// Fire form change event
|
|
1034
|
-
window.dispatchEvent(new Event(
|
|
1035
|
+
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
1035
1036
|
await refetch();
|
|
1036
1037
|
setStep("/dashboard");
|
|
1037
1038
|
}
|
|
@@ -1574,7 +1575,7 @@ function useDemoBankingInfoForm(props) {
|
|
|
1574
1575
|
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;
|
|
1575
1576
|
const defaultCurrency = (_h = (_g = props.demoData) === null || _g === void 0 ? void 0 : _g.states) === null || _h === void 0 ? void 0 : _h.currency;
|
|
1576
1577
|
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;
|
|
1577
|
-
const setStep = index_module.En(
|
|
1578
|
+
const setStep = index_module.En(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
1578
1579
|
const [paymentMethodChecked, setPaymentMethodChecked] = domContextHooks_module.useState(undefined);
|
|
1579
1580
|
const [paymentScheduleChecked, setPaymentScheduleChecked] = domContextHooks_module.useState(undefined);
|
|
1580
1581
|
const [currency, setCurrency] = domContextHooks_module.useState(defaultCurrency);
|
|
@@ -1698,10 +1699,10 @@ const DOCUSIGN_EXPIRED_STATES = ["ttl_expired", "session_timeout"];
|
|
|
1698
1699
|
function useDocusignForm(props) {
|
|
1699
1700
|
var _a, _b, _c;
|
|
1700
1701
|
const user = index_module.J();
|
|
1701
|
-
const context = index_module.Fn(
|
|
1702
|
-
const [step, setStep] = index_module.Pn(
|
|
1703
|
-
const { data
|
|
1704
|
-
const publisher = (_b = (_a = data
|
|
1702
|
+
const context = index_module.Fn(usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE);
|
|
1703
|
+
const [step, setStep] = index_module.Pn(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
1704
|
+
const { data, loading: userLoading, refetch, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
1705
|
+
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;
|
|
1705
1706
|
const [createTaxDocument, { loading: documentLoading, data: document, errors: documentErrors },] = index_module.$e(GET_TAX_DOCUMENT);
|
|
1706
1707
|
const [completeTaxDocument, { loading: completeDocumentLoading, data: completeData, errors: completeErrors, },] = index_module.$e(COMPLETE_TAX_DOCUMENT);
|
|
1707
1708
|
const [docusignStatus, setDocusignStatus] = domContextHooks_module.useState(undefined);
|
|
@@ -1769,7 +1770,7 @@ function useDocusignForm(props) {
|
|
|
1769
1770
|
if (!result.completeImpactPublisherTaxDocument.success)
|
|
1770
1771
|
throw new Error();
|
|
1771
1772
|
// Fire form change event
|
|
1772
|
-
window.dispatchEvent(new Event(
|
|
1773
|
+
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
1773
1774
|
setShowExitButton(true);
|
|
1774
1775
|
}
|
|
1775
1776
|
catch (e) {
|
|
@@ -2073,7 +2074,7 @@ const DocusignFormView = (props) => {
|
|
|
2073
2074
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
2074
2075
|
id: "formStep",
|
|
2075
2076
|
defaultMessage: text.formStep,
|
|
2076
|
-
}, { step: states.step, count:
|
|
2077
|
+
}, { step: states.step, count: usePayoutStatus.FORM_STEPS }))),
|
|
2077
2078
|
index.h("h3", null, text.taxForm),
|
|
2078
2079
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
|
|
2079
2080
|
states.loadingError && (index.h("div", null,
|
|
@@ -2266,7 +2267,7 @@ const DocusignForm = class {
|
|
|
2266
2267
|
get el() { return index.getElement(this); }
|
|
2267
2268
|
};
|
|
2268
2269
|
function useDocusignFormDemo(props) {
|
|
2269
|
-
const setStep = index_module.En(
|
|
2270
|
+
const setStep = index_module.En(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
2270
2271
|
return cjs.cjs({
|
|
2271
2272
|
text: props.getTextProps(),
|
|
2272
2273
|
states: {
|
|
@@ -2452,7 +2453,7 @@ const IndirectTaxFormView = (props) => {
|
|
|
2452
2453
|
global.intl.formatMessage({
|
|
2453
2454
|
id: "formStep",
|
|
2454
2455
|
defaultMessage: text.formStep,
|
|
2455
|
-
}, { step: states.step, count:
|
|
2456
|
+
}, { step: states.step, count: usePayoutStatus.FORM_STEPS }))),
|
|
2456
2457
|
index.h("h3", null, text.indirectTax),
|
|
2457
2458
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription),
|
|
2458
2459
|
index.h("p", { class: classes.DescriptionText }, text.indirectTaxDescription)),
|
|
@@ -2547,12 +2548,12 @@ function useIndirectTaxForm(props) {
|
|
|
2547
2548
|
const user = index_module.J();
|
|
2548
2549
|
const locale = index_module.L();
|
|
2549
2550
|
const formRef = domContextHooks_module.useRef(null);
|
|
2550
|
-
const context = index_module.Fn(
|
|
2551
|
-
const [step, setStep] = index_module.Pn(
|
|
2551
|
+
const context = index_module.Fn(usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE);
|
|
2552
|
+
const [step, setStep] = index_module.Pn(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
2552
2553
|
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = index_module.$e(CONNECT_PARTNER);
|
|
2553
|
-
const userForm = index_module.Fn(
|
|
2554
|
-
const { data: userData, refetch, errors: userError, } = index_module.$n(
|
|
2555
|
-
const { data: _countriesRes, loading: countriesLoading } = index_module.$n(
|
|
2554
|
+
const userForm = index_module.Fn(usePayoutStatus.USER_FORM_CONTEXT_NAMESPACE);
|
|
2555
|
+
const { data: userData, refetch, errors: userError, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
2556
|
+
const { data: _countriesRes, loading: countriesLoading } = index_module.$n(usePayoutStatus.COUNTRIES_QUERY_NAMESPACE);
|
|
2556
2557
|
const intlLocale = (locale === null || locale === void 0 ? void 0 : locale.replace("_", "-")) || "en";
|
|
2557
2558
|
const _countries = domContextHooks_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) => utils$1.getCountryObj({ countryCode: country.countryCode, locale: intlLocale })); }, [(_a = _countriesRes === null || _countriesRes === void 0 ? void 0 : _countriesRes.impactPayoutCountries) === null || _a === void 0 ? void 0 : _a.data]);
|
|
2558
2559
|
const [loading, setLoading] = domContextHooks_module.useState(false);
|
|
@@ -2611,8 +2612,51 @@ function useIndirectTaxForm(props) {
|
|
|
2611
2612
|
console.error("Could not detect select change");
|
|
2612
2613
|
setFormState((p) => ({ ...p, [field]: value }));
|
|
2613
2614
|
};
|
|
2614
|
-
|
|
2615
|
+
async function connectPartner(formData) {
|
|
2615
2616
|
var _a, _b, _c, _d, _e;
|
|
2617
|
+
const vars = {
|
|
2618
|
+
user: {
|
|
2619
|
+
id: user.id,
|
|
2620
|
+
accountId: user.accountId,
|
|
2621
|
+
},
|
|
2622
|
+
firstName: userForm.firstName,
|
|
2623
|
+
lastName: userForm.lastName,
|
|
2624
|
+
countryCode: userForm.countryCode,
|
|
2625
|
+
currency: userForm.currency,
|
|
2626
|
+
address: userForm.address,
|
|
2627
|
+
city: userForm.city,
|
|
2628
|
+
state: userForm.state,
|
|
2629
|
+
postalCode: userForm.postalCode,
|
|
2630
|
+
phoneNumber: userForm.phoneNumber,
|
|
2631
|
+
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
2632
|
+
indirectTaxCountryCode: formData.selectedRegion,
|
|
2633
|
+
indirectTaxRegion: formData.province || formData.subRegion,
|
|
2634
|
+
indirectTaxId: formData.indirectTaxNumber,
|
|
2635
|
+
additionalTaxId: formData.qstNumber,
|
|
2636
|
+
withholdingTaxId: formData.subRegionTaxNumber,
|
|
2637
|
+
};
|
|
2638
|
+
const result = await connectImpactPartner({
|
|
2639
|
+
vars,
|
|
2640
|
+
});
|
|
2641
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
2642
|
+
throw new Error();
|
|
2643
|
+
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
2644
|
+
// Output backend errors to console for now
|
|
2645
|
+
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
2646
|
+
throw new Error();
|
|
2647
|
+
}
|
|
2648
|
+
await refetch();
|
|
2649
|
+
const resultPublisher = (_e = (_d = (_c = result
|
|
2650
|
+
.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;
|
|
2651
|
+
const hasValidCurrentDocument = utils$1.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2652
|
+
// Fire form change event
|
|
2653
|
+
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
2654
|
+
return {
|
|
2655
|
+
resultPublisher,
|
|
2656
|
+
hasValidCurrentDocument,
|
|
2657
|
+
};
|
|
2658
|
+
}
|
|
2659
|
+
const onSubmit = async (event) => {
|
|
2616
2660
|
if (!option) {
|
|
2617
2661
|
setErrors({ taxDetails: true });
|
|
2618
2662
|
return;
|
|
@@ -2638,44 +2682,7 @@ function useIndirectTaxForm(props) {
|
|
|
2638
2682
|
}
|
|
2639
2683
|
setLoading(true);
|
|
2640
2684
|
try {
|
|
2641
|
-
const
|
|
2642
|
-
user: {
|
|
2643
|
-
id: user.id,
|
|
2644
|
-
accountId: user.accountId,
|
|
2645
|
-
},
|
|
2646
|
-
firstName: userForm.firstName,
|
|
2647
|
-
lastName: userForm.lastName,
|
|
2648
|
-
countryCode: userForm.countryCode,
|
|
2649
|
-
currency: userForm.currency,
|
|
2650
|
-
address: userForm.address,
|
|
2651
|
-
city: userForm.city,
|
|
2652
|
-
state: userForm.state,
|
|
2653
|
-
postalCode: userForm.postalCode,
|
|
2654
|
-
phoneNumber: userForm.phoneNumber,
|
|
2655
|
-
phoneNumberCountryCode: userForm.phoneNumberCountryCode,
|
|
2656
|
-
indirectTaxCountryCode: formData.selectedRegion,
|
|
2657
|
-
indirectTaxRegion: formData.province || formData.subRegion,
|
|
2658
|
-
indirectTaxId: formData.indirectTaxNumber,
|
|
2659
|
-
additionalTaxId: formData.qstNumber,
|
|
2660
|
-
withholdingTaxId: formData.subRegionTaxNumber,
|
|
2661
|
-
};
|
|
2662
|
-
const result = await connectImpactPartner({
|
|
2663
|
-
vars,
|
|
2664
|
-
});
|
|
2665
|
-
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
2666
|
-
throw new Error();
|
|
2667
|
-
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
2668
|
-
// Output backend errors to console for now
|
|
2669
|
-
console.error("Failed to create Impact connection: ", result.createImpactConnection
|
|
2670
|
-
.validationErrors);
|
|
2671
|
-
throw new Error();
|
|
2672
|
-
}
|
|
2673
|
-
await refetch();
|
|
2674
|
-
const resultPublisher = (_e = (_d = (_c = result
|
|
2675
|
-
.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;
|
|
2676
|
-
const hasValidCurrentDocument = utils$1.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2677
|
-
// Fire form change event
|
|
2678
|
-
window.dispatchEvent(new Event(data.TAX_FORM_UPDATED_EVENT_KEY));
|
|
2685
|
+
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
2679
2686
|
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
2680
2687
|
!hasValidCurrentDocument) {
|
|
2681
2688
|
// Go to docusign form
|
|
@@ -2951,7 +2958,7 @@ const IndirectTaxForm = class {
|
|
|
2951
2958
|
}
|
|
2952
2959
|
};
|
|
2953
2960
|
function useDemoIndirectTaxForm(props) {
|
|
2954
|
-
const setStep = index_module.En(
|
|
2961
|
+
const setStep = index_module.En(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
2955
2962
|
const [option, setOption] = domContextHooks_module.useState("otherRegion");
|
|
2956
2963
|
const [demoFormState, setDemoFormState] = domContextHooks_module.useState({});
|
|
2957
2964
|
return cjs.cjs({
|
|
@@ -3586,8 +3593,8 @@ function PayoutDetailsCardView(props) {
|
|
|
3586
3593
|
|
|
3587
3594
|
function usePayoutDetailsCard(props) {
|
|
3588
3595
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
3589
|
-
const { data
|
|
3590
|
-
const publisher = (_b = (_a = data
|
|
3596
|
+
const { data, loading } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
3597
|
+
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;
|
|
3591
3598
|
function getPayoutDetailedStatusText(paymentDay) {
|
|
3592
3599
|
var _a;
|
|
3593
3600
|
const currentDay = luxon.luxon.DateTime.now().day;
|
|
@@ -4028,7 +4035,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4028
4035
|
icon: "exclamation-octagon",
|
|
4029
4036
|
class: sheet$4.classes.ErrorHoldAlertContainer,
|
|
4030
4037
|
};
|
|
4031
|
-
case "
|
|
4038
|
+
case "NEW_PAYEE_REVIEW":
|
|
4032
4039
|
return {
|
|
4033
4040
|
header: text.accountReviewHeader,
|
|
4034
4041
|
description: global.intl.formatMessage({
|
|
@@ -4042,6 +4049,96 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4042
4049
|
icon: "exclamation-triangle",
|
|
4043
4050
|
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4044
4051
|
};
|
|
4052
|
+
case "PAYMENT_HOLD_ON_CHANGE":
|
|
4053
|
+
return {
|
|
4054
|
+
header: text.paymentHoldOnChangeHeader,
|
|
4055
|
+
description: global.intl.formatMessage({
|
|
4056
|
+
id: "accountReviewDescription",
|
|
4057
|
+
defaultMessage: text.paymentHoldOnChangeDescription,
|
|
4058
|
+
}, {
|
|
4059
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4060
|
+
}),
|
|
4061
|
+
buttonText: null,
|
|
4062
|
+
alertType: "warning",
|
|
4063
|
+
icon: "exclamation-triangle",
|
|
4064
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4065
|
+
};
|
|
4066
|
+
case "BENEFICIARY_NAME_INVALID":
|
|
4067
|
+
return {
|
|
4068
|
+
header: text.beneficiaryNameInvalidHeader,
|
|
4069
|
+
description: global.intl.formatMessage({
|
|
4070
|
+
id: "accountReviewDescription",
|
|
4071
|
+
defaultMessage: text.beneficiaryNameInvalidDescription,
|
|
4072
|
+
}, {
|
|
4073
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4074
|
+
}),
|
|
4075
|
+
button: (index.h(index.Fragment, null,
|
|
4076
|
+
index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4077
|
+
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4078
|
+
alertType: "warning",
|
|
4079
|
+
icon: "exclamation-triangle",
|
|
4080
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4081
|
+
};
|
|
4082
|
+
case "BENEFICIARY_NAME_MISMATCH":
|
|
4083
|
+
return {
|
|
4084
|
+
header: text.beneficiaryNameMismatchHeader,
|
|
4085
|
+
description: global.intl.formatMessage({
|
|
4086
|
+
id: "accountReviewDescription",
|
|
4087
|
+
defaultMessage: text.beneficiaryNameMismatchDescription,
|
|
4088
|
+
}, {
|
|
4089
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4090
|
+
}),
|
|
4091
|
+
button: (index.h(index.Fragment, null,
|
|
4092
|
+
index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4093
|
+
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4094
|
+
alertType: "warning",
|
|
4095
|
+
icon: "exclamation-triangle",
|
|
4096
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4097
|
+
};
|
|
4098
|
+
case "BANK_TAX_NAME_MISMATCH":
|
|
4099
|
+
return {
|
|
4100
|
+
header: text.bankTaxNameMismatchHeader,
|
|
4101
|
+
description: global.intl.formatMessage({
|
|
4102
|
+
id: "accountReviewDescription",
|
|
4103
|
+
defaultMessage: text.bankTaxNameMismatchDescription,
|
|
4104
|
+
}, {
|
|
4105
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4106
|
+
}),
|
|
4107
|
+
button: (index.h(index.Fragment, null,
|
|
4108
|
+
index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4109
|
+
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4110
|
+
alertType: "warning",
|
|
4111
|
+
icon: "exclamation-triangle",
|
|
4112
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4113
|
+
};
|
|
4114
|
+
case "WITHDRAWAL_SETTINGS_INVALID":
|
|
4115
|
+
return {
|
|
4116
|
+
header: text.withdrawalSettingsInvalidHeader,
|
|
4117
|
+
description: global.intl.formatMessage({
|
|
4118
|
+
id: "accountReviewDescription",
|
|
4119
|
+
defaultMessage: text.withdrawalSettingsInvalidDescription,
|
|
4120
|
+
}, {
|
|
4121
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4122
|
+
}),
|
|
4123
|
+
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
4124
|
+
alertType: "warning",
|
|
4125
|
+
icon: "exclamation-triangle",
|
|
4126
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4127
|
+
};
|
|
4128
|
+
case "PAYMENT_RETURNED":
|
|
4129
|
+
return {
|
|
4130
|
+
header: text.paymentReturnedHeader,
|
|
4131
|
+
description: global.intl.formatMessage({
|
|
4132
|
+
id: "accountReviewDescription",
|
|
4133
|
+
defaultMessage: text.paymentReturnedDescription,
|
|
4134
|
+
}, {
|
|
4135
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4136
|
+
}),
|
|
4137
|
+
button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
|
|
4138
|
+
alertType: "error",
|
|
4139
|
+
icon: "exclamation-triangle",
|
|
4140
|
+
class: sheet$4.classes.WarningHoldAlertContainer,
|
|
4141
|
+
};
|
|
4045
4142
|
case "HOLD":
|
|
4046
4143
|
return {
|
|
4047
4144
|
header: text.payoutHoldAlertHeader,
|
|
@@ -4289,10 +4386,10 @@ function getIndirectTaxType(taxInformation) {
|
|
|
4289
4386
|
}
|
|
4290
4387
|
const useTaxAndCashDashboard = (props) => {
|
|
4291
4388
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
4292
|
-
const setStep = index_module.En(
|
|
4293
|
-
const setContext = index_module.En(
|
|
4389
|
+
const setStep = index_module.En(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
4390
|
+
const setContext = index_module.En(usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE);
|
|
4294
4391
|
const [showDialog, setShowDialog] = domContextHooks_module.useState(false);
|
|
4295
|
-
const { render, loading: veriffLoading, errors: veriffErrors, } =
|
|
4392
|
+
const { render, loading: veriffLoading, errors: veriffErrors, } = usePayoutStatus.useVeriffApp();
|
|
4296
4393
|
const { data: taxSettingRes } = index_module.wn(GET_TAX_SETTING, {});
|
|
4297
4394
|
const locale = index_module.L();
|
|
4298
4395
|
domContextHooks_module.useEffect(() => {
|
|
@@ -4301,8 +4398,8 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
4301
4398
|
if (window.location.hash)
|
|
4302
4399
|
setStep(`/${window.location.hash.replace("#", "")}`);
|
|
4303
4400
|
}, []);
|
|
4304
|
-
const { data
|
|
4305
|
-
const publisher = (_b = (_a = data
|
|
4401
|
+
const { data, loading, errors: userError, refetch, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
4402
|
+
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;
|
|
4306
4403
|
const documentType = publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType;
|
|
4307
4404
|
const submissionDate = (_c = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _c === void 0 ? void 0 : _c.dateCreated;
|
|
4308
4405
|
const dateSubmitted = submissionDate
|
|
@@ -4326,12 +4423,12 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
4326
4423
|
setStep("/3");
|
|
4327
4424
|
};
|
|
4328
4425
|
const provinceName = (_d = IndirectTaxDetailsView.INDIRECT_TAX_PROVINCES.find((p) => { var _a; return p.regionCode === ((_a = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _a === void 0 ? void 0 : _a.indirectTaxRegion); })) === null || _d === void 0 ? void 0 : _d.displayName;
|
|
4329
|
-
const payoutStatus = data
|
|
4426
|
+
const payoutStatus = data ? usePayoutStatus.getStatus(data) : null;
|
|
4330
4427
|
domContextHooks_module.useEffect(() => {
|
|
4331
4428
|
const cb = () => refetch();
|
|
4332
|
-
window.addEventListener(
|
|
4429
|
+
window.addEventListener(usePayoutStatus.VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
4333
4430
|
return () => {
|
|
4334
|
-
window.removeEventListener(
|
|
4431
|
+
window.removeEventListener(usePayoutStatus.VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
4335
4432
|
};
|
|
4336
4433
|
}, []);
|
|
4337
4434
|
const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
|
|
@@ -4509,7 +4606,7 @@ const TaxAndCashDashboard = class {
|
|
|
4509
4606
|
*
|
|
4510
4607
|
* @uiName Edit payment info button label
|
|
4511
4608
|
*/
|
|
4512
|
-
this.editPaymentInformationButton = "Edit
|
|
4609
|
+
this.editPaymentInformationButton = "Edit payout information";
|
|
4513
4610
|
/**
|
|
4514
4611
|
* @uiName Not registered for indirect tax text
|
|
4515
4612
|
* @uiWidget textArea
|
|
@@ -4612,6 +4709,54 @@ const TaxAndCashDashboard = class {
|
|
|
4612
4709
|
* @uiName Account review alert description
|
|
4613
4710
|
*/
|
|
4614
4711
|
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}.";
|
|
4712
|
+
/**
|
|
4713
|
+
* @uiName Payment hold on change alert header
|
|
4714
|
+
*/
|
|
4715
|
+
this.paymentHoldOnChangeHeader = "We are reviewing your new payout settings";
|
|
4716
|
+
/**
|
|
4717
|
+
* @uiName Payment hold on change alert description
|
|
4718
|
+
*/
|
|
4719
|
+
this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
|
|
4720
|
+
/**
|
|
4721
|
+
* @uiName Beneficiary name invalid alert header
|
|
4722
|
+
*/
|
|
4723
|
+
this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
|
|
4724
|
+
/**
|
|
4725
|
+
* @uiName Beneficiary name invalid description
|
|
4726
|
+
*/
|
|
4727
|
+
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.";
|
|
4728
|
+
/**
|
|
4729
|
+
* @uiName Beneficiary name mismatch alert header
|
|
4730
|
+
*/
|
|
4731
|
+
this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
|
|
4732
|
+
/**
|
|
4733
|
+
* @uiName Beneficiary name mismatch alert description
|
|
4734
|
+
*/
|
|
4735
|
+
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.";
|
|
4736
|
+
/**
|
|
4737
|
+
* @uiName Bank name mismatch alert header
|
|
4738
|
+
*/
|
|
4739
|
+
this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
|
|
4740
|
+
/**
|
|
4741
|
+
* @uiName Bank name mismatch alert description
|
|
4742
|
+
*/
|
|
4743
|
+
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.";
|
|
4744
|
+
/**
|
|
4745
|
+
* @uiName Withdrawal settings invalid alert header
|
|
4746
|
+
*/
|
|
4747
|
+
this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
4748
|
+
/**
|
|
4749
|
+
* @uiName Withdrawal settings invalid alert description
|
|
4750
|
+
*/
|
|
4751
|
+
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.";
|
|
4752
|
+
/**
|
|
4753
|
+
* @uiName Payment returned alert header
|
|
4754
|
+
*/
|
|
4755
|
+
this.paymentReturnedHeader = "Payout unsuccessful";
|
|
4756
|
+
/**
|
|
4757
|
+
* @uiName Payment returned alert description
|
|
4758
|
+
*/
|
|
4759
|
+
this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
|
|
4615
4760
|
/**
|
|
4616
4761
|
* @uiName Terms and Conditions text
|
|
4617
4762
|
*/
|
|
@@ -6008,7 +6153,7 @@ const vanillaStyle$4 = `
|
|
|
6008
6153
|
`;
|
|
6009
6154
|
const UserInfoFormView = (props) => {
|
|
6010
6155
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
6011
|
-
const { states, states: { formState }, callbacks, text, refs, data
|
|
6156
|
+
const { states, states: { formState }, callbacks, text, refs, data, } = props;
|
|
6012
6157
|
const { classes } = sheet$5;
|
|
6013
6158
|
const bankingCollectionText = global.intl.formatMessage({
|
|
6014
6159
|
id: "bankingCollectionText",
|
|
@@ -6017,7 +6162,7 @@ const UserInfoFormView = (props) => {
|
|
|
6017
6162
|
termsAndConditionsLink: (index.h("a", { href: text.termsAndConditionsLink, target: "_blank" }, text.termsAndConditionsLabel)),
|
|
6018
6163
|
});
|
|
6019
6164
|
let regionLabel = undefined;
|
|
6020
|
-
switch (data
|
|
6165
|
+
switch (data.regionLabelEnum) {
|
|
6021
6166
|
case "STATE":
|
|
6022
6167
|
regionLabel = text.state;
|
|
6023
6168
|
break;
|
|
@@ -6030,6 +6175,12 @@ const UserInfoFormView = (props) => {
|
|
|
6030
6175
|
default:
|
|
6031
6176
|
regionLabel = text.state;
|
|
6032
6177
|
}
|
|
6178
|
+
function isDisabledInput(field) {
|
|
6179
|
+
var _a;
|
|
6180
|
+
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
6181
|
+
return true;
|
|
6182
|
+
return false;
|
|
6183
|
+
}
|
|
6033
6184
|
return (index.h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
6034
6185
|
index.h("style", { type: "text/css" },
|
|
6035
6186
|
styleString$5,
|
|
@@ -6049,7 +6200,7 @@ const UserInfoFormView = (props) => {
|
|
|
6049
6200
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
6050
6201
|
id: "formStep",
|
|
6051
6202
|
defaultMessage: text.formStep,
|
|
6052
|
-
}, { step: states.step, count:
|
|
6203
|
+
}, { step: states.step, count: usePayoutStatus.FORM_STEPS }))),
|
|
6053
6204
|
index.h("h3", null, text.personalInformation),
|
|
6054
6205
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
|
|
6055
6206
|
((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sqm-form-message", { type: "error" },
|
|
@@ -6070,18 +6221,22 @@ const UserInfoFormView = (props) => {
|
|
|
6070
6221
|
})))),
|
|
6071
6222
|
index.h("div", null,
|
|
6072
6223
|
index.h("div", { class: classes.InputContainer },
|
|
6073
|
-
index.h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
6224
|
+
index.h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled ||
|
|
6225
|
+
states.isUser ||
|
|
6226
|
+
isDisabledInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
|
|
6074
6227
|
class: classes.ErrorInput,
|
|
6075
6228
|
helpText: utils$1.formatErrorMessage(text.firstName, formState.errors.firstName),
|
|
6076
6229
|
}
|
|
6077
6230
|
: {}), { id: "firstName", name: "/firstName", required: true })),
|
|
6078
|
-
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
6231
|
+
index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled ||
|
|
6232
|
+
states.isUser ||
|
|
6233
|
+
isDisabledInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
|
|
6079
6234
|
class: classes.ErrorInput,
|
|
6080
6235
|
helpText: utils$1.formatErrorMessage(text.lastName, formState.errors.lastName),
|
|
6081
6236
|
}
|
|
6082
6237
|
: {}), { id: "lastName", name: "/lastName", required: true })),
|
|
6083
6238
|
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 }),
|
|
6084
|
-
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 ||
|
|
6239
|
+
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 || isDisabledInput("countryCode") }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
|
|
6085
6240
|
class: classes.ErrorInput,
|
|
6086
6241
|
helpText: utils$1.formatErrorMessage(text.country, formState.errors.countryCode),
|
|
6087
6242
|
}
|
|
@@ -6091,13 +6246,14 @@ const UserInfoFormView = (props) => {
|
|
|
6091
6246
|
e.stopPropagation();
|
|
6092
6247
|
}, "onSl-input": (e) => {
|
|
6093
6248
|
callbacks.setCountrySearch(e.target.value);
|
|
6094
|
-
} }), (_e = data
|
|
6095
|
-
_e.map((c) => (index.h("sl-menu-item", { value: c.countryCode }, c.displayName))), (_f = data
|
|
6249
|
+
} }), (_e = data === null || data === void 0 ? void 0 : data.countries) === null || _e === void 0 ? void 0 :
|
|
6250
|
+
_e.map((c) => (index.h("sl-menu-item", { value: c.countryCode }, c.displayName))), (_f = data === null || data === void 0 ? void 0 : data.allCountries) === null || _f === void 0 ? void 0 :
|
|
6096
6251
|
_f.map((c) => (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
|
|
6097
6252
|
index.h("div", { class: classes.PhoneInputsSection },
|
|
6098
6253
|
index.h("p", null, text.phoneNumber),
|
|
6099
6254
|
index.h("div", { class: classes.PhoneInputsContainer },
|
|
6100
|
-
index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
6255
|
+
index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
|
|
6256
|
+
isDisabledInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
6101
6257
|
class: classes.ErrorInput,
|
|
6102
6258
|
}
|
|
6103
6259
|
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
@@ -6106,13 +6262,13 @@ const UserInfoFormView = (props) => {
|
|
|
6106
6262
|
e.stopPropagation();
|
|
6107
6263
|
}, "onSl-input": (e) => {
|
|
6108
6264
|
callbacks.setPhoneCountrySearch(e.target.value);
|
|
6109
|
-
} }), (_h = data
|
|
6265
|
+
} }), (_h = data === null || data === void 0 ? void 0 : data.phoneCountries) === null || _h === void 0 ? void 0 :
|
|
6110
6266
|
_h.map((c) => {
|
|
6111
6267
|
var _a, _b;
|
|
6112
6268
|
return (index.h("sl-menu-item", { value: c.countryCode },
|
|
6113
6269
|
index.h("div", { slot: "prefix" }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
|
|
6114
6270
|
_b.dial_code));
|
|
6115
|
-
}), (_j = data
|
|
6271
|
+
}), (_j = data === null || data === void 0 ? void 0 : data.allCountries) === null || _j === void 0 ? void 0 :
|
|
6116
6272
|
_j.map((c) => {
|
|
6117
6273
|
var _a, _b;
|
|
6118
6274
|
return (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } },
|
|
@@ -6123,7 +6279,7 @@ const UserInfoFormView = (props) => {
|
|
|
6123
6279
|
// Naive phone number validation
|
|
6124
6280
|
utils$1.validateBillingField(/[a-zA-Z]+/, value) &&
|
|
6125
6281
|
utils$1.formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
|
|
6126
|
-
}, disabled: states.disabled ||
|
|
6282
|
+
}, disabled: states.disabled || isDisabledInput("phoneNumber") }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
6127
6283
|
class: classes.ErrorInput,
|
|
6128
6284
|
helpText: utils$1.formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
6129
6285
|
}
|
|
@@ -6131,7 +6287,7 @@ const UserInfoFormView = (props) => {
|
|
|
6131
6287
|
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 }) =>
|
|
6132
6288
|
// Checks for non-ASCII characters
|
|
6133
6289
|
!utils$1.validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6134
|
-
utils$1.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
6290
|
+
utils$1.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("address") }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
6135
6291
|
class: classes.ErrorInput,
|
|
6136
6292
|
helpText: utils$1.formatErrorMessage(text.address, formState.errors.address),
|
|
6137
6293
|
}
|
|
@@ -6139,22 +6295,22 @@ const UserInfoFormView = (props) => {
|
|
|
6139
6295
|
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 }) =>
|
|
6140
6296
|
// Checks for non-ASCII characters
|
|
6141
6297
|
!utils$1.validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6142
|
-
utils$1.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled ||
|
|
6298
|
+
utils$1.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("city") }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
6143
6299
|
class: classes.ErrorInput,
|
|
6144
6300
|
helpText: utils$1.formatErrorMessage(text.city, formState.errors.city),
|
|
6145
6301
|
}
|
|
6146
6302
|
: {}), { required: true })),
|
|
6147
|
-
!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 ||
|
|
6303
|
+
!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 || isDisabledInput("state") }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
|
|
6148
6304
|
class: classes.ErrorInput,
|
|
6149
6305
|
helpText: utils$1.formatErrorMessage(text.state, formState.errors.state),
|
|
6150
6306
|
}
|
|
6151
|
-
: {}), { required: true }), (_p = data
|
|
6152
|
-
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 ||
|
|
6307
|
+
: {}), { required: true }), (_p = data.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (index.h("sl-menu-item", { value: r.value }, r.label))))),
|
|
6308
|
+
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 || isDisabledInput("postalCode") }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
|
|
6153
6309
|
class: classes.ErrorInput,
|
|
6154
6310
|
helpText: utils$1.formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
6155
6311
|
}
|
|
6156
6312
|
: {}), { required: true })),
|
|
6157
|
-
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 ||
|
|
6313
|
+
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 || isDisabledInput("currency"), helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
|
|
6158
6314
|
class: classes.ErrorInput,
|
|
6159
6315
|
helpText: utils$1.formatErrorMessage(text.currency, formState.errors.currency),
|
|
6160
6316
|
}
|
|
@@ -6164,11 +6320,11 @@ const UserInfoFormView = (props) => {
|
|
|
6164
6320
|
e.stopPropagation();
|
|
6165
6321
|
}, "onSl-input": (e) => {
|
|
6166
6322
|
callbacks.setCurrencySearch(e.target.value);
|
|
6167
|
-
} }), (_s = data
|
|
6323
|
+
} }), (_s = data === null || data === void 0 ? void 0 : data.currencies) === null || _s === void 0 ? void 0 :
|
|
6168
6324
|
_s.map((c) => (index.h("sl-menu-item", { value: c.currencyCode },
|
|
6169
6325
|
c.currencyCode,
|
|
6170
6326
|
" - ",
|
|
6171
|
-
c.displayName))), (_t = data
|
|
6327
|
+
c.displayName))), (_t = data === null || data === void 0 ? void 0 : data.allCurrencies) === null || _t === void 0 ? void 0 :
|
|
6172
6328
|
_t.map((c) => (index.h("sl-menu-item", { value: c.currencyCode, style: { display: "none" } },
|
|
6173
6329
|
c.currencyCode,
|
|
6174
6330
|
" - ",
|
|
@@ -6176,22 +6332,24 @@ const UserInfoFormView = (props) => {
|
|
|
6176
6332
|
index.h("div", { class: classes.CheckboxWrapper },
|
|
6177
6333
|
index.h("sl-checkbox", { checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
|
|
6178
6334
|
e.target.value = e.target.checked;
|
|
6179
|
-
}, disabled: states.
|
|
6335
|
+
}, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
|
|
6180
6336
|
((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (index.h("p", { class: classes.ErrorText }, utils$1.formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
|
|
6181
|
-
index.h("sl-button", { type: "primary", disabled: states.
|
|
6337
|
+
index.h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
6182
6338
|
};
|
|
6183
6339
|
|
|
6184
6340
|
function useUserInfoForm(props) {
|
|
6185
|
-
var _a, _b, _c, _d;
|
|
6341
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6186
6342
|
const currencyRef = domContextHooks_module.useRef(undefined);
|
|
6187
6343
|
const phoneCountryRef = domContextHooks_module.useRef(undefined);
|
|
6188
6344
|
const formRef = domContextHooks_module.useRef(null);
|
|
6189
|
-
const context = index_module.Fn(
|
|
6190
|
-
const countries = index_module.Fn(
|
|
6191
|
-
const [step, setStep] = index_module.Pn(
|
|
6192
|
-
const [userFormContext, setUserFormContext] = index_module.Pn(
|
|
6193
|
-
const
|
|
6194
|
-
const
|
|
6345
|
+
const context = index_module.Fn(usePayoutStatus.TAX_FORM_CONTEXT_NAMESPACE);
|
|
6346
|
+
const countries = index_module.Fn(usePayoutStatus.SORTED_COUNTRIES_NAMESPACE);
|
|
6347
|
+
const [step, setStep] = index_module.Pn(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
6348
|
+
const [userFormContext, setUserFormContext] = index_module.Pn(usePayoutStatus.USER_FORM_CONTEXT_NAMESPACE);
|
|
6349
|
+
const user = index_module.J();
|
|
6350
|
+
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = index_module.$e(CONNECT_PARTNER);
|
|
6351
|
+
const { data, loading, refetch, errors: userError, } = index_module.$n(usePayoutStatus.USER_QUERY_NAMESPACE);
|
|
6352
|
+
const _currencies = index_module.Fn(usePayoutStatus.CURRENCIES_NAMESPACE);
|
|
6195
6353
|
const currencies = domContextHooks_module.useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
|
|
6196
6354
|
const [countrySearch, setCountrySearch] = domContextHooks_module.useState("");
|
|
6197
6355
|
const [phoneCountrySearch, setPhoneCountrySearch] = domContextHooks_module.useState("");
|
|
@@ -6206,7 +6364,7 @@ function useUserInfoForm(props) {
|
|
|
6206
6364
|
}, []);
|
|
6207
6365
|
domContextHooks_module.useEffect(() => {
|
|
6208
6366
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
6209
|
-
const user = data
|
|
6367
|
+
const user = data === null || data === void 0 ? void 0 : data.user;
|
|
6210
6368
|
if (!user || step !== "/1")
|
|
6211
6369
|
return;
|
|
6212
6370
|
// If form already filled out, skip initialising it
|
|
@@ -6247,7 +6405,7 @@ function useUserInfoForm(props) {
|
|
|
6247
6405
|
postalCode: (_k = user.customFields) === null || _k === void 0 ? void 0 : _k.postalCode,
|
|
6248
6406
|
});
|
|
6249
6407
|
}
|
|
6250
|
-
}, [data
|
|
6408
|
+
}, [data, step, userFormContext]);
|
|
6251
6409
|
const onFormChange = (field, e) => {
|
|
6252
6410
|
var _a, _b;
|
|
6253
6411
|
const value = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
@@ -6292,6 +6450,45 @@ function useUserInfoForm(props) {
|
|
|
6292
6450
|
setFilteredCurrencies(currencies.filter((c) => c.currencyCode.toLowerCase().includes(currencySearch.toLowerCase())) || []);
|
|
6293
6451
|
}
|
|
6294
6452
|
}, [currencySearch, currencies]);
|
|
6453
|
+
async function connectPartner(formData) {
|
|
6454
|
+
var _a, _b, _c, _d, _e;
|
|
6455
|
+
const vars = {
|
|
6456
|
+
user: {
|
|
6457
|
+
id: user.id,
|
|
6458
|
+
accountId: user.accountId,
|
|
6459
|
+
},
|
|
6460
|
+
firstName: formData.firstName,
|
|
6461
|
+
lastName: formData.lastName,
|
|
6462
|
+
countryCode: formData.countryCode,
|
|
6463
|
+
currency: formData.currency,
|
|
6464
|
+
address: formData.address,
|
|
6465
|
+
city: formData.city,
|
|
6466
|
+
state: formData.state,
|
|
6467
|
+
postalCode: formData.postalCode,
|
|
6468
|
+
phoneNumber: formData.phoneNumber,
|
|
6469
|
+
phoneNumberCountryCode: formData.phoneNumberCountryCode,
|
|
6470
|
+
};
|
|
6471
|
+
const result = await connectImpactPartner({
|
|
6472
|
+
vars,
|
|
6473
|
+
});
|
|
6474
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message))
|
|
6475
|
+
throw new Error();
|
|
6476
|
+
if (!((_b = result.createImpactConnection) === null || _b === void 0 ? void 0 : _b.success)) {
|
|
6477
|
+
// Output backend errors to console for now
|
|
6478
|
+
console.error("Failed to create Impact connection: ", result.createImpactConnection.validationErrors);
|
|
6479
|
+
throw new Error();
|
|
6480
|
+
}
|
|
6481
|
+
await refetch();
|
|
6482
|
+
const resultPublisher = (_e = (_d = (_c = result
|
|
6483
|
+
.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;
|
|
6484
|
+
const hasValidCurrentDocument = utils$1.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
6485
|
+
// Fire form change event
|
|
6486
|
+
window.dispatchEvent(new Event(usePayoutStatus.TAX_FORM_UPDATED_EVENT_KEY));
|
|
6487
|
+
return {
|
|
6488
|
+
resultPublisher,
|
|
6489
|
+
hasValidCurrentDocument,
|
|
6490
|
+
};
|
|
6491
|
+
}
|
|
6295
6492
|
async function onSubmit(event) {
|
|
6296
6493
|
let formControls = event.target.getFormControls();
|
|
6297
6494
|
let formData = {};
|
|
@@ -6334,9 +6531,41 @@ function useUserInfoForm(props) {
|
|
|
6334
6531
|
postalCode: userData.postalCode,
|
|
6335
6532
|
currency: userData.currency,
|
|
6336
6533
|
});
|
|
6337
|
-
const
|
|
6534
|
+
const skipNextStep = getSkipNextStep(userData);
|
|
6535
|
+
console.log({ skipNextStep });
|
|
6536
|
+
if (skipNextStep) {
|
|
6537
|
+
try {
|
|
6538
|
+
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
6539
|
+
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
6540
|
+
!hasValidCurrentDocument) {
|
|
6541
|
+
// Go to docusign form
|
|
6542
|
+
setStep("/3");
|
|
6543
|
+
}
|
|
6544
|
+
else {
|
|
6545
|
+
if (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.brandedSignup) {
|
|
6546
|
+
// Go to banking information form
|
|
6547
|
+
setStep("/4");
|
|
6548
|
+
}
|
|
6549
|
+
else {
|
|
6550
|
+
// Go right to the dashboard
|
|
6551
|
+
setStep("/dashboard");
|
|
6552
|
+
}
|
|
6553
|
+
}
|
|
6554
|
+
return;
|
|
6555
|
+
}
|
|
6556
|
+
catch (e) {
|
|
6557
|
+
setErrors({ general: true });
|
|
6558
|
+
return;
|
|
6559
|
+
}
|
|
6560
|
+
}
|
|
6561
|
+
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
6338
6562
|
setStep(nextStep);
|
|
6339
6563
|
}
|
|
6564
|
+
function getSkipNextStep(userData) {
|
|
6565
|
+
if (userData.countryCode === "US")
|
|
6566
|
+
return true;
|
|
6567
|
+
return true;
|
|
6568
|
+
}
|
|
6340
6569
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
6341
6570
|
const regionObj = hasStates
|
|
6342
6571
|
? IndirectTaxDetailsView.ADDRESS_REGIONS[userFormContext === null || userFormContext === void 0 ? void 0 : userFormContext.countryCode]
|
|
@@ -6364,16 +6593,17 @@ function useUserInfoForm(props) {
|
|
|
6364
6593
|
allCountries: countries,
|
|
6365
6594
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
6366
6595
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
6596
|
+
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,
|
|
6367
6597
|
},
|
|
6368
6598
|
states: {
|
|
6369
6599
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
6370
6600
|
hideState: !hasStates,
|
|
6371
6601
|
hideSteps: !!context.hideSteps,
|
|
6372
|
-
disabled: loading,
|
|
6602
|
+
disabled: loading || connectLoading,
|
|
6373
6603
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
6374
|
-
loading: loading,
|
|
6375
|
-
isPartner: !!((
|
|
6376
|
-
isUser: !!((
|
|
6604
|
+
loading: loading || connectLoading,
|
|
6605
|
+
isPartner: !!((_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.publisher),
|
|
6606
|
+
isUser: !!((_f = (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.user),
|
|
6377
6607
|
formState: {
|
|
6378
6608
|
...userFormContext,
|
|
6379
6609
|
errors: formErrors,
|
|
@@ -6563,7 +6793,7 @@ const TaxForm = class {
|
|
|
6563
6793
|
}
|
|
6564
6794
|
};
|
|
6565
6795
|
function useDemoUserInfoForm(props) {
|
|
6566
|
-
const setStep = index_module.En(
|
|
6796
|
+
const setStep = index_module.En(usePayoutStatus.TAX_CONTEXT_NAMESPACE);
|
|
6567
6797
|
return cjs.cjs({
|
|
6568
6798
|
setStep,
|
|
6569
6799
|
onSubmit: async () => {
|