@saasquatch/mint-components 1.15.4 → 1.15.5-2

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