@saasquatch/mint-components 1.12.0-1 → 1.12.0-11

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 (159) hide show
  1. package/dist/cjs/{ShadowViewAddon-88821c64.js → ShadowViewAddon-040cffad.js} +6 -3
  2. package/dist/cjs/extractProps-fd93ba62.js +21 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/mint-components.cjs.js +1 -1
  5. package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +92 -78
  6. package/dist/cjs/sqm-big-stat_39.cjs.entry.js +128 -63
  7. package/dist/cjs/sqm-code-verification.cjs.entry.js +67 -77
  8. package/dist/cjs/sqm-email-verification.cjs.entry.js +158 -12
  9. package/dist/cjs/{sqm-invoice-table-view-ce9a34ac.js → sqm-invoice-table-view-c58966f8.js} +79 -0
  10. package/dist/cjs/sqm-stencilbook.cjs.entry.js +56 -14
  11. package/dist/cjs/sqm-widget-verification-internal.cjs.entry.js +81 -11
  12. package/dist/cjs/sqm-widget-verification.cjs.entry.js +102 -19
  13. package/dist/cjs/usePayoutStatus-b9fb7399.js +70 -0
  14. package/dist/cjs/useVerificationEmail-6aacdb71.js +169 -0
  15. package/dist/collection/collection-manifest.json +1 -1
  16. package/dist/collection/components/sqm-big-stat/useBigStat.js +6 -3
  17. package/dist/collection/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.js +1 -2
  18. package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll-view.js +1 -0
  19. package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll.js +16 -3
  20. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.js +9 -2
  21. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.js +20 -10
  22. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.js +34 -63
  23. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.js +38 -29
  24. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.js +23 -3
  25. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +17 -4
  26. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.js +65 -11
  27. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.js +77 -21
  28. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-internal.js +327 -15
  29. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +447 -22
  30. package/dist/collection/components/sqm-widget-verification/useVerificationEmail.js +165 -0
  31. package/dist/collection/components/tax-and-cash/BankingForm.stories.js +1 -0
  32. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +78 -0
  33. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +2 -1
  34. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +7 -0
  35. package/dist/collection/components/tax-and-cash/sqm-docusign-form/docusign-iframe/DocusignIframe.js +0 -1
  36. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +10 -0
  37. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +72 -13
  38. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +146 -9
  39. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +30 -15
  40. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/data.js +6 -0
  41. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +8 -8
  42. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +2 -2
  43. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +22 -16
  44. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +99 -88
  45. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +8 -1
  46. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +1 -6
  47. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +16 -11
  48. package/dist/esm/{ShadowViewAddon-65c8679e.js → ShadowViewAddon-69b61037.js} +6 -3
  49. package/dist/esm/extractProps-ae1afbb3.js +19 -0
  50. package/dist/esm/{keys-a1496e39.js → keys-db1897ae.js} +1 -1
  51. package/dist/esm/loader.js +1 -1
  52. package/dist/esm/mint-components.js +1 -1
  53. package/dist/esm/sqm-banking-info-form_16.entry.js +92 -78
  54. package/dist/esm/sqm-big-stat_39.entry.js +127 -62
  55. package/dist/esm/sqm-code-verification.entry.js +69 -79
  56. package/dist/esm/sqm-email-verification.entry.js +159 -13
  57. package/dist/esm/{sqm-invoice-table-view-08c03ba7.js → sqm-invoice-table-view-d1cfdaf4.js} +79 -0
  58. package/dist/esm/sqm-stencilbook.entry.js +56 -14
  59. package/dist/esm/sqm-widget-verification-internal.entry.js +84 -14
  60. package/dist/esm/sqm-widget-verification.entry.js +104 -21
  61. package/dist/esm/usePayoutStatus-1a635054.js +67 -0
  62. package/dist/esm/useVerificationEmail-c32696ba.js +167 -0
  63. package/dist/esm-es5/ShadowViewAddon-69b61037.js +1 -0
  64. package/dist/esm-es5/extractProps-ae1afbb3.js +1 -0
  65. package/dist/esm-es5/{keys-a1496e39.js → keys-db1897ae.js} +1 -1
  66. package/dist/esm-es5/loader.js +1 -1
  67. package/dist/esm-es5/mint-components.js +1 -1
  68. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
  69. package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -1
  70. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  71. package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
  72. package/dist/esm-es5/sqm-invoice-table-view-d1cfdaf4.js +1 -0
  73. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  74. package/dist/esm-es5/sqm-widget-verification-internal.entry.js +1 -1
  75. package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
  76. package/dist/esm-es5/usePayoutStatus-1a635054.js +1 -0
  77. package/dist/esm-es5/useVerificationEmail-c32696ba.js +1 -0
  78. package/dist/mint-components/mint-components.esm.js +1 -1
  79. package/dist/mint-components/p-0e45bc0e.system.entry.js +1 -0
  80. package/dist/mint-components/p-1712a9fd.entry.js +11 -0
  81. package/dist/mint-components/p-1e616d45.system.js +1 -0
  82. package/dist/mint-components/{p-721a89c6.entry.js → p-24092973.entry.js} +2 -2
  83. package/dist/mint-components/p-26468242.js +1 -0
  84. package/dist/mint-components/p-282a7d85.entry.js +195 -0
  85. package/dist/mint-components/p-331d060e.entry.js +223 -0
  86. package/dist/mint-components/p-39840341.js +1 -0
  87. package/dist/mint-components/p-4364001c.entry.js +12 -0
  88. package/dist/mint-components/p-4bd7a472.js +1 -0
  89. package/dist/mint-components/p-517224ef.js +19 -0
  90. package/dist/mint-components/p-5f766d09.entry.js +25 -0
  91. package/dist/mint-components/p-8300d8c8.system.js +1 -0
  92. package/dist/mint-components/p-8bddb468.system.entry.js +1 -0
  93. package/dist/mint-components/p-9596e97c.system.entry.js +1 -0
  94. package/dist/mint-components/p-974070c4.system.entry.js +1 -0
  95. package/dist/mint-components/{p-b651706a.js → p-9eae245f.js} +6 -3
  96. package/dist/mint-components/p-a8645c1b.system.js +1 -0
  97. package/dist/mint-components/p-aabab609.system.entry.js +1 -0
  98. package/dist/mint-components/p-b2a99637.system.js +1 -0
  99. package/dist/mint-components/{p-66a04cca.system.entry.js → p-b62faaa5.system.entry.js} +1 -1
  100. package/dist/mint-components/p-c510fb88.entry.js +1 -0
  101. package/dist/mint-components/p-ca809fdd.system.js +1 -1
  102. package/dist/mint-components/p-d7806f31.js +48 -0
  103. package/dist/mint-components/p-e01ac27c.system.js +1 -0
  104. package/dist/mint-components/p-e45a8501.system.entry.js +1 -0
  105. package/dist/mint-components/p-e990dc21.system.js +1 -0
  106. package/dist/types/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.d.ts +0 -1
  107. package/dist/types/components/sqm-payout-button-scroll/sqm-payout-button-scroll.d.ts +7 -0
  108. package/dist/types/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.d.ts +1 -0
  109. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.d.ts +3 -3
  110. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.d.ts +4 -10
  111. package/dist/types/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.d.ts +2 -0
  112. package/dist/types/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.d.ts +4 -1
  113. package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.d.ts +6 -1
  114. package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.d.ts +10 -2
  115. package/dist/types/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.d.ts +3 -2
  116. package/dist/types/components/sqm-widget-verification/sqm-widget-verification-internal.d.ts +15 -0
  117. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +79 -0
  118. package/dist/types/components/sqm-widget-verification/useVerificationEmail.d.ts +14 -0
  119. package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +1 -0
  120. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +1 -0
  121. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +2 -0
  122. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +12 -0
  123. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +41 -0
  124. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +12 -0
  125. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/data.d.ts +6 -0
  126. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +2 -2
  127. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +10 -3
  128. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +19 -18
  129. package/dist/types/components.d.ts +366 -92
  130. package/docs/docs.docx +0 -0
  131. package/docs/raisins.json +1 -1
  132. package/grapesjs/grapesjs.js +1 -1
  133. package/package.json +1 -1
  134. package/dist/cjs/useEmailVerification-30a1c7f6.js +0 -75
  135. package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +0 -3
  136. package/dist/esm/useEmailVerification-7135732c.js +0 -72
  137. package/dist/esm-es5/ShadowViewAddon-65c8679e.js +0 -1
  138. package/dist/esm-es5/sqm-invoice-table-view-08c03ba7.js +0 -1
  139. package/dist/esm-es5/useEmailVerification-7135732c.js +0 -1
  140. package/dist/mint-components/p-117b4705.system.js +0 -1
  141. package/dist/mint-components/p-1bd0cda8.system.entry.js +0 -1
  142. package/dist/mint-components/p-1ee62d9f.system.entry.js +0 -1
  143. package/dist/mint-components/p-1f9a9b70.system.entry.js +0 -1
  144. package/dist/mint-components/p-23fdd44e.entry.js +0 -1
  145. package/dist/mint-components/p-36f7caec.system.entry.js +0 -1
  146. package/dist/mint-components/p-39397731.entry.js +0 -1
  147. package/dist/mint-components/p-39af4acd.entry.js +0 -240
  148. package/dist/mint-components/p-4c9b6fbe.system.js +0 -1
  149. package/dist/mint-components/p-65e2c043.system.js +0 -1
  150. package/dist/mint-components/p-663303b7.entry.js +0 -8
  151. package/dist/mint-components/p-6cae44d7.js +0 -1
  152. package/dist/mint-components/p-7f5c7bf7.system.entry.js +0 -1
  153. package/dist/mint-components/p-8a337864.js +0 -7
  154. package/dist/mint-components/p-a02afa72.system.js +0 -1
  155. package/dist/mint-components/p-a5a9aa07.entry.js +0 -189
  156. package/dist/mint-components/p-c763c0b2.js +0 -1
  157. package/dist/mint-components/p-e93e5740.entry.js +0 -1
  158. package/dist/mint-components/p-e9ca48fc.system.entry.js +0 -1
  159. package/dist/types/components/sqm-widget-verification/useWidgetVerification.d.ts +0 -1
