@saasquatch/mint-components 2.0.2-9 → 2.0.3-1
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-e5f70b8b.js → IndirectTaxDetailsView-659a139c.js} +2 -2
- package/dist/cjs/{ShadowViewAddon-925a8fa6.js → ShadowViewAddon-ae3a32c3.js} +5 -5
- package/dist/cjs/{usePayoutStatus-9abe2de8.js → data-44260010.js} +127 -129
- package/dist/cjs/{global-8bba5b3a.js → global-e862bfd4.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +120 -85
- package/dist/cjs/sqm-big-stat_47.cjs.entry.js +44 -38
- 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 +2 -2
- package/dist/cjs/{sqm-lead-checkbox-field-view-340acad0.js → sqm-lead-checkbox-field-view-dca40eb4.js} +1 -1
- package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-lead-input-field-view-06ed3632.js → sqm-lead-input-field-view-2006001f.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-5518eb0d.js → sqm-portal-email-verification-view-1745d9a2.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-profile-view-615e6975.js → sqm-portal-profile-view-5c5e29b1.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 +29 -9
- package/dist/cjs/{useLeadFormState-fd0445f9.js → useLeadFormState-91999606.js} +1 -1
- package/dist/cjs/{utils-83d125fa.js → utils-4eb18a29.js} +1 -1
- package/dist/collection/components/sqm-header-logo/sqm-header-logo.js +5 -2
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +4 -4
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +10 -6
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/useDocusignForm.js +11 -5
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +13 -0
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +12 -6
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +5 -5
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +1 -4
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +4 -4
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +9 -4
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +4 -4
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +7 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +4 -4
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +20 -12
- package/dist/collection/global/styles.js +1 -1
- package/dist/collection/global/styles.ts +1 -1
- package/dist/esm/{IndirectTaxDetailsView-0a57b622.js → IndirectTaxDetailsView-8dec05e4.js} +2 -2
- package/dist/esm/{ShadowViewAddon-aae27c2e.js → ShadowViewAddon-78a1c35c.js} +5 -5
- package/dist/esm/{usePayoutStatus-e0ef2374.js → data-68816061.js} +128 -130
- package/dist/esm/{global-1099f20d.js → global-58a69018.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_10.entry.js +67 -32
- package/dist/esm/sqm-big-stat_47.entry.js +22 -16
- 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 +2 -2
- package/dist/esm/{sqm-lead-checkbox-field-view-cbafee07.js → sqm-lead-checkbox-field-view-81541e40.js} +1 -1
- package/dist/esm/sqm-lead-checkbox-field.entry.js +3 -3
- package/dist/esm/{sqm-lead-input-field-view-f3775c28.js → sqm-lead-input-field-view-d543d939.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-7d86299c.js → sqm-portal-email-verification-view-5fb1a99e.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/{sqm-portal-profile-view-3ed13e4d.js → sqm-portal-profile-view-e3aef106.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 +29 -9
- package/dist/esm/{useLeadFormState-c379e5d7.js → useLeadFormState-8d4b2620.js} +1 -1
- package/dist/esm/{utils-6122971b.js → utils-2695a43e.js} +1 -1
- package/dist/esm-es5/{IndirectTaxDetailsView-0a57b622.js → IndirectTaxDetailsView-8dec05e4.js} +1 -1
- package/dist/esm-es5/{ShadowViewAddon-aae27c2e.js → ShadowViewAddon-78a1c35c.js} +1 -1
- package/dist/esm-es5/data-68816061.js +6 -0
- package/dist/esm-es5/{global-1099f20d.js → global-58a69018.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-cbafee07.js → sqm-lead-checkbox-field-view-81541e40.js} +1 -1
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-input-field-view-f3775c28.js → sqm-lead-input-field-view-d543d939.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-7d86299c.js → sqm-portal-email-verification-view-5fb1a99e.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-3ed13e4d.js → sqm-portal-profile-view-e3aef106.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-c379e5d7.js → useLeadFormState-8d4b2620.js} +1 -1
- package/dist/esm-es5/{utils-6122971b.js → utils-2695a43e.js} +1 -1
- package/dist/mint-components/global/styles.ts +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-717b6730.system.entry.js → p-011c0990.system.entry.js} +1 -1
- package/dist/mint-components/{p-db1a0db1.js → p-027c0b10.js} +1 -1
- package/dist/mint-components/{p-aa8c6332.js → p-088f082f.js} +1 -1
- package/dist/mint-components/{p-511c87ce.system.entry.js → p-0c024cf0.system.entry.js} +1 -1
- package/dist/mint-components/{p-60465a2d.system.js → p-1215518e.system.js} +1 -1
- package/dist/mint-components/{p-6c006998.entry.js → p-12e6cea7.entry.js} +2 -2
- package/dist/mint-components/{p-ad4348c3.system.js → p-13c6673e.system.js} +1 -1
- package/dist/mint-components/{p-ed16b35a.js → p-1aa9136c.js} +1 -1
- package/dist/mint-components/{p-a5c63310.entry.js → p-1b79b186.entry.js} +1 -1
- package/dist/mint-components/{p-6d5bd95a.js → p-1d8c5935.js} +1 -1
- package/dist/mint-components/{p-56009bf0.system.entry.js → p-2ea3eea9.system.entry.js} +1 -1
- package/dist/mint-components/{p-7a268047.js → p-325c5476.js} +1 -1
- package/dist/mint-components/{p-bec87ac9.system.entry.js → p-36a1fa33.system.entry.js} +1 -1
- package/dist/mint-components/p-42760067.system.entry.js +1 -0
- package/dist/mint-components/{p-aefaec37.entry.js → p-43ad51bc.entry.js} +1 -1
- package/dist/mint-components/{p-e0a724dd.system.js → p-4cc72a4e.system.js} +1 -1
- package/dist/mint-components/{p-47c83656.entry.js → p-58c79873.entry.js} +1 -1
- package/dist/mint-components/{p-c994512c.system.js → p-5fbe6356.system.js} +1 -1
- package/dist/mint-components/{p-6d9ce4e5.entry.js → p-6076dbaf.entry.js} +1 -1
- package/dist/mint-components/{p-74f43a08.system.js → p-78dda262.system.js} +1 -1
- package/dist/mint-components/p-7fb4470e.entry.js +1 -0
- package/dist/mint-components/{p-4ce51b1c.system.entry.js → p-829cb9ed.system.entry.js} +1 -1
- package/dist/mint-components/{p-c85f204b.system.js → p-8618e8f6.system.js} +1 -1
- package/dist/mint-components/{p-aa08457e.system.js → p-8d9fa981.system.js} +1 -1
- package/dist/mint-components/{p-09ab53fb.system.entry.js → p-8fa77acf.system.entry.js} +1 -1
- package/dist/mint-components/p-92b5c376.js +157 -0
- package/dist/mint-components/{p-967a9040.system.js → p-947bacd1.system.js} +1 -1
- package/dist/mint-components/{p-79a3344f.js → p-988f236f.js} +1 -1
- package/dist/mint-components/{p-22a9114f.system.entry.js → p-9d46f87f.system.entry.js} +1 -1
- package/dist/mint-components/p-a2dbc9ad.system.js +6 -0
- package/dist/mint-components/{p-4c811d12.entry.js → p-a470e203.entry.js} +2 -2
- package/dist/mint-components/{p-00bc7211.js → p-a974c549.js} +1 -1
- package/dist/mint-components/{p-5f3eafd4.entry.js → p-aabfb90f.entry.js} +2 -2
- package/dist/mint-components/p-ad3ebf4d.entry.js +1 -0
- package/dist/mint-components/{p-0649123a.system.entry.js → p-bbdf93b6.system.entry.js} +1 -1
- package/dist/mint-components/p-be0ca483.entry.js +273 -0
- package/dist/mint-components/{p-4fed8672.js → p-bf044217.js} +1 -1
- package/dist/mint-components/p-c0d60c61.entry.js +106 -0
- package/dist/mint-components/{p-d3120982.system.entry.js → p-c6e8086f.system.entry.js} +1 -1
- package/dist/mint-components/{p-ea0bc627.entry.js → p-d88d8ffe.entry.js} +1 -1
- package/dist/mint-components/{p-a217cc8d.entry.js → p-dc5bca55.entry.js} +1 -1
- package/dist/mint-components/{p-6445e926.system.entry.js → p-deecffd0.system.entry.js} +1 -1
- package/dist/mint-components/{p-60c14cec.entry.js → p-e19f0908.entry.js} +1 -1
- package/dist/mint-components/{p-38f932ae.system.js → p-e3ee8c37.system.js} +1 -1
- package/dist/mint-components/{p-14e813a7.system.entry.js → p-e8bda98a.system.entry.js} +1 -1
- package/dist/mint-components/{p-5d059c95.entry.js → p-ee3a7577.entry.js} +1 -1
- package/dist/mint-components/{p-57ce33dd.js → p-ee83de0e.js} +2 -2
- package/dist/mint-components/{p-f401ef19.system.entry.js → p-f5256738.system.entry.js} +1 -1
- package/dist/mint-components/p-f5820d03.system.js +1 -0
- package/dist/mint-components/{p-18720462.system.entry.js → p-fcf8bdbc.system.entry.js} +1 -1
- package/dist/mint-components/p-ffef3f95.system.entry.js +1 -0
- package/dist/types/components/sqm-header-logo/sqm-header-logo.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +7 -0
- package/dist/types/components.d.ts +2 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/usePayoutStatus-e0ef2374.js +0 -6
- package/dist/mint-components/p-35576752.system.entry.js +0 -1
- package/dist/mint-components/p-408a3798.entry.js +0 -273
- package/dist/mint-components/p-59bb2d52.system.js +0 -6
- package/dist/mint-components/p-60e35884.entry.js +0 -99
- package/dist/mint-components/p-680a7162.system.entry.js +0 -1
- package/dist/mint-components/p-8b5b2acc.entry.js +0 -1
- package/dist/mint-components/p-ab111e29.entry.js +0 -1
- package/dist/mint-components/p-c41108ae.js +0 -157
- package/dist/mint-components/p-f0eae4e6.system.js +0 -1
|
@@ -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-e862bfd4.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-659a139c.js');
|
|
20
|
+
const utils$1 = require('./utils-4eb18a29.js');
|
|
21
21
|
const keys = require('./keys-cff24974.js');
|
|
22
|
-
const
|
|
22
|
+
const data = require('./data-44260010.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: data.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(data.TAX_CONTEXT_NAMESPACE);
|
|
869
|
+
const context = index_module.Fn(data.TAX_FORM_CONTEXT_NAMESPACE);
|
|
870
|
+
const countries = index_module.Fn(data.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(data.FINANCE_NETWORK_SETTINGS_NAMESPACE);
|
|
873
|
+
const { data: userData, refetch, errors: userError, } = index_module.$n(data.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);
|
|
@@ -903,11 +903,6 @@ function useBankingInfoForm(props) {
|
|
|
903
903
|
const paymentMethodChecked = !hasPayPal
|
|
904
904
|
? "toBankAccount"
|
|
905
905
|
: _paymentMethodChecked;
|
|
906
|
-
domContextHooks_module.useEffect(() => {
|
|
907
|
-
// reset redirect hash
|
|
908
|
-
if (window.location.hash !== "#4")
|
|
909
|
-
window.location.hash = "";
|
|
910
|
-
}, []);
|
|
911
906
|
domContextHooks_module.useEffect(() => {
|
|
912
907
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
913
908
|
if (!userData)
|
|
@@ -1032,7 +1027,7 @@ function useBankingInfoForm(props) {
|
|
|
1032
1027
|
return;
|
|
1033
1028
|
}
|
|
1034
1029
|
// Fire form change event
|
|
1035
|
-
window.dispatchEvent(new Event(
|
|
1030
|
+
window.dispatchEvent(new Event(data.TAX_FORM_UPDATED_EVENT_KEY));
|
|
1036
1031
|
await refetch();
|
|
1037
1032
|
setStep("/dashboard");
|
|
1038
1033
|
}
|
|
@@ -1079,6 +1074,7 @@ function useBankingInfoForm(props) {
|
|
|
1079
1074
|
}
|
|
1080
1075
|
await runMutation(formData, token);
|
|
1081
1076
|
setShowModal(false);
|
|
1077
|
+
window.location.hash = "";
|
|
1082
1078
|
};
|
|
1083
1079
|
const onVerification = async (token) => {
|
|
1084
1080
|
host.dispatchEvent(new CustomEvent(keys.VERIFICATION_EVENT_KEY, {
|
|
@@ -1108,7 +1104,15 @@ function useBankingInfoForm(props) {
|
|
|
1108
1104
|
setBankCountry: updateBankCountry,
|
|
1109
1105
|
setPaymentMethodChecked,
|
|
1110
1106
|
setPaymentScheduleChecked,
|
|
1111
|
-
onBack: () =>
|
|
1107
|
+
onBack: () => {
|
|
1108
|
+
// return to dashboard
|
|
1109
|
+
if (window.location.hash) {
|
|
1110
|
+
window.location.hash = "";
|
|
1111
|
+
}
|
|
1112
|
+
else {
|
|
1113
|
+
setStep("/dashboard");
|
|
1114
|
+
}
|
|
1115
|
+
},
|
|
1112
1116
|
setCountrySearch,
|
|
1113
1117
|
onVerification,
|
|
1114
1118
|
onVerificationHide: () => onVerification(null),
|
|
@@ -1575,7 +1579,7 @@ function useDemoBankingInfoForm(props) {
|
|
|
1575
1579
|
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;
|
|
1576
1580
|
const defaultCurrency = (_h = (_g = props.demoData) === null || _g === void 0 ? void 0 : _g.states) === null || _h === void 0 ? void 0 : _h.currency;
|
|
1577
1581
|
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;
|
|
1578
|
-
const setStep = index_module.En(
|
|
1582
|
+
const setStep = index_module.En(data.TAX_CONTEXT_NAMESPACE);
|
|
1579
1583
|
const [paymentMethodChecked, setPaymentMethodChecked] = domContextHooks_module.useState(undefined);
|
|
1580
1584
|
const [paymentScheduleChecked, setPaymentScheduleChecked] = domContextHooks_module.useState(undefined);
|
|
1581
1585
|
const [currency, setCurrency] = domContextHooks_module.useState(defaultCurrency);
|
|
@@ -1699,10 +1703,10 @@ const DOCUSIGN_EXPIRED_STATES = ["ttl_expired", "session_timeout"];
|
|
|
1699
1703
|
function useDocusignForm(props) {
|
|
1700
1704
|
var _a, _b, _c;
|
|
1701
1705
|
const user = index_module.J();
|
|
1702
|
-
const context = index_module.Fn(
|
|
1703
|
-
const [step, setStep] = index_module.Pn(
|
|
1704
|
-
const { data, loading: userLoading, refetch, } = index_module.$n(
|
|
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;
|
|
1706
|
+
const context = index_module.Fn(data.TAX_FORM_CONTEXT_NAMESPACE);
|
|
1707
|
+
const [step, setStep] = index_module.Pn(data.TAX_CONTEXT_NAMESPACE);
|
|
1708
|
+
const { data: data$1, loading: userLoading, refetch, } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
1709
|
+
const publisher = (_b = (_a = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
1706
1710
|
const [createTaxDocument, { loading: documentLoading, data: document, errors: documentErrors },] = index_module.$e(GET_TAX_DOCUMENT);
|
|
1707
1711
|
const [completeTaxDocument, { loading: completeDocumentLoading, data: completeData, errors: completeErrors, },] = index_module.$e(COMPLETE_TAX_DOCUMENT);
|
|
1708
1712
|
const [docusignStatus, setDocusignStatus] = domContextHooks_module.useState(undefined);
|
|
@@ -1770,7 +1774,7 @@ function useDocusignForm(props) {
|
|
|
1770
1774
|
if (!result.completeImpactPublisherTaxDocument.success)
|
|
1771
1775
|
throw new Error();
|
|
1772
1776
|
// Fire form change event
|
|
1773
|
-
window.dispatchEvent(new Event(
|
|
1777
|
+
window.dispatchEvent(new Event(data.TAX_FORM_UPDATED_EVENT_KEY));
|
|
1774
1778
|
setShowExitButton(true);
|
|
1775
1779
|
}
|
|
1776
1780
|
catch (e) {
|
|
@@ -1781,11 +1785,17 @@ function useDocusignForm(props) {
|
|
|
1781
1785
|
}
|
|
1782
1786
|
};
|
|
1783
1787
|
const progressStep = () => {
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1788
|
+
// return to dashboard
|
|
1789
|
+
if (window.location.hash) {
|
|
1790
|
+
window.location.hash = "";
|
|
1791
|
+
}
|
|
1792
|
+
else {
|
|
1793
|
+
setStep(context.overrideNextStep ||
|
|
1794
|
+
!!(publisher === null || publisher === void 0 ? void 0 : publisher.withdrawalSettings) ||
|
|
1795
|
+
!(publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup)
|
|
1796
|
+
? "/dashboard"
|
|
1797
|
+
: "/4");
|
|
1798
|
+
}
|
|
1789
1799
|
};
|
|
1790
1800
|
const allLoading = userLoading || documentLoading || loading;
|
|
1791
1801
|
return {
|
|
@@ -2074,7 +2084,7 @@ const DocusignFormView = (props) => {
|
|
|
2074
2084
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
2075
2085
|
id: "formStep",
|
|
2076
2086
|
defaultMessage: text.formStep,
|
|
2077
|
-
}, { step: states.step, count:
|
|
2087
|
+
}, { step: states.step, count: data.FORM_STEPS }))),
|
|
2078
2088
|
index.h("h3", null, text.taxForm),
|
|
2079
2089
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
|
|
2080
2090
|
states.loadingError && (index.h("div", null,
|
|
@@ -2267,7 +2277,7 @@ const DocusignForm = class {
|
|
|
2267
2277
|
get el() { return index.getElement(this); }
|
|
2268
2278
|
};
|
|
2269
2279
|
function useDocusignFormDemo(props) {
|
|
2270
|
-
const setStep = index_module.En(
|
|
2280
|
+
const setStep = index_module.En(data.TAX_CONTEXT_NAMESPACE);
|
|
2271
2281
|
return cjs.cjs({
|
|
2272
2282
|
text: props.getTextProps(),
|
|
2273
2283
|
states: {
|
|
@@ -2453,7 +2463,7 @@ const IndirectTaxFormView = (props) => {
|
|
|
2453
2463
|
global.intl.formatMessage({
|
|
2454
2464
|
id: "formStep",
|
|
2455
2465
|
defaultMessage: text.formStep,
|
|
2456
|
-
}, { step: states.step, count:
|
|
2466
|
+
}, { step: states.step, count: data.FORM_STEPS }))),
|
|
2457
2467
|
index.h("h3", null, text.indirectTax),
|
|
2458
2468
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription),
|
|
2459
2469
|
index.h("p", { class: classes.DescriptionText }, text.indirectTaxDescription)),
|
|
@@ -2548,12 +2558,12 @@ function useIndirectTaxForm(props) {
|
|
|
2548
2558
|
const user = index_module.J();
|
|
2549
2559
|
const locale = index_module.L();
|
|
2550
2560
|
const formRef = domContextHooks_module.useRef(null);
|
|
2551
|
-
const context = index_module.Fn(
|
|
2552
|
-
const [step, setStep] = index_module.Pn(
|
|
2561
|
+
const context = index_module.Fn(data.TAX_FORM_CONTEXT_NAMESPACE);
|
|
2562
|
+
const [step, setStep] = index_module.Pn(data.TAX_CONTEXT_NAMESPACE);
|
|
2553
2563
|
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = index_module.$e(CONNECT_PARTNER);
|
|
2554
|
-
const userForm = index_module.Fn(
|
|
2555
|
-
const { data: userData, refetch, errors: userError, } = index_module.$n(
|
|
2556
|
-
const { data: _countriesRes, loading: countriesLoading } = index_module.$n(
|
|
2564
|
+
const userForm = index_module.Fn(data.USER_FORM_CONTEXT_NAMESPACE);
|
|
2565
|
+
const { data: userData, refetch, errors: userError, } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
2566
|
+
const { data: _countriesRes, loading: countriesLoading } = index_module.$n(data.COUNTRIES_QUERY_NAMESPACE);
|
|
2557
2567
|
const intlLocale = (locale === null || locale === void 0 ? void 0 : locale.replace("_", "-")) || "en";
|
|
2558
2568
|
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]);
|
|
2559
2569
|
const [loading, setLoading] = domContextHooks_module.useState(false);
|
|
@@ -2650,7 +2660,7 @@ function useIndirectTaxForm(props) {
|
|
|
2650
2660
|
.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
2661
|
const hasValidCurrentDocument = utils$1.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2652
2662
|
// Fire form change event
|
|
2653
|
-
window.dispatchEvent(new Event(
|
|
2663
|
+
window.dispatchEvent(new Event(data.TAX_FORM_UPDATED_EVENT_KEY));
|
|
2654
2664
|
return {
|
|
2655
2665
|
resultPublisher,
|
|
2656
2666
|
hasValidCurrentDocument,
|
|
@@ -2958,7 +2968,7 @@ const IndirectTaxForm = class {
|
|
|
2958
2968
|
}
|
|
2959
2969
|
};
|
|
2960
2970
|
function useDemoIndirectTaxForm(props) {
|
|
2961
|
-
const setStep = index_module.En(
|
|
2971
|
+
const setStep = index_module.En(data.TAX_CONTEXT_NAMESPACE);
|
|
2962
2972
|
const [option, setOption] = domContextHooks_module.useState("otherRegion");
|
|
2963
2973
|
const [demoFormState, setDemoFormState] = domContextHooks_module.useState({});
|
|
2964
2974
|
return cjs.cjs({
|
|
@@ -3593,8 +3603,8 @@ function PayoutDetailsCardView(props) {
|
|
|
3593
3603
|
|
|
3594
3604
|
function usePayoutDetailsCard(props) {
|
|
3595
3605
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
3596
|
-
const { data, loading } = index_module.$n(
|
|
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;
|
|
3606
|
+
const { data: data$1, loading } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
3607
|
+
const publisher = (_b = (_a = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
3598
3608
|
function getPayoutDetailedStatusText(paymentDay) {
|
|
3599
3609
|
var _a;
|
|
3600
3610
|
const currentDay = luxon.luxon.DateTime.now().day;
|
|
@@ -3923,6 +3933,11 @@ const style$5 = {
|
|
|
3923
3933
|
SubduedText: {
|
|
3924
3934
|
color: "var(--sqm-text-subdued)",
|
|
3925
3935
|
},
|
|
3936
|
+
ButtonContainer: {
|
|
3937
|
+
display: "flex",
|
|
3938
|
+
gap: "var(--sl-spacing-medium)",
|
|
3939
|
+
flexWrap: "wrap",
|
|
3940
|
+
},
|
|
3926
3941
|
};
|
|
3927
3942
|
const sheet$4 = JSS.createStyleSheet(style$5);
|
|
3928
3943
|
const styleString$4 = sheet$4.toString();
|
|
@@ -4072,7 +4087,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4072
4087
|
}, {
|
|
4073
4088
|
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4074
4089
|
}),
|
|
4075
|
-
button: (index.h(
|
|
4090
|
+
button: (index.h("div", { class: sheet$4.classes.ButtonContainer },
|
|
4076
4091
|
index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4077
4092
|
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4078
4093
|
alertType: "warning",
|
|
@@ -4088,7 +4103,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4088
4103
|
}, {
|
|
4089
4104
|
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4090
4105
|
}),
|
|
4091
|
-
button: (index.h(
|
|
4106
|
+
button: (index.h("div", { class: sheet$4.classes.ButtonContainer },
|
|
4092
4107
|
index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4093
4108
|
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4094
4109
|
alertType: "warning",
|
|
@@ -4104,7 +4119,7 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
4104
4119
|
}, {
|
|
4105
4120
|
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
4106
4121
|
}),
|
|
4107
|
-
button: (index.h(
|
|
4122
|
+
button: (index.h("div", { class: sheet$4.classes.ButtonContainer },
|
|
4108
4123
|
index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
|
|
4109
4124
|
index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet$4.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
|
|
4110
4125
|
alertType: "warning",
|
|
@@ -4386,20 +4401,26 @@ function getIndirectTaxType(taxInformation) {
|
|
|
4386
4401
|
}
|
|
4387
4402
|
const useTaxAndCashDashboard = (props) => {
|
|
4388
4403
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
4389
|
-
const setStep = index_module.En(
|
|
4390
|
-
const setContext = index_module.En(
|
|
4404
|
+
const setStep = index_module.En(data.TAX_CONTEXT_NAMESPACE);
|
|
4405
|
+
const setContext = index_module.En(data.TAX_FORM_CONTEXT_NAMESPACE);
|
|
4391
4406
|
const [showDialog, setShowDialog] = domContextHooks_module.useState(false);
|
|
4392
|
-
const { render, loading: veriffLoading, errors: veriffErrors, } =
|
|
4407
|
+
const { render, loading: veriffLoading, errors: veriffErrors, } = data.useVeriffApp();
|
|
4393
4408
|
const { data: taxSettingRes } = index_module.wn(GET_TAX_SETTING, {});
|
|
4394
4409
|
const locale = index_module.L();
|
|
4395
4410
|
domContextHooks_module.useEffect(() => {
|
|
4396
4411
|
// Clear override context once on submitted
|
|
4397
4412
|
setContext({});
|
|
4398
|
-
if (window.location.hash)
|
|
4413
|
+
if (window.location.hash) {
|
|
4414
|
+
setContext({
|
|
4415
|
+
overrideNextStep: "/dashboard",
|
|
4416
|
+
overrideBackStep: "/dashboard",
|
|
4417
|
+
hideSteps: true,
|
|
4418
|
+
});
|
|
4399
4419
|
setStep(`/${window.location.hash.replace("#", "")}`);
|
|
4420
|
+
}
|
|
4400
4421
|
}, []);
|
|
4401
|
-
const { data, loading, errors: userError, refetch, } = index_module.$n(
|
|
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;
|
|
4422
|
+
const { data: data$1, loading, errors: userError, refetch, } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
4423
|
+
const publisher = (_b = (_a = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
4403
4424
|
const documentType = publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType;
|
|
4404
4425
|
const submissionDate = (_c = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _c === void 0 ? void 0 : _c.dateCreated;
|
|
4405
4426
|
const dateSubmitted = submissionDate
|
|
@@ -4423,12 +4444,12 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
4423
4444
|
setStep("/3");
|
|
4424
4445
|
};
|
|
4425
4446
|
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;
|
|
4426
|
-
const payoutStatus = data ?
|
|
4447
|
+
const payoutStatus = data$1 ? data.getStatus(data$1) : null;
|
|
4427
4448
|
domContextHooks_module.useEffect(() => {
|
|
4428
4449
|
const cb = () => refetch();
|
|
4429
|
-
window.addEventListener(
|
|
4450
|
+
window.addEventListener(data.VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
4430
4451
|
return () => {
|
|
4431
|
-
window.removeEventListener(
|
|
4452
|
+
window.removeEventListener(data.VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
4432
4453
|
};
|
|
4433
4454
|
}, []);
|
|
4434
4455
|
const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
|
|
@@ -4744,11 +4765,11 @@ const TaxAndCashDashboard = class {
|
|
|
4744
4765
|
/**
|
|
4745
4766
|
* @uiName Withdrawal settings invalid alert header
|
|
4746
4767
|
*/
|
|
4747
|
-
this.withdrawalSettingsInvalidHeader = "Your payment information includes invalid characters";
|
|
4768
|
+
this.withdrawalSettingsInvalidHeader = "Your payment information is incomplete or includes invalid characters";
|
|
4748
4769
|
/**
|
|
4749
4770
|
* @uiName Withdrawal settings invalid alert description
|
|
4750
4771
|
*/
|
|
4751
|
-
this.withdrawalSettingsInvalidDescription = "There are invalid characters in your payment information. Please review your information and make sure it is correct
|
|
4772
|
+
this.withdrawalSettingsInvalidDescription = "There are missing fields or invalid characters in your payment information. Please review your information and make sure it is correct. Your payouts are on hold until this is resolved.";
|
|
4752
4773
|
/**
|
|
4753
4774
|
* @uiName Payment returned alert header
|
|
4754
4775
|
*/
|
|
@@ -6153,7 +6174,7 @@ const vanillaStyle$4 = `
|
|
|
6153
6174
|
`;
|
|
6154
6175
|
const UserInfoFormView = (props) => {
|
|
6155
6176
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
6156
|
-
const { states, states: { formState }, callbacks, text, refs, data, } = props;
|
|
6177
|
+
const { states, states: { formState }, callbacks, text, refs, data: data$1, } = props;
|
|
6157
6178
|
const { classes } = sheet$5;
|
|
6158
6179
|
const bankingCollectionText = global.intl.formatMessage({
|
|
6159
6180
|
id: "bankingCollectionText",
|
|
@@ -6162,7 +6183,7 @@ const UserInfoFormView = (props) => {
|
|
|
6162
6183
|
termsAndConditionsLink: (index.h("a", { href: text.termsAndConditionsLink, target: "_blank" }, text.termsAndConditionsLabel)),
|
|
6163
6184
|
});
|
|
6164
6185
|
let regionLabel = undefined;
|
|
6165
|
-
switch (data.regionLabelEnum) {
|
|
6186
|
+
switch (data$1.regionLabelEnum) {
|
|
6166
6187
|
case "STATE":
|
|
6167
6188
|
regionLabel = text.state;
|
|
6168
6189
|
break;
|
|
@@ -6177,7 +6198,7 @@ const UserInfoFormView = (props) => {
|
|
|
6177
6198
|
}
|
|
6178
6199
|
function isDisabledInput(field) {
|
|
6179
6200
|
var _a;
|
|
6180
|
-
if (states.isPartner && !!((_a = data.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
6201
|
+
if (states.isPartner && !!((_a = data$1.partnerData) === null || _a === void 0 ? void 0 : _a[field]))
|
|
6181
6202
|
return true;
|
|
6182
6203
|
return false;
|
|
6183
6204
|
}
|
|
@@ -6200,7 +6221,7 @@ const UserInfoFormView = (props) => {
|
|
|
6200
6221
|
!states.hideSteps && (index.h("p", null, global.intl.formatMessage({
|
|
6201
6222
|
id: "formStep",
|
|
6202
6223
|
defaultMessage: text.formStep,
|
|
6203
|
-
}, { step: states.step, count:
|
|
6224
|
+
}, { step: states.step, count: data.FORM_STEPS }))),
|
|
6204
6225
|
index.h("h3", null, text.personalInformation),
|
|
6205
6226
|
index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
|
|
6206
6227
|
((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sqm-form-message", { type: "error" },
|
|
@@ -6246,8 +6267,8 @@ const UserInfoFormView = (props) => {
|
|
|
6246
6267
|
e.stopPropagation();
|
|
6247
6268
|
}, "onSl-input": (e) => {
|
|
6248
6269
|
callbacks.setCountrySearch(e.target.value);
|
|
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 :
|
|
6270
|
+
} }), (_e = data$1 === null || data$1 === void 0 ? void 0 : data$1.countries) === null || _e === void 0 ? void 0 :
|
|
6271
|
+
_e.map((c) => (index.h("sl-menu-item", { value: c.countryCode }, c.displayName))), (_f = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCountries) === null || _f === void 0 ? void 0 :
|
|
6251
6272
|
_f.map((c) => (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
|
|
6252
6273
|
index.h("div", { class: classes.PhoneInputsSection },
|
|
6253
6274
|
index.h("p", null, text.phoneNumber),
|
|
@@ -6262,13 +6283,13 @@ const UserInfoFormView = (props) => {
|
|
|
6262
6283
|
e.stopPropagation();
|
|
6263
6284
|
}, "onSl-input": (e) => {
|
|
6264
6285
|
callbacks.setPhoneCountrySearch(e.target.value);
|
|
6265
|
-
} }), (_h = data === null || data === void 0 ? void 0 : data.phoneCountries) === null || _h === void 0 ? void 0 :
|
|
6286
|
+
} }), (_h = data$1 === null || data$1 === void 0 ? void 0 : data$1.phoneCountries) === null || _h === void 0 ? void 0 :
|
|
6266
6287
|
_h.map((c) => {
|
|
6267
6288
|
var _a, _b;
|
|
6268
6289
|
return (index.h("sl-menu-item", { value: c.countryCode },
|
|
6269
6290
|
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 :
|
|
6270
6291
|
_b.dial_code));
|
|
6271
|
-
}), (_j = data === null || data === void 0 ? void 0 : data.allCountries) === null || _j === void 0 ? void 0 :
|
|
6292
|
+
}), (_j = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCountries) === null || _j === void 0 ? void 0 :
|
|
6272
6293
|
_j.map((c) => {
|
|
6273
6294
|
var _a, _b;
|
|
6274
6295
|
return (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } },
|
|
@@ -6287,7 +6308,7 @@ const UserInfoFormView = (props) => {
|
|
|
6287
6308
|
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 }) =>
|
|
6288
6309
|
// Checks for non-ASCII characters
|
|
6289
6310
|
!utils$1.validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6290
|
-
utils$1.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("
|
|
6311
|
+
utils$1.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("billingAddress") }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
|
|
6291
6312
|
class: classes.ErrorInput,
|
|
6292
6313
|
helpText: utils$1.formatErrorMessage(text.address, formState.errors.address),
|
|
6293
6314
|
}
|
|
@@ -6295,17 +6316,17 @@ const UserInfoFormView = (props) => {
|
|
|
6295
6316
|
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 }) =>
|
|
6296
6317
|
// Checks for non-ASCII characters
|
|
6297
6318
|
!utils$1.validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
6298
|
-
utils$1.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("
|
|
6319
|
+
utils$1.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || isDisabledInput("billingCity") }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
|
|
6299
6320
|
class: classes.ErrorInput,
|
|
6300
6321
|
helpText: utils$1.formatErrorMessage(text.city, formState.errors.city),
|
|
6301
6322
|
}
|
|
6302
6323
|
: {}), { required: true })),
|
|
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("
|
|
6324
|
+
!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("billingState") }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
|
|
6304
6325
|
class: classes.ErrorInput,
|
|
6305
6326
|
helpText: utils$1.formatErrorMessage(text.state, formState.errors.state),
|
|
6306
6327
|
}
|
|
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("
|
|
6328
|
+
: {}), { required: true }), (_p = data$1.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (index.h("sl-menu-item", { value: r.value }, r.label))))),
|
|
6329
|
+
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("billingPostalCode") }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
|
|
6309
6330
|
class: classes.ErrorInput,
|
|
6310
6331
|
helpText: utils$1.formatErrorMessage(text.postalCode, formState.errors.postalCode),
|
|
6311
6332
|
}
|
|
@@ -6320,11 +6341,11 @@ const UserInfoFormView = (props) => {
|
|
|
6320
6341
|
e.stopPropagation();
|
|
6321
6342
|
}, "onSl-input": (e) => {
|
|
6322
6343
|
callbacks.setCurrencySearch(e.target.value);
|
|
6323
|
-
} }), (_s = data === null || data === void 0 ? void 0 : data.currencies) === null || _s === void 0 ? void 0 :
|
|
6344
|
+
} }), (_s = data$1 === null || data$1 === void 0 ? void 0 : data$1.currencies) === null || _s === void 0 ? void 0 :
|
|
6324
6345
|
_s.map((c) => (index.h("sl-menu-item", { value: c.currencyCode },
|
|
6325
6346
|
c.currencyCode,
|
|
6326
6347
|
" - ",
|
|
6327
|
-
c.displayName))), (_t = data === null || data === void 0 ? void 0 : data.allCurrencies) === null || _t === void 0 ? void 0 :
|
|
6348
|
+
c.displayName))), (_t = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCurrencies) === null || _t === void 0 ? void 0 :
|
|
6328
6349
|
_t.map((c) => (index.h("sl-menu-item", { value: c.currencyCode, style: { display: "none" } },
|
|
6329
6350
|
c.currencyCode,
|
|
6330
6351
|
" - ",
|
|
@@ -6337,19 +6358,28 @@ const UserInfoFormView = (props) => {
|
|
|
6337
6358
|
index.h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
|
|
6338
6359
|
};
|
|
6339
6360
|
|
|
6361
|
+
const GET_INDIRECT_TAX_COUNTRY_CODE = index_module.dist.gql `
|
|
6362
|
+
query getIndirectTaxCountryCode {
|
|
6363
|
+
tenantSettings {
|
|
6364
|
+
impactBrandCountryCode
|
|
6365
|
+
impactBrandIndirectTaxCountryCode
|
|
6366
|
+
}
|
|
6367
|
+
}
|
|
6368
|
+
`;
|
|
6340
6369
|
function useUserInfoForm(props) {
|
|
6341
|
-
var _a, _b, _c, _d, _e, _f;
|
|
6370
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6342
6371
|
const currencyRef = domContextHooks_module.useRef(undefined);
|
|
6343
6372
|
const phoneCountryRef = domContextHooks_module.useRef(undefined);
|
|
6344
6373
|
const formRef = domContextHooks_module.useRef(null);
|
|
6345
|
-
const context = index_module.Fn(
|
|
6346
|
-
const countries = index_module.Fn(
|
|
6347
|
-
const [step, setStep] = index_module.Pn(
|
|
6348
|
-
const [userFormContext, setUserFormContext] = index_module.Pn(
|
|
6374
|
+
const context = index_module.Fn(data.TAX_FORM_CONTEXT_NAMESPACE);
|
|
6375
|
+
const countries = index_module.Fn(data.SORTED_COUNTRIES_NAMESPACE);
|
|
6376
|
+
const [step, setStep] = index_module.Pn(data.TAX_CONTEXT_NAMESPACE);
|
|
6377
|
+
const [userFormContext, setUserFormContext] = index_module.Pn(data.USER_FORM_CONTEXT_NAMESPACE);
|
|
6349
6378
|
const user = index_module.J();
|
|
6350
6379
|
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = index_module.$e(CONNECT_PARTNER);
|
|
6351
|
-
const { data
|
|
6352
|
-
const
|
|
6380
|
+
const { data: tenantData } = index_module.wn(GET_INDIRECT_TAX_COUNTRY_CODE, {});
|
|
6381
|
+
const { data: data$1, loading, refetch, errors: userError, } = index_module.$n(data.USER_QUERY_NAMESPACE);
|
|
6382
|
+
const _currencies = index_module.Fn(data.CURRENCIES_NAMESPACE);
|
|
6353
6383
|
const currencies = domContextHooks_module.useMemo(() => [...(_currencies || [])].sort((a, b) => a.displayName.localeCompare(b.displayName)), [_currencies]);
|
|
6354
6384
|
const [countrySearch, setCountrySearch] = domContextHooks_module.useState("");
|
|
6355
6385
|
const [phoneCountrySearch, setPhoneCountrySearch] = domContextHooks_module.useState("");
|
|
@@ -6364,7 +6394,7 @@ function useUserInfoForm(props) {
|
|
|
6364
6394
|
}, []);
|
|
6365
6395
|
domContextHooks_module.useEffect(() => {
|
|
6366
6396
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
6367
|
-
const user = data === null || data === void 0 ? void 0 : data.user;
|
|
6397
|
+
const user = data$1 === null || data$1 === void 0 ? void 0 : data$1.user;
|
|
6368
6398
|
if (!user || step !== "/1")
|
|
6369
6399
|
return;
|
|
6370
6400
|
// If form already filled out, skip initialising it
|
|
@@ -6405,7 +6435,7 @@ function useUserInfoForm(props) {
|
|
|
6405
6435
|
postalCode: (_k = user.customFields) === null || _k === void 0 ? void 0 : _k.postalCode,
|
|
6406
6436
|
});
|
|
6407
6437
|
}
|
|
6408
|
-
}, [data, step, userFormContext]);
|
|
6438
|
+
}, [data$1, step, userFormContext]);
|
|
6409
6439
|
const onFormChange = (field, e) => {
|
|
6410
6440
|
var _a, _b;
|
|
6411
6441
|
const value = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
@@ -6483,7 +6513,7 @@ function useUserInfoForm(props) {
|
|
|
6483
6513
|
.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
6514
|
const hasValidCurrentDocument = utils$1.validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
6485
6515
|
// Fire form change event
|
|
6486
|
-
window.dispatchEvent(new Event(
|
|
6516
|
+
window.dispatchEvent(new Event(data.TAX_FORM_UPDATED_EVENT_KEY));
|
|
6487
6517
|
return {
|
|
6488
6518
|
resultPublisher,
|
|
6489
6519
|
hasValidCurrentDocument,
|
|
@@ -6532,7 +6562,6 @@ function useUserInfoForm(props) {
|
|
|
6532
6562
|
currency: userData.currency,
|
|
6533
6563
|
});
|
|
6534
6564
|
const skipNextStep = getSkipNextStep(userData);
|
|
6535
|
-
console.log({ skipNextStep });
|
|
6536
6565
|
if (skipNextStep) {
|
|
6537
6566
|
try {
|
|
6538
6567
|
const { resultPublisher, hasValidCurrentDocument } = await connectPartner(formData);
|
|
@@ -6561,10 +6590,16 @@ function useUserInfoForm(props) {
|
|
|
6561
6590
|
const nextStep = context.overrideNextStep || skipNextStep ? "/3" : "/2";
|
|
6562
6591
|
setStep(nextStep);
|
|
6563
6592
|
}
|
|
6593
|
+
const indirectTaxCountry = (_a = tenantData === null || tenantData === void 0 ? void 0 : tenantData.tenantSettings) === null || _a === void 0 ? void 0 : _a.impactBrandIndirectTaxCountryCode;
|
|
6594
|
+
const hasIndirectTax = !!indirectTaxCountry;
|
|
6564
6595
|
function getSkipNextStep(userData) {
|
|
6596
|
+
if (!hasIndirectTax)
|
|
6597
|
+
return true;
|
|
6565
6598
|
if (userData.countryCode === "US")
|
|
6566
6599
|
return true;
|
|
6567
|
-
|
|
6600
|
+
if (hasIndirectTax && userData.countryCode !== indirectTaxCountry)
|
|
6601
|
+
return true;
|
|
6602
|
+
return false;
|
|
6568
6603
|
}
|
|
6569
6604
|
const hasStates = ["ES", "AU", "US", "CA"].includes(userFormContext.countryCode);
|
|
6570
6605
|
const regionObj = hasStates
|
|
@@ -6593,7 +6628,7 @@ function useUserInfoForm(props) {
|
|
|
6593
6628
|
allCountries: countries,
|
|
6594
6629
|
regionLabelEnum: regionObj === null || regionObj === void 0 ? void 0 : regionObj.labelEnum,
|
|
6595
6630
|
regions: (regionObj === null || regionObj === void 0 ? void 0 : regionObj.regions) || [],
|
|
6596
|
-
partnerData: (
|
|
6631
|
+
partnerData: (_c = (_b = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _b === void 0 ? void 0 : _b.impactConnection) === null || _c === void 0 ? void 0 : _c.publisher,
|
|
6597
6632
|
},
|
|
6598
6633
|
states: {
|
|
6599
6634
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
@@ -6602,8 +6637,8 @@ function useUserInfoForm(props) {
|
|
|
6602
6637
|
disabled: loading || connectLoading,
|
|
6603
6638
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
6604
6639
|
loading: loading || connectLoading,
|
|
6605
|
-
isPartner: !!((
|
|
6606
|
-
isUser: !!((
|
|
6640
|
+
isPartner: !!((_e = (_d = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher),
|
|
6641
|
+
isUser: !!((_g = (_f = data$1 === null || data$1 === void 0 ? void 0 : data$1.user) === null || _f === void 0 ? void 0 : _f.impactConnection) === null || _g === void 0 ? void 0 : _g.user),
|
|
6607
6642
|
formState: {
|
|
6608
6643
|
...userFormContext,
|
|
6609
6644
|
errors: formErrors,
|
|
@@ -6793,7 +6828,7 @@ const TaxForm = class {
|
|
|
6793
6828
|
}
|
|
6794
6829
|
};
|
|
6795
6830
|
function useDemoUserInfoForm(props) {
|
|
6796
|
-
const setStep = index_module.En(
|
|
6831
|
+
const setStep = index_module.En(data.TAX_CONTEXT_NAMESPACE);
|
|
6797
6832
|
return cjs.cjs({
|
|
6798
6833
|
setStep,
|
|
6799
6834
|
onSubmit: async () => {
|