@saasquatch/mint-components 1.3.2-1 → 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 (281) hide show
  1. package/dist/cjs/{ShadowViewAddon-75c18b96.js → ShadowViewAddon-d2fde0a2.js} +1 -1
  2. package/dist/cjs/{global-041b5338.js → global-e04d7cde.js} +107 -56
  3. package/dist/cjs/{index.module-6a7bda18.js → index.module-07ed6ad2.js} +2 -1
  4. package/dist/cjs/loader.cjs.js +3 -4
  5. package/dist/cjs/mint-components.cjs.js +3 -4
  6. package/dist/cjs/{re-render-7cdb2d81.js → re-render-81649c33.js} +1 -1
  7. package/dist/cjs/sqm-asset-card.cjs.entry.js +1 -1
  8. package/dist/cjs/sqm-big-stat.cjs.entry.js +2 -2
  9. package/dist/cjs/{sqm-divided-layout_27.cjs.entry.js → sqm-divided-layout_30.cjs.entry.js} +1860 -609
  10. package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +1 -1
  11. package/dist/cjs/{index-19309631.js → sqm-leaderboard-rank-view-0ba128e2.js} +10 -3
  12. package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +7 -9
  13. package/dist/cjs/sqm-leaderboard.cjs.entry.js +2 -2
  14. package/dist/cjs/sqm-name-fields.cjs.entry.js +1 -1
  15. package/dist/cjs/{sqm-navigation-sidebar-item-view-e99b4a10.js → sqm-navigation-sidebar-item-view-0bad789c.js} +1 -1
  16. package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +2 -2
  17. package/dist/cjs/sqm-popup-container.cjs.entry.js +1 -1
  18. package/dist/cjs/{sqm-portal-email-verification-view-5e955797.js → sqm-portal-email-verification-view-3c7d8701.js} +1 -1
  19. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +3 -4
  20. package/dist/cjs/{sqm-portal-footer-view-9089feb7.js → sqm-portal-footer-view-8f5d682e.js} +1 -1
  21. package/dist/cjs/sqm-portal-footer.cjs.entry.js +3 -4
  22. package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +1 -1
  23. package/dist/cjs/sqm-portal-logout.cjs.entry.js +1 -1
  24. package/dist/cjs/{sqm-portal-profile-view-a23ea292.js → sqm-portal-profile-view-14866b58.js} +1 -1
  25. package/dist/cjs/sqm-portal-profile.cjs.entry.js +3 -4
  26. package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +1 -1
  27. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +1 -1
  28. package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +1 -1
  29. package/dist/cjs/sqm-referral-table-column.cjs.entry.js +2 -2
  30. package/dist/cjs/sqm-referral-table-date-column.cjs.entry.js +2 -2
  31. package/dist/cjs/sqm-referral-table-rewards-column.cjs.entry.js +2 -2
  32. package/dist/cjs/sqm-referral-table-status-column.cjs.entry.js +2 -2
  33. package/dist/cjs/sqm-referral-table-user-column.cjs.entry.js +2 -2
  34. package/dist/cjs/sqm-share-code.cjs.entry.js +1 -1
  35. package/dist/cjs/{useDemoBigStat-17e61803.js → useDemoBigStat-1692a6a1.js} +117 -21
  36. package/dist/collection/collection-manifest.json +2 -1
  37. package/dist/collection/components/sqm-big-stat/BigStat.stories.js +8 -1
  38. package/dist/collection/components/sqm-big-stat/UseBigStat.stories.js +3 -0
  39. package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +1 -1
  40. package/dist/collection/components/sqm-big-stat/useBigStat.js +115 -20
  41. package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +1 -0
  42. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +21 -0
  43. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +218 -0
  44. package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +5 -14
  45. package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +27 -40
  46. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +113 -78
  47. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +3 -2
  48. package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +4 -2
  49. package/dist/collection/components/sqm-rewards-table/UseRewardsTable.stories.js +53 -0
  50. package/dist/collection/components/sqm-rewards-table/sqm-rewards-table-column.js +120 -0
  51. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +11 -16
  52. package/dist/collection/components/{sqm-rewards-table → sqm-router}/Router.stories.js +0 -0
  53. package/dist/collection/components/sqm-share-button/sqm-share-button.js +1 -1
  54. package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +3 -1
  55. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +9 -1
  56. package/dist/collection/components/sqm-task-card/SVGs.js +0 -6
  57. package/dist/collection/components/sqm-task-card/TaskCard.stories.js +90 -259
  58. package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +41 -0
  59. package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +7 -0
  60. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +311 -0
  61. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar.stories.js +53 -0
  62. package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +30 -315
  63. package/dist/collection/components/sqm-task-card/sqm-task-card.js +111 -51
  64. package/dist/collection/stories/NewPortal.stories.js +15 -15
  65. package/dist/esm/{ShadowViewAddon-fff5d35d.js → ShadowViewAddon-aa087ef2.js} +1 -1
  66. package/dist/esm/{global-5ecbf81a.js → global-107bb084.js} +54 -3
  67. package/dist/esm/{index.module-f80561db.js → index.module-1f571929.js} +2 -2
  68. package/dist/esm/loader.js +3 -4
  69. package/dist/esm/mint-components.js +3 -4
  70. package/dist/esm/{re-render-9ab5fe0f.js → re-render-76c9129f.js} +1 -1
  71. package/dist/esm/sqm-asset-card.entry.js +1 -1
  72. package/dist/esm/sqm-big-stat.entry.js +2 -2
  73. package/dist/esm/{sqm-divided-layout_27.entry.js → sqm-divided-layout_30.entry.js} +1817 -569
  74. package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
  75. package/dist/esm/{index-2f5dd0a1.js → sqm-leaderboard-rank-view-c1aefdd5.js} +9 -3
  76. package/dist/esm/sqm-leaderboard-rank.entry.js +3 -5
  77. package/dist/esm/sqm-leaderboard.entry.js +2 -2
  78. package/dist/esm/sqm-name-fields.entry.js +1 -1
  79. package/dist/esm/{sqm-navigation-sidebar-item-view-8a3f374b.js → sqm-navigation-sidebar-item-view-b3618185.js} +1 -1
  80. package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
  81. package/dist/esm/sqm-popup-container.entry.js +1 -1
  82. package/dist/esm/{sqm-portal-email-verification-view-90781be2.js → sqm-portal-email-verification-view-df0559b0.js} +1 -1
  83. package/dist/esm/sqm-portal-email-verification.entry.js +3 -4
  84. package/dist/esm/{sqm-portal-footer-view-c317518e.js → sqm-portal-footer-view-2b2bfc9e.js} +1 -1
  85. package/dist/esm/sqm-portal-footer.entry.js +3 -4
  86. package/dist/esm/sqm-portal-forgot-password.entry.js +1 -1
  87. package/dist/esm/sqm-portal-logout.entry.js +1 -1
  88. package/dist/esm/{sqm-portal-profile-view-824c8242.js → sqm-portal-profile-view-2fbb0845.js} +1 -1
  89. package/dist/esm/sqm-portal-profile.entry.js +3 -4
  90. package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
  91. package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
  92. package/dist/esm/sqm-portal-verify-email.entry.js +1 -1
  93. package/dist/esm/sqm-referral-table-column.entry.js +2 -2
  94. package/dist/esm/sqm-referral-table-date-column.entry.js +2 -2
  95. package/dist/esm/sqm-referral-table-rewards-column.entry.js +2 -2
  96. package/dist/esm/sqm-referral-table-status-column.entry.js +2 -2
  97. package/dist/esm/sqm-referral-table-user-column.entry.js +2 -2
  98. package/dist/esm/sqm-share-code.entry.js +1 -1
  99. package/dist/esm/{useDemoBigStat-b71fe122.js → useDemoBigStat-49cdfe32.js} +117 -21
  100. package/dist/esm-es5/{ShadowViewAddon-fff5d35d.js → ShadowViewAddon-aa087ef2.js} +1 -1
  101. package/dist/esm-es5/{global-5ecbf81a.js → global-107bb084.js} +16 -2
  102. package/dist/esm-es5/{index.module-f80561db.js → index.module-1f571929.js} +1 -1
  103. package/dist/esm-es5/loader.js +1 -1
  104. package/dist/esm-es5/mint-components.js +1 -1
  105. package/dist/esm-es5/{re-render-9ab5fe0f.js → re-render-76c9129f.js} +1 -1
  106. package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
  107. package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
  108. package/dist/esm-es5/sqm-divided-layout_30.entry.js +1 -0
  109. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  110. package/dist/esm-es5/sqm-leaderboard-rank-view-c1aefdd5.js +1 -0
  111. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  112. package/dist/esm-es5/sqm-leaderboard.entry.js +1 -1
  113. package/dist/esm-es5/sqm-name-fields.entry.js +1 -1
  114. package/dist/esm-es5/{sqm-navigation-sidebar-item-view-8a3f374b.js → sqm-navigation-sidebar-item-view-b3618185.js} +1 -1
  115. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  116. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  117. package/dist/esm-es5/{sqm-portal-email-verification-view-90781be2.js → sqm-portal-email-verification-view-df0559b0.js} +1 -1
  118. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  119. package/dist/esm-es5/{sqm-portal-footer-view-c317518e.js → sqm-portal-footer-view-2b2bfc9e.js} +1 -1
  120. package/dist/esm-es5/sqm-portal-footer.entry.js +1 -1
  121. package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
  122. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  123. package/dist/esm-es5/{sqm-portal-profile-view-824c8242.js → sqm-portal-profile-view-2fbb0845.js} +1 -1
  124. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  125. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  126. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  127. package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
  128. package/dist/esm-es5/sqm-referral-table-column.entry.js +1 -1
  129. package/dist/esm-es5/sqm-referral-table-date-column.entry.js +1 -1
  130. package/dist/esm-es5/sqm-referral-table-rewards-column.entry.js +1 -1
  131. package/dist/esm-es5/sqm-referral-table-status-column.entry.js +1 -1
  132. package/dist/esm-es5/sqm-referral-table-user-column.entry.js +1 -1
  133. package/dist/esm-es5/sqm-share-code.entry.js +1 -1
  134. package/dist/esm-es5/useDemoBigStat-49cdfe32.js +1 -0
  135. package/dist/mint-components/mint-components.esm.js +1 -1
  136. package/dist/mint-components/mint-components.js +1 -1
  137. package/dist/mint-components/{p-57a53dbd.system.entry.js → p-03b7444e.system.entry.js} +1 -1
  138. package/dist/mint-components/{p-82ab88fe.system.js → p-0470556b.system.js} +1 -1
  139. package/dist/mint-components/p-0ca63e9e.system.entry.js +1 -0
  140. package/dist/mint-components/p-0ddd6063.system.entry.js +1 -0
  141. package/dist/mint-components/{p-337b49ee.entry.js → p-0f19ab40.entry.js} +1 -1
  142. package/dist/mint-components/{p-1ac9c24b.system.entry.js → p-123930ab.system.entry.js} +1 -1
  143. package/dist/mint-components/p-20991bdd.system.entry.js +1 -0
  144. package/dist/mint-components/{p-3052c913.system.js → p-22ee65c4.system.js} +1 -1
  145. package/dist/mint-components/{p-2a025d2a.system.entry.js → p-2b9a01ce.system.entry.js} +1 -1
  146. package/dist/mint-components/{p-d9cc041f.entry.js → p-3b9492a8.entry.js} +1 -1
  147. package/dist/mint-components/{p-e9ab90a1.entry.js → p-3bbc61af.entry.js} +1 -1
  148. package/dist/mint-components/{p-05cca77b.js → p-3fd9db63.js} +1 -1
  149. package/dist/mint-components/p-458070cf.js +1 -0
  150. package/dist/mint-components/{p-434ee9c1.js → p-4ae9f594.js} +1 -1
  151. package/dist/mint-components/{p-7c13e32e.system.entry.js → p-57568b23.system.entry.js} +1 -1
  152. package/dist/mint-components/{p-82d7a2ba.entry.js → p-57aa7493.entry.js} +1 -1
  153. package/dist/mint-components/p-5986de11.entry.js +1 -0
  154. package/dist/mint-components/p-59fa991d.entry.js +335 -0
  155. package/dist/mint-components/p-5a1a2b2c.entry.js +1 -0
  156. package/dist/mint-components/{p-3b0acfcd.system.js → p-5e681b4b.system.js} +1 -1
  157. package/dist/mint-components/{p-4ba2faf2.system.entry.js → p-62b134cb.system.entry.js} +1 -1
  158. package/dist/mint-components/{p-e475a5ff.system.entry.js → p-64299f78.system.entry.js} +1 -1
  159. package/dist/mint-components/p-6466d643.entry.js +1 -0
  160. package/dist/mint-components/{p-2bce988c.js → p-70008004.js} +1 -1
  161. package/dist/mint-components/{p-16535642.system.entry.js → p-70a6f9d9.system.entry.js} +1 -1
  162. package/dist/mint-components/p-719c2664.system.js +1 -0
  163. package/dist/mint-components/{p-db723323.system.entry.js → p-75924795.system.entry.js} +1 -1
  164. package/dist/mint-components/p-8155cd07.system.js +1 -0
  165. package/dist/mint-components/{p-0688c9c2.system.entry.js → p-86a55c58.system.entry.js} +1 -1
  166. package/dist/mint-components/p-874e7da3.entry.js +13 -0
  167. package/dist/mint-components/{p-5dfc6804.system.entry.js → p-8ac0ec83.system.entry.js} +1 -1
  168. package/dist/mint-components/{p-1fb688a9.system.js → p-91b0d151.system.js} +1 -1
  169. package/dist/mint-components/p-9ca6142b.system.entry.js +1 -0
  170. package/dist/mint-components/{p-6d545e13.entry.js → p-a26457cd.entry.js} +1 -1
  171. package/dist/mint-components/{p-8e37c08d.js → p-a37fc3cb.js} +1 -1
  172. package/dist/mint-components/p-a48fc54e.system.js +1 -0
  173. package/dist/mint-components/{p-cc3510c8.js → p-ab378185.js} +1 -1
  174. package/dist/mint-components/p-ac92b5ea.js +235 -0
  175. package/dist/mint-components/{p-6cdc70f4.entry.js → p-b0c6f82b.entry.js} +1 -1
  176. package/dist/mint-components/{p-844f9bad.entry.js → p-b0e9c89c.entry.js} +1 -1
  177. package/dist/mint-components/{p-16da5146.entry.js → p-b3bac2c6.entry.js} +1 -1
  178. package/dist/mint-components/{p-04516274.system.entry.js → p-bcb30771.system.entry.js} +1 -1
  179. package/dist/mint-components/{p-a0cfd3d9.system.js → p-bdfdb088.system.js} +1 -1
  180. package/dist/mint-components/p-beb02af2.entry.js +1 -0
  181. package/dist/mint-components/{p-ceeaf074.system.js → p-beeeda0c.system.js} +35 -21
  182. package/dist/mint-components/p-bf10c781.system.js +1 -0
  183. package/dist/mint-components/p-c0e8aaa7.system.entry.js +1 -0
  184. package/dist/mint-components/{p-3fd33dee.system.entry.js → p-c35b54e4.system.entry.js} +1 -1
  185. package/dist/mint-components/{p-a7f0b2f6.entry.js → p-c61c61e7.entry.js} +1 -1
  186. package/dist/mint-components/{p-5f28af29.entry.js → p-c974b7d4.entry.js} +1 -1
  187. package/dist/mint-components/{p-2f171597.entry.js → p-cbf1db2b.entry.js} +1 -1
  188. package/dist/mint-components/{p-a4a00461.entry.js → p-d1e28563.entry.js} +1 -1
  189. package/dist/mint-components/p-d37f227e.entry.js +1 -0
  190. package/dist/mint-components/{p-1813b9b9.system.js → p-d44e98b8.system.js} +1 -1
  191. package/dist/mint-components/{p-f1e1086e.js → p-d73d26ec.js} +17 -2
  192. package/dist/mint-components/p-dacbf435.entry.js +9 -0
  193. package/dist/mint-components/{p-1b414d8f.system.entry.js → p-dbc04567.system.entry.js} +1 -1
  194. package/dist/mint-components/{p-d3787c3a.entry.js → p-de0efef2.entry.js} +1 -1
  195. package/dist/mint-components/p-e01213a2.system.entry.js +1 -0
  196. package/dist/mint-components/p-e2a855b8.system.entry.js +1 -0
  197. package/dist/mint-components/p-f0ad9b15.entry.js +1 -0
  198. package/dist/mint-components/{p-a0045707.system.entry.js → p-f0cbf76e.system.entry.js} +1 -1
  199. package/dist/mint-components/{p-aba21f90.entry.js → p-f2db1c3b.entry.js} +1 -1
  200. package/dist/mint-components/{p-505f5c59.system.entry.js → p-f538a675.system.entry.js} +1 -1
  201. package/dist/mint-components/{p-844fd903.js → p-f7e2418a.js} +1 -1
  202. package/dist/mint-components/{p-00190438.js → p-f8abbd79.js} +1 -1
  203. package/dist/mint-components/{p-af06ea5b.system.entry.js → p-fc90a3fe.system.entry.js} +1 -1
  204. package/dist/types/components/sqm-big-stat/UseBigStat.stories.d.ts +6 -0
  205. package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +1 -0
  206. package/dist/types/components/sqm-big-stat/useBigStat.d.ts +4 -1
  207. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +6 -0
  208. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +81 -0
  209. package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +1 -0
  210. package/dist/types/components/sqm-reward-exchange-list/progressBar.d.ts +3 -2
  211. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +2 -3
  212. package/dist/types/components/sqm-rewards-table/UseRewardsTable.stories.d.ts +16 -0
  213. package/dist/types/components/sqm-rewards-table/sqm-rewards-table-column.d.ts +20 -0
  214. package/dist/types/components/sqm-rewards-table/useRewardsTable.d.ts +33 -0
  215. package/dist/types/components/{sqm-rewards-table → sqm-router}/Router.stories.d.ts +0 -0
  216. package/dist/types/components/sqm-task-card/SVGs.d.ts +0 -1
  217. package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +3 -1
  218. package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +10 -0
  219. package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +1 -0
  220. package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +10 -0
  221. package/dist/types/components/sqm-task-card/progress-bar/progress-bar.stories.d.ts +12 -0
  222. package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +13 -22
  223. package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +26 -14
  224. package/dist/types/components.d.ts +82 -36
  225. package/grapesjs/grapesjs.js +1 -1
  226. package/package.json +1 -1
  227. package/dist/cjs/sqm-leaderboard-rank-view-35015d30.js +0 -10
  228. package/dist/cjs/sqm-rewards-table.cjs.entry.js +0 -332
  229. package/dist/cjs/sqm-task-card-view-57066e67.js +0 -476
  230. package/dist/cjs/sqm-task-card.cjs.entry.js +0 -56
  231. package/dist/cjs/tslib.es6-0e81fab1.js +0 -56
  232. package/dist/cjs/useChildElements-428ca5b8.js +0 -21
  233. package/dist/esm/sqm-leaderboard-rank-view-da91f5f3.js +0 -8
  234. package/dist/esm/sqm-rewards-table.entry.js +0 -328
  235. package/dist/esm/sqm-task-card-view-2ee495af.js +0 -474
  236. package/dist/esm/sqm-task-card.entry.js +0 -52
  237. package/dist/esm/tslib.es6-7ac9d7e4.js +0 -53
  238. package/dist/esm/useChildElements-506f00d0.js +0 -19
  239. package/dist/esm-es5/index-2f5dd0a1.js +0 -1
  240. package/dist/esm-es5/sqm-divided-layout_27.entry.js +0 -1
  241. package/dist/esm-es5/sqm-leaderboard-rank-view-da91f5f3.js +0 -1
  242. package/dist/esm-es5/sqm-rewards-table.entry.js +0 -1
  243. package/dist/esm-es5/sqm-task-card-view-2ee495af.js +0 -1
  244. package/dist/esm-es5/sqm-task-card.entry.js +0 -1
  245. package/dist/esm-es5/tslib.es6-7ac9d7e4.js +0 -15
  246. package/dist/esm-es5/useChildElements-506f00d0.js +0 -1
  247. package/dist/esm-es5/useDemoBigStat-b71fe122.js +0 -1
  248. package/dist/mint-components/p-11c75956.entry.js +0 -1
  249. package/dist/mint-components/p-189219ee.system.js +0 -1
  250. package/dist/mint-components/p-1e248afc.system.entry.js +0 -1
  251. package/dist/mint-components/p-21dfdeb8.entry.js +0 -1
  252. package/dist/mint-components/p-23a0bdae.entry.js +0 -1
  253. package/dist/mint-components/p-353b4413.system.js +0 -1
  254. package/dist/mint-components/p-405a9253.js +0 -227
  255. package/dist/mint-components/p-55e02769.entry.js +0 -13
  256. package/dist/mint-components/p-58d9b2f0.js +0 -15
  257. package/dist/mint-components/p-684850a7.entry.js +0 -287
  258. package/dist/mint-components/p-70837c1c.entry.js +0 -49
  259. package/dist/mint-components/p-71d942af.entry.js +0 -9
  260. package/dist/mint-components/p-7c138c84.entry.js +0 -1
  261. package/dist/mint-components/p-7c261ea0.system.entry.js +0 -1
  262. package/dist/mint-components/p-8034f81c.system.entry.js +0 -1
  263. package/dist/mint-components/p-81dbda90.system.entry.js +0 -1
  264. package/dist/mint-components/p-8c16f04e.js +0 -1
  265. package/dist/mint-components/p-8f5e2af4.entry.js +0 -1
  266. package/dist/mint-components/p-91d39961.system.js +0 -1
  267. package/dist/mint-components/p-b3af1c6f.js +0 -1
  268. package/dist/mint-components/p-bf04a8e1.system.entry.js +0 -1
  269. package/dist/mint-components/p-bf055b6c.system.js +0 -1
  270. package/dist/mint-components/p-c3866bfa.system.entry.js +0 -1
  271. package/dist/mint-components/p-c9c4f31b.system.entry.js +0 -1
  272. package/dist/mint-components/p-dd6a666e.system.js +0 -15
  273. package/dist/mint-components/p-dfc3cf82.js +0 -1
  274. package/dist/mint-components/p-e19a57a4.system.entry.js +0 -1
  275. package/dist/mint-components/p-e22eed7b.entry.js +0 -1
  276. package/dist/mint-components/p-e2ebe90c.entry.js +0 -1
  277. package/dist/mint-components/p-e78a5a91.js +0 -1
  278. package/dist/mint-components/p-ecbabf6e.system.js +0 -1
  279. package/dist/mint-components/p-f41ab9e1.system.js +0 -1
  280. package/dist/mint-components/p-f87d8f53.system.js +0 -1
  281. package/dist/mint-components/p-fcaa5886.system.entry.js +0 -1