@@ -24,9 +24,9 @@ import { P as PortalProfileView } from './sqm-portal-profile-view-15ddbec8.js';
24
24
  import './utilities-443732be.js';
25
25
  import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-79a85e02.js';
26
26
  import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-d7ea2c56.js';
27
- import { S as ShareButtonView, L as LeaderboardView, C as CopyTextView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalLoginView, f as PortalRegisterView, T as TaskCardView, g as ProgressBarView, h as PoweredByImg$1, i as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, j as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, k as RewardExchangeView, r as rewardExchangeCustomErrorMsg, l as rewardExchangeLongText, m as rewardExchangeSelected, n as chooseAmountFixed, o as chooseAmountFixedNoDescription, p as chooseAmountVariable, q as chooseAmountVariableNoDescription, s as chooseAmountVariableDisabled, t as chooseAmountVariableUnavailable, v as confirmFixed, w as confirmVariable, x as redemptionError, y as queryError, z as success, A as successVariable, F as loading, G as empty$1, J as rewardExchange, K as CardFeedView, M as CouponCodeView, O as ProgressBar$2, Q as autoColorScaleCss, U as ShadowViewAddon } from './ShadowViewAddon-65c8679e.js';
27
+ import { S as ShareButtonView, L as LeaderboardView, C as CopyTextView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalLoginView, f as PortalRegisterView, T as TaskCardView, g as ProgressBarView, h as PoweredByImg$1, i as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, j as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, k as RewardExchangeView, r as rewardExchangeCustomErrorMsg, l as rewardExchangeLongText, m as rewardExchangeSelected, n as chooseAmountFixed, o as chooseAmountFixedNoDescription, p as chooseAmountVariable, q as chooseAmountVariableNoDescription, s as chooseAmountVariableDisabled, t as chooseAmountVariableUnavailable, v as confirmFixed, w as confirmVariable, x as redemptionError, y as queryError, z as success, A as successVariable, F as loading, G as empty$1, J as rewardExchange, K as CardFeedView, M as CouponCodeView, O as ProgressBar$2, Q as autoColorScaleCss, U as ShadowViewAddon } from './ShadowViewAddon-69b61037.js';
28
28
  import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-6c582684.js';
