@saasquatch/mint-components 1.3.1-6 → 1.3.2-10

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 (344) hide show
  1. package/CHANGELOG.md +23 -31
  2. package/dist/cjs/{ShadowViewAddon-a33867b9.js → ShadowViewAddon-d2fde0a2.js} +1 -1
  3. package/dist/cjs/{global-f4f5e602.js → global-e04d7cde.js} +279 -70
  4. package/dist/cjs/{index.module-e9dac160.js → index.module-07ed6ad2.js} +4 -2
  5. package/dist/cjs/loader.cjs.js +3 -3
  6. package/dist/cjs/mint-components.cjs.js +3 -3
  7. package/dist/cjs/{re-render-3acba68a.js → re-render-81649c33.js} +1 -1
  8. package/dist/cjs/sqm-asset-card.cjs.entry.js +1 -1
  9. package/dist/cjs/sqm-big-stat.cjs.entry.js +2 -2
  10. package/dist/cjs/{sqm-divided-layout_26.cjs.entry.js → sqm-divided-layout_30.cjs.entry.js} +2607 -168
  11. package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +1 -1
  12. package/dist/cjs/{sqm-leaderboard-rank-view-54299e38.js → sqm-leaderboard-rank-view-0ba128e2.js} +2 -2
  13. package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +3 -3
  14. package/dist/cjs/sqm-leaderboard.cjs.entry.js +2 -2
  15. package/dist/cjs/sqm-name-fields.cjs.entry.js +1 -1
  16. package/dist/cjs/{sqm-navigation-sidebar-item-view-daa9c2e1.js → sqm-navigation-sidebar-item-view-0bad789c.js} +1 -1
  17. package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +2 -2
  18. package/dist/cjs/sqm-popup-container.cjs.entry.js +1 -1
  19. package/dist/cjs/{sqm-portal-email-verification-view-395079fe.js → sqm-portal-email-verification-view-3c7d8701.js} +1 -1
  20. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +4 -4
  21. package/dist/cjs/{sqm-portal-footer-view-c82aedb5.js → sqm-portal-footer-view-8f5d682e.js} +1 -1
  22. package/dist/cjs/sqm-portal-footer.cjs.entry.js +3 -3
  23. package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +1 -1
  24. package/dist/cjs/sqm-portal-logout.cjs.entry.js +1 -1
  25. package/dist/cjs/{sqm-portal-profile-view-9fa00ccd.js → sqm-portal-profile-view-14866b58.js} +1 -1
  26. package/dist/cjs/sqm-portal-profile.cjs.entry.js +3 -3
  27. package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +1 -1
  28. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +1 -1
  29. package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +1 -1
  30. package/dist/cjs/sqm-referral-table-column.cjs.entry.js +2 -2
  31. package/dist/cjs/sqm-referral-table-date-column.cjs.entry.js +2 -2
  32. package/dist/cjs/sqm-referral-table-rewards-column.cjs.entry.js +2 -2
  33. package/dist/cjs/sqm-referral-table-status-column.cjs.entry.js +2 -2
  34. package/dist/cjs/sqm-referral-table-user-column.cjs.entry.js +2 -2
  35. package/dist/cjs/sqm-share-code.cjs.entry.js +1 -1
  36. package/dist/cjs/{useDemoBigStat-e99cc8a2.js → useDemoBigStat-1692a6a1.js} +119 -22
  37. package/dist/collection/collection-manifest.json +7 -3
  38. package/dist/collection/{stories → components/sqm-asset-card}/AssetCard.stories.js +2 -2
  39. package/dist/collection/{stories → components/sqm-big-stat}/BigStat.stories.js +10 -3
  40. package/dist/collection/{stories → components/sqm-big-stat}/UseBigStat.stories.js +7 -4
  41. package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +1 -21
  42. package/dist/collection/components/sqm-big-stat/useBigStat.js +117 -21
  43. package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +1 -0
  44. package/dist/collection/{stories → components/sqm-divided-layout}/DividedLayout.stories.js +4 -4
  45. package/dist/collection/{stories → components/sqm-edit-profile}/EditProfileForm.stories.js +2 -2
  46. package/dist/collection/{stories → components/sqm-edit-profile}/UseEditProfile.stories.js +1 -1
  47. package/dist/collection/{stories → components/sqm-form-message}/FormMessage.stories.js +1 -1
  48. package/dist/collection/{stories → components/sqm-hero}/Hero.stories.js +2 -2
  49. package/dist/collection/{stories → components/sqm-leaderboard}/Leaderboard.stories.js +2 -2
  50. package/dist/collection/{stories → components/sqm-leaderboard}/UseLeaderboard.stories.js +3 -3
  51. package/dist/collection/{stories → components/sqm-leaderboard-rank}/LeaderboardRank.stories.js +2 -2
  52. package/dist/collection/{stories → components/sqm-name-fields}/NameFields.stories.js +2 -2
  53. package/dist/collection/{stories → components/sqm-navigation-sidebar}/NavigationSidebar.stories.js +3 -3
  54. package/dist/collection/{stories → components/sqm-navigation-sidebar-item}/SidebarItem.stories.js +2 -2
  55. package/dist/collection/{stories → components/sqm-password-field}/PasswordField.stories.js +1 -1
  56. package/dist/collection/{stories → components/sqm-portal-change-password}/ChangePassword.stories.js +3 -3
  57. package/dist/collection/{stories → components/sqm-portal-email-verification}/PortalEmailVerification.stories.js +3 -3
  58. package/dist/collection/{stories → components/sqm-portal-footer}/PortalFooter.stories.js +2 -2
  59. package/dist/collection/{stories → components/sqm-portal-forgot-password}/PortalForgotPassword.stories.js +3 -3
  60. package/dist/collection/{stories → components/sqm-portal-frame}/PortalFrame.stories.js +2 -2
  61. package/dist/collection/{stories → components/sqm-portal-login}/PortalLogin.stories.js +2 -2
  62. package/dist/collection/{stories → components/sqm-portal-profile}/PortalProfile.stories.js +2 -2
  63. package/dist/collection/{stories → components/sqm-portal-register}/PortalRegister.stories.js +2 -2
  64. package/dist/collection/components/sqm-portal-register/sqm-portal-register.js +1 -1
  65. package/dist/collection/{stories → components/sqm-portal-reset-password}/PortalResetPassword.stories.js +3 -3
  66. package/dist/collection/{stories → components/sqm-portal-verify-email}/PortalVerifyEmail.stories.js +3 -3
  67. package/dist/collection/{stories → components/sqm-program-menu}/ProgramMenu.stories.js +2 -2
  68. package/dist/collection/{stories → components/sqm-referral-iframe}/ReferralIframe.stories.js +2 -2
  69. package/dist/collection/{stories → components/sqm-referral-table}/ReferralTable.stories.js +2 -2
  70. package/dist/collection/{stories → components/sqm-referral-table}/ReferralTableCell.stories.js +1 -1
  71. package/dist/collection/{stories → components/sqm-referral-table}/ReferralTableRewardsCell.stories.js +1 -1
  72. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-column.js +1 -1
  73. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-date-column.js +1 -1
  74. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.js +1 -1
  75. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-status-column.js +1 -1
  76. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-user-column.js +1 -1
  77. package/dist/collection/components/sqm-referral-table/useReferralTable.js +2 -2
  78. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +21 -0
  79. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +218 -0
  80. package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +8 -0
  81. package/dist/collection/components/sqm-reward-exchange-list/UseRewardExchangeList.stories.js +143 -0
  82. package/dist/collection/components/sqm-reward-exchange-list/assets/Reward-icon.png +0 -0
  83. package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +60 -0
  84. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +269 -0
  85. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +121 -0
  86. package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +198 -0
  87. package/dist/collection/components/sqm-rewards-table/UseRewardsTable.stories.js +53 -0
  88. package/dist/collection/components/sqm-rewards-table/sqm-rewards-table-column.js +120 -0
  89. package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +222 -0
  90. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +190 -0
  91. package/dist/collection/{stories → components/sqm-router}/Router.stories.js +1 -1
  92. package/dist/collection/{stories → components/sqm-share-button}/ShareButton.stories.js +2 -2
  93. package/dist/collection/{stories → components/sqm-share-button}/UseShareButton.stories.js +2 -2
  94. package/dist/collection/components/sqm-share-button/sqm-share-button.js +1 -1
  95. package/dist/collection/{stories → components/sqm-share-link}/ShareLink.stories.js +2 -2
  96. package/dist/collection/{stories → components/sqm-share-link}/UseShareLink.stories.js +3 -3
  97. package/dist/collection/components/sqm-share-link/useShareLink.js +1 -2
  98. package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +3 -1
  99. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +48 -36
  100. package/dist/collection/components/sqm-task-card/Matrix.js +63 -0
  101. package/dist/collection/components/sqm-task-card/SVGs.js +9 -0
  102. package/dist/collection/components/sqm-task-card/TaskCard.stories.js +330 -0
  103. package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +41 -0
  104. package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +7 -0
  105. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +311 -0
  106. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar.stories.js +53 -0
  107. package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +173 -0
  108. package/dist/collection/components/sqm-task-card/sqm-task-card.js +384 -0
  109. package/dist/collection/{stories → components/sqm-user-name}/UserName.stories.js +3 -3
  110. package/dist/collection/global/styles.js +278 -69
  111. package/dist/collection/global/styles.ts +278 -69
  112. package/dist/collection/stories/NewPortal.stories.js +15 -15
  113. package/dist/collection/tables/GenericTableView.js +51 -0
  114. package/dist/collection/tables/TableSlots.js +22 -0
  115. package/dist/collection/{components/sqm-referral-table → tables}/re-render.js +0 -0
  116. package/dist/collection/{components/sqm-referral-table → tables}/sqm-table-cell.js +0 -0
  117. package/dist/collection/{components/sqm-referral-table → tables}/sqm-table-row.js +0 -0
  118. package/dist/collection/{components/sqm-referral-table → tables}/useChildElements.js +0 -0
  119. package/dist/esm/{ShadowViewAddon-7cbc6390.js → ShadowViewAddon-aa087ef2.js} +1 -1
  120. package/dist/esm/{global-5dfb4fa8.js → global-107bb084.js} +279 -70
  121. package/dist/esm/{index.module-07f3fbb0.js → index.module-1f571929.js} +2 -2
  122. package/dist/esm/loader.js +3 -3
  123. package/dist/esm/mint-components.js +3 -3
  124. package/dist/esm/{re-render-0be5746e.js → re-render-76c9129f.js} +1 -1
  125. package/dist/esm/sqm-asset-card.entry.js +1 -1
  126. package/dist/esm/sqm-big-stat.entry.js +2 -2
  127. package/dist/esm/{sqm-divided-layout_26.entry.js → sqm-divided-layout_30.entry.js} +2605 -170
  128. package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
  129. package/dist/esm/{sqm-leaderboard-rank-view-04161da4.js → sqm-leaderboard-rank-view-c1aefdd5.js} +2 -2
  130. package/dist/esm/sqm-leaderboard-rank.entry.js +3 -3
  131. package/dist/esm/sqm-leaderboard.entry.js +2 -2
  132. package/dist/esm/sqm-name-fields.entry.js +1 -1
  133. package/dist/esm/{sqm-navigation-sidebar-item-view-78631800.js → sqm-navigation-sidebar-item-view-b3618185.js} +1 -1
  134. package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
  135. package/dist/esm/sqm-popup-container.entry.js +1 -1
  136. package/dist/esm/{sqm-portal-email-verification-view-d6ffe3b8.js → sqm-portal-email-verification-view-df0559b0.js} +1 -1
  137. package/dist/esm/sqm-portal-email-verification.entry.js +4 -4
  138. package/dist/esm/{sqm-portal-footer-view-5aa288c9.js → sqm-portal-footer-view-2b2bfc9e.js} +1 -1
  139. package/dist/esm/sqm-portal-footer.entry.js +3 -3
  140. package/dist/esm/sqm-portal-forgot-password.entry.js +1 -1
  141. package/dist/esm/sqm-portal-logout.entry.js +1 -1
  142. package/dist/esm/{sqm-portal-profile-view-636a8688.js → sqm-portal-profile-view-2fbb0845.js} +1 -1
  143. package/dist/esm/sqm-portal-profile.entry.js +3 -3
  144. package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
  145. package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
  146. package/dist/esm/sqm-portal-verify-email.entry.js +1 -1
  147. package/dist/esm/sqm-referral-table-column.entry.js +2 -2
  148. package/dist/esm/sqm-referral-table-date-column.entry.js +2 -2
  149. package/dist/esm/sqm-referral-table-rewards-column.entry.js +2 -2
  150. package/dist/esm/sqm-referral-table-status-column.entry.js +2 -2
  151. package/dist/esm/sqm-referral-table-user-column.entry.js +2 -2
  152. package/dist/esm/sqm-share-code.entry.js +1 -1
  153. package/dist/esm/{useDemoBigStat-531a4d2a.js → useDemoBigStat-49cdfe32.js} +119 -22
  154. package/dist/esm-es5/{ShadowViewAddon-7cbc6390.js → ShadowViewAddon-aa087ef2.js} +1 -1
  155. package/dist/esm-es5/{global-5dfb4fa8.js → global-107bb084.js} +2 -2
  156. package/dist/esm-es5/{index.module-07f3fbb0.js → index.module-1f571929.js} +1 -1
  157. package/dist/esm-es5/loader.js +1 -1
  158. package/dist/esm-es5/mint-components.js +1 -1
  159. package/dist/esm-es5/{re-render-0be5746e.js → re-render-76c9129f.js} +1 -1
  160. package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
  161. package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
  162. package/dist/esm-es5/sqm-divided-layout_30.entry.js +1 -0
  163. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  164. package/dist/esm-es5/{sqm-leaderboard-rank-view-04161da4.js → sqm-leaderboard-rank-view-c1aefdd5.js} +1 -1
  165. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  166. package/dist/esm-es5/sqm-leaderboard.entry.js +1 -1
  167. package/dist/esm-es5/sqm-name-fields.entry.js +1 -1
  168. package/dist/esm-es5/{sqm-navigation-sidebar-item-view-78631800.js → sqm-navigation-sidebar-item-view-b3618185.js} +1 -1
  169. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  170. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  171. package/dist/esm-es5/{sqm-portal-email-verification-view-d6ffe3b8.js → sqm-portal-email-verification-view-df0559b0.js} +1 -1
  172. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  173. package/dist/esm-es5/{sqm-portal-footer-view-5aa288c9.js → sqm-portal-footer-view-2b2bfc9e.js} +1 -1
  174. package/dist/esm-es5/sqm-portal-footer.entry.js +1 -1
  175. package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
  176. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  177. package/dist/esm-es5/{sqm-portal-profile-view-636a8688.js → sqm-portal-profile-view-2fbb0845.js} +1 -1
  178. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  179. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  180. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  181. package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
  182. package/dist/esm-es5/sqm-referral-table-column.entry.js +1 -1
  183. package/dist/esm-es5/sqm-referral-table-date-column.entry.js +1 -1
  184. package/dist/esm-es5/sqm-referral-table-rewards-column.entry.js +1 -1
  185. package/dist/esm-es5/sqm-referral-table-status-column.entry.js +1 -1
  186. package/dist/esm-es5/sqm-referral-table-user-column.entry.js +1 -1
  187. package/dist/esm-es5/sqm-share-code.entry.js +1 -1
  188. package/dist/esm-es5/useDemoBigStat-49cdfe32.js +1 -0
  189. package/dist/mint-components/assets/Reward-icon.png +0 -0
  190. package/dist/mint-components/global/styles.ts +278 -69
  191. package/dist/mint-components/mint-components.esm.js +1 -1
  192. package/dist/mint-components/mint-components.js +1 -1
  193. package/dist/mint-components/{p-cb8a3610.system.entry.js → p-03b7444e.system.entry.js} +1 -1
  194. package/dist/mint-components/{p-b745adaa.system.js → p-0470556b.system.js} +1 -1
  195. package/dist/mint-components/{p-6bbb9d5a.system.entry.js → p-0ca63e9e.system.entry.js} +1 -1
  196. package/dist/mint-components/{p-4ca49eb2.system.entry.js → p-0ddd6063.system.entry.js} +1 -1
  197. package/dist/mint-components/{p-a12e34b0.entry.js → p-0f19ab40.entry.js} +1 -1
  198. package/dist/mint-components/{p-84da6c55.system.entry.js → p-123930ab.system.entry.js} +1 -1
  199. package/dist/mint-components/p-20991bdd.system.entry.js +1 -0
  200. package/dist/mint-components/{p-3f3b81de.system.js → p-22ee65c4.system.js} +1 -1
  201. package/dist/mint-components/{p-f05f6004.system.entry.js → p-2b9a01ce.system.entry.js} +1 -1
  202. package/dist/mint-components/{p-705141c1.entry.js → p-3b9492a8.entry.js} +1 -1
  203. package/dist/mint-components/{p-11fe72bd.entry.js → p-3bbc61af.entry.js} +1 -1
  204. package/dist/mint-components/{p-99f85aae.js → p-3fd9db63.js} +1 -1
  205. package/dist/mint-components/p-458070cf.js +1 -0
  206. package/dist/mint-components/{p-1c69eba7.js → p-4ae9f594.js} +1 -1
  207. package/dist/mint-components/{p-7e6a38d0.system.entry.js → p-57568b23.system.entry.js} +1 -1
  208. package/dist/mint-components/{p-453df041.entry.js → p-57aa7493.entry.js} +1 -1
  209. package/dist/mint-components/p-5986de11.entry.js +1 -0
  210. package/dist/mint-components/p-59fa991d.entry.js +335 -0
  211. package/dist/mint-components/{p-cac1ffd0.entry.js → p-5a1a2b2c.entry.js} +1 -1
  212. package/dist/mint-components/{p-552a99b9.system.js → p-5e681b4b.system.js} +1 -1
  213. package/dist/mint-components/p-62b134cb.system.entry.js +1 -0
  214. package/dist/mint-components/{p-9fb97b00.system.entry.js → p-64299f78.system.entry.js} +1 -1
  215. package/dist/mint-components/p-6466d643.entry.js +1 -0
  216. package/dist/mint-components/{p-91c46672.js → p-70008004.js} +1 -1
  217. package/dist/mint-components/{p-a1029019.system.entry.js → p-70a6f9d9.system.entry.js} +1 -1
  218. package/dist/mint-components/p-719c2664.system.js +1 -0
  219. package/dist/mint-components/p-75924795.system.entry.js +1 -0
  220. package/dist/mint-components/{p-55580223.system.js → p-8155cd07.system.js} +1 -1
  221. package/dist/mint-components/{p-f5333477.system.entry.js → p-86a55c58.system.entry.js} +1 -1
  222. package/dist/mint-components/{p-087571f1.entry.js → p-874e7da3.entry.js} +1 -1
  223. package/dist/mint-components/{p-d9123a4a.system.entry.js → p-8ac0ec83.system.entry.js} +1 -1
  224. package/dist/mint-components/{p-d32ebb2d.system.js → p-91b0d151.system.js} +1 -1
  225. package/dist/mint-components/{p-45befbb8.system.entry.js → p-9ca6142b.system.entry.js} +1 -1
  226. package/dist/mint-components/{p-e3d75555.entry.js → p-a26457cd.entry.js} +1 -1
  227. package/dist/mint-components/{p-ccddec52.js → p-a37fc3cb.js} +1 -1
  228. package/dist/mint-components/p-a48fc54e.system.js +1 -0
  229. package/dist/mint-components/{p-6accffd6.js → p-ab378185.js} +1 -1
  230. package/dist/mint-components/p-ac92b5ea.js +235 -0
  231. package/dist/mint-components/{p-6a9b7f7c.entry.js → p-b0c6f82b.entry.js} +1 -1
  232. package/dist/mint-components/{p-df3a9a38.entry.js → p-b0e9c89c.entry.js} +1 -1
  233. package/dist/mint-components/{p-d98a6a1c.entry.js → p-b3bac2c6.entry.js} +1 -1
  234. package/dist/mint-components/{p-40f1482a.system.entry.js → p-bcb30771.system.entry.js} +1 -1
  235. package/dist/mint-components/{p-6a95537b.system.js → p-bdfdb088.system.js} +1 -1
  236. package/dist/mint-components/{p-7f7f60ea.entry.js → p-beb02af2.entry.js} +1 -1
  237. package/dist/mint-components/{p-77cf28f1.system.js → p-beeeda0c.system.js} +2 -2
  238. package/dist/mint-components/p-bf10c781.system.js +1 -0
  239. package/dist/mint-components/{p-ab551be3.system.entry.js → p-c0e8aaa7.system.entry.js} +1 -1
  240. package/dist/mint-components/{p-24cc7ee3.system.entry.js → p-c35b54e4.system.entry.js} +1 -1
  241. package/dist/mint-components/{p-2818f3a0.entry.js → p-c61c61e7.entry.js} +1 -1
  242. package/dist/mint-components/{p-94c25cfe.entry.js → p-c974b7d4.entry.js} +1 -1
  243. package/dist/mint-components/{p-aeb995ca.entry.js → p-cbf1db2b.entry.js} +1 -1
  244. package/dist/mint-components/{p-0d3f2c66.entry.js → p-d1e28563.entry.js} +1 -1
  245. package/dist/mint-components/{p-b95eaf63.entry.js → p-d37f227e.entry.js} +1 -1
  246. package/dist/mint-components/{p-730785e9.system.js → p-d44e98b8.system.js} +1 -1
  247. package/dist/mint-components/{p-80a40e90.js → p-d73d26ec.js} +2 -2
  248. package/dist/mint-components/{p-ab9ef09d.entry.js → p-dacbf435.entry.js} +1 -1
  249. package/dist/mint-components/{p-1af6d49d.system.entry.js → p-dbc04567.system.entry.js} +1 -1
  250. package/dist/mint-components/{p-4018d7eb.entry.js → p-de0efef2.entry.js} +1 -1
  251. package/dist/mint-components/{p-72420d6b.system.entry.js → p-e01213a2.system.entry.js} +1 -1
  252. package/dist/mint-components/p-e2a855b8.system.entry.js +1 -0
  253. package/dist/mint-components/{p-0996811b.entry.js → p-f0ad9b15.entry.js} +1 -1
  254. package/dist/mint-components/{p-23f0e229.system.entry.js → p-f0cbf76e.system.entry.js} +1 -1
  255. package/dist/mint-components/{p-48b04ef0.entry.js → p-f2db1c3b.entry.js} +1 -1
  256. package/dist/mint-components/{p-e1549548.system.entry.js → p-f538a675.system.entry.js} +1 -1
  257. package/dist/mint-components/{p-8edba448.js → p-f7e2418a.js} +1 -1
  258. package/dist/mint-components/{p-f7118fd5.js → p-f8abbd79.js} +1 -1
  259. package/dist/mint-components/{p-92671ed2.system.entry.js → p-fc90a3fe.system.entry.js} +1 -1
  260. package/dist/types/{stories → components/sqm-asset-card}/AssetCard.stories.d.ts +0 -0
  261. package/dist/types/{stories → components/sqm-big-stat}/BigStat.stories.d.ts +0 -0
  262. package/dist/types/{stories → components/sqm-big-stat}/UseBigStat.stories.d.ts +6 -0
  263. package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +1 -0
  264. package/dist/types/components/sqm-big-stat/sqm-big-stat.d.ts +0 -6
  265. package/dist/types/components/sqm-big-stat/useBigStat.d.ts +4 -1
  266. package/dist/types/{stories → components/sqm-divided-layout}/DividedLayout.stories.d.ts +0 -0
  267. package/dist/types/{stories → components/sqm-edit-profile}/EditProfileForm.stories.d.ts +0 -0
  268. package/dist/types/{stories → components/sqm-edit-profile}/UseEditProfile.stories.d.ts +0 -0
  269. package/dist/types/{stories → components/sqm-form-message}/FormMessage.stories.d.ts +0 -0
  270. package/dist/types/{stories → components/sqm-hero}/Hero.stories.d.ts +0 -0
  271. package/dist/types/{stories → components/sqm-leaderboard}/Leaderboard.stories.d.ts +0 -0
  272. package/dist/types/{stories → components/sqm-leaderboard}/UseLeaderboard.stories.d.ts +0 -0
  273. package/dist/types/{stories → components/sqm-leaderboard-rank}/LeaderboardRank.stories.d.ts +0 -0
  274. package/dist/types/{stories → components/sqm-name-fields}/NameFields.stories.d.ts +0 -0
  275. package/dist/types/{stories → components/sqm-navigation-sidebar}/NavigationSidebar.stories.d.ts +0 -0
  276. package/dist/types/{stories → components/sqm-navigation-sidebar-item}/SidebarItem.stories.d.ts +0 -0
  277. package/dist/types/{stories → components/sqm-password-field}/PasswordField.stories.d.ts +0 -0
  278. package/dist/types/{stories → components/sqm-portal-change-password}/ChangePassword.stories.d.ts +0 -0
  279. package/dist/types/{stories → components/sqm-portal-email-verification}/PortalEmailVerification.stories.d.ts +0 -0
  280. package/dist/types/{stories → components/sqm-portal-footer}/PortalFooter.stories.d.ts +0 -0
  281. package/dist/types/{stories → components/sqm-portal-forgot-password}/PortalForgotPassword.stories.d.ts +0 -0
  282. package/dist/types/{stories → components/sqm-portal-frame}/PortalFrame.stories.d.ts +0 -0
  283. package/dist/types/{stories → components/sqm-portal-login}/PortalLogin.stories.d.ts +0 -0
  284. package/dist/types/{stories → components/sqm-portal-profile}/PortalProfile.stories.d.ts +0 -0
  285. package/dist/types/{stories → components/sqm-portal-register}/PortalRegister.stories.d.ts +0 -0
  286. package/dist/types/{stories → components/sqm-portal-reset-password}/PortalResetPassword.stories.d.ts +0 -0
  287. package/dist/types/{stories → components/sqm-portal-verify-email}/PortalVerifyEmail.stories.d.ts +0 -0
  288. package/dist/types/{stories → components/sqm-program-menu}/ProgramMenu.stories.d.ts +0 -0
  289. package/dist/types/{stories → components/sqm-referral-iframe}/ReferralIframe.stories.d.ts +0 -0
  290. package/dist/types/{stories → components/sqm-referral-table}/ReferralTable.stories.d.ts +0 -0
  291. package/dist/types/{stories → components/sqm-referral-table}/ReferralTableCell.stories.d.ts +0 -0
  292. package/dist/types/{stories → components/sqm-referral-table}/ReferralTableRewardsCell.stories.d.ts +0 -0
  293. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +6 -0
  294. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +81 -0
  295. package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +3 -0
  296. package/dist/types/components/sqm-reward-exchange-list/UseRewardExchangeList.stories.d.ts +28 -0
  297. package/dist/types/components/sqm-reward-exchange-list/progressBar.d.ts +4 -0
  298. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +25 -0
  299. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list.d.ts +20 -0
  300. package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +43 -0
  301. package/dist/types/components/sqm-rewards-table/UseRewardsTable.stories.d.ts +16 -0
  302. package/dist/types/components/sqm-rewards-table/sqm-rewards-table-column.d.ts +20 -0
  303. package/dist/types/components/sqm-rewards-table/sqm-rewards-table.d.ts +32 -0
  304. package/dist/types/components/sqm-rewards-table/useRewardsTable.d.ts +38 -0
  305. package/dist/types/{stories → components/sqm-router}/Router.stories.d.ts +0 -0
  306. package/dist/types/{stories → components/sqm-share-button}/ShareButton.stories.d.ts +0 -0
  307. package/dist/types/{stories → components/sqm-share-button}/UseShareButton.stories.d.ts +0 -0
  308. package/dist/types/{stories → components/sqm-share-link}/ShareLink.stories.d.ts +0 -0
  309. package/dist/types/{stories → components/sqm-share-link}/UseShareLink.stories.d.ts +0 -0
  310. package/dist/types/components/sqm-task-card/Matrix.d.ts +11 -0
  311. package/dist/types/components/sqm-task-card/SVGs.d.ts +2 -0
  312. package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +11 -0
  313. package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +10 -0
  314. package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +1 -0
  315. package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +10 -0
  316. package/dist/types/components/sqm-task-card/progress-bar/progress-bar.stories.d.ts +12 -0
  317. package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +16 -0
  318. package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +73 -0
  319. package/dist/types/components/sqm-user-name/UserName.stories.d.ts +6 -0
  320. package/dist/types/components.d.ts +269 -10
  321. package/dist/types/global/styles.d.ts +1 -1
  322. package/dist/types/tables/GenericTableView.d.ts +29 -0
  323. package/dist/types/tables/TableSlots.d.ts +8 -0
  324. package/dist/types/{components/sqm-referral-table → tables}/re-render.d.ts +0 -0
  325. package/dist/types/{components/sqm-referral-table → tables}/sqm-table-cell.d.ts +0 -0
  326. package/dist/types/{components/sqm-referral-table → tables}/sqm-table-row.d.ts +0 -0
  327. package/dist/types/{components/sqm-referral-table → tables}/useChildElements.d.ts +0 -0
  328. package/grapesjs/grapesjs.js +1 -1
  329. package/package.json +2 -2
  330. package/dist/esm-es5/sqm-divided-layout_26.entry.js +0 -1
  331. package/dist/esm-es5/useDemoBigStat-531a4d2a.js +0 -1
  332. package/dist/mint-components/p-0ed2de6a.js +0 -1
  333. package/dist/mint-components/p-253d07a3.system.entry.js +0 -1
  334. package/dist/mint-components/p-3ace9bab.entry.js +0 -230
  335. package/dist/mint-components/p-3e5c8dc2.entry.js +0 -1
  336. package/dist/mint-components/p-3fc2b5d4.system.js +0 -1
  337. package/dist/mint-components/p-420e50a8.entry.js +0 -1
  338. package/dist/mint-components/p-44a83e6e.system.js +0 -1
  339. package/dist/mint-components/p-4a9dcc1f.system.js +0 -1
  340. package/dist/mint-components/p-52be0df6.js +0 -227
  341. package/dist/mint-components/p-54d90d9f.system.entry.js +0 -1
  342. package/dist/mint-components/p-a60e8e00.system.entry.js +0 -1
  343. package/dist/mint-components/p-c6f2d1f4.system.entry.js +0 -1
  344. package/dist/types/stories/UserName.stories.d.ts +0 -6
@@ -1,8 +1,8 @@
1
- import { h, r as registerInstance, c as Host } from './index-17b4da69.js';
1
+ import { h, r as registerInstance, c as Host, d as getAssetPath } from './index-17b4da69.js';
2
2
  import { m as h$1, j as useState, e as useEffect, f as useRef, n as d$2, y as y$1, b as browser, u as useReducer, c as createCommonjsModule, a as commonjsGlobal, k as useMemo } from './extends-3a3f9fe2.js';
3
- import { i as intl, a as insertCSS } from './global-5dfb4fa8.js';
3
+ import { i as intl, a as insertCSS } from './global-107bb084.js';
4
4
  import { u as useCallback } from './use-callback-b38a1523.js';
5
- import { d as dist, T as T$1, e as en, b as be, j as j$1, Z as Ze, r as rn, D as De, q as qe, P as P$1, E as Ee, M as M$1, a as sn, c as an, x as x$1, f as D$1, L as L$1 } from './index.module-07f3fbb0.js';
5
+ import { d as dist, T as T$1, e as en, b as be, j as j$1, Z as Ze, r as rn, D as De, q as qe, P as P$1, E as Ee, M as M$1, a as sn, c as an, x as x$1, f as D$1, L as L$1, N as Ne, A as A$1 } from './index.module-1f571929.js';
6
6
  import { j as jsonpointer } from './jsonpointer-388a7082.js';
7
7
  import { j as jss, c as create } from './jss-preset-default.esm-71fae192.js';
8
8
  import { g as getProps, a as getMissingProps } from './utils-454405f5.js';
@@ -11,21 +11,21 @@ import { E as ErrorStyles, H as HostBlock, A as AuthWrapper, a as AuthColumn, b
11
11
  import { P as PortalContainerView } from './sqm-portal-container-view-73757ca5.js';
12
12
  import { P as PortalSectionView } from './sqm-portal-section-view-f0876545.js';
13
13
  import { T as TextSpanView } from './sqm-text-span-view-1781df94.js';
14
- import { g as gql, L as LeaderboardRankView } from './sqm-leaderboard-rank-view-04161da4.js';
15
- import { u as useRerenderListener } from './re-render-0be5746e.js';
16
- import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-531a4d2a.js';
14
+ import { g as gql, L as LeaderboardRankView } from './sqm-leaderboard-rank-view-c1aefdd5.js';
15
+ import { u as useRerenderListener, a as useRequestRerender } from './re-render-76c9129f.js';
16
+ import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-49cdfe32.js';
17
17
  import { S as ShareLinkView } from './sqm-share-link-view-9282b8e8.js';
18
- import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-7cbc6390.js';
18
+ import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-aa087ef2.js';
19
19
  import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-2242502c.js';
20
- import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-78631800.js';
20
+ import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-b3618185.js';
21
21
  import { S as StatContainerView } from './sqm-stat-container-view-4133feb6.js';
22
- import { P as PortalProfileView } from './sqm-portal-profile-view-636a8688.js';
22
+ import { P as PortalProfileView } from './sqm-portal-profile-view-2fbb0845.js';
23
23
  import { P as PortalForgotPasswordView } from './sqm-portal-forgot-password-view-e3a6a716.js';
24
- import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-d6ffe3b8.js';
24
+ import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-df0559b0.js';
25
25
  import { P as PortalResetPasswordView$1 } from './sqm-portal-reset-password-view-a4e50da2.js';
26
26
  import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-6f18bac2.js';
27
27
  import { A as AssetCardView } from './sqm-asset-card-view-6f360937.js';
28
- import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-5aa288c9.js';
28
+ import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-2b2bfc9e.js';
29
29
  import { H as HeroView } from './sqm-hero-view-bfd8abd1.js';
30
30
  import { N as NameFieldsView } from './sqm-name-fields-view-4162fb7b.js';
31
31
 
@@ -14745,6 +14745,927 @@ const ReferralTableUserCell = class {
14745
14745
  }
14746
14746
  };
14747
14747
 
14748
+ const GET_EXCHANGE_LIST = dist.gql `
14749
+ query getExchangeList {
14750
+ viewer {
14751
+ ... on User {
14752
+ visibleRewardExchangeItems(limit: 20, offset: 0) {
14753
+ data {
14754
+ key
14755
+ name
14756
+ description
14757
+ imageUrl
14758
+ available
14759
+ unavailableReason
14760
+ unavailableReasonCode
14761
+ ruleType
14762
+ sourceUnit
14763
+ sourceValue
14764
+ prettySourceValue
14765
+ sourceMinValue
14766
+ prettySourceMinValue
14767
+ sourceMaxValue
14768
+ prettySourceMaxValue
14769
+ destinationMinValue
14770
+ prettyDestinationMinValue
14771
+ destinationMaxValue
14772
+ prettyDestinationMaxValue
14773
+ globalRewardKey
14774
+ destinationUnit
14775
+ steps {
14776
+ sourceValue
14777
+ prettySourceValue
14778
+ destinationValue
14779
+ prettyDestinationValue
14780
+ available
14781
+ unavailableReasonCode
14782
+ }
14783
+ }
14784
+ totalCount
14785
+ }
14786
+ }
14787
+ }
14788
+ }
14789
+ `;
14790
+ const EXCHANGE = dist.gql `
14791
+ mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {
14792
+ exchangeReward(exchangeRewardInput: $exchangeRewardInput) {
14793
+ reward {
14794
+ id
14795
+ fuelTankCode
14796
+ }
14797
+ }
14798
+ }
14799
+ `;
14800
+ function useRewardExchangeList(props) {
14801
+ var _a, _b, _c, _d;
14802
+ const drawerRef = useRef();
14803
+ const [exchangeState, setExchangeState] = useReducer((state, next) => ({
14804
+ ...state,
14805
+ ...next,
14806
+ }), {
14807
+ selectedItem: undefined,
14808
+ selectedStep: undefined,
14809
+ redeemStage: "chooseReward",
14810
+ amount: 0,
14811
+ exchangeError: false,
14812
+ });
14813
+ const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
14814
+ const user = T$1();
14815
+ const [exchange, { data: exchangeResponse, errors }] = be(EXCHANGE);
14816
+ const { data, loading } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
14817
+ useEffect(() => {
14818
+ var _a, _b;
14819
+ if ((_b = (_a = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _a === void 0 ? void 0 : _a.reward) === null || _b === void 0 ? void 0 : _b.id) {
14820
+ setExchangeState({ redeemStage: "success" });
14821
+ }
14822
+ if (!!errors) {
14823
+ console.log("YEA");
14824
+ setExchangeState({ exchangeError: true });
14825
+ }
14826
+ }, [exchangeResponse, errors]);
14827
+ function openDrawer() {
14828
+ var _a;
14829
+ setExchangeState({ redeemStage: "chooseReward" });
14830
+ (_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.show();
14831
+ }
14832
+ function exchangeReward() {
14833
+ if (!selectedItem)
14834
+ return;
14835
+ let exchangeVariables = {
14836
+ accountId: user === null || user === void 0 ? void 0 : user.accountId,
14837
+ userId: user.id,
14838
+ };
14839
+ switch (selectedItem.ruleType) {
14840
+ case "FIXED_GLOBAL_REWARD":
14841
+ exchangeVariables = {
14842
+ ...exchangeVariables,
14843
+ redeemCreditInput: {
14844
+ amount: selectedItem.sourceValue,
14845
+ unit: selectedItem.sourceUnit,
14846
+ },
14847
+ globalRewardKey: selectedItem.globalRewardKey,
14848
+ };
14849
+ break;
14850
+ case "VARIABLE_GLOBAL_REWARD":
14851
+ exchangeVariables = {
14852
+ ...exchangeVariables,
14853
+ redeemCreditInput: {
14854
+ amount: amount,
14855
+ unit: selectedItem.sourceUnit,
14856
+ },
14857
+ globalRewardKey: selectedItem.globalRewardKey,
14858
+ rewardInput: {
14859
+ valueInCents: selectedStep.destinationValue,
14860
+ },
14861
+ };
14862
+ break;
14863
+ case "VARIABLE_CREDIT_REWARD":
14864
+ exchangeVariables = {
14865
+ ...exchangeVariables,
14866
+ redeemCreditInput: {
14867
+ amount: amount,
14868
+ unit: selectedItem.sourceUnit,
14869
+ },
14870
+ rewardInput: {
14871
+ type: "CREDIT",
14872
+ unit: selectedItem.destinationUnit,
14873
+ assignedCredit: selectedStep.destinationValue,
14874
+ },
14875
+ };
14876
+ break;
14877
+ default:
14878
+ exchangeVariables = {
14879
+ ...exchangeVariables,
14880
+ redeemCreditInput: {
14881
+ amount: selectedItem.sourceValue,
14882
+ unit: selectedItem.sourceUnit,
14883
+ },
14884
+ globalRewardKey: selectedItem.globalRewardKey,
14885
+ };
14886
+ }
14887
+ exchange({ exchangeRewardInput: exchangeVariables });
14888
+ }
14889
+ const resetState = useCallback((e) => {
14890
+ var _a, _b;
14891
+ // selects also trigger an sl-hide event :(
14892
+ //@ts-ignore - componentId is not private here
14893
+ if (((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.componentId) !== ((_b = drawerRef.current) === null || _b === void 0 ? void 0 : _b.componentId))
14894
+ return;
14895
+ setExchangeState({
14896
+ amount: 0,
14897
+ selectedStep: undefined,
14898
+ selectedItem: undefined,
14899
+ exchangeError: false,
14900
+ });
14901
+ }, []);
14902
+ useEffect(() => {
14903
+ if (!(drawerRef === null || drawerRef === void 0 ? void 0 : drawerRef.current))
14904
+ return;
14905
+ const drawer = drawerRef.current;
14906
+ // Clear input value when drawer is closed
14907
+ drawer.addEventListener("sl-hide", resetState);
14908
+ return () => {
14909
+ drawer.removeEventListener("sl-hide", resetState);
14910
+ };
14911
+ }, [drawerRef.current]);
14912
+ function setStage(stage) {
14913
+ setExchangeState({ redeemStage: stage });
14914
+ }
14915
+ return {
14916
+ states: {
14917
+ content: {
14918
+ text: props,
14919
+ },
14920
+ selectedItem,
14921
+ redeemStage,
14922
+ amount,
14923
+ selectedStep,
14924
+ exchangeError,
14925
+ loading,
14926
+ },
14927
+ data: {
14928
+ exchangeList: (_b = (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.visibleRewardExchangeItems) === null || _b === void 0 ? void 0 : _b.data,
14929
+ //@ts-ignore
14930
+ fuelTankCode: (_d = (_c = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _c === void 0 ? void 0 : _c.reward) === null || _d === void 0 ? void 0 : _d.fuelTankCode,
14931
+ },
14932
+ callbacks: {
14933
+ exchangeReward,
14934
+ openDrawer,
14935
+ setExchangeState,
14936
+ setStage,
14937
+ },
14938
+ refs: {
14939
+ drawerRef,
14940
+ },
14941
+ };
14942
+ }
14943
+
14944
+ const LeftArrow = () => (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { marginBottom: "-2px", marginRight: "5px" } },
14945
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.34655 1.90573C7.75405 2.31323 7.75405 2.97392 7.34655 3.38143L3.56266 7.16531H14.9565C15.5328 7.16531 16 7.6325 16 8.20879C16 8.78509 15.5328 9.25227 14.9565 9.25227H3.56266L7.69437 13.384C8.10188 13.7915 8.10188 14.4522 7.69437 14.8597C7.28687 15.2672 6.62617 15.2672 6.21867 14.8597L0.305628 8.94664C-0.101876 8.53914 -0.101876 7.87845 0.305628 7.47094L5.87084 1.90573C6.27835 1.49822 6.93904 1.49822 7.34655 1.90573Z", fill: "#858585" })));
14946
+ const ExchangeArrows = () => (h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14947
+ h("circle", { cx: "15", cy: "15", r: "15", fill: "white" }),
14948
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.6255 21.783C10.5129 21.8963 10.3597 21.96 10.2 21.96C10.0402 21.96 9.88705 21.8963 9.77442 21.783L5.87442 17.8597C5.64081 17.6247 5.64194 17.2448 5.87695 17.0112C6.11197 16.7775 6.49186 16.7787 6.72548 17.0137L9.59995 19.9054V8.52001C9.59995 8.18864 9.86858 7.92001 10.2 7.92001C10.5313 7.92001 10.8 8.18864 10.8 8.52001V19.9054L13.6744 17.0137C13.908 16.7787 14.2879 16.7775 14.5229 17.0112C14.758 17.2448 14.7591 17.6247 14.5255 17.8597L10.6255 21.783ZM20.2255 8.09707C20.1129 7.98378 19.9597 7.92007 19.8 7.92007C19.6402 7.92007 19.487 7.98378 19.3744 8.09707L15.4744 12.0204C15.2408 12.2554 15.2419 12.6353 15.477 12.8689C15.712 13.1025 16.0919 13.1014 16.3255 12.8664L19.2 9.97473V21.3601C19.2 21.6914 19.4686 21.9601 19.8 21.9601C20.1313 21.9601 20.4 21.6914 20.4 21.3601V9.97473L23.2744 12.8664C23.508 13.1014 23.8879 13.1025 24.1229 12.8689C24.358 12.6353 24.3591 12.2554 24.1255 12.0204L20.2255 8.09707Z", fill: "#333333" })));
14949
+ const CheckMark = () => (h("svg", { style: { top: "-4px", position: "relative", left: "2px" }, xmlns: "http://www.w3.org/2000/svg", width: "10", height: "7", viewBox: "0 0 10 7", fill: "none" },
14950
+ h("path", { d: "M2.12828 2.71485C1.72536 2.33712 1.09253 2.35754 0.714799 2.76045C0.337068 3.16336 0.357483 3.7962 0.760395 4.17393L2.12828 2.71485ZM3.81471 5.66661L3.13076 6.39615C3.51542 6.75677 4.11399 6.75677 4.49865 6.39615L3.81471 5.66661ZM9.23939 1.95171C9.6423 1.57397 9.66271 0.941139 9.28498 0.538227C8.90725 0.135315 8.27442 0.114901 7.87151 0.492631L9.23939 1.95171ZM0.760395 4.17393L3.13076 6.39615L4.49865 4.93708L2.12828 2.71485L0.760395 4.17393ZM4.49865 6.39615L9.23939 1.95171L7.87151 0.492631L3.13076 4.93708L4.49865 6.39615Z", fill: "white" })));
14951
+
14952
+ function Dot({ active, completed, incomplete, }) {
14953
+ return (h("div", { style: {
14954
+ flex: "0 0 0",
14955
+ content: "''",
14956
+ height: "4px",
14957
+ borderRadius: "4px",
14958
+ background: incomplete ? "#E5E5E5" : "#9E9E9E",
14959
+ position: "relative",
14960
+ bottom: "0",
14961
+ left: "0",
14962
+ display: "flex",
14963
+ justifyContent: "center",
14964
+ columnGap: "50px",
14965
+ marginRight: "-2px",
14966
+ boxSizing: "content-box",
14967
+ } },
14968
+ h("div", { style: {
14969
+ backgroundColor: completed ? "#9E9E9E" : "#FFF",
14970
+ border: active
14971
+ ? "2px solid #9E9E9E"
14972
+ : incomplete
14973
+ ? "2px solid #E5E5E5"
14974
+ : "none",
14975
+ borderRadius: "50%",
14976
+ width: completed ? "14px" : "10px",
14977
+ height: completed ? "14px" : "10px",
14978
+ margin: "-5px auto 0px",
14979
+ zIndex: "1",
14980
+ boxSizing: "content-box",
14981
+ } }, completed && h(CheckMark, null))));
14982
+ }
14983
+ function ProgressLine({ incomplete = false, active = false }) {
14984
+ return (h("div", { style: {
14985
+ content: "''",
14986
+ flex: "0.5 0.5 0",
14987
+ height: "4px",
14988
+ borderRadius: "4px",
14989
+ background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
14990
+ position: "relative",
14991
+ bottom: "0",
14992
+ left: "0",
14993
+ display: "flex",
14994
+ justifyContent: "center",
14995
+ columnGap: "50px",
14996
+ marginRight: "-2px",
14997
+ boxSizing: "content-box",
14998
+ } }));
14999
+ }
15000
+ function Progress({ active, completed, incomplete }) {
15001
+ return [
15002
+ h(ProgressLine, { incomplete: incomplete }),
15003
+ h(Dot, { active: active, completed: completed, incomplete: incomplete }),
15004
+ h(ProgressLine, { incomplete: incomplete, active: active }),
15005
+ ];
15006
+ }
15007
+ function ProgressBar({ stageCount, currentStage, }) {
15008
+ return (h("div", { style: { display: "flex", columnGap: "-2px" } }, Array.from(Array(stageCount).keys()).map((stage) => (h(Progress, { active: currentStage === stage, completed: currentStage > stage, incomplete: currentStage < stage })))));
15009
+ }
15010
+
15011
+ const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
15012
+ const stageProgressList = {
15013
+ chooseReward: "Choose reward",
15014
+ chooseAmount: "Amount",
15015
+ confirmation: "Confirm",
15016
+ };
15017
+ function RewardExchangeView(props) {
15018
+ const style = {
15019
+ Container: {
15020
+ position: "relative",
15021
+ },
15022
+ CardContainer: {
15023
+ "&:hover": {
15024
+ boxShadow: "0 3px 10px #87ceeb6e!important",
15025
+ },
15026
+ },
15027
+ Base: {
15028
+ display: "flex",
15029
+ cursor: "pointer",
15030
+ textAlign: "center",
15031
+ height: "120px",
15032
+ "&::part(base)": {
15033
+ width: "100%",
15034
+ maxWidth: "350px",
15035
+ display: "flex",
15036
+ margin: "0 auto",
15037
+ },
15038
+ "&::part(body)": {
15039
+ padding: 0,
15040
+ display: "flex",
15041
+ width: "100%",
15042
+ },
15043
+ },
15044
+ Drawer: {
15045
+ "&::part(base)": {
15046
+ minWidth: "400px",
15047
+ maxWidth: "700px",
15048
+ width: "50%",
15049
+ margin: "0 auto",
15050
+ right: "0",
15051
+ },
15052
+ "&::part(panel)": {
15053
+ height: "85vh",
15054
+ width: "100%",
15055
+ },
15056
+ },
15057
+ FullImage: {
15058
+ objectFit: "contain",
15059
+ maxWidth: "100%",
15060
+ height: "100px",
15061
+ },
15062
+ PreviewImage: {
15063
+ objectFit: "contain",
15064
+ width: "120px",
15065
+ height: "120px",
15066
+ flex: 0.33,
15067
+ },
15068
+ InputBox: {
15069
+ width: "100%",
15070
+ marginBottom: "20px",
15071
+ },
15072
+ Select: {
15073
+ "&::part(base)": {
15074
+ flex: "0.75",
15075
+ },
15076
+ "&::part(menu)": {
15077
+ maxHeight: "40vh",
15078
+ },
15079
+ },
15080
+ Buttons: {
15081
+ marginLeft: "auto",
15082
+ width: "100%",
15083
+ maxWidth: "300px",
15084
+ },
15085
+ Button: {
15086
+ margin: "10px 0",
15087
+ display: "block",
15088
+ textAlign: "center",
15089
+ cursor: "pointer",
15090
+ },
15091
+ ProgressBar: {
15092
+ fontSize: "80%",
15093
+ marginBottom: "20px",
15094
+ "& .text-area": {
15095
+ marginTop: "5px",
15096
+ display: "flex",
15097
+ justifyContent: "center",
15098
+ textAlign: "center",
15099
+ whiteSpace: "nowrap",
15100
+ marginBottom: "6px",
15101
+ "& .text": {
15102
+ flex: "1 1 0",
15103
+ },
15104
+ "& .text.subdued": {
15105
+ color: "#BDBDBD",
15106
+ },
15107
+ },
15108
+ },
15109
+ };
15110
+ // JSS config
15111
+ jss.setup(create());
15112
+ const sheet = jss.createStyleSheet(style);
15113
+ const styleString = sheet.toString();
15114
+ const { states, data, callbacks, refs } = props;
15115
+ const { selectedItem, selectedStep } = states;
15116
+ function getInput() {
15117
+ var _a, _b;
15118
+ const item = states.selectedItem;
15119
+ if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
15120
+ return h("span", null);
15121
+ if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
15122
+ return h("p", null,
15123
+ "Not enough ",
15124
+ item.sourceUnit,
15125
+ " to redeem for this reward.");
15126
+ }
15127
+ return (h("sl-select", { style: { width: "auto" }, label: "Select amount to receive", class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
15128
+ var _a, _b, _c, _d, _e;
15129
+ return callbacks.setExchangeState({
15130
+ amount: (_c = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.sourceValue,
15131
+ selectedStep: (_e = (_d = e.detail) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.value,
15132
+ });
15133
+ } }, (_b = item.steps) === null || _b === void 0 ? void 0 : _b.map((step) => (h("sl-menu-item", { value: step, disabled: !step.available },
15134
+ step.prettyDestinationValue,
15135
+ h("div", { slot: "suffix", style: { fontSize: "75%", float: "right" } },
15136
+ step.prettySourceValue,
15137
+ step.unavailableReasonCode && (h("p", { style: { fontSize: "70%", color: "#F2994A" } }, step.unavailableReasonCode))))))));
15138
+ }
15139
+ function chooseReward() {
15140
+ var _a;
15141
+ const nextStage = "chooseAmount";
15142
+ // console.log({ nextStage, ruleType: selectedItem?.ruleType });
15143
+ return [
15144
+ h("div", { style: {
15145
+ display: "grid",
15146
+ justifyContent: "center",
15147
+ gap: "20px",
15148
+ gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
15149
+ } }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
15150
+ const style = {
15151
+ boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) ? "0 1px 8px #87ceeb" : "none",
15152
+ marginBottom: "10px 0",
15153
+ flex: "1",
15154
+ minWidth: "100%",
15155
+ color: !item.available && "#eee",
15156
+ };
15157
+ const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
15158
+ ? item.prettySourceValue
15159
+ : `${item.sourceMinValue} to ${item.prettySourceMaxValue}`;
15160
+ return (h("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
15161
+ h("sl-card", { class: sheet.classes.Base, onClick: () => item.available &&
15162
+ callbacks.setExchangeState({ selectedItem: item }) },
15163
+ // item?.imageUrl &&
15164
+ h("img", { class: sheet.classes.PreviewImage, src: (item === null || item === void 0 ? void 0 : item.imageUrl) || getAssetPath("./assets/Reward-icon.png") }),
15165
+ h("p", { style: {
15166
+ textAlign: "left",
15167
+ margin: "0",
15168
+ flex: "1",
15169
+ fontSize: "90%",
15170
+ padding: "8px"
15171
+ } },
15172
+ h("b", null, item.description),
15173
+ h("p", { style: { margin: "0" } }, amount),
15174
+ item.unavailableReasonCode && (h("p", { style: {
15175
+ fontSize: "70%",
15176
+ color: "#F2994A",
15177
+ marginTop: "0",
15178
+ } }, item.unavailableReasonCode ===
15179
+ "INSUFFICIENT_REDEEMABLE_CREDIT"
15180
+ ? "Not enough points"
15181
+ : item.unavailableReasonCode))))));
15182
+ })),
15183
+ h("div", { class: sheet.classes.Buttons },
15184
+ h("sl-button", { onClick: () => callbacks.setStage(nextStage), style: { display: "block" }, class: sheet.classes.Button, disabled: !states.selectedItem }, "Continue"),
15185
+ h("a", {
15186
+ // onClick={() => refs.drawerRef.current?.hide()}
15187
+ style: { display: "block" }, class: sheet.classes.Button }, "Cancel")),
15188
+ ];
15189
+ }
15190
+ function chooseAmount() {
15191
+ const input = getInput();
15192
+ return (h("div", null,
15193
+ h("div", { style: { width: "50%", margin: "0 auto" } }, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) && (h("img", { class: sheet.classes.FullImage, src: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl }))),
15194
+ h("p", null, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description),
15195
+ h("div", { class: sheet.classes.InputBox }, input),
15196
+ h("div", { class: sheet.classes.Buttons },
15197
+ h("sl-button", { onClick: () => callbacks.setStage("confirmation"), disabled: input && !states.amount, style: { display: "block" }, class: sheet.classes.Button }, "Continue"),
15198
+ h("a", { onClick: () => callbacks.setStage("chooseReward"), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
15199
+ }
15200
+ // console.log({ selectedItem, selectedStep });
15201
+ function confirmation() {
15202
+ const previousStage = "chooseAmount";
15203
+ return (h("div", null,
15204
+ h("h2", null, "Confirm and redeem"),
15205
+ h("div", { style: { textAlign: "center" } },
15206
+ h("p", null,
15207
+ h("b", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue)),
15208
+ h("p", null,
15209
+ h(ExchangeArrows, null)),
15210
+ h("div", { class: sheet.classes.CardContainer, style: {
15211
+ boxShadow: "none",
15212
+ marginBottom: "10px",
15213
+ flex: "1",
15214
+ minWidth: "100%",
15215
+ } },
15216
+ h("sl-card", { class: sheet.classes.Base },
15217
+ h("img", { class: sheet.classes.PreviewImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
15218
+ getAssetPath("./assets/Reward-icon.png") }),
15219
+ h("p", { style: { marginBottom: "0", flex: "1" } }, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue)))),
15220
+ h("div", { class: sheet.classes.Buttons },
15221
+ h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
15222
+ h("a", { onClick: () => callbacks.setStage(previousStage), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
15223
+ }
15224
+ function success() {
15225
+ return (h("div", { style: { textAlign: "center" } },
15226
+ h("img", { class: sheet.classes.FullImage, src: getAssetPath("./assets/Reward-icon.png") }),
15227
+ h("p", { style: { color: "forestgreen" } }, "Reward Redeemed"),
15228
+ (data === null || data === void 0 ? void 0 : data.fuelTankCode) && h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode)));
15229
+ }
15230
+ const stages = {
15231
+ chooseReward: () => chooseReward(),
15232
+ chooseAmount: () => chooseAmount(),
15233
+ confirmation: () => confirmation(),
15234
+ success: () => success(),
15235
+ };
15236
+ const currentStage = stages[states.redeemStage];
15237
+ function stageMap() {
15238
+ const stageNumber = stageList.indexOf(states.redeemStage);
15239
+ return (h("div", { class: sheet.classes.ProgressBar },
15240
+ h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
15241
+ if (stage === states.redeemStage) {
15242
+ return h("span", { class: "text" }, stageProgressList[stage]);
15243
+ }
15244
+ else {
15245
+ return (h("span", { class: "text subdued" }, stageProgressList[stage]));
15246
+ }
15247
+ })),
15248
+ h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
15249
+ }
15250
+ const BackButton = () => {
15251
+ if (states.redeemStage === "success")
15252
+ return "";
15253
+ let previousStage = "";
15254
+ if (states.redeemStage === "confirmation") {
15255
+ previousStage = "chooseAmount";
15256
+ }
15257
+ else if (states.redeemStage === "chooseAmount") {
15258
+ previousStage = "chooseReward";
15259
+ }
15260
+ return (h("div", { slot: "label" },
15261
+ h("a", { style: { cursor: "pointer", fontSize: "80%", color: "#858585" }, onClick: () => callbacks.setStage(previousStage) },
15262
+ h(LeftArrow, null),
15263
+ " Back")));
15264
+ };
15265
+ console.log(props);
15266
+ return (h("div", { class: sheet.classes.Container },
15267
+ h("style", { type: "text/css" }, styleString),
15268
+ h("div", null,
15269
+ h(BackButton, null),
15270
+ stageMap(),
15271
+ currentStage && currentStage(),
15272
+ states.exchangeError &&
15273
+ "Something went wrong. Please contact support or try again.")));
15274
+ }
15275
+
15276
+ const SqmRewardExchangeList = class {
15277
+ constructor(hostRef) {
15278
+ registerInstance(this, hostRef);
15279
+ this.ignored = true;
15280
+ /**
15281
+ * @uiName Exchange button text
15282
+ */
15283
+ this.buttonText = "Exchange Rewards";
15284
+ h$1(this);
15285
+ }
15286
+ disconnectedCallback() { }
15287
+ render() {
15288
+ // const missingProps = getMissingProps([
15289
+ // {
15290
+ // attribute: "listType",
15291
+ // value: this.listType,
15292
+ // },
15293
+ // ]);
15294
+ // if (missingProps) {
15295
+ // return <RequiredPropsError missingProps={missingProps} />;
15296
+ // }
15297
+ const { states, data, callbacks, refs } = j$1()
15298
+ ? useRewardExchangeListDemo(getProps(this))
15299
+ : useRewardExchangeList(getProps(this));
15300
+ return (h(Host, { style: { display: "contents" } }, h(RewardExchangeView, { states: states, data: data, callbacks: callbacks, refs: refs })));
15301
+ }
15302
+ static get assetsDirs() { return ["assets"]; }
15303
+ };
15304
+ function useRewardExchangeListDemo(props) {
15305
+ return cjs({
15306
+ states: {
15307
+ content: {
15308
+ text: props,
15309
+ },
15310
+ redeemStage: "chooseReward",
15311
+ amount: 0,
15312
+ selectedStep: undefined,
15313
+ exchangeError: false,
15314
+ loading: false,
15315
+ },
15316
+ data: {
15317
+ shareCode: "SHARECODE123",
15318
+ },
15319
+ callbacks: {
15320
+ exchangeReward: () => { },
15321
+ openDrawer: () => { },
15322
+ setExchangeState: (_) => { },
15323
+ setStage: (_) => { },
15324
+ },
15325
+ refs: {
15326
+ drawerRef: {},
15327
+ },
15328
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
15329
+ }
15330
+
15331
+ const style$7 = {
15332
+ THead: {
15333
+ padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
15334
+ "text-align": "left",
15335
+ },
15336
+ TCell: {
15337
+ padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
15338
+ },
15339
+ TRow: {
15340
+ "border-top": "1px solid #EAEAEA",
15341
+ },
15342
+ Table: {
15343
+ "border-collapse": "collapse",
15344
+ width: "100%",
15345
+ },
15346
+ ButtonContainer: {
15347
+ display: "flex",
15348
+ "justify-content": "flex-end",
15349
+ "margin-top": "var(--sl-spacing-small)",
15350
+ ...gap({ direction: "row", size: "var(--sl-spacing-small)" }),
15351
+ },
15352
+ };
15353
+ jss.setup(create());
15354
+ const sheet$7 = jss.createStyleSheet(style$7);
15355
+ const styleString$7 = sheet$7.toString();
15356
+ function GenericTableView(props) {
15357
+ const { states, data, callbacks, elements } = props;
15358
+ const { columns, rows } = elements;
15359
+ const { show } = states;
15360
+ return (h("div", null,
15361
+ h("style", { type: "text/css" }, styleString$7),
15362
+ h("table", { class: sheet$7.classes.Table },
15363
+ data.textOverrides.showLabels && (h("thead", null,
15364
+ h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column) => (h("th", { class: sheet$7.classes.THead },
15365
+ h(TextSpanView, { type: "h3" }, column))))))),
15366
+ h("tbody", null,
15367
+ show === "loading" && elements.loadingElement,
15368
+ show === "empty" && elements.emptyElement,
15369
+ show === "rows" && (rows === null || rows === void 0 ? void 0 : rows.map((row, i) => (h("tr", { class: sheet$7.classes.TRow, style: {
15370
+ borderTop: `${!data.textOverrides.showLabels && i === 0 ? "none" : ""}`,
15371
+ }, part: "table-row" }, row.map((cell) => (h("td", { class: sheet$7.classes.TCell },
15372
+ h(TextSpanView, { type: "p" }, cell)))))))))),
15373
+ h("div", { class: sheet$7.classes.ButtonContainer, part: states.namespace + "-button-wrapper" },
15374
+ h("sl-button", { size: "small", disabled: !states.hasPrev, loading: show === "loading", onClick: callbacks.prevPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.prevLabel),
15375
+ h("sl-button", { size: "small", loading: show === "loading", disabled: !states.hasNext, onClick: callbacks.nextPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.moreLabel))));
15376
+ }
15377
+
15378
+ function LoadingSlot$1() {
15379
+ return (h("slot", { name: "loading" },
15380
+ h(LoadingSkeleton, null)));
15381
+ }
15382
+ function LoadingSkeleton() {
15383
+ return (h("div", { style: { width: "100%" } },
15384
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15385
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15386
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15387
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15388
+ h("sl-skeleton", null)));
15389
+ }
15390
+ function EmptySlot$1({ label }) {
15391
+ return (h("slot", { name: "empty" },
15392
+ h(EmptySkeleton, { label: label })));
15393
+ }
15394
+ function EmptySkeleton({ label }) {
15395
+ return (h("div", { style: { width: "100%" } },
15396
+ h("sqm-text", null,
15397
+ h("h3", { style: { color: "#777777" } }, label))));
15398
+ }
15399
+
15400
+ const CSS_NAMESPACE = "sqm-rewards-table";
15401
+ const GET_REWARDS = gql `
15402
+ query getRewards(
15403
+ $limit: Int!
15404
+ $offset: Int!
15405
+ $rewardFilter: RewardFilterInput
15406
+ ) {
15407
+ viewer {
15408
+ ... on User {
15409
+ id
15410
+ rewards(limit: $limit, offset: $offset, filter: $rewardFilter) {
15411
+ totalCount
15412
+ count
15413
+ data {
15414
+ id
15415
+ type
15416
+ value
15417
+ unit
15418
+ name
15419
+ dateGiven
15420
+ dateExpires
15421
+ dateCancelled
15422
+ dateRedeemed
15423
+ dateScheduledFor
15424
+ fuelTankCode
15425
+ fuelTankType
15426
+ currency
15427
+ prettyValue
15428
+ statuses
15429
+ globalRewardKey
15430
+ programRewardKey
15431
+ rewardRedemptionTransactions {
15432
+ data {
15433
+ exchangedRewards {
15434
+ data {
15435
+ prettyValue
15436
+ type
15437
+ fuelTankCode
15438
+ globalRewardKey
15439
+ }
15440
+ }
15441
+ }
15442
+ }
15443
+ }
15444
+ }
15445
+ }
15446
+ }
15447
+ }
15448
+ `;
15449
+ function useRewardsTable(props, emptyElement, loadingElement) {
15450
+ var _a, _b;
15451
+ const user = T$1();
15452
+ const programIdContext = M$1();
15453
+ // Default to context, overriden by props
15454
+ const programId = (_a = props.programId) !== null && _a !== void 0 ? _a : programIdContext;
15455
+ const rewardFilter = {
15456
+ userId_eq: user === null || user === void 0 ? void 0 : user.id,
15457
+ accountId_eq: user === null || user === void 0 ? void 0 : user.accountId,
15458
+ // If no program ID, shows all programs
15459
+ ...(programId
15460
+ ? programId === "classic"
15461
+ ? { programId_exists: false }
15462
+ : { programId_eq: programId }
15463
+ : {}),
15464
+ };
15465
+ const [content, setContent] = useReducer((state, next) => ({
15466
+ ...state,
15467
+ ...next,
15468
+ }), {
15469
+ columns: [],
15470
+ rows: [],
15471
+ loading: false,
15472
+ page: 0,
15473
+ });
15474
+ const { envelope: rewardsData, states, callbacks, } = sn(GET_REWARDS, (data) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.rewards; }, {
15475
+ limit: props.perPage,
15476
+ offset: 0,
15477
+ }, {
15478
+ rewardFilter,
15479
+ }, !(user === null || user === void 0 ? void 0 : user.jwt));
15480
+ const tick = useRerenderListener();
15481
+ const components = useChildElements();
15482
+ const data = rewardsData === null || rewardsData === void 0 ? void 0 : rewardsData.data;
15483
+ async function getComponentData(components) {
15484
+ // filter out loading and empty states from columns array
15485
+ const columnComponents = components.filter((component) => component.slot !== "loading" && component.slot !== "empty");
15486
+ // get the column titles (renderLabel is asynchronous)
15487
+ const columnsPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderLabel()));
15488
+ // get the column cells (renderCell is asynchronous)
15489
+ const cellsPromise = data === null || data === void 0 ? void 0 : data.map(async (r) => {
15490
+ const cellPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderCell([r], c)));
15491
+ const cells = await Promise.all(cellPromise);
15492
+ return cells;
15493
+ });
15494
+ const rows = cellsPromise && (await Promise.all(cellsPromise)).filter((i) => i);
15495
+ setContent({ rows });
15496
+ const columns = columnsPromise && (await Promise.all(columnsPromise));
15497
+ // Set the content to render and finish loading components
15498
+ setContent({ columns, loading: false, page: states.currentPage });
15499
+ }
15500
+ useEffect(() => {
15501
+ setContent({ loading: true });
15502
+ rewardsData && getComponentData(components);
15503
+ }, [rewardsData, components, tick]);
15504
+ const isEmpty = !((_b = content === null || content === void 0 ? void 0 : content.rows) === null || _b === void 0 ? void 0 : _b.length) && !(data === null || data === void 0 ? void 0 : data.length);
15505
+ console.log(states.loading, content.loading, rewardsData);
15506
+ const show =
15507
+ // 1 - Loading if loading
15508
+ states.loading || content.loading
15509
+ ? "loading"
15510
+ : // 2 - Empty if empty
15511
+ isEmpty
15512
+ ? "empty"
15513
+ : // 3 - Then show rows
15514
+ "rows";
15515
+ return {
15516
+ states: {
15517
+ hasNext: states.currentPage < states.pageCount - 1,
15518
+ hasPrev: states.currentPage > 0,
15519
+ show,
15520
+ namespace: CSS_NAMESPACE,
15521
+ },
15522
+ data: {
15523
+ textOverrides: {
15524
+ showLabels: props.showLabels,
15525
+ prevLabel: props.prevLabel,
15526
+ moreLabel: props.moreLabel,
15527
+ },
15528
+ },
15529
+ elements: {
15530
+ columns: content.columns,
15531
+ rows: content.rows,
15532
+ emptyElement,
15533
+ loadingElement,
15534
+ },
15535
+ callbacks: {
15536
+ nextPage: () => {
15537
+ callbacks.setCurrentPage(states.currentPage + 1);
15538
+ },
15539
+ prevPage: () => {
15540
+ callbacks.setCurrentPage(states.currentPage - 1);
15541
+ },
15542
+ },
15543
+ };
15544
+ }
15545
+ function generateUserError$1(e) {
15546
+ try {
15547
+ return JSON.stringify(e);
15548
+ }
15549
+ catch (e) {
15550
+ return "An unknown error";
15551
+ }
15552
+ }
15553
+ async function tryMethod$1(c, callback) {
15554
+ const tag = c.tagName.toLowerCase();
15555
+ await customElements.whenDefined(tag);
15556
+ let labelPromise;
15557
+ try {
15558
+ labelPromise = callback();
15559
+ }
15560
+ catch (e) {
15561
+ // renderLabel did not return a promise, so this method probably doesn't exist
15562
+ // therefore, we IGNORE the label
15563
+ if (callback.name === "renderReferrerCell") {
15564
+ console.error("column does not have a renderReferrerCell method.");
15565
+ }
15566
+ else {
15567
+ console.error("label promise failed", e);
15568
+ }
15569
+ return h("span", null);
15570
+ }
15571
+ try {
15572
+ return await labelPromise;
15573
+ }
15574
+ catch (e) {
15575
+ // The column returned a promise, and that promise failed.
15576
+ // This should not happen so we fail fast
15577
+ console.error("Error rendering label", e);
15578
+ const userError = generateUserError$1(e);
15579
+ return (h("details", null,
15580
+ h("summary", null, "Error"),
15581
+ userError));
15582
+ }
15583
+ }
15584
+
15585
+ const RewardsTable = class {
15586
+ constructor(hostRef) {
15587
+ registerInstance(this, hostRef);
15588
+ /** @uiName Number of rewards per page */
15589
+ this.perPage = 3;
15590
+ /** @uiName Show column labels */
15591
+ this.showLabels = true;
15592
+ /** @uiName Previous button text */
15593
+ this.prevLabel = "Prev";
15594
+ /** @uiName View More button text */
15595
+ this.moreLabel = "Next";
15596
+ /** @uiName Show Referred by user in table */
15597
+ this.showReferrer = false;
15598
+ h$1(this);
15599
+ }
15600
+ disconnectedCallback() { }
15601
+ render() {
15602
+ const empty = h(EmptySlot$1, { label: "No Rewards Yet" });
15603
+ const loading = h(LoadingSlot$1, null);
15604
+ const { states, data, callbacks, elements } = j$1()
15605
+ ? useRewardsTableDemo(this)
15606
+ : useRewardsTable(this, empty, loading);
15607
+ return (h(GenericTableView, { states: states, data: data, callbacks: callbacks, elements: elements }));
15608
+ }
15609
+ };
15610
+ function useRewardsTableDemo(props) {
15611
+ return cjs({
15612
+ states: {
15613
+ hasPrev: false,
15614
+ hasNext: false,
15615
+ loading: false,
15616
+ namespace: CSS_NAMESPACE,
15617
+ },
15618
+ callbacks: {
15619
+ prevPage: () => console.log("Prev"),
15620
+ nextPage: () => console.log("Next"),
15621
+ },
15622
+ data: {
15623
+ textOverrides: {
15624
+ showLabels: props.showLabels,
15625
+ prevLabel: props.prevLabel,
15626
+ moreLabel: props.moreLabel,
15627
+ },
15628
+ referralData: [],
15629
+ },
15630
+ elements: {
15631
+ emptyElement: h(EmptySkeleton, { label: "No Rewards Yet" }),
15632
+ loadingElement: h(LoadingSkeleton, null),
15633
+ // TODO: This should be smarter
15634
+ columns: [h("div", null, "Name"), h("div", null, "Email"), h("div", null, "DOB")],
15635
+ rows: [],
15636
+ },
15637
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
15638
+ }
15639
+
15640
+ const RewardsTableColumn = class {
15641
+ constructor(hostRef) {
15642
+ registerInstance(this, hostRef);
15643
+ /**
15644
+ * @uiName Reward column title
15645
+ */
15646
+ this.columnTitle = "Rewards";
15647
+ /**
15648
+ * @uiName Hide dropdown details of reward
15649
+ */
15650
+ this.hideDetails = false;
15651
+ h$1(this);
15652
+ }
15653
+ disconnectedCallback() { }
15654
+ //@ts-ignore
15655
+ async renderCell(data) {
15656
+ // TODO: Do the right thing with many rewards, pending rewards, canceled rewards
15657
+ console.log({ data });
15658
+ return (h("sqm-referral-table-rewards-cell", { rewards: data, hideDetails: this.hideDetails }));
15659
+ }
15660
+ async renderLabel() {
15661
+ return this.columnTitle;
15662
+ }
15663
+ render() {
15664
+ useRequestRerender([this.columnTitle]);
15665
+ return h(Host, { style: { display: "none" } });
15666
+ }
15667
+ };
15668
+
14748
15669
  const debug$1 = browser("sq:useRouter");
14749
15670
  function matchPath(pattern, page) {
14750
15671
  if (!pattern)
@@ -14837,19 +15758,19 @@ const SqmRouter = class {
14837
15758
  };
14838
15759
  SqmRouter.style = sqmRouterCss;
14839
15760
 
14840
- const style$7 = {
15761
+ const style$8 = {
14841
15762
  HostBlock: HostBlock,
14842
15763
  buttonStyle: {
14843
15764
  display: "block",
14844
15765
  },
14845
15766
  };
14846
15767
  jss.setup(create());
14847
- const sheet$7 = jss.createStyleSheet(style$7);
14848
- const styleString$7 = sheet$7.toString();
15768
+ const sheet$8 = jss.createStyleSheet(style$8);
15769
+ const styleString$8 = sheet$8.toString();
14849
15770
  function ShareButtonView(props, children) {
14850
15771
  return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
14851
- h("style", { type: "text/css" }, styleString$7),
14852
- h("sl-button", { class: sheet$7.classes.buttonStyle, loading: props.loading, disabled: props.disabled, pill: props.pill, size: props.size, type: props.type, onClick: props.onClick, exportparts: `base: ${props.type}sharebutton-base` },
15772
+ h("style", { type: "text/css" }, styleString$8),
15773
+ h("sl-button", { class: sheet$8.classes.buttonStyle, loading: props.loading, disabled: props.disabled, pill: props.pill, size: props.size, type: props.type, onClick: props.onClick, exportparts: `base: ${props.type}sharebutton-base` },
14853
15774
  !props.hideicon && (h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
14854
15775
  !props.hidetext && children)));
14855
15776
  }
@@ -15008,14 +15929,13 @@ const MessageLinkQuery$1 = dist.gql `
15008
15929
  }
15009
15930
  `;
15010
15931
  function useShareLink(props) {
15011
- var _a, _b, _c;
15932
+ var _a, _b;
15012
15933
  const { programId = M$1() } = props;
15013
15934
  const user = T$1();
15014
15935
  const { data } = en(MessageLinkQuery$1, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt));
15015
15936
  const shareString = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink) !== null && _b !== void 0 ? _b :
15016
15937
  // Shown during loading
15017
15938
  "...";
15018
- console.log((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.shareLink, shareString);
15019
15939
  const [open, setOpen] = useState(false);
15020
15940
  function onClick() {
15021
15941
  // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
@@ -16488,7 +17408,7 @@ var _createEmotion = createEmotion({
16488
17408
  function i$1(){return (i$1=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r]);}return n}).apply(this,arguments)}function s(n,t){return t||(t=n.slice(0)),n.raw=t,n}var a$1,l,u,c$1=css(a$1||(a$1=s(['\n width: 100vw;\n height: 100vh;\n\n .story-book-outer-div {\n .story-div {\n font-family: "Arial", sans-serif;\n font-size: 12px;\n }\n padding-bottom: 500px;\n }\n\n .story-div {\n position: fixed;\n box-sizing: border-box;\n top: 0;\n width: 250px;\n height: 100vh;\n z-index: 999;\n overflow-y: scroll;\n background: white;\n margin-bottom: 32px;\n }\n\n .header {\n padding: 24px 0 16px 16px;\n margin-bottom: 24px;\n color: white;\n background: #333;\n cursor: pointer;\n\n h2 {\n letter-spacing: 3px;\n font-weight: 400;\n }\n }\n\n .parentStoryList {\n list-style: none;\n padding-left: 16px;\n\n summary {\n margin-bottom: 4px;\n }\n }\n .parentStory {\n cursor: pointer;\n }\n .parentStory.selected {\n font-weight: bold;\n }\n\n .subStory {\n font-size: 12px;\n cursor: pointer;\n line-height: 1.5em;\n margin-top: 4px;\n\n a {\n display: block;\n padding: 4px 4px 4px 16px;\n }\n }\n .subStory:hover {\n background-color: #eee;\n }\n .subStory.selected {\n background-color: lightgreen;\n }\n\n .component {\n padding: 24px 16px;\n }\n\n h4.group-header {\n margin: 8px 0;\n text-transform: uppercase;\n font-weight: 600;\n font-size: 14px;\n color: #575757;\n }\n\n .group-wrapper {\n margin-bottom: 24px;\n }\n\n .dynamic-display-wrapper {\n position: fixed;\n display: flex;\n flex-direction: column;\n bottom: 0;\n left: 100%;\n padding: 16px;\n z-index: 1000;\n background: white;\n transform: translateX(-100%);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n\n & > :not(:first-child) {\n margin-top: 12px;\n }\n\n p {\n font-size: 12px;\n margin: 0;\n padding: 0;\n }\n\n .button-wrapper {\n display: flex;\n\n & > :not(:first-child) {\n margin-left: 12px;\n }\n }\n\n & button {\n border: 1px solid #eaeaea;\n background: white;\n border-radius: 4px;\n color: #777;\n padding: 4px 12px;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n &.active {\n background: #555;\n border-color: #555;\n color: white;\n }\n }\n }\n'])));function p$1(n,t){var o,r=t.story.title.split("/"),e=r[1]?r[0]:"_";return i$1({},n,((o={})[e]=[].concat(n[e]||[],[{story:i$1({},t.story,{title:r[1]||r[0]}),subs:t.subs}]).sort(function(n,t){return n.story.title.localeCompare(t.story.title)}),o))}function d$1(n){return {story:n.default,subs:function(n,t){if(null==n)return {};var o,r,e={},i=Object.keys(n);for(r=0;r<i.length;r++)t.indexOf(o=i[r])>=0||(e[o]=n[o]);return e}(n,["default"])}}function f(a,f){var b=f.h,y=void 0===b?h:b,g=f.title,m=void 0===g?"Stencilbook":g,x=f.homepage,h$1=void 0===x?y("h3",null,"Select a story!"):x,v=f.addons,k=void 0===v?[]:v,w=useMemo(function(){return a.map(d$1).reduce(p$1,{_:[]})},a),S=useState(void 0),C=S[0],z=S[1],O=null==C?void 0:C.key,j=useState("desktop"),T=j[0],_=j[1],B=useState(!0),D=B[0],L=B[1],N=useState(!1),q=N[0],A=N[1],M=function(){return y("div",{class:"dynamic-display-wrapper"},y("div",{class:"button-wrapper"},y("button",{class:"desktop"===T?"active":"",onClick:function(){return _("desktop")}},"Desktop"),y("button",{class:"tablet"===T?"active":"",onClick:function(){return _("tablet")}},"Tablet"),y("button",{class:"mobile"===T?"active":"",onClick:function(){return _("mobile")}},"Mobile")),y("p",null,"Note: Currently doesn't test breakpoints, use the native tester for now"),y("hr",null),y("button",{class:q?"active":"",onClick:function(){return A(function(n){return !n})}},"Toggle Dark Background"),y("hr",null),y("button",{class:D?"active":"",onClick:function(){return L(function(n){return !n})}},"Toggle Sidebar"))},P="mobile"===T?"375px":"tablet"===T?"768px":"1124px",V=css(l||(l=s(["\n max-width: ",";\n margin-left: ",";\n "])),P,D?"250px":"0px"),X=css(u||(u=s(["\n display: none;\n "])));document.body.style.backgroundColor=q?"#232323":"#fafafa";var E=function(n){var t=n.selected,o=k.reduce(function(n,o){return function(){return y(o,{story:i$1({},t)},y(n,null))}},null==t?void 0:t.story);return y(o,null)},F=function(){return y("div",{class:"story-book-outer-div"},y("div",{class:"story-div "+(D?"":X)},y("div",{class:"header",onClick:function(){z(void 0);}},y("h2",null,m)),y("ul",{class:"parentStoryList"},Object.keys(w).sort().map(function(n){return y("div",{class:"group-wrapper"},"_"!==n&&y("h4",{class:"group-header"},n),w[n].map(function(t){return y("li",{class:"parentStory"},y("details",{style:{marginBottom:"10px"}},y("summary",{style:{outline:"none"}},t.story.title),t.subs&&Object.keys(t.subs).map(function(o){var e=n+"/"+o,i=t.subs[o],s=i.storyName||lodash_startcase(o);return y("div",{class:"subStory "+(O===e?"selected":"")},y("a",{onClick:function(){return function(n,t,o,r){z({key:t,story:n,parent:o,label:r});}(i,e,t.story,s)}},s))})))}))}))),y(M,null),y("div",{class:"component "+V},!O&&h$1,O&&y("div",null,y("h3",null,C.label),y(E,{selected:C}))))};return {class:c$1,children:y(F,null),View:F,selected:C}}
16489
17409
 
16490
17410
  const ShareButton_stories = {
16491
- title: "Share Button",
17411
+ title: "Components/Share Button",
16492
17412
  };
16493
17413
  const WithIcon = () => {
16494
17414
  const props = { medium: "facebook", iconslot: "suffix" };
@@ -16544,7 +17464,7 @@ const ShareButton$1 = /*#__PURE__*/Object.freeze({
16544
17464
  });
16545
17465
 
16546
17466
  const ShareLink_stories = {
16547
- title: "Share Link",
17467
+ title: "Components/Share Link",
16548
17468
  };
16549
17469
  const Default = () => {
16550
17470
  const props = {
@@ -16585,14 +17505,15 @@ const ShareLink$1 = /*#__PURE__*/Object.freeze({
16585
17505
  });
16586
17506
 
16587
17507
  const BigStat_stories = {
16588
- title: "Big Stat",
17508
+ title: "Components/Big Stat",
16589
17509
  };
16590
17510
  const Default$1 = () => {
16591
- const props = { statvalue: "9.900,00" };
17511
+ const props = { value: 990000, statvalue: "9.900,00" };
16592
17512
  return h(BigStatView, Object.assign({}, props), "Big stat");
16593
17513
  };
16594
17514
  const LeftAlign = () => {
16595
17515
  const props = {
17516
+ value: 500,
16596
17517
  statvalue: "500",
16597
17518
  alignment: "left",
16598
17519
  };
@@ -16600,6 +17521,7 @@ const LeftAlign = () => {
16600
17521
  };
16601
17522
  const RightAlign = () => {
16602
17523
  const props = {
17524
+ value: 500,
16603
17525
  statvalue: "500",
16604
17526
  alignment: "right",
16605
17527
  };
@@ -16607,6 +17529,7 @@ const RightAlign = () => {
16607
17529
  };
16608
17530
  const FlexReverse = () => {
16609
17531
  const props = {
17532
+ value: 500,
16610
17533
  statvalue: "500",
16611
17534
  flexReverse: true,
16612
17535
  };
@@ -16614,6 +17537,7 @@ const FlexReverse = () => {
16614
17537
  };
16615
17538
  const FlexReverseRight = () => {
16616
17539
  const props = {
17540
+ value: 500,
16617
17541
  statvalue: "500",
16618
17542
  flexReverse: true,
16619
17543
  alignment: "right",
@@ -16622,6 +17546,7 @@ const FlexReverseRight = () => {
16622
17546
  };
16623
17547
  const FlexReverseLeft = () => {
16624
17548
  const props = {
17549
+ value: 500,
16625
17550
  statvalue: "500",
16626
17551
  flexReverse: true,
16627
17552
  alignment: "left",
@@ -16630,12 +17555,14 @@ const FlexReverseLeft = () => {
16630
17555
  };
16631
17556
  const NoStatValue = () => {
16632
17557
  const props = {
17558
+ value: 0,
16633
17559
  statvalue: "...",
16634
17560
  };
16635
17561
  return h(BigStatView, Object.assign({}, props), "Big stat");
16636
17562
  };
16637
17563
  const InvalidStatValue = () => {
16638
17564
  const props = {
17565
+ value: 0,
16639
17566
  statvalue: "!!!",
16640
17567
  };
16641
17568
  return h(BigStatView, Object.assign({}, props), "Big stat");
@@ -16655,7 +17582,7 @@ const BigStat = /*#__PURE__*/Object.freeze({
16655
17582
  });
16656
17583
 
16657
17584
  const Leaderboard_stories = {
16658
- title: "Leaderboard",
17585
+ title: "Components/Leaderboard",
16659
17586
  parameters: {
16660
17587
  tagname: "sqm-leaderboard",
16661
17588
  },
@@ -16932,7 +17859,7 @@ const Router = /*#__PURE__*/Object.freeze({
16932
17859
  });
16933
17860
 
16934
17861
  const LeaderboardRank_stories = {
16935
- title: "Leaderboard Rank",
17862
+ title: "Components/Leaderboard Rank",
16936
17863
  };
16937
17864
  const First = () => {
16938
17865
  const props = { data: { rank: "1st" } };
@@ -16979,7 +17906,7 @@ function setupLoggedOut() {
16979
17906
  };
16980
17907
  }
16981
17908
  const PortalFrame_stories = {
16982
- title: "Portal Frame",
17909
+ title: "Components/Portal Frame",
16983
17910
  };
16984
17911
  const defaultProps = {
16985
17912
  data: {
@@ -17074,7 +18001,7 @@ const PortalFrame$1 = /*#__PURE__*/Object.freeze({
17074
18001
  });
17075
18002
 
17076
18003
  const EditProfileForm_stories = {
17077
- title: "Edit Profile Form",
18004
+ title: "Components/Edit Profile Form",
17078
18005
  };
17079
18006
  const defaultProps$1 = {
17080
18007
  states: {
@@ -17361,6 +18288,9 @@ const RewardBalanceCashUSD = createHookStory(() => {
17361
18288
  const ProgramGoals = createHookStory(() => {
17362
18289
  const dummy = encodeURIComponent("Paid-Member-Goal/referrals");
17363
18290
  return View(`/programGoals/count/${dummy}`, "/(programGoals)/:metricType/:goalId");
18291
+ });
18292
+ const CustomField = createHookStory(() => {
18293
+ return View(`/customFields/thingCount`, "/(customFields)/:customField");
17364
18294
  });
17365
18295
 
17366
18296
  const UseBigStat = /*#__PURE__*/Object.freeze({
@@ -17392,7 +18322,8 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
17392
18322
  RewardsAvailableWithSlash: RewardsAvailableWithSlash,
17393
18323
  RewardBalance: RewardBalance,
17394
18324
  RewardBalanceCashUSD: RewardBalanceCashUSD,
17395
- ProgramGoals: ProgramGoals
18325
+ ProgramGoals: ProgramGoals,
18326
+ CustomField: CustomField
17396
18327
  });
17397
18328
 
17398
18329
  function setupGraphQL$4() {
@@ -17513,62 +18444,286 @@ const TopStartedReferrers = createHookStory(() => {
17513
18444
  ];
17514
18445
  });
17515
18446
 
17516
- const UseLeaderboard = /*#__PURE__*/Object.freeze({
18447
+ const UseLeaderboard = /*#__PURE__*/Object.freeze({
18448
+ __proto__: null,
18449
+ 'default': UseLeaderboard_stories,
18450
+ TopConvertedReferrers: TopConvertedReferrers,
18451
+ TopStartedReferrers: TopStartedReferrers
18452
+ });
18453
+
18454
+ const FormMessage_stories = {
18455
+ title: "Components/Form Message",
18456
+ };
18457
+ const SuccessAlert = () => {
18458
+ return (h("sqm-form-message", { type: "success" },
18459
+ h("div", null, "This is a success message.")));
18460
+ };
18461
+ const ErrorAlert = () => {
18462
+ return (h("sqm-form-message", { type: "error" },
18463
+ h("div", null, "This is an error message")));
18464
+ };
18465
+ const InfoAlert = () => {
18466
+ return (h("sqm-form-message", { type: "info" },
18467
+ h("div", null, "This is an info message")));
18468
+ };
18469
+ const FullStackSuccess = () => {
18470
+ return (h("sqm-form-message", { type: "success", exportparts: "successalert-icon" },
18471
+ h("div", { class: "AlertContent" },
18472
+ h("div", { part: "successalert-text" }, "Title"),
18473
+ h("div", { part: "successalert-subtext" }, "Body text."),
18474
+ h("sl-button", { type: "default", exportparts: "base: defaultbutton-base", onClick: () => {
18475
+ console.log("click");
18476
+ } }, "Primary Action"),
18477
+ h("sl-button", { class: "SecondaryTextButton", type: "text", onClick: () => {
18478
+ console.log("click");
18479
+ } }, "Secondary Action"))));
18480
+ };
18481
+
18482
+ const FormMessage$1 = /*#__PURE__*/Object.freeze({
18483
+ __proto__: null,
18484
+ 'default': FormMessage_stories,
18485
+ SuccessAlert: SuccessAlert,
18486
+ ErrorAlert: ErrorAlert,
18487
+ InfoAlert: InfoAlert,
18488
+ FullStackSuccess: FullStackSuccess
18489
+ });
18490
+
18491
+ const EXCHANGE$1 = dist.gql `
18492
+ mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {
18493
+ exchangeReward(exchangeRewardInput: $exchangeRewardInput) {
18494
+ reward {
18495
+ id
18496
+ }
18497
+ }
18498
+ }
18499
+ `;
18500
+ const UseRewardExchangeList_stories = {
18501
+ title: "Hooks / useRewardExchange",
18502
+ };
18503
+ function setupGraphQL$6() {
18504
+ const id = "testestest";
18505
+ const accountId = id;
18506
+ const programId = "sam-partner-test-2";
18507
+ //@ts-ignore
18508
+ window.widgetIdent = {
18509
+ tenantAlias: "test_a8b41jotf8a1v",
18510
+ appDomain: "https://staging.referralsaasquatch.com",
18511
+ programId,
18512
+ };
18513
+ useEffect(() => {
18514
+ L$1({
18515
+ accountId,
18516
+ id,
18517
+ jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
18518
+ });
18519
+ return () => {
18520
+ window.widgetIdent = undefined;
18521
+ L$1(undefined);
18522
+ };
18523
+ }, []);
18524
+ return { id, accountId };
18525
+ }
18526
+ function useExchangeButton() {
18527
+ const { id, accountId } = setupGraphQL$6();
18528
+ const [points, setPoints] = useState(10);
18529
+ const [rate, setRate] = useState(100);
18530
+ const [exchange, { data, errors }] = Ne(EXCHANGE$1);
18531
+ return {
18532
+ states: {
18533
+ points,
18534
+ rate,
18535
+ },
18536
+ data: {
18537
+ id,
18538
+ accountId,
18539
+ data,
18540
+ errors,
18541
+ },
18542
+ callbacks: {
18543
+ exchange,
18544
+ setPoints,
18545
+ setRate,
18546
+ },
18547
+ };
18548
+ }
18549
+ const DefaultView = (props) => {
18550
+ const { states, data, callbacks } = props;
18551
+ return (h("div", null,
18552
+ h("div", null,
18553
+ h("label", null, "Rate:"),
18554
+ h("input", { value: states.rate, onInput: (e) =>
18555
+ // @ts-ignore
18556
+ callbacks.setRate(e.target.value) })),
18557
+ h("input", { value: states.points, onInput: (e) =>
18558
+ // @ts-ignore
18559
+ callbacks.setPoints(e.target.value) }),
18560
+ h("button", { onClick: () => callbacks.exchange(props.input) }, "Exchange"),
18561
+ h("details", null,
18562
+ h("summary", null, "response"),
18563
+ h("h4", null, "data"),
18564
+ h("div", { style: { maxWidth: "500px" } },
18565
+ h("pre", { style: { width: "500px", whiteSpace: "pre-wrap" } }, JSON.stringify(data.data))),
18566
+ h("h4", null, "errors"),
18567
+ h("div", { style: { maxWidth: "500px" } },
18568
+ h("pre", { style: { maxWidth: "500px", whiteSpace: "pre-wrap" } }, JSON.stringify(data.errors))))));
18569
+ };
18570
+ const RewardList = createHookStory(() => {
18571
+ setupGraphQL$6();
18572
+ return (h("sqm-reward-exchange-list", { "list-type": "something" }));
18573
+ });
18574
+ const FixedGlobalReward = createHookStory(() => {
18575
+ const { states, data, callbacks } = useExchangeButton();
18576
+ return (h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
18577
+ exchangeRewardInput: {
18578
+ userId: data.id,
18579
+ accountId: data.accountId,
18580
+ redeemCreditInput: {
18581
+ amount: states.points,
18582
+ unit: "POINT",
18583
+ },
18584
+ globalRewardKey: "gc1",
18585
+ },
18586
+ } }));
18587
+ });
18588
+ const VariableGlobalReward = createHookStory(() => {
18589
+ const { states, data, callbacks } = useExchangeButton();
18590
+ return (h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
18591
+ exchangeRewardInput: {
18592
+ userId: data.id,
18593
+ accountId: data.accountId,
18594
+ redeemCreditInput: {
18595
+ amount: states.points,
18596
+ unit: "POINT",
18597
+ },
18598
+ globalRewardKey: "gc1",
18599
+ rewardInput: {
18600
+ valueInCents: Math.ceil(states.points * states.rate),
18601
+ },
18602
+ },
18603
+ } }));
18604
+ });
18605
+ const VariableCreditReward = createHookStory(() => {
18606
+ const { states, data, callbacks } = useExchangeButton();
18607
+ return (h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
18608
+ exchangeRewardInput: {
18609
+ userId: data.id,
18610
+ accountId: data.accountId,
18611
+ redeemCreditInput: {
18612
+ amount: states.points,
18613
+ unit: "POINT",
18614
+ },
18615
+ rewardInput: {
18616
+ type: "CREDIT",
18617
+ unit: "foo",
18618
+ assignedCredit: Math.ceil(states.points * states.rate),
18619
+ },
18620
+ },
18621
+ } }));
18622
+ });
18623
+
18624
+ const UseRewardExchangeList = /*#__PURE__*/Object.freeze({
18625
+ __proto__: null,
18626
+ 'default': UseRewardExchangeList_stories,
18627
+ RewardList: RewardList,
18628
+ FixedGlobalReward: FixedGlobalReward,
18629
+ VariableGlobalReward: VariableGlobalReward,
18630
+ VariableCreditReward: VariableCreditReward
18631
+ });
18632
+
18633
+ const UseRewardsTable_stories = {
18634
+ title: "Hooks / useRewardsTable",
18635
+ };
18636
+ function setupGraphQL$7() {
18637
+ const id = "testestest";
18638
+ const accountId = id;
18639
+ //@ts-ignore
18640
+ window.widgetIdent = {
18641
+ tenantAlias: "test_a8b41jotf8a1v",
18642
+ appDomain: "https://staging.referralsaasquatch.com",
18643
+ };
18644
+ useEffect(() => {
18645
+ L$1({
18646
+ accountId,
18647
+ id,
18648
+ jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
18649
+ });
18650
+ return () => {
18651
+ window.widgetIdent = undefined;
18652
+ L$1(undefined);
18653
+ };
18654
+ }, []);
18655
+ return { id, accountId };
18656
+ }
18657
+ const RewardsTableWithProgram = createHookStory(() => {
18658
+ setupGraphQL$7();
18659
+ A$1("sam-partner-test-2");
18660
+ return (h("sqm-rewards-table", null,
18661
+ h("sqm-rewards-table-column", null)));
18662
+ });
18663
+ const RewardsTableNoProgram = createHookStory(() => {
18664
+ setupGraphQL$7();
18665
+ A$1(undefined);
18666
+ return (h("sqm-rewards-table", null,
18667
+ h("sqm-rewards-table-column", null)));
18668
+ });
18669
+
18670
+ const UseRewardsTable = /*#__PURE__*/Object.freeze({
17517
18671
  __proto__: null,
17518
- 'default': UseLeaderboard_stories,
17519
- TopConvertedReferrers: TopConvertedReferrers,
17520
- TopStartedReferrers: TopStartedReferrers
18672
+ 'default': UseRewardsTable_stories,
18673
+ RewardsTableWithProgram: RewardsTableWithProgram,
18674
+ RewardsTableNoProgram: RewardsTableNoProgram
17521
18675
  });
17522
18676
 
17523
- const FormMessage_stories = {
17524
- title: "Form Message",
17525
- };
17526
- const SuccessAlert = () => {
17527
- return (h("sqm-form-message", { type: "success" },
17528
- h("div", null, "This is a success message.")));
17529
- };
17530
- const ErrorAlert = () => {
17531
- return (h("sqm-form-message", { type: "error" },
17532
- h("div", null, "This is an error message")));
17533
- };
17534
- const InfoAlert = () => {
17535
- return (h("sqm-form-message", { type: "info" },
17536
- h("div", null, "This is an info message")));
18677
+ const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
18678
+ const UseTaskCard_stories = {
18679
+ title: "Hooks / useTaskCard",
17537
18680
  };
17538
- const FullStackSuccess = () => {
17539
- return (h("sqm-form-message", { type: "success", exportparts: "successalert-icon" },
17540
- h("div", { class: "AlertContent" },
17541
- h("div", { part: "successalert-text" }, "Title"),
17542
- h("div", { part: "successalert-subtext" }, "Body text."),
17543
- h("sl-button", { type: "default", exportparts: "base: defaultbutton-base", onClick: () => {
17544
- console.log("click");
17545
- } }, "Primary Action"),
17546
- h("sl-button", { class: "SecondaryTextButton", type: "text", onClick: () => {
17547
- console.log("click");
17548
- } }, "Secondary Action"))));
17549
- };
18681
+ function setupGraphQL$8() {
18682
+ const id = "sam+klip@saasquat.ch";
18683
+ const accountId = id;
18684
+ const programId = "klip-referral-program";
18685
+ //@ts-ignore
18686
+ window.widgetIdent = {
18687
+ tenantAlias: "test_a74miwdpofztj",
18688
+ appDomain: "https://staging.referralsaasquatch.com",
18689
+ programId,
18690
+ };
18691
+ useEffect(() => {
18692
+ L$1({
18693
+ accountId,
18694
+ id,
18695
+ jwt: JWT,
18696
+ });
18697
+ return () => {
18698
+ window.widgetIdent = undefined;
18699
+ L$1(undefined);
18700
+ };
18701
+ }, []);
18702
+ return { id, accountId };
18703
+ }
18704
+ const TaskCard = createHookStory(() => {
18705
+ setupGraphQL$8();
18706
+ return (h("sqm-task-card", { "card-title": "Comment on 5 articles", "button-text": "Start reading", goal: 5, steps: true, "show-progress-bar": true }));
18707
+ });
17550
18708
 
17551
- const FormMessage$1 = /*#__PURE__*/Object.freeze({
18709
+ const UseTaskCard = /*#__PURE__*/Object.freeze({
17552
18710
  __proto__: null,
17553
- 'default': FormMessage_stories,
17554
- SuccessAlert: SuccessAlert,
17555
- ErrorAlert: ErrorAlert,
17556
- InfoAlert: InfoAlert,
17557
- FullStackSuccess: FullStackSuccess
18711
+ 'default': UseTaskCard_stories,
18712
+ TaskCard: TaskCard
17558
18713
  });
17559
18714
 
17560
18715
  const NewPortal_stories = {
17561
18716
  title: "New Portal",
17562
18717
  };
17563
- const style$8 = {
18718
+ const style$9 = {
17564
18719
  HeaderSubtitleBold: {
17565
18720
  "font-weight": 500,
17566
18721
  "text-decoration": "underline",
17567
18722
  },
17568
18723
  };
17569
18724
  jss.setup(create());
17570
- const sheet$8 = jss.createStyleSheet(style$8);
17571
- const styleString$8 = sheet$8.toString();
18725
+ const sheet$9 = jss.createStyleSheet(style$9);
18726
+ const styleString$9 = sheet$9.toString();
17572
18727
  const barProps = {
17573
18728
  data: {
17574
18729
  programs: [
@@ -17663,7 +18818,7 @@ const Dashboard = () => {
17663
18818
  hide: false,
17664
18819
  };
17665
18820
  return (h("sqm-divided-layout", { direction: "row" },
17666
- h("style", { type: "text/css" }, styleString$8),
18821
+ h("style", { type: "text/css" }, styleString$9),
17667
18822
  h(Sidebar, null),
17668
18823
  h("sqm-divided-layout", { direction: "column" },
17669
18824
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -17676,10 +18831,10 @@ const Dashboard = () => {
17676
18831
  h("h1", null, "John Smith"))),
17677
18832
  })),
17678
18833
  h(StatContainerView, Object.assign({}, { space: "64px" }),
17679
- h(BigStatView, Object.assign({}, { statvalue: "2,345" }), "Clicks"),
17680
- h(BigStatView, Object.assign({}, { statvalue: "58" }), "Referrals"),
17681
- h(BigStatView, Object.assign({}, { statvalue: "$10,540" }), "Earned"),
17682
- h(BigStatView, Object.assign({}, { statvalue: "$2,305" }), "Awaiting Payout"))),
18834
+ h(BigStatView, Object.assign({}, { statvalue: "2,345", value: 234500 }), "Clicks"),
18835
+ h(BigStatView, Object.assign({}, { statvalue: "58", value: 58 }), "Referrals"),
18836
+ h(BigStatView, Object.assign({}, { statvalue: "$10,540", value: 1054000 }), "Earned"),
18837
+ h(BigStatView, Object.assign({}, { statvalue: "$2,305", value: 230500 }), "Awaiting Payout"))),
17683
18838
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
17684
18839
  h(PortalSectionView, Object.assign({}, {
17685
18840
  labelMargin: "x-large",
@@ -17721,7 +18876,7 @@ const Dashboard = () => {
17721
18876
  };
17722
18877
  const EditProfile$2 = () => {
17723
18878
  return (h("sqm-divided-layout", { direction: "row" },
17724
- h("style", { type: "text/css" }, styleString$8),
18879
+ h("style", { type: "text/css" }, styleString$9),
17725
18880
  h(Sidebar, null),
17726
18881
  h("sqm-divided-layout", { direction: "column" },
17727
18882
  h(PortalProfileView, Object.assign({}, {
@@ -17785,7 +18940,7 @@ const EditProfile$2 = () => {
17785
18940
  };
17786
18941
  const Commissions = () => {
17787
18942
  return (h("sqm-divided-layout", { direction: "row" },
17788
- h("style", { type: "text/css" }, styleString$8),
18943
+ h("style", { type: "text/css" }, styleString$9),
17789
18944
  h(Sidebar, null),
17790
18945
  h("sqm-divided-layout", { direction: "column" },
17791
18946
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -17798,19 +18953,19 @@ const Commissions = () => {
17798
18953
  h("p", null,
17799
18954
  "for the",
17800
18955
  " ",
17801
- h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
18956
+ h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
17802
18957
  " ",
17803
18958
  "program"))),
17804
18959
  })),
17805
18960
  h(StatContainerView, Object.assign({}, { space: "64px" }),
17806
- h(BigStatView, Object.assign({}, { statvalue: "$ 1,000" }), "Total Earned"),
17807
- h(BigStatView, Object.assign({}, { statvalue: "$ 800" }), "Available"),
17808
- h(BigStatView, Object.assign({}, { statvalue: "$ 180" }), "Pending"),
17809
- h(BigStatView, Object.assign({}, { statvalue: "$ 20" }), "Redeemed"))))));
18961
+ h(BigStatView, Object.assign({}, { statvalue: "$ 1,000", value: 100000 }), "Total Earned"),
18962
+ h(BigStatView, Object.assign({}, { statvalue: "$ 800", value: 80000 }), "Available"),
18963
+ h(BigStatView, Object.assign({}, { statvalue: "$ 180", value: 18000 }), "Pending"),
18964
+ h(BigStatView, Object.assign({}, { statvalue: "$ 20", value: 2000 }), "Redeemed"))))));
17810
18965
  };
17811
18966
  const Activity = () => {
17812
18967
  return (h("sqm-divided-layout", { direction: "row" },
17813
- h("style", { type: "text/css" }, styleString$8),
18968
+ h("style", { type: "text/css" }, styleString$9),
17814
18969
  h(Sidebar, null),
17815
18970
  h("sqm-divided-layout", { direction: "column" },
17816
18971
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -17823,7 +18978,7 @@ const Activity = () => {
17823
18978
  h("p", null,
17824
18979
  "for the",
17825
18980
  " ",
17826
- h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
18981
+ h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
17827
18982
  " ",
17828
18983
  "program"))),
17829
18984
  })),
@@ -17833,10 +18988,10 @@ const Activity = () => {
17833
18988
  label: (h("sqm-text", null,
17834
18989
  h("h3", null, "Referral Activity"))),
17835
18990
  content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
17836
- h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Total Referrals"),
17837
- h(BigStatView, Object.assign({}, { statvalue: "800" }), "Converted"),
17838
- h(BigStatView, Object.assign({}, { statvalue: "180" }), "Pending"),
17839
- h(BigStatView, Object.assign({}, { statvalue: "20" }), "Disqualified"))),
18991
+ h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 100000 }), "Total Referrals"),
18992
+ h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "Converted"),
18993
+ h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "Pending"),
18994
+ h(BigStatView, Object.assign({}, { statvalue: "20", value: 20 }), "Disqualified"))),
17840
18995
  }))),
17841
18996
  h(PortalSectionView, Object.assign({}, {
17842
18997
  labelMargin: "x-large",
@@ -17844,9 +18999,9 @@ const Activity = () => {
17844
18999
  label: (h("sqm-text", null,
17845
19000
  h("h3", null, "Traffic Generated"))),
17846
19001
  content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
17847
- h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Clicks"),
17848
- h(BigStatView, Object.assign({}, { statvalue: "800" }), "From share link"),
17849
- h(BigStatView, Object.assign({}, { statvalue: "180" }), "From share mediums"))),
19002
+ h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 1000 }), "Clicks"),
19003
+ h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "From share link"),
19004
+ h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "From share mediums"))),
17850
19005
  })))));
17851
19006
  };
17852
19007
 
@@ -17860,7 +19015,7 @@ const NewPortal = /*#__PURE__*/Object.freeze({
17860
19015
  });
17861
19016
 
17862
19017
  const SidebarItem_stories = {
17863
- title: "Sidebar Item",
19018
+ title: "Components/Sidebar Item",
17864
19019
  };
17865
19020
  const InactiveItem = () => {
17866
19021
  const props = {
@@ -17897,7 +19052,7 @@ const SidebarItem = /*#__PURE__*/Object.freeze({
17897
19052
  });
17898
19053
 
17899
19054
  const NavigationSidebar_stories = {
17900
- title: "Navigation Sidebar",
19055
+ title: "Components/Navigation Sidebar",
17901
19056
  };
17902
19057
  const DefaultNavigationSidebar = () => {
17903
19058
  const barProps = {
@@ -17946,7 +19101,7 @@ const NavigationSidebar = /*#__PURE__*/Object.freeze({
17946
19101
  });
17947
19102
 
17948
19103
  const PortalLogin_stories = {
17949
- title: "Portal Login",
19104
+ title: "Components/Portal Login",
17950
19105
  };
17951
19106
  const defaultProps$2 = {
17952
19107
  states: {
@@ -17991,7 +19146,7 @@ const PortalLogin$1 = /*#__PURE__*/Object.freeze({
17991
19146
  });
17992
19147
 
17993
19148
  const PortalRegister_stories = {
17994
- title: "Portal Register",
19149
+ title: "Components/Portal Register",
17995
19150
  };
17996
19151
  const defaultProps$3 = {
17997
19152
  states: {
@@ -18094,7 +19249,7 @@ const PortalRegister$1 = /*#__PURE__*/Object.freeze({
18094
19249
  const scenario = "@author:\r\n@owner:ian\r\nFeature: Forgot Password\r\n\r\n @motivating\r\n Scenario: Users can request to reset their password\r\n Given a user enters their email address\r\n And that email address is linked to a previously created account\r\n When they click \"Reset Password\"\r\n Then the button enters a loading state\r\n When the password reset email is sent\r\n Then a confirmation banner is shown stating a password reset email was sent\r\n\r\n @motivating\r\n Scenario: Users are notified if sending their password reset email fails\r\n Given a user enters their email address\r\n And that email address is linked to a previously created account\r\n When they click \"Reset Password\"\r\n Then the button enters a loading state\r\n When the password reset email fails to send\r\n Then the user will not receive a password reset email\r\n And an error banner is shown stating that they should try again\r\n\r\n @motivating\r\n @landmine\r\n Scenario: If the input email is not associated to an account a success banner will be shown but an email will not be sent\r\n Given the user entered an email address that is not associated to an accoun\r\n When they click \"Reset Password\"\r\n Then the button enters a loading state\r\n But no email will be sent\r\n And a success banner is shown stating a password reset email was sent if the given email was associated to an account\r\n\r\n @motivating\r\n Scenario: Users can resend password reset email\r\n Given a user had previously requested to reset their password\r\n When they enter their email address\r\n And that email address is linked to a previously created account\r\n And they click \"Reset Password\"\r\n Then the user will receive a second password reset email\r\n And a success banner is shown stating that their email was sent\r\n";
18095
19250
 
18096
19251
  const PortalForgotPassword_stories = {
18097
- title: "Portal Forgot Password",
19252
+ title: "Components/Portal Forgot Password",
18098
19253
  parameters: {
18099
19254
  scenario,
18100
19255
  },
@@ -18172,7 +19327,7 @@ const PortalForgotPassword = /*#__PURE__*/Object.freeze({
18172
19327
  const scenario$1 = "@author:\r\n@owner: ian\r\nFeature: Email Verification\r\n\r\n @minutae\r\n Scenario: User's redirected from registration can re-send their verification email\r\n Given a user has registered\r\n And they have been sent a verification email\r\n When they are redirected to the email verification page\r\n Then a message will be displayed\r\n And it will reflect that a email has already been sent to their email\r\n But they can still re-send the email\r\n When they click to \"Resend-Email\"\r\n Then the user will receive a verification email\r\n\r\n @motivating\r\n Scenario: Users are notified if sending the email verification message fails\r\n Given a user with an email was stored in session data from registration\r\n When they click to \"Resend-Email\"\r\n Then the button enters a loading state\r\n When an error occurs trying to send the verification email\r\n Then the user will not receive a verification email\r\n And an error banner is shown stating that they should try again\r\n\r\n @motivating\r\n Scenario: Users are notified if sending the email verification message succeeds\r\n Given a user with an email was stored in session data from registration\r\n When they click to \"Resend-Email\"\r\n Then the button enters a loading state\r\n When the email verification message sends\r\n Then the user will receive a verification email\r\n And a success banner is shown stating that their email was resent";
18173
19328
 
18174
19329
  const PortalEmailVerification_stories = {
18175
- title: "Portal Email Verification",
19330
+ title: "Components/Portal Email Verification",
18176
19331
  parameters: {
18177
19332
  scenario: scenario$1,
18178
19333
  },
@@ -18258,7 +19413,7 @@ const PortalEmailVerification = /*#__PURE__*/Object.freeze({
18258
19413
  const scenario$2 = "@author:\r\n@owner:ian\r\nFeature: Reset Password\r\n\r\n\r\n Background: A user in on the password reset page\r\n Given a user who has been redirected to the password reset page\r\n\r\n @motivating\r\n Scenario: Users can reset their password\r\n Given a user has a valid oob code as a url query parameter\r\n When they enter their password twice\r\n And they click \"Update\"\r\n Then their password is updated\r\n And a banner with a success message will be displayed\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario Outline: Users cannot reset their password with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n Then they will see an error message saying that their password reset code is invalid or expired\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/\"\r\n Examples:\r\n | oobCode |\r\n | invalid oob code |\r\n | non existant oob code |\r\n\r\n @motivating\r\n Scenario: Users must enter the same password twice to successfully reset their password\r\n Given a user has been redirected to the password reset page\r\n And they have a valid oob code as a url query parameter\r\n When they enter two different passwords into the password reset form\r\n And they click \"Update\"\r\n Then their password is not be reset\r\n And an error banner stating the input passwords must match appears\r\n And their password will not be reset\r\n When they enter the same password twice\r\n And they click \"Update\"\r\n Then a banner appears with a success message\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/activity\"";
18259
19414
 
18260
19415
  const PortalResetPassword_stories = {
18261
- title: "Portal Reset Password",
19416
+ title: "Components/Portal Reset Password",
18262
19417
  parameters: {
18263
19418
  scenario: scenario$2,
18264
19419
  },
@@ -18422,7 +19577,7 @@ const PortalResetPassword = /*#__PURE__*/Object.freeze({
18422
19577
  const scenario$3 = "@author:\r\n@owner:ian\r\nFeature: Verify Email\r\n\r\n\r\n Background: A user is on the email verification page\r\n Given a user who has been redirected to the email verification page\r\n\r\n @motivating\r\n Scenario: Verifying your email will take you to the portal login page\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button will enter a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" will appear\r\n When they click \"Continue\"\r\n Then they will be redirected to login\r\n\r\n @motivating\r\n Scenario: Users will be automatically redirected if they dont click \"Continue\"\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button will enter a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" will appear\r\n When they wait 5 seconds\r\n Then they will be redirected to login\r\n\r\n @motivating\r\n Scenario: Users are notified if verifying their email has failed\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button will enter a loading state\r\n When their email fails to be validated\r\n Then an banner is shown stating that an error occured\r\n\r\n @motivating\r\n Scenario Outline: Users cannot verify their email with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n Then they will see an error message saying that their verification code is invalid or expired\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/\"\r\n Examples:\r\n | oobCode |\r\n | invalid oob code |\r\n | non existant oob code |\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/activity\"\r\n\r\n @motivating\r\n Scenario Outline: Users will be redirected to the value of the nextPage url parameter if it exists\r\n Given the component <mayHave> prop \"nextPage\" with <nextPageValue>\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n And the user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to <nextPageParamValue>\r\n Examples:\r\n | mayHave | nextPageValue | nextPageParamValue |\r\n | has | /dashboard | /activity |\r\n | does not have | N/A | /activity |";
18423
19578
 
18424
19579
  const PortalVerifyEmail_stories = {
18425
- title: "Portal Verify Email",
19580
+ title: "Components/Portal Verify Email",
18426
19581
  parameters: {
18427
19582
  scenario: scenario$3,
18428
19583
  },
@@ -18466,7 +19621,7 @@ const PortalVerifyEmail = /*#__PURE__*/Object.freeze({
18466
19621
  });
18467
19622
 
18468
19623
  const AssetCard_stories = {
18469
- title: "Asset Card",
19624
+ title: "Components/Asset Card",
18470
19625
  };
18471
19626
  const Default$7 = () => {
18472
19627
  const props = {
@@ -18502,7 +19657,7 @@ const AssetCard = /*#__PURE__*/Object.freeze({
18502
19657
  });
18503
19658
 
18504
19659
  const DividedLayout_stories = {
18505
- title: "Divided Layout",
19660
+ title: "Components/Divided Layout",
18506
19661
  };
18507
19662
  const barProps$1 = {
18508
19663
  data: {
@@ -18594,7 +19749,7 @@ const DividedLayout$1 = /*#__PURE__*/Object.freeze({
18594
19749
  const scenario$4 = "Feature: Change Password\r\n\r\n @motivating\r\n Scenario: Users can change their password\r\n Given a user has registered for the portal\r\n And they have a password\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n Then a popup will appear\r\n When they enter their new password\r\n And confirm it\r\n And click \"Change Password\"\r\n Then they will see a success banner stating that the change was successful\r\n When they logout\r\n And try to login\r\n Then they will not be able to login with their old password\r\n But they will be able to login with their new password\r\n\r\n @motivating\r\n Scenario: Users must confirm their password change\r\n Given a user has registered for the portal\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n Then a popup will appear\r\n When they enter their new password\r\n But they enter a different password to confirm\r\n And click \"Change Password\"\r\n Then they will see an error banner stating that the passwords didnt match\r\n When they logout\r\n And try to login\r\n Then they will be able to login with their existing password\r\n\r\n @motivating\r\n Scenario: Users must enter a new password and confirm it to change their password\r\n Given a user has registered for the portal\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n Then a popup will appear\r\n When they click \"Change password\"\r\n Then a validation error will appear for the new password field\r\n And their password will not be changed\r\n When they enter a new password\r\n And they click \"Change password\"\r\n Then a validation error will appear for the confirm new password field\r\n And their password will not be changed\r\n\r\n @motivating\r\n Scenario: An error banner will be displayed if the password change fails\r\n Given a user has registered for the portal\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n When they enter their new password\r\n And confirm it\r\n And click \"Change Password\"\r\n But the change fails\r\n Then they will see an error banner stating that the change failed\r\n When they logout\r\n And try to login\r\n Then they will be able to login with their existing password";
18595
19750
 
18596
19751
  const ChangePassword_stories = {
18597
- title: "Change Password",
19752
+ title: "Components/Change Password",
18598
19753
  parameters: {
18599
19754
  scenario: scenario$4,
18600
19755
  },
@@ -18750,7 +19905,7 @@ const ChangePassword = /*#__PURE__*/Object.freeze({
18750
19905
  });
18751
19906
 
18752
19907
  const PortalProfile_stories = {
18753
- title: "Portal Profile",
19908
+ title: "Components/Portal Profile",
18754
19909
  };
18755
19910
  // const style = {};
18756
19911
  jss.setup(create());
@@ -18991,7 +20146,7 @@ const PortalProfile = /*#__PURE__*/Object.freeze({
18991
20146
  });
18992
20147
 
18993
20148
  const ReferralTableRewardsCell_stories = {
18994
- title: "Referral Table Rewards Cell",
20149
+ title: "Components/Referral Table Rewards Cell",
18995
20150
  };
18996
20151
  const baseReward = {
18997
20152
  id: "123",
@@ -19223,7 +20378,7 @@ const ReferralTableRewardsCell$1 = /*#__PURE__*/Object.freeze({
19223
20378
  });
19224
20379
 
19225
20380
  const ReferralTable_stories = {
19226
- title: "Referral Table",
20381
+ title: "Components/Referral Table",
19227
20382
  };
19228
20383
  const loadingElement = (h("div", { slot: "loading", style: { display: "contents" } },
19229
20384
  h("sqm-table-row", null,
@@ -19710,7 +20865,7 @@ const ReferralTable$1 = /*#__PURE__*/Object.freeze({
19710
20865
  });
19711
20866
 
19712
20867
  const ReferralTableCell_stories = {
19713
- title: "Referral Table Cell",
20868
+ title: "Components/Referral Table Cell",
19714
20869
  };
19715
20870
  const TableCell = () => {
19716
20871
  return (h("sqm-referral-table-cell", { innerTemplate: "Table Cell Text" }));
@@ -19782,73 +20937,1029 @@ const ReferralTableCell$1 = /*#__PURE__*/Object.freeze({
19782
20937
  RewardsCell: RewardsCell
19783
20938
  });
19784
20939
 
19785
- const UserName_stories = {
19786
- title: "User Name",
20940
+ const UserName_stories = {
20941
+ title: "Tests/User Name",
20942
+ };
20943
+ const DemoData = () => {
20944
+ return (h("sqm-user-name", { demoData: {
20945
+ loading: false,
20946
+ loadingText: "...",
20947
+ username: "Test Testerson",
20948
+ } }));
20949
+ };
20950
+ const Username = () => {
20951
+ return h("sqm-user-name", null);
20952
+ };
20953
+
20954
+ const UserName = /*#__PURE__*/Object.freeze({
20955
+ __proto__: null,
20956
+ 'default': UserName_stories,
20957
+ DemoData: DemoData,
20958
+ Username: Username
20959
+ });
20960
+
20961
+ const PasswordField_stories = {
20962
+ title: "Components/Portal Password Field",
20963
+ };
20964
+ const Start = () => {
20965
+ return (h("sqm-password-field", { demoData: {
20966
+ initValue: "",
20967
+ states: {
20968
+ enableValidation: true,
20969
+ validationErrors: {},
20970
+ content: {
20971
+ fieldLabel: "Password",
20972
+ },
20973
+ },
20974
+ } }));
20975
+ };
20976
+ const EmptyError = () => {
20977
+ return (h("sqm-password-field", { demoData: {
20978
+ initValue: "",
20979
+ states: {
20980
+ enableValidation: true,
20981
+ validationErrors: { password: "Cannot be empty" },
20982
+ content: {
20983
+ fieldLabel: "Password",
20984
+ },
20985
+ },
20986
+ } }));
20987
+ };
20988
+ const ValidationError = () => {
20989
+ return (h("sqm-password-field", { demoData: {
20990
+ initValue: "asdf",
20991
+ states: {
20992
+ enableValidation: true,
20993
+ validationErrors: { password: "Incomplete" },
20994
+ content: {
20995
+ fieldLabel: "Password",
20996
+ },
20997
+ },
20998
+ } }));
20999
+ };
21000
+
21001
+ const PasswordField = /*#__PURE__*/Object.freeze({
21002
+ __proto__: null,
21003
+ 'default': PasswordField_stories,
21004
+ Start: Start,
21005
+ EmptyError: EmptyError,
21006
+ ValidationError: ValidationError
21007
+ });
21008
+
21009
+ const checkmark_circle = () => {
21010
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
21011
+ h("path", { fill: "currentColor", "fill-rule": "evenodd", d: "M1.636 9a7.364 7.364 0 1114.728 0A7.364 7.364 0 011.636 9zM9 0a9 9 0 100 18A9 9 0 009 0zm5.192 6.266a.982.982 0 00-1.548-1.208l-4.787 6.137-2.58-2.58a.982.982 0 00-1.39 1.388l3.367 3.366a.982.982 0 001.468-.09l5.47-7.013z", "clip-rule": "evenodd" })));
21012
+ };
21013
+ const arrow_left_right = () => {
21014
+ return (h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
21015
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.265 2.789a.346.346 0 000-.489L8.066.101a.346.346 0 10-.489.489l1.61 1.609H2.073a.691.691 0 00-.69.691v1.728a.346.346 0 00.69 0V2.89h7.114L7.577 4.5a.346.346 0 10.49.488l2.198-2.2zM.101 9.21a.346.346 0 000 .489l2.2 2.199a.346.346 0 00.488-.489l-1.61-1.609h7.114c.382 0 .691-.31.691-.691V7.382a.346.346 0 00-.691 0V9.11H1.18L2.789 7.5a.346.346 0 10-.489-.488l-2.199 2.2z", fill: "currentColor" })));
21016
+ };
21017
+
21018
+ const gift = () => {
21019
+ return (h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
21020
+ h("path", { d: "M15 5H9v11h4.5a1 1 0 001-1V9h.5a1 1 0 001-1V6a1 1 0 00-1-1zM1.5 9v6a1 1 0 001 1H7V5H1a1 1 0 00-1 1v2a1 1 0 001 1h.5z", fill: "var(--sl-color-primary-200)" }),
21021
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
21022
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M14 2.71c0 .886-1.33 2.227-2 2.29H9v11H7.002V5H4.588C3.212 4.702 2 3.645 2 2.52 2 1.426 2.476.558 3.342.183 4.169-.176 5.125.02 5.88.545c.927.643 1.447 1.851 1.919 2.947l.123.286.12-.272C8.51 2.45 9.045 1.243 9.94.596c.793-.573 1.801-.79 2.672-.397.9.405 1.388 1.336 1.388 2.51zM10.612 1.5c.48-.347 1.056-.41 1.548 0 .428.357.45.525.506.93l.01.07c0 .599-.516 1.5-1.032 1.5-.366 0-.653-.003-.922-.006-.49-.005-.92-.01-1.657.006.14-.272.252-.533.36-.782.285-.667.534-1.246 1.187-1.718zm-5.673 0c-.233-.161-.766-.09-.987.006-.183.08-.456.32-.456 1.015 0 .674 1.092 1.257 1.092 1.257S5.454 4 7.002 4c-.527-1.305-1.273-1.951-2.063-2.5z", fill: "var(--sl-color-primary-600)" })));
21023
+ };
21024
+
21025
+ function ProgressBarView(props) {
21026
+ const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, } = props;
21027
+ console.log("progress bar props", props);
21028
+ const gift1 = gift();
21029
+ const gift2 = gift();
21030
+ const gift3 = gift();
21031
+ var items = [];
21032
+ var columns = "";
21033
+ var repetitions = Math.floor(progress / goal);
21034
+ if (repeatable) {
21035
+ if (steps) {
21036
+ addStepsRepeatable();
21037
+ }
21038
+ else {
21039
+ addLinearRepeatable();
21040
+ }
21041
+ }
21042
+ // non repeatable
21043
+ else {
21044
+ if (steps) {
21045
+ addSteps();
21046
+ }
21047
+ else {
21048
+ addLinear();
21049
+ }
21050
+ }
21051
+ const style = {
21052
+ ProgressBar: {
21053
+ "& .progress-bar": {
21054
+ height: "15px",
21055
+ marginTop: steps ? "var(--sl-spacing-x-medium)" : "var(--sl-spacing-large)",
21056
+ marginBottom: "var(--sl-spacing-xx-large)",
21057
+ marginRight: "var(--sl-spacing-x-small)",
21058
+ fontSize: "var(--sl-font-size-x-small)",
21059
+ display: "grid",
21060
+ gridTemplateColumns: columns,
21061
+ lineHeight: "45px",
21062
+ userSelect: "none",
21063
+ },
21064
+ "& .progress-bar.repeatable-steps": {
21065
+ marginLeft: "var(--sl-spacing-x-small)",
21066
+ },
21067
+ "& .filled:after": {
21068
+ content: '""',
21069
+ display: "flex",
21070
+ width: "100%",
21071
+ height: "4px",
21072
+ borderRadius: "4px",
21073
+ backgroundColor: complete ? "var(--sl-color-success-500)" : "var(--sl-color-primary-500)",
21074
+ },
21075
+ "& .progress": {
21076
+ display: "block",
21077
+ textAlign: "center",
21078
+ marginLeft: "-100px",
21079
+ marginRight: "-100px",
21080
+ },
21081
+ "& .progress::after": {
21082
+ content: '""',
21083
+ width: "12px",
21084
+ height: "12px",
21085
+ display: "flex",
21086
+ backgroundColor: complete ? "var(--sl-color-success-500)" : "var(--sl-color-primary-500)",
21087
+ borderRadius: "50%",
21088
+ position: "relative",
21089
+ left: "47%",
21090
+ top: "-85%",
21091
+ },
21092
+ "& .progress.bg:after": {
21093
+ width: "0",
21094
+ height: "0",
21095
+ border: "none",
21096
+ },
21097
+ "& .progress.top": {
21098
+ position: "relative",
21099
+ top: "-40px",
21100
+ },
21101
+ "& .progress.top:after": {
21102
+ top: "-16%",
21103
+ },
21104
+ "& .empty": {
21105
+ display: "block",
21106
+ textAlign: "center",
21107
+ marginLeft: "-100px",
21108
+ marginRight: "-100px",
21109
+ },
21110
+ "& .empty::after": {
21111
+ content: '""',
21112
+ width: "12px",
21113
+ height: "12px",
21114
+ border: "2px solid #E0E0E0",
21115
+ margin: "-2px",
21116
+ display: "flex",
21117
+ backgroundColor: "white",
21118
+ borderRadius: "50%",
21119
+ position: "relative",
21120
+ left: "47%",
21121
+ top: "-85%",
21122
+ },
21123
+ "& .empty.bg:after": {
21124
+ width: "0",
21125
+ height: "0",
21126
+ border: "none",
21127
+ },
21128
+ "& .remain:after": {
21129
+ content: '""',
21130
+ display: "flex",
21131
+ width: "100%",
21132
+ height: "4px",
21133
+ borderRadius: "4px",
21134
+ backgroundColor: "#E0E0E0",
21135
+ },
21136
+ "& .gift.bw": {
21137
+ filter: "grayscale(100%)",
21138
+ },
21139
+ "& .gift.start": {
21140
+ transform: "scale(80%)",
21141
+ top: "-20px",
21142
+ },
21143
+ "& .gift": {
21144
+ textAlign: "center",
21145
+ marginLeft: "-100px",
21146
+ marginRight: "-100px",
21147
+ position: "relative",
21148
+ display: "list-item",
21149
+ listStyleType: "none",
21150
+ top: "-18px",
21151
+ filter: goal <= progress ? "" : "grayscale(100%)",
21152
+ zIndex: "1",
21153
+ },
21154
+ },
21155
+ };
21156
+ jss.setup(create());
21157
+ const sheet = jss.createStyleSheet(style);
21158
+ const styleString = sheet.toString();
21159
+ return (h("div", { class: sheet.classes.ProgressBar },
21160
+ h("style", { type: "text/css" }, styleString),
21161
+ h("div", { class: repetitions > 1 ? "progress-bar repeatable-steps" : "progress-bar" }, items)));
21162
+ function clamp(x, min, max) {
21163
+ return Math.min(Math.max(x, min), max);
21164
+ }
21165
+ function addLinear() {
21166
+ const ratio = progress / goal;
21167
+ columns =
21168
+ clamp(ratio, 0, 1) + "fr 0fr " + clamp(1 - ratio, 0, 1) + "fr 0fr 0fr";
21169
+ items.push(h("div", { class: "filled" }));
21170
+ items.push(h("div", { class: clamp(progress, 0, goal) == goal ? "progress top bg" : "progress top" }, clamp(progress, 0, goal) == goal
21171
+ ? ""
21172
+ : progressBarUnit + clamp(progress, 0, goal)));
21173
+ items.push(h("div", { class: "remain" }));
21174
+ items.push(h("div", { class: "progress bg" }, goal));
21175
+ items.push(h("div", { class: "gift" }, gift1));
21176
+ }
21177
+ function addSteps() {
21178
+ let ratio = 1 / goal;
21179
+ for (let i = 1; i < goal; i++) {
21180
+ columns += ratio + "fr 0fr ";
21181
+ if (i > progress) {
21182
+ items.push(h("div", { class: "remain" }));
21183
+ items.push(h("div", { class: "empty" }, i));
21184
+ }
21185
+ else {
21186
+ items.push(h("div", { class: "filled" }));
21187
+ items.push(h("div", { class: "progress" }, i));
21188
+ }
21189
+ }
21190
+ columns += ratio + "fr 0fr ";
21191
+ // reward success
21192
+ if (goal <= progress) {
21193
+ columns += "0fr ";
21194
+ items.push(h("div", { class: "filled" }));
21195
+ items.push(h("div", { class: "progress bg" }, goal));
21196
+ items.push(h("div", { class: "gift" }, gift1));
21197
+ }
21198
+ // reward fail
21199
+ else {
21200
+ columns += "0fr ";
21201
+ items.push(h("div", { class: "remain" }));
21202
+ items.push(h("div", { class: "empty bg" }, goal));
21203
+ items.push(h("div", { class: "gift" }, gift1));
21204
+ }
21205
+ }
21206
+ function addLinearRepeatable() {
21207
+ let repetitions = Math.floor(progress / goal);
21208
+ let ratio = ((progress % goal) / goal) * 0.5;
21209
+ // 0 repetition
21210
+ if (repetitions == 0) {
21211
+ columns = ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr 0.5fr 0fr 0fr";
21212
+ items.push(h("div", { class: "filled" }));
21213
+ items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progressBarUnit + progress));
21214
+ items.push(h("div", { class: "remain" }));
21215
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
21216
+ items.push(h("div", { class: "gift" }, gift1));
21217
+ items.push(h("div", { class: "remain" }));
21218
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
21219
+ items.push(h("div", { class: "gift bw" }, gift2));
21220
+ }
21221
+ // single repetition
21222
+ else if (repetitions == 1) {
21223
+ columns =
21224
+ "0.5fr 0fr 0fr " + ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr";
21225
+ items.push(h("div", { class: "filled" }));
21226
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
21227
+ items.push(h("div", { class: "gift" }, gift1));
21228
+ items.push(h("div", { class: "filled" }));
21229
+ items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progress == goal ? "" : progressBarUnit + progress));
21230
+ items.push(h("div", { class: "remain" }));
21231
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
21232
+ items.push(h("div", { class: "gift bw" }, gift2));
21233
+ }
21234
+ // multiple repetitions
21235
+ else {
21236
+ columns =
21237
+ "0fr 0fr 0.5fr 0fr 0fr " +
21238
+ ratio +
21239
+ "fr 0fr " +
21240
+ (0.5 - ratio) +
21241
+ "fr 0fr 0fr";
21242
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions - 1)));
21243
+ items.push(h("div", { class: "gift start" }, gift1));
21244
+ items.push(h("div", { class: "filled" }));
21245
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * repetitions));
21246
+ items.push(h("div", { class: "gift" }, gift2));
21247
+ items.push(h("div", { class: "filled" }));
21248
+ items.push(h("div", { class: progress == goal * repetitions ? "progress top bg" : "progress top" }, progress == goal * repetitions ? "" : progressBarUnit + progress));
21249
+ items.push(h("div", { class: "remain" }));
21250
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions + 1)));
21251
+ items.push(h("div", { class: "gift bw" }, gift3));
21252
+ }
21253
+ }
21254
+ function addStepsRepeatable() {
21255
+ let repetitions = Math.floor(progress / goal);
21256
+ // no or single repetition
21257
+ if (repetitions < 2) {
21258
+ let ratio = 1 / goal;
21259
+ for (let i = 1; i < goal * 2 + 1; i++) {
21260
+ columns += ratio + "fr 0fr ";
21261
+ if (i > progress) {
21262
+ if (i == goal) {
21263
+ columns += "0fr ";
21264
+ items.push(h("div", { class: "remain" }));
21265
+ items.push(h("div", { class: "empty bg" }, goal));
21266
+ items.push(h("div", { class: "gift bw" }, gift1));
21267
+ }
21268
+ else if (i == goal * 2) {
21269
+ columns += "0fr 0fr";
21270
+ items.push(h("div", { class: "remain" }));
21271
+ items.push(h("div", { class: "empty bg" }, goal * 2));
21272
+ items.push(h("div", { class: "gift bw" }, gift2));
21273
+ }
21274
+ else {
21275
+ items.push(h("div", { class: "remain" }));
21276
+ items.push(h("div", { class: "empty" }, progressBarUnit + i));
21277
+ }
21278
+ }
21279
+ else if (i == goal) {
21280
+ columns += "0fr ";
21281
+ items.push(h("div", { class: "filled" }));
21282
+ items.push(h("div", { class: "progress bg" }, i));
21283
+ items.push(h("div", { class: "gift" }, gift3));
21284
+ }
21285
+ else {
21286
+ items.push(h("div", { class: "filled" }));
21287
+ items.push(h("div", { class: "progress" }, i));
21288
+ }
21289
+ }
21290
+ }
21291
+ // case repetition many
21292
+ else {
21293
+ let position = (progress % goal) + goal;
21294
+ let ratio = 1 / goal;
21295
+ columns += "0fr 0fr ";
21296
+ items.push(h("div", { class: "progress bg" }, goal * (repetitions - 1)));
21297
+ items.push(h("div", { class: "gift start" }, gift1));
21298
+ for (let i = 1; i < goal * 2 + 1; i++) {
21299
+ columns += ratio + "fr 0fr ";
21300
+ if (i <= goal) {
21301
+ if (i == goal) {
21302
+ columns += "0fr ";
21303
+ items.push(h("div", { class: "filled" }));
21304
+ items.push(h("div", { class: "progress bg" }, i + goal * (repetitions - 1)));
21305
+ items.push(h("div", { class: "gift" }, gift2));
21306
+ }
21307
+ else {
21308
+ items.push(h("div", { class: "filled" }));
21309
+ items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
21310
+ }
21311
+ }
21312
+ else if (i > position) {
21313
+ if (i == goal * 2) {
21314
+ columns += "0fr 0fr";
21315
+ items.push(h("div", { class: "remain" }));
21316
+ items.push(h("div", { class: "empty bg" }, i + goal * (repetitions - 1)));
21317
+ items.push(h("div", { class: "gift bw" }, gift3));
21318
+ }
21319
+ else {
21320
+ items.push(h("div", { class: "remain" }));
21321
+ items.push(h("div", { class: "empty" }, i + goal * (repetitions - 1)));
21322
+ }
21323
+ }
21324
+ else {
21325
+ items.push(h("div", { class: "filled" }));
21326
+ items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
21327
+ }
21328
+ }
21329
+ }
21330
+ }
21331
+ }
21332
+
21333
+ function TaskCardView(props) {
21334
+ const { rewardAmount, cardTitle, description, showProgressBar, progress = 0, goal, rewardUnit, repeatable, showExpiry, dateExpires, buttonText, buttonLink, loading, } = props;
21335
+ console.log({ props });
21336
+ const checkmark_circle$1 = checkmark_circle();
21337
+ const arrow_left_right$1 = arrow_left_right();
21338
+ const style = {
21339
+ HostBlock: HostBlock,
21340
+ TaskCard: {
21341
+ "& .main > div": {
21342
+ margin: "var(--sl-spacing-medium)",
21343
+ },
21344
+ "& .main": {
21345
+ position: "relative",
21346
+ boxSizing: "border-box",
21347
+ minWidth: "347px",
21348
+ background: "var(--sl-color-white)",
21349
+ border: "1px solid var(--sl-color-gray-300)",
21350
+ borderRadius: "var(--sl-border-radius-medium)",
21351
+ fontSize: "var(--sl-font-size-small)",
21352
+ lineHeight: "var(--sl-line-height-dense)",
21353
+ },
21354
+ "& .main.complete": {
21355
+ background: "var(--sl-color-success-50)",
21356
+ borderColor: "var(--sl-color-success-700)",
21357
+ },
21358
+ },
21359
+ Header: {
21360
+ display: "flex",
21361
+ "& .icon": {
21362
+ alignSelf: "center",
21363
+ lineHeight: "0",
21364
+ color: "var(--sl-color-success-700)",
21365
+ fontSize: "var(--sl-font-size-large)",
21366
+ marginRight: "var(--sl-spacing-x-small)",
21367
+ },
21368
+ "& .value": {
21369
+ alignSelf: "center",
21370
+ color: "var(--sl-color-black)",
21371
+ fontSize: "var(--sl-font-size-x-large)",
21372
+ fontWeight: "var(--sl-font-weight-semibold)",
21373
+ lineHeight: "100%",
21374
+ marginRight: "var(--sl-spacing-xx-small)",
21375
+ },
21376
+ "& .text": {
21377
+ alignSelf: "end",
21378
+ textTransform: "uppercase",
21379
+ color: "var(--sl-color-gray-600)",
21380
+ fontSize: "var(--sl-font-size-x-small)",
21381
+ lineHeight: "var(--sl-font-size-medium)",
21382
+ marginRight: "var(--sl-spacing-xx-small)",
21383
+ },
21384
+ },
21385
+ Title: {
21386
+ color: "var(--sl-color-black)",
21387
+ fontSize: "var(--sl-font-size-small)",
21388
+ fontWeight: "var(--sl-font-weight-semibold)",
21389
+ },
21390
+ Footer: {
21391
+ display: "flex",
21392
+ "& .icon": {
21393
+ fontSize: "var(--sl-font-size-xx-small)",
21394
+ marginRight: "var(--sl-spacing-xx-small)",
21395
+ },
21396
+ "& .text": {
21397
+ marginTop: "auto",
21398
+ verticalAlign: "text-bottom",
21399
+ fontSize: "var(--sl-font-size-x-small)",
21400
+ color: "var(--sl-color-gray-600)",
21401
+ },
21402
+ "& .success": {
21403
+ color: "var(--sl-color-success-600)!important",
21404
+ fontWeight: "var(--sl-font-weight-semibold)",
21405
+ },
21406
+ "& .action": {
21407
+ marginTop: "auto",
21408
+ marginLeft: "auto",
21409
+ },
21410
+ "& sl-button.action::part(base) ": {
21411
+ color: "var(--sl-color-white)",
21412
+ background: "var(--sl-color-primary-500)",
21413
+ border: "1px solid var(--sl-color-primary-500)",
21414
+ borderRadius: "var(--sl-border-radius-medium)",
21415
+ },
21416
+ "& sl-button.action.completed::part(base) ": {
21417
+ border: "1px solid var(--sl-color-gray-300)!important",
21418
+ background: "var(--sl-color-gray-300)!important",
21419
+ },
21420
+ },
21421
+ };
21422
+ jss.setup(create());
21423
+ const sheet = jss.createStyleSheet(style);
21424
+ const styleString = sheet.toString();
21425
+ const showComplete = progress >= goal;
21426
+ const repetitions = showProgressBar ? Math.floor(progress / goal) : progress;
21427
+ const taskComplete = showComplete && repeatable === false;
21428
+ console.log({ showProgressBar, loading });
21429
+ return (h("div", { class: sheet.classes.TaskCard },
21430
+ h("div", { class: showComplete ? "main complete" : "main" },
21431
+ h("style", { type: "text/css" }, styleString),
21432
+ h("div", { class: sheet.classes.Header },
21433
+ showComplete && h("span", { class: "icon" }, checkmark_circle$1),
21434
+ h("span", { class: "value" }, rewardAmount),
21435
+ h("span", { class: "text" }, rewardUnit)),
21436
+ h("div", { class: sheet.classes.Title }, cardTitle),
21437
+ h(Details, { description: description }),
21438
+ showProgressBar && loading ? (h("sl-skeleton", { style: { width: "98%", margin: "0 auto" } })) : (showProgressBar && h(ProgressBarView, Object.assign({}, props, { complete: taskComplete }))),
21439
+ h("div", { class: sheet.classes.Footer },
21440
+ h("span", { class: "text" },
21441
+ repeatable && (h("div", null,
21442
+ h("span", { class: repetitions > 0 ? "icon success" : "icon" }, arrow_left_right$1),
21443
+ h("span", { class: repetitions > 0 ? "success" : "" },
21444
+ "Completed ",
21445
+ repetitions,
21446
+ " times"))),
21447
+ showExpiry && (h("span", null,
21448
+ "Ends ",
21449
+ " ",
21450
+ dateExpires))),
21451
+ h("sl-button", { class: taskComplete ? "action completed" : "action", size: "small", onClick: () => window.open(buttonLink), disabled: taskComplete }, buttonText)))));
21452
+ }
21453
+ function Details(props) {
21454
+ const style = {
21455
+ Description: {
21456
+ "& input[type=checkbox]": {
21457
+ display: "none",
21458
+ },
21459
+ "& input:checked ~ .details": {
21460
+ transform: "rotate(-180deg)",
21461
+ },
21462
+ "& .details": {
21463
+ position: "absolute",
21464
+ top: "var(--sl-spacing-medium)",
21465
+ right: "var(--sl-spacing-medium)",
21466
+ color: "var(--sl-color-gray-700)",
21467
+ fontSize: "var(--sl-font-size-large)",
21468
+ "& :hover": {
21469
+ color: "var(--sl-color-primary-700)",
21470
+ },
21471
+ transformOrigin: "50% 37%",
21472
+ transition: "transform var(--sl-transition-medium) ease",
21473
+ },
21474
+ "& input:checked ~ .summary": {
21475
+ transition: "max-height var(--sl-transition-medium) ease",
21476
+ maxHeight: "300px",
21477
+ },
21478
+ "& .summary": {
21479
+ display: "block",
21480
+ overflow: "hidden",
21481
+ color: "var(--sl-color-gray-700)",
21482
+ fontSize: "var(--sl-font-size-x-small)",
21483
+ maxHeight: "0px",
21484
+ transition: "max-height var(--sl-transition-fast) ease-out",
21485
+ },
21486
+ },
21487
+ };
21488
+ jss.setup(create());
21489
+ const sheet = jss.createStyleSheet(style);
21490
+ const styleString = sheet.toString();
21491
+ const rid = Math.random().toString(36).slice(2);
21492
+ return (h("div", null,
21493
+ h("style", { type: "text/css" }, styleString),
21494
+ h("span", { class: sheet.classes.Description },
21495
+ h("input", { type: "checkbox", id: "details-" + rid }),
21496
+ h("label", { class: "details", htmlFor: "details-" + rid },
21497
+ h("sl-icon", { name: "chevron-down" })),
21498
+ h("span", { class: "summary" }, props.description))));
21499
+ }
21500
+
21501
+ const scenario$5 = "@author:derek\r\n@owner:\r\nFeature: Task Card\r\n\r\n\tScenario: A header, body title, description and a CTA button are always displayed\r\n\t\tGiven the Task Card is configured with the following props\r\n\t\t\t| prop | value |\r\n\t\t\t| rewardAmount | \"40\" |\r\n\t\t\t| rewardUnit | \"Points\" |\r\n\t\t\t| cardTitle | Complete a survey |\r\n\t\t\t| description | Fill out our survey form and receive points! |\r\n\t\t\t| buttonText | Take Survey |\r\n\t\t\t| buttonLink | https://example.com/ |\r\n\t\tWhen a user views the Task Card\r\n\t\tThen they see \"40 Points\" as the heading\r\n\t\tAnd the \"40\" is bolded\r\n\t\tAnd they see \"Complete a survey\" bolded in the body\r\n\t\tAnd a details icon in the top right hand corner\r\n\t\tAnd a button with text \"Take Survey\" in the bottom right hand corner\r\n\t\tWhen they click the button\r\n\t\tThen they are redirected to \"example.com\" in a new window\r\n\t\tWhen they click the details icon\r\n\t\tThen \"Fill out our survey form and receive points!\" is shown as the card description\r\n\r\n\tScenario: A loading state is displayed while the Task Card is loading\r\n\t\tGiven a Task Card component\r\n\t\tWhen a user views the Task Card\r\n\t\tThen a loading state is displayed\r\n\t\tWhen the Task Card has loaded\r\n\t\tThen the loading state disapears\r\n\r\n\tScenario Outline: The Progress Bar can be shown or hidden but is hidden by default\r\n\t\tGiven a Task Card component\r\n\t\tAnd it <mayHave> \"showProgressBar\" <value>\r\n\t\tWhen a user views the Task Card\r\n\t\tThen the progress bar <mayBe> displayed\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | is |\r\n\t\t\t| has | false | isn't |\r\n\t\t\t| doesn't have | | isn't |\r\n\r\n\tScenario Outline: Tasks can be repeatable or one-time only but are one-time only be default\r\n\t\tGiven a Task Card component\r\n\t\tAnd it <mayHave> \"repeatable\" <value>\r\n\t\tAnd a user who has already completed the task\r\n\t\tWhen they views the Task Card\r\n\t\tThen they see a green checkmark icon beside the card heading\r\n\t\tAnd the card <mayBe> green\r\n\t\tAnd the card's border <mayBe> green\r\n\t\tAnd the CTA button <mayBe> disabled\r\n\t\tAnd the CTA button <mayBe> grey\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | isn't |\r\n\t\t\t| has | false | is |\r\n\t\t\t| doesn't have | | is |\r\n\r\n\tScenario: Task Expiries can be configured and disable the CTA after the expiry\r\n\t\tGiven a Task Card component\r\n\t\tAnd it is configured for <expiry>\r\n\t\tWhen a user views the Card on <day>\r\n\t\tThen they the expiry on <cardLocation>\r\n\t\tAnd the text <mayBe> orange\r\n\t\tAnd the card <mayBe> disabled\r\n\t\tAnd the card <mayBe> grey\r\n\t\tAnd the user <mayBe> unable to complete the loyalty task\r\n\t\tExamples:\r\n\t\t\t| expiry | day | cardLocation | mayBe |\r\n\t\t\t| Dec 31 2021 11:59:59 | Dec 1st 2021 12:00:00 | bottom left | isn't |\r\n\t\t\t| Dec 31 2021 11:59:59 | Dec 31 2021 11:00:00 | top right | isn't |\r\n\t\t\t| Dec 31 2021 11:59:59 | Jan 15th 2022 10:00:00 | top right | is |\r\n\r\n\tScenario Outline: Task expiry can be hidden or shown but is hidden by default\r\n\t\tGiven a Task Card\r\n\t\tAnd it is configured with an expiry\r\n\t\tAnd it <mayHave> \"showExpiry\" <value>\r\n\t\tWhen a user views the Task card\r\n\t\tThen the expiry <mayBe> shown in the bottom left hand corner\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | is |\r\n\t\t\t| has | false | isn't |\r\n\t\t\t| doesn't have | | isn't |\r\n\r\n\t#DS: Currently this text is non configurable and isnt set up for proper pluralization\r\n\tScenario Outline: A task completion count is displayed for repeatable tasks\r\n\t\tGiven a Task Card is configured for a repeatable task\r\n\t\tAnd has \"goalCompletionNumber\" <goalCompletionNumberValue>\r\n\t\tAnd a user with <userGoalProgress>\r\n\t\tWhen the user views the task card\r\n\t\tThen they see a repeat icon\r\n\t\tAnd the <text> in the bottom left hand corner\r\n\t\tAnd the <text> is green\r\n\t\tExamples:\r\n\t\t\t| goalCompletionNumber | userGoalProgress | text |\r\n\t\t\t| 1 | 0 | Completed 0 times |\r\n\t\t\t| 1 | 1 | Completed 1 times |\r\n\t\t\t| 1 | 2 | Completed 2 times |\r\n\t\t\t| 10 | 5 | Completed 0 times |\r\n\t\t\t| 10 | 12 | Completed 1 times |\r\n\t\t\t| 10 | 29 | Completed 2 times |\r\n\r\n\tScenario Outline: The source of a user's progress can be a custom field or a program goal\r\n\t\tGiven a Task Card is configured to have <progressSourcePath> progress source\r\n\t\tAnd a user\r\n\t\tWhen they view the Task card\r\n\t\tThen the value at <progressSourcePath> is used to benchmark their progress against the Goal Completion Count\r\n\t\tExamples:\r\n\t\t\t| value |\r\n\t\t\t| /customFields/activityCount |\r\n\t\t\t| /customFields/purchaseTotal |\r\n\t\t\t| /programGoals/count%2FComment-on-Article |\r\n\t\t\t| /programGoals/count/Referral-Started%2Freferrals |\r\n\r\n\tScenario Outline: The users completion of a goal is calculated by the Goal Completion Number\r\n\t\tGiven a Task Card is configured to have <goalValue>\r\n\t\tAnd a user who has <progressValue>\r\n\t\tWhen they view the Task Card\r\n\t\tThen they are shown to have <progressValue> towards <goalValue>\r\n\t\tWhen their progress grows larger than <goalValue>\r\n\t\tThen the task is marked as completed\r\n\t\tExamples:\r\n\t\t\t| goalValue | progressValue |\r\n\t\t\t| 1 | 0 |\r\n\t\t\t| 10 | 9 |\r\n\t\t\t| 5 | 2 |\r\n\r\n\tScenario: The Goal Completion Number defaults to 1\r\n\t\tGiven a Task Card without a configured \"goalCompletionNumber\"\r\n\t\tAnd a user who has <progressValue>\r\n\t\tWhen they view the Task Card\r\n\t\tThen it <mayBe> marked as completed\r\n\t\tExamples:\r\n\t\t\t| progressValue | mayBe |\r\n\t\t\t| 0 | isn't |\r\n\t\t\t| 1 | is |\r\n\t\t\t| 2 | is |";
21502
+
21503
+ const TaskCard_stories = {
21504
+ title: "Components/Task Card/",
21505
+ parameters: {
21506
+ scenario: scenario$5,
21507
+ },
19787
21508
  };
19788
- const FullStack$1 = () => {
19789
- return (h("sqm-user-name", { demoData: {
19790
- loading: false,
19791
- loadingText: "...",
19792
- username: "Test Testerson",
19793
- } }));
21509
+ const resizable = {
21510
+ width: "347px",
21511
+ minWidth: "347px",
21512
+ resize: "horizontal",
21513
+ height: "fit-content",
21514
+ overflow: "hidden",
19794
21515
  };
19795
- const FullStackDefault = () => {
19796
- return h("sqm-user-name", null);
21516
+ const NotRepeatable = () => {
21517
+ const oneAction = {
21518
+ rewardAmount: 20,
21519
+ showExpiry: false,
21520
+ rewardUnit: "Points",
21521
+ cardTitle: "Complete a survey",
21522
+ repeatable: false,
21523
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21524
+ buttonText: "Take survey",
21525
+ goal: 1,
21526
+ buttonLink: "https://example.com/",
21527
+ showProgressBar: false,
21528
+ loading: false,
21529
+ };
21530
+ const coupleActions = {
21531
+ rewardAmount: 40,
21532
+ rewardUnit: "Points",
21533
+ cardTitle: "Comment on 5 articles",
21534
+ showProgressBar: true,
21535
+ showExpiry: false,
21536
+ goal: 5,
21537
+ repeatable: false,
21538
+ steps: true,
21539
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21540
+ buttonText: "Start reading",
21541
+ buttonLink: "https://example.com/",
21542
+ loading: false,
21543
+ };
21544
+ const manyActions = {
21545
+ rewardAmount: 150,
21546
+ rewardUnit: "Points",
21547
+ cardTitle: "Spend $500 at our Store",
21548
+ showProgressBar: true,
21549
+ showExpiry: false,
21550
+ goal: 500,
21551
+ repeatable: false,
21552
+ progressBarUnit: "$",
21553
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21554
+ buttonText: "Visit our Store",
21555
+ buttonLink: "https://example.com/",
21556
+ loading: false,
21557
+ };
21558
+ return (h("div", { style: { display: "inline-flex", gap: "32px" } },
21559
+ h("div", { style: resizable },
21560
+ h("h4", null, "One Action"),
21561
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21562
+ " ",
21563
+ h("h5", null),
21564
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21565
+ " ",
21566
+ h("h5", null)),
21567
+ h("div", { style: resizable },
21568
+ h("h4", null, "A Couple Actions"),
21569
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
21570
+ " ",
21571
+ h("h5", null),
21572
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
21573
+ " ",
21574
+ h("h5", null),
21575
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
21576
+ " ",
21577
+ h("h5", null)),
21578
+ h("div", { style: resizable },
21579
+ h("h4", null, "Many Actions"),
21580
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
21581
+ " ",
21582
+ h("h5", null),
21583
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
21584
+ " ",
21585
+ h("h5", null),
21586
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
21587
+ " ",
21588
+ h("h5", null))));
21589
+ };
21590
+ const NotRepeatableWithExpiry = () => {
21591
+ const oneAction = {
21592
+ rewardAmount: 20,
21593
+ rewardUnit: "Points",
21594
+ cardTitle: "Complete a survey",
21595
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21596
+ buttonText: "Take survey",
21597
+ goal: 1,
21598
+ showExpiry: true,
21599
+ repeatable: false,
21600
+ dateExpires: "Nov 1, 2021",
21601
+ buttonLink: "https://example.com/",
21602
+ showProgressBar: false,
21603
+ loading: false,
21604
+ };
21605
+ const coupleActions = {
21606
+ rewardAmount: 40,
21607
+ rewardUnit: "Points",
21608
+ cardTitle: "Comment on 5 articles",
21609
+ showProgressBar: true,
21610
+ goal: 5,
21611
+ steps: true,
21612
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21613
+ buttonText: "Start reading",
21614
+ showExpiry: true,
21615
+ repeatable: false,
21616
+ dateExpires: "Nov 1, 2021",
21617
+ buttonLink: "https://example.com/",
21618
+ loading: false,
21619
+ };
21620
+ const manyActions = {
21621
+ rewardAmount: 150,
21622
+ rewardUnit: "Points",
21623
+ repeatable: false,
21624
+ cardTitle: "Spend $500 at our Store",
21625
+ showProgressBar: true,
21626
+ goal: 500,
21627
+ progressBarUnit: "$",
21628
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21629
+ buttonText: "Visit our Store",
21630
+ showExpiry: true,
21631
+ dateExpires: "Nov 1, 2021",
21632
+ buttonLink: "https://example.com/",
21633
+ loading: false,
21634
+ };
21635
+ return (h("div", { style: { display: "inline-flex", gap: "32px" } },
21636
+ h("div", { style: resizable },
21637
+ h("h4", null, "One Action"),
21638
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21639
+ " ",
21640
+ h("h5", null),
21641
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21642
+ " ",
21643
+ h("h5", null)),
21644
+ h("div", { style: resizable },
21645
+ h("h4", null, "A Couple Actions"),
21646
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
21647
+ " ",
21648
+ h("h5", null),
21649
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
21650
+ " ",
21651
+ h("h5", null),
21652
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
21653
+ " ",
21654
+ h("h5", null)),
21655
+ h("div", { style: resizable },
21656
+ h("h4", null, "Many Actions"),
21657
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
21658
+ " ",
21659
+ h("h5", null),
21660
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
21661
+ " ",
21662
+ h("h5", null),
21663
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
21664
+ " ",
21665
+ h("h5", null))));
21666
+ };
21667
+ const Repeatable = () => {
21668
+ const oneAction = {
21669
+ rewardAmount: 20,
21670
+ rewardUnit: "Points",
21671
+ showExpiry: false,
21672
+ cardTitle: "Complete a survey",
21673
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21674
+ buttonText: "Take survey",
21675
+ goal: 1,
21676
+ repeatable: true,
21677
+ buttonLink: "https://example.com/",
21678
+ showProgressBar: false,
21679
+ loading: false,
21680
+ };
21681
+ const coupleActions = {
21682
+ rewardAmount: 40,
21683
+ rewardUnit: "Points",
21684
+ showExpiry: false,
21685
+ cardTitle: "Comment on 5 articles",
21686
+ showProgressBar: true,
21687
+ repeatable: true,
21688
+ goal: 5,
21689
+ steps: true,
21690
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21691
+ buttonText: "Start reading",
21692
+ buttonLink: "https://example.com/",
21693
+ loading: false,
21694
+ };
21695
+ const manyActions = {
21696
+ rewardAmount: 150,
21697
+ rewardUnit: "Points",
21698
+ showExpiry: false,
21699
+ cardTitle: "Spend $500 at our Store",
21700
+ showProgressBar: true,
21701
+ repeatable: true,
21702
+ goal: 500,
21703
+ progressBarUnit: "$",
21704
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21705
+ buttonText: "Visit our Store",
21706
+ buttonLink: "https://example.com/",
21707
+ loading: false,
21708
+ };
21709
+ return (h("div", { style: { display: "inline-flex", gap: "32px" } },
21710
+ h("div", { style: resizable },
21711
+ h("h4", null, "One Action"),
21712
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21713
+ " ",
21714
+ h("h5", null),
21715
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21716
+ " ",
21717
+ h("h5", null)),
21718
+ h("div", { style: resizable },
21719
+ h("h4", null, "A Couple Actions"),
21720
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
21721
+ " ",
21722
+ h("h5", null),
21723
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
21724
+ " ",
21725
+ h("h5", null),
21726
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
21727
+ " ",
21728
+ h("h5", null),
21729
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
21730
+ " ",
21731
+ h("h5", null)),
21732
+ h("div", { style: resizable },
21733
+ h("h4", null, "Many Actions"),
21734
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
21735
+ " ",
21736
+ h("h5", null),
21737
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
21738
+ " ",
21739
+ h("h5", null),
21740
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
21741
+ " ",
21742
+ h("h5", null),
21743
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
21744
+ " ",
21745
+ h("h5", null))));
21746
+ };
21747
+ const RepeatableWithExpiry = () => {
21748
+ const oneAction = {
21749
+ rewardAmount: 20,
21750
+ rewardUnit: "Points",
21751
+ cardTitle: "Complete a survey",
21752
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21753
+ buttonText: "Take survey",
21754
+ goal: 1,
21755
+ repeatable: true,
21756
+ showExpiry: true,
21757
+ dateExpires: "Nov 1, 2021",
21758
+ buttonLink: "https://example.com/",
21759
+ showProgressBar: false,
21760
+ loading: false,
21761
+ };
21762
+ const coupleActions = {
21763
+ rewardAmount: 40,
21764
+ rewardUnit: "Points",
21765
+ cardTitle: "Comment on 5 articles",
21766
+ showProgressBar: true,
21767
+ repeatable: true,
21768
+ goal: 5,
21769
+ steps: true,
21770
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21771
+ buttonText: "Start reading",
21772
+ showExpiry: true,
21773
+ dateExpires: "Nov 1, 2021",
21774
+ buttonLink: "https://example.com/",
21775
+ loading: false,
21776
+ };
21777
+ const manyActions = {
21778
+ rewardAmount: 150,
21779
+ rewardUnit: "Points",
21780
+ cardTitle: "Spend $500 at our Store",
21781
+ showProgressBar: true,
21782
+ repeatable: true,
21783
+ goal: 500,
21784
+ progressBarUnit: "$",
21785
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21786
+ buttonText: "Visit our Store",
21787
+ showExpiry: true,
21788
+ dateExpires: "Nov 1, 2021",
21789
+ buttonLink: "https://example.com/",
21790
+ loading: false,
21791
+ };
21792
+ return (h("div", { style: { display: "inline-flex", gap: "32px" } },
21793
+ h("div", { style: resizable },
21794
+ h("h4", null, "One Action"),
21795
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21796
+ " ",
21797
+ h("h5", null),
21798
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21799
+ " ",
21800
+ h("h5", null)),
21801
+ h("div", { style: resizable },
21802
+ h("h4", null, "A Couple Actions"),
21803
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
21804
+ " ",
21805
+ h("h5", null),
21806
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
21807
+ " ",
21808
+ h("h5", null),
21809
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
21810
+ " ",
21811
+ h("h5", null),
21812
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
21813
+ " ",
21814
+ h("h5", null)),
21815
+ h("div", { style: resizable },
21816
+ h("h4", null, "Many Actions"),
21817
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
21818
+ " ",
21819
+ h("h5", null),
21820
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
21821
+ " ",
21822
+ h("h5", null),
21823
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
21824
+ " ",
21825
+ h("h5", null),
21826
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
21827
+ " ",
21828
+ h("h5", null))));
19797
21829
  };
19798
21830
 
19799
- const UserName = /*#__PURE__*/Object.freeze({
21831
+ const TaskCard$1 = /*#__PURE__*/Object.freeze({
19800
21832
  __proto__: null,
19801
- 'default': UserName_stories,
19802
- FullStack: FullStack$1,
19803
- FullStackDefault: FullStackDefault
21833
+ 'default': TaskCard_stories,
21834
+ NotRepeatable: NotRepeatable,
21835
+ NotRepeatableWithExpiry: NotRepeatableWithExpiry,
21836
+ Repeatable: Repeatable,
21837
+ RepeatableWithExpiry: RepeatableWithExpiry
19804
21838
  });
19805
21839
 
19806
- const PasswordField_stories = {
19807
- title: "Portal Password Field",
21840
+ /**
21841
+ * Displays a cartesian product of the input props
21842
+ *
21843
+ * @returns
21844
+ */
21845
+ function MatrixStory({ matrix, props, Component, }) {
21846
+ const propMatrix = Object.keys(matrix).map((propKey) => {
21847
+ const propValues = matrix[propKey];
21848
+ return propValues.map((val) => {
21849
+ return {
21850
+ [propKey]: val,
21851
+ };
21852
+ });
21853
+ });
21854
+ const combinations = cartesian(...propMatrix);
21855
+ const propsCombinations = combinations.map((combo) => {
21856
+ return combo.reduce((props, prop) => {
21857
+ return {
21858
+ ...props,
21859
+ ...prop,
21860
+ };
21861
+ }, {});
21862
+ });
21863
+ return propsCombinations.map((combo) => {
21864
+ const example = { ...props, ...combo };
21865
+ return (h("div", null,
21866
+ h(PropsTable, { values: example }),
21867
+ h("hr", null),
21868
+ h(Component, Object.assign({}, example))));
21869
+ });
21870
+ }
21871
+ function PropsTable({ values }) {
21872
+ return (h("table", null,
21873
+ h("tbody", null, Object.keys(values).map((key) => {
21874
+ return (h("tr", null,
21875
+ h("th", null, key),
21876
+ h("td", null, JSON.stringify(values[key]))));
21877
+ }))));
21878
+ }
21879
+ /**
21880
+ * Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
21881
+ *
21882
+ * TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
21883
+ *
21884
+ * @param args - an array of arrays
21885
+ * @returns combinations of the elements in those array
21886
+ */
21887
+ function cartesian(...args) {
21888
+ var r = [], max = args.length - 1;
21889
+ function helper(arr, i) {
21890
+ for (var j = 0, l = args[i].length; j < l; j++) {
21891
+ var a = arr.slice(0); // clone arr
21892
+ a.push(args[i][j]);
21893
+ if (i == max)
21894
+ r.push(a);
21895
+ else
21896
+ helper(a, i + 1);
21897
+ }
21898
+ }
21899
+ helper([], 0);
21900
+ return r;
21901
+ }
21902
+
21903
+ const scenario$6 = "@author:\r\n@owner:\r\nFeature: Task Card Progress Bar\r\n\r\n\tScenario Outline: Progress Bar\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> with <unit> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | color |\r\n\t\t\t| -100 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 0 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 250 | 500 | ―――――――――●―――――――――🎁 | $ | no |\r\n\t\t\t| 500 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\t\t\t| 1000 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\r\n\tScenario Outline: Progress Bar Steps\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps from 1 to <goal>\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | color |\r\n\t\t\t| -1 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 0 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 1 | 5 | ―――●―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 5 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\t\t\t| 7 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\r\n\r\n\tScenario Outline: Progress Bar Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd <icon1> has <color1>\r\n\t\tAnd <icon2> has <color2>\r\n\t\tAnd <icon3> has <color3>\r\n\t\tAnd <icon1> shows <text1> below\r\n\t\tAnd <icon2> shows <text2> below\r\n\t\tAnd <icon3> shows <text3> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | icon1 | icon2 | icon3 | color1 | color2 | color3 | text 1 | text 2 | text 3 |\r\n\t\t\t| 250 | 500 | ――――●――――🎁―――――――🎁 | $ | NA | gift | gift | NA | no | no | NA | 500 | 1000 |\r\n\t\t\t| 500 | 500 | ―――――――――🎁―――――――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 750 | 500 | ―――――――――🎁―――●―――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 1000 | 500 | 🎁―――――――🎁―――――――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\t\t\t| 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\r\n\t# \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t math logic inside text ?\r\n\t# | 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | gift | gift | gift | yes | yes | no | goal * (⌊ progress / goal ⌋ - 1) | goal * ⌊ progress / goal ⌋ | goal * (⌊ progress / goal ⌋ +1) |\r\n\r\n\r\n\tScenario Outline: Progress Bar Steps Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar |";
21904
+
21905
+ const progressBar_stories = {
21906
+ title: "Components/Task Card Progress Bar",
21907
+ parameters: {
21908
+ scenario: scenario$6,
21909
+ },
19808
21910
  };
19809
- const Start = () => {
19810
- return (h("sqm-password-field", { demoData: {
19811
- initValue: "",
19812
- states: {
19813
- enableValidation: true,
19814
- validationErrors: {},
19815
- content: {
19816
- fieldLabel: "Password",
19817
- },
19818
- },
19819
- } }));
21911
+ const Default$a = () => {
21912
+ return h(ProgressBarView, null);
19820
21913
  };
19821
- const EmptyError = () => {
19822
- return (h("sqm-password-field", { demoData: {
19823
- initValue: "",
19824
- states: {
19825
- enableValidation: true,
19826
- validationErrors: { password: "Cannot be empty" },
19827
- content: {
19828
- fieldLabel: "Password",
19829
- },
19830
- },
19831
- } }));
21914
+ const ProgressBar$1 = () => {
21915
+ const props = {
21916
+ progress: 0,
21917
+ goal: 500,
21918
+ progressBarUnit: "$",
21919
+ };
21920
+ return (h("div", null,
21921
+ h(MatrixStory, { matrix: { progress: [-100, 0, 100, 500, 1000] }, props: props, Component: ProgressBarView })));
19832
21922
  };
19833
- const ValidationError = () => {
19834
- return (h("sqm-password-field", { demoData: {
19835
- initValue: "asdf",
19836
- states: {
19837
- enableValidation: true,
19838
- validationErrors: { password: "Incomplete" },
19839
- content: {
19840
- fieldLabel: "Password",
19841
- },
19842
- },
19843
- } }));
21923
+ const ProgressBarSteps = () => {
21924
+ const props = {
21925
+ progress: 0,
21926
+ steps: true,
21927
+ goal: 5,
21928
+ progressBarUnit: "$",
21929
+ };
21930
+ return (h("div", null,
21931
+ h(MatrixStory, { matrix: { progress: [-1, 0, 1, 5, 7] }, props: props, Component: ProgressBarView })));
21932
+ };
21933
+ const ProgressBarRepeatable = () => {
21934
+ const props = {
21935
+ progress: 0,
21936
+ goal: 500,
21937
+ progressBarUnit: "$",
21938
+ repeatable: true,
21939
+ };
21940
+ return (h("div", null,
21941
+ h(MatrixStory, { matrix: { progress: [100, 500, 650, 1200] }, props: props, Component: ProgressBarView })));
21942
+ };
21943
+ const ProgressBarStepsRepeatable = () => {
21944
+ const props = {
21945
+ progress: 0,
21946
+ steps: true,
21947
+ goal: 5,
21948
+ progressBarUnit: "$",
21949
+ repeatable: true,
21950
+ };
21951
+ return (h("div", null,
21952
+ h(MatrixStory, { matrix: { progress: [1, 5, 7, 12] }, props: props, Component: ProgressBarView })));
19844
21953
  };
19845
21954
 
19846
- const PasswordField = /*#__PURE__*/Object.freeze({
21955
+ const TaskCardProgressBar = /*#__PURE__*/Object.freeze({
19847
21956
  __proto__: null,
19848
- 'default': PasswordField_stories,
19849
- Start: Start,
19850
- EmptyError: EmptyError,
19851
- ValidationError: ValidationError
21957
+ 'default': progressBar_stories,
21958
+ Default: Default$a,
21959
+ ProgressBar: ProgressBar$1,
21960
+ ProgressBarSteps: ProgressBarSteps,
21961
+ ProgressBarRepeatable: ProgressBarRepeatable,
21962
+ ProgressBarStepsRepeatable: ProgressBarStepsRepeatable
19852
21963
  });
19853
21964
 
19854
21965
  const portalTemplate = "<sqm-portal-frame>\r\n <a slot=\"header\" href=\"/\">\r\n <sqm-text style=\"height: 60px\">\r\n <img\r\n style=\"height: 60px\"\r\n src=\"https://res.cloudinary.com/saasquatch/image/upload/v1634255445/squatch-assets/Copy_of_saasquatch-logo-tree-large-horizontal.png\"\r\n />\r\n </sqm-text>\r\n </a>\r\n <sqb-program-section program-id=\"referral-program\">\r\n <sqm-router>\r\n <template\r\n path=\"/:path(\\bregister\\b|\\bemailVerification\\b|\\blogin\\b|\\bverifyEmail\\b|\\bforgotPassword\\b|\\bresetPassword\\b|\\blogout\\b)\"\r\n >\r\n <sqm-graphql-client-provider\r\n domain=\"https://managed-identity.saasquatch.com\"\r\n >\r\n <sqm-hero\r\n background=\"https://images.unsplash.com/photo-1599676821464-3555954838dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1939&q=80\"\r\n >\r\n <sqm-router>\r\n <template path=\"/register\">\r\n <sqm-portal-register>\r\n <sqm-name-fields slot=\"formData\"></sqm-name-fields>\r\n </sqm-portal-register>\r\n </template>\r\n\r\n <template path=\"/emailVerification\">\r\n <sqm-portal-protected-route\r\n redirect-to=\"/login\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-email-verification></sqm-portal-email-verification>\r\n </template>\r\n\r\n <template path=\"/login\">\r\n <sqm-portal-login></sqm-portal-login>\r\n </template>\r\n\r\n <template path=\"/verifyEmail\">\r\n <sqm-portal-verify-email></sqm-portal-verify-email>\r\n </template>\r\n\r\n <template path=\"/forgotPassword\">\r\n <sqm-portal-forgot-password\r\n email-label=\"Business Email\"\r\n ></sqm-portal-forgot-password>\r\n </template>\r\n\r\n <template path=\"/resetPassword\">\r\n <sqm-portal-reset-password\r\n confirm-password=\"true\"\r\n ></sqm-portal-reset-password>\r\n </template>\r\n <template path=\"/logout\">\r\n <sqm-portal-logout next-page=\"/login\"></sqm-portal-logout>\r\n </template>\r\n </sqm-router>\r\n </sqm-hero>\r\n </sqm-graphql-client-provider>\r\n </template>\r\n </sqm-router>\r\n <sqm-router>\r\n <template path=\"/:path(\\bactivity\\b|\\beditProfile\\b)?\">\r\n <sqm-divided-layout\r\n direction=\"row\"\r\n style=\"\r\n border-top: 1px solid #eaeaea;\r\n border-bottom: 1px solid #eaeaea;\r\n \"\r\n >\r\n <sqm-navigation-sidebar>\r\n <sqm-navigation-sidebar-item\r\n path=\"/\"\r\n icon=\"house\"\r\n label=\"Dashboard\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/activity\"\r\n icon=\"bar-chart\"\r\n label=\"Activity\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/editProfile\"\r\n icon=\"person\"\r\n label=\"Edit Profile\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/logout\"\r\n icon=\"box-arrow-right\"\r\n label=\"Logout\"\r\n ></sqm-navigation-sidebar-item>\r\n </sqm-navigation-sidebar>\r\n <sqm-divided-layout direction=\"column\">\r\n <sqm-router>\r\n <template path=\"/\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqb-widget\r\n widget-type=\"p/referral-program/w/referrerWidget\"\r\n track-loads=\"true\"\r\n ></sqb-widget>\r\n </template>\r\n <template path=\"/editProfile\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-container direction=\"column\" gap=\"xxx-large\">\r\n <sqm-portal-profile></sqm-portal-profile> </sqm-portal-container\r\n ><sqm-portal-container direction=\"column\" gap=\"xxx-large\">\r\n <sqm-graphql-client-provider\r\n domain=\"https://managed-identity.saasquatch.com\"\r\n >\r\n <sqm-portal-change-password></sqm-portal-change-password>\r\n </sqm-graphql-client-provider>\r\n </sqm-portal-container>\r\n </template>\r\n\r\n <template path=\"/activity\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-container\r\n direction=\"column\"\r\n padding=\"xxx-large\"\r\n gap=\"xxx-large\"\r\n >\r\n <sqm-text> <h1>Activity</h1></sqm-text>\r\n <sqm-stat-container space=\"xxxx-large\"\r\n ><sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/referralsCount\"\r\n ><sqm-text><p>Referrals</p></sqm-text></sqm-big-stat\r\n >\r\n <sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/rewardsCountFiltered/AVAILABLE\"\r\n ><sqm-text><p>Rewards Earned</p></sqm-text></sqm-big-stat\r\n >\r\n <sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/rewardBalance/CREDIT/CENTS\"\r\n ><sqm-text><p>Reward Balance</p></sqm-text></sqm-big-stat\r\n >\r\n </sqm-stat-container>\r\n <sqm-referral-table>\r\n <sqm-referral-table-user-column></sqm-referral-table-user-column>\r\n <sqm-referral-table-rewards-column></sqm-referral-table-rewards-column>\r\n <sqm-referral-table-status-column></sqm-referral-table-status-column>\r\n <sqm-referral-table-date-column\r\n column-title=\"Referred\"\r\n date-shown=\"dateReferralStarted\"\r\n ></sqm-referral-table-date-column> </sqm-referral-table\r\n ></sqm-portal-container>\r\n </template>\r\n </sqm-router>\r\n </sqm-divided-layout>\r\n </sqm-divided-layout>\r\n </template>\r\n </sqm-router>\r\n </sqb-program-section>\r\n <sqm-portal-footer\r\n slot=\"footer\"\r\n support-email=\"support@example.com\"\r\n terms-link=\"https://example.com\"\r\n faq-link=\"https://example.com\"\r\n terms-text=\"Terms And Conditions\"\r\n faq-text=\"FAQ\"\r\n show-powered-by=\"true\"\r\n ></sqm-portal-footer>\r\n</sqm-portal-frame>\r\n";
@@ -22863,7 +24974,7 @@ const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Gen
22863
24974
 
22864
24975
  const ForgotPasswordReadme = "# sqm-portal-forgot-password\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------- | -------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; }; content?: { secondaryButton: any; messageSlot: any; emailLabel?: string; submitLabel?: string; }; }` | `undefined` |\r\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\r\n| `submitLabel` | `submit-label` | | `string` | `\"Request Password Reset\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-forgot-password --> sqm-form-message\r\n style sqm-portal-forgot-password fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
22865
24976
 
22866
- const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| -------------------------- | ---------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\r\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\r\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; confirmPassword: boolean; hideInputs: boolean; validationState?: FormState; enablePasswordValidation?: boolean; }; content?: { formData?: any; passwordField?: any; secondaryButton?: any; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; }; refs?: { formRef: any; }; }` | `undefined` |\r\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\r\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\r\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\r\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\r\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\r\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\r\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\r\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Used by\r\n\r\n - [sqm-stencilbook](../sqm-stencilbook)\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n- [sqm-password-field](../sqm-password-field)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-register --> sqm-form-message\r\n sqm-portal-register --> sqm-password-field\r\n sqm-stencilbook --> sqm-portal-register\r\n style sqm-portal-register fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
24977
+ const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| -------------------------- | ---------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\r\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\r\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; confirmPassword: boolean; hideInputs: boolean; validationState?: FormState; enablePasswordValidation?: boolean; }; refs?: { formRef: any; }; content?: { formData?: any; passwordField?: any; secondaryButton?: any; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; }; }` | `undefined` |\r\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\r\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\r\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\r\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\r\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\r\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\r\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\r\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Used by\r\n\r\n - [sqm-stencilbook](../sqm-stencilbook)\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n- [sqm-password-field](../sqm-password-field)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-register --> sqm-form-message\r\n sqm-portal-register --> sqm-password-field\r\n sqm-stencilbook --> sqm-portal-register\r\n style sqm-portal-register fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
22867
24978
 
22868
24979
  const EditProfileReadme = "# sqm-portal-profile\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------ | --------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |\r\n| `countrytext` | `countrytext` | | `string` | `\"Country\"` |\r\n| `demoData` | -- | | `{ states?: { success: boolean; loading: boolean; submitDisabled: boolean; showCountry: boolean; formState: { country: string; firstName: string; lastName: string; errors: any; error: string; }; user: { id: string; accountId: string; firstName: string; lastName: string; email: string; countryCode: string; }; text: { firstnametext: string; lastnametext: string; emailtext: string; countrytext: string; editProfileHeader: string; editProfileSubHeader: string; submitChangeButtonText: string; }; }; }` | `undefined` |\r\n| `editProfileHeader` | `edit-profile-header` | | `string` | `\"Edit your profile\"` |\r\n| `editProfileSubHeader` | `edit-profile-sub-header` | | `string` | `\"Personal Information\"` |\r\n| `emailtext` | `emailtext` | | `string` | `\"Email\"` |\r\n| `firstnametext` | `firstnametext` | | `string` | `\"First Name\"` |\r\n| `lastnametext` | `lastnametext` | | `string` | `\"Last Name\"` |\r\n| `showCountry` | `show-country` | | `boolean` | `true` |\r\n| `submitChangeButtonText` | `submit-change-button-text` | | `string` | `\"Submit Changes\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-profile --> sqm-form-message\r\n style sqm-portal-profile fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
22869
24980
 
@@ -22871,7 +24982,7 @@ const ResetPasswordReadme = "# sqm-portal-reset-password\r\n\r\n\r\n\r\n<!-- Aut
22871
24982
 
22872
24983
  const EmailVerificationReadme = "# sqm-portal-email-verification\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------- | --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; }; content?: { email: string; verifyMessage: string; emailVerificationHeader: string; resendEmailButtonText: string; }; }` | `undefined` |\r\n| `emailVerificationHeader` | `email-verification-header` | | `string` | `\"Verify your email\"` |\r\n| `resendEmailButtonText` | `resend-email-button-text` | | `string` | `\"Re-send Email\"` |\r\n| `verifyMessage` | `verify-message` | | `string` | `\"A verification email was sent to {email}. Please verify your email to continue to the portal.\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-email-verification --> sqm-form-message\r\n style sqm-portal-email-verification fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
22873
24984
 
22874
- const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| ---------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | ----------- |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; verified: boolean; }; data?: { oobCode: string; }; }` | `undefined` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n\n\n## Dependencies\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-verify-email --> sqm-form-message\n style sqm-portal-verify-email fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
24985
+ const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ---------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | ----------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; verified: boolean; }; data?: { oobCode: string; }; }` | `undefined` |\r\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-verify-email --> sqm-form-message\r\n style sqm-portal-verify-email fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
22875
24986
 
22876
24987
  const PortalTemplates_stories = {
22877
24988
  title: "Templates / Portal",
@@ -23069,7 +25180,7 @@ const ProgramMenu$1 = /*#__PURE__*/Object.freeze({
23069
25180
  const PoweredByImg_stories = {
23070
25181
  title: "Powered By",
23071
25182
  };
23072
- const Default$a = () => {
25183
+ const Default$b = () => {
23073
25184
  return h(PoweredByImg$1, null);
23074
25185
  };
23075
25186
  const CustomColor = () => {
@@ -23082,17 +25193,17 @@ const CustomWidthAndHeight = () => {
23082
25193
  const PoweredByImg = /*#__PURE__*/Object.freeze({
23083
25194
  __proto__: null,
23084
25195
  'default': PoweredByImg_stories,
23085
- Default: Default$a,
25196
+ Default: Default$b,
23086
25197
  CustomColor: CustomColor,
23087
25198
  CustomWidthAndHeight: CustomWidthAndHeight
23088
25199
  });
23089
25200
 
23090
- const scenario$5 = "Feature: Portal Footer\r\n\r\n Background: A user is viewing the portal\r\n Given a hosted portal\r\n And a user is viewing the portal\r\n And the portal has a footer\r\n\r\n Scenario Outline: FAQ and T&C links/text are configurable and open in a new page when clicked\r\n Given the footer has prop \"terms-link\" with value \"https://example.com/terms\"\r\n And prop \"terms-text\" with value \"Terms and Conditions\"\r\n And prop \"faq-link\" with value \"https://example.com/FAQ\"\r\n And prop \"faq-text\" with value \"Visit FAQ\"\r\n When a user clicks on the \"Visit FAQ\" link\r\n Then they will be redirected to \"https://example.com/FAQ\" in a new page\r\n When they go back to the portal\r\n And click on the \"Terms and Conditions\" link\r\n Then they will be redirected to \"https://example.com/terms\" in a new page\r\n\r\n Scenario Outline: FAQ/T&C Links are not shown if a link is not provided\r\n Given the footer does not have <linkProp>\r\n But it <mayHave> <textProp> with <value>\r\n Then the <link> will not be shown in the footer\r\n Examples:\r\n | linkProp | mayHave | textProp | value | link |\r\n | terms-link | has | termsText | Terms and Conditions | T&C Link |\r\n | faq-link | has | faqText | Visit FAQ | FAQ Link |\r\n | terms-link | doesn't have | | | T&C Link |\r\n | faq-link | doesn't have | | | FAQ Link |\r\n\r\n Scenario Outline: The support email and text is configurable but has a default\r\n Given the footer <mayHave> <emailPropWithValue>\r\n And the footer <mayAlsoHave> <textPropWithValue>\r\n Then the footer's support email text is <renderedEmailText>\r\n And the email address will be a mailto link with <mailtoEmail>\r\n When the user clicks on the email address mailto Link\r\n Then the users preferred email client will open with a draft email to <mailtoEmail>\r\n Examples:\r\n | mayHave | emailPropWithValue | mayAlsoHave | textPropWithValue | mailtoEmail | renderedEmailText |\r\n | has | support@saasquatch.com | has | For support please contact {email} | support@saasquatch.com | For support please contact support@saasquatch.com |\r\n | doesn't have | N/A | doesn't have | N/A | support@example.com | For program support, contact support@example.com |\r\n\r\n Scenario Outline: Powered by SaaSquatch is shown by default\r\n Given the footer <mayHaveProp> \"show-powered-by\" with <value>\r\n Then the powered by SaaSquatch image <mayBeShown>\r\n Examples:\r\n | mayHaveProp | value | mayBeShown |\r\n | has prop | true | is shown |\r\n | has prop | false | isn't shown |\r\n | has prop | test | is shown |\r\n | has prop | | is shown |\r\n | doesn't have prop | | is shown |\r\n\r\n Scenario: Powered By Saasquatch links out to \"https://saasquatch.com\"\r\n Given the footer has the powered by SaaSquatch image\r\n When a user clicks on it\r\n Then they will be redirected to \"https://saasquatch.com\" in a new page";
25201
+ const scenario$7 = "Feature: Portal Footer\r\n\r\n Background: A user is viewing the portal\r\n Given a hosted portal\r\n And a user is viewing the portal\r\n And the portal has a footer\r\n\r\n Scenario Outline: FAQ and T&C links/text are configurable and open in a new page when clicked\r\n Given the footer has prop \"terms-link\" with value \"https://example.com/terms\"\r\n And prop \"terms-text\" with value \"Terms and Conditions\"\r\n And prop \"faq-link\" with value \"https://example.com/FAQ\"\r\n And prop \"faq-text\" with value \"Visit FAQ\"\r\n When a user clicks on the \"Visit FAQ\" link\r\n Then they will be redirected to \"https://example.com/FAQ\" in a new page\r\n When they go back to the portal\r\n And click on the \"Terms and Conditions\" link\r\n Then they will be redirected to \"https://example.com/terms\" in a new page\r\n\r\n Scenario Outline: FAQ/T&C Links are not shown if a link is not provided\r\n Given the footer does not have <linkProp>\r\n But it <mayHave> <textProp> with <value>\r\n Then the <link> will not be shown in the footer\r\n Examples:\r\n | linkProp | mayHave | textProp | value | link |\r\n | terms-link | has | termsText | Terms and Conditions | T&C Link |\r\n | faq-link | has | faqText | Visit FAQ | FAQ Link |\r\n | terms-link | doesn't have | | | T&C Link |\r\n | faq-link | doesn't have | | | FAQ Link |\r\n\r\n Scenario Outline: The support email and text is configurable but has a default\r\n Given the footer <mayHave> <emailPropWithValue>\r\n And the footer <mayAlsoHave> <textPropWithValue>\r\n Then the footer's support email text is <renderedEmailText>\r\n And the email address will be a mailto link with <mailtoEmail>\r\n When the user clicks on the email address mailto Link\r\n Then the users preferred email client will open with a draft email to <mailtoEmail>\r\n Examples:\r\n | mayHave | emailPropWithValue | mayAlsoHave | textPropWithValue | mailtoEmail | renderedEmailText |\r\n | has | support@saasquatch.com | has | For support please contact {email} | support@saasquatch.com | For support please contact support@saasquatch.com |\r\n | doesn't have | N/A | doesn't have | N/A | support@example.com | For program support, contact support@example.com |\r\n\r\n Scenario Outline: Powered by SaaSquatch is shown by default\r\n Given the footer <mayHaveProp> \"show-powered-by\" with <value>\r\n Then the powered by SaaSquatch image <mayBeShown>\r\n Examples:\r\n | mayHaveProp | value | mayBeShown |\r\n | has prop | true | is shown |\r\n | has prop | false | isn't shown |\r\n | has prop | test | is shown |\r\n | has prop | | is shown |\r\n | doesn't have prop | | is shown |\r\n\r\n Scenario: Powered By Saasquatch links out to \"https://saasquatch.com\"\r\n Given the footer has the powered by SaaSquatch image\r\n When a user clicks on it\r\n Then they will be redirected to \"https://saasquatch.com\" in a new page";
23091
25202
 
23092
25203
  const PortalFooter_stories = {
23093
25204
  title: "Portal Footer",
23094
25205
  parameters: {
23095
- scenario: scenario$5,
25206
+ scenario: scenario$7,
23096
25207
  },
23097
25208
  };
23098
25209
  const defaultProps$9 = {
@@ -23121,12 +25232,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
23121
25232
  FooterNoPoweredBy: FooterNoPoweredBy
23122
25233
  });
23123
25234
 
23124
- const scenario$6 = "Feature: Hero Unit\r\n\r\n Background: A portal with a hero unit exists\r\n Given a hosted portal\r\n And the portal has hero unit on the login page\r\n And a user is viewing the login page\r\n\r\n Scenario: The hero unit defaults to a single column layout\r\n Given a hero unit does not have a \"columns\" prop\r\n But the following html is wrapped by the hero unit\r\n \"\"\"\r\n <sqm-portal-login></sqm-portal-login>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Get Referring!</h1>\r\n <p style=\"text-align:center\">\r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim\r\n ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\r\n aliquip ex ea commodo consequat. Duis aute irure dolor in\r\n reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\r\n pariatur.\r\n </p>\r\n </div>\r\n \"\"\"\r\n Then only a single column will be displayed\r\n And within it will be the login component\r\n\r\n Scenario Outline: The hero unit supports single or dual column layouts\r\n Given a hero unit with prop \"columns\" having <columnValue>\r\n And it wraps <html>\r\n Then the hero unit displays <columnValue> columns\r\n Examples:\r\n | columnValue | html |\r\n | 1 | <h1>Column 1!</h1> |\r\n | 2 | <h1>Column 1!</h1><div slot=\"secondary-column\"><h1 style=\"text-align:center\">Column 2!</h1></div> |\r\n\r\n Scenario: HTML to be displayed in the second column comes from the \"secondary-column\" slot\r\n Given a hero unit with \"columns\" \"2\"\r\n And the following html\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div>\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n When the hero unit is rendered\r\n Then only one column is displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 1 will contain the \"Column 2!\" text\r\n When the div for column two is updated to have 'slot=\"secondary-column\"'\r\n Then the two columns are displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 2 will contain the \"Column 2!\" text\r\n\r\n Scenario Outline: A background for the hero unit can be set as an image or colour\r\n Given a hero unit with <backgroundPropValue>\r\n Then the background will be <background>\r\n Examples:\r\n | background | background |\r\n | https://images.unsplash.com/photo-1599676821464-3555954838d | image of misty mountains |\r\n | LightSlateGrey | light slate grey |\r\n | #00FF00 | green |\r\n | rgb(128,0,128) | purple |\r\n\r\n Scenario Outline: Wrap Direction can be configured for mobile experiences\r\n Given a hero unit with the following HTML\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n And prop \"wrap-direction\" has <value>\r\n When the window width is less than 600px\r\n Then the two columns will stack\r\n And <column> will be on top\r\n Examples:\r\n | value | column |\r\n | wrap | 1 |\r\n | wrap-reverse | 2 |\r\n | | 1 |";
25235
+ const scenario$8 = "Feature: Hero Unit\r\n\r\n Background: A portal with a hero unit exists\r\n Given a hosted portal\r\n And the portal has hero unit on the login page\r\n And a user is viewing the login page\r\n\r\n Scenario: The hero unit defaults to a single column layout\r\n Given a hero unit does not have a \"columns\" prop\r\n But the following html is wrapped by the hero unit\r\n \"\"\"\r\n <sqm-portal-login></sqm-portal-login>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Get Referring!</h1>\r\n <p style=\"text-align:center\">\r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim\r\n ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\r\n aliquip ex ea commodo consequat. Duis aute irure dolor in\r\n reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\r\n pariatur.\r\n </p>\r\n </div>\r\n \"\"\"\r\n Then only a single column will be displayed\r\n And within it will be the login component\r\n\r\n Scenario Outline: The hero unit supports single or dual column layouts\r\n Given a hero unit with prop \"columns\" having <columnValue>\r\n And it wraps <html>\r\n Then the hero unit displays <columnValue> columns\r\n Examples:\r\n | columnValue | html |\r\n | 1 | <h1>Column 1!</h1> |\r\n | 2 | <h1>Column 1!</h1><div slot=\"secondary-column\"><h1 style=\"text-align:center\">Column 2!</h1></div> |\r\n\r\n Scenario: HTML to be displayed in the second column comes from the \"secondary-column\" slot\r\n Given a hero unit with \"columns\" \"2\"\r\n And the following html\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div>\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n When the hero unit is rendered\r\n Then only one column is displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 1 will contain the \"Column 2!\" text\r\n When the div for column two is updated to have 'slot=\"secondary-column\"'\r\n Then the two columns are displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 2 will contain the \"Column 2!\" text\r\n\r\n Scenario Outline: A background for the hero unit can be set as an image or colour\r\n Given a hero unit with <backgroundPropValue>\r\n Then the background will be <background>\r\n Examples:\r\n | background | background |\r\n | https://images.unsplash.com/photo-1599676821464-3555954838d | image of misty mountains |\r\n | LightSlateGrey | light slate grey |\r\n | #00FF00 | green |\r\n | rgb(128,0,128) | purple |\r\n\r\n Scenario Outline: Wrap Direction can be configured for mobile experiences\r\n Given a hero unit with the following HTML\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n And prop \"wrap-direction\" has <value>\r\n When the window width is less than 600px\r\n Then the two columns will stack\r\n And <column> will be on top\r\n Examples:\r\n | value | column |\r\n | wrap | 1 |\r\n | wrap-reverse | 2 |\r\n | | 1 |";
23125
25236
 
23126
25237
  const Hero_stories = {
23127
25238
  title: "Hero Layout",
23128
25239
  parameters: {
23129
- scenario: scenario$6,
25240
+ scenario: scenario$8,
23130
25241
  },
23131
25242
  };
23132
25243
  const LoginOneColumn = () => {
@@ -23303,12 +25414,12 @@ const Hero = /*#__PURE__*/Object.freeze({
23303
25414
  TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
23304
25415
  });
23305
25416
 
23306
- const scenario$7 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Referral Iframe\r\n\r\n Used to provide an external form for submitting referral leads using the current user's referral code\r\n\r\n Background: A user is logged in\r\n Given there is a logged in user\r\n\r\n @motivating\r\n Scenario: Referral code is passed to the iframe as a query parameter\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the user has navigated to \"/refer\"\r\n And the user's referral code is \"BOBBYREFER\"\r\n When the iframe content is loaded\r\n Then the iframe url will be \"https://example.com?rsCode=BOBBYREFER\"\r\n\r\n @ui\r\n Scenario Outline: The height and width of the iFrame can be controlled via props\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the iframe content is 1000x1000\r\n And the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the content of the iframe will be displayed with scrollbars\r\n And the dimension of the iFrame displayed will be 500x500\r\n When the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the full content of the iframe will be displayed on the page\r\n And the dimension of the iFrame displayed will be 1000x1000\r\n Examples:\r\n | heightValue | widthValue |\r\n | 500px | 500px |\r\n | 50% | 50% |\r\n\r\n @minutae\r\n Scenario Outline: The iFrame will fail fast if a iFrame source isn't provided\r\n Given \"iframe-src\" <mayBeAnAttribute>\r\n And it <mayHaveValue>\r\n When a user views the referral iFrame component\r\n Then an alert with an error message is displayed in place of the iFrame\r\n And it has a details section\r\n When \"More details\" is clicked\r\n Then the following information will be displayed\r\n | component being used |\r\n | missing attribute(s) |\r\n\r\n Examples:\r\n | mayBeAnAttribute | mayHaveValue |\r\n | is not an attribute | N/A |\r\n | is an attribute | \"\" |\r\n | is an attribute | |";
25417
+ const scenario$9 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Referral Iframe\r\n\r\n Used to provide an external form for submitting referral leads using the current user's referral code\r\n\r\n Background: A user is logged in\r\n Given there is a logged in user\r\n\r\n @motivating\r\n Scenario: Referral code is passed to the iframe as a query parameter\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the user has navigated to \"/refer\"\r\n And the user's referral code is \"BOBBYREFER\"\r\n When the iframe content is loaded\r\n Then the iframe url will be \"https://example.com?rsCode=BOBBYREFER\"\r\n\r\n @ui\r\n Scenario Outline: The height and width of the iFrame can be controlled via props\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the iframe content is 1000x1000\r\n And the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the content of the iframe will be displayed with scrollbars\r\n And the dimension of the iFrame displayed will be 500x500\r\n When the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the full content of the iframe will be displayed on the page\r\n And the dimension of the iFrame displayed will be 1000x1000\r\n Examples:\r\n | heightValue | widthValue |\r\n | 500px | 500px |\r\n | 50% | 50% |\r\n\r\n @minutae\r\n Scenario Outline: The iFrame will fail fast if a iFrame source isn't provided\r\n Given \"iframe-src\" <mayBeAnAttribute>\r\n And it <mayHaveValue>\r\n When a user views the referral iFrame component\r\n Then an alert with an error message is displayed in place of the iFrame\r\n And it has a details section\r\n When \"More details\" is clicked\r\n Then the following information will be displayed\r\n | component being used |\r\n | missing attribute(s) |\r\n\r\n Examples:\r\n | mayBeAnAttribute | mayHaveValue |\r\n | is not an attribute | N/A |\r\n | is an attribute | \"\" |\r\n | is an attribute | |";
23307
25418
 
23308
25419
  const ReferralIframe_stories = {
23309
25420
  title: "Referral Iframe",
23310
25421
  parameters: {
23311
- scenario: scenario$7,
25422
+ scenario: scenario$9,
23312
25423
  },
23313
25424
  };
23314
25425
  const props = {
@@ -23339,12 +25450,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
23339
25450
  ReferralIframeError: ReferralIframeError
23340
25451
  });
23341
25452
 
23342
- const scenario$8 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Name Fields\r\n\r\n Fields to be used to fill the first and last name of a user during registration\r\n\r\n Background:\r\n Given the current page is \"/register\"\r\n\r\n @motivating\r\n Scenario: Both first name and last name are required\r\n Given the email field has valid input\r\n And the password field has valid input\r\n And first name field is empty\r\n And last name field is empty\r\n When register is clicked\r\n Then the name fields will be highlighted in red\r\n And the error messages will say \"Cannot be empty\"\r\n\r\n @motivating\r\n Scenario: First and last name are upserted with the SaaSquatch user\r\n Given all fields have been filled with data\r\n | firstName | lastName | email | password |\r\n | Bob | Testerson | bob@example.com | SecurePassword1 |\r\n When register is clicked\r\n Then the email verification page will be loaded\r\n And the user will be upserted\r\n And the SaaSquatch user will contain data\r\n | firstName | lastName | email |\r\n | Bob | Testerson | bob@example.com |\r\n\r\n";
25453
+ const scenario$a = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Name Fields\r\n\r\n Fields to be used to fill the first and last name of a user during registration\r\n\r\n Background:\r\n Given the current page is \"/register\"\r\n\r\n @motivating\r\n Scenario: Both first name and last name are required\r\n Given the email field has valid input\r\n And the password field has valid input\r\n And first name field is empty\r\n And last name field is empty\r\n When register is clicked\r\n Then the name fields will be highlighted in red\r\n And the error messages will say \"Cannot be empty\"\r\n\r\n @motivating\r\n Scenario: First and last name are upserted with the SaaSquatch user\r\n Given all fields have been filled with data\r\n | firstName | lastName | email | password |\r\n | Bob | Testerson | bob@example.com | SecurePassword1 |\r\n When register is clicked\r\n Then the email verification page will be loaded\r\n And the user will be upserted\r\n And the SaaSquatch user will contain data\r\n | firstName | lastName | email |\r\n | Bob | Testerson | bob@example.com |\r\n\r\n";
23343
25454
 
23344
25455
  const NameFields_stories = {
23345
25456
  title: "Name Fields",
23346
25457
  parameters: {
23347
- scenario: scenario$8,
25458
+ scenario: scenario$a,
23348
25459
  },
23349
25460
  };
23350
25461
  const props$1 = {
@@ -23382,6 +25493,251 @@ const NameFields$1 = /*#__PURE__*/Object.freeze({
23382
25493
  NameFieldsWithErrors: NameFieldsWithErrors
23383
25494
  });
23384
25495
 
25496
+ const baseResponse = (data) => ({
25497
+ states: {
25498
+ content: null,
25499
+ redeemStage: "chooseReward",
25500
+ amount: 0,
25501
+ exchangeError: false,
25502
+ loading: false,
25503
+ selectedItem: null,
25504
+ selectedStep: null,
25505
+ },
25506
+ data: {
25507
+ exchangeList: data,
25508
+ },
25509
+ callbacks: {
25510
+ exchangeReward: null,
25511
+ openDrawer: null,
25512
+ setStage: null,
25513
+ setExchangeState: null,
25514
+ refs: null,
25515
+ },
25516
+ refs: null,
25517
+ });
25518
+ const baseReward$2 = {
25519
+ key: "",
25520
+ name: "",
25521
+ description: "",
25522
+ imageUrl: "",
25523
+ available: true,
25524
+ unavailableReason: null,
25525
+ unavailableReasonCode: null,
25526
+ ruleType: "FIXED_GLOBAL_REWARD",
25527
+ sourceUnit: "POINT",
25528
+ sourceValue: 10,
25529
+ prettySourceValue: "10 SaaSquatch Points",
25530
+ sourceMinValue: null,
25531
+ prettySourceMinValue: null,
25532
+ sourceMaxValue: null,
25533
+ prettySourceMaxValue: null,
25534
+ destinationMinValue: null,
25535
+ prettyDestinationMinValue: null,
25536
+ destinationMaxValue: null,
25537
+ prettyDestinationMaxValue: null,
25538
+ globalRewardKey: "",
25539
+ destinationUnit: null,
25540
+ steps: [],
25541
+ };
25542
+ const notEnoughPoints = {
25543
+ available: false,
25544
+ unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
25545
+ };
25546
+ const usTax = {
25547
+ available: false,
25548
+ unavailableReasonCode: "US_TAX",
25549
+ };
25550
+ const imageUrl = (props) => ({
25551
+ imageUrl: props,
25552
+ });
25553
+ const description = (props) => ({
25554
+ description: props,
25555
+ });
25556
+ const fixedValue = (props) => ({
25557
+ prettySourceValue: props,
25558
+ });
25559
+ const variableValue = (min, max, text) => ({
25560
+ ruleType: "VARIABLE_CREDIT_REWARD",
25561
+ sourceMinValue: min,
25562
+ prettySourceMinValue: min + " " + text,
25563
+ sourceMaxValue: max,
25564
+ prettySourceMaxValue: max + " " + text,
25565
+ });
25566
+ const test = {
25567
+ ...baseResponse([
25568
+ {
25569
+ ...baseReward$2,
25570
+ ...description("Free swag with a promo code"),
25571
+ ...imageUrl("https://i.imgur.com/Ds7M19I.png"),
25572
+ ...fixedValue("40 SaaSquatch Points"),
25573
+ },
25574
+ {
25575
+ ...baseReward$2,
25576
+ ...description("Visa® Prepaid Card USD"),
25577
+ ...imageUrl("https://i.imgur.com/4s3q2zz.png"),
25578
+ ...variableValue(20, 80, "SaaSquatch Points"),
25579
+ },
25580
+ {
25581
+ ...baseReward$2,
25582
+ ...description("A very exclusive gift box"),
25583
+ ...imageUrl("https://i.imgur.com/XuiJi4l.png"),
25584
+ ...fixedValue("30 SaaSquatch Points"),
25585
+ },
25586
+ {
25587
+ ...baseReward$2,
25588
+ ...description("$50 Store credit"),
25589
+ ...imageUrl("https://i.imgur.com/WkCMVSE.png"),
25590
+ ...fixedValue("100 SaaSquatch Points"),
25591
+ },
25592
+ {
25593
+ ...baseReward$2,
25594
+ ...description("Variable amount of store credit"),
25595
+ ...imageUrl("https://i.imgur.com/Jn2fE0s.png"),
25596
+ ...variableValue(20, 100, "SaaSquatch Points"),
25597
+ },
25598
+ {
25599
+ ...baseReward$2,
25600
+ ...notEnoughPoints,
25601
+ ...description("A very rare cactus"),
25602
+ ...imageUrl("https://i.imgur.com/CvCdpXc.png"),
25603
+ ...fixedValue("2000 SaaSquatch Points"),
25604
+ },
25605
+ {
25606
+ ...baseReward$2,
25607
+ ...usTax,
25608
+ ...description("$1000 Store credit"),
25609
+ ...imageUrl("https://i.imgur.com/I9FCh9Z.png"),
25610
+ ...fixedValue("2000 SaaSquatch Points"),
25611
+ },
25612
+ {
25613
+ ...baseReward$2,
25614
+ ...notEnoughPoints,
25615
+ ...description("A holiday gift box"),
25616
+ ...imageUrl("https://i.imgur.com/HBJS1WH.png"),
25617
+ ...fixedValue("100 SaaSquatch Points"),
25618
+ },
25619
+ ]),
25620
+ };
25621
+ const test2 = {
25622
+ states: {
25623
+ content: {
25624
+ text: {
25625
+ buttonText: "Exchange Rewards",
25626
+ ignored: true,
25627
+ },
25628
+ },
25629
+ redeemStage: "chooseAmount",
25630
+ amount: 0,
25631
+ exchangeError: false,
25632
+ loading: false,
25633
+ selectedItem: {
25634
+ key: "r4",
25635
+ name: "Salmon Coins",
25636
+ description: "Points for Salmon Coins",
25637
+ imageUrl: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHCBUWFRgWFRYYGRgZGh4cHBocHR4aHxwdGRwZHBwfHh4cIS4lHB4rHxoYJjgnKy8xNTU1GiQ7QD00Py40NTEBDAwMEA8QHhISHzQrJCs0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NP/AABEIAIABiQMBIgACEQEDEQH/xAAcAAEAAQUBAQAAAAAAAAAAAAAABAECAwUGBwj/xAA+EAABAwICBgYHBwQCAwAAAAABAAIRAyEEMQUSQVFhcQYTgZGhsQciMkJScvAUYoKSwdHhorLC8SMzFUNj/8QAGAEBAQEBAQAAAAAAAAAAAAAAAAECAwT/xAAfEQEBAQEBAQEAAwEBAAAAAAAAARECEiExE0FRYQP/2gAMAwEAAhEDEQA/APZkREBERAREQEREBERAREQEREBERAREQERY6jw0EkgACSTYADMk7AgvVjHgzBBixgzBXmfSjpqapNLDuLaeTqgs58Zhl/Vbx28BnA0Lj3UXNcx0G0tmxHwkW1tvLhks3qRZHryqtdonSjK7dZtnCzmzJaf1HFbFWXUERFQREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBFSVqdNafoYVoNaoAT7LBdzvlaLxxyG0oNlUqBoLnEAASSTAAFySTkF5H0z6WHEuNKiSKANx7JqkXl20MFoHfsAidKemVTFeo31KPwAgl0ZF7hY7IaLA39aBHNsIO0cv34eaCVSeBlcnblb/FqnYatxz3WLhw+FnHMrVMfx7/MjyCkMI5znx+Y7flCx1NajqNGaUdTIex2qRYRkRuj3h+y9D0Lp2nXETq1APWb5xv5ZjxXj9Ovt8dsdmXIHmVKw+OIg62rGWqQIINvWs1vZJWeZeVuV7gi5Xoj0j+0g03kGowSSMnNkCTYAOkjK17cOqXSXWBERUEREBERAREQEREBERAREQEREBERBRFjq1WtaXOcGtAkuJAAG8k2C5LS/TukyW0GGq74j6jO83PcAd6DslQFeI6Y6VYmvOvWcG/BS9RvIwZcODiV1vomonq69QWa57Wht82N1i6+ZIe0diD0JERAREQEREBERARFgxOJZTaX1HtY0ZucQAOZNkGdFxmkvSJg2SGa9Y5eo2G/mdEji2VzmO9JWIdalTp0xvcS93+IHcUHqyiYvH0qQmpUYwb3ua3+4rxTG9IsbV9vEVI3NPVjuZC1XUyST7RvfM85zQezYrptgGW68OO5jXP8AFojxWoxHpMw49ilVfxOowH+onwXmzcKdqudhrG0oOyr+k+qfYwzG/M9zvANatfX9ImOd7Ios5NJI/M4+S55lCQREFXvoaosJU0ScV0u0g+ZxL28GtYzxa2fFaKs173F73ue45uc4uceZcSStuyiI8+zmqfZNvDJNGlGGVww5W21BFh2eCubSMAxCmrjUCkruqK2v2dUNAxZTVazUdlJU7A6Rq0rs1J3vp06jvzPYXeKyCiQL5jzhUZhrXAngg2+H6c41lmmnx/42j+2FLZ6RcbtFA/gd+j1z4o8Fa2lJNoTTHV0/SVifeo0Ty1m+bipdL0nO9/DDm2p+hZ+q4p9A7B3rG7D7ldR6NR9JlA+1Qqj5Sx3m4KfR9IOCd7RqM+ZhP9msvKjQVr6B2Jo9oodLcC/LEsHzSz+8BbLDaRo1P+urTf8AK9rvIrwQUSrTSDtxummPohF4Dh8VXZ/11qrAPhe9o7gYUmp0kxzmln2mrB3EB35wNYd6uo9oxukqNETWqspg5a7mtnlJute3pbgSYGJp9pgd5svC6mHc5xcXFzjmXEknmTcqVo3Btc8Nq1RSZHt6jn8hqtuVLf8AFkfQVGs17Q5rg5pyIIIPIjNZFxnQgYXDsdTZjadUvdrBtqcWizC4mTtPALswVZUVREVBEWr0tpujh2k1HXiQwXc7k3ntMBBs1y+nOmFKjLaUVXjODDW/M7aeA3XIXHae6XVq8tE06RkBjbufwc7ad7R6oyOstA8SBrmBsYMvC7nclm0TdJ6Zq4l01Hl8GzR6rGn7rbxzu6+ajOpW9cwPhH6/RVGHdYcBJ7hYfVlewxlnvzPfkPBc63GsxNODkQBsi8cBGXYAvbui+jxQwtFgEHUDncXP9Z09pK8r6N4QV8XSY4Swv1nWMEMBeQTx1YjivbF1n4wIiKgiIgIoOkdJUaDdatUaxuzWMExsAzceAuuG016RjduFpz/9KgMfhYDPeRyQeh1KgaC5xAAuSTAA4k5LldJ9PsHSkNc6s7dTEt/OYaRyleZY/FVq/rYis525rnta0cmWaOwBR6VJvZs4q4mur0j6Q8U+RRYykN//AGO4GXANH5SuWxlWrWdr13ve7e8zHyjJo4CFIpU5dnEe7CzMpgkGO02gBTYIlHCNOWaq7CxnCmsLGky4H9O7MqSXMd7Jnz7Vf0a84Y7M1e3DAGTErOQcoVGAgXud6xeo1jC+iDsmLgHfCyNZa43LIAeCrqu4f6UvS4w06bRIBvtG76/VXhuYiwyWRtMzO+yv1Dv3qejEcuEScuSqy4BG0LK6mdpsVXqSs+lxHfRsdWATwVWstfwUjqztOfJWll4m5k5d6noxH1A4R5KoZsj+Fnbh4yt2BVFMzF8s7J6XGBzIyEo1ucgjmpXUcSqvpwJv5p6MRXU4KPZAsCeA4qUKMDWEmc8haMzKvFDinpMQxTtzWGphSQIMR4rZ9TxKtFDVMTmdt8k9JiA6lA9bZmVa2nrXGV4Wy6kn/SCieCejGt+z7xmqNw42dotmtmKBz3oaJ2Af7V0xrRQWB2GcTIIjzW2dhycx9cVUUjuWtRqeom8Kx1K4EEzt3dq2tXCuIgerfNXtoHIieJj9E1WndhQsuHxFWkJp1XsH3HOb4A3WxNI5kW7FjfhpvfMfUKWkS8J0xxzBPWB42B7GnxbB8Vs6HpHrCzsOxzvuuczwId5rROpDYIUX7MdbIRGe8/tmp7MbLSXS/F1zGv1TDbVpktJ5vnW7iBwWrNSZtebn6vzOfFVdRGcXG/gsRBDshzlX2YvNM5iBPvHyaNg4eG1YjTGwEnaTf67SFKaRffynyusVWmTcz2sJ7tdat2J/axur7zm8p1u5rLDvV9erAsCecADs/hVYHDIv7NRo8FHxTnfAT+L9LrEm1b+Oz9GGj9Z9XEOAloFNsTm71nk615jU/MV6UuX9HmC6vBMMQajnVD+Iw3+lrV1C7MiIiAuO9IHSKthWU20GEvqlw19XWDA3VyGRcS4RNrGxXYrnOk2lMTRNPqKTHtdOs5xIAgthoIyLpME2tkUHj+OOIc7rq7aznEj13tI5Aa1o3NFuCuwrdbWE6riLS3IjxFoyBXqjelDXtLK+FqesIcwalQXzBDi0kfhXKaVwNBjvUa4U3e44arqZ+66TLfEdsiejHLvwuIBa6wMga4aHsc0DIyQGk2sYNjvKtpawqOLWwwxbjAkwbiTPet7UoPp2JljvZeNvBw913gdig1KV5XK3LrUmzGLDTrtaTMmOU2/lS37ABbb/AAsOFoE1GQPeb5hSXsHblO1T18Xz9Ryxu5VwLTDzuj/L9JVXtUmizOMnF3c0GPM9y1OrSxjartiFiqAufVakUoP1hJEZrK6mSRBi97Z71cwZdir9d4WNXFdVXNEqx0ERvVW2Fgp6XyuLFY5h1gda0XEZ9queyYuREG31krnH+fruU9LimomoMz2LIFR0C5OXYI4p6MYxTOtMjVjLirnTcNF4tOXarmNMkmI2b+9Zm7Pr6/hPRjBTa7Ii+/YVke0xbPYs4CAJ6MYg3KyvaxXGYnM7BvVackXEHd2/68U9GMb6YIIOX6K3qwIHYJ+tyyUmOvr6udonLjO1XagsSMtvZCejGCjh2tsNu03klZQxYsSx9tRwF7yFlkNgE3yE7SrOk8mp9fXasLcOQ4nXJnJuwfWaz6xmIsRnbPkriP3VnR5Y9S/P/StbB+uav2fXFY2MDRAgBb1PK5zARBEqxrCTIJABiIF/4V7XAHNXdYO1X6mLKtEOBaQSCLqw4Yauq31Rsjv2rKao+vFKeHcSS1r3TsDSc+Q4KWUYxTsNvNW1mgA2mPFTv/H4g5Uan5CPNYq2isRBmg8j5Z8FPPRsatzgXECLfV9ywOpif45fXapr6DwdUtLTuIIPcVb1WrcxuG4fynMpsQyyPLb+gPkotRzQbhp5kDwICmVXjeQOYjucIBUWq8jcR94FvcW2K758xz36xlrfgj8MjwJUSs1v3B4f3BSw5o90s4tgjvb+yxYydWQ6RxA8wYWZ+rXqfo9x/WYNjSQTSJpmDsEFv9JA7CuqXlPotx5biKlLJr6etH3mERH4XOmNwXqy6siIiArHNBEG4KvRBp8XoNjrsJpncAHM7WnIfKWrVVKGKpWcwPZvpme9jr90rrEQcBUbQMyzVM3nWaAeAB1QeS1dbRjM2vjg6/iP2XpOJwTH+00ExEizo5i8cFrH9Gqcy2AeLWu8gFiytS44puHYy4cHOi0ZDZKgVMPORlegO0PUbZmpHzOb4AR4qK/RNfiB90yfF58li87+rOscTTwT5HqnmRAHG+alDDRyFu/+JK6N2BLTdpHF0yVKo4VgF4KvM35C2OKqtDZLnBvMxMhRnYpnuBzvlB8yt5pvo/TZrVWAu2lusZ7Jz5LRMqUzsaOcHzlZ65y/VnSprH4I+ZzR5lOsd8LOx7VIAaBIcR2D9WfqrqYJMes7dZpn8oXOyNzWClUJIBaR4/QUkMU+ngY4k5/sPFX/AGXZ9bFm81djWOaRECZsrw1T/syDDeaxjSG1nmq9XkpzMMq9QfBXE1DDFka3fkpXUHcqmgdmcJhqKykGiGgDkq6ql9QqUsKAIE773vxKmLqMGqrWKaMOrm4fbClVE1FaaUrYjDqvUKfVa80bz3KvUeS2LcNfKyzNw4GasqfGpOFJtcRe23f2LL9iO7gtoQR7LHu+Vrj5BafFaRfJaPVjOxkcxs7V2541z66g/CATrEfsoVUMBzJ2WvdYMRUnN2tO0u1e45FYX1CPasD8Q1f62+qe0Ld5iemdzm7bc7HslZcO9jXAlrXfdfrDuDSCe2QorfxAb7Fve2W94UzDwLWjgBHhY9wUsw/XUaG0i1zmsZh2NnMtgQNp9n9V1C0fR3AajNciC4WERDc9m+3gt4u/O59crm/FURFpEfE4Zjxqva1w3ET3blz2keh9N96bi0/C712nhJ9bvJ5LqUQeTaX6P1qMl7SGj32+s3tOwcHRwXPPBbmNXc5t2nmNy95IXM6W6H0Ksup/8Tz8Ilp5sy7oWbB5WwbQPxM/Vv8AEJUo6wkAO4tMH9j2Qttpbo5Xw51ns9Uf+xhJb2mJbycAOK1vWA3zO8eq79ncslj7rSnRrGNw+Mo1HEta18O1rQ14LHE2yAdO3Je7r54xFyYMjcQAe79oXsvQfSn2jCUy6demOrfOZLAIPa3VPMncuusujREQEREBERAREQEREFpaCIN1FqaPpu92OVvJTEQaitoVpye4c4P7LWV+i0/A7iRB7wupRZvMqy2OHf0OvIZB3tcP8lJo6EcwWYRvPtE9sldeiniL6rlRgnDNju4qx2F4fWxdakJeIeq5A0An2ZdaWDcO5WdQz4W9wWP4v+r7rlxhQs1LBt2roDhGfC3uT7Iz4fNanGJ6rmK1WgDAlxytsO6+SjPxLB7rwOQPkV02J0PRqTrNgxGsLOHbt5GQua0hoavSksHWM+7JcObMxzaT8oTrn5+Lz1/qjcVSPvgfN6v91ipjKQNxF1znXcOBvEcJH6iVJ0bpHq3TAc33mOEC+4gEA5XcvPLNyt38+N6KKuZQnIE8gt9hyxzQ5oaQdwH1KkQuv8Mv9se655mCecmHtt5rMNFvPwt8fJbtFqf+PKe61bNED3nk8gB5ypFLR7GmYk/eMxyGSmItTjmfkS21VRcXgqdQRUY10ZEi45HMHkpSLaOS0l0Qa6TRcWnc4m/4oJI+YOXLYvRVagfWa5g+JsBp5gkscTwIPBeqqhErN5laleTUmkH2Rzb/AMZ7Wmx71v8AQOB6yqJ9lvrOnbGw75MeK6itoOg6/VgH7stHcLHuUjBYFlIEMETcnMlSc1fXxMREW2BERAREQEREBc3pbodha8nV6t596nDZ5tjVPOJ4rpEQeU6U9H+Ibem5lYbB7Du5xj+rsW89HuiMThzVFZmoxwbAJBlwJuIOUE35dncopn1dVREVQREQEREBERAREQEREBERAREQEREBERAREQEREGuxuiqNW72An4hLXfmbBjhktFi+h+2nV5B4y/EyI7l1qLN5l/VlsaDo9oytQLmvc0sI2OJOtaDBYItO07Fv0RWTJhbqqIiqCIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIg//Z",
25638
+ available: true,
25639
+ unavailableReason: null,
25640
+ unavailableReasonCode: null,
25641
+ ruleType: "VARIABLE_CREDIT_REWARD",
25642
+ sourceUnit: "POINT",
25643
+ sourceValue: null,
25644
+ prettySourceValue: null,
25645
+ sourceMinValue: 1,
25646
+ prettySourceMinValue: "1 Point",
25647
+ sourceMaxValue: 100,
25648
+ prettySourceMaxValue: "100 Points",
25649
+ destinationMinValue: 1,
25650
+ prettyDestinationMinValue: "1 Salmon Coin",
25651
+ destinationMaxValue: 100,
25652
+ prettyDestinationMaxValue: "100 Salmons",
25653
+ globalRewardKey: null,
25654
+ destinationUnit: "TESTUNIT",
25655
+ steps: [
25656
+ {
25657
+ sourceValue: 1,
25658
+ prettySourceValue: "1 Point",
25659
+ destinationValue: 1,
25660
+ prettyDestinationValue: "1 Salmon Coin",
25661
+ available: true,
25662
+ unavailableReasonCode: null,
25663
+ },
25664
+ {
25665
+ sourceValue: 2,
25666
+ prettySourceValue: "2 Points",
25667
+ destinationValue: 2,
25668
+ prettyDestinationValue: "2 Salmons",
25669
+ available: true,
25670
+ unavailableReasonCode: null,
25671
+ },
25672
+ {
25673
+ sourceValue: 3,
25674
+ prettySourceValue: "3 Points",
25675
+ destinationValue: 3,
25676
+ prettyDestinationValue: "3 Salmons",
25677
+ available: true,
25678
+ unavailableReasonCode: null,
25679
+ },
25680
+ {
25681
+ sourceValue: 4,
25682
+ prettySourceValue: "4 Points",
25683
+ destinationValue: 4,
25684
+ prettyDestinationValue: "4 Salmons",
25685
+ available: true,
25686
+ unavailableReasonCode: null,
25687
+ },
25688
+ {
25689
+ sourceValue: 5,
25690
+ prettySourceValue: "5 Points",
25691
+ destinationValue: 5,
25692
+ prettyDestinationValue: "5 Salmons",
25693
+ available: true,
25694
+ unavailableReasonCode: null,
25695
+ },
25696
+ ],
25697
+ },
25698
+ selectedStep: null,
25699
+ },
25700
+ data: {
25701
+ exchangeList: null,
25702
+ },
25703
+ callbacks: {
25704
+ exchangeReward: null,
25705
+ openDrawer: null,
25706
+ setStage: null,
25707
+ setExchangeState: null,
25708
+ refs: {
25709
+ drawerRef: {},
25710
+ },
25711
+ },
25712
+ refs: null,
25713
+ };
25714
+
25715
+ const RewardExchangeList_stories = {
25716
+ title: "Components/Reward Exchange List",
25717
+ };
25718
+ const resizable$1 = {
25719
+ width: "683px",
25720
+ minWidth: "260px",
25721
+ resize: "horizontal",
25722
+ height: "fit-content",
25723
+ overflow: "hidden",
25724
+ };
25725
+ const Default$c = () => {
25726
+ return (h("div", { style: resizable$1 },
25727
+ h(RewardExchangeView, Object.assign({}, test))));
25728
+ };
25729
+ const Default2 = () => {
25730
+ return (h("div", { style: { ...resizable$1, height: "700px" } },
25731
+ h(RewardExchangeView, Object.assign({}, test2))));
25732
+ };
25733
+
25734
+ const RewardExchangeList = /*#__PURE__*/Object.freeze({
25735
+ __proto__: null,
25736
+ 'default': RewardExchangeList_stories,
25737
+ Default: Default$c,
25738
+ Default2: Default2
25739
+ });
25740
+
23385
25741
  function deepFreeze(obj) {
23386
25742
  if (obj instanceof Map) {
23387
25743
  obj.clear = obj.delete = obj.set = function () {
@@ -25962,7 +28318,9 @@ const CucumberAddon = ({ story }, children) => {
25962
28318
  // No scenario or invalid. Ignoring.
25963
28319
  }
25964
28320
  return (h("div", null,
25965
- result && h("pre", { innerHTML: result.value }),
28321
+ h("details", null,
28322
+ h("summary", null, "Specs"),
28323
+ result && h("pre", { innerHTML: result.value })),
25966
28324
  children));
25967
28325
  };
25968
28326
 
@@ -25999,6 +28357,8 @@ const stories = [
25999
28357
  ReferralTableRewardsCell$1,
26000
28358
  UserName,
26001
28359
  PasswordField,
28360
+ TaskCard$1,
28361
+ TaskCardProgressBar,
26002
28362
  PortalTemplates,
26003
28363
  ProgramMenu$1,
26004
28364
  PoweredByImg,
@@ -26006,6 +28366,10 @@ const stories = [
26006
28366
  Hero,
26007
28367
  ReferralIframe$1,
26008
28368
  NameFields$1,
28369
+ RewardExchangeList,
28370
+ UseRewardExchangeList,
28371
+ UseTaskCard,
28372
+ UseRewardsTable
26009
28373
  ];
26010
28374
  const StencilStorybook = class {
26011
28375
  constructor(hostRef) {
@@ -26045,6 +28409,77 @@ const TableRow = class {
26045
28409
  }
26046
28410
  };
26047
28411
 
28412
+ const TaskCard$2 = class {
28413
+ constructor(hostRef) {
28414
+ registerInstance(this, hostRef);
28415
+ this.ignored = true;
28416
+ /**
28417
+ * @uiName Reward Amount
28418
+ */
28419
+ this.rewardAmount = 0;
28420
+ /**
28421
+ * @uiName Reward Unit
28422
+ */
28423
+ this.rewardUnit = "Points";
28424
+ /**
28425
+ * @uiName Title Text
28426
+ */
28427
+ this.cardTitle = "Title Text";
28428
+ /**
28429
+ * @uiName Description Text
28430
+ */
28431
+ this.description = "Description Text";
28432
+ /**
28433
+ * @uiName Goal Repeatable
28434
+ */
28435
+ this.repeatable = false;
28436
+ /**
28437
+ * @uiName Show Progress Bar
28438
+ */
28439
+ this.showProgressBar = false;
28440
+ /**
28441
+ * @uiName Goal Progress Source
28442
+ */
28443
+ this.progressSource = "";
28444
+ /**
28445
+ * @uiName Goal Completion Number
28446
+ */
28447
+ this.goal = 1;
28448
+ /**
28449
+ * @uiName Progress Bar Steps
28450
+ */
28451
+ this.steps = false;
28452
+ /**
28453
+ * @uiName Show Goal Expiry
28454
+ */
28455
+ this.showExpiry = false;
28456
+ /**
28457
+ * @uiName CTA Button Text
28458
+ */
28459
+ this.buttonText = "Complete Action";
28460
+ /**
28461
+ * @uiName CTA Button Link
28462
+ */
28463
+ this.buttonLink = "https://example.com/";
28464
+ /**
28465
+ * Select what type of stat to display for the goal. Manual paths are also supported.
28466
+ *
28467
+ * @uiWidget StatTypeSelectWidget
28468
+ * @uiName Stat Type
28469
+ * @uiOptions {"version": 1.1}
28470
+ */
28471
+ this.statType = "/programGoals/count/Referral-Started%2Freferrals";
28472
+ h$1(this);
28473
+ }
28474
+ disconnectedCallback() { }
28475
+ render() {
28476
+ const { props } = j$1() ? useDemoBigStat(this) : useBigStat(this);
28477
+ const { value, statvalue } = props;
28478
+ console.log(props, j$1());
28479
+ return (h(TaskCardView, Object.assign({}, getProps(this), { progress: value, loading: value === undefined })));
28480
+ }
28481
+ };
28482
+
26048
28483
  const debug$2 = browser("sq:global");
26049
28484
  const textStyles = `
26050
28485
  sqm-text {
@@ -26170,4 +28605,4 @@ function useUserNameDemo(props) {
26170
28605
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
26171
28606
  }
26172
28607
 
26173
- export { DividedLayout as sqm_divided_layout, EditProfile as sqm_edit_profile, FormMessage as sqm_form_message, SqmHookStoryContainer as sqm_hook_story_container, NavigationMenu as sqm_navigation_menu, PortalPasswordField as sqm_password_field, PortalChangePassword as sqm_portal_change_password, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramMenu as sqm_program_menu, SqmReferralIframe as sqm_referral_iframe, ReferralTable as sqm_referral_table, ReferralTableCell as sqm_referral_table_cell, ReferralTableDateCell as sqm_referral_table_date_cell, ReferralTableRewardsCell as sqm_referral_table_rewards_cell, ReferralTableStatusCell as sqm_referral_table_status_cell, ReferralTableUserCell as sqm_referral_table_user_cell, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareLink as sqm_share_link, StencilStorybook as sqm_stencilbook, TableCell$1 as sqm_table_cell, TableRow as sqm_table_row, Text as sqm_text, UserName$1 as sqm_user_name };
28608
+ export { DividedLayout as sqm_divided_layout, EditProfile as sqm_edit_profile, FormMessage as sqm_form_message, SqmHookStoryContainer as sqm_hook_story_container, NavigationMenu as sqm_navigation_menu, PortalPasswordField as sqm_password_field, PortalChangePassword as sqm_portal_change_password, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramMenu as sqm_program_menu, SqmReferralIframe as sqm_referral_iframe, ReferralTable as sqm_referral_table, ReferralTableCell as sqm_referral_table_cell, ReferralTableDateCell as sqm_referral_table_date_cell, ReferralTableRewardsCell as sqm_referral_table_rewards_cell, ReferralTableStatusCell as sqm_referral_table_status_cell, ReferralTableUserCell as sqm_referral_table_user_cell, SqmRewardExchangeList as sqm_reward_exchange_list, RewardsTable as sqm_rewards_table, RewardsTableColumn as sqm_rewards_table_column, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareLink as sqm_share_link, StencilStorybook as sqm_stencilbook, TableCell$1 as sqm_table_cell, TableRow as sqm_table_row, TaskCard$2 as sqm_task_card, Text as sqm_text, UserName$1 as sqm_user_name };