@saasquatch/mint-components 2.2.0-0 → 2.2.0-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 (114) hide show
  1. package/dist/cjs/{keys-cff24974.js → keys-5a2c9ed2.js} +4 -0
  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_10.cjs.entry.js +12 -16
  5. package/dist/cjs/sqm-big-stat_46.cjs.entry.js +22 -26
  6. package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
  7. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +14 -35
  8. package/dist/cjs/{sqm-partner-info-modal-view-540886b4.js → sqm-partner-info-modal-view-431ff976.js} +15 -10
  9. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +27 -9
  10. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +30 -9
  11. package/dist/cjs/sqm-stencilbook.cjs.entry.js +487 -310
  12. package/dist/cjs/{sqm-user-info-form-view-01bf2f41.js → sqm-user-info-form-view-f1127a60.js} +2 -2
  13. package/dist/cjs/sqm-widget-verification-controller.cjs.entry.js +1 -1
  14. package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +14 -4
  15. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +15 -10
  16. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +1 -30
  17. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +13 -26
  18. package/dist/collection/components/sqm-referral-table/ReferralTable.stories.js +1 -0
  19. package/dist/collection/components/sqm-referral-table/ReferralTableRewardsCell.stories.js +1 -0
  20. package/dist/collection/components/sqm-referral-table/TaxAndCashReferralTableRewardsCell.stories.js +209 -157
  21. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.js +30 -10
  22. package/dist/collection/components/sqm-rewards-table/RewardsTableCell.stories.js +1 -0
  23. package/dist/collection/components/sqm-rewards-table/TaxAndCashRewardsTableCell.stories.js +223 -148
  24. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.js +30 -10
  25. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +1 -0
  26. package/dist/collection/components/sqm-widget-verification/keys.js +2 -0
  27. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +0 -59
  28. package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +23 -10
  29. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +5 -4
  30. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +1 -30
  31. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +0 -1
  32. package/dist/collection/components/tax-and-cash/sqm-user-info-form/UserInfoFormView.stories.js +0 -1
  33. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +2 -2
  34. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +0 -25
  35. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +5 -6
  36. package/dist/esm/keys-d7c5c851.js +8 -0
  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_10.entry.js +12 -16
  40. package/dist/esm/sqm-big-stat_46.entry.js +22 -26
  41. package/dist/esm/sqm-code-verification.entry.js +1 -1
  42. package/dist/esm/sqm-email-verification_2.entry.js +14 -35
  43. package/dist/esm/{sqm-partner-info-modal-view-eec8606e.js → sqm-partner-info-modal-view-b3c33bc3.js} +15 -10
  44. package/dist/esm/sqm-referral-table_11.entry.js +27 -9
  45. package/dist/esm/sqm-rewards-table_9.entry.js +30 -9
  46. package/dist/esm/sqm-stencilbook.entry.js +487 -310
  47. package/dist/esm/{sqm-user-info-form-view-365cef98.js → sqm-user-info-form-view-e732dc4d.js} +2 -2
  48. package/dist/esm/sqm-widget-verification-controller.entry.js +1 -1
  49. package/dist/esm-es5/keys-d7c5c851.js +1 -0
  50. package/dist/esm-es5/loader.js +1 -1
  51. package/dist/esm-es5/mint-components.js +1 -1
  52. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  53. package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -1
  54. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  55. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  56. package/dist/esm-es5/sqm-partner-info-modal-view-b3c33bc3.js +1 -0
  57. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  58. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  59. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  60. package/dist/esm-es5/{sqm-user-info-form-view-365cef98.js → sqm-user-info-form-view-e732dc4d.js} +1 -1
  61. package/dist/esm-es5/sqm-widget-verification-controller.entry.js +1 -1
  62. package/dist/mint-components/mint-components.esm.js +1 -1
  63. package/dist/mint-components/p-162da001.system.entry.js +1 -0
  64. package/dist/mint-components/p-16416781.system.entry.js +1 -0
  65. package/dist/mint-components/p-1bff74c0.js +1 -0
  66. package/dist/mint-components/p-1c413a06.system.js +1 -1
  67. package/dist/mint-components/p-1f76371b.entry.js +9 -0
  68. package/dist/mint-components/{p-2d3a12f2.entry.js → p-36b91873.entry.js} +2 -2
  69. package/dist/mint-components/{p-038d0b8f.entry.js → p-440d3788.entry.js} +3 -3
  70. package/dist/mint-components/p-4c47beb0.system.js +1 -0
  71. package/dist/mint-components/{p-55d4caaa.entry.js → p-63102c04.entry.js} +7 -13
  72. package/dist/mint-components/p-6d15ce09.system.entry.js +1 -0
  73. package/dist/mint-components/{p-a0986077.system.entry.js → p-70a90ad8.system.entry.js} +1 -1
  74. package/dist/mint-components/p-837c4cf8.js +1 -0
  75. package/dist/mint-components/p-987a54e2.system.js +1 -0
  76. package/dist/mint-components/{p-88c9cc1b.entry.js → p-a67f2ccf.entry.js} +1 -1
  77. package/dist/mint-components/p-bdf858c3.entry.js +1 -0
  78. package/dist/mint-components/{p-9e43f1eb.entry.js → p-be5ecf62.entry.js} +3 -2
  79. package/dist/mint-components/p-d3ac8246.system.entry.js +1 -0
  80. package/dist/mint-components/{p-64041ee1.entry.js → p-d43c728e.entry.js} +22 -22
  81. package/dist/mint-components/{p-52eca331.js → p-dd5d8095.js} +1 -1
  82. package/dist/mint-components/{p-4d009702.system.entry.js → p-e83d08d7.system.entry.js} +1 -1
  83. package/dist/mint-components/{p-6194855b.system.entry.js → p-ecdbe09b.system.entry.js} +1 -1
  84. package/dist/mint-components/{p-a2db4345.system.js → p-ed3ae5ba.system.js} +1 -1
  85. package/dist/mint-components/{p-037c1a4f.system.entry.js → p-fe944f94.system.entry.js} +1 -1
  86. package/dist/types/components/sqm-partner-info-modal/PartnerInfoModal.stories.d.ts +1 -0
  87. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +0 -2
  88. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +0 -6
  89. package/dist/types/components/sqm-referral-table/TaxAndCashReferralTableRewardsCell.stories.d.ts +16 -0
  90. package/dist/types/components/sqm-rewards-table/TaxAndCashRewardsTableCell.stories.d.ts +18 -7
  91. package/dist/types/components/sqm-widget-verification/keys.d.ts +2 -0
  92. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +0 -10
  93. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +0 -5
  94. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +0 -1
  95. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.d.ts +0 -4
  96. package/dist/types/components.d.ts +0 -48
  97. package/dist/types/saasquatch.d.ts +1 -0
  98. package/docs/docs.docx +0 -0
  99. package/docs/raisins.json +1 -1
  100. package/grapesjs/grapesjs.js +1 -1
  101. package/package.json +1 -1
  102. package/dist/esm/keys-db1897ae.js +0 -6
  103. package/dist/esm-es5/keys-db1897ae.js +0 -1
  104. package/dist/esm-es5/sqm-partner-info-modal-view-eec8606e.js +0 -1
  105. package/dist/mint-components/p-39840341.js +0 -1
  106. package/dist/mint-components/p-55627a5c.entry.js +0 -1
  107. package/dist/mint-components/p-574a4089.system.js +0 -1
  108. package/dist/mint-components/p-7d5956ec.system.entry.js +0 -1
  109. package/dist/mint-components/p-91369a5f.js +0 -1
  110. package/dist/mint-components/p-b2a99637.system.js +0 -1
  111. package/dist/mint-components/p-d01949f7.system.entry.js +0 -1
  112. package/dist/mint-components/p-d273eb05.entry.js +0 -9
  113. package/dist/mint-components/p-e9e05970.system.entry.js +0 -1
  114. package/dist/mint-components/p-ea5eec69.system.entry.js +0 -1