29
- import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-08c03ba7.js';
29
+ import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-d1cfdaf4.js';
30
30
 
31
31
  /**
32
32
  * lodash (Custom Build) <https://lodash.com/>
@@ -14408,6 +14408,7 @@ const bankingFormProps = {
14408
14408
  loadingError: false,
14409
14409
  },
14410
14410
  callbacks: {
14411
+ onVerification: () => { },
14411
14412
  onSubmit: async () => console.log("Submit"),
14412
14413
  setPaymentMethodChecked: () => { },
14413
14414
  setPaymentScheduleChecked: () => { },
@@ -14995,20 +14996,40 @@ const WidgetEmailVerification_stories = {
14995
14996
  };
14996
14997
  const defaultProps$k = {
14997
14998
  email: "",
14998
- error: "",
14999
+ error: false,
14999
15000
  loading: false,
15001
+ initialLoading: false,
15002
+ sendCodeError: false,
15000
15003
  };
15001
15004
  const Default$i = () => (h("sqm-email-verification", { demoData: {} }));
15005
+ const EmailIsPrefilled = () => (h("sqm-email-verification", { demoData: {
15006
+ states: {
15007
+ ...defaultProps$k,
15008
+ email: "test@example.com",
15009
+ },
15010
+ } }));
15002
15011
  const Loading$7 = () => (h("sqm-email-verification", { demoData: {
15012
+ states: {
15013
+ ...defaultProps$k,
15014
+ initialLoading: true,
15015
+ },
15016
+ } }));
15017
+ const SaveLoading = () => (h("sqm-email-verification", { demoData: {
15003
15018
  states: {
15004
15019
  ...defaultProps$k,
15005
15020
  loading: true,
15006
15021
  },
15007
15022
  } }));
15008
- const Error$a = () => (h("sqm-email-verification", { demoData: {
15023
+ const InvalidEmail = () => (h("sqm-email-verification", { demoData: {
15024
+ states: {
15025
+ ...defaultProps$k,
15026
+ error: true,
15027
+ },
15028
+ } }));
15029
+ const SendCodeError = () => (h("sqm-email-verification", { demoData: {
15009
15030
  states: {
15010
15031
  ...defaultProps$k,
15011
- error: "Email is invalid",
15032
+ sendCodeError: true,
15012
15033
  },
15013
15034
  } }));
15014
15035
 
@@ -15016,20 +15037,30 @@ const WidgetEmailVerification = /*#__PURE__*/Object.freeze({
15016
15037
  __proto__: null,
15017
15038
  'default': WidgetEmailVerification_stories,
15018
15039
  Default: Default$i,
15040
+ EmailIsPrefilled: EmailIsPrefilled,
15019
15041
  Loading: Loading$7,
15020
- Error: Error$a
15042
+ SaveLoading: SaveLoading,
15043
+ InvalidEmail: InvalidEmail,
15044
+ SendCodeError: SendCodeError
15021
15045
  });