@@ -1,10 +1,9 @@
1
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-5ecbf81a.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, N as Ne } from './index.module-f80561db.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
- import './tslib.es6-7ac9d7e4.js';
8
7
  import { j as jss, c as create } from './jss-preset-default.esm-71fae192.js';
9
8
  import { g as getProps, a as getMissingProps } from './utils-454405f5.js';
10
9
  import { c as cjs } from './cjs-bdfb4486.js';
@@ -12,24 +11,21 @@ import { E as ErrorStyles, H as HostBlock, A as AuthWrapper, a as AuthColumn, b
12
11
  import { P as PortalContainerView } from './sqm-portal-container-view-73757ca5.js';
13
12
  import { P as PortalSectionView } from './sqm-portal-section-view-f0876545.js';
14
13
  import { T as TextSpanView } from './sqm-text-span-view-1781df94.js';
15
- import { g as gql } from './index-2f5dd0a1.js';
16
- import { u as useRerenderListener } from './re-render-9ab5fe0f.js';
17
- import { u as useChildElements } from './useChildElements-506f00d0.js';
18
- import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-b71fe122.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';
19
17
  import { S as ShareLinkView } from './sqm-share-link-view-9282b8e8.js';
20
- import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-fff5d35d.js';
21
- import { L as LeaderboardRankView } from './sqm-leaderboard-rank-view-da91f5f3.js';
18
+ import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-aa087ef2.js';
22
19
  import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-2242502c.js';
23
- import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-8a3f374b.js';
20
+ import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-b3618185.js';
24
21
  import { S as StatContainerView } from './sqm-stat-container-view-4133feb6.js';
25
- import { P as PortalProfileView } from './sqm-portal-profile-view-824c8242.js';
22
+ import { P as PortalProfileView } from './sqm-portal-profile-view-2fbb0845.js';
26
23
  import { P as PortalForgotPasswordView } from './sqm-portal-forgot-password-view-e3a6a716.js';
27
- import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-90781be2.js';
24
+ import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-df0559b0.js';
28
25
  import { P as PortalResetPasswordView$1 } from './sqm-portal-reset-password-view-a4e50da2.js';
29
26
  import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-6f18bac2.js';
30
27
  import { A as AssetCardView } from './sqm-asset-card-view-6f360937.js';
31
- import { T as TaskCardView } from './sqm-task-card-view-2ee495af.js';
32
- import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-c317518e.js';
28
+ import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-2b2bfc9e.js';
33
29
  import { H as HeroView } from './sqm-hero-view-bfd8abd1.js';
34
30
  import { N as NameFieldsView } from './sqm-name-fields-view-4162fb7b.js';
35
31
 
@@ -5876,6 +5872,21 @@ function ReferralTableView(props) {
5876
5872
  h("sl-button", { size: "small", loading: states.loading, disabled: !states.hasNext, onClick: callbacks.nextPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.moreLabel))));
