@saasquatch/mint-components 2.5.10-0 → 2.5.11-0

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 (87) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mint-components.cjs.js +1 -1
  3. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +27 -20
  4. package/dist/cjs/sqm-big-stat_47.cjs.entry.js +30 -10
  5. package/dist/cjs/sqm-stencilbook.cjs.entry.js +83 -3
  6. package/dist/cjs/{sqm-user-info-form-view-df5b95be.js → sqm-user-info-form-view-9416da92.js} +9 -7
  7. package/dist/cjs/{subregions-fd4e4ee2.js → subregions-e18b324d.js} +36 -0
  8. package/dist/cjs/{useIndirectTaxForm-76b94531.js → useIndirectTaxForm-31c63877.js} +8 -6
  9. package/dist/collection/components/sqm-coupon-code/sqm-coupon-code.js +1 -1
  10. package/dist/collection/components/sqm-logout-current-user/sqm-logout-current-user.js +1 -1
  11. package/dist/collection/components/sqm-referral-code/sqm-referral-code.js +1 -1
  12. package/dist/collection/components/sqm-share-button/sqm-share-button.js +1 -1
  13. package/dist/collection/components/sqm-share-code/sqm-share-code.js +1 -1
  14. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +1 -0
  15. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +2 -2
  16. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +1 -1
  17. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +2 -0
  18. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +3 -3
  19. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +35 -0
  20. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +9 -6
  21. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +199 -1
  22. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +5 -3
  23. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +205 -7
  24. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories.js +34 -0
  25. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +9 -6
  26. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +198 -0
  27. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +13 -16
  28. package/dist/collection/components/tax-and-cash/utils.js +33 -0
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/esm/mint-components.js +1 -1
  31. package/dist/esm/sqm-banking-info-form_10.entry.js +27 -20
  32. package/dist/esm/sqm-big-stat_47.entry.js +30 -10
  33. package/dist/esm/sqm-stencilbook.entry.js +83 -3
  34. package/dist/esm/{sqm-user-info-form-view-d35324ba.js → sqm-user-info-form-view-6693aa82.js} +9 -7
  35. package/dist/esm/{subregions-c7df98a1.js → subregions-7f834e40.js} +34 -1
  36. package/dist/esm/{useIndirectTaxForm-6ea561e4.js → useIndirectTaxForm-58b0ea4b.js} +8 -6
  37. package/dist/esm-es5/loader.js +1 -1
  38. package/dist/esm-es5/mint-components.js +1 -1
  39. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  40. package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
  41. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  42. package/dist/esm-es5/sqm-user-info-form-view-6693aa82.js +1 -0
  43. package/dist/esm-es5/subregions-7f834e40.js +1 -0
  44. package/dist/esm-es5/useIndirectTaxForm-58b0ea4b.js +6 -0
  45. package/dist/mint-components/mint-components.esm.js +1 -1
  46. package/dist/mint-components/p-0714330d.system.js +6 -0
  47. package/dist/mint-components/p-07f70909.system.entry.js +1 -0
  48. package/dist/mint-components/{p-4314e5c9.entry.js → p-11db4597.entry.js} +3 -3
  49. package/dist/mint-components/p-6116d239.js +108 -0
  50. package/dist/mint-components/p-7a324afd.entry.js +308 -0
  51. package/dist/mint-components/p-9098802a.entry.js +83 -0
  52. package/dist/mint-components/{p-477fe6fa.system.entry.js → p-97f5251b.system.entry.js} +1 -1
  53. package/dist/mint-components/p-9b9a9762.system.js +1 -0
  54. package/dist/mint-components/p-a1eb93fc.system.js +1 -0
  55. package/dist/mint-components/p-c9fc666c.system.entry.js +1 -0
  56. package/dist/mint-components/p-cb7d2088.js +1 -0
  57. package/dist/mint-components/p-d811796f.js +1 -0
  58. package/dist/mint-components/p-e78ec46b.system.js +1 -1
  59. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +1 -0
  60. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +5 -0
  61. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +10 -0
  62. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +36 -0
  63. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +2 -1
  64. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +38 -2
  65. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories.d.ts +5 -0
  66. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +9 -0
  67. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +36 -0
  68. package/dist/types/components/tax-and-cash/utils.d.ts +38 -1
  69. package/dist/types/components.d.ts +220 -4
  70. package/docs/docs.docx +0 -0
  71. package/docs/raisins.json +1 -1
  72. package/docs/stats.json +1588 -235
  73. package/grapesjs/grapesjs.js +1 -1
  74. package/package.json +1 -1
  75. package/dist/esm-es5/sqm-user-info-form-view-d35324ba.js +0 -1
  76. package/dist/esm-es5/subregions-c7df98a1.js +0 -1
  77. package/dist/esm-es5/useIndirectTaxForm-6ea561e4.js +0 -6
  78. package/dist/mint-components/p-089c0803.js +0 -1
  79. package/dist/mint-components/p-1cb0fc65.system.js +0 -6
  80. package/dist/mint-components/p-2401753b.js +0 -1
  81. package/dist/mint-components/p-59f9d9bb.js +0 -107
  82. package/dist/mint-components/p-615dbc66.system.entry.js +0 -1
  83. package/dist/mint-components/p-98659a12.system.js +0 -1
  84. package/dist/mint-components/p-9e90f38e.entry.js +0 -83
  85. package/dist/mint-components/p-aaf05ef1.entry.js +0 -308
  86. package/dist/mint-components/p-db8e74e0.system.entry.js +0 -1
  87. package/dist/mint-components/p-ed18f6a0.system.js +0 -1