15022
15046
 
15023
15047
  const WidgetCodeVerification_stories = {
15024
15048
  title: "Components/Widget Code Verification",
15025
15049
  };
15026
15050
  const defaultProps$l = {
15051
+ initialiseLoading: false,
15027
15052
  email: "testemail@example.com",
15028
15053
  loading: false,
15029
15054
  verifyFailed: false,
15030
- codeResent: false,
15055
+ emailResent: false,
15031
15056
  };
15032
15057
  const Default$j = () => (h("sqm-code-verification", { demoData: { states: defaultProps$l } }));
15058
+ const InitialLoading = () => (h("sqm-code-verification", { demoData: {
15059
+ states: {
15060
+ ...defaultProps$l,
15061
+ initialiseLoading: true,
15062
+ },
15063
+ } }));
15033
15064
  const Loading$8 = () => (h("sqm-code-verification", { demoData: {
15034
15065
  states: {
15035
15066
  ...defaultProps$l,
@@ -15039,7 +15070,7 @@ const Loading$8 = () => (h("sqm-code-verification", { demoData: {
15039
15070
  const CodeResent = () => (h("sqm-code-verification", { demoData: {
15040
15071
  states: {
15041
15072
  ...defaultProps$l,
15042
- codeResent: true,
15073
+ emailResent: true,
15043
15074
  },
15044
15075
  } }));
15045
15076
  const VerificationFailed = () => (h("sqm-code-verification", { demoData: {
@@ -15053,6 +15084,7 @@ const WidgetCodeVerification = /*#__PURE__*/Object.freeze({
15053
15084
  __proto__: null,
15054
15085
  'default': WidgetCodeVerification_stories,
15055
15086
  Default: Default$j,
15087
+ InitialLoading: InitialLoading,
15056
15088
  Loading: Loading$8,
15057
15089
  CodeResent: CodeResent,
15058
15090
  VerificationFailed: VerificationFailed
@@ -15062,15 +15094,13 @@ const PayoutButtonScroll_stories = {
15062
15094
  title: "Components/Payout Scroll Button",
15063
15095
  };
15064
15096
  const defaultProps$m = {
15065
- payoutSettingsComplete: false,
15097
+ payoutSettingsComplete: true,
15066
15098
  };
15067
- const Default$k = () => (h("sqm-payout-button-scroll", { demoData: { states: defaultProps$m } }));
15068
15099
  const CompletedTaxForm = () => (h("sqm-payout-button-scroll", { demoData: { states: { ...defaultProps$m, payoutSettingsComplete: true } } }));
15069
15100
 
15070
15101
  const PayoutButtonScroll = /*#__PURE__*/Object.freeze({
15071
15102
  __proto__: null,
15072
15103
  'default': PayoutButtonScroll_stories,
15073
- Default: Default$k,
15074
15104
  CompletedTaxForm: CompletedTaxForm
15075
15105
  });
15076
15106
 
@@ -15078,21 +15108,33 @@ const PayoutStatusAlert_stories = {
15078
15108
  title: "Components/Payout Status Alert",
15079
15109
  };
15080
15110
  const defaultProps$n = {
15111
+ error: false,
15081
15112
  status: "INFORMATION_REQUIRED",
15082
15113
  loading: false,
15114
+ showVerifyIdentity: false,
15083
15115
  };
15084
15116
  const InformationRequired = () => (h("sqm-payout-status-alert", { demoData: { states: defaultProps$n } }));
15085
15117
  const VerifyIdentity = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps$n, status: "VERIFICATION_NEEDED" } } }));
15118
+ const VerifyIdentityOpen = () => (h("sqm-payout-status-alert", { demoData: {
15119
+ states: {
15120
+ ...defaultProps$n,
15121
+ status: "VERIFICATION_NEEDED",
15122
+ showVerifyIdentity: true,
15123
+ },
15124
+ } }));
15086
15125
  const Hold = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps$n, status: "HOLD" } } }));
15087
15126
  const Loading$9 = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps$n, loading: true } } }));