5877
5873
  }
5878
5874
 
5875
+ function useChildElements() {
5876
+ const host = P$1();
5877
+ const initialState = host.children.length ? Array.from(host.children) : [];
5878
+ const [childElements, setChildElements] = useState(initialState);
5879
+ useEffect(() => {
5880
+ const observer = new MutationObserver(() => {
5881
+ const children = Array.from(host.children);
5882
+ setChildElements([...children]);
5883
+ });
5884
+ observer.observe(host, { childList: true });
5885
+ return () => observer.disconnect();
5886
+ }, [host]);
5887
+ return childElements;
5888
+ }
5889
+
5879
5890
  const GET_REFERRER_DATA = gql `
5880
5891
  query getReferrals($programId: ID, $rewardFilter: RewardFilterInput) {
5881
5892
  viewer {
@@ -14767,6 +14778,7 @@ const GET_EXCHANGE_LIST = dist.gql `
14767
14778
  destinationValue
14768
14779
  prettyDestinationValue
14769
14780
  available
14781
+ unavailableReasonCode
14770
14782
  }
14771
14783
  }
14772
14784
  totalCount
@@ -14794,14 +14806,14 @@ function useRewardExchangeList(props) {
14794
14806
  }), {
14795
14807
  selectedItem: undefined,
14796
14808
  selectedStep: undefined,
14797
- redeemStage: "",
14809
+ redeemStage: "chooseReward",
14798
14810
  amount: 0,
14799
14811
  exchangeError: false,
14800
14812
  });
14801
14813
  const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
14802
14814
  const user = T$1();
14803
14815
  const [exchange, { data: exchangeResponse, errors }] = be(EXCHANGE);
14804
- const { data } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
14816
+ const { data, loading } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
14805
14817
  useEffect(() => {
14806
14818
  var _a, _b;
14807
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) {
@@ -14910,6 +14922,7 @@ function useRewardExchangeList(props) {
14910
14922
  amount,
14911
14923
  selectedStep,
14912
14924
  exchangeError,
14925
+ loading,
14913
14926
  },
14914
14927
  data: {
14915
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,
@@ -14928,6 +14941,14 @@ function useRewardExchangeList(props) {
14928
14941
  };
14929
14942
  }
14930
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
+
14931
14952
  function Dot({ active, completed, incomplete, }) {
14932
14953
  return (h("div", { style: {
14933
14954
  flex: "0 0 0",
@@ -14952,58 +14973,41 @@ function Dot({ active, completed, incomplete, }) {
14952
14973
  ? "2px solid #E5E5E5"
14953
14974
  : "none",
14954
14975
  borderRadius: "50%",
14955
- width: completed ? "12px" : "8px",
14956
- height: completed ? "12px" : "8px",
14957
- margin: "-4px auto 0px",
14976
+ width: completed ? "14px" : "10px",
14977
+ height: completed ? "14px" : "10px",
14978
+ margin: "-5px auto 0px",
14958
14979
  zIndex: "1",
14959
- } })));
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
+ } }));
14960
14999
  }
14961
15000
  function Progress({ active, completed, incomplete }) {
14962
15001
  return [
14963
- h("div", { style: {
14964
- content: "''",
14965
- flex: "0.5 0.5 0",
14966
- height: "4px",
14967
- borderRadius: "4px",
14968
- background: incomplete ? "#E5E5E5" : "#9E9E9E",
14969
- position: "relative",
14970
- bottom: "0",
14971
- left: "0",
14972
- display: "flex",
14973
- justifyContent: "center",
14974
- columnGap: "50px",
14975
- marginRight: "-2px",
14976
- boxSizing: "content-box",
14977
- } }),
15002
+ h(ProgressLine, { incomplete: incomplete }),
14978
15003
  h(Dot, { active: active, completed: completed, incomplete: incomplete }),
14979
- h("div", { style: {
14980
- content: "''",
14981
- flex: "0.5 0.5 0",
14982
- height: "4px",
14983
- borderRadius: "4px",
14984
- background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
14985
- position: "relative",
14986
- bottom: "0",
14987
- left: "0",
14988
- display: "flex",
14989
- justifyContent: "center",
14990
- columnGap: "50px",
14991
- marginRight: "-2px",
14992
- boxSizing: "content-box",
14993
- } }),
15004
+ h(ProgressLine, { incomplete: incomplete, active: active }),
14994
15005
  ];
14995
15006
  }
14996
- function ProgressBar({ stage }) {
14997
- console.log({ stage });
14998
- return (h("div", { style: { display: "flex", columnGap: "-2px" } },
14999
- h(Progress, { active: stage === 0, completed: stage > 0, incomplete: stage < 0 }),
15000
- h(Progress, { active: stage === 1, completed: stage > 1, incomplete: stage < 1 }),
15001
- h(Progress, { active: stage === 2, completed: stage > 2, incomplete: stage < 2 })));
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 })))));
15002
15009
  }
15003
15010
 
15004
- 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" } },
15005
- 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" })));
15006
-
15007
15011
  const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
15008
15012
  const stageProgressList = {
15009
15013
  chooseReward: "Choose reward",
@@ -15014,7 +15018,6 @@ function RewardExchangeView(props) {
15014
15018
  const style = {
15015
15019
  Container: {
15016
15020
  position: "relative",
15017
- display: "flex",
15018
15021
  },
15019
15022
  CardContainer: {
15020
15023
  "&:hover": {
@@ -15022,29 +15025,33 @@ function RewardExchangeView(props) {
15022
15025
  },
15023
15026
  },
15024
15027
  Base: {
15025
- display: "block",
15028
+ display: "flex",
15026
15029
  cursor: "pointer",
15027
15030
  textAlign: "center",
15031
+ height: "120px",
15028
15032
  "&::part(base)": {
15029
15033
  width: "100%",
15030
- height: "170px",
15034
+ maxWidth: "350px",
15031
15035
  display: "flex",
15032
- justifyContent: "space-between",
15033
- alignItems: "center",
15036
+ margin: "0 auto",
15034
15037
  },
15035
15038
  "&::part(body)": {
15036
- padding: "10px 0",
15039
+ padding: 0,
15040
+ display: "flex",
15041
+ width: "100%",
15037
15042
  },
15038
15043
  },
15039
15044
  Drawer: {
15040
15045
  "&::part(base)": {
15041
15046
  minWidth: "400px",
15047
+ maxWidth: "700px",
15042
15048
  width: "50%",
15043
15049
  margin: "0 auto",
15044
15050
  right: "0",
15045
15051
  },
15046
15052
  "&::part(panel)": {
15047
15053
  height: "85vh",
15054
+ width: "100%",
15048
15055
  },
15049
15056
  },
15050
15057
  FullImage: {
@@ -15054,8 +15061,9 @@ function RewardExchangeView(props) {
15054
15061
  },
15055
15062
  PreviewImage: {
15056
15063
  objectFit: "contain",
15057
- maxWidth: "100%",
15058
- height: "75px",
15064
+ width: "120px",
15065
+ height: "120px",
15066
+ flex: 0.33,
15059
15067
  },
15060
15068
  InputBox: {
15061
15069
  width: "100%",
@@ -15070,8 +15078,9 @@ function RewardExchangeView(props) {
15070
15078
  },
15071
15079
  },
15072
15080
  Buttons: {
15073
- bottom: "0",
15081
+ marginLeft: "auto",
15074
15082
  width: "100%",
15083
+ maxWidth: "300px",
15075
15084
  },
15076
15085
  Button: {
15077
15086
  margin: "10px 0",
@@ -15079,6 +15088,24 @@ function RewardExchangeView(props) {
15079
15088
  textAlign: "center",
15080
15089
  cursor: "pointer",
15081
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
+ },
15082
15109
  };
15083
15110
  // JSS config
15084
15111
  jss.setup(create());
@@ -15105,37 +15132,60 @@ function RewardExchangeView(props) {
15105
15132
  });
15106
15133
  } }, (_b = item.steps) === null || _b === void 0 ? void 0 : _b.map((step) => (h("sl-menu-item", { value: step, disabled: !step.available },
15107
15134
  step.prettyDestinationValue,
15108
- h("span", { slot: "suffix", style: { fontSize: "75%" } }, step.prettySourceValue))))));
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))))))));
15109
15138
  }