@@ -31,7 +31,7 @@ const ShadowViewAddon = require('./ShadowViewAddon-2b3f51be.js');
31
31
  require('./sqm-portal-container-view-70a47420.js');
32
32
  const utils$1 = require('./utils-a8e0bd9b.js');
33
33
  const data = require('./data-6b5095f8.js');
34
- const keys = require('./keys-cff24974.js');
34
+ const keys = require('./keys-5a2c9ed2.js');
35
35
  require('./eventKeys-7af4df4d.js');
36
36
  const usePayoutStatus = require('./usePayoutStatus-cf050a03.js');
37
37
  const parseStates = require('./parseStates-d1effc19.js');
@@ -6419,7 +6419,6 @@ function getCurrentStep(user) {
6419
6419
  return "/1";
6420
6420
  }
6421
6421
  const { requiredTaxDocumentType, currentTaxDocument, withdrawalSettings, brandedSignup, payoutsAccount, } = user.impactConnection.publisher;
6422
- console.log(user.impactConnection, "publisher data in useTaxAndCash to determine step new new");
6423
6422
  if (user.impactConnection.connectionStatus === "STARTED") {
6424
6423
  return "/1";
6425
6424
  }
@@ -6651,11 +6650,6 @@ const TaxAndCashMonolith = class {
6651
6650
  * @uiGroup Step 1 Properties
6652
6651
  */
6653
6652
  this.step1_currency = "Currency";
6654
- /**
6655
- * @uiName Currency field help text
6656
- * @uiGroup Step 1 Properties
6657
- */
6658
- this.step1_currencyHelpText = "Choose your preferred payout currency";
6659
6653
  /**
6660
6654
  * Edit the property called terms and conditions text to change what's displayed for {termsAndConditionsLink}.
6661
6655
  * @uiName Terms and conditions checkbox
@@ -7975,18 +7969,20 @@ const USER_LOOKUP = index_module.dist.gql `
7975
7969
  }
7976
7970
  `;
7977
7971
  function useWidgetVerification() {
7978
- const userIdentity = index_module.J();
7979
- const [showCode, setShowCode] = index_module.In({
7972
+ const [showCode] = index_module.In({
7980
7973
  namespace: keys.SHOW_CODE_NAMESPACE,
7981
7974
  initialValue: false,
7982
7975
  });
7983
- const [email, setEmail] = index_module.In({
7984
- namespace: keys.VERIFICATION_EMAIL_NAMESPACE,
7985
- initialValue: userIdentity === null || userIdentity === void 0 ? void 0 : userIdentity.email,
7986
- });
7987
7976
  const setContext = index_module.En(keys.VERIFICATION_PARENT_NAMESPACE);
7988
7977
  const [loading, setLoading] = domContextHooks_module.useState(true);
7989
- const [showPartnerModal, setShowPartnerModal] = domContextHooks_module.useState(false);
7978
+ const [showPartnerModal, setShowPartnerModal] = index_module.In({
7979
+ namespace: keys.SHOW_PARTNER_MODAL_NAMESPACE,
7980
+ initialValue: false,
7981
+ });
7982
+ const [partnerCreated, setPartnerCreated] = index_module.In({
7983
+ namespace: keys.PARTNER_CREATED_NAMESPACE,
7984
+ initialValue: false,
7985
+ });
7990
7986
  const [fetch] = index_module.Xe(USER_LOOKUP);
7991
7987
  domContextHooks_module.useEffect(() => {
7992
7988
  const checkUser = async () => {
@@ -8021,9 +8017,20 @@ function useWidgetVerification() {
8021
8017
  };
8022
8018
  const onPartnerModalComplete = () => {
8023
8019
  setShowPartnerModal(false);
8020
+ setPartnerCreated(false);
8024
8021
  setContext(true);
8025
8022
  };
8026
- return { showCode, showPartnerModal, onVerification, onPartnerModalComplete, loading };
8023
+ domContextHooks_module.useEffect(() => {
8024
+ if (partnerCreated)
8025
+ onPartnerModalComplete();
8026
+ }, [partnerCreated]);
8027
+ return {
8028
+ showCode,
8029
+ showPartnerModal,
8030
+ onVerification,
8031
+ onPartnerModalComplete,
8032
+ loading,
8033
+ };
8027
8034
  }
8028
8035
 
8029
8036
  const style$3 = {
@@ -8066,16 +8073,6 @@ const WidgetVerification = class {
8066
8073
  * @uiGroup General Text
8067
8074
  */
8068
8075
  this.general_widgetHeaderWithPartnerCreation = "Let's get you ready for rewards";
8069
- /**
8070
- * @uiName General verify widget header text
8071
- * @uiGroup General Text
8072
- */
8073
- this.general_verifyEmailHeader = "Verify your email";
8074
- /**
8075
- * @uiName General verify widget description text
8076
- * @uiGroup General Text
8077
- */
8078
- this.general_verifyEmailDescription = "To get your cash paid out directly to your bank account, please complete your account setup";
8079
8076
  /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8080
8077
  EMAIL STEP PROPS
8081
8078
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -8260,7 +8257,6 @@ const WidgetVerification = class {
8260
8257
  if (props.showPartnerModal && ((_a = partnerState === null || partnerState === void 0 ? void 0 : partnerState.states) === null || _a === void 0 ? void 0 : _a.open) === false) {
8261
8258
  return index.h("div", null);
8262
8259
  }
8263
- // const generalText = this.getStepTextProps("general_");
8264
8260
  const partnerText = this.getStepTextProps("createPartnerStep_");
8265
8261
  const dialogLabel = this.general_widgetHeaderWithPartnerCreation;
8266
8262
  const renderStepContent = () => {
@@ -11,7 +11,7 @@ const utils = require('./utils-6847bc06.js');
11
11
  const JSS = require('./JSS-8503a151.js');
12
12
  const mixins = require('./mixins-4761d472.js');
13
13
  const sqmTextSpanView = require('./sqm-text-span-view-8a32dd8c.js');
14
- const keys = require('./keys-cff24974.js');
14
+ const keys = require('./keys-5a2c9ed2.js');
15
15
  const useVerificationEmail = require('./useVerificationEmail-994bc32f.js');
16
16
 
17
17
  const style = {
@@ -11,8 +11,8 @@ const utils = require('./utils-6847bc06.js');
11
11
  const JSS = require('./JSS-8503a151.js');
12
12
  const sqmTextSpanView = require('./sqm-text-span-view-8a32dd8c.js');
13
13
  const data = require('./data-6b5095f8.js');
14
- const sqmPartnerInfoModalView = require('./sqm-partner-info-modal-view-540886b4.js');
15
- const keys = require('./keys-cff24974.js');
14
+ const sqmPartnerInfoModalView = require('./sqm-partner-info-modal-view-431ff976.js');
15
+ const keys = require('./keys-5a2c9ed2.js');
16
16
  const eventKeys = require('./eventKeys-7af4df4d.js');
17
17
  const parseStates = require('./parseStates-d1effc19.js');
18
18
  const useVerificationEmail = require('./useVerificationEmail-994bc32f.js');
@@ -417,7 +417,6 @@ function useDemoWidgetEmailVerification(props) {
417
417
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
418
418
  }
419
419
 
420
- // new field under impactConnection:{ resolvedByEmail: boolean } - determines if connection came from managed identity
421
420
  const GET_USER_PARTNER_INFO = index_module.dist.gql `
422
421
  query getUserPartnerInfo {
423
422
  user: viewer {
@@ -514,30 +513,22 @@ const START_IMPACT_CONNECTION = index_module.dist.gql `
514
513
  }
515
514
  }
516
515
  `;
517
- const GET_BRAND_NAME = index_module.dist.gql `
518
- query getTenantSettings {
519
- tenantSettings {
520
- companyName
521
- }
522
- }
523
- `;
524
516
  function usePartnerInfoModal(props) {
525
- var _a, _b, _c, _d, _e, _f, _g;
517
+ var _a, _b, _c, _d, _e, _f;
526
518
  const locale = index_module.L();
527
- const setVerificationContext = index_module.En(keys.VERIFICATION_PARENT_NAMESPACE);
519
+ const setPartnerCreated = index_module.En(keys.PARTNER_CREATED_NAMESPACE);
528
520
  const { data: userData, loading: userLoading, refetch, } = index_module.wn(GET_USER_PARTNER_INFO, {});
529
521
  const user = userData === null || userData === void 0 ? void 0 : userData.user;
530
522
  const { data: currenciesData, loading: currenciesLoading } = index_module.wn(GET_CURRENCIES, { variables: { locale } });
531
523
  const { data: countriesData, loading: countriesLoading } = index_module.wn(GET_COUNTRIES, {});
532
- const { data: tenantSettingsData } = index_module.wn(GET_BRAND_NAME, {});
533
524
  const { data: financeNetworkData } = index_module.wn(data.GET_FINANCE_NETWORK_SETTINGS, {
534
525
  variables: { filter: {} },
535
526
  });
536
- const [startImpactConnection, { loading: connectLoading, errors: connectErrors },] = index_module.$e(START_IMPACT_CONNECTION);
527
+ const [startImpactConnection, { loading: connectLoading }] = index_module.$e(START_IMPACT_CONNECTION);
537
528
  const [allowBankingCollection, setAllowBankingCollection] = domContextHooks_module.useState(false);
538
- const [checkboxError, setCheckboxError] = domContextHooks_module.useState("");
539
529
  // No pre-filled country, use locale to determine countryCode instead
540
- const [countryCode, setCountryCode] = domContextHooks_module.useState(((_b = (_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.countryCode) || "");
530
+ const [countryCode, setCountryCode] = domContextHooks_module.useState(((_b = (_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.countryCode) ||
531
+ locale.replace(/^.*_/, ""));
541
532
  const [currency, setCurrency] = domContextHooks_module.useState(((_d = (_c = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _c === void 0 ? void 0 : _c.publisher) === null || _d === void 0 ? void 0 : _d.currency) || "");
542
533
  const countries = ((_e = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _e === void 0 ? void 0 : _e.data) || [];
543
534
  // copied from useTaxAndCash for displaying currencies based on country - could be in helper?
@@ -611,13 +602,11 @@ function usePartnerInfoModal(props) {
611
602
  function onCheckboxChange(e) {
612
603
  const checked = e.target.checked;
613
604
  setAllowBankingCollection(checked);
614
- if (checked)
615
- setCheckboxError("");
616
605
  }
617
606
  async function onSubmit() {
618
607
  var _a, _b;
619
608
  if (!allowBankingCollection) {
620
- setCheckboxError(props.missingFieldsErrorText);
609
+ setError(props.missingFieldsErrorText);
621
610
  return;
622
611
  }
623
612
  if (!countryCode || !currency) {
@@ -625,7 +614,10 @@ function usePartnerInfoModal(props) {
625
614
  return;
626
615
  }
627
616
  setError("");
628
- setCheckboxError("");
617
+ if (!user) {
618
+ setError(props.networkErrorText);
619
+ return;
620
+ }
629
621
  try {
630
622
  const vars = {
631
623
  user: {
@@ -634,8 +626,6 @@ function usePartnerInfoModal(props) {
634
626
  },
635
627
  firstName: user.firstName,
636
628
  lastName: user.lastName,
637
- // phoneNumber: null,
638
- // phoneNumberCountryCode: null,
639
629
  countryCode,
640
630
  currency,
641
631
  };
@@ -646,7 +636,6 @@ function usePartnerInfoModal(props) {
646
636
  }
647
637
  const connectionResult = result
648
638
  .startImpactConnection;
649
- console.log(result, connectionResult, "result and connectionResult from creating partner from modal");
650
639
  if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
651
640
  const validationMsg = (_b = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors) === null || _b === void 0 ? void 0 : _b.map((e) => e.message).join(". ");
652
641
  setError(validationMsg || props.networkErrorText);
@@ -655,8 +644,8 @@ function usePartnerInfoModal(props) {
655
644
  }
656
645
  window.dispatchEvent(new Event(eventKeys.TAX_FORM_UPDATED_EVENT_KEY));
657
646
  await refetch();
647
+ setPartnerCreated === null || setPartnerCreated === void 0 ? void 0 : setPartnerCreated(true);
658
648
  setSuccess(true);
659
- setVerificationContext(true);
660
649
  }
661
650
  catch (e) {
662
651
  console.error("Partner creation error:", e);
@@ -671,16 +660,14 @@ function usePartnerInfoModal(props) {
671
660
  open: showModal,
672
661
  loading: userLoading || countriesLoading || currenciesLoading,
673
662
  submitting: connectLoading,
674
- isExistingPartner: impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.publisher,
663
+ isExistingPartner: !!(impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.publisher),
675
664
  countryCode,
676
665
  currency,
677
666
  error,
678
667
  success,
679
- brandName: ((_g = tenantSettingsData === null || tenantSettingsData === void 0 ? void 0 : tenantSettingsData.tenantSettings) === null || _g === void 0 ? void 0 : _g.companyName) || "",
680
668
  filteredCountries: filteredCountries || [],
681
669
  filteredCurrencies: filteredCurrencies || [],
682
670
  allowBankingCollection,
683
- checkboxError,
684
671
  disabled: userLoading || connectLoading,
685
672
  },
686
673
  callbacks: {
@@ -699,12 +686,6 @@ function usePartnerInfoModal(props) {
699
686
  const PartnerInfoModal = class {
700
687
  constructor(hostRef) {
701
688
  index.registerInstance(this, hostRef);
702
- /**
703
- * Brand name shown in the modal header
704
- *
705
- * @uiName Brand name
706
- */
707
- this.brandName = "";
708
689
  /**
709
690
  * Header text when user has no existing partner
710
691
  *
@@ -828,7 +809,6 @@ function useDemoPartnerInfoModal(props) {
828
809
  // @ts-ignore
829
810
  return cjs.cjs({
830
811
  states: {
831
- brandName: "Test Brand",
832
812
  open: false,
833
813
  loading: false,
834
814
  submitting: false,
@@ -840,7 +820,6 @@ function useDemoPartnerInfoModal(props) {
840
820
  filteredCountries: [],
841
821
  filteredCurrencies: [],
842
822
  allowBankingCollection,
843
- checkboxError: "",
844
823
  disabled: false,
845
824
  },
846
825
  callbacks: {
@@ -31,8 +31,6 @@ const style = {
31
31
  marginTop: "var(--sl-spacing-large)",
32
32
  },
33
33
  ErrorMessage: {
34
- color: "var(--sqm-danger-color-text, #d32f2f)",
35
- fontSize: "var(--sl-font-size-small)",
36
34
  marginTop: "var(--sl-spacing-x-small)",
37
35
  },
38
36
  SearchInput: {
@@ -59,6 +57,11 @@ const style = {
59
57
  justifyContent: "flex-start",
60
58
  flexDirection: "column",
61
59
  },
60
+ Checkbox: {
61
+ "&::part(label)": {
62
+ fontSize: "var(--sl-font-size-small)",
63
+ },
64
+ },
62
65
  SubmitButton: {
63
66
  width: "100%",
64
67
  marginTop: "var(--sl-spacing-large)",
@@ -87,22 +90,24 @@ function PartnerInfoModalContentView(props) {
87
90
  styleString),
88
91
  index.h("div", { class: sheet.classes.FormFields },
89
92
  description,
90
- index.h("sl-select", { exportparts: "label: input-label, base: input-base, menu: select-menu", label: text.countryLabel, value: states.countryCode, disabled: states.submitting || !!states.isExistingPartner, required: true, hoist: true, "onSl-select": callbacks.onCountryChange },
93
+ index.h("sl-select", { exportparts: "label: input-label, base: input-base, menu: select-menu", label: text.countryLabel, value: states.countryCode, disabled: states.submitting ||
94
+ (!!states.countryCode && states.isExistingPartner), required: true, hoist: true, "onSl-select": callbacks.onCountryChange },
91
95
  index.h("sl-input", { class: sheet.classes.SearchInput, placeholder: text.searchCountryPlaceholder, onKeyDown: (e) => e.stopPropagation(), "onSl-input": (e) => {
92
96
  var _a;
93
97
  callbacks.setCountrySearch((_a = e.target) === null || _a === void 0 ? void 0 : _a.value);
94
98
  } }),
95
99
  index.h("div", { class: sheet.classes.SelectMenu }, (_a = states.filteredCountries) === null || _a === void 0 ? void 0 : _a.map((c) => (index.h("sl-menu-item", { value: c.countryCode }, c.displayName))))),
96
- index.h("sl-select", { exportparts: "label: input-label, base: input-base", label: text.currencyLabel, value: states.currency, disabled: states.submitting || !!states.isExistingPartner, required: true, hoist: true, "onSl-select": callbacks.onCurrencyChange },
97
- index.h("sl-input", { class: sheet.classes.SearchInput, placeholder: text.searchCurrencyPlaceholder, onKeyDown: (e) => e.stopPropagation(), "onSl-input": (e) => { var _a; return callbacks.setCurrencySearch((_a = e.target) === null || _a === void 0 ? void 0 : _a.value); } }), (_b = states.filteredCurrencies) === null || _b === void 0 ? void 0 :
98
- _b.map((c) => (index.h("sl-menu-item", { value: c.currencyCode },
100
+ index.h("sl-select", { exportparts: "label: input-label, base: input-base", label: text.currencyLabel, value: states.currency, disabled: states.submitting || !!states.currency, required: true, hoist: true, "onSl-select": callbacks.onCurrencyChange },
101
+ index.h("sl-input", { class: sheet.classes.SearchInput, placeholder: text.searchCurrencyPlaceholder, onKeyDown: (e) => e.stopPropagation(), "onSl-input": (e) => { var _a; return callbacks.setCurrencySearch((_a = e.target) === null || _a === void 0 ? void 0 : _a.value); } }),
102
+ index.h("div", { class: sheet.classes.SelectMenu }, (_b = states.filteredCurrencies) === null || _b === void 0 ? void 0 : _b.map((c) => (index.h("sl-menu-item", { value: c.currencyCode },
99
103
  c.currencyCode,
100
104
  " - ",
101
- c.displayName)))),
105
+ c.displayName))))),
102
106
  index.h("div", { class: sheet.classes.CheckboxWrapper },
103
- index.h("sl-checkbox", { checked: states.allowBankingCollection === true, "onSl-change": callbacks.onCheckboxChange, disabled: states.submitting, required: true, value: states.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
104
- states.checkboxError && (index.h("p", { class: sheet.classes.ErrorMessage }, states.checkboxError)))),
105
- states.error && index.h("p", { class: sheet.classes.ErrorMessage }, states.error),
107
+ index.h("sl-checkbox", { class: sheet.classes.Checkbox, checked: states.allowBankingCollection === true, "onSl-change": callbacks.onCheckboxChange, disabled: states.submitting, required: true, value: states.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText))),
108
+ states.error && (index.h("div", { class: sheet.classes.ErrorMessage },
109
+ index.h("sqm-form-message", { class: sheet.classes.ErrorMessage, type: "error" },
110
+ index.h("p", { part: "alert-description" }, states.error)))),
106
111
  index.h("sl-button", { slot: "footer", type: "primary", loading: states.submitting, disabled: states.submitting ||
107
112
  !states.countryCode ||
108
113
  !states.currency ||
@@ -428,7 +428,7 @@ const ReferralTableRewardsCell = class {
428
428
  constructor(hostRef) {
429
429
  index.registerInstance(this, hostRef);
430
430
  this.statusText = "{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";
431
- this.statusLongText = "{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";
431
+ this.statusLongText = "{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";
432
432
  this.pendingForText = "{status} for {date}";
433
433
  this.locale = "en";
434
434
  }
@@ -535,7 +535,7 @@ const ReferralTableRewardsCell = class {
535
535
  }
536
536
  };
537
537
  const getState = (reward, taxConnection) => {
538
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
538
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
539
539
  const possibleStates = [
540
540
  "REDEEMED",
541
541
  "CANCELLED",
@@ -559,12 +559,21 @@ const ReferralTableRewardsCell = class {
559
559
  if (((_f = (_e = reward.referral) === null || _e === void 0 ? void 0 : _e.fraudData) === null || _f === void 0 ? void 0 : _f.moderationStatus) === "DENIED")
560
560
  return "DENIED";
561
561
  }
562
- const partnerFundsStatus = (_g = reward.partnerFundsTransfer) === null || _g === void 0 ? void 0 : _g.status;
562
+ const isCashReward = reward.rewardedCash;
563
+ if (isCashReward) {
564
+ if (!((_g = this.taxConnection) === null || _g === void 0 ? void 0 : _g.connected) ||
565
+ (((_h = this.taxConnection) === null || _h === void 0 ? void 0 : _h.connected) &&
566
+ !((_k = (_j = this.taxConnection) === null || _j === void 0 ? void 0 : _j.publisher) === null || _k === void 0 ? void 0 : _k.withdrawalSettings)))
567
+ return "PENDING_PARTNER_CREATION";
568
+ }
569
+ const partnerFundsStatus = (_l = reward.partnerFundsTransfer) === null || _l === void 0 ? void 0 : _l.status;
563
570
  if (reward.partnerFundsTransfer) {
564
571
  if (partnerFundsStatus === "REVERSED")
565
572
  return "PAYOUT_CANCELLED";
566
573
  if (partnerFundsStatus === "OVERDUE")
567
574
  return "PAYOUT_FAILED";
575
+ }
576
+ if (reward.partnerFundsTransfer) {
568
577
  if (reward.partnerFundsTransfer.dateScheduled &&
569
578
  reward.partnerFundsTransfer.dateScheduled > Date.now()) {
570
579
  return "PROCESSING";
@@ -577,13 +586,13 @@ const ReferralTableRewardsCell = class {
577
586
  partnerFundsStatus !== "REVERSED"))
578
587
  return "PAYOUT_APPROVED";
579
588
  }
580
- if ((_h = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _h === void 0 ? void 0 : _h.includes("US_TAX")) {
589
+ if ((_m = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _m === void 0 ? void 0 : _m.includes("US_TAX")) {
581
590
  if (!(taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.taxHandlingEnabled))
582
591
  return "PENDING";
583
592
  if (!(taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.connected))
584
593
  return "PENDING_PARTNER_CREATION";
585
- if ((_j = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _j === void 0 ? void 0 : _j.requiredTaxDocumentType) {
586
- if (!((_k = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _k === void 0 ? void 0 : _k.currentTaxDocument))
594
+ if ((_o = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _o === void 0 ? void 0 : _o.requiredTaxDocumentType) {
595
+ if (!((_p = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _p === void 0 ? void 0 : _p.currentTaxDocument))
587
596
  return "PENDING_TAX_SUBMISSION";
588
597
  const status = taxConnection.publisher.currentTaxDocument.status;
589
598
  if (status === "INACTIVE" ||
@@ -593,10 +602,19 @@ const ReferralTableRewardsCell = class {
593
602
  if (status === "NOT_VERIFIED")
594
603
  return "PENDING_TAX_REVIEW";
595
604
  }
596
- if (!((_l = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _l === void 0 ? void 0 : _l.withdrawalSettings))
605
+ if (!((_q = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _q === void 0 ? void 0 : _q.withdrawalSettings))
606
+ return "PENDING_PARTNER_CREATION";
607
+ }
608
+ // Fallback: when rewardStatus() forced PENDING because the user is
609
+ // connected but hasn't set up withdrawal settings (no pendingReasons
610
+ // were returned by the API, e.g. for credit rewards with a PFT).
611
+ if (reward.rewardedCash) {
612
+ if (!(taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.connected) ||
613
+ ((taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.connected) &&
614
+ !((_r = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _r === void 0 ? void 0 : _r.withdrawalSettings)))
597
615
  return "PENDING_PARTNER_CREATION";
598
616
  }
599
- if ((_m = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _m === void 0 ? void 0 : _m.includes("MISSING_PAYOUT_CONFIGURATION")) {
617
+ if ((_s = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _s === void 0 ? void 0 : _s.includes("MISSING_PAYOUT_CONFIGURATION")) {
600
618
  return "PENDING_PARTNER_CREATION";
601
619
  }
602
620
  if (reward.statuses.length === 1)
@@ -656,7 +674,7 @@ const ReferralTableRewardsCell = class {
656
674
  date: getTimeDiff(reward.dateScheduledFor),
657
675
  }))) : (index.h("sl-badge", { class: getBadgeCSSClass(slBadgeType), type: slBadgeType, pill: true }, badgeText)), reward.dateExpires && state === "AVAILABLE" && (index.h("sl-badge", { class: getBadgeCSSClass(slBadgeType), type: "info", pill: true }, this.expiringText, ` ${getTimeDiff(reward.dateExpires)}`)))), index.h("div", null, state === "PENDING_REVIEW" && ((_c = reward.referral) === null || _c === void 0 ? void 0 : _c.dateModerated) && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText, " ", index.h("span", { class: sheet.classes.BoldText, part: "sqm-cell-value" }, luxon.luxon.DateTime.fromMillis(reward.referral.dateModerated)
658
676
  .setLocale(utils.luxonLocale(this.locale))
659
- .toLocaleString(luxon.luxon.DateTime.DATE_MED))))), state === "PAYOUT_APPROVED" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PROCESSING" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PAYOUT_FAILED" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PAYOUT_CANCELLED" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PENDING_TAX_REVIEW" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PENDING_NEW_TAX_FORM" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PENDING_TAX_SUBMISSION" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PENDING_PARTNER_CREATION" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "DENIED" && ((_d = reward.referral) === null || _d === void 0 ? void 0 : _d.dateModerated) && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText, " ", index.h("span", { class: sheet.classes.BoldText, part: "sqm-cell-value" }, luxon.luxon.DateTime.fromMillis(reward.referral.dateModerated)
677
+ .toLocaleString(luxon.luxon.DateTime.DATE_MED))))), state === "" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PROCESSING" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PAYOUT_APPROVED" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PAYOUT_FAILED" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PAYOUT_CANCELLED" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PENDING_TAX_REVIEW" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PENDING_NEW_TAX_FORM" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PENDING_TAX_SUBMISSION" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "PENDING_PARTNER_CREATION" && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText))), state === "DENIED" && ((_d = reward.referral) === null || _d === void 0 ? void 0 : _d.dateModerated) && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, statusText, " ", index.h("span", { class: sheet.classes.BoldText, part: "sqm-cell-value" }, luxon.luxon.DateTime.fromMillis(reward.referral.dateModerated)
660
678
  .setLocale(utils.luxonLocale(this.locale))
661
679
  .toLocaleString(luxon.luxon.DateTime.DATE_MED)), ".", this.deniedHelpText ? ` ${this.deniedHelpText}` : ``))), reward.dateGiven && (index.h("div", null, index.h(sqmTextSpanView.TextSpanView, { type: "p" }, this.rewardReceivedText, " ", index.h("span", { class: sheet.classes.BoldText, part: "sqm-cell-value" }, luxon.luxon.DateTime.fromMillis(reward.dateGiven)
662
680
  .setLocale(utils.luxonLocale(this.locale))
@@ -60,6 +60,7 @@ const GET_REWARDS = index_module.dist.gql `
60
60
  fuelTankCode
61
61
  fuelTankType
62
62
  currency
63
+ rewardedCash
63
64
  prettyValue(locale: $locale)
64
65
  prettyValueNumber: prettyValue(
65
66
  formatType: NUMBER_FORMATTED
@@ -854,7 +855,7 @@ const RewardTableStatusCell = class {
854
855
  this.pendingTaxReview = "Awaiting tax form review.";
855
856
  this.pendingNewTaxForm = "Invalid tax form. Submit a new form to receive your rewards.";
856
857
  this.pendingTaxSubmission = "Submit your tax documents to receive your rewards.";
857
- this.pendingPartnerCreation = "Complete your tax and cash payout setup to receive your rewards.";
858
+ this.pendingPartnerCreation = "Complete your cash payout setup to receive your rewards.";
858
859
  this.pendingScheduled = "Until";
859
860
  this.pendingUnhandled = "Fulfillment error";
860
861
  this.pendingReviewText = "Awaiting review";
@@ -865,16 +866,26 @@ const RewardTableStatusCell = class {
865
866
  this.payoutProcessing = "Processing until {date}. Payout is then scheduled based on your settings.";
866
867
  }
867
868
  rewardStatus(reward) {
868
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
869
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
869
870
  const hasExpired = (_a = reward.statuses) === null || _a === void 0 ? void 0 : _a.includes("EXPIRED");
870
871
  const isPending = (_b = reward.statuses) === null || _b === void 0 ? void 0 : _b.includes("PENDING");
871
872
  const integrationOrFueltankReward = reward.type === "INTEGRATION" || reward.type === "FUELTANK";
873
+ // AL: TODO Scott said we should change this to use pendingReasons instead of fraudStatus - probably dont want to change this for backwards compatibility
872
874
  const fraudStatus = (_d = (_c = reward.referral) === null || _c === void 0 ? void 0 : _c.fraudData) === null || _d === void 0 ? void 0 : _d.moderationStatus;
873
875
  if (fraudStatus === "DENIED")
874
876
  return "DENIED";
875
877
  if (fraudStatus === "PENDING")
876
878
  return "PENDING_REVIEW";
877
- const partnerTransferStatus = (_e = reward.partnerFundsTransfer) === null || _e === void 0 ? void 0 : _e.status;
879
+ const isCashReward = reward.rewardedCash;
880
+ console.log(this.reward, "reward in status cell");
881
+ // pft can now be created before withdrawal settings exist
882
+ if (isCashReward) {
883
+ if (!((_e = this.taxConnection) === null || _e === void 0 ? void 0 : _e.connected) ||
884
+ (((_f = this.taxConnection) === null || _f === void 0 ? void 0 : _f.connected) &&
885
+ !((_h = (_g = this.taxConnection) === null || _g === void 0 ? void 0 : _g.publisher) === null || _h === void 0 ? void 0 : _h.withdrawalSettings)))
886
+ return "PENDING";
887
+ }
888
+ const partnerTransferStatus = (_j = reward.partnerFundsTransfer) === null || _j === void 0 ? void 0 : _j.status;
878
889
  if (reward.partnerFundsTransfer) {
879
890
  if (partnerTransferStatus === "REVERSED")
880
891
  return "PAYOUT_CANCELLED";
@@ -899,24 +910,24 @@ const RewardTableStatusCell = class {
899
910
  if (isPending)
900
911
  return "PENDING";
901
912
  if (reward.type === "CREDIT") {
902
- return ((_f = reward.statuses) === null || _f === void 0 ? void 0 : _f.includes("REDEEMED")) ? "REDEEMED" : "AVAILABLE";
913
+ return ((_k = reward.statuses) === null || _k === void 0 ? void 0 : _k.includes("REDEEMED")) ? "REDEEMED" : "AVAILABLE";
903
914
  }
904
- if (reward.type === "PCT_DISCOUNT" && ((_g = reward.statuses) === null || _g === void 0 ? void 0 : _g.includes("AVAILABLE"))) {
915
+ if (reward.type === "PCT_DISCOUNT" && ((_l = reward.statuses) === null || _l === void 0 ? void 0 : _l.includes("AVAILABLE"))) {
905
916
  return "AVAILABLE";
906
917
  }
907
918
  if (integrationOrFueltankReward && isPending) {
908
919
  return "PENDING";
909
920
  }
910
- if (integrationOrFueltankReward && ((_h = reward.statuses) === null || _h === void 0 ? void 0 : _h.includes("CANCELLED"))) {
921
+ if (integrationOrFueltankReward && ((_m = reward.statuses) === null || _m === void 0 ? void 0 : _m.includes("CANCELLED"))) {
911
922
  return "CANCELLED";
912
923
  }
913
- if (integrationOrFueltankReward && ((_j = reward.statuses) === null || _j === void 0 ? void 0 : _j.includes("AVAILABLE"))) {
924
+ if (integrationOrFueltankReward && ((_o = reward.statuses) === null || _o === void 0 ? void 0 : _o.includes("AVAILABLE"))) {
914
925
  return "AVAILABLE";
915
926
  }
916
927
  return "";
917
928
  }
918
929
  getTaxPendingReasons(reward, taxConnection) {
919
- var _a, _b, _c, _d, _e;
930
+ var _a, _b, _c, _d, _e, _f;
920
931
  if ((_a = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _a === void 0 ? void 0 : _a.includes("US_TAX")) {
921
932
  if (!(taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.taxHandlingEnabled))
922
933
  return this.pendingUsTax;
@@ -931,12 +942,22 @@ const RewardTableStatusCell = class {
931
942
  if (status === "NOT_VERIFIED")
932
943
  return this.pendingTaxReview;
933
944
  }
934
- if (!((_d = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _d === void 0 ? void 0 : _d.withdrawalSettings))
945
+ if (!((_d = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _d === void 0 ? void 0 : _d.withdrawalSettings)) {
935
946
  return this.pendingPartnerCreation;
947
+ }
936
948
  }
937
949
  if ((_e = reward === null || reward === void 0 ? void 0 : reward.pendingReasons) === null || _e === void 0 ? void 0 : _e.includes("MISSING_PAYOUT_CONFIGURATION")) {
938
950
  return this.pendingPartnerCreation;
939
951
  }
952
+ // Fallback: when rewardStatus() forced PENDING because the user is
953
+ // connected but hasn't set up withdrawal settings (no pendingReasons
954
+ // were returned by the API, e.g. for credit rewards with a PFT).
955
+ if (reward.rewardedCash) {
956
+ if (!(taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.connected) ||
957
+ ((taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.connected) &&
958
+ !((_f = taxConnection === null || taxConnection === void 0 ? void 0 : taxConnection.publisher) === null || _f === void 0 ? void 0 : _f.withdrawalSettings)))
959
+ return this.pendingPartnerCreation;
960
+ }
940
961
  return "";
941
962
  }
942
963
  getBadgeType(rewardStatus) {