15127
+ const Error$a = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps$n, error: true } } }));
15088
15128
 
15089
15129
  const PayoutStatusAlert = /*#__PURE__*/Object.freeze({
15090
15130
  __proto__: null,
15091
15131
  'default': PayoutStatusAlert_stories,
15092
15132
  InformationRequired: InformationRequired,
15093
15133
  VerifyIdentity: VerifyIdentity,
15134
+ VerifyIdentityOpen: VerifyIdentityOpen,
15094
15135
  Hold: Hold,
15095
- Loading: Loading$9
15136
+ Loading: Loading$9,
15137
+ Error: Error$a
15096
15138
  });
15097
15139
 
15098
15140
  /**
@@ -15107,7 +15149,7 @@ const PayoutStatusAlert = /*#__PURE__*/Object.freeze({
15107
15149
  *
15108
15150
  */
15109
15151
  //
15110
- const Default$l = `
15152
+ const Default$k = `
15111
15153
  // No CSS
15112
15154
  `;
15113
15155
  const Orangey = `
@@ -15141,7 +15183,7 @@ const Klip = `
15141
15183
 
15142
15184
  const Themes = /*#__PURE__*/Object.freeze({
15143
15185
  __proto__: null,
15144
- Default: Default$l,
15186
+ Default: Default$k,
15145
15187
  Orangey: Orangey,
15146
15188
  Netflix: Netflix,
15147
15189
  SaaSquatchCorporate: SaaSquatchCorporate,
@@ -1,29 +1,99 @@
1
1
  import { r as registerInstance, h as h$1 } from './index-17b4da69.js';
2
- import { n as h } from './stencil-hooks.module-ac12ca1c.js';
3
- import { K, F as Fn } from './index.module-6c840c4e.js';
4
- import { S as SHOW_CODE_NAMESPACE, b as VERIFICATION_EMAIL_NAMESPACE } from './keys-a1496e39.js';
2
+ import { n as h, k as useState, f as useEffect } from './stencil-hooks.module-ac12ca1c.js';
3
+ import { d as dist, i as isDemo, F as Fn, S as Sn, K, o as an } from './index.module-6c840c4e.js';
4
+ import { g as getProps } from './utils-334c1e34.js';
5
+ import { S as SHOW_CODE_NAMESPACE, a as VERIFICATION_EMAIL_NAMESPACE, V as VERIFICATION_PARENT_NAMESPACE } from './keys-db1897ae.js';
6
+ import { e as extractProps } from './extractProps-ae1afbb3.js';
5
7
 
8
+ const USER_LOOKUP = dist.gql `
9
+ query checkUserVerification {
10
+ viewer {
11
+ ... on User {
12
+ id
13
+ accountId
14
+ email
15
+ emailVerified
16
+ }
17
+ }
18
+ }
19
+ `;
20
+ function useWidgetVerificationInternal() {
21
+ const userIdentity = K();
22
+ const [showCode, setShowCode] = Fn({
23
+ namespace: SHOW_CODE_NAMESPACE,
24
+ initialValue: false,
25
+ });
26
+ const [email, setEmail] = Fn({
27
+ namespace: VERIFICATION_EMAIL_NAMESPACE,
28
+ initialValue: userIdentity === null || userIdentity === void 0 ? void 0 : userIdentity.email,
29
+ });
30
+ const setContext = Sn(VERIFICATION_PARENT_NAMESPACE);
31
+ const [loading, setLoading] = useState(true);
32
+ const [fetch] = an(USER_LOOKUP);
33
+ useEffect(() => {
34
+ const checkUser = async () => {
35
+ var _a;
36
+ try {
37
+ const res = await fetch({});
38
+ if (!res || res instanceof Error)
39
+ throw new Error();
40
+ if ((_a = res === null || res === void 0 ? void 0 : res.viewer) === null || _a === void 0 ? void 0 : _a.emailVerified)
41
+ setContext(true);
42
+ }
43
+ catch (e) {
44
+ console.error("Could not fetch user information:", e);
45
+ }
46
+ finally {
47
+ setLoading(false);
48
+ }
49
+ };
50
+ checkUser();
51
+ }, []);
52
+ const onVerification = () => {
53
+ setContext(true);
54
+ };
55
+ return { showCode, onVerification, loading };
56
+ }
6
57
  const WidgetVerificationInternal = class {
7
58
  constructor(hostRef) {
8
59
  registerInstance(this, hostRef);
9
60
  h(this);
10
61
  }
11
62
  disconnectedCallback() { }
63
+ getStepTextProps(prefix) {
64
+ const props = getProps(this);
65
+ return extractProps(props, prefix);
66
+ }
12
67
  render() {
13
- const userIdentity = K();
14
- const [showCode, setShowCode] = Fn({
15
- namespace: SHOW_CODE_NAMESPACE,
16
- initialValue: false,
17
- });
18
- const [email, setEmail] = Fn({
19
- namespace: VERIFICATION_EMAIL_NAMESPACE,
20
- initialValue: userIdentity === null || userIdentity === void 0 ? void 0 : userIdentity.email,
21
- });
68
+ const { showCode, onVerification, loading } = isDemo()
69
+ ? useDemoWidgetVerificationInternal()
70
+ : useWidgetVerificationInternal();
71
+ // TODO: Shoelace spinner is throwing errors
72
+ if (loading)
73
+ return h$1("div", null);
74
+ // if (loading) {
75
+ // return <sl-spinner style="font-size: 2rem;"></sl-spinner>;
76
+ // }
22
77
  if (showCode) {
23
- return h$1("sqm-code-verification", null);
78
+ return (h$1("sqm-code-verification", Object.assign({ onVerification: onVerification }, this.getStepTextProps("codeStep_"))));
24
79
  }
25
- return h$1("sqm-email-verification", null);
80
+ return (h$1("sqm-email-verification", Object.assign({}, this.getStepTextProps("emailStep_"))));
26
81
  }
27
82
  };
83
+ function useDemoWidgetVerificationInternal() {
84
+ const [showCode, setShowCode] = Fn({
85
+ namespace: SHOW_CODE_NAMESPACE,
86
+ initialValue: false,
87
+ });
88
+ const [email, setEmail] = Fn({
89
+ namespace: VERIFICATION_EMAIL_NAMESPACE,
90
+ initialValue: undefined,
91
+ });
92
+ const setContext = Sn(VERIFICATION_PARENT_NAMESPACE);
93
+ const onVerification = () => {
94
+ setContext(true);
95
+ };
96
+ return { showCode, onVerification, loading: false };
97
+ }
28
98
 
29
99
  export { WidgetVerificationInternal as sqm_widget_verification_internal };
@@ -1,7 +1,8 @@
1
1
  import { r as registerInstance, h as h$1, c as Host } from './index-17b4da69.js';
2
- import { b as browser, n as h, k as useState, f as useEffect, l } from './stencil-hooks.module-ac12ca1c.js';
2
+ import { b as browser, n as h, k as useState, f as useEffect } from './stencil-hooks.module-ac12ca1c.js';
3
3
  import { F as Fn, b as useCallback } from './index.module-6c840c4e.js';
4
- import { V as VERIFICATION_EVENT_KEY, a as VERIFICATION_PARENT_NAMESPACE } from './keys-a1496e39.js';
4
+ import { g as getProps } from './utils-334c1e34.js';
5
+ import { V as VERIFICATION_PARENT_NAMESPACE } from './keys-db1897ae.js';
5
6
 
6
7
  const debug = browser("sq:widget-verification");
7
8
  function useTemplateChildren({ parent, callback }) {
@@ -31,23 +32,105 @@ function useTemplateChildren({ parent, callback }) {
31
32
  };
32
33
  }
33
34
  const WidgetVerification = class {
35
+ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36
+ CODE STEP PROPS
37
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
34
38
  constructor(hostRef) {
35
39
  registerInstance(this, hostRef);
40
+ // ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification
41
+ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42
+ EMAIL STEP PROPS
43
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
44
+ /**
45
+ * @uiName Verify email widget header text
46
+ * @uiGroup Email Verification Step
47
+ */
48
+ this.emailStep_verifyEmailHeaderText = "Start by verifying your email. We’ll send you a code through our referral provider, impact.com.";
49
+ /**
50
+ * @uiName Send code to email alert header
51
+ * @uiGroup Email Verification Step
52
+ */
53
+ this.emailStep_sendCodeErrorHeader = "There was an error sending your code.";
54
+ /**
55
+ * @uiName Send code to email alert description
56
+ * @uiGroup Email Verification Step
57
+ */
58
+ this.emailStep_sendCodeErrorDescription = "Please try again. If this problem continues, contact our program support team.";
59
+ /**
60
+ * @uiName Email input label
61
+ * @uiGroup Email Verification Step
62
+ */
63
+ this.emailStep_emailLabel = "Email";
64
+ /**
65
+ * @uiName Send code button text
66
+ * @uiGroup Email Verification Step
67
+ */
68
+ this.emailStep_sendCodeText = "Send code";
69
+ /**
70
+ * @uiName Send code button text
71
+ * @uiGroup Email Verification Step
72
+ */
73
+ this.emailStep_emailValidationErrorText = "Please enter a valid email";
74
+ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75
+ EMAIL STEP PROPS
76
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
77
+ /**
78
+ * @uiName Verify code widget header text
79
+ * @uiGroup Code Verification Step
80
+ */
81
+ this.codeStep_verifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
82
+ /**
83
+ * @uiName Reverify code widget header text
84
+ * @uiGroup Code Verification Step
85
+ */
86
+ this.codeStep_reverifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
87
+ /**
88
+ * Text displayed under verify button
89
+ * @uiName Resend code text
90
+ * @uiGroup Code Verification Step
91
+ */
92
+ this.codeStep_resendCodeText = "Didn't receive your code? {resendCodeLink}";
93
+ /**
94
+ * The link that appears in the resend code link
95
+ * @uiName Resend code label
96
+ * @uiGroup Code Verification Step
97
+ */
98
+ this.codeStep_resendCodeLabel = "Resend code";
99
+ /**
100
+ * Link text displayed under verify button
101
+ * @uiName Resend code text
102
+ * @uiGroup Code Verification Step
103
+ */
104
+ this.codeStep_codeResentSuccessfullyText = "Another code has been sent to {email}";
105
+ /**
106
+ * Error text displayed under verification input
107
+ * @uiName Invalid code text
108
+ * @uiGroup Code Verification Step
109
+ */
110
+ this.codeStep_invalidCodeText = "Please check your code and try again. If you’re still having trouble, try resending your code.";
111
+ /**
112
+ * @uiName Verify code button text
113
+ * @uiGroup Code Verification Step
114
+ */
115
+ this.codeStep_verifyText = "Verify";
116
+ /**
117
+ * Displayed when the email verification fails due to a network error. The participant can try refreshing the page.
118
+ * @uiName Network error message
119
+ * @uiGroup Code Verification Step
120
+ */
121
+ this.codeStep_networkErrorMessage = "An error occurred while verifying your email. Please refresh the page and try again.";
36
122
  h(this);
37
123
  }
38
124
  disconnectedCallback() { }
39
125
  render() {
40
126
  const [context, setContext] = Fn({
41
127
  namespace: VERIFICATION_PARENT_NAMESPACE,
42
- initialValue: undefined,
128
+ initialValue: false,
43
129
  });
44
- const authToken = context === null || context === void 0 ? void 0 : context.token;
45
130
  const [container, setContainer] = useState(undefined);
46
131
  const [slot, setSlot] = useState(undefined);
47
- if (!authToken)
48
- debug("No user identity available");
49
132
  const updateTemplates = useCallback(() => {
50
- const isAuth = !!authToken;
133
+ const isAuth = context;
51
134
  const templates = slot.querySelectorAll(`template`);
52
135
  const template = Array.from(templates).find((t) => t.slot === (isAuth ? "verified" : "not-verified"));
53
136
  if (template) {
@@ -95,7 +178,7 @@ const WidgetVerification = class {
95
178
  target.style.height = "25px";
96
179
  });
97
180
  }
98
- }, [container, slot, authToken]);
181
+ }, [container, slot, context]);
99
182
  useEffect(() => {
100
183
  if (!container || !slot) {
101
184
  debug("DOM not ready:");
@@ -104,19 +187,19 @@ const WidgetVerification = class {
104
187
  // Run on first render
105
188
  updateTemplates();
106
189
  return useTemplateChildren({ parent: slot, callback: updateTemplates });
107
- }, [slot, container, authToken]);
108
- useEffect(() => {
109
- const host = l();
110
- const callback = (e) => {
111
- e.stopPropagation();
112
- setContext({ token: e.detail.token });
113
- };
114
- host.addEventListener(VERIFICATION_EVENT_KEY, callback);
115
- return () => {
116
- host.removeEventListener(VERIFICATION_EVENT_KEY, callback);
117
- };
118
- }, []);
119
- return (h$1(Host, null, h$1("div", { ref: setSlot, style: { display: "contents" } }, h$1("template", { slot: "not-verified" }, h$1("sqm-widget-verification-internal", null)), h$1("slot", { name: "not-verified" }), h$1("slot", { name: "verified" })), h$1("div", { ref: setContainer }, h$1("slot", { name: "shown" }))));
190
+ }, [slot, container, context]);
191
+ // useEffect(() => {
192
+ // const host = useHost();
193
+ // const callback = (e: CustomEvent) => {
194
+ // e.stopPropagation();
195
+ // setContext({ token: e.detail.token });
196
+ // };
197
+ // host.addEventListener(VERIFICATION_EVENT_KEY, callback);
198
+ // return () => {
199
+ // host.removeEventListener(VERIFICATION_EVENT_KEY, callback);
200
+ // };
201
+ // }, []);
202
+ return (h$1(Host, null, h$1("div", { ref: setSlot, style: { display: "contents" } }, h$1("template", { slot: "not-verified" }, h$1("sqm-widget-verification-internal", Object.assign({}, getProps(this)))), h$1("slot", { name: "not-verified" }), h$1("slot", { name: "verified" })), h$1("div", { ref: setContainer }, h$1("slot", { name: "shown" }))));
120
203
  }
121
204
  };
122
205
 
@@ -0,0 +1,67 @@
1
+ import { k as useState, f as useEffect } from './stencil-hooks.module-ac12ca1c.js';
2
+ import { d as dist, g as getEnvironmentSDK, E as En } from './index.module-6c840c4e.js';
3
+
4
+ const GET_USER_STATUS = dist.gql `
5
+ query getUserStatus {
6
+ user: viewer {
7
+ ... on User {
8
+ id
9
+ impactConnection {
10
+ connected
11
+ publisher {
12
+ id
13
+ payoutsAccount {
14
+ hold
15
+ holdReasons
16
+ }
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }
22
+ `;
23
+ function getStatus(data) {
24
+ var _a, _b, _c, _d, _e;
25
+ const account = (_b = (_a = data.user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.payoutsAccount;
26
+ if (!((_d = (_c = data.user) === null || _c === void 0 ? void 0 : _c.impactConnection) === null || _d === void 0 ? void 0 : _d.connected) || !account)
27
+ return "INFORMATION_REQUIRED";
28
+ if ((_e = account.holdReasons) === null || _e === void 0 ? void 0 : _e.includes("IDV_CHECK_REQUIRED"))
29
+ return "VERIFICATION_NEEDED";
30
+ if (account.hold)
31
+ return "HOLD";
32
+ return "DONE";
33
+ }
34
+ function usePayoutStatus(props) {
35
+ const { type } = getEnvironmentSDK();
36
+ const { loading, data, errors, refetch } = En(GET_USER_STATUS, {});
37
+ const [status, setStatus] = useState(undefined);
38
+ const [showDialog, setShowDialog] = useState(false);
39
+ useEffect(() => {
40
+ if (!data)
41
+ return;
42
+ const s = getStatus(data);
43
+ setStatus(s);
44
+ }, [data]);
45
+ useEffect(() => {
46
+ const cb = () => refetch();
47
+ window.addEventListener("sqm:tax-form-updated", cb);
48
+ return () => window.removeEventListener("sqm:tax-form-updated", cb);
49
+ }, []);
50
+ return {
51
+ states: {
52
+ loading,
53
+ status,
54
+ showVerifyIdentity: showDialog,
55
+ error: !!errors,
56
+ },
57
+ data: { type },
58
+ text: props.getTextProps(),
59
+ callbacks: {
60
+ onTermsClick: () => window.open(props.termsUrl, "_blank").focus(),
61
+ onClick: () => setShowDialog(true),
62
+ onCancel: () => setShowDialog(false),
63
+ },
64
+ };
65
+ }
66
+
67
+ export { getStatus as g, usePayoutStatus as u };