@@ -69,14 +69,23 @@ export class TaxAndCashDashboard {
69
69
  this.paymentHoldOnChangeDescription = "Your payout is temporarily on hold while we review your new payment information, this process is usually resolved within 48 hours.";
70
70
  this.beneficiaryNameInvalidHeader = "Your payment information does not match your tax form";
71
71
  this.beneficiaryNameInvalidDescription = "The account holder (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.";
72
+ this.beneficiaryNameInvalidNonBrandedHeader = "Account holder name contains invalid characters";
73
+ this.beneficiaryNameInvalidNonBrandedDescription = "The account holder name in your payment information contains characters we can't accept. Go to impact.com to update it so it is valid and matches the name on your tax form. Your payouts are on hold until this is resolved.";
72
74
  this.beneficiaryNameMismatchHeader = "Your payment information does not match your tax form";
73
75
  this.beneficiaryNameMismatchDescription = "The account holder (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.";
76
+ this.beneficiaryNameMismatchNonBrandedHeader = "Account holder name doesn't match your tax form";
77
+ this.beneficiaryNameMismatchNonBrandedDescription = "The account holder name in your payment information doesn't match the name on your tax form. Go to impact.com to update one or both so the names match exactly. Your payouts are on hold until this is resolved.";
74
78
  this.bankTaxNameMismatchHeader = "Your payment information does not match your tax form";
75
79
  this.bankTaxNameMismatchDescription = "The bank account (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.";
80
+ this.bankTaxNameMismatchNonBrandedHeader = "Bank account name doesn't match your tax form";
81
+ this.bankTaxNameMismatchNonBrandedDescription = "The name on your bank account doesn't match the name on your tax form. Go to impact.com to update your payment information or your tax form so the two names match exactly. Your payouts are on hold until this is resolved.";
76
82
  this.withdrawalSettingsInvalidHeader = "Your payment information is incomplete or includes invalid characters";
77
83
  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.";
84
+ this.withdrawalSettingsInvalidNonBrandedHeader = "Payment information is incomplete or contains errors";
85
+ this.withdrawalSettingsInvalidNonBrandedDescription = "Some required details in your payment information are missing or contain invalid characters. Go to impact.com to review and complete your information. Your payouts are on hold until this is resolved.";
78
86
  this.paymentReturnedHeader = "Payout unsuccessful";
79
87
  this.paymentReturnedDescription = "Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.";
88
+ this.paymentReturnedNonBrandedDescription = "Your most recent payment for your earnings was returned. Go to impact.com to check that your payment information is correct and up to date.";
80
89
  this.termsAndConditions = "Terms and Conditions";
81
90
  this.w9RequiredButtonText = "Submit W-9";
82
91
  this.generalErrorTitle = "There was a problem submitting your information";
@@ -1271,6 +1280,48 @@ export class TaxAndCashDashboard {
1271
1280
  "reflect": false,
1272
1281
  "defaultValue": "\"The account holder (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.\""
1273
1282
  },
1283
+ "beneficiaryNameInvalidNonBrandedHeader": {
1284
+ "type": "string",
1285
+ "mutable": false,
1286
+ "complexType": {
1287
+ "original": "string",
1288
+ "resolved": "string",
1289
+ "references": {}
1290
+ },
1291
+ "required": false,
1292
+ "optional": false,
1293
+ "docs": {
1294
+ "tags": [{
1295
+ "name": "uiName",
1296
+ "text": "Beneficiary name invalid alert header (non-branded partners)"
1297
+ }],
1298
+ "text": ""
1299
+ },
1300
+ "attribute": "beneficiary-name-invalid-non-branded-header",
1301
+ "reflect": false,
1302
+ "defaultValue": "\"Account holder name contains invalid characters\""
1303
+ },
1304
+ "beneficiaryNameInvalidNonBrandedDescription": {
1305
+ "type": "string",
1306
+ "mutable": false,
1307
+ "complexType": {
1308
+ "original": "string",
1309
+ "resolved": "string",
1310
+ "references": {}
1311
+ },
1312
+ "required": false,
1313
+ "optional": false,
1314
+ "docs": {
1315
+ "tags": [{
1316
+ "name": "uiName",
1317
+ "text": "Beneficiary name invalid alert description (non-branded partners)"
1318
+ }],
1319
+ "text": ""
1320
+ },
1321
+ "attribute": "beneficiary-name-invalid-non-branded-description",
1322
+ "reflect": false,
1323
+ "defaultValue": "\"The account holder name in your payment information contains characters we can't accept. Go to impact.com to update it so it is valid and matches the name on your tax form. Your payouts are on hold until this is resolved.\""
1324
+ },
1274
1325
  "beneficiaryNameMismatchHeader": {
1275
1326
  "type": "string",
1276
1327
  "mutable": false,
@@ -1313,6 +1364,48 @@ export class TaxAndCashDashboard {
1313
1364
  "reflect": false,
1314
1365
  "defaultValue": "\"The account holder (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.\""
1315
1366
  },
1367
+ "beneficiaryNameMismatchNonBrandedHeader": {
1368
+ "type": "string",
1369
+ "mutable": false,
1370
+ "complexType": {
1371
+ "original": "string",
1372
+ "resolved": "string",
1373
+ "references": {}
1374
+ },
1375
+ "required": false,
1376
+ "optional": false,
1377
+ "docs": {
1378
+ "tags": [{
1379
+ "name": "uiName",
1380
+ "text": "Beneficiary name mismatch alert header (non-branded partners)"
1381
+ }],
1382
+ "text": ""
1383
+ },
1384
+ "attribute": "beneficiary-name-mismatch-non-branded-header",
1385
+ "reflect": false,
1386
+ "defaultValue": "\"Account holder name doesn't match your tax form\""
1387
+ },
1388
+ "beneficiaryNameMismatchNonBrandedDescription": {
1389
+ "type": "string",
1390
+ "mutable": false,
1391
+ "complexType": {
1392
+ "original": "string",
1393
+ "resolved": "string",
1394
+ "references": {}
1395
+ },
1396
+ "required": false,
1397
+ "optional": false,
1398
+ "docs": {
1399
+ "tags": [{
1400
+ "name": "uiName",
1401
+ "text": "Beneficiary name mismatch alert description (non-branded partners)"
1402
+ }],
1403
+ "text": ""
1404
+ },
1405
+ "attribute": "beneficiary-name-mismatch-non-branded-description",
1406
+ "reflect": false,
1407
+ "defaultValue": "\"The account holder name in your payment information doesn't match the name on your tax form. Go to impact.com to update one or both so the names match exactly. Your payouts are on hold until this is resolved.\""
1408
+ },
1316
1409
  "bankTaxNameMismatchHeader": {
1317
1410
  "type": "string",
1318
1411
  "mutable": false,
@@ -1355,6 +1448,48 @@ export class TaxAndCashDashboard {
1355
1448
  "reflect": false,
1356
1449
  "defaultValue": "\"The bank account (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.\""
1357
1450
  },
1451
+ "bankTaxNameMismatchNonBrandedHeader": {
1452
+ "type": "string",
1453
+ "mutable": false,
1454
+ "complexType": {
1455
+ "original": "string",
1456
+ "resolved": "string",
1457
+ "references": {}
1458
+ },
1459
+ "required": false,
1460
+ "optional": false,
1461
+ "docs": {
1462
+ "tags": [{
1463
+ "name": "uiName",
1464
+ "text": "Bank name mismatch alert header (non-branded partners)"
1465
+ }],
1466
+ "text": ""
1467
+ },
1468
+ "attribute": "bank-tax-name-mismatch-non-branded-header",
1469
+ "reflect": false,
1470
+ "defaultValue": "\"Bank account name doesn't match your tax form\""
1471
+ },
1472
+ "bankTaxNameMismatchNonBrandedDescription": {
1473
+ "type": "string",
1474
+ "mutable": false,
1475
+ "complexType": {
1476
+ "original": "string",
1477
+ "resolved": "string",
1478
+ "references": {}
1479
+ },
1480
+ "required": false,
1481
+ "optional": false,
1482
+ "docs": {
1483
+ "tags": [{
1484
+ "name": "uiName",
1485
+ "text": "Bank name mismatch alert description (non-branded partners)"
1486
+ }],
1487
+ "text": ""
1488
+ },
1489
+ "attribute": "bank-tax-name-mismatch-non-branded-description",
1490
+ "reflect": false,
1491
+ "defaultValue": "\"The name on your bank account doesn't match the name on your tax form. Go to impact.com to update your payment information or your tax form so the two names match exactly. Your payouts are on hold until this is resolved.\""
1492
+ },
1358
1493
  "withdrawalSettingsInvalidHeader": {
1359
1494
  "type": "string",
1360
1495
  "mutable": false,
@@ -1397,6 +1532,48 @@ export class TaxAndCashDashboard {
1397
1532
  "reflect": false,
1398
1533
  "defaultValue": "\"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.\""
1399
1534
  },
1535
+ "withdrawalSettingsInvalidNonBrandedHeader": {
1536
+ "type": "string",
1537
+ "mutable": false,
1538
+ "complexType": {
1539
+ "original": "string",
1540
+ "resolved": "string",
1541
+ "references": {}
1542
+ },
1543
+ "required": false,
1544
+ "optional": false,
1545
+ "docs": {
1546
+ "tags": [{
1547
+ "name": "uiName",
1548
+ "text": "Withdrawal settings invalid alert header (non-branded partners)"
1549
+ }],
1550
+ "text": ""
1551
+ },
1552
+ "attribute": "withdrawal-settings-invalid-non-branded-header",
1553
+ "reflect": false,
1554
+ "defaultValue": "\"Payment information is incomplete or contains errors\""
1555
+ },
1556
+ "withdrawalSettingsInvalidNonBrandedDescription": {
1557
+ "type": "string",
1558
+ "mutable": false,
1559
+ "complexType": {
1560
+ "original": "string",
1561
+ "resolved": "string",
1562
+ "references": {}
1563
+ },
1564
+ "required": false,
1565
+ "optional": false,
1566
+ "docs": {
1567
+ "tags": [{
1568
+ "name": "uiName",
1569
+ "text": "Withdrawal settings invalid alert description (non-branded partners)"
1570
+ }],
1571
+ "text": ""
1572
+ },
1573
+ "attribute": "withdrawal-settings-invalid-non-branded-description",
1574
+ "reflect": false,
1575
+ "defaultValue": "\"Some required details in your payment information are missing or contain invalid characters. Go to impact.com to review and complete your information. Your payouts are on hold until this is resolved.\""
1576
+ },
1400
1577
  "paymentReturnedHeader": {
1401
1578
  "type": "string",
1402
1579
  "mutable": false,
@@ -1439,6 +1616,27 @@ export class TaxAndCashDashboard {
1439
1616
  "reflect": false,
1440
1617
  "defaultValue": "\"Our recent payment attempt for your earnings was unsuccessful. Please review your payment information and make sure it is correct.\""
1441
1618
  },
1619
+ "paymentReturnedNonBrandedDescription": {
1620
+ "type": "string",
1621
+ "mutable": false,
1622
+ "complexType": {
1623
+ "original": "string",
1624
+ "resolved": "string",
1625
+ "references": {}
1626
+ },
1627
+ "required": false,
1628
+ "optional": false,
1629
+ "docs": {
1630
+ "tags": [{
1631
+ "name": "uiName",
1632
+ "text": "Payment returned alert description (non-branded partners)"
1633
+ }],
1634
+ "text": ""
1635
+ },
1636
+ "attribute": "payment-returned-non-branded-description",
1637
+ "reflect": false,
1638
+ "defaultValue": "\"Your most recent payment for your earnings was returned. Go to impact.com to check that your payment information is correct and up to date.\""
1639
+ },
1442
1640
  "termsAndConditions": {
1443
1641
  "type": "string",
1444
1642
  "mutable": false,
@@ -3,7 +3,7 @@ import { useEffect, useMemo, useRef, useState, } from "@saasquatch/universal-hoo
3
3
  import jsonpointer from "jsonpointer";
4
4
  import { CURRENCIES_NAMESPACE, SORTED_COUNTRIES_NAMESPACE, TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../data";
5
5
  import { ADDRESS_REGIONS } from "../subregions";
6
- import { objectIsFull, toDomesticNumber, validTaxDocument } from "../utils";
6
+ import { getParticipantEmail, objectIsFull, toDomesticNumber, validTaxDocument, } from "../utils";
7
7
  import { TAX_FORM_UPDATED_EVENT_KEY } from "../eventKeys";
8
8
  import { CONNECT_PARTNER, COMPLETE_PARTNER, } from "../sqm-indirect-tax-form/useIndirectTaxForm";
9
9
  import { gql } from "graphql-request";
@@ -43,18 +43,15 @@ export function useUserInfoForm(props) {
43
43
  window.location.hash = "";
44
44
  }, []);
45
45
  useEffect(() => {
46
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
46
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
47
47
  const user = data === null || data === void 0 ? void 0 : data.user;
48
48
  if (!user || step !== "/1")
49
49
  return;
50
50
  // If form already filled out, skip initialising it
51
51
  if (objectIsFull(userFormContext))
52
52
  return;
53
- // Prefer MI email if it was verified before this
54
- const email = ((_a = user.managedIdentity) === null || _a === void 0 ? void 0 : _a.emailVerified)
55
- ? user.managedIdentity.email
56
- : user.email;
57
- if (((_b = user.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher) && ((_c = user.impactConnection) === null || _c === void 0 ? void 0 : _c.user)) {
53
+ const email = getParticipantEmail(user);
54
+ if (((_a = user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) && ((_b = user.impactConnection) === null || _b === void 0 ? void 0 : _b.user)) {
58
55
  // Initialise with partner information
59
56
  setUserFormContext({
60
57
  email,
@@ -79,16 +76,16 @@ export function useUserInfoForm(props) {
79
76
  // Initialise with user information
80
77
  setUserFormContext({
81
78
  email,
82
- firstName: ((_e = (_d = user.impactConnection) === null || _d === void 0 ? void 0 : _d.user) === null || _e === void 0 ? void 0 : _e.firstName) || user.firstName,
83
- lastName: ((_g = (_f = user.impactConnection) === null || _f === void 0 ? void 0 : _f.user) === null || _g === void 0 ? void 0 : _g.lastName) || user.lastName,
79
+ firstName: ((_d = (_c = user.impactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.firstName) || user.firstName,
80
+ lastName: ((_f = (_e = user.impactConnection) === null || _e === void 0 ? void 0 : _e.user) === null || _f === void 0 ? void 0 : _f.lastName) || user.lastName,
84
81
  countryCode: user.countryCode || "US",
85
- currency: (_h = user.customFields) === null || _h === void 0 ? void 0 : _h.currency,
86
- phoneNumberCountryCode: ((_j = user.customFields) === null || _j === void 0 ? void 0 : _j.phoneNumberCountryCode) || "US",
87
- phoneNumber: (_k = user.customFields) === null || _k === void 0 ? void 0 : _k.phoneNumber,
88
- address: (_l = user.customFields) === null || _l === void 0 ? void 0 : _l.address,
89
- city: (_m = user.customFields) === null || _m === void 0 ? void 0 : _m.city,
90
- state: (_o = user.customFields) === null || _o === void 0 ? void 0 : _o.state,
91
- postalCode: (_p = user.customFields) === null || _p === void 0 ? void 0 : _p.postalCode,
82
+ currency: (_g = user.customFields) === null || _g === void 0 ? void 0 : _g.currency,
83
+ phoneNumberCountryCode: ((_h = user.customFields) === null || _h === void 0 ? void 0 : _h.phoneNumberCountryCode) || "US",
84
+ phoneNumber: (_j = user.customFields) === null || _j === void 0 ? void 0 : _j.phoneNumber,
85
+ address: (_k = user.customFields) === null || _k === void 0 ? void 0 : _k.address,
86
+ city: (_l = user.customFields) === null || _l === void 0 ? void 0 : _l.city,
87
+ state: (_m = user.customFields) === null || _m === void 0 ? void 0 : _m.state,
88
+ postalCode: (_o = user.customFields) === null || _o === void 0 ? void 0 : _o.postalCode,
92
89
  });
93
90
  }
94
91
  }, [data, step, userFormContext]);
@@ -1,5 +1,38 @@
1
1
  import { parsePhoneNumberFromString } from "libphonenumber-js";
2
2
  import { intl } from "../../global/global";
3
+ /** Managed identity email once verified, else the profile email. */
4
+ export function getParticipantEmail(user) {
5
+ var _a;
6
+ return ((_a = user === null || user === void 0 ? void 0 : user.managedIdentity) === null || _a === void 0 ? void 0 : _a.emailVerified)
7
+ ? user.managedIdentity.email
8
+ : user === null || user === void 0 ? void 0 : user.email;
9
+ }
10
+ const IMPACT_APP_URL = "https://app.impact.com";
11
+ /**
12
+ * Non-branded partners manage their payment information on impact.com, so
13
+ * their payment information alerts use copy that points them there.
14
+ */
15
+ export function withPaymentInfoAlertCopy(text, canEditPayoutInfo) {
16
+ if (canEditPayoutInfo !== false)
17
+ return text;
18
+ return {
19
+ ...text,
20
+ beneficiaryNameInvalidHeader: text.beneficiaryNameInvalidNonBrandedHeader,
21
+ beneficiaryNameInvalidDescription: text.beneficiaryNameInvalidNonBrandedDescription,
22
+ beneficiaryNameMismatchHeader: text.beneficiaryNameMismatchNonBrandedHeader,
23
+ beneficiaryNameMismatchDescription: text.beneficiaryNameMismatchNonBrandedDescription,
24
+ bankTaxNameMismatchHeader: text.bankTaxNameMismatchNonBrandedHeader,
25
+ bankTaxNameMismatchDescription: text.bankTaxNameMismatchNonBrandedDescription,
26
+ withdrawalSettingsInvalidHeader: text.withdrawalSettingsInvalidNonBrandedHeader,
27
+ withdrawalSettingsInvalidDescription: text.withdrawalSettingsInvalidNonBrandedDescription,
28
+ paymentReturnedDescription: text.paymentReturnedNonBrandedDescription,
29
+ };
30
+ }
31
+ export function getEditPayoutInfoButtonProps(canEditPayoutInfo, onClick) {
32
+ return canEditPayoutInfo === false
33
+ ? { href: IMPACT_APP_URL, target: "_blank" }
34
+ : { onClick };
35
+ }
3
36
  /**
4
37
  * Normalize user input to the domestic form Impact stores: digits only,
5
38
  * with the country dial code and trunk-zero prefix removed.