15110
15139
  function chooseReward() {
15111
15140
  var _a;
15112
- const nextStage = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
15113
- ? "confirmation"
15114
- : "chooseAmount";
15115
- console.log({ nextStage, ruleType: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType });
15116
- return (h("div", { style: {
15117
- display: "flex",
15118
- justifyContent: "center",
15119
- flexWrap: "wrap",
15120
- alignItems: "center",
15121
- columnGap: "12px",
15122
- rowGap: "12px",
15123
- } }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 :
15124
- _a.map((item) => {
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) => {
15125
15150
  const style = {
15126
15151
  boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) ? "0 1px 8px #87ceeb" : "none",
15127
15152
  marginBottom: "10px 0",
15128
15153
  flex: "1",
15129
- minWidth: "45%",
15154
+ minWidth: "100%",
15155
+ color: !item.available && "#eee",
15130
15156
  };
15131
- return (h("div", { key: item.key, class: sheet.classes.CardContainer, style: style },
15132
- h("sl-card", { class: sheet.classes.Base, onClick: () => callbacks.setExchangeState({ selectedItem: item }), disabled: !item.available },
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 &&
15133
15164
  h("img", { class: sheet.classes.PreviewImage, src: (item === null || item === void 0 ? void 0 : item.imageUrl) || getAssetPath("./assets/Reward-icon.png") }),
15134
- h("p", null, item.description))));
15135
- }),
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
+ })),
15136
15183
  h("div", { class: sheet.classes.Buttons },
15137
15184
  h("sl-button", { onClick: () => callbacks.setStage(nextStage), style: { display: "block" }, class: sheet.classes.Button, disabled: !states.selectedItem }, "Continue"),
15138
- h("a", { onClick: () => { var _a; return (_a = refs.drawerRef.current) === null || _a === void 0 ? void 0 : _a.hide(); }, style: { display: "block" }, class: sheet.classes.Button }, "Cancel"))));
15185
+ h("a", {
15186
+ // onClick={() => refs.drawerRef.current?.hide()}
15187
+ style: { display: "block" }, class: sheet.classes.Button }, "Cancel")),
15188
+ ];
15139
15189
  }
15140
15190
  function chooseAmount() {
15141
15191
  const input = getInput();
@@ -15147,26 +15197,26 @@ function RewardExchangeView(props) {
15147
15197
  h("sl-button", { onClick: () => callbacks.setStage("confirmation"), disabled: input && !states.amount, style: { display: "block" }, class: sheet.classes.Button }, "Continue"),
15148
15198
  h("a", { onClick: () => callbacks.setStage("chooseReward"), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
15149
15199
  }
15150
- console.log({ selectedItem, selectedStep });
15200
+ // console.log({ selectedItem, selectedStep });
15151
15201
  function confirmation() {
15152
- console.log("confirmation:", { selectedItem });
15153
- const redemptionAmount = () => {
15154
- var _a;
15155
- if ((selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD") {
15156
- return `Redeem ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.sourceValue} ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.sourceUnit} for ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.globalRewardKey}`;
15157
- }
15158
- else {
15159
- const amount = states.amount;
15160
- const reward = (_a = selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) !== null && _a !== void 0 ? _a : `${amount} ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.destinationUnit}`;
15161
- return `Redeem ${amount} ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.sourceUnit} for ${reward}`;
15162
- }
15163
- };
15164
- const previousStage = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
15165
- ? "chooseReward"
15166
- : "chooseAmount";
15202
+ const previousStage = "chooseAmount";
15167
15203
  return (h("div", null,
15168
- h("h2", null, "Confirm your redemption:"),
15169
- redemptionAmount(),
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)))),
15170
15220
  h("div", { class: sheet.classes.Buttons },
15171
15221
  h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
15172
15222
  h("a", { onClick: () => callbacks.setStage(previousStage), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
@@ -15175,8 +15225,7 @@ function RewardExchangeView(props) {
15175
15225
  return (h("div", { style: { textAlign: "center" } },
15176
15226
  h("img", { class: sheet.classes.FullImage, src: getAssetPath("./assets/Reward-icon.png") }),
15177
15227
  h("p", { style: { color: "forestgreen" } }, "Reward Redeemed"),
15178
- (data === null || data === void 0 ? void 0 : data.fuelTankCode) && h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode),
15179
- h("sl-button", { onClick: () => { var _a, _b; return (_b = (_a = refs.drawerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.hide(); } }, "Done")));
15228
+ (data === null || data === void 0 ? void 0 : data.fuelTankCode) && h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode)));
15180
15229
  }
15181
15230
  const stages = {
15182
15231
  chooseReward: () => chooseReward(),
@@ -15187,32 +15236,23 @@ function RewardExchangeView(props) {
15187
15236
  const currentStage = stages[states.redeemStage];
15188
15237
  function stageMap() {
15189
15238
  const stageNumber = stageList.indexOf(states.redeemStage);
15190
- return (h("div", { style: { fontSize: "80%" } },
15191
- h(ProgressBar, { stage: stageNumber }),
15192
- h("div", { style: {
15193
- marginTop: "5px",
15194
- display: "flex",
15195
- justifyContent: "center",
15196
- textAlign: "center",
15197
- whiteSpace: "nowrap",
15198
- marginBottom: "10px",
15199
- } }, Object.keys(stageProgressList).map((stage) => {
15200
- if (stage === states.redeemStage)
15201
- return (h("b", { style: { flex: "1 1 0" } },
15202
- " ",
15203
- stageProgressList[stage]));
15204
- return h("i", { style: { flex: "1 1 0" } }, stageProgressList[stage]);
15205
- }))));
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 })));
15206
15249
  }
15207
- const Label = () => {
15250
+ const BackButton = () => {
15208
15251
  if (states.redeemStage === "success")
15209
15252
  return "";
15210
15253
  let previousStage = "";
15211
15254
  if (states.redeemStage === "confirmation") {
15212
- previousStage =
15213
- (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
15214
- ? "chooseReward"
15215
- : "chooseAmount";
15255
+ previousStage = "chooseAmount";
15216
15256
  }
15217
15257
  else if (states.redeemStage === "chooseAmount") {
15218
15258
  previousStage = "chooseReward";
@@ -15222,16 +15262,15 @@ function RewardExchangeView(props) {
15222
15262
  h(LeftArrow, null),
15223
15263
  " Back")));
15224
15264
  };
15265
+ console.log(props);
15225
15266
  return (h("div", { class: sheet.classes.Container },
15226
15267
  h("style", { type: "text/css" }, styleString),
15227
15268
  h("div", null,
15228
- h("sl-drawer", { ref: (ref) => (refs.drawerRef.current = ref), placement: "right", class: sheet.classes.Drawer, open: stageList.indexOf(states.redeemStage) >= 0 },
15229
- h(Label, null),
15230
- stageMap(),
15231
- currentStage && currentStage(),
15232
- states.exchangeError &&
15233
- "Something went wrong. Please contact support or try again."),
15234
- h("sl-button", { onClick: () => callbacks.openDrawer() }, "Redeem Rewards"))));
15269
+ h(BackButton, null),
15270
+ stageMap(),
15271
+ currentStage && currentStage(),
15272
+ states.exchangeError &&
15273
+ "Something went wrong. Please contact support or try again.")));
15235
15274
  }
15236
15275
 
15237
15276
  const SqmRewardExchangeList = class {
@@ -15268,10 +15307,11 @@ function useRewardExchangeListDemo(props) {
15268
15307
  content: {
15269
15308
  text: props,
15270
15309
  },
15271
- redeemStage: "",
15310
+ redeemStage: "chooseReward",
15272
15311
  amount: 0,
15273
15312
  selectedStep: undefined,
15274
15313
  exchangeError: false,
15314
+ loading: false,
15275
15315
  },
15276
15316
  data: {
15277
15317
  shareCode: "SHARECODE123",
@@ -15288,142 +15328,480 @@ function useRewardExchangeListDemo(props) {
15288
15328
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
15289
15329
  }
15290
15330
 
15291
- const debug$1 = browser("sq:useRouter");
15292
- function matchPath(pattern, page) {
15293
- if (!pattern)
15294
- return;
15295
- const regexp = pathToRegexp(pattern);
15296
- return regexp.exec(page);
15297
- }
15298
- function useRouter() {
15299
- const location = an();
15300
- const host = P$1();
15301
- const [slot, setSlot] = useState(undefined);
15302
- const [container, setContainer] = useState(undefined);
15303
- const page = location.pathname;
15304
- // convert sqm-routes into templates
15305
- useEffect(() => {
15306
- const routes = host.querySelectorAll(`sqm-route`);
15307
- const routesArray = Array.from(routes);
15308
- routesArray.forEach((route) => {
15309
- const newTemplate = document.createElement("template");
15310
- newTemplate.setAttribute("path", route.path);
15311
- newTemplate.innerHTML = route.innerHTML;
15312
- route.parentNode.appendChild(newTemplate);
15313
- route.parentNode.removeChild(route);
15314
- });
15315
- }, []);
15316
- useEffect(() => {
15317
- var _a, _b;
15318
- if (!container || !slot) {
15319
- debug$1("DOM not ready for navigation rendering on:", page);
15320
- return;
15321
- }
15322
- // <template>
15323
- const templates = slot.querySelectorAll(`template`);
15324
- const templatesArray = Array.from(templates);
15325
- const template = templatesArray.find((template) => {
15326
- var _a, _b, _c;
15327
- //@ts-ignore
15328
- const path = (_b = (_a = template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15329
- if ((_c = matchPath(path, page)) === null || _c === void 0 ? void 0 : _c.length)
15330
- return template;
15331
- });
15332
- //@ts-ignore - can't access template attributes directly
15333
- const templatePath = (_b = (_a = template === null || template === void 0 ? void 0 : template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15334
- debug$1({
15335
- containerDatasetPage: container.dataset.page,
15336
- templatePath,
15337
- page,
15338
- });
15339
- // if no routes found, and the old route doesn't match the new route
15340
- if (!template) {
15341
- // No matching page, display nothing
15342
- debug$1("No matching page found for ", page, ", so render nothing");
15343
- container.innerHTML = "";
15344
- container.dataset.page = page;
15345
- return;
15346
- }
15347
- debug$1("Page updated to ", page, template);
15348
- // if pathToRegexp results truthy or page is an exact match
15349
- if (!!matchPath(templatePath, container.dataset.page)) {
15350
- debug$1("don't rerender");
15351
- // Same page, do not re-render
15352
- // Reduces dom mutations, speeds up page speed
15353
- }
15354
- else if (template) {
15355
- container.innerHTML = template.innerHTML;
15356
- container.dataset.page = page;
15357
- }
15358
- }, [slot, container, page]);
15359
- return {
15360
- callbacks: {
15361
- setSlot,
15362
- setContainer,
15363
- },
15364
- };
15365
- }
15366
-
15367
- const sqmRouterCss = "sqm-router{display:contents}";
15368
-
15369
- const SqmRouter = class {
15370
- constructor(hostRef) {
15371
- registerInstance(this, hostRef);
15372
- this.ignored = true;
15373
- h$1(this);
15374
- }
15375
- disconnectedCallback() { }
15376
- render() {
15377
- const { callbacks } = useRouter();
15378
- return (h(Host, null, h("div", { ref: callbacks.setSlot, style: { display: "none" } }, h("slot", null)), h("div", { style: { display: "contents" }, ref: callbacks.setContainer })));
15379
- }
15380
- };
15381
- SqmRouter.style = sqmRouterCss;
15382
-
15383
15331
  const style$7 = {
15384
- HostBlock: HostBlock,
15385
- buttonStyle: {
15386
- display: "block",
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)" }),
15387
15351
  },
15388
15352
  };
15389
15353
  jss.setup(create());
15390
15354
  const sheet$7 = jss.createStyleSheet(style$7);
15391
15355
  const styleString$7 = sheet$7.toString();
15392
- function ShareButtonView(props, children) {
15393
- return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
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,
15394
15361
  h("style", { type: "text/css" }, styleString$7),
15395
- 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` },
15396
- !props.hideicon && (h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
15397
- !props.hidetext && children)));
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
15398
  }
15399
15399
 
15400
- const MessageLinkQuery = gql `
15401
- query (
15402
- $programId: ID
15403
- $engagementMedium: UserEngagementMedium!
15404
- $shareMedium: ReferralShareMedium!
15400
+ const CSS_NAMESPACE = "sqm-rewards-table";
15401
+ const GET_REWARDS = gql `
15402
+ query getRewards(
15403
+ $limit: Int!
15404
+ $offset: Int!
15405
+ $rewardFilter: RewardFilterInput
15405
15406
  ) {
15406
15407
  viewer {
15407
15408
  ... on User {
15408
- messageLink(
15409
- programId: $programId
15410
- engagementMedium: $engagementMedium
15411
- shareMedium: $shareMedium
15412
- )
15413
- shareLink(programId: $programId, engagementMedium: $engagementMedium)
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
+ }
15414
15445
  }
15415
15446
  }
15416
15447
  }
15417
15448
  `;
15418
- function NativeShare(props, directLink) {
15419
- const title = props.sharetitle || "Share title";
15420
- const text = props.sharetext || "Share text";
15421
- if (directLink === "undefined") {
15422
- return alert("error: message link undefined!");
15423
- }
15424
- if (window.navigator.share) {
15425
- window.navigator
15426
- .share({
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
+
15669
+ const debug$1 = browser("sq:useRouter");
15670
+ function matchPath(pattern, page) {
15671
+ if (!pattern)
15672
+ return;
15673
+ const regexp = pathToRegexp(pattern);
15674
+ return regexp.exec(page);
15675
+ }
15676
+ function useRouter() {
15677
+ const location = an();
15678
+ const host = P$1();
15679
+ const [slot, setSlot] = useState(undefined);
15680
+ const [container, setContainer] = useState(undefined);
15681
+ const page = location.pathname;
15682
+ // convert sqm-routes into templates
15683
+ useEffect(() => {
15684
+ const routes = host.querySelectorAll(`sqm-route`);
15685
+ const routesArray = Array.from(routes);
15686
+ routesArray.forEach((route) => {
15687
+ const newTemplate = document.createElement("template");
15688
+ newTemplate.setAttribute("path", route.path);
15689
+ newTemplate.innerHTML = route.innerHTML;
15690
+ route.parentNode.appendChild(newTemplate);
15691
+ route.parentNode.removeChild(route);
15692
+ });
15693
+ }, []);
15694
+ useEffect(() => {
15695
+ var _a, _b;
15696
+ if (!container || !slot) {
15697
+ debug$1("DOM not ready for navigation rendering on:", page);
15698
+ return;
15699
+ }
15700
+ // <template>
15701
+ const templates = slot.querySelectorAll(`template`);
15702
+ const templatesArray = Array.from(templates);
15703
+ const template = templatesArray.find((template) => {
15704
+ var _a, _b, _c;
15705
+ //@ts-ignore
15706
+ const path = (_b = (_a = template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15707
+ if ((_c = matchPath(path, page)) === null || _c === void 0 ? void 0 : _c.length)
15708
+ return template;
15709
+ });
15710
+ //@ts-ignore - can't access template attributes directly
15711
+ const templatePath = (_b = (_a = template === null || template === void 0 ? void 0 : template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15712
+ debug$1({
15713
+ containerDatasetPage: container.dataset.page,
15714
+ templatePath,
15715
+ page,
15716
+ });
15717
+ // if no routes found, and the old route doesn't match the new route
15718
+ if (!template) {
15719
+ // No matching page, display nothing
15720
+ debug$1("No matching page found for ", page, ", so render nothing");
15721
+ container.innerHTML = "";
15722
+ container.dataset.page = page;
15723
+ return;
15724
+ }
15725
+ debug$1("Page updated to ", page, template);
15726
+ // if pathToRegexp results truthy or page is an exact match
15727
+ if (!!matchPath(templatePath, container.dataset.page)) {
15728
+ debug$1("don't rerender");
15729
+ // Same page, do not re-render
15730
+ // Reduces dom mutations, speeds up page speed
15731
+ }
15732
+ else if (template) {
15733
+ container.innerHTML = template.innerHTML;
15734
+ container.dataset.page = page;
15735
+ }
15736
+ }, [slot, container, page]);
15737
+ return {
15738
+ callbacks: {
15739
+ setSlot,
15740
+ setContainer,
15741
+ },
15742
+ };
15743
+ }
15744
+
15745
+ const sqmRouterCss = "sqm-router{display:contents}";
15746
+
15747
+ const SqmRouter = class {
15748
+ constructor(hostRef) {
15749
+ registerInstance(this, hostRef);
15750
+ this.ignored = true;
15751
+ h$1(this);
15752
+ }
15753
+ disconnectedCallback() { }
15754
+ render() {
15755
+ const { callbacks } = useRouter();
15756
+ return (h(Host, null, h("div", { ref: callbacks.setSlot, style: { display: "none" } }, h("slot", null)), h("div", { style: { display: "contents" }, ref: callbacks.setContainer })));
15757
+ }
15758
+ };
15759
+ SqmRouter.style = sqmRouterCss;
15760
+
15761
+ const style$8 = {
15762
+ HostBlock: HostBlock,
15763
+ buttonStyle: {
15764
+ display: "block",
15765
+ },
15766
+ };
15767
+ jss.setup(create());
15768
+ const sheet$8 = jss.createStyleSheet(style$8);
15769
+ const styleString$8 = sheet$8.toString();
15770
+ function ShareButtonView(props, children) {
15771
+ return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
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` },
15774
+ !props.hideicon && (h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
15775
+ !props.hidetext && children)));
15776
+ }
15777
+
15778
+ const MessageLinkQuery = gql `
15779
+ query (
15780
+ $programId: ID
15781
+ $engagementMedium: UserEngagementMedium!
15782
+ $shareMedium: ReferralShareMedium!
15783
+ ) {
15784
+ viewer {
15785
+ ... on User {
15786
+ messageLink(
15787
+ programId: $programId
15788
+ engagementMedium: $engagementMedium
15789
+ shareMedium: $shareMedium
15790
+ )
15791
+ shareLink(programId: $programId, engagementMedium: $engagementMedium)
15792
+ }
15793
+ }
15794
+ }
15795
+ `;
15796
+ function NativeShare(props, directLink) {
15797
+ const title = props.sharetitle || "Share title";
15798
+ const text = props.sharetext || "Share text";
15799
+ if (directLink === "undefined") {
15800
+ return alert("error: message link undefined!");
15801
+ }
15802
+ if (window.navigator.share) {
15803
+ window.navigator
15804
+ .share({
15427
15805
  title,
15428
15806
  text,
15429
15807
  url: directLink,
@@ -17130,11 +17508,12 @@ const BigStat_stories = {
17130
17508
  title: "Components/Big Stat",
17131
17509
  };
17132
17510
  const Default$1 = () => {
17133
- const props = { statvalue: "9.900,00" };
17511
+ const props = { value: 990000, statvalue: "9.900,00" };
17134
17512
  return h(BigStatView, Object.assign({}, props), "Big stat");
17135
17513
  };
17136
17514
  const LeftAlign = () => {
17137
17515
  const props = {
17516
+ value: 500,
17138
17517
  statvalue: "500",
17139
17518
  alignment: "left",
17140
17519
  };
@@ -17142,6 +17521,7 @@ const LeftAlign = () => {
17142
17521
  };
17143
17522
  const RightAlign = () => {
17144
17523
  const props = {
17524
+ value: 500,
17145
17525
  statvalue: "500",
17146
17526
  alignment: "right",
17147
17527
  };
@@ -17149,6 +17529,7 @@ const RightAlign = () => {
17149
17529
  };
17150
17530
  const FlexReverse = () => {
17151
17531
  const props = {
17532
+ value: 500,
17152
17533
  statvalue: "500",
17153
17534
  flexReverse: true,
17154
17535
  };
@@ -17156,6 +17537,7 @@ const FlexReverse = () => {
17156
17537
  };
17157
17538
  const FlexReverseRight = () => {
17158
17539
  const props = {
17540
+ value: 500,
17159
17541
  statvalue: "500",
17160
17542
  flexReverse: true,
17161
17543
  alignment: "right",
@@ -17164,6 +17546,7 @@ const FlexReverseRight = () => {
17164
17546
  };
17165
17547
  const FlexReverseLeft = () => {
17166
17548
  const props = {
17549
+ value: 500,
17167
17550
  statvalue: "500",
17168
17551
  flexReverse: true,
17169
17552
  alignment: "left",
@@ -17172,12 +17555,14 @@ const FlexReverseLeft = () => {
17172
17555
  };
17173
17556
  const NoStatValue = () => {
17174
17557
  const props = {
17558
+ value: 0,
17175
17559
  statvalue: "...",
17176
17560
  };
17177
17561
  return h(BigStatView, Object.assign({}, props), "Big stat");
17178
17562
  };
17179
17563
  const InvalidStatValue = () => {
17180
17564
  const props = {
17565
+ value: 0,
17181
17566
  statvalue: "!!!",
17182
17567
  };
17183
17568
  return h(BigStatView, Object.assign({}, props), "Big stat");
@@ -17903,6 +18288,9 @@ const RewardBalanceCashUSD = createHookStory(() => {
17903
18288
  const ProgramGoals = createHookStory(() => {
17904
18289
  const dummy = encodeURIComponent("Paid-Member-Goal/referrals");
17905
18290
  return View(`/programGoals/count/${dummy}`, "/(programGoals)/:metricType/:goalId");
18291
+ });
18292
+ const CustomField = createHookStory(() => {
18293
+ return View(`/customFields/thingCount`, "/(customFields)/:customField");
17906
18294
  });
17907
18295
 
17908
18296
  const UseBigStat = /*#__PURE__*/Object.freeze({
@@ -17934,7 +18322,8 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
17934
18322
  RewardsAvailableWithSlash: RewardsAvailableWithSlash,
17935
18323
  RewardBalance: RewardBalance,
17936
18324
  RewardBalanceCashUSD: RewardBalanceCashUSD,
17937
- ProgramGoals: ProgramGoals
18325
+ ProgramGoals: ProgramGoals,
18326
+ CustomField: CustomField
17938
18327
  });
17939
18328
 
17940
18329
  function setupGraphQL$4() {
@@ -18241,18 +18630,100 @@ const UseRewardExchangeList = /*#__PURE__*/Object.freeze({
18241
18630
  VariableCreditReward: VariableCreditReward
18242
18631
  });
18243
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({
18671
+ __proto__: null,
18672
+ 'default': UseRewardsTable_stories,
18673
+ RewardsTableWithProgram: RewardsTableWithProgram,
18674
+ RewardsTableNoProgram: RewardsTableNoProgram
18675
+ });
18676
+
18677
+ const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
18678
+ const UseTaskCard_stories = {
18679
+ title: "Hooks / useTaskCard",
18680
+ };
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
+ });
18708
+
18709
+ const UseTaskCard = /*#__PURE__*/Object.freeze({
18710
+ __proto__: null,
18711
+ 'default': UseTaskCard_stories,
18712
+ TaskCard: TaskCard
18713
+ });
18714
+
18244
18715
  const NewPortal_stories = {
18245
18716
  title: "New Portal",
18246
18717
  };
18247
- const style$8 = {
18718
+ const style$9 = {
18248
18719
  HeaderSubtitleBold: {
18249
18720
  "font-weight": 500,
18250
18721
  "text-decoration": "underline",
18251
18722
  },
18252
18723
  };
18253
18724
  jss.setup(create());
18254
- const sheet$8 = jss.createStyleSheet(style$8);
18255
- const styleString$8 = sheet$8.toString();
18725
+ const sheet$9 = jss.createStyleSheet(style$9);
18726
+ const styleString$9 = sheet$9.toString();
18256
18727
  const barProps = {
18257
18728
  data: {
18258
18729
  programs: [
@@ -18347,7 +18818,7 @@ const Dashboard = () => {
18347
18818
  hide: false,
18348
18819
  };
18349
18820
  return (h("sqm-divided-layout", { direction: "row" },
18350
- h("style", { type: "text/css" }, styleString$8),
18821
+ h("style", { type: "text/css" }, styleString$9),
18351
18822
  h(Sidebar, null),
18352
18823
  h("sqm-divided-layout", { direction: "column" },
18353
18824
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18360,10 +18831,10 @@ const Dashboard = () => {
18360
18831
  h("h1", null, "John Smith"))),
18361
18832
  })),
18362
18833
  h(StatContainerView, Object.assign({}, { space: "64px" }),
18363
- h(BigStatView, Object.assign({}, { statvalue: "2,345" }), "Clicks"),
18364
- h(BigStatView, Object.assign({}, { statvalue: "58" }), "Referrals"),
18365
- h(BigStatView, Object.assign({}, { statvalue: "$10,540" }), "Earned"),
18366
- 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"))),
18367
18838
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
18368
18839
  h(PortalSectionView, Object.assign({}, {
18369
18840
  labelMargin: "x-large",
@@ -18405,7 +18876,7 @@ const Dashboard = () => {
18405
18876
  };
18406
18877
  const EditProfile$2 = () => {
18407
18878
  return (h("sqm-divided-layout", { direction: "row" },
18408
- h("style", { type: "text/css" }, styleString$8),
18879
+ h("style", { type: "text/css" }, styleString$9),
18409
18880
  h(Sidebar, null),
18410
18881
  h("sqm-divided-layout", { direction: "column" },
18411
18882
  h(PortalProfileView, Object.assign({}, {
@@ -18469,7 +18940,7 @@ const EditProfile$2 = () => {
18469
18940
  };
18470
18941
  const Commissions = () => {
18471
18942
  return (h("sqm-divided-layout", { direction: "row" },
18472
- h("style", { type: "text/css" }, styleString$8),
18943
+ h("style", { type: "text/css" }, styleString$9),
18473
18944
  h(Sidebar, null),
18474
18945
  h("sqm-divided-layout", { direction: "column" },
18475
18946
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18482,19 +18953,19 @@ const Commissions = () => {
18482
18953
  h("p", null,
18483
18954
  "for the",
18484
18955
  " ",
18485
- h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
18956
+ h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
18486
18957
  " ",
18487
18958
  "program"))),
18488
18959
  })),
18489
18960
  h(StatContainerView, Object.assign({}, { space: "64px" }),
18490
- h(BigStatView, Object.assign({}, { statvalue: "$ 1,000" }), "Total Earned"),
18491
- h(BigStatView, Object.assign({}, { statvalue: "$ 800" }), "Available"),
18492
- h(BigStatView, Object.assign({}, { statvalue: "$ 180" }), "Pending"),
18493
- 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"))))));
18494
18965
  };
18495
18966
  const Activity = () => {
18496
18967
  return (h("sqm-divided-layout", { direction: "row" },
18497
- h("style", { type: "text/css" }, styleString$8),
18968
+ h("style", { type: "text/css" }, styleString$9),
18498
18969
  h(Sidebar, null),
18499
18970
  h("sqm-divided-layout", { direction: "column" },
18500
18971
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18507,7 +18978,7 @@ const Activity = () => {
18507
18978
  h("p", null,
18508
18979
  "for the",
18509
18980
  " ",
18510
- h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
18981
+ h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
18511
18982
  " ",
18512
18983
  "program"))),
18513
18984
  })),
@@ -18517,10 +18988,10 @@ const Activity = () => {
18517
18988
  label: (h("sqm-text", null,
18518
18989
  h("h3", null, "Referral Activity"))),
18519
18990
  content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
18520
- h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Total Referrals"),
18521
- h(BigStatView, Object.assign({}, { statvalue: "800" }), "Converted"),
18522
- h(BigStatView, Object.assign({}, { statvalue: "180" }), "Pending"),
18523
- 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"))),
18524
18995
  }))),
18525
18996
  h(PortalSectionView, Object.assign({}, {
18526
18997
  labelMargin: "x-large",
@@ -18528,9 +18999,9 @@ const Activity = () => {
18528
18999
  label: (h("sqm-text", null,
18529
19000
  h("h3", null, "Traffic Generated"))),
18530
19001
  content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
18531
- h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Clicks"),
18532
- h(BigStatView, Object.assign({}, { statvalue: "800" }), "From share link"),
18533
- 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"))),
18534
19005
  })))));
18535
19006
  };
18536
19007
 
@@ -20512,31 +20983,528 @@ const EmptyError = () => {
20512
20983
  fieldLabel: "Password",
20513
20984
  },
20514
20985
  },
20515
- } }));
20516
- };
20517
- const ValidationError = () => {
20518
- return (h("sqm-password-field", { demoData: {
20519
- initValue: "asdf",
20520
- states: {
20521
- enableValidation: true,
20522
- validationErrors: { password: "Incomplete" },
20523
- content: {
20524
- fieldLabel: "Password",
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)",
20525
21470
  },
21471
+ transformOrigin: "50% 37%",
21472
+ transition: "transform var(--sl-transition-medium) ease",
20526
21473
  },
20527
- } }));
20528
- };
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
+ }
20529
21500
 
20530
- const PasswordField = /*#__PURE__*/Object.freeze({
20531
- __proto__: null,
20532
- 'default': PasswordField_stories,
20533
- Start: Start,
20534
- EmptyError: EmptyError,
20535
- ValidationError: ValidationError
20536
- });
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 |";
20537
21502
 
20538
21503
  const TaskCard_stories = {
20539
- title: "Components/Task Card",
21504
+ title: "Components/Task Card/",
21505
+ parameters: {
21506
+ scenario: scenario$5,
21507
+ },
20540
21508
  };
20541
21509
  const resizable = {
20542
21510
  width: "347px",
@@ -20545,35 +21513,47 @@ const resizable = {
20545
21513
  height: "fit-content",
20546
21514
  overflow: "hidden",
20547
21515
  };
20548
- const Default$a = () => {
20549
- // @ts-ignore
20550
- return h(TaskCardView, null);
20551
- };
20552
21516
  const NotRepeatable = () => {
20553
21517
  const oneAction = {
20554
- points: 20,
21518
+ rewardAmount: 20,
21519
+ showExpiry: false,
21520
+ rewardUnit: "Points",
20555
21521
  cardTitle: "Complete a survey",
21522
+ repeatable: false,
20556
21523
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20557
21524
  buttonText: "Take survey",
20558
21525
  goal: 1,
21526
+ buttonLink: "https://example.com/",
21527
+ showProgressBar: false,
21528
+ loading: false,
20559
21529
  };
20560
21530
  const coupleActions = {
20561
- points: 40,
21531
+ rewardAmount: 40,
21532
+ rewardUnit: "Points",
20562
21533
  cardTitle: "Comment on 5 articles",
20563
21534
  showProgressBar: true,
21535
+ showExpiry: false,
20564
21536
  goal: 5,
20565
- steps: 1,
21537
+ repeatable: false,
21538
+ steps: true,
20566
21539
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20567
21540
  buttonText: "Start reading",
21541
+ buttonLink: "https://example.com/",
21542
+ loading: false,
20568
21543
  };
20569
21544
  const manyActions = {
20570
- points: 150,
21545
+ rewardAmount: 150,
21546
+ rewardUnit: "Points",
20571
21547
  cardTitle: "Spend $500 at our Store",
20572
21548
  showProgressBar: true,
21549
+ showExpiry: false,
20573
21550
  goal: 500,
20574
- unit: "$",
21551
+ repeatable: false,
21552
+ progressBarUnit: "$",
20575
21553
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20576
21554
  buttonText: "Visit our Store",
21555
+ buttonLink: "https://example.com/",
21556
+ loading: false,
20577
21557
  };
20578
21558
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20579
21559
  h("div", { style: resizable },
@@ -20594,13 +21574,6 @@ const NotRepeatable = () => {
20594
21574
  h("h5", null),
20595
21575
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20596
21576
  " ",
20597
- h("h5", null),
20598
- h("h5", null,
20599
- "Progress ",
20600
- ">",
20601
- " Goal"),
20602
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
20603
- " ",
20604
21577
  h("h5", null)),
20605
21578
  h("div", { style: resizable },
20606
21579
  h("h4", null, "Many Actions"),
@@ -20612,46 +21585,52 @@ const NotRepeatable = () => {
20612
21585
  h("h5", null),
20613
21586
  h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
20614
21587
  " ",
20615
- h("h5", null),
20616
- h("h5", null,
20617
- "Progress ",
20618
- ">",
20619
- " Goal"),
20620
- h(TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
20621
- " ",
20622
21588
  h("h5", null))));
20623
21589
  };
20624
21590
  const NotRepeatableWithExpiry = () => {
20625
21591
  const oneAction = {
20626
- points: 20,
21592
+ rewardAmount: 20,
21593
+ rewardUnit: "Points",
20627
21594
  cardTitle: "Complete a survey",
20628
21595
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20629
21596
  buttonText: "Take survey",
20630
21597
  goal: 1,
20631
- expire: true,
20632
- dateExpire: "Nov 1, 2021",
21598
+ showExpiry: true,
21599
+ repeatable: false,
21600
+ dateExpires: "Nov 1, 2021",
21601
+ buttonLink: "https://example.com/",
21602
+ showProgressBar: false,
21603
+ loading: false,
20633
21604
  };
20634
21605
  const coupleActions = {
20635
- points: 40,
21606
+ rewardAmount: 40,
21607
+ rewardUnit: "Points",
20636
21608
  cardTitle: "Comment on 5 articles",
20637
21609
  showProgressBar: true,
20638
21610
  goal: 5,
20639
- steps: 1,
21611
+ steps: true,
20640
21612
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20641
21613
  buttonText: "Start reading",
20642
- expire: true,
20643
- dateExpire: "Nov 1, 2021",
21614
+ showExpiry: true,
21615
+ repeatable: false,
21616
+ dateExpires: "Nov 1, 2021",
21617
+ buttonLink: "https://example.com/",
21618
+ loading: false,
20644
21619
  };
20645
21620
  const manyActions = {
20646
- points: 150,
21621
+ rewardAmount: 150,
21622
+ rewardUnit: "Points",
21623
+ repeatable: false,
20647
21624
  cardTitle: "Spend $500 at our Store",
20648
21625
  showProgressBar: true,
20649
21626
  goal: 500,
20650
- unit: "$",
21627
+ progressBarUnit: "$",
20651
21628
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20652
21629
  buttonText: "Visit our Store",
20653
- expire: true,
20654
- dateExpire: "Nov 1, 2021",
21630
+ showExpiry: true,
21631
+ dateExpires: "Nov 1, 2021",
21632
+ buttonLink: "https://example.com/",
21633
+ loading: false,
20655
21634
  };
20656
21635
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20657
21636
  h("div", { style: resizable },
@@ -20672,13 +21651,6 @@ const NotRepeatableWithExpiry = () => {
20672
21651
  h("h5", null),
20673
21652
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20674
21653
  " ",
20675
- h("h5", null),
20676
- h("h5", null,
20677
- "Progress ",
20678
- ">",
20679
- " Goal"),
20680
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
20681
- " ",
20682
21654
  h("h5", null)),
20683
21655
  h("div", { style: resizable },
20684
21656
  h("h4", null, "Many Actions"),
@@ -20690,43 +21662,49 @@ const NotRepeatableWithExpiry = () => {
20690
21662
  h("h5", null),
20691
21663
  h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
20692
21664
  " ",
20693
- h("h5", null),
20694
- h("h5", null,
20695
- "Progress ",
20696
- ">",
20697
- " Goal"),
20698
- h(TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
20699
- " ",
20700
21665
  h("h5", null))));
20701
21666
  };
20702
21667
  const Repeatable = () => {
20703
21668
  const oneAction = {
20704
- points: 20,
21669
+ rewardAmount: 20,
21670
+ rewardUnit: "Points",
21671
+ showExpiry: false,
20705
21672
  cardTitle: "Complete a survey",
20706
21673
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20707
21674
  buttonText: "Take survey",
20708
21675
  goal: 1,
20709
21676
  repeatable: true,
21677
+ buttonLink: "https://example.com/",
21678
+ showProgressBar: false,
21679
+ loading: false,
20710
21680
  };
20711
21681
  const coupleActions = {
20712
- points: 40,
21682
+ rewardAmount: 40,
21683
+ rewardUnit: "Points",
21684
+ showExpiry: false,
20713
21685
  cardTitle: "Comment on 5 articles",
20714
21686
  showProgressBar: true,
20715
21687
  repeatable: true,
20716
21688
  goal: 5,
20717
- steps: 1,
21689
+ steps: true,
20718
21690
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20719
21691
  buttonText: "Start reading",
21692
+ buttonLink: "https://example.com/",
21693
+ loading: false,
20720
21694
  };
20721
21695
  const manyActions = {
20722
- points: 150,
21696
+ rewardAmount: 150,
21697
+ rewardUnit: "Points",
21698
+ showExpiry: false,
20723
21699
  cardTitle: "Spend $500 at our Store",
20724
21700
  showProgressBar: true,
20725
21701
  repeatable: true,
20726
21702
  goal: 500,
20727
- unit: "$",
21703
+ progressBarUnit: "$",
20728
21704
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20729
21705
  buttonText: "Visit our Store",
21706
+ buttonLink: "https://example.com/",
21707
+ loading: false,
20730
21708
  };
20731
21709
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20732
21710
  h("div", { style: resizable },
@@ -20750,18 +21728,6 @@ const Repeatable = () => {
20750
21728
  h("h5", null),
20751
21729
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
20752
21730
  " ",
20753
- h("h5", null),
20754
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
20755
- " ",
20756
- h("h5", null),
20757
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
20758
- " ",
20759
- h("h5", null),
20760
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
20761
- " ",
20762
- h("h5", null),
20763
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
20764
- " ",
20765
21731
  h("h5", null)),
20766
21732
  h("div", { style: resizable },
20767
21733
  h("h4", null, "Many Actions"),
@@ -20776,54 +21742,52 @@ const Repeatable = () => {
20776
21742
  h("h5", null),
20777
21743
  h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
20778
21744
  " ",
20779
- h("h5", null),
20780
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
20781
- " ",
20782
- h("h5", null),
20783
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
20784
- " ",
20785
- h("h5", null),
20786
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
20787
- " ",
20788
- h("h5", null),
20789
- h(TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
20790
- " ",
20791
21745
  h("h5", null))));
20792
21746
  };
20793
21747
  const RepeatableWithExpiry = () => {
20794
21748
  const oneAction = {
20795
- points: 20,
21749
+ rewardAmount: 20,
21750
+ rewardUnit: "Points",
20796
21751
  cardTitle: "Complete a survey",
20797
21752
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20798
21753
  buttonText: "Take survey",
20799
21754
  goal: 1,
20800
21755
  repeatable: true,
20801
- expire: true,
20802
- dateExpire: "Nov 1, 2021",
21756
+ showExpiry: true,
21757
+ dateExpires: "Nov 1, 2021",
21758
+ buttonLink: "https://example.com/",
21759
+ showProgressBar: false,
21760
+ loading: false,
20803
21761
  };
20804
21762
  const coupleActions = {
20805
- points: 40,
21763
+ rewardAmount: 40,
21764
+ rewardUnit: "Points",
20806
21765
  cardTitle: "Comment on 5 articles",
20807
21766
  showProgressBar: true,
20808
21767
  repeatable: true,
20809
21768
  goal: 5,
20810
- steps: 1,
21769
+ steps: true,
20811
21770
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20812
21771
  buttonText: "Start reading",
20813
- expire: true,
20814
- dateExpire: "Nov 1, 2021",
21772
+ showExpiry: true,
21773
+ dateExpires: "Nov 1, 2021",
21774
+ buttonLink: "https://example.com/",
21775
+ loading: false,
20815
21776
  };
20816
21777
  const manyActions = {
20817
- points: 150,
21778
+ rewardAmount: 150,
21779
+ rewardUnit: "Points",
20818
21780
  cardTitle: "Spend $500 at our Store",
20819
21781
  showProgressBar: true,
20820
21782
  repeatable: true,
20821
21783
  goal: 500,
20822
- unit: "$",
21784
+ progressBarUnit: "$",
20823
21785
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20824
21786
  buttonText: "Visit our Store",
20825
- expire: true,
20826
- dateExpire: "Nov 1, 2021",
21787
+ showExpiry: true,
21788
+ dateExpires: "Nov 1, 2021",
21789
+ buttonLink: "https://example.com/",
21790
+ loading: false,
20827
21791
  };
20828
21792
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20829
21793
  h("div", { style: resizable },
@@ -20847,18 +21811,6 @@ const RepeatableWithExpiry = () => {
20847
21811
  h("h5", null),
20848
21812
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
20849
21813
  " ",
20850
- h("h5", null),
20851
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
20852
- " ",
20853
- h("h5", null),
20854
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
20855
- " ",
20856
- h("h5", null),
20857
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
20858
- " ",
20859
- h("h5", null),
20860
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
20861
- " ",
20862
21814
  h("h5", null)),
20863
21815
  h("div", { style: resizable },
20864
21816
  h("h4", null, "Many Actions"),
@@ -20873,169 +21825,143 @@ const RepeatableWithExpiry = () => {
20873
21825
  h("h5", null),
20874
21826
  h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
20875
21827
  " ",
20876
- h("h5", null),
20877
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
20878
- " ",
20879
- h("h5", null),
20880
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
20881
- " ",
20882
- h("h5", null),
20883
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
20884
- " ",
20885
- h("h5", null),
20886
- h(TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
20887
- " ",
20888
21828
  h("h5", null))));
20889
- };
20890
- // export const Repeatable = () => {
20891
- // const oneAction = {
20892
- // points: 20,
20893
- // cardTitle: "Complete a survey",
20894
- // description:
20895
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20896
- // repeatable: 0,
20897
- // buttonText: "Take survey",
20898
- // buttonOnClick: () => {},
20899
- // };
20900
- // const coupleActions = {
20901
- // points: 40,
20902
- // cardTitle: "Comment on 5 articles",
20903
- // goal: 5,
20904
- // steps: 1,
20905
- // repeatable: true,
20906
- // description:
20907
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20908
- // buttonText: "Start reading",
20909
- // buttonOnClick: () => {},
20910
- // };
20911
- // const manyActions = {
20912
- // points: 150,
20913
- // cardTitle: "Spend $500 at our Store",
20914
- // goal: 500,
20915
- // repeatable: true,
20916
- // unit: "$",
20917
- // description:
20918
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20919
- // buttonText: "Visit our Store",
20920
- // buttonOnClick: () => {},
20921
- // };
20922
- // return (
20923
- // <div style={{ display: "inline-flex", gap: "32px" }}>
20924
- // <div style={resizable}>
20925
- // <h4>One Action</h4>
20926
- // <TaskCardView {...oneAction} /> <h5 />
20927
- // <TaskCardView {...oneAction} repeatable={1} complete /> <h5 />
20928
- // </div>
20929
- // <div style={resizable}>
20930
- // <h4>A Couple Actions</h4>
20931
- // <TaskCardView {...coupleActions} progress={1} /> <h5 />
20932
- // <TaskCardView {...coupleActions} progress={5} /> <h5 />
20933
- // <TaskCardView {...coupleActions} progress={7} /> <h5 />
20934
- // <TaskCardView {...coupleActions} progress={10} /> <h5 />
20935
- // <TaskCardView {...coupleActions} progress={12} /> <h5 />
20936
- // </div>
20937
- // <div style={resizable}>
20938
- // <h4>Many Actions</h4>
20939
- // <TaskCardView {...manyActions} progress={100} /> <h5 />
20940
- // <TaskCardView {...manyActions} progress={500} /> <h5 />
20941
- // <TaskCardView {...manyActions} progress={650} /> <h5 />
20942
- // <TaskCardView {...manyActions} progress={1000} /> <h5 />
20943
- // <TaskCardView {...manyActions} progress={1200} /> <h5 />
20944
- // </div>
20945
- // </div>
20946
- // );
20947
- // };
20948
- // export const RepeatableWithExpiry = () => {
20949
- // const oneAction = {
20950
- // points: 20,
20951
- // cardTitle: "Complete a survey",
20952
- // expire: "Nov 30, 2021",
20953
- // description:
20954
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20955
- // repeatable: 0,
20956
- // buttonText: "Take survey",
20957
- // buttonOnClick: () => {},
20958
- // };
20959
- // const coupleActions = {
20960
- // points: 40,
20961
- // cardTitle: "Comment on 5 articles",
20962
- // expire: "Nov 30, 2021",
20963
- // goal: 5,
20964
- // steps: 1,
20965
- // repeatable: true,
20966
- // description:
20967
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20968
- // buttonText: "Start reading",
20969
- // buttonOnClick: () => {},
20970
- // };
20971
- // const manyActions = {
20972
- // points: 150,
20973
- // cardTitle: "Spend $500 at our Store",
20974
- // expire: "Nov 30, 2021",
20975
- // goal: 500,
20976
- // repeatable: true,
20977
- // unit: "$",
20978
- // description:
20979
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20980
- // buttonText: "Visit our Store",
20981
- // buttonOnClick: () => {},
20982
- // };
20983
- // return (
20984
- // <div style={{ display: "inline-flex", gap: "32px" }}>
20985
- // <div style={resizable}>
20986
- // <h4>One Action</h4>
20987
- // <TaskCardView {...oneAction} /> <h5 />
20988
- // <TaskCardView {...oneAction} repeatable={1} complete /> <h5 />
20989
- // </div>
20990
- // <div style={resizable}>
20991
- // <h4>A Couple Actions</h4>
20992
- // <TaskCardView {...coupleActions} progress={1} /> <h5 />
20993
- // <TaskCardView {...coupleActions} progress={5} /> <h5 />
20994
- // <TaskCardView {...coupleActions} progress={7} /> <h5 />
20995
- // <TaskCardView {...coupleActions} progress={10} /> <h5 />
20996
- // <TaskCardView {...coupleActions} progress={12} /> <h5 />
20997
- // </div>
20998
- // <div style={resizable}>
20999
- // <h4>Many Actions</h4>
21000
- // <TaskCardView {...manyActions} progress={100} /> <h5 />
21001
- // <TaskCardView {...manyActions} progress={500} /> <h5 />
21002
- // <TaskCardView {...manyActions} progress={650} /> <h5 />
21003
- // <TaskCardView {...manyActions} progress={1000} /> <h5 />
21004
- // <TaskCardView {...manyActions} progress={1200} /> <h5 />
21005
- // </div>
21006
- // </div>
21007
- // );
21008
- // };
21009
- // export const ProgressBar = () => {
21010
- // const props = {
21011
- // goal: 5,
21012
- // };
21013
- // return (
21014
- // <div>
21015
- // <MatrixStory
21016
- // matrix={{ progress: [1, 2, 5], steps: [0, 1], repeatable: [false] }}
21017
- // props={props}
21018
- // Component={ProgressBarView}
21019
- // />
21020
- // <MatrixStory
21021
- // matrix={{ progress: [2, 5, 7, 12], steps: [0, 1], repeatable: [true] }}
21022
- // props={props}
21023
- // Component={ProgressBarView}
21024
- // />
21025
- // </div>
21026
- // );
21027
- // };
21028
-
21029
- const TaskCard = /*#__PURE__*/Object.freeze({
21829
+ };
21830
+
21831
+ const TaskCard$1 = /*#__PURE__*/Object.freeze({
21030
21832
  __proto__: null,
21031
21833
  'default': TaskCard_stories,
21032
- Default: Default$a,
21033
21834
  NotRepeatable: NotRepeatable,
21034
21835
  NotRepeatableWithExpiry: NotRepeatableWithExpiry,
21035
21836
  Repeatable: Repeatable,
21036
21837
  RepeatableWithExpiry: RepeatableWithExpiry
21037
21838
  });
21038
21839
 
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
+ },
21910
+ };
21911
+ const Default$a = () => {
21912
+ return h(ProgressBarView, null);
21913
+ };
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 })));
21922
+ };
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 })));
21953
+ };
21954
+
21955
+ const TaskCardProgressBar = /*#__PURE__*/Object.freeze({
21956
+ __proto__: null,
21957
+ 'default': progressBar_stories,
21958
+ Default: Default$a,
21959
+ ProgressBar: ProgressBar$1,
21960
+ ProgressBarSteps: ProgressBarSteps,
21961
+ ProgressBarRepeatable: ProgressBarRepeatable,
21962
+ ProgressBarStepsRepeatable: ProgressBarStepsRepeatable
21963
+ });
21964
+
21039
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";
21040
21966
 
21041
21967
  const portalLeadSubmitTemplate = "<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|\\brefer\\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=\"/refer\"\r\n icon=\"inbox\"\r\n label=\"Submit A Lead\"\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 <template path=\"/refer\">\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-referral-iframe></sqm-referral-iframe>\r\n </template>\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";
@@ -24048,7 +24974,7 @@ const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Gen
24048
24974
 
24049
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";
24050
24976
 
24051
- const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| -------------------------- | ---------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\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` |\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\n\n\n## Dependencies\n\n### Used by\n\n - [sqm-stencilbook](../sqm-stencilbook)\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n- [sqm-password-field](../sqm-password-field)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-register --> sqm-form-message\n sqm-portal-register --> sqm-password-field\n sqm-stencilbook --> sqm-portal-register\n style sqm-portal-register fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\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";
24052
24978
 
24053
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";
24054
24980
 
@@ -24272,12 +25198,12 @@ const PoweredByImg = /*#__PURE__*/Object.freeze({
24272
25198
  CustomWidthAndHeight: CustomWidthAndHeight
24273
25199
  });
24274
25200
 
24275
- 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";
24276
25202
 
24277
25203
  const PortalFooter_stories = {
24278
25204
  title: "Portal Footer",
24279
25205
  parameters: {
24280
- scenario: scenario$5,
25206
+ scenario: scenario$7,
24281
25207
  },
24282
25208
  };
24283
25209
  const defaultProps$9 = {
@@ -24306,12 +25232,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
24306
25232
  FooterNoPoweredBy: FooterNoPoweredBy
24307
25233
  });
24308
25234
 
24309
- 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 |";
24310
25236
 
24311
25237
  const Hero_stories = {
24312
25238
  title: "Hero Layout",
24313
25239
  parameters: {
24314
- scenario: scenario$6,
25240
+ scenario: scenario$8,
24315
25241
  },
24316
25242
  };
24317
25243
  const LoginOneColumn = () => {
@@ -24488,12 +25414,12 @@ const Hero = /*#__PURE__*/Object.freeze({
24488
25414
  TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
24489
25415
  });
24490
25416
 
24491
- 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 | |";
24492
25418
 
24493
25419
  const ReferralIframe_stories = {
24494
25420
  title: "Referral Iframe",
24495
25421
  parameters: {
24496
- scenario: scenario$7,
25422
+ scenario: scenario$9,
24497
25423
  },
24498
25424
  };
24499
25425
  const props = {
@@ -24524,12 +25450,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
24524
25450
  ReferralIframeError: ReferralIframeError
24525
25451
  });
24526
25452
 
24527
- 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";
24528
25454
 
24529
25455
  const NameFields_stories = {
24530
25456
  title: "Name Fields",
24531
25457
  parameters: {
24532
- scenario: scenario$8,
25458
+ scenario: scenario$a,
24533
25459
  },
24534
25460
  };
24535
25461
  const props$1 = {
@@ -24567,6 +25493,251 @@ const NameFields$1 = /*#__PURE__*/Object.freeze({
24567
25493
  NameFieldsWithErrors: NameFieldsWithErrors
24568
25494
  });
24569
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
+
24570
25741
  function deepFreeze(obj) {
24571
25742
  if (obj instanceof Map) {
24572
25743
  obj.clear = obj.delete = obj.set = function () {
@@ -27147,7 +28318,9 @@ const CucumberAddon = ({ story }, children) => {
27147
28318
  // No scenario or invalid. Ignoring.
27148
28319
  }
27149
28320
  return (h("div", null,
27150
- result && h("pre", { innerHTML: result.value }),
28321
+ h("details", null,
28322
+ h("summary", null, "Specs"),
28323
+ result && h("pre", { innerHTML: result.value })),
27151
28324
  children));
27152
28325
  };
27153
28326
 
@@ -27184,7 +28357,8 @@ const stories = [
27184
28357
  ReferralTableRewardsCell$1,
27185
28358
  UserName,
27186
28359
  PasswordField,
27187
- TaskCard,
28360
+ TaskCard$1,
28361
+ TaskCardProgressBar,
27188
28362
  PortalTemplates,
27189
28363
  ProgramMenu$1,
27190
28364
  PoweredByImg,
@@ -27192,7 +28366,10 @@ const stories = [
27192
28366
  Hero,
27193
28367
  ReferralIframe$1,
27194
28368
  NameFields$1,
28369
+ RewardExchangeList,
27195
28370
  UseRewardExchangeList,
28371
+ UseTaskCard,
28372
+ UseRewardsTable
27196
28373
  ];
27197
28374
  const StencilStorybook = class {
27198
28375
  constructor(hostRef) {
@@ -27232,6 +28409,77 @@ const TableRow = class {
27232
28409
  }
27233
28410
  };
27234
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
+
27235
28483
  const debug$2 = browser("sq:global");
27236
28484
  const textStyles = `
27237
28485
  sqm-text {
@@ -27357,4 +28605,4 @@ function useUserNameDemo(props) {
27357
28605
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
27358
28606
  }
27359
28607
 
27360
- 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, 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 };