@saasquatch/mint-components 1.3.2-1 → 1.3.2-13

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 (285) hide show
  1. package/dist/cjs/{ShadowViewAddon-75c18b96.js → ShadowViewAddon-a85b8c8d.js} +1 -1
  2. package/dist/cjs/{global-041b5338.js → global-6223fe8f.js} +110 -56
  3. package/dist/cjs/{index.module-6a7bda18.js → index.module-7dd4b981.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-6111d4bd.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} +1959 -766
  10. package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +1 -1
  11. package/dist/cjs/{index-19309631.js → sqm-leaderboard-rank-view-7dd44d62.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-6c7f78e6.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-08d1848c.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-69c73802.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-14b41436.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-2786227e.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-portal-register/sqm-portal-register.js +1 -1
  43. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +21 -0
  44. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +218 -0
  45. package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +5 -14
  46. package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +31 -43
  47. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +175 -100
  48. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +6 -8
  49. package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +10 -32
  50. package/dist/collection/components/sqm-rewards-table/UseRewardsTable.stories.js +53 -0
  51. package/dist/collection/components/sqm-rewards-table/sqm-rewards-table-column.js +120 -0
  52. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +11 -16
  53. package/dist/collection/components/{sqm-rewards-table → sqm-router}/Router.stories.js +0 -0
  54. package/dist/collection/components/sqm-share-button/sqm-share-button.js +1 -1
  55. package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +3 -1
  56. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +7 -1
  57. package/dist/collection/components/sqm-task-card/SVGs.js +0 -6
  58. package/dist/collection/components/sqm-task-card/TaskCard.stories.js +165 -389
  59. package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +41 -0
  60. package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +7 -0
  61. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +318 -0
  62. package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +93 -346
  63. package/dist/collection/components/sqm-task-card/sqm-task-card.js +127 -53
  64. package/dist/collection/global/styles.js +3 -0
  65. package/dist/collection/global/styles.ts +3 -0
  66. package/dist/collection/stories/NewPortal.stories.js +15 -15
  67. package/dist/esm/{ShadowViewAddon-fff5d35d.js → ShadowViewAddon-a3f510db.js} +1 -1
  68. package/dist/esm/{global-5ecbf81a.js → global-90da933f.js} +57 -3
  69. package/dist/esm/{index.module-f80561db.js → index.module-90d2c3ad.js} +2 -2
  70. package/dist/esm/loader.js +3 -4
  71. package/dist/esm/mint-components.js +3 -4
  72. package/dist/esm/{re-render-9ab5fe0f.js → re-render-e06f2f7f.js} +1 -1
  73. package/dist/esm/sqm-asset-card.entry.js +1 -1
  74. package/dist/esm/sqm-big-stat.entry.js +2 -2
  75. package/dist/esm/{sqm-divided-layout_27.entry.js → sqm-divided-layout_30.entry.js} +1939 -749
  76. package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
  77. package/dist/esm/{index-2f5dd0a1.js → sqm-leaderboard-rank-view-47844836.js} +9 -3
  78. package/dist/esm/sqm-leaderboard-rank.entry.js +3 -5
  79. package/dist/esm/sqm-leaderboard.entry.js +2 -2
  80. package/dist/esm/sqm-name-fields.entry.js +1 -1
  81. package/dist/esm/{sqm-navigation-sidebar-item-view-8a3f374b.js → sqm-navigation-sidebar-item-view-f2304ad9.js} +1 -1
  82. package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
  83. package/dist/esm/sqm-popup-container.entry.js +1 -1
  84. package/dist/esm/{sqm-portal-email-verification-view-90781be2.js → sqm-portal-email-verification-view-8cefe480.js} +1 -1
  85. package/dist/esm/sqm-portal-email-verification.entry.js +3 -4
  86. package/dist/esm/{sqm-portal-footer-view-c317518e.js → sqm-portal-footer-view-d9fe0bf8.js} +1 -1
  87. package/dist/esm/sqm-portal-footer.entry.js +3 -4
  88. package/dist/esm/sqm-portal-forgot-password.entry.js +1 -1
  89. package/dist/esm/sqm-portal-logout.entry.js +1 -1
  90. package/dist/esm/{sqm-portal-profile-view-824c8242.js → sqm-portal-profile-view-b67467b4.js} +1 -1
  91. package/dist/esm/sqm-portal-profile.entry.js +3 -4
  92. package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
  93. package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
  94. package/dist/esm/sqm-portal-verify-email.entry.js +1 -1
  95. package/dist/esm/sqm-referral-table-column.entry.js +2 -2
  96. package/dist/esm/sqm-referral-table-date-column.entry.js +2 -2
  97. package/dist/esm/sqm-referral-table-rewards-column.entry.js +2 -2
  98. package/dist/esm/sqm-referral-table-status-column.entry.js +2 -2
  99. package/dist/esm/sqm-referral-table-user-column.entry.js +2 -2
  100. package/dist/esm/sqm-share-code.entry.js +1 -1
  101. package/dist/esm/{useDemoBigStat-b71fe122.js → useDemoBigStat-c3b955b7.js} +117 -21
  102. package/dist/esm-es5/{ShadowViewAddon-fff5d35d.js → ShadowViewAddon-a3f510db.js} +1 -1
  103. package/dist/esm-es5/{global-5ecbf81a.js → global-90da933f.js} +16 -2
  104. package/dist/esm-es5/{index.module-f80561db.js → index.module-90d2c3ad.js} +1 -1
  105. package/dist/esm-es5/loader.js +1 -1
  106. package/dist/esm-es5/mint-components.js +1 -1
  107. package/dist/esm-es5/{re-render-9ab5fe0f.js → re-render-e06f2f7f.js} +1 -1
  108. package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
  109. package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
  110. package/dist/esm-es5/sqm-divided-layout_30.entry.js +1 -0
  111. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  112. package/dist/esm-es5/sqm-leaderboard-rank-view-47844836.js +1 -0
  113. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  114. package/dist/esm-es5/sqm-leaderboard.entry.js +1 -1
  115. package/dist/esm-es5/sqm-name-fields.entry.js +1 -1
  116. package/dist/esm-es5/{sqm-navigation-sidebar-item-view-8a3f374b.js → sqm-navigation-sidebar-item-view-f2304ad9.js} +1 -1
  117. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  118. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  119. package/dist/esm-es5/{sqm-portal-email-verification-view-90781be2.js → sqm-portal-email-verification-view-8cefe480.js} +1 -1
  120. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  121. package/dist/esm-es5/{sqm-portal-footer-view-c317518e.js → sqm-portal-footer-view-d9fe0bf8.js} +1 -1
  122. package/dist/esm-es5/sqm-portal-footer.entry.js +1 -1
  123. package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
  124. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  125. package/dist/esm-es5/{sqm-portal-profile-view-824c8242.js → sqm-portal-profile-view-b67467b4.js} +1 -1
  126. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  127. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  128. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  129. package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
  130. package/dist/esm-es5/sqm-referral-table-column.entry.js +1 -1
  131. package/dist/esm-es5/sqm-referral-table-date-column.entry.js +1 -1
  132. package/dist/esm-es5/sqm-referral-table-rewards-column.entry.js +1 -1
  133. package/dist/esm-es5/sqm-referral-table-status-column.entry.js +1 -1
  134. package/dist/esm-es5/sqm-referral-table-user-column.entry.js +1 -1
  135. package/dist/esm-es5/sqm-share-code.entry.js +1 -1
  136. package/dist/esm-es5/useDemoBigStat-c3b955b7.js +1 -0
  137. package/dist/mint-components/global/styles.ts +3 -0
  138. package/dist/mint-components/mint-components.css +1 -0
  139. package/dist/mint-components/mint-components.esm.js +1 -1
  140. package/dist/mint-components/mint-components.js +1 -1
  141. package/dist/mint-components/{p-3052c913.system.js → p-07c924fa.system.js} +1 -1
  142. package/dist/mint-components/{p-05cca77b.js → p-0eb3e89c.js} +1 -1
  143. package/dist/mint-components/{p-337b49ee.entry.js → p-160bd62f.entry.js} +1 -1
  144. package/dist/mint-components/p-16f5a7cb.system.js +1 -0
  145. package/dist/mint-components/{p-4ba2faf2.system.entry.js → p-1a09e4e1.system.entry.js} +1 -1
  146. package/dist/mint-components/p-1c8b0290.entry.js +1 -0
  147. package/dist/mint-components/{p-7c13e32e.system.entry.js → p-1dcdca58.system.entry.js} +1 -1
  148. package/dist/mint-components/p-20d41ab1.entry.js +1 -0
  149. package/dist/mint-components/{p-e9ab90a1.entry.js → p-221a4097.entry.js} +1 -1
  150. package/dist/mint-components/{p-a0045707.system.entry.js → p-223b42bd.system.entry.js} +1 -1
  151. package/dist/mint-components/{p-cc3510c8.js → p-224504ad.js} +1 -1
  152. package/dist/mint-components/{p-2a025d2a.system.entry.js → p-24b3c6f0.system.entry.js} +1 -1
  153. package/dist/mint-components/{p-1b414d8f.system.entry.js → p-24c9a599.system.entry.js} +1 -1
  154. package/dist/mint-components/{p-a7f0b2f6.entry.js → p-29fab29b.entry.js} +1 -1
  155. package/dist/mint-components/{p-e475a5ff.system.entry.js → p-304e6c82.system.entry.js} +1 -1
  156. package/dist/mint-components/{p-5f28af29.entry.js → p-3397167c.entry.js} +1 -1
  157. package/dist/mint-components/p-33c5ffb7.entry.js +1 -0
  158. package/dist/mint-components/{p-04516274.system.entry.js → p-396bf448.system.entry.js} +1 -1
  159. package/dist/mint-components/p-3b97aed8.system.js +1 -0
  160. package/dist/mint-components/{p-3b0acfcd.system.js → p-3ce2fb83.system.js} +1 -1
  161. package/dist/mint-components/{p-82d7a2ba.entry.js → p-3d856985.entry.js} +1 -1
  162. package/dist/mint-components/p-3f7218fb.entry.js +335 -0
  163. package/dist/mint-components/{p-af06ea5b.system.entry.js → p-4052b948.system.entry.js} +1 -1
  164. package/dist/mint-components/{p-57a53dbd.system.entry.js → p-412a9226.system.entry.js} +1 -1
  165. package/dist/mint-components/p-44d0fc80.system.entry.js +1 -0
  166. package/dist/mint-components/{p-844f9bad.entry.js → p-45c752a0.entry.js} +1 -1
  167. package/dist/mint-components/{p-f1e1086e.js → p-46a4269a.js} +17 -2
  168. package/dist/mint-components/p-52802c88.entry.js +13 -0
  169. package/dist/mint-components/p-5480e4ee.entry.js +1 -0
  170. package/dist/mint-components/{p-db723323.system.entry.js → p-55508395.system.entry.js} +1 -1
  171. package/dist/mint-components/{p-844fd903.js → p-563253e8.js} +1 -1
  172. package/dist/mint-components/p-60855d33.system.js +1 -0
  173. package/dist/mint-components/p-67ae18d1.system.entry.js +1 -0
  174. package/dist/mint-components/{p-434ee9c1.js → p-6882070c.js} +1 -1
  175. package/dist/mint-components/{p-1ac9c24b.system.entry.js → p-69bcf4fa.system.entry.js} +1 -1
  176. package/dist/mint-components/p-6bf0a4d9.system.entry.js +1 -0
  177. package/dist/mint-components/p-6e245fa3.system.entry.js +1 -0
  178. package/dist/mint-components/{p-a4a00461.entry.js → p-723ebe45.entry.js} +1 -1
  179. package/dist/mint-components/{p-5dfc6804.system.entry.js → p-73148868.system.entry.js} +1 -1
  180. package/dist/mint-components/{p-6cdc70f4.entry.js → p-8435a22d.entry.js} +1 -1
  181. package/dist/mint-components/p-883a32e7.entry.js +1 -0
  182. package/dist/mint-components/p-9c554ca0.system.js +1 -0
  183. package/dist/mint-components/{p-d3787c3a.entry.js → p-9d6dbb2d.entry.js} +1 -1
  184. package/dist/mint-components/p-9e4fee30.system.entry.js +1 -0
  185. package/dist/mint-components/{p-2bce988c.js → p-a2c3cff3.js} +1 -1
  186. package/dist/mint-components/{p-d9cc041f.entry.js → p-a4c2c7ed.entry.js} +1 -1
  187. package/dist/mint-components/{p-1813b9b9.system.js → p-a6094ff9.system.js} +1 -1
  188. package/dist/mint-components/{p-aba21f90.entry.js → p-ade44a4e.entry.js} +1 -1
  189. package/dist/mint-components/p-b1bb07db.entry.js +1 -0
  190. package/dist/mint-components/{p-ceeaf074.system.js → p-b608f7a4.system.js} +35 -21
  191. package/dist/mint-components/p-b6b4022a.system.entry.js +1 -0
  192. package/dist/mint-components/{p-2f171597.entry.js → p-b8bd2607.entry.js} +1 -1
  193. package/dist/mint-components/{p-0688c9c2.system.entry.js → p-be2738b0.system.entry.js} +1 -1
  194. package/dist/mint-components/{p-82ab88fe.system.js → p-c6114bfe.system.js} +1 -1
  195. package/dist/mint-components/{p-16535642.system.entry.js → p-c79c608d.system.entry.js} +1 -1
  196. package/dist/mint-components/{p-505f5c59.system.entry.js → p-cca9026f.system.entry.js} +1 -1
  197. package/dist/mint-components/{p-71d942af.entry.js → p-cd410a05.entry.js} +2 -2
  198. package/dist/mint-components/{p-a0cfd3d9.system.js → p-cdeae699.system.js} +1 -1
  199. package/dist/mint-components/{p-3fd33dee.system.entry.js → p-d174d0bc.system.entry.js} +1 -1
  200. package/dist/mint-components/p-d21e0dbd.js +1 -0
  201. package/dist/mint-components/{p-00190438.js → p-d35b0366.js} +1 -1
  202. package/dist/mint-components/{p-8e37c08d.js → p-db2e4c42.js} +1 -1
  203. package/dist/mint-components/p-dc603d08.system.entry.js +1 -0
  204. package/dist/mint-components/{p-1fb688a9.system.js → p-e7f633b9.system.js} +1 -1
  205. package/dist/mint-components/{p-16da5146.entry.js → p-f17050de.entry.js} +1 -1
  206. package/dist/mint-components/p-f90486ca.js +235 -0
  207. package/dist/mint-components/p-fce1dbf6.entry.js +1 -0
  208. package/dist/types/components/sqm-big-stat/UseBigStat.stories.d.ts +6 -0
  209. package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +1 -0
  210. package/dist/types/components/sqm-big-stat/useBigStat.d.ts +4 -1
  211. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +6 -0
  212. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +81 -0
  213. package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +1 -0
  214. package/dist/types/components/sqm-reward-exchange-list/progressBar.d.ts +3 -2
  215. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +3 -4
  216. package/dist/types/components/sqm-rewards-table/UseRewardsTable.stories.d.ts +16 -0
  217. package/dist/types/components/sqm-rewards-table/sqm-rewards-table-column.d.ts +20 -0
  218. package/dist/types/components/sqm-rewards-table/useRewardsTable.d.ts +33 -0
  219. package/dist/types/components/{sqm-rewards-table → sqm-router}/Router.stories.d.ts +0 -0
  220. package/dist/types/components/sqm-task-card/SVGs.d.ts +0 -1
  221. package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +12 -5
  222. package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +10 -0
  223. package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +1 -0
  224. package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +11 -0
  225. package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +13 -22
  226. package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +29 -14
  227. package/dist/types/components.d.ts +86 -36
  228. package/dist/types/global/styles.d.ts +1 -1
  229. package/grapesjs/grapesjs.js +1 -1
  230. package/package.json +1 -1
  231. package/dist/cjs/sqm-leaderboard-rank-view-35015d30.js +0 -10
  232. package/dist/cjs/sqm-rewards-table.cjs.entry.js +0 -332
  233. package/dist/cjs/sqm-task-card-view-57066e67.js +0 -476
  234. package/dist/cjs/sqm-task-card.cjs.entry.js +0 -56
  235. package/dist/cjs/tslib.es6-0e81fab1.js +0 -56
  236. package/dist/cjs/useChildElements-428ca5b8.js +0 -21
  237. package/dist/esm/sqm-leaderboard-rank-view-da91f5f3.js +0 -8
  238. package/dist/esm/sqm-rewards-table.entry.js +0 -328
  239. package/dist/esm/sqm-task-card-view-2ee495af.js +0 -474
  240. package/dist/esm/sqm-task-card.entry.js +0 -52
  241. package/dist/esm/tslib.es6-7ac9d7e4.js +0 -53
  242. package/dist/esm/useChildElements-506f00d0.js +0 -19
  243. package/dist/esm-es5/index-2f5dd0a1.js +0 -1
  244. package/dist/esm-es5/sqm-divided-layout_27.entry.js +0 -1
  245. package/dist/esm-es5/sqm-leaderboard-rank-view-da91f5f3.js +0 -1
  246. package/dist/esm-es5/sqm-rewards-table.entry.js +0 -1
  247. package/dist/esm-es5/sqm-task-card-view-2ee495af.js +0 -1
  248. package/dist/esm-es5/sqm-task-card.entry.js +0 -1
  249. package/dist/esm-es5/tslib.es6-7ac9d7e4.js +0 -15
  250. package/dist/esm-es5/useChildElements-506f00d0.js +0 -1
  251. package/dist/esm-es5/useDemoBigStat-b71fe122.js +0 -1
  252. package/dist/mint-components/p-11c75956.entry.js +0 -1
  253. package/dist/mint-components/p-189219ee.system.js +0 -1
  254. package/dist/mint-components/p-1e248afc.system.entry.js +0 -1
  255. package/dist/mint-components/p-21dfdeb8.entry.js +0 -1
  256. package/dist/mint-components/p-23a0bdae.entry.js +0 -1
  257. package/dist/mint-components/p-353b4413.system.js +0 -1
  258. package/dist/mint-components/p-405a9253.js +0 -227
  259. package/dist/mint-components/p-55e02769.entry.js +0 -13
  260. package/dist/mint-components/p-58d9b2f0.js +0 -15
  261. package/dist/mint-components/p-684850a7.entry.js +0 -287
  262. package/dist/mint-components/p-6d545e13.entry.js +0 -1
  263. package/dist/mint-components/p-70837c1c.entry.js +0 -49
  264. package/dist/mint-components/p-7c138c84.entry.js +0 -1
  265. package/dist/mint-components/p-7c261ea0.system.entry.js +0 -1
  266. package/dist/mint-components/p-8034f81c.system.entry.js +0 -1
  267. package/dist/mint-components/p-81dbda90.system.entry.js +0 -1
  268. package/dist/mint-components/p-8c16f04e.js +0 -1
  269. package/dist/mint-components/p-8f5e2af4.entry.js +0 -1
  270. package/dist/mint-components/p-91d39961.system.js +0 -1
  271. package/dist/mint-components/p-b3af1c6f.js +0 -1
  272. package/dist/mint-components/p-bf04a8e1.system.entry.js +0 -1
  273. package/dist/mint-components/p-bf055b6c.system.js +0 -1
  274. package/dist/mint-components/p-c3866bfa.system.entry.js +0 -1
  275. package/dist/mint-components/p-c9c4f31b.system.entry.js +0 -1
  276. package/dist/mint-components/p-dd6a666e.system.js +0 -15
  277. package/dist/mint-components/p-dfc3cf82.js +0 -1
  278. package/dist/mint-components/p-e19a57a4.system.entry.js +0 -1
  279. package/dist/mint-components/p-e22eed7b.entry.js +0 -1
  280. package/dist/mint-components/p-e2ebe90c.entry.js +0 -1
  281. package/dist/mint-components/p-e78a5a91.js +0 -1
  282. package/dist/mint-components/p-ecbabf6e.system.js +0 -1
  283. package/dist/mint-components/p-f41ab9e1.system.js +0 -1
  284. package/dist/mint-components/p-f87d8f53.system.js +0 -1
  285. 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-90da933f.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-90d2c3ad.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-47844836.js';
15
+ import { u as useRerenderListener, a as useRequestRerender } from './re-render-e06f2f7f.js';
16
+ import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-c3b955b7.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-a3f510db.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-f2304ad9.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-b67467b4.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-8cefe480.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-d9fe0bf8.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
@@ -14787,36 +14799,29 @@ const EXCHANGE = dist.gql `
14787
14799
  `;
14788
14800
  function useRewardExchangeList(props) {
14789
14801
  var _a, _b, _c, _d;
14790
- const drawerRef = useRef();
14791
14802
  const [exchangeState, setExchangeState] = useReducer((state, next) => ({
14792
14803
  ...state,
14793
14804
  ...next,
14794
14805
  }), {
14795
14806
  selectedItem: undefined,
14796
14807
  selectedStep: undefined,
14797
- redeemStage: "",
14808
+ redeemStage: "chooseReward",
14798
14809
  amount: 0,
14799
14810
  exchangeError: false,
14800
14811
  });
14801
14812
  const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
14802
14813
  const user = T$1();
14803
14814
  const [exchange, { data: exchangeResponse, errors }] = be(EXCHANGE);
14804
- const { data } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
14815
+ const { data, loading, refetch } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
14805
14816
  useEffect(() => {
14806
14817
  var _a, _b;
14807
14818
  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) {
14808
14819
  setExchangeState({ redeemStage: "success" });
14809
14820
  }
14810
14821
  if (!!errors) {
14811
- console.log("YEA");
14812
14822
  setExchangeState({ exchangeError: true });
14813
14823
  }
14814
14824
  }, [exchangeResponse, errors]);
14815
- function openDrawer() {
14816
- var _a;
14817
- setExchangeState({ redeemStage: "chooseReward" });
14818
- (_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.show();
14819
- }
14820
14825
  function exchangeReward() {
14821
14826
  if (!selectedItem)
14822
14827
  return;
@@ -14874,29 +14879,16 @@ function useRewardExchangeList(props) {
14874
14879
  }
14875
14880
  exchange({ exchangeRewardInput: exchangeVariables });
14876
14881
  }
14877
- const resetState = useCallback((e) => {
14878
- var _a, _b;
14879
- // selects also trigger an sl-hide event :(
14880
- //@ts-ignore - componentId is not private here
14881
- if (((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.componentId) !== ((_b = drawerRef.current) === null || _b === void 0 ? void 0 : _b.componentId))
14882
- return;
14882
+ const resetState = (refresh) => {
14883
+ refresh && refetch();
14883
14884
  setExchangeState({
14884
14885
  amount: 0,
14885
14886
  selectedStep: undefined,
14886
14887
  selectedItem: undefined,
14887
14888
  exchangeError: false,
14889
+ redeemStage: "chooseReward",
14888
14890
  });
14889
- }, []);
14890
- useEffect(() => {
14891
- if (!(drawerRef === null || drawerRef === void 0 ? void 0 : drawerRef.current))
14892
- return;
14893
- const drawer = drawerRef.current;
14894
- // Clear input value when drawer is closed
14895
- drawer.addEventListener("sl-hide", resetState);
14896
- return () => {
14897
- drawer.removeEventListener("sl-hide", resetState);
14898
- };
14899
- }, [drawerRef.current]);
14891
+ };
14900
14892
  function setStage(stage) {
14901
14893
  setExchangeState({ redeemStage: stage });
14902
14894
  }
@@ -14910,24 +14902,27 @@ function useRewardExchangeList(props) {
14910
14902
  amount,
14911
14903
  selectedStep,
14912
14904
  exchangeError,
14905
+ loading,
14913
14906
  },
14914
14907
  data: {
14915
14908
  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,
14916
- //@ts-ignore
14917
14909
  fuelTankCode: (_d = (_c = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _c === void 0 ? void 0 : _c.reward) === null || _d === void 0 ? void 0 : _d.fuelTankCode,
14918
14910
  },
14919
14911
  callbacks: {
14920
14912
  exchangeReward,
14921
- openDrawer,
14922
14913
  setExchangeState,
14923
14914
  setStage,
14924
- },
14925
- refs: {
14926
- drawerRef,
14915
+ resetState,
14927
14916
  },
14928
14917
  };
14929
14918
  }
14930
14919
 
14920
+ const ExchangeArrows = () => (h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14921
+ h("circle", { cx: "15", cy: "15", r: "15", fill: "white" }),
14922
+ 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" })));
14923
+ const CheckMark = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "7", viewBox: "0 0 10 7", fill: "none" },
14924
+ 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" })));
14925
+
14931
14926
  function Dot({ active, completed, incomplete, }) {
14932
14927
  return (h("div", { style: {
14933
14928
  flex: "0 0 0",
@@ -14947,63 +14942,47 @@ function Dot({ active, completed, incomplete, }) {
14947
14942
  h("div", { style: {
14948
14943
  backgroundColor: completed ? "#9E9E9E" : "#FFF",
14949
14944
  border: active
14950
- ? "2px solid #9E9E9E"
14945
+ ? "3px solid #9E9E9E"
14951
14946
  : incomplete
14952
- ? "2px solid #E5E5E5"
14953
- : "none",
14947
+ ? "3px solid #E5E5E5"
14948
+ : "3px solid #9E9E9E",
14954
14949
  borderRadius: "50%",
14955
- width: completed ? "12px" : "8px",
14956
- height: completed ? "12px" : "8px",
14957
- margin: "-4px auto 0px",
14950
+ width: "10px",
14951
+ height: "10px",
14952
+ margin: "-6px auto 0px",
14958
14953
  zIndex: "1",
14959
- } })));
14954
+ boxSizing: "content-box",
14955
+ } }, completed && (h("div", { style: { top: "-6px", position: "relative" } },
14956
+ h(CheckMark, null))))));
14957
+ }
14958
+ function ProgressLine({ incomplete = false, active = false }) {
14959
+ return (h("div", { style: {
14960
+ content: "''",
14961
+ flex: "0.5 0.5 0",
14962
+ height: "4px",
14963
+ borderRadius: "4px",
14964
+ background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
14965
+ position: "relative",
14966
+ bottom: "0",
14967
+ left: "0",
14968
+ display: "flex",
14969
+ justifyContent: "center",
14970
+ columnGap: "50px",
14971
+ marginRight: "-2px",
14972
+ boxSizing: "content-box",
14973
+ } }));
14960
14974
  }
14961
14975
  function Progress({ active, completed, incomplete }) {
14962
14976
  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
- } }),
14977
+ h(ProgressLine, { incomplete: incomplete }),
14978
14978
  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
- } }),
14979
+ h(ProgressLine, { incomplete: incomplete, active: active }),
14994
14980
  ];
14995
14981
  }
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 })));
14982
+ function ProgressBar({ stageCount, currentStage, }) {
14983
+ 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
14984
  }
15003
14985
 
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
14986
  const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
15008
14987
  const stageProgressList = {
15009
14988
  chooseReward: "Choose reward",
@@ -15013,38 +14992,43 @@ const stageProgressList = {
15013
14992
  function RewardExchangeView(props) {
15014
14993
  const style = {
15015
14994
  Container: {
14995
+ padding: "var(--sl-spacing-medium)",
15016
14996
  position: "relative",
15017
- display: "flex",
15018
14997
  },
15019
14998
  CardContainer: {
15020
- "&:hover": {
15021
- boxShadow: "0 3px 10px #87ceeb6e!important",
14999
+ "&:active": {
15000
+ //boxShadow: "0 3px 10px #87ceeb6e!important",
15022
15001
  },
15023
15002
  },
15024
15003
  Base: {
15025
- display: "block",
15004
+ display: "flex",
15026
15005
  cursor: "pointer",
15027
15006
  textAlign: "center",
15007
+ height: "120px",
15028
15008
  "&::part(base)": {
15009
+ boxShadow: "none",
15029
15010
  width: "100%",
15030
- height: "170px",
15011
+ // maxWidth: "350px",
15031
15012
  display: "flex",
15032
- justifyContent: "space-between",
15033
- alignItems: "center",
15013
+ margin: "0 auto",
15034
15014
  },
15035
15015
  "&::part(body)": {
15036
- padding: "10px 0",
15016
+ padding: 0,
15017
+ display: "flex",
15018
+ width: "100%",
15037
15019
  },
15038
15020
  },
15039
15021
  Drawer: {
15040
15022
  "&::part(base)": {
15041
15023
  minWidth: "400px",
15024
+ maxWidth: "700px",
15042
15025
  width: "50%",
15043
15026
  margin: "0 auto",
15044
15027
  right: "0",
15045
15028
  },
15046
15029
  "&::part(panel)": {
15047
15030
  height: "85vh",
15031
+ width: "100%",
15048
15032
  },
15049
15033
  },
15050
15034
  FullImage: {
@@ -15054,8 +15038,9 @@ function RewardExchangeView(props) {
15054
15038
  },
15055
15039
  PreviewImage: {
15056
15040
  objectFit: "contain",
15057
- maxWidth: "100%",
15058
- height: "75px",
15041
+ width: "120px",
15042
+ height: "120px",
15043
+ flex: 0.33,
15059
15044
  },
15060
15045
  InputBox: {
15061
15046
  width: "100%",
@@ -15070,8 +15055,9 @@ function RewardExchangeView(props) {
15070
15055
  },
15071
15056
  },
15072
15057
  Buttons: {
15073
- bottom: "0",
15058
+ marginLeft: "auto",
15074
15059
  width: "100%",
15060
+ maxWidth: "300px",
15075
15061
  },
15076
15062
  Button: {
15077
15063
  margin: "10px 0",
@@ -15079,12 +15065,57 @@ function RewardExchangeView(props) {
15079
15065
  textAlign: "center",
15080
15066
  cursor: "pointer",
15081
15067
  },
15068
+ ProgressBar: {
15069
+ fontSize: "80%",
15070
+ marginBottom: "20px",
15071
+ "& .text-area": {
15072
+ marginTop: "5px",
15073
+ display: "flex",
15074
+ justifyContent: "center",
15075
+ textAlign: "center",
15076
+ whiteSpace: "nowrap",
15077
+ marginBottom: "6px",
15078
+ "& .text": {
15079
+ flex: "1 1 0",
15080
+ },
15081
+ "& .text.subdued": {
15082
+ color: "#BDBDBD",
15083
+ },
15084
+ },
15085
+ },
15086
+ KutayCard: {
15087
+ "&::part(base)": {
15088
+ boxShadow: "none",
15089
+ },
15090
+ },
15091
+ KutayButton: {
15092
+ display: "flex",
15093
+ flexWrap: "wrap",
15094
+ margin: "var(--sl-spacing-medium) 0",
15095
+ "& .cancel": {
15096
+ width: "20%",
15097
+ marginLeft: "auto",
15098
+ marginRight: "var(--sl-spacing-medium)",
15099
+ "&::part(base)": {
15100
+ fontWeight: "var(--sl-font-weight-normal)",
15101
+ color: "var(--sl-color-neutral-1000)",
15102
+ },
15103
+ },
15104
+ "& .continue": {
15105
+ width: "20%",
15106
+ "&::part(base)": {
15107
+ background: "var(--sl-color-neutral-500)",
15108
+ fontWeight: "var(--sl-font-weight-normal)",
15109
+ color: "var(--sl-color-neutral-0)",
15110
+ },
15111
+ },
15112
+ },
15082
15113
  };
15083
15114
  // JSS config
15084
15115
  jss.setup(create());
15085
15116
  const sheet = jss.createStyleSheet(style);
15086
15117
  const styleString = sheet.toString();
15087
- const { states, data, callbacks, refs } = props;
15118
+ const { states, data, callbacks } = props;
15088
15119
  const { selectedItem, selectedStep } = states;
15089
15120
  function getInput() {
15090
15121
  var _a, _b;
@@ -15105,37 +15136,70 @@ function RewardExchangeView(props) {
15105
15136
  });
15106
15137
  } }, (_b = item.steps) === null || _b === void 0 ? void 0 : _b.map((step) => (h("sl-menu-item", { value: step, disabled: !step.available },
15107
15138
  step.prettyDestinationValue,
15108
- h("span", { slot: "suffix", style: { fontSize: "75%" } }, step.prettySourceValue))))));
15139
+ h("div", { slot: "suffix", style: { fontSize: "75%", float: "right" } },
15140
+ step.prettySourceValue,
15141
+ step.unavailableReasonCode && (h("p", { style: { fontSize: "70%", color: "#F2994A" } }, step.unavailableReasonCode))))))));
15109
15142
  }
15110
15143
  function chooseReward() {
15111
15144
  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) => {
15145
+ return [
15146
+ h("div", { style: {
15147
+ display: "grid",
15148
+ justifyContent: "center",
15149
+ gap: "20px",
15150
+ gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
15151
+ } }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
15125
15152
  const style = {
15126
- boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) ? "0 1px 8px #87ceeb" : "none",
15153
+ boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
15154
+ ? "0 0 0 2px var(--sl-color-primary-500)"
15155
+ : "none",
15127
15156
  marginBottom: "10px 0",
15157
+ borderRadius: "var(--sl-border-radius-medium)",
15128
15158
  flex: "1",
15129
- minWidth: "45%",
15159
+ minWidth: "100%",
15160
+ color: !item.available && "#eee",
15130
15161
  };
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 },
15162
+ const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
15163
+ ? item.prettySourceValue
15164
+ : `${item.sourceMinValue} to ${item.prettySourceMaxValue}`;
15165
+ return (h("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
15166
+ h("sl-card", { class: sheet.classes.Base, onClick: () => item.available &&
15167
+ callbacks.setExchangeState({ selectedItem: item }) },
15168
+ item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (h("div", { style: {
15169
+ width: "18px",
15170
+ height: "18px",
15171
+ borderRadius: "50%",
15172
+ background: "var(--sl-color-primary-500)",
15173
+ position: "relative",
15174
+ margin: "-9px",
15175
+ left: "350px",
15176
+ } },
15177
+ h("div", { style: { position: "relative", top: "-6px" } },
15178
+ h(CheckMark, null)))),
15179
+ // item?.imageUrl &&
15133
15180
  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
- }),
15136
- h("div", { class: sheet.classes.Buttons },
15137
- 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"))));
15181
+ h("p", { style: {
15182
+ textAlign: "left",
15183
+ margin: "0",
15184
+ flex: "1",
15185
+ fontSize: "90%",
15186
+ padding: "8px",
15187
+ } },
15188
+ h("b", null, item.description),
15189
+ h("p", { style: { margin: "0" } }, amount),
15190
+ item.unavailableReasonCode && (h("p", { style: {
15191
+ fontSize: "70%",
15192
+ color: "#F2994A",
15193
+ marginTop: "0",
15194
+ } }, item.unavailableReasonCode ===
15195
+ "INSUFFICIENT_REDEEMABLE_CREDIT"
15196
+ ? "Not enough points"
15197
+ : item.unavailableReasonCode))))));
15198
+ })),
15199
+ h("div", { class: sheet.classes.KutayButton },
15200
+ h("sl-button", { class: "cancel", size: "large", type: "text" }, "Cancel"),
15201
+ h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("chooseAmount"), disabled: !states.selectedItem }, "Continue")),
15202
+ ];
15139
15203
  }
15140
15204
  function chooseAmount() {
15141
15205
  const input = getInput();
@@ -15143,40 +15207,38 @@ function RewardExchangeView(props) {
15143
15207
  h("div", { style: { width: "50%", margin: "0 auto" } }, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) && (h("img", { class: sheet.classes.FullImage, src: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl }))),
15144
15208
  h("p", null, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description),
15145
15209
  h("div", { class: sheet.classes.InputBox }, input),
15146
- h("div", { class: sheet.classes.Buttons },
15147
- h("sl-button", { onClick: () => callbacks.setStage("confirmation"), disabled: input && !states.amount, style: { display: "block" }, class: sheet.classes.Button }, "Continue"),
15148
- h("a", { onClick: () => callbacks.setStage("chooseReward"), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
15210
+ h("div", { class: sheet.classes.KutayButton },
15211
+ h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, "Cancel"),
15212
+ h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: input && !states.amount }, "Continue to confirmation"))));
15149
15213
  }
15150
- console.log({ selectedItem, selectedStep });
15151
15214
  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";
15167
15215
  return (h("div", null,
15168
- h("h2", null, "Confirm your redemption:"),
15169
- redemptionAmount(),
15216
+ h("h2", null, "Confirm and redeem"),
15217
+ h("div", { style: { textAlign: "center" } },
15218
+ h("p", null,
15219
+ h("b", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue)),
15220
+ h("p", null,
15221
+ h(ExchangeArrows, null)),
15222
+ h("div", { class: sheet.classes.CardContainer, style: {
15223
+ boxShadow: "none",
15224
+ marginBottom: "10px",
15225
+ flex: "1",
15226
+ minWidth: "100%",
15227
+ } },
15228
+ h("sl-card", { class: sheet.classes.Base },
15229
+ h("img", { class: sheet.classes.PreviewImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
15230
+ getAssetPath("./assets/Reward-icon.png") }),
15231
+ h("p", { style: { marginBottom: "0", flex: "1" } }, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue)))),
15170
15232
  h("div", { class: sheet.classes.Buttons },
15171
15233
  h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
15172
- h("a", { onClick: () => callbacks.setStage(previousStage), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
15234
+ h("a", { onClick: () => callbacks.setStage("chooseAmount"), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
15173
15235
  }
15174
15236
  function success() {
15175
15237
  return (h("div", { style: { textAlign: "center" } },
15176
15238
  h("img", { class: sheet.classes.FullImage, src: getAssetPath("./assets/Reward-icon.png") }),
15177
15239
  h("p", { style: { color: "forestgreen" } }, "Reward Redeemed"),
15178
15240
  (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")));
15241
+ h("sl-button", { onClick: () => callbacks.resetState(true) }, "Done")));
15180
15242
  }
15181
15243
  const stages = {
15182
15244
  chooseReward: () => chooseReward(),
@@ -15187,51 +15249,43 @@ function RewardExchangeView(props) {
15187
15249
  const currentStage = stages[states.redeemStage];
15188
15250
  function stageMap() {
15189
15251
  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
- }))));
15252
+ return (h("div", { class: sheet.classes.ProgressBar },
15253
+ h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
15254
+ if (stage === states.redeemStage) {
15255
+ return h("span", { class: "text" }, stageProgressList[stage]);
15256
+ }
15257
+ else {
15258
+ return (h("span", { class: "text subdued" }, stageProgressList[stage]));
15259
+ }
15260
+ })),
15261
+ h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
15206
15262
  }
15207
- const Label = () => {
15208
- if (states.redeemStage === "success")
15209
- return "";
15210
- let previousStage = "";
15211
- if (states.redeemStage === "confirmation") {
15212
- previousStage =
15213
- (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
15214
- ? "chooseReward"
15215
- : "chooseAmount";
15216
- }
15217
- else if (states.redeemStage === "chooseAmount") {
15218
- previousStage = "chooseReward";
15219
- }
15220
- return (h("div", { slot: "label" },
15221
- h("a", { style: { cursor: "pointer", fontSize: "80%", color: "#858585" }, onClick: () => callbacks.setStage(previousStage) },
15222
- h(LeftArrow, null),
15223
- " Back")));
15224
- };
15263
+ // const BackButton = () => {
15264
+ // if (states.redeemStage === "success") return "";
15265
+ // let previousStage: Stages = "";
15266
+ // if (states.redeemStage === "confirmation") {
15267
+ // previousStage = "chooseAmount";
15268
+ // } else if (states.redeemStage === "chooseAmount") {
15269
+ // previousStage = "chooseReward";
15270
+ // }
15271
+ // return (
15272
+ // <div slot="label">
15273
+ // <a
15274
+ // style={{ cursor: "pointer", fontSize: "80%", color: "#858585" }}
15275
+ // onClick={() => callbacks.setStage(previousStage)}
15276
+ // >
15277
+ // <LeftArrow /> Back
15278
+ // </a>
15279
+ // </div>
15280
+ // );
15281
+ // };
15225
15282
  return (h("div", { class: sheet.classes.Container },
15226
15283
  h("style", { type: "text/css" }, styleString),
15227
15284
  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"))));
15285
+ stageMap(),
15286
+ currentStage && currentStage(),
15287
+ states.exchangeError &&
15288
+ "Something went wrong. Please contact support or try again.")));
15235
15289
  }
15236
15290
 
15237
15291
  const SqmRewardExchangeList = class {
@@ -15255,10 +15309,10 @@ const SqmRewardExchangeList = class {
15255
15309
  // if (missingProps) {
15256
15310
  // return <RequiredPropsError missingProps={missingProps} />;
15257
15311
  // }
15258
- const { states, data, callbacks, refs } = j$1()
15312
+ const { states, data, callbacks } = j$1()
15259
15313
  ? useRewardExchangeListDemo(getProps(this))
15260
15314
  : useRewardExchangeList(getProps(this));
15261
- return (h(Host, { style: { display: "contents" } }, h(RewardExchangeView, { states: states, data: data, callbacks: callbacks, refs: refs })));
15315
+ return (h(Host, { style: { display: "contents" } }, h(RewardExchangeView, { states: states, data: data, callbacks: callbacks })));
15262
15316
  }
15263
15317
  static get assetsDirs() { return ["assets"]; }
15264
15318
  };
@@ -15268,161 +15322,497 @@ function useRewardExchangeListDemo(props) {
15268
15322
  content: {
15269
15323
  text: props,
15270
15324
  },
15271
- redeemStage: "",
15325
+ redeemStage: "chooseReward",
15272
15326
  amount: 0,
15273
15327
  selectedStep: undefined,
15274
15328
  exchangeError: false,
15329
+ loading: false,
15275
15330
  },
15276
15331
  data: {
15277
15332
  shareCode: "SHARECODE123",
15278
15333
  },
15279
15334
  callbacks: {
15280
15335
  exchangeReward: () => { },
15281
- openDrawer: () => { },
15282
15336
  setExchangeState: (_) => { },
15283
15337
  setStage: (_) => { },
15284
- },
15285
- refs: {
15286
- drawerRef: {},
15338
+ resetState: () => { }
15287
15339
  },
15288
15340
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
15289
15341
  }
15290
15342
 
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
15343
  const style$7 = {
15384
- HostBlock: HostBlock,
15385
- buttonStyle: {
15386
- display: "block",
15344
+ THead: {
15345
+ padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
15346
+ "text-align": "left",
15347
+ },
15348
+ TCell: {
15349
+ padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
15350
+ },
15351
+ TRow: {
15352
+ "border-top": "1px solid #EAEAEA",
15353
+ },
15354
+ Table: {
15355
+ "border-collapse": "collapse",
15356
+ width: "100%",
15357
+ },
15358
+ ButtonContainer: {
15359
+ display: "flex",
15360
+ "justify-content": "flex-end",
15361
+ "margin-top": "var(--sl-spacing-small)",
15362
+ ...gap({ direction: "row", size: "var(--sl-spacing-small)" }),
15387
15363
  },
15388
15364
  };
15389
15365
  jss.setup(create());
15390
15366
  const sheet$7 = jss.createStyleSheet(style$7);
15391
15367
  const styleString$7 = sheet$7.toString();
15392
- function ShareButtonView(props, children) {
15393
- return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
15368
+ function GenericTableView(props) {
15369
+ const { states, data, callbacks, elements } = props;
15370
+ const { columns, rows } = elements;
15371
+ const { show } = states;
15372
+ return (h("div", null,
15394
15373
  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)));
15374
+ h("table", { class: sheet$7.classes.Table },
15375
+ data.textOverrides.showLabels && (h("thead", null,
15376
+ h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column) => (h("th", { class: sheet$7.classes.THead },
15377
+ h(TextSpanView, { type: "h3" }, column))))))),
15378
+ h("tbody", null,
15379
+ show === "loading" && elements.loadingElement,
15380
+ show === "empty" && elements.emptyElement,
15381
+ show === "rows" && (rows === null || rows === void 0 ? void 0 : rows.map((row, i) => (h("tr", { class: sheet$7.classes.TRow, style: {
15382
+ borderTop: `${!data.textOverrides.showLabels && i === 0 ? "none" : ""}`,
15383
+ }, part: "table-row" }, row.map((cell) => (h("td", { class: sheet$7.classes.TCell },
15384
+ h(TextSpanView, { type: "p" }, cell)))))))))),
15385
+ h("div", { class: sheet$7.classes.ButtonContainer, part: states.namespace + "-button-wrapper" },
15386
+ h("sl-button", { size: "small", disabled: !states.hasPrev, loading: show === "loading", onClick: callbacks.prevPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.prevLabel),
15387
+ h("sl-button", { size: "small", loading: show === "loading", disabled: !states.hasNext, onClick: callbacks.nextPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.moreLabel))));
15388
+ }
15389
+
15390
+ function LoadingSlot$1() {
15391
+ return (h("slot", { name: "loading" },
15392
+ h(LoadingSkeleton, null)));
15393
+ }
15394
+ function LoadingSkeleton() {
15395
+ return (h("div", { style: { width: "100%" } },
15396
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15397
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15398
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15399
+ h("sl-skeleton", { style: { marginBottom: "28px" } }),
15400
+ h("sl-skeleton", null)));
15401
+ }
15402
+ function EmptySlot$1({ label }) {
15403
+ return (h("slot", { name: "empty" },
15404
+ h(EmptySkeleton, { label: label })));
15405
+ }
15406
+ function EmptySkeleton({ label }) {
15407
+ return (h("div", { style: { width: "100%" } },
15408
+ h("sqm-text", null,
15409
+ h("h3", { style: { color: "#777777" } }, label))));
15398
15410
  }
15399
15411
 
15400
- const MessageLinkQuery = gql `
15401
- query (
15402
- $programId: ID
15403
- $engagementMedium: UserEngagementMedium!
15404
- $shareMedium: ReferralShareMedium!
15412
+ const CSS_NAMESPACE = "sqm-rewards-table";
15413
+ const GET_REWARDS = gql `
15414
+ query getRewards(
15415
+ $limit: Int!
15416
+ $offset: Int!
15417
+ $rewardFilter: RewardFilterInput
15405
15418
  ) {
15406
15419
  viewer {
15407
15420
  ... on User {
15408
- messageLink(
15409
- programId: $programId
15410
- engagementMedium: $engagementMedium
15411
- shareMedium: $shareMedium
15412
- )
15413
- shareLink(programId: $programId, engagementMedium: $engagementMedium)
15414
- }
15415
- }
15416
- }
15417
- `;
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
15421
+ id
15422
+ rewards(limit: $limit, offset: $offset, filter: $rewardFilter) {
15423
+ totalCount
15424
+ count
15425
+ data {
15426
+ id
15427
+ type
15428
+ value
15429
+ unit
15430
+ name
15431
+ dateGiven
15432
+ dateExpires
15433
+ dateCancelled
15434
+ dateRedeemed
15435
+ dateScheduledFor
15436
+ fuelTankCode
15437
+ fuelTankType
15438
+ currency
15439
+ prettyValue
15440
+ statuses
15441
+ globalRewardKey
15442
+ programRewardKey
15443
+ rewardRedemptionTransactions {
15444
+ data {
15445
+ exchangedRewards {
15446
+ data {
15447
+ prettyValue
15448
+ type
15449
+ fuelTankCode
15450
+ globalRewardKey
15451
+ }
15452
+ }
15453
+ }
15454
+ }
15455
+ }
15456
+ }
15457
+ }
15458
+ }
15459
+ }
15460
+ `;
15461
+ function useRewardsTable(props, emptyElement, loadingElement) {
15462
+ var _a, _b;
15463
+ const user = T$1();
15464
+ const programIdContext = M$1();
15465
+ // Default to context, overriden by props
15466
+ const programId = (_a = props.programId) !== null && _a !== void 0 ? _a : programIdContext;
15467
+ const rewardFilter = {
15468
+ userId_eq: user === null || user === void 0 ? void 0 : user.id,
15469
+ accountId_eq: user === null || user === void 0 ? void 0 : user.accountId,
15470
+ // If no program ID, shows all programs
15471
+ ...(programId
15472
+ ? programId === "classic"
15473
+ ? { programId_exists: false }
15474
+ : { programId_eq: programId }
15475
+ : {}),
15476
+ };
15477
+ const [content, setContent] = useReducer((state, next) => ({
15478
+ ...state,
15479
+ ...next,
15480
+ }), {
15481
+ columns: [],
15482
+ rows: [],
15483
+ loading: false,
15484
+ page: 0,
15485
+ });
15486
+ 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; }, {
15487
+ limit: props.perPage,
15488
+ offset: 0,
15489
+ }, {
15490
+ rewardFilter,
15491
+ }, !(user === null || user === void 0 ? void 0 : user.jwt));
15492
+ const tick = useRerenderListener();
15493
+ const components = useChildElements();
15494
+ const data = rewardsData === null || rewardsData === void 0 ? void 0 : rewardsData.data;
15495
+ async function getComponentData(components) {
15496
+ // filter out loading and empty states from columns array
15497
+ const columnComponents = components.filter((component) => component.slot !== "loading" && component.slot !== "empty");
15498
+ // get the column titles (renderLabel is asynchronous)
15499
+ const columnsPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderLabel()));
15500
+ // get the column cells (renderCell is asynchronous)
15501
+ const cellsPromise = data === null || data === void 0 ? void 0 : data.map(async (r) => {
15502
+ const cellPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderCell([r], c)));
15503
+ const cells = await Promise.all(cellPromise);
15504
+ return cells;
15505
+ });
15506
+ const rows = cellsPromise && (await Promise.all(cellsPromise)).filter((i) => i);
15507
+ setContent({ rows });
15508
+ const columns = columnsPromise && (await Promise.all(columnsPromise));
15509
+ // Set the content to render and finish loading components
15510
+ setContent({ columns, loading: false, page: states.currentPage });
15511
+ }
15512
+ useEffect(() => {
15513
+ setContent({ loading: true });
15514
+ rewardsData && getComponentData(components);
15515
+ }, [rewardsData, components, tick]);
15516
+ 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);
15517
+ console.log(states.loading, content.loading, rewardsData);
15518
+ const show =
15519
+ // 1 - Loading if loading
15520
+ states.loading || content.loading
15521
+ ? "loading"
15522
+ : // 2 - Empty if empty
15523
+ isEmpty
15524
+ ? "empty"
15525
+ : // 3 - Then show rows
15526
+ "rows";
15527
+ return {
15528
+ states: {
15529
+ hasNext: states.currentPage < states.pageCount - 1,
15530
+ hasPrev: states.currentPage > 0,
15531
+ show,
15532
+ namespace: CSS_NAMESPACE,
15533
+ },
15534
+ data: {
15535
+ textOverrides: {
15536
+ showLabels: props.showLabels,
15537
+ prevLabel: props.prevLabel,
15538
+ moreLabel: props.moreLabel,
15539
+ },
15540
+ },
15541
+ elements: {
15542
+ columns: content.columns,
15543
+ rows: content.rows,
15544
+ emptyElement,
15545
+ loadingElement,
15546
+ },
15547
+ callbacks: {
15548
+ nextPage: () => {
15549
+ callbacks.setCurrentPage(states.currentPage + 1);
15550
+ },
15551
+ prevPage: () => {
15552
+ callbacks.setCurrentPage(states.currentPage - 1);
15553
+ },
15554
+ },
15555
+ };
15556
+ }
15557
+ function generateUserError$1(e) {
15558
+ try {
15559
+ return JSON.stringify(e);
15560
+ }
15561
+ catch (e) {
15562
+ return "An unknown error";
15563
+ }
15564
+ }
15565
+ async function tryMethod$1(c, callback) {
15566
+ const tag = c.tagName.toLowerCase();
15567
+ await customElements.whenDefined(tag);
15568
+ let labelPromise;
15569
+ try {
15570
+ labelPromise = callback();
15571
+ }
15572
+ catch (e) {
15573
+ // renderLabel did not return a promise, so this method probably doesn't exist
15574
+ // therefore, we IGNORE the label
15575
+ if (callback.name === "renderReferrerCell") {
15576
+ console.error("column does not have a renderReferrerCell method.");
15577
+ }
15578
+ else {
15579
+ console.error("label promise failed", e);
15580
+ }
15581
+ return h("span", null);
15582
+ }
15583
+ try {
15584
+ return await labelPromise;
15585
+ }
15586
+ catch (e) {
15587
+ // The column returned a promise, and that promise failed.
15588
+ // This should not happen so we fail fast
15589
+ console.error("Error rendering label", e);
15590
+ const userError = generateUserError$1(e);
15591
+ return (h("details", null,
15592
+ h("summary", null, "Error"),
15593
+ userError));
15594
+ }
15595
+ }
15596
+
15597
+ const RewardsTable = class {
15598
+ constructor(hostRef) {
15599
+ registerInstance(this, hostRef);
15600
+ /** @uiName Number of rewards per page */
15601
+ this.perPage = 3;
15602
+ /** @uiName Show column labels */
15603
+ this.showLabels = true;
15604
+ /** @uiName Previous button text */
15605
+ this.prevLabel = "Prev";
15606
+ /** @uiName View More button text */
15607
+ this.moreLabel = "Next";
15608
+ /** @uiName Show Referred by user in table */
15609
+ this.showReferrer = false;
15610
+ h$1(this);
15611
+ }
15612
+ disconnectedCallback() { }
15613
+ render() {
15614
+ const empty = h(EmptySlot$1, { label: "No Rewards Yet" });
15615
+ const loading = h(LoadingSlot$1, null);
15616
+ const { states, data, callbacks, elements } = j$1()
15617
+ ? useRewardsTableDemo(this)
15618
+ : useRewardsTable(this, empty, loading);
15619
+ return (h(GenericTableView, { states: states, data: data, callbacks: callbacks, elements: elements }));
15620
+ }
15621
+ };
15622
+ function useRewardsTableDemo(props) {
15623
+ return cjs({
15624
+ states: {
15625
+ hasPrev: false,
15626
+ hasNext: false,
15627
+ loading: false,
15628
+ namespace: CSS_NAMESPACE,
15629
+ },
15630
+ callbacks: {
15631
+ prevPage: () => console.log("Prev"),
15632
+ nextPage: () => console.log("Next"),
15633
+ },
15634
+ data: {
15635
+ textOverrides: {
15636
+ showLabels: props.showLabels,
15637
+ prevLabel: props.prevLabel,
15638
+ moreLabel: props.moreLabel,
15639
+ },
15640
+ referralData: [],
15641
+ },
15642
+ elements: {
15643
+ emptyElement: h(EmptySkeleton, { label: "No Rewards Yet" }),
15644
+ loadingElement: h(LoadingSkeleton, null),
15645
+ // TODO: This should be smarter
15646
+ columns: [h("div", null, "Name"), h("div", null, "Email"), h("div", null, "DOB")],
15647
+ rows: [],
15648
+ },
15649
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
15650
+ }
15651
+
15652
+ const RewardsTableColumn = class {
15653
+ constructor(hostRef) {
15654
+ registerInstance(this, hostRef);
15655
+ /**
15656
+ * @uiName Reward column title
15657
+ */
15658
+ this.columnTitle = "Rewards";
15659
+ /**
15660
+ * @uiName Hide dropdown details of reward
15661
+ */
15662
+ this.hideDetails = false;
15663
+ h$1(this);
15664
+ }
15665
+ disconnectedCallback() { }
15666
+ //@ts-ignore
15667
+ async renderCell(data) {
15668
+ // TODO: Do the right thing with many rewards, pending rewards, canceled rewards
15669
+ console.log({ data });
15670
+ return (h("sqm-referral-table-rewards-cell", { rewards: data, hideDetails: this.hideDetails }));
15671
+ }
15672
+ async renderLabel() {
15673
+ return this.columnTitle;
15674
+ }
15675
+ render() {
15676
+ useRequestRerender([this.columnTitle]);
15677
+ return h(Host, { style: { display: "none" } });
15678
+ }
15679
+ };
15680
+
15681
+ const debug$1 = browser("sq:useRouter");
15682
+ function matchPath(pattern, page) {
15683
+ if (!pattern)
15684
+ return;
15685
+ const regexp = pathToRegexp(pattern);
15686
+ return regexp.exec(page);
15687
+ }
15688
+ function useRouter() {
15689
+ const location = an();
15690
+ const host = P$1();
15691
+ const [slot, setSlot] = useState(undefined);
15692
+ const [container, setContainer] = useState(undefined);
15693
+ const page = location.pathname;
15694
+ // convert sqm-routes into templates
15695
+ useEffect(() => {
15696
+ const routes = host.querySelectorAll(`sqm-route`);
15697
+ const routesArray = Array.from(routes);
15698
+ routesArray.forEach((route) => {
15699
+ const newTemplate = document.createElement("template");
15700
+ newTemplate.setAttribute("path", route.path);
15701
+ newTemplate.innerHTML = route.innerHTML;
15702
+ route.parentNode.appendChild(newTemplate);
15703
+ route.parentNode.removeChild(route);
15704
+ });
15705
+ }, []);
15706
+ useEffect(() => {
15707
+ var _a, _b;
15708
+ if (!container || !slot) {
15709
+ debug$1("DOM not ready for navigation rendering on:", page);
15710
+ return;
15711
+ }
15712
+ // <template>
15713
+ const templates = slot.querySelectorAll(`template`);
15714
+ const templatesArray = Array.from(templates);
15715
+ const template = templatesArray.find((template) => {
15716
+ var _a, _b, _c;
15717
+ //@ts-ignore
15718
+ const path = (_b = (_a = template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
15719
+ if ((_c = matchPath(path, page)) === null || _c === void 0 ? void 0 : _c.length)
15720
+ return template;
15721
+ });
15722
+ //@ts-ignore - can't access template attributes directly
15723
+ 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;
15724
+ debug$1({
15725
+ containerDatasetPage: container.dataset.page,
15726
+ templatePath,
15727
+ page,
15728
+ });
15729
+ // if no routes found, and the old route doesn't match the new route
15730
+ if (!template) {
15731
+ // No matching page, display nothing
15732
+ debug$1("No matching page found for ", page, ", so render nothing");
15733
+ container.innerHTML = "";
15734
+ container.dataset.page = page;
15735
+ return;
15736
+ }
15737
+ debug$1("Page updated to ", page, template);
15738
+ // if pathToRegexp results truthy or page is an exact match
15739
+ if (!!matchPath(templatePath, container.dataset.page)) {
15740
+ debug$1("don't rerender");
15741
+ // Same page, do not re-render
15742
+ // Reduces dom mutations, speeds up page speed
15743
+ }
15744
+ else if (template) {
15745
+ container.innerHTML = template.innerHTML;
15746
+ container.dataset.page = page;
15747
+ }
15748
+ }, [slot, container, page]);
15749
+ return {
15750
+ callbacks: {
15751
+ setSlot,
15752
+ setContainer,
15753
+ },
15754
+ };
15755
+ }
15756
+
15757
+ const sqmRouterCss = "sqm-router{display:contents}";
15758
+
15759
+ const SqmRouter = class {
15760
+ constructor(hostRef) {
15761
+ registerInstance(this, hostRef);
15762
+ this.ignored = true;
15763
+ h$1(this);
15764
+ }
15765
+ disconnectedCallback() { }
15766
+ render() {
15767
+ const { callbacks } = useRouter();
15768
+ return (h(Host, null, h("div", { ref: callbacks.setSlot, style: { display: "none" } }, h("slot", null)), h("div", { style: { display: "contents" }, ref: callbacks.setContainer })));
15769
+ }
15770
+ };
15771
+ SqmRouter.style = sqmRouterCss;
15772
+
15773
+ const style$8 = {
15774
+ HostBlock: HostBlock,
15775
+ buttonStyle: {
15776
+ display: "block",
15777
+ },
15778
+ };
15779
+ jss.setup(create());
15780
+ const sheet$8 = jss.createStyleSheet(style$8);
15781
+ const styleString$8 = sheet$8.toString();
15782
+ function ShareButtonView(props, children) {
15783
+ return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
15784
+ h("style", { type: "text/css" }, styleString$8),
15785
+ 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` },
15786
+ !props.hideicon && (h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
15787
+ !props.hidetext && children)));
15788
+ }
15789
+
15790
+ const MessageLinkQuery = gql `
15791
+ query (
15792
+ $programId: ID
15793
+ $engagementMedium: UserEngagementMedium!
15794
+ $shareMedium: ReferralShareMedium!
15795
+ ) {
15796
+ viewer {
15797
+ ... on User {
15798
+ messageLink(
15799
+ programId: $programId
15800
+ engagementMedium: $engagementMedium
15801
+ shareMedium: $shareMedium
15802
+ )
15803
+ shareLink(programId: $programId, engagementMedium: $engagementMedium)
15804
+ }
15805
+ }
15806
+ }
15807
+ `;
15808
+ function NativeShare(props, directLink) {
15809
+ const title = props.sharetitle || "Share title";
15810
+ const text = props.sharetext || "Share text";
15811
+ if (directLink === "undefined") {
15812
+ return alert("error: message link undefined!");
15813
+ }
15814
+ if (window.navigator.share) {
15815
+ window.navigator
15426
15816
  .share({
15427
15817
  title,
15428
15818
  text,
@@ -17130,11 +17520,12 @@ const BigStat_stories = {
17130
17520
  title: "Components/Big Stat",
17131
17521
  };
17132
17522
  const Default$1 = () => {
17133
- const props = { statvalue: "9.900,00" };
17523
+ const props = { value: 990000, statvalue: "9.900,00" };
17134
17524
  return h(BigStatView, Object.assign({}, props), "Big stat");
17135
17525
  };
17136
17526
  const LeftAlign = () => {
17137
17527
  const props = {
17528
+ value: 500,
17138
17529
  statvalue: "500",
17139
17530
  alignment: "left",
17140
17531
  };
@@ -17142,6 +17533,7 @@ const LeftAlign = () => {
17142
17533
  };
17143
17534
  const RightAlign = () => {
17144
17535
  const props = {
17536
+ value: 500,
17145
17537
  statvalue: "500",
17146
17538
  alignment: "right",
17147
17539
  };
@@ -17149,6 +17541,7 @@ const RightAlign = () => {
17149
17541
  };
17150
17542
  const FlexReverse = () => {
17151
17543
  const props = {
17544
+ value: 500,
17152
17545
  statvalue: "500",
17153
17546
  flexReverse: true,
17154
17547
  };
@@ -17156,6 +17549,7 @@ const FlexReverse = () => {
17156
17549
  };
17157
17550
  const FlexReverseRight = () => {
17158
17551
  const props = {
17552
+ value: 500,
17159
17553
  statvalue: "500",
17160
17554
  flexReverse: true,
17161
17555
  alignment: "right",
@@ -17164,6 +17558,7 @@ const FlexReverseRight = () => {
17164
17558
  };
17165
17559
  const FlexReverseLeft = () => {
17166
17560
  const props = {
17561
+ value: 500,
17167
17562
  statvalue: "500",
17168
17563
  flexReverse: true,
17169
17564
  alignment: "left",
@@ -17172,12 +17567,14 @@ const FlexReverseLeft = () => {
17172
17567
  };
17173
17568
  const NoStatValue = () => {
17174
17569
  const props = {
17570
+ value: 0,
17175
17571
  statvalue: "...",
17176
17572
  };
17177
17573
  return h(BigStatView, Object.assign({}, props), "Big stat");
17178
17574
  };
17179
17575
  const InvalidStatValue = () => {
17180
17576
  const props = {
17577
+ value: 0,
17181
17578
  statvalue: "!!!",
17182
17579
  };
17183
17580
  return h(BigStatView, Object.assign({}, props), "Big stat");
@@ -17903,6 +18300,9 @@ const RewardBalanceCashUSD = createHookStory(() => {
17903
18300
  const ProgramGoals = createHookStory(() => {
17904
18301
  const dummy = encodeURIComponent("Paid-Member-Goal/referrals");
17905
18302
  return View(`/programGoals/count/${dummy}`, "/(programGoals)/:metricType/:goalId");
18303
+ });
18304
+ const CustomField = createHookStory(() => {
18305
+ return View(`/customFields/thingCount`, "/(customFields)/:customField");
17906
18306
  });
17907
18307
 
17908
18308
  const UseBigStat = /*#__PURE__*/Object.freeze({
@@ -17934,7 +18334,8 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
17934
18334
  RewardsAvailableWithSlash: RewardsAvailableWithSlash,
17935
18335
  RewardBalance: RewardBalance,
17936
18336
  RewardBalanceCashUSD: RewardBalanceCashUSD,
17937
- ProgramGoals: ProgramGoals
18337
+ ProgramGoals: ProgramGoals,
18338
+ CustomField: CustomField
17938
18339
  });
17939
18340
 
17940
18341
  function setupGraphQL$4() {
@@ -18241,18 +18642,100 @@ const UseRewardExchangeList = /*#__PURE__*/Object.freeze({
18241
18642
  VariableCreditReward: VariableCreditReward
18242
18643
  });
18243
18644
 
18645
+ const UseRewardsTable_stories = {
18646
+ title: "Hooks / useRewardsTable",
18647
+ };
18648
+ function setupGraphQL$7() {
18649
+ const id = "testestest";
18650
+ const accountId = id;
18651
+ //@ts-ignore
18652
+ window.widgetIdent = {
18653
+ tenantAlias: "test_a8b41jotf8a1v",
18654
+ appDomain: "https://staging.referralsaasquatch.com",
18655
+ };
18656
+ useEffect(() => {
18657
+ L$1({
18658
+ accountId,
18659
+ id,
18660
+ jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
18661
+ });
18662
+ return () => {
18663
+ window.widgetIdent = undefined;
18664
+ L$1(undefined);
18665
+ };
18666
+ }, []);
18667
+ return { id, accountId };
18668
+ }
18669
+ const RewardsTableWithProgram = createHookStory(() => {
18670
+ setupGraphQL$7();
18671
+ A$1("sam-partner-test-2");
18672
+ return (h("sqm-rewards-table", null,
18673
+ h("sqm-rewards-table-column", null)));
18674
+ });
18675
+ const RewardsTableNoProgram = createHookStory(() => {
18676
+ setupGraphQL$7();
18677
+ A$1(undefined);
18678
+ return (h("sqm-rewards-table", null,
18679
+ h("sqm-rewards-table-column", null)));
18680
+ });
18681
+
18682
+ const UseRewardsTable = /*#__PURE__*/Object.freeze({
18683
+ __proto__: null,
18684
+ 'default': UseRewardsTable_stories,
18685
+ RewardsTableWithProgram: RewardsTableWithProgram,
18686
+ RewardsTableNoProgram: RewardsTableNoProgram
18687
+ });
18688
+
18689
+ const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
18690
+ const UseTaskCard_stories = {
18691
+ title: "Hooks / useTaskCard",
18692
+ };
18693
+ function setupGraphQL$8() {
18694
+ const id = "sam+klip@saasquat.ch";
18695
+ const accountId = id;
18696
+ const programId = "klip-referral-program";
18697
+ //@ts-ignore
18698
+ window.widgetIdent = {
18699
+ tenantAlias: "test_a74miwdpofztj",
18700
+ appDomain: "https://staging.referralsaasquatch.com",
18701
+ programId,
18702
+ };
18703
+ useEffect(() => {
18704
+ L$1({
18705
+ accountId,
18706
+ id,
18707
+ jwt: JWT,
18708
+ });
18709
+ return () => {
18710
+ window.widgetIdent = undefined;
18711
+ L$1(undefined);
18712
+ };
18713
+ }, []);
18714
+ return { id, accountId };
18715
+ }
18716
+ const TaskCard = createHookStory(() => {
18717
+ setupGraphQL$8();
18718
+ return (h("sqm-task-card", { "card-title": "Comment on 5 articles", "button-text": "Start reading", goal: 5, steps: true, "show-progress-bar": true }));
18719
+ });
18720
+
18721
+ const UseTaskCard = /*#__PURE__*/Object.freeze({
18722
+ __proto__: null,
18723
+ 'default': UseTaskCard_stories,
18724
+ TaskCard: TaskCard
18725
+ });
18726
+
18244
18727
  const NewPortal_stories = {
18245
18728
  title: "New Portal",
18246
18729
  };
18247
- const style$8 = {
18730
+ const style$9 = {
18248
18731
  HeaderSubtitleBold: {
18249
18732
  "font-weight": 500,
18250
18733
  "text-decoration": "underline",
18251
18734
  },
18252
18735
  };
18253
18736
  jss.setup(create());
18254
- const sheet$8 = jss.createStyleSheet(style$8);
18255
- const styleString$8 = sheet$8.toString();
18737
+ const sheet$9 = jss.createStyleSheet(style$9);
18738
+ const styleString$9 = sheet$9.toString();
18256
18739
  const barProps = {
18257
18740
  data: {
18258
18741
  programs: [
@@ -18347,7 +18830,7 @@ const Dashboard = () => {
18347
18830
  hide: false,
18348
18831
  };
18349
18832
  return (h("sqm-divided-layout", { direction: "row" },
18350
- h("style", { type: "text/css" }, styleString$8),
18833
+ h("style", { type: "text/css" }, styleString$9),
18351
18834
  h(Sidebar, null),
18352
18835
  h("sqm-divided-layout", { direction: "column" },
18353
18836
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18360,10 +18843,10 @@ const Dashboard = () => {
18360
18843
  h("h1", null, "John Smith"))),
18361
18844
  })),
18362
18845
  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"))),
18846
+ h(BigStatView, Object.assign({}, { statvalue: "2,345", value: 234500 }), "Clicks"),
18847
+ h(BigStatView, Object.assign({}, { statvalue: "58", value: 58 }), "Referrals"),
18848
+ h(BigStatView, Object.assign({}, { statvalue: "$10,540", value: 1054000 }), "Earned"),
18849
+ h(BigStatView, Object.assign({}, { statvalue: "$2,305", value: 230500 }), "Awaiting Payout"))),
18367
18850
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
18368
18851
  h(PortalSectionView, Object.assign({}, {
18369
18852
  labelMargin: "x-large",
@@ -18405,7 +18888,7 @@ const Dashboard = () => {
18405
18888
  };
18406
18889
  const EditProfile$2 = () => {
18407
18890
  return (h("sqm-divided-layout", { direction: "row" },
18408
- h("style", { type: "text/css" }, styleString$8),
18891
+ h("style", { type: "text/css" }, styleString$9),
18409
18892
  h(Sidebar, null),
18410
18893
  h("sqm-divided-layout", { direction: "column" },
18411
18894
  h(PortalProfileView, Object.assign({}, {
@@ -18469,7 +18952,7 @@ const EditProfile$2 = () => {
18469
18952
  };
18470
18953
  const Commissions = () => {
18471
18954
  return (h("sqm-divided-layout", { direction: "row" },
18472
- h("style", { type: "text/css" }, styleString$8),
18955
+ h("style", { type: "text/css" }, styleString$9),
18473
18956
  h(Sidebar, null),
18474
18957
  h("sqm-divided-layout", { direction: "column" },
18475
18958
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18482,19 +18965,19 @@ const Commissions = () => {
18482
18965
  h("p", null,
18483
18966
  "for the",
18484
18967
  " ",
18485
- h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
18968
+ h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
18486
18969
  " ",
18487
18970
  "program"))),
18488
18971
  })),
18489
18972
  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"))))));
18973
+ h(BigStatView, Object.assign({}, { statvalue: "$ 1,000", value: 100000 }), "Total Earned"),
18974
+ h(BigStatView, Object.assign({}, { statvalue: "$ 800", value: 80000 }), "Available"),
18975
+ h(BigStatView, Object.assign({}, { statvalue: "$ 180", value: 18000 }), "Pending"),
18976
+ h(BigStatView, Object.assign({}, { statvalue: "$ 20", value: 2000 }), "Redeemed"))))));
18494
18977
  };
18495
18978
  const Activity = () => {
18496
18979
  return (h("sqm-divided-layout", { direction: "row" },
18497
- h("style", { type: "text/css" }, styleString$8),
18980
+ h("style", { type: "text/css" }, styleString$9),
18498
18981
  h(Sidebar, null),
18499
18982
  h("sqm-divided-layout", { direction: "column" },
18500
18983
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
@@ -18507,7 +18990,7 @@ const Activity = () => {
18507
18990
  h("p", null,
18508
18991
  "for the",
18509
18992
  " ",
18510
- h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
18993
+ h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
18511
18994
  " ",
18512
18995
  "program"))),
18513
18996
  })),
@@ -18517,10 +19000,10 @@ const Activity = () => {
18517
19000
  label: (h("sqm-text", null,
18518
19001
  h("h3", null, "Referral Activity"))),
18519
19002
  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"))),
19003
+ h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 100000 }), "Total Referrals"),
19004
+ h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "Converted"),
19005
+ h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "Pending"),
19006
+ h(BigStatView, Object.assign({}, { statvalue: "20", value: 20 }), "Disqualified"))),
18524
19007
  }))),
18525
19008
  h(PortalSectionView, Object.assign({}, {
18526
19009
  labelMargin: "x-large",
@@ -18528,9 +19011,9 @@ const Activity = () => {
18528
19011
  label: (h("sqm-text", null,
18529
19012
  h("h3", null, "Traffic Generated"))),
18530
19013
  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"))),
19014
+ h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 1000 }), "Clicks"),
19015
+ h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "From share link"),
19016
+ h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "From share mediums"))),
18534
19017
  })))));
18535
19018
  };
18536
19019
 
@@ -20535,8 +21018,613 @@ const PasswordField = /*#__PURE__*/Object.freeze({
20535
21018
  ValidationError: ValidationError
20536
21019
  });
20537
21020
 
21021
+ /**
21022
+ * Displays a cartesian product of the input props
21023
+ *
21024
+ * @returns
21025
+ */
21026
+ function MatrixStory({ matrix, props, Component, }) {
21027
+ const propMatrix = Object.keys(matrix).map((propKey) => {
21028
+ const propValues = matrix[propKey];
21029
+ return propValues.map((val) => {
21030
+ return {
21031
+ [propKey]: val,
21032
+ };
21033
+ });
21034
+ });
21035
+ const combinations = cartesian(...propMatrix);
21036
+ const propsCombinations = combinations.map((combo) => {
21037
+ return combo.reduce((props, prop) => {
21038
+ return {
21039
+ ...props,
21040
+ ...prop,
21041
+ };
21042
+ }, {});
21043
+ });
21044
+ return propsCombinations.map((combo) => {
21045
+ const example = { ...props, ...combo };
21046
+ return (h("div", null,
21047
+ h(PropsTable, { values: example }),
21048
+ h("hr", null),
21049
+ h(Component, Object.assign({}, example))));
21050
+ });
21051
+ }
21052
+ function PropsTable({ values }) {
21053
+ return (h("table", null,
21054
+ h("tbody", null, Object.keys(values).map((key) => {
21055
+ return (h("tr", null,
21056
+ h("th", null, key),
21057
+ h("td", null, JSON.stringify(values[key]))));
21058
+ }))));
21059
+ }
21060
+ /**
21061
+ * Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
21062
+ *
21063
+ * TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
21064
+ *
21065
+ * @param args - an array of arrays
21066
+ * @returns combinations of the elements in those array
21067
+ */
21068
+ function cartesian(...args) {
21069
+ var r = [], max = args.length - 1;
21070
+ function helper(arr, i) {
21071
+ for (var j = 0, l = args[i].length; j < l; j++) {
21072
+ var a = arr.slice(0); // clone arr
21073
+ a.push(args[i][j]);
21074
+ if (i == max)
21075
+ r.push(a);
21076
+ else
21077
+ helper(a, i + 1);
21078
+ }
21079
+ }
21080
+ helper([], 0);
21081
+ return r;
21082
+ }
21083
+
21084
+ const checkmark_circle = () => {
21085
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
21086
+ 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" })));
21087
+ };
21088
+ const arrow_left_right = () => {
21089
+ return (h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
21090
+ 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" })));
21091
+ };
21092
+
21093
+ const gift = () => {
21094
+ return (h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
21095
+ 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)" }),
21096
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
21097
+ 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)" })));
21098
+ };
21099
+
21100
+ function ProgressBarView(props) {
21101
+ const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, expired = false, } = props;
21102
+ console.log("progress bar props", props);
21103
+ const gift1 = gift();
21104
+ const gift2 = gift();
21105
+ const gift3 = gift();
21106
+ var items = [];
21107
+ var columns = "";
21108
+ var repetitions = Math.floor(progress / goal);
21109
+ if (repeatable) {
21110
+ if (steps) {
21111
+ addStepsRepeatable();
21112
+ }
21113
+ else {
21114
+ addLinearRepeatable();
21115
+ }
21116
+ }
21117
+ // non repeatable
21118
+ else {
21119
+ if (steps) {
21120
+ addSteps();
21121
+ }
21122
+ else {
21123
+ addLinear();
21124
+ }
21125
+ }
21126
+ const style = {
21127
+ ProgressBar: {
21128
+ "& .progress-bar": {
21129
+ height: "15px",
21130
+ marginTop: steps
21131
+ ? "var(--sl-spacing-medium)"
21132
+ : "var(--sl-spacing-large)",
21133
+ filter: expired ? "grayscale(1)" : "",
21134
+ marginBottom: "var(--sl-spacing-xx-large)",
21135
+ marginRight: "var(--sl-spacing-x-small)",
21136
+ fontSize: "var(--sl-font-size-x-small)",
21137
+ display: "grid",
21138
+ gridTemplateColumns: columns,
21139
+ lineHeight: "45px",
21140
+ userSelect: "none",
21141
+ },
21142
+ "& .progress-bar.repeatable-steps": {
21143
+ marginLeft: "var(--sl-spacing-x-small)",
21144
+ },
21145
+ "& .filled:after": {
21146
+ content: '""',
21147
+ display: "flex",
21148
+ width: "100%",
21149
+ height: "4px",
21150
+ borderRadius: "4px",
21151
+ backgroundColor: complete
21152
+ ? "var(--sl-color-success-500)"
21153
+ : "var(--sl-color-primary-500)",
21154
+ },
21155
+ "& .progress": {
21156
+ display: "block",
21157
+ textAlign: "center",
21158
+ marginLeft: "-100px",
21159
+ marginRight: "-100px",
21160
+ },
21161
+ "& .progress::after": {
21162
+ content: '""',
21163
+ width: "12px",
21164
+ height: "12px",
21165
+ display: "flex",
21166
+ backgroundColor: complete
21167
+ ? "var(--sl-color-success-500)"
21168
+ : "var(--sl-color-primary-500)",
21169
+ borderRadius: "50%",
21170
+ position: "relative",
21171
+ left: "47%",
21172
+ top: "-85%",
21173
+ },
21174
+ "& .progress.bg:after": {
21175
+ width: "0",
21176
+ height: "0",
21177
+ border: "none",
21178
+ },
21179
+ "& .progress.top": {
21180
+ position: "relative",
21181
+ top: "-40px",
21182
+ },
21183
+ "& .progress.top:after": {
21184
+ top: "-16%",
21185
+ },
21186
+ "& .empty": {
21187
+ display: "block",
21188
+ textAlign: "center",
21189
+ marginLeft: "-100px",
21190
+ marginRight: "-100px",
21191
+ },
21192
+ "& .empty::after": {
21193
+ content: '""',
21194
+ width: "12px",
21195
+ height: "12px",
21196
+ border: "2px solid #E0E0E0",
21197
+ margin: "-2px",
21198
+ display: "flex",
21199
+ backgroundColor: "white",
21200
+ borderRadius: "50%",
21201
+ position: "relative",
21202
+ left: "47%",
21203
+ top: "-85%",
21204
+ },
21205
+ "& .empty.bg:after": {
21206
+ width: "0",
21207
+ height: "0",
21208
+ border: "none",
21209
+ },
21210
+ "& .remain:after": {
21211
+ content: '""',
21212
+ display: "flex",
21213
+ width: "100%",
21214
+ height: "4px",
21215
+ borderRadius: "4px",
21216
+ backgroundColor: "#E0E0E0",
21217
+ },
21218
+ "& .gift.bw": {
21219
+ filter: "grayscale(100%)",
21220
+ },
21221
+ "& .gift.start": {
21222
+ transform: "scale(80%)",
21223
+ top: "-20px",
21224
+ },
21225
+ "& .gift": {
21226
+ textAlign: "center",
21227
+ marginLeft: "-100px",
21228
+ marginRight: "-100px",
21229
+ position: "relative",
21230
+ display: "list-item",
21231
+ listStyleType: "none",
21232
+ top: "-18px",
21233
+ filter: goal <= progress ? "" : "grayscale(100%)",
21234
+ zIndex: "1",
21235
+ },
21236
+ },
21237
+ };
21238
+ jss.setup(create());
21239
+ const sheet = jss.createStyleSheet(style);
21240
+ const styleString = sheet.toString();
21241
+ return (h("div", { class: sheet.classes.ProgressBar },
21242
+ h("style", { type: "text/css" }, styleString),
21243
+ h("div", { class: repetitions > 1 ? "progress-bar repeatable-steps" : "progress-bar" }, items)));
21244
+ function clamp(x, min, max) {
21245
+ return Math.min(Math.max(x, min), max);
21246
+ }
21247
+ function addLinear() {
21248
+ const ratio = progress / goal;
21249
+ columns =
21250
+ clamp(ratio, 0, 1) + "fr 0fr " + clamp(1 - ratio, 0, 1) + "fr 0fr 0fr";
21251
+ items.push(h("div", { class: "filled" }));
21252
+ items.push(h("div", { class: clamp(progress, 0, goal) == goal ? "progress top bg" : "progress top" }, clamp(progress, 0, goal) == goal
21253
+ ? ""
21254
+ : progressBarUnit + clamp(progress, 0, goal)));
21255
+ items.push(h("div", { class: "remain" }));
21256
+ items.push(h("div", { class: "progress bg" }, goal));
21257
+ items.push(h("div", { class: "gift" }, gift1));
21258
+ }
21259
+ function addSteps() {
21260
+ let ratio = 1 / goal;
21261
+ for (let i = 1; i < goal; i++) {
21262
+ columns += ratio + "fr 0fr ";
21263
+ if (i > progress) {
21264
+ items.push(h("div", { class: "remain" }));
21265
+ items.push(h("div", { class: "empty" }, i));
21266
+ }
21267
+ else {
21268
+ items.push(h("div", { class: "filled" }));
21269
+ items.push(h("div", { class: "progress" }, i));
21270
+ }
21271
+ }
21272
+ columns += ratio + "fr 0fr ";
21273
+ // reward success
21274
+ if (goal <= progress) {
21275
+ columns += "0fr ";
21276
+ items.push(h("div", { class: "filled" }));
21277
+ items.push(h("div", { class: "progress bg" }, goal));
21278
+ items.push(h("div", { class: "gift" }, gift1));
21279
+ }
21280
+ // reward fail
21281
+ else {
21282
+ columns += "0fr ";
21283
+ items.push(h("div", { class: "remain" }));
21284
+ items.push(h("div", { class: "empty bg" }, goal));
21285
+ items.push(h("div", { class: "gift" }, gift1));
21286
+ }
21287
+ }
21288
+ function addLinearRepeatable() {
21289
+ let repetitions = Math.floor(progress / goal);
21290
+ let ratio = ((progress % goal) / goal) * 0.5;
21291
+ // 0 repetition
21292
+ if (repetitions == 0) {
21293
+ columns = ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr 0.5fr 0fr 0fr";
21294
+ items.push(h("div", { class: "filled" }));
21295
+ items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progressBarUnit + progress));
21296
+ items.push(h("div", { class: "remain" }));
21297
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
21298
+ items.push(h("div", { class: "gift" }, gift1));
21299
+ items.push(h("div", { class: "remain" }));
21300
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
21301
+ items.push(h("div", { class: "gift bw" }, gift2));
21302
+ }
21303
+ // single repetition
21304
+ else if (repetitions == 1) {
21305
+ columns =
21306
+ "0.5fr 0fr 0fr " + ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr";
21307
+ items.push(h("div", { class: "filled" }));
21308
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
21309
+ items.push(h("div", { class: "gift" }, gift1));
21310
+ items.push(h("div", { class: "filled" }));
21311
+ items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progress == goal ? "" : progressBarUnit + progress));
21312
+ items.push(h("div", { class: "remain" }));
21313
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
21314
+ items.push(h("div", { class: "gift bw" }, gift2));
21315
+ }
21316
+ // multiple repetitions
21317
+ else {
21318
+ columns =
21319
+ "0fr 0fr 0.5fr 0fr 0fr " +
21320
+ ratio +
21321
+ "fr 0fr " +
21322
+ (0.5 - ratio) +
21323
+ "fr 0fr 0fr";
21324
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions - 1)));
21325
+ items.push(h("div", { class: "gift start" }, gift1));
21326
+ items.push(h("div", { class: "filled" }));
21327
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * repetitions));
21328
+ items.push(h("div", { class: "gift" }, gift2));
21329
+ items.push(h("div", { class: "filled" }));
21330
+ items.push(h("div", { class: progress == goal * repetitions ? "progress top bg" : "progress top" }, progress == goal * repetitions ? "" : progressBarUnit + progress));
21331
+ items.push(h("div", { class: "remain" }));
21332
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions + 1)));
21333
+ items.push(h("div", { class: "gift bw" }, gift3));
21334
+ }
21335
+ }
21336
+ function addStepsRepeatable() {
21337
+ let repetitions = Math.floor(progress / goal);
21338
+ // no or single repetition
21339
+ if (repetitions < 2) {
21340
+ let ratio = 1 / goal;
21341
+ for (let i = 1; i < goal * 2 + 1; i++) {
21342
+ columns += ratio + "fr 0fr ";
21343
+ if (i > progress) {
21344
+ if (i == goal) {
21345
+ columns += "0fr ";
21346
+ items.push(h("div", { class: "remain" }));
21347
+ items.push(h("div", { class: "empty bg" }, goal));
21348
+ items.push(h("div", { class: "gift bw" }, gift1));
21349
+ }
21350
+ else if (i == goal * 2) {
21351
+ columns += "0fr 0fr";
21352
+ items.push(h("div", { class: "remain" }));
21353
+ items.push(h("div", { class: "empty bg" }, goal * 2));
21354
+ items.push(h("div", { class: "gift bw" }, gift2));
21355
+ }
21356
+ else {
21357
+ items.push(h("div", { class: "remain" }));
21358
+ items.push(h("div", { class: "empty" }, i));
21359
+ }
21360
+ }
21361
+ else if (i == goal) {
21362
+ columns += "0fr ";
21363
+ items.push(h("div", { class: "filled" }));
21364
+ items.push(h("div", { class: "progress bg" }, i));
21365
+ items.push(h("div", { class: "gift" }, gift3));
21366
+ }
21367
+ else {
21368
+ items.push(h("div", { class: "filled" }));
21369
+ items.push(h("div", { class: "progress" }, i));
21370
+ }
21371
+ }
21372
+ }
21373
+ // case repetition many
21374
+ else {
21375
+ let position = (progress % goal) + goal;
21376
+ let ratio = 1 / goal;
21377
+ columns += "0fr 0fr ";
21378
+ items.push(h("div", { class: "progress bg" }, goal * (repetitions - 1)));
21379
+ items.push(h("div", { class: "gift start" }, gift1));
21380
+ for (let i = 1; i < goal * 2 + 1; i++) {
21381
+ columns += ratio + "fr 0fr ";
21382
+ if (i <= goal) {
21383
+ if (i == goal) {
21384
+ columns += "0fr ";
21385
+ items.push(h("div", { class: "filled" }));
21386
+ items.push(h("div", { class: "progress bg" }, i + goal * (repetitions - 1)));
21387
+ items.push(h("div", { class: "gift" }, gift2));
21388
+ }
21389
+ else {
21390
+ items.push(h("div", { class: "filled" }));
21391
+ items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
21392
+ }
21393
+ }
21394
+ else if (i > position) {
21395
+ if (i == goal * 2) {
21396
+ columns += "0fr 0fr";
21397
+ items.push(h("div", { class: "remain" }));
21398
+ items.push(h("div", { class: "empty bg" }, i + goal * (repetitions - 1)));
21399
+ items.push(h("div", { class: "gift bw" }, gift3));
21400
+ }
21401
+ else {
21402
+ items.push(h("div", { class: "remain" }));
21403
+ items.push(h("div", { class: "empty" }, i + goal * (repetitions - 1)));
21404
+ }
21405
+ }
21406
+ else {
21407
+ items.push(h("div", { class: "filled" }));
21408
+ items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
21409
+ }
21410
+ }
21411
+ }
21412
+ }
21413
+ }
21414
+
21415
+ function TaskCardView(props) {
21416
+ console.log({ props });
21417
+ const checkmark_circle$1 = checkmark_circle();
21418
+ const arrow_left_right$1 = arrow_left_right();
21419
+ const style = {
21420
+ HostBlock: HostBlock,
21421
+ TaskCard: {
21422
+ "& .main > div": {
21423
+ margin: "var(--sl-spacing-medium)",
21424
+ },
21425
+ "& .main": {
21426
+ position: "relative",
21427
+ boxSizing: "border-box",
21428
+ minWidth: "347px",
21429
+ background: "var(--sl-color-neutral-0)",
21430
+ border: "1px solid var(--sl-color-neutral-300)",
21431
+ borderRadius: "var(--sl-border-radius-medium)",
21432
+ fontSize: "var(--sl-font-size-small)",
21433
+ lineHeight: "var(--sl-line-height-dense)",
21434
+ color: "var(--sl-color-neutral-600)",
21435
+ },
21436
+ "& .main.complete": {
21437
+ background: "var(--sl-color-success-50)",
21438
+ borderColor: "var(--sl-color-success-700)",
21439
+ },
21440
+ "& .main.expired": {
21441
+ color: "var(--sl-color-neutral-400)",
21442
+ background: "var(--sl-color-neutral-100)",
21443
+ },
21444
+ "& .title": {
21445
+ fontSize: "var(--sl-font-size-small)",
21446
+ fontWeight: "var(--sl-font-weight-semibold)",
21447
+ },
21448
+ "& .black": {
21449
+ color: "var(--sl-color-neutral-1000)",
21450
+ },
21451
+ },
21452
+ Header: {
21453
+ display: "flex",
21454
+ "& .icon": {
21455
+ alignSelf: "center",
21456
+ lineHeight: "0",
21457
+ color: "var(--sl-color-success-700)",
21458
+ fontSize: "var(--sl-font-size-large)",
21459
+ marginRight: "var(--sl-spacing-x-small)",
21460
+ },
21461
+ "& .value": {
21462
+ alignSelf: "center",
21463
+ fontSize: "var(--sl-font-size-x-large)",
21464
+ fontWeight: "var(--sl-font-weight-semibold)",
21465
+ lineHeight: "100%",
21466
+ marginRight: "var(--sl-spacing-xx-small)",
21467
+ },
21468
+ "& .text": {
21469
+ alignSelf: "end",
21470
+ textTransform: "uppercase",
21471
+ fontSize: "var(--sl-font-size-x-small)",
21472
+ lineHeight: "var(--sl-font-size-medium)",
21473
+ marginRight: "var(--sl-spacing-xx-small)",
21474
+ },
21475
+ "& .end": {
21476
+ color: "var(--sl-color-warning-600)",
21477
+ fontWeight: "var(--sl-font-weight-semibold)",
21478
+ marginBottom: "var(--sl-spacing-xx-small)",
21479
+ },
21480
+ "& .black": {
21481
+ color: "var(--sl-color-neutral-1000)",
21482
+ },
21483
+ "& .neutral": {
21484
+ color: "var(--sl-color-neutral-400)",
21485
+ },
21486
+ },
21487
+ Footer: {
21488
+ display: "flex",
21489
+ "& .icon": {
21490
+ fontSize: "var(--sl-font-size-xx-small)",
21491
+ marginRight: "var(--sl-spacing-xx-small)",
21492
+ },
21493
+ "& .text": {
21494
+ marginTop: "auto",
21495
+ verticalAlign: "text-bottom",
21496
+ fontSize: "var(--sl-font-size-x-small)",
21497
+ },
21498
+ "& .success": {
21499
+ color: "var(--sl-color-success-600)",
21500
+ fontWeight: "var(--sl-font-weight-semibold)",
21501
+ },
21502
+ "& .action": {
21503
+ marginTop: "auto",
21504
+ marginLeft: "auto",
21505
+ "&::part(base)": {
21506
+ color: "var(--sl-color-neutral-0)",
21507
+ borderRadius: "var(--sl-border-radius-medium)",
21508
+ },
21509
+ "&.disabled::part(base)": {
21510
+ border: "1px solid var(--sl-color-neutral-400)",
21511
+ background: "var(--sl-color-neutral-400)",
21512
+ },
21513
+ },
21514
+ "& .neutral": {
21515
+ color: "var(--sl-color-neutral-400)",
21516
+ },
21517
+ },
21518
+ };
21519
+ jss.setup(create());
21520
+ const sheet = jss.createStyleSheet(style);
21521
+ const styleString = sheet.toString();
21522
+ const showComplete = props.progress >= props.goal;
21523
+ const repetitions = props.showProgressBar
21524
+ ? Math.floor(props.progress / props.goal)
21525
+ : props.progress;
21526
+ const taskComplete = showComplete && props.repeatable === false;
21527
+ const dateExpire = props.showExpiry && luxon.DateTime.fromISO(props.dateExpires.split("/").pop());
21528
+ const taskExpired = props.showExpiry && luxon.DateTime.now() > dateExpire;
21529
+ const dateExpireText = dateExpire.toLocaleString(luxon.DateTime.DATE_FULL);
21530
+ console.log(taskExpired);
21531
+ return (h("div", { class: sheet.classes.TaskCard },
21532
+ h("div", { class: taskExpired ? "main expired" : taskComplete ? "main complete" : "main" },
21533
+ h("style", { type: "text/css" }, styleString),
21534
+ h("div", { class: sheet.classes.Header }, props.loading ? (h("sl-skeleton", { style: { width: "22%", margin: "0" } })) : (h("div", null,
21535
+ taskExpired && (h("div", { class: "end" },
21536
+ " ",
21537
+ "Ended " + dateExpireText,
21538
+ " ")),
21539
+ showComplete && (h("span", { class: taskExpired ? "icon neutral" : "icon" }, checkmark_circle$1)),
21540
+ h("span", { class: taskExpired ? "value" : "value black" }, props.rewardAmount),
21541
+ h("span", { class: "text" }, props.rewardUnit)))),
21542
+ props.loading ? (h("sl-skeleton", { style: { width: "42%", margin: "0 16px" } })) : (h("div", { class: taskExpired ? "title" : "title black" }, props.cardTitle)),
21543
+ props.loading ? (h("sl-skeleton", { style: { width: "91%", margin: "12px 16px" } })) : (h(Details, Object.assign({}, props))),
21544
+ props.showProgressBar && props.loading ? (h("sl-skeleton", { style: { width: "91%", margin: "0 auto" } })) : (props.showProgressBar && (h(ProgressBarView, Object.assign({}, props, { complete: taskComplete, expired: taskExpired })))),
21545
+ h("div", { class: sheet.classes.Footer }, props.loading ? (h("sl-skeleton", { style: { width: "25%", marginLeft: "auto" } })) : (h("div", { style: { display: "contents" } },
21546
+ h("span", { class: "text" },
21547
+ props.repeatable && (h("div", null,
21548
+ h("span", { class: repetitions > 0
21549
+ ? taskExpired
21550
+ ? "icon neutral"
21551
+ : "icon success"
21552
+ : "icon" }, arrow_left_right$1),
21553
+ h("span", { class: repetitions > 0
21554
+ ? taskExpired
21555
+ ? "neutral"
21556
+ : "success"
21557
+ : "" }, "Completed " + repetitions + " times"))),
21558
+ props.showExpiry && !taskExpired && (h("span", null, "Ends " + dateExpireText))),
21559
+ h("sl-button", { class: taskComplete || taskExpired ? "action disabled" : "action", type: "primary", size: "small", onClick: () => window.open(props.buttonLink), disabled: taskComplete || taskExpired }, props.buttonText)))))));
21560
+ }
21561
+ function Details(props) {
21562
+ const style = {
21563
+ Description: {
21564
+ "& input[type=checkbox]": {
21565
+ display: "none",
21566
+ },
21567
+ "& input:checked ~ .details": {
21568
+ transform: "rotate(-180deg)",
21569
+ },
21570
+ "& .details": {
21571
+ position: "absolute",
21572
+ top: "var(--sl-spacing-medium)",
21573
+ right: "var(--sl-spacing-medium)",
21574
+ color: "var(--sl-color-neutral-700)",
21575
+ fontSize: "var(--sl-font-size-large)",
21576
+ "& :hover": {
21577
+ color: "var(--sl-color-primary-700)",
21578
+ },
21579
+ transformOrigin: "50% 37%",
21580
+ transition: "transform var(--sl-transition-medium) ease",
21581
+ },
21582
+ "& input:checked ~ .summary": {
21583
+ transition: "all var(--sl-transition-medium) ease",
21584
+ maxHeight: "300px",
21585
+ marginBottom: props.steps
21586
+ ? "var(--sl-spacing-large)"
21587
+ : props.showProgressBar
21588
+ ? "var(--sl-spacing-xx-large)"
21589
+ : "var(--sl-spacing-large)",
21590
+ },
21591
+ "& .summary": {
21592
+ display: "block",
21593
+ overflow: "hidden",
21594
+ fontSize: "var(--sl-font-size-small)",
21595
+ maxHeight: "0px",
21596
+ transition: "all var(--sl-transition-fast) ease-out",
21597
+ marginBottom: "var(--sl-spacing-medium)",
21598
+ },
21599
+ },
21600
+ };
21601
+ jss.setup(create());
21602
+ const sheet = jss.createStyleSheet(style);
21603
+ const styleString = sheet.toString();
21604
+ const rid = Math.random().toString(36).slice(2);
21605
+ return (h("div", null,
21606
+ h("style", { type: "text/css" }, styleString),
21607
+ h("span", { class: sheet.classes.Description },
21608
+ h("input", { type: "checkbox", id: "details-" + rid }),
21609
+ h("label", { class: "details", htmlFor: "details-" + rid },
21610
+ h("sl-icon", { name: "chevron-down" })),
21611
+ h("span", { class: "summary" }, props.description))));
21612
+ }
21613
+
21614
+ const scenarioTaskCard = "@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 |";
21615
+
21616
+ const scenarioProgressBar = "@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 |";
21617
+
21618
+ const scenario$5 = scenarioTaskCard + scenarioProgressBar;
20538
21619
  const TaskCard_stories = {
20539
- title: "Components/Task Card",
21620
+ title: "Components/Task Card/",
21621
+ parameters: {
21622
+ scenario: scenario$5,
21623
+ },
21624
+ };
21625
+ const storyFrame = {
21626
+ display: "inline-flex",
21627
+ gap: "32px",
20540
21628
  };
20541
21629
  const resizable = {
20542
21630
  width: "347px",
@@ -20545,37 +21633,55 @@ const resizable = {
20545
21633
  height: "fit-content",
20546
21634
  overflow: "hidden",
20547
21635
  };
20548
- const Default$a = () => {
20549
- // @ts-ignore
20550
- return h(TaskCardView, null);
21636
+ const oneAction = {
21637
+ rewardAmount: 20,
21638
+ rewardUnit: "Points",
21639
+ cardTitle: "Complete a survey",
21640
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21641
+ repeatable: false,
21642
+ showProgressBar: false,
21643
+ progress: 0,
21644
+ goal: 1,
21645
+ buttonText: "Take survey",
21646
+ buttonLink: "https://example.com/",
21647
+ showExpiry: false,
21648
+ dateExpires: null,
21649
+ loading: false,
20551
21650
  };
20552
- const NotRepeatable = () => {
20553
- const oneAction = {
20554
- points: 20,
20555
- cardTitle: "Complete a survey",
20556
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20557
- buttonText: "Take survey",
20558
- goal: 1,
20559
- };
20560
- const coupleActions = {
20561
- points: 40,
20562
- cardTitle: "Comment on 5 articles",
20563
- showProgressBar: true,
20564
- goal: 5,
20565
- steps: 1,
20566
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20567
- buttonText: "Start reading",
20568
- };
20569
- const manyActions = {
20570
- points: 150,
20571
- cardTitle: "Spend $500 at our Store",
20572
- showProgressBar: true,
20573
- goal: 500,
20574
- unit: "$",
20575
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20576
- buttonText: "Visit our Store",
20577
- };
20578
- return (h("div", { style: { display: "inline-flex", gap: "32px" } },
21651
+ const coupleActions = {
21652
+ rewardAmount: 40,
21653
+ rewardUnit: "Points",
21654
+ cardTitle: "Comment on 5 articles",
21655
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21656
+ repeatable: false,
21657
+ showProgressBar: true,
21658
+ steps: true,
21659
+ progress: 1,
21660
+ goal: 5,
21661
+ buttonText: "Take survey",
21662
+ buttonLink: "https://example.com/",
21663
+ showExpiry: false,
21664
+ dateExpires: null,
21665
+ loading: false,
21666
+ };
21667
+ const manyActions = {
21668
+ rewardAmount: 150,
21669
+ rewardUnit: "Points",
21670
+ cardTitle: "Spend $500 at our Store",
21671
+ description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
21672
+ repeatable: false,
21673
+ showProgressBar: true,
21674
+ progress: 100,
21675
+ goal: 500,
21676
+ progressBarUnit: "$",
21677
+ buttonText: "Take survey",
21678
+ buttonLink: "https://example.com/",
21679
+ showExpiry: false,
21680
+ dateExpires: null,
21681
+ loading: false,
21682
+ };
21683
+ const TaskCardNotRepeatable = () => {
21684
+ return (h("div", { style: storyFrame },
20579
21685
  h("div", { style: resizable },
20580
21686
  h("h4", null, "One Action"),
20581
21687
  h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
@@ -20586,454 +21692,211 @@ const NotRepeatable = () => {
20586
21692
  h("h5", null)),
20587
21693
  h("div", { style: resizable },
20588
21694
  h("h4", null, "A Couple Actions"),
20589
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
20590
- " ",
20591
- h("h5", null),
20592
21695
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
20593
21696
  " ",
20594
21697
  h("h5", null),
20595
21698
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20596
21699
  " ",
20597
- h("h5", null),
20598
- h("h5", null,
20599
- "Progress ",
20600
- ">",
20601
- " Goal"),
20602
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
20603
- " ",
20604
21700
  h("h5", null)),
20605
21701
  h("div", { style: resizable },
20606
21702
  h("h4", null, "Many Actions"),
20607
- h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
20608
- " ",
20609
- h("h5", null),
20610
21703
  h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
20611
21704
  " ",
20612
21705
  h("h5", null),
20613
21706
  h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
20614
21707
  " ",
20615
- h("h5", null),
20616
- h("h5", null,
20617
- "Progress ",
20618
- ">",
20619
- " Goal"),
20620
- h(TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
20621
- " ",
20622
21708
  h("h5", null))));
20623
21709
  };
20624
- const NotRepeatableWithExpiry = () => {
20625
- const oneAction = {
20626
- points: 20,
20627
- cardTitle: "Complete a survey",
20628
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20629
- buttonText: "Take survey",
20630
- goal: 1,
20631
- expire: true,
20632
- dateExpire: "Nov 1, 2021",
20633
- };
20634
- const coupleActions = {
20635
- points: 40,
20636
- cardTitle: "Comment on 5 articles",
20637
- showProgressBar: true,
20638
- goal: 5,
20639
- steps: 1,
20640
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20641
- buttonText: "Start reading",
20642
- expire: true,
20643
- dateExpire: "Nov 1, 2021",
20644
- };
20645
- const manyActions = {
20646
- points: 150,
20647
- cardTitle: "Spend $500 at our Store",
20648
- showProgressBar: true,
20649
- goal: 500,
20650
- unit: "$",
20651
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20652
- buttonText: "Visit our Store",
20653
- expire: true,
20654
- dateExpire: "Nov 1, 2021",
20655
- };
20656
- return (h("div", { style: { display: "inline-flex", gap: "32px" } },
21710
+ const TaskCardRepeatable = () => {
21711
+ return (h("div", { style: storyFrame },
20657
21712
  h("div", { style: resizable },
20658
21713
  h("h4", null, "One Action"),
20659
- h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21714
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0, repeatable: true })),
20660
21715
  " ",
20661
21716
  h("h5", null),
20662
- h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21717
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1, repeatable: true })),
20663
21718
  " ",
20664
21719
  h("h5", null)),
20665
21720
  h("div", { style: resizable },
20666
21721
  h("h4", null, "A Couple Actions"),
20667
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
20668
- " ",
21722
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 1, repeatable: true })),
20669
21723
  h("h5", null),
20670
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
20671
- " ",
21724
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 5, repeatable: true })),
20672
21725
  h("h5", null),
20673
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20674
- " ",
21726
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 7, repeatable: true })),
20675
21727
  h("h5", null),
20676
- h("h5", null,
20677
- "Progress ",
20678
- ">",
20679
- " Goal"),
20680
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
20681
- " ",
21728
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 10, repeatable: true })),
20682
21729
  h("h5", null)),
20683
21730
  h("div", { style: resizable },
20684
21731
  h("h4", null, "Many Actions"),
20685
- h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
20686
- " ",
21732
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 100, repeatable: true })),
20687
21733
  h("h5", null),
20688
- h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
20689
- " ",
21734
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 500, repeatable: true })),
20690
21735
  h("h5", null),
20691
- h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
20692
- " ",
21736
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 650, repeatable: true })),
20693
21737
  h("h5", null),
20694
- h("h5", null,
20695
- "Progress ",
20696
- ">",
20697
- " Goal"),
20698
- h(TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
20699
- " ",
21738
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 1000, repeatable: true })),
20700
21739
  h("h5", null))));
20701
21740
  };
20702
- const Repeatable = () => {
20703
- const oneAction = {
20704
- points: 20,
20705
- cardTitle: "Complete a survey",
20706
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20707
- buttonText: "Take survey",
20708
- goal: 1,
20709
- repeatable: true,
20710
- };
20711
- const coupleActions = {
20712
- points: 40,
20713
- cardTitle: "Comment on 5 articles",
20714
- showProgressBar: true,
20715
- repeatable: true,
20716
- goal: 5,
20717
- steps: 1,
20718
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20719
- buttonText: "Start reading",
20720
- };
20721
- const manyActions = {
20722
- points: 150,
20723
- cardTitle: "Spend $500 at our Store",
20724
- showProgressBar: true,
20725
- repeatable: true,
20726
- goal: 500,
20727
- unit: "$",
20728
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20729
- buttonText: "Visit our Store",
21741
+ const TaskCardDateExpires = () => {
21742
+ const expire = {
21743
+ showExpiry: true,
21744
+ dateExpires: "2021-12-01T08:00:00.000Z/2077-12-01T08:00:00.000Z",
20730
21745
  };
20731
- return (h("div", { style: { display: "inline-flex", gap: "32px" } },
21746
+ const expireRepeat = { ...expire, repeatable: true };
21747
+ return (h("div", { style: storyFrame },
20732
21748
  h("div", { style: resizable },
20733
21749
  h("h4", null, "One Action"),
20734
- h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21750
+ h(TaskCardView, Object.assign({}, oneAction, expire)),
20735
21751
  " ",
20736
21752
  h("h5", null),
20737
- h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21753
+ h(TaskCardView, Object.assign({}, oneAction, expireRepeat)),
20738
21754
  " ",
20739
21755
  h("h5", null)),
20740
21756
  h("div", { style: resizable },
20741
21757
  h("h4", null, "A Couple Actions"),
20742
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
20743
- " ",
20744
- h("h5", null),
20745
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20746
- " ",
20747
- h("h5", null),
20748
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
20749
- " ",
20750
- h("h5", null),
20751
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
20752
- " ",
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 })),
21758
+ h(TaskCardView, Object.assign({}, coupleActions, expire)),
20758
21759
  " ",
20759
21760
  h("h5", null),
20760
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
20761
- " ",
20762
- h("h5", null),
20763
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
21761
+ h(TaskCardView, Object.assign({}, coupleActions, expireRepeat)),
20764
21762
  " ",
20765
21763
  h("h5", null)),
20766
21764
  h("div", { style: resizable },
20767
21765
  h("h4", null, "Many Actions"),
20768
- h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
20769
- " ",
20770
- h("h5", null),
20771
- h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
20772
- " ",
20773
- h("h5", null),
20774
- h(TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
20775
- " ",
20776
- h("h5", null),
20777
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
20778
- " ",
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 })),
21766
+ h(TaskCardView, Object.assign({}, manyActions, expire)),
20787
21767
  " ",
20788
21768
  h("h5", null),
20789
- h(TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
21769
+ h(TaskCardView, Object.assign({}, manyActions, expireRepeat)),
20790
21770
  " ",
20791
21771
  h("h5", null))));
20792
21772
  };
20793
- const RepeatableWithExpiry = () => {
20794
- const oneAction = {
20795
- points: 20,
20796
- cardTitle: "Complete a survey",
20797
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20798
- buttonText: "Take survey",
20799
- goal: 1,
20800
- repeatable: true,
20801
- expire: true,
20802
- dateExpire: "Nov 1, 2021",
20803
- };
20804
- const coupleActions = {
20805
- points: 40,
20806
- cardTitle: "Comment on 5 articles",
20807
- showProgressBar: true,
20808
- repeatable: true,
20809
- goal: 5,
20810
- steps: 1,
20811
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20812
- buttonText: "Start reading",
20813
- expire: true,
20814
- dateExpire: "Nov 1, 2021",
20815
- };
20816
- const manyActions = {
20817
- points: 150,
20818
- cardTitle: "Spend $500 at our Store",
20819
- showProgressBar: true,
20820
- repeatable: true,
20821
- goal: 500,
20822
- unit: "$",
20823
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20824
- buttonText: "Visit our Store",
20825
- expire: true,
20826
- dateExpire: "Nov 1, 2021",
20827
- };
20828
- return (h("div", { style: { display: "inline-flex", gap: "32px" } },
21773
+ const TaskCardLoading = () => {
21774
+ const loading = { loading: true };
21775
+ return (h("div", { style: storyFrame },
20829
21776
  h("div", { style: resizable },
20830
21777
  h("h4", null, "One Action"),
20831
- h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
21778
+ h(TaskCardView, Object.assign({}, oneAction, loading)),
20832
21779
  " ",
20833
21780
  h("h5", null),
20834
- h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
21781
+ h(TaskCardView, Object.assign({}, oneAction, loading)),
20835
21782
  " ",
20836
21783
  h("h5", null)),
20837
21784
  h("div", { style: resizable },
20838
21785
  h("h4", null, "A Couple Actions"),
20839
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
21786
+ h(TaskCardView, Object.assign({}, coupleActions, loading)),
20840
21787
  " ",
20841
21788
  h("h5", null),
20842
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
21789
+ h(TaskCardView, Object.assign({}, coupleActions, loading)),
20843
21790
  " ",
20844
- h("h5", null),
20845
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
21791
+ h("h5", null)),
21792
+ h("div", { style: resizable },
21793
+ h("h4", null, "Many Actions"),
21794
+ h(TaskCardView, Object.assign({}, manyActions, loading)),
20846
21795
  " ",
20847
21796
  h("h5", null),
20848
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
21797
+ h(TaskCardView, Object.assign({}, manyActions, loading)),
20849
21798
  " ",
20850
- h("h5", null),
20851
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
21799
+ h("h5", null))));
21800
+ };
21801
+ const TaskCardExpired = () => {
21802
+ const expire = {
21803
+ showExpiry: true,
21804
+ dateExpires: "2021-12-01T08:00:00.000Z/2021-12-01T08:00:00.000Z",
21805
+ };
21806
+ const expireRepeat = { ...expire, repeatable: true };
21807
+ return (h("div", { style: storyFrame },
21808
+ h("div", { style: resizable },
21809
+ h("h4", null, "One Action"),
21810
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expire)),
20852
21811
  " ",
20853
21812
  h("h5", null),
20854
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
21813
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1 }, expire)),
20855
21814
  " ",
20856
21815
  h("h5", null),
20857
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
21816
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expireRepeat)),
20858
21817
  " ",
20859
21818
  h("h5", null),
20860
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
21819
+ h(TaskCardView, Object.assign({}, oneAction, { progress: 1 }, expireRepeat)),
20861
21820
  " ",
20862
21821
  h("h5", null)),
20863
21822
  h("div", { style: resizable },
20864
- h("h4", null, "Many Actions"),
20865
- h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
20866
- " ",
20867
- h("h5", null),
20868
- h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
21823
+ h("h4", null, "A Couple Actions"),
21824
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 }, expire)),
20869
21825
  " ",
20870
21826
  h("h5", null),
20871
- h(TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
21827
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 }, expire)),
20872
21828
  " ",
20873
21829
  h("h5", null),
20874
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
20875
- " ",
21830
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 }, expireRepeat)),
20876
21831
  h("h5", null),
20877
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
21832
+ h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 }, expireRepeat)),
21833
+ h("h5", null)),
21834
+ h("div", { style: resizable },
21835
+ h("h4", null, "Many Actions"),
21836
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 100 }, expire)),
20878
21837
  " ",
20879
21838
  h("h5", null),
20880
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
21839
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }, expire)),
20881
21840
  " ",
20882
21841
  h("h5", null),
20883
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
20884
- " ",
21842
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 100 }, expireRepeat)),
20885
21843
  h("h5", null),
20886
- h(TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
20887
- " ",
21844
+ h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }, expireRepeat)),
20888
21845
  h("h5", null))));
20889
21846
  };
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({
21847
+ const ProgressBar$1 = () => {
21848
+ const props = {
21849
+ progress: 0,
21850
+ goal: 500,
21851
+ progressBarUnit: "$",
21852
+ };
21853
+ return (h("div", null,
21854
+ h(MatrixStory, { matrix: { progress: [-100, 0, 100, 500, 1000] }, props: props, Component: ProgressBarView })));
21855
+ };
21856
+ const ProgressBarSteps = () => {
21857
+ const props = {
21858
+ progress: 0,
21859
+ steps: true,
21860
+ goal: 5,
21861
+ progressBarUnit: "$",
21862
+ };
21863
+ return (h("div", null,
21864
+ h(MatrixStory, { matrix: { progress: [-1, 0, 1, 5, 7] }, props: props, Component: ProgressBarView })));
21865
+ };
21866
+ const ProgressBarRepeatable = () => {
21867
+ const props = {
21868
+ progress: 0,
21869
+ goal: 500,
21870
+ progressBarUnit: "$",
21871
+ repeatable: true,
21872
+ };
21873
+ return (h("div", null,
21874
+ h(MatrixStory, { matrix: { progress: [100, 500, 650, 1200] }, props: props, Component: ProgressBarView })));
21875
+ };
21876
+ const ProgressBarStepsRepeatable = () => {
21877
+ const props = {
21878
+ progress: 0,
21879
+ steps: true,
21880
+ goal: 5,
21881
+ progressBarUnit: "$",
21882
+ repeatable: true,
21883
+ };
21884
+ return (h("div", null,
21885
+ h(MatrixStory, { matrix: { progress: [1, 5, 7, 12] }, props: props, Component: ProgressBarView })));
21886
+ };
21887
+
21888
+ const TaskCard$1 = /*#__PURE__*/Object.freeze({
21030
21889
  __proto__: null,
21031
21890
  'default': TaskCard_stories,
21032
- Default: Default$a,
21033
- NotRepeatable: NotRepeatable,
21034
- NotRepeatableWithExpiry: NotRepeatableWithExpiry,
21035
- Repeatable: Repeatable,
21036
- RepeatableWithExpiry: RepeatableWithExpiry
21891
+ TaskCardNotRepeatable: TaskCardNotRepeatable,
21892
+ TaskCardRepeatable: TaskCardRepeatable,
21893
+ TaskCardDateExpires: TaskCardDateExpires,
21894
+ TaskCardLoading: TaskCardLoading,
21895
+ TaskCardExpired: TaskCardExpired,
21896
+ ProgressBar: ProgressBar$1,
21897
+ ProgressBarSteps: ProgressBarSteps,
21898
+ ProgressBarRepeatable: ProgressBarRepeatable,
21899
+ ProgressBarStepsRepeatable: ProgressBarStepsRepeatable
21037
21900
  });
21038
21901
 
21039
21902
  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";
@@ -24048,7 +24911,7 @@ const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Gen
24048
24911
 
24049
24912
  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
24913
 
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";
24914
+ 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; }; content?: { formData?: any; passwordField?: any; secondaryButton?: any; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; }; refs?: { formRef: any; }; }` | `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";
24052
24915
 
24053
24916
  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
24917
 
@@ -24056,7 +24919,7 @@ const ResetPasswordReadme = "# sqm-portal-reset-password\r\n\r\n\r\n\r\n<!-- Aut
24056
24919
 
24057
24920
  const EmailVerificationReadme = "# sqm-portal-email-verification\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------- | --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; }; content?: { email: string; verifyMessage: string; emailVerificationHeader: string; resendEmailButtonText: string; }; }` | `undefined` |\r\n| `emailVerificationHeader` | `email-verification-header` | | `string` | `\"Verify your email\"` |\r\n| `resendEmailButtonText` | `resend-email-button-text` | | `string` | `\"Re-send Email\"` |\r\n| `verifyMessage` | `verify-message` | | `string` | `\"A verification email was sent to {email}. Please verify your email to continue to the portal.\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-email-verification --> sqm-form-message\r\n style sqm-portal-email-verification fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
24058
24921
 
24059
- const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ---------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | ----------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; verified: boolean; }; data?: { oobCode: string; }; }` | `undefined` |\r\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-verify-email --> sqm-form-message\r\n style sqm-portal-verify-email fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
24922
+ const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| ---------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | ----------- |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; verified: boolean; }; data?: { oobCode: string; }; }` | `undefined` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n\n\n## Dependencies\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-verify-email --> sqm-form-message\n style sqm-portal-verify-email fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
24060
24923
 
24061
24924
  const PortalTemplates_stories = {
24062
24925
  title: "Templates / Portal",
@@ -24254,7 +25117,7 @@ const ProgramMenu$1 = /*#__PURE__*/Object.freeze({
24254
25117
  const PoweredByImg_stories = {
24255
25118
  title: "Powered By",
24256
25119
  };
24257
- const Default$b = () => {
25120
+ const Default$a = () => {
24258
25121
  return h(PoweredByImg$1, null);
24259
25122
  };
24260
25123
  const CustomColor = () => {
@@ -24267,17 +25130,17 @@ const CustomWidthAndHeight = () => {
24267
25130
  const PoweredByImg = /*#__PURE__*/Object.freeze({
24268
25131
  __proto__: null,
24269
25132
  'default': PoweredByImg_stories,
24270
- Default: Default$b,
25133
+ Default: Default$a,
24271
25134
  CustomColor: CustomColor,
24272
25135
  CustomWidthAndHeight: CustomWidthAndHeight
24273
25136
  });
24274
25137
 
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";
25138
+ const scenario$6 = "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
25139
 
24277
25140
  const PortalFooter_stories = {
24278
25141
  title: "Portal Footer",
24279
25142
  parameters: {
24280
- scenario: scenario$5,
25143
+ scenario: scenario$6,
24281
25144
  },
24282
25145
  };
24283
25146
  const defaultProps$9 = {
@@ -24306,12 +25169,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
24306
25169
  FooterNoPoweredBy: FooterNoPoweredBy
24307
25170
  });
24308
25171
 
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 |";
25172
+ const scenario$7 = "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
25173
 
24311
25174
  const Hero_stories = {
24312
25175
  title: "Hero Layout",
24313
25176
  parameters: {
24314
- scenario: scenario$6,
25177
+ scenario: scenario$7,
24315
25178
  },
24316
25179
  };
24317
25180
  const LoginOneColumn = () => {
@@ -24488,12 +25351,12 @@ const Hero = /*#__PURE__*/Object.freeze({
24488
25351
  TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
24489
25352
  });
24490
25353
 
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 | |";
25354
+ const scenario$8 = "@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
25355
 
24493
25356
  const ReferralIframe_stories = {
24494
25357
  title: "Referral Iframe",
24495
25358
  parameters: {
24496
- scenario: scenario$7,
25359
+ scenario: scenario$8,
24497
25360
  },
24498
25361
  };
24499
25362
  const props = {
@@ -24524,12 +25387,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
24524
25387
  ReferralIframeError: ReferralIframeError
24525
25388
  });
24526
25389
 
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";
25390
+ const scenario$9 = "@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
25391
 
24529
25392
  const NameFields_stories = {
24530
25393
  title: "Name Fields",
24531
25394
  parameters: {
24532
- scenario: scenario$8,
25395
+ scenario: scenario$9,
24533
25396
  },
24534
25397
  };
24535
25398
  const props$1 = {
@@ -24567,6 +25430,251 @@ const NameFields$1 = /*#__PURE__*/Object.freeze({
24567
25430
  NameFieldsWithErrors: NameFieldsWithErrors
24568
25431
  });
24569
25432
 
25433
+ const baseResponse = (data) => ({
25434
+ states: {
25435
+ content: null,
25436
+ redeemStage: "chooseReward",
25437
+ amount: 0,
25438
+ exchangeError: false,
25439
+ loading: false,
25440
+ selectedItem: null,
25441
+ selectedStep: null,
25442
+ },
25443
+ data: {
25444
+ exchangeList: data,
25445
+ },
25446
+ callbacks: {
25447
+ exchangeReward: null,
25448
+ resetState: null,
25449
+ setStage: null,
25450
+ setExchangeState: null,
25451
+ refs: null,
25452
+ },
25453
+ refs: null,
25454
+ });
25455
+ const baseReward$2 = {
25456
+ key: "",
25457
+ name: "",
25458
+ description: "",
25459
+ imageUrl: "",
25460
+ available: true,
25461
+ unavailableReason: null,
25462
+ unavailableReasonCode: null,
25463
+ ruleType: "FIXED_GLOBAL_REWARD",
25464
+ sourceUnit: "POINT",
25465
+ sourceValue: 10,
25466
+ prettySourceValue: "10 SaaSquatch Points",
25467
+ sourceMinValue: null,
25468
+ prettySourceMinValue: null,
25469
+ sourceMaxValue: null,
25470
+ prettySourceMaxValue: null,
25471
+ destinationMinValue: null,
25472
+ prettyDestinationMinValue: null,
25473
+ destinationMaxValue: null,
25474
+ prettyDestinationMaxValue: null,
25475
+ globalRewardKey: "",
25476
+ destinationUnit: null,
25477
+ steps: [],
25478
+ };
25479
+ const notEnoughPoints = {
25480
+ available: false,
25481
+ unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
25482
+ };
25483
+ const usTax = {
25484
+ available: false,
25485
+ unavailableReasonCode: "US_TAX",
25486
+ };
25487
+ const imageUrl = (props) => ({
25488
+ imageUrl: props,
25489
+ });
25490
+ const description = (props) => ({
25491
+ description: props,
25492
+ });
25493
+ const fixedValue = (props) => ({
25494
+ prettySourceValue: props,
25495
+ });
25496
+ const variableValue = (min, max, text) => ({
25497
+ ruleType: "VARIABLE_CREDIT_REWARD",
25498
+ sourceMinValue: min,
25499
+ prettySourceMinValue: min + " " + text,
25500
+ sourceMaxValue: max,
25501
+ prettySourceMaxValue: max + " " + text,
25502
+ });
25503
+ const test = {
25504
+ ...baseResponse([
25505
+ {
25506
+ ...baseReward$2,
25507
+ ...description("Free swag with a promo code"),
25508
+ ...imageUrl("https://i.imgur.com/Ds7M19I.png"),
25509
+ ...fixedValue("40 SaaSquatch Points"),
25510
+ },
25511
+ {
25512
+ ...baseReward$2,
25513
+ ...description("Visa® Prepaid Card USD"),
25514
+ ...imageUrl("https://i.imgur.com/4s3q2zz.png"),
25515
+ ...variableValue(20, 80, "SaaSquatch Points"),
25516
+ },
25517
+ {
25518
+ ...baseReward$2,
25519
+ ...description("A very exclusive gift box"),
25520
+ ...imageUrl("https://i.imgur.com/XuiJi4l.png"),
25521
+ ...fixedValue("30 SaaSquatch Points"),
25522
+ },
25523
+ {
25524
+ ...baseReward$2,
25525
+ ...description("$50 Store credit"),
25526
+ ...imageUrl("https://i.imgur.com/WkCMVSE.png"),
25527
+ ...fixedValue("100 SaaSquatch Points"),
25528
+ },
25529
+ {
25530
+ ...baseReward$2,
25531
+ ...description("Variable amount of store credit"),
25532
+ ...imageUrl("https://i.imgur.com/Jn2fE0s.png"),
25533
+ ...variableValue(20, 100, "SaaSquatch Points"),
25534
+ },
25535
+ {
25536
+ ...baseReward$2,
25537
+ ...notEnoughPoints,
25538
+ ...description("A very rare cactus"),
25539
+ ...imageUrl("https://i.imgur.com/CvCdpXc.png"),
25540
+ ...fixedValue("2000 SaaSquatch Points"),
25541
+ },
25542
+ {
25543
+ ...baseReward$2,
25544
+ ...usTax,
25545
+ ...description("$1000 Store credit"),
25546
+ ...imageUrl("https://i.imgur.com/I9FCh9Z.png"),
25547
+ ...fixedValue("2000 SaaSquatch Points"),
25548
+ },
25549
+ {
25550
+ ...baseReward$2,
25551
+ ...notEnoughPoints,
25552
+ ...description("A holiday gift box"),
25553
+ ...imageUrl("https://i.imgur.com/HBJS1WH.png"),
25554
+ ...fixedValue("100 SaaSquatch Points"),
25555
+ },
25556
+ ]),
25557
+ };
25558
+ const test2 = {
25559
+ states: {
25560
+ content: {
25561
+ text: {
25562
+ buttonText: "Exchange Rewards",
25563
+ ignored: true,
25564
+ },
25565
+ },
25566
+ redeemStage: "chooseAmount",
25567
+ amount: 0,
25568
+ exchangeError: false,
25569
+ loading: false,
25570
+ selectedItem: {
25571
+ key: "r4",
25572
+ name: "Salmon Coins",
25573
+ description: "Points for Salmon Coins",
25574
+ 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",
25575
+ available: true,
25576
+ unavailableReason: null,
25577
+ unavailableReasonCode: null,
25578
+ ruleType: "VARIABLE_CREDIT_REWARD",
25579
+ sourceUnit: "POINT",
25580
+ sourceValue: null,
25581
+ prettySourceValue: null,
25582
+ sourceMinValue: 1,
25583
+ prettySourceMinValue: "1 Point",
25584
+ sourceMaxValue: 100,
25585
+ prettySourceMaxValue: "100 Points",
25586
+ destinationMinValue: 1,
25587
+ prettyDestinationMinValue: "1 Salmon Coin",
25588
+ destinationMaxValue: 100,
25589
+ prettyDestinationMaxValue: "100 Salmons",
25590
+ globalRewardKey: null,
25591
+ destinationUnit: "TESTUNIT",
25592
+ steps: [
25593
+ {
25594
+ sourceValue: 1,
25595
+ prettySourceValue: "1 Point",
25596
+ destinationValue: 1,
25597
+ prettyDestinationValue: "1 Salmon Coin",
25598
+ available: true,
25599
+ unavailableReasonCode: null,
25600
+ },
25601
+ {
25602
+ sourceValue: 2,
25603
+ prettySourceValue: "2 Points",
25604
+ destinationValue: 2,
25605
+ prettyDestinationValue: "2 Salmons",
25606
+ available: true,
25607
+ unavailableReasonCode: null,
25608
+ },
25609
+ {
25610
+ sourceValue: 3,
25611
+ prettySourceValue: "3 Points",
25612
+ destinationValue: 3,
25613
+ prettyDestinationValue: "3 Salmons",
25614
+ available: true,
25615
+ unavailableReasonCode: null,
25616
+ },
25617
+ {
25618
+ sourceValue: 4,
25619
+ prettySourceValue: "4 Points",
25620
+ destinationValue: 4,
25621
+ prettyDestinationValue: "4 Salmons",
25622
+ available: true,
25623
+ unavailableReasonCode: null,
25624
+ },
25625
+ {
25626
+ sourceValue: 5,
25627
+ prettySourceValue: "5 Points",
25628
+ destinationValue: 5,
25629
+ prettyDestinationValue: "5 Salmons",
25630
+ available: true,
25631
+ unavailableReasonCode: null,
25632
+ },
25633
+ ],
25634
+ },
25635
+ selectedStep: null,
25636
+ },
25637
+ data: {
25638
+ exchangeList: null,
25639
+ },
25640
+ callbacks: {
25641
+ exchangeReward: null,
25642
+ resetState: null,
25643
+ setStage: null,
25644
+ setExchangeState: null,
25645
+ refs: {
25646
+ drawerRef: {},
25647
+ },
25648
+ },
25649
+ refs: null,
25650
+ };
25651
+
25652
+ const RewardExchangeList_stories = {
25653
+ title: "Components/Reward Exchange List",
25654
+ };
25655
+ const resizable$1 = {
25656
+ width: "683px",
25657
+ minWidth: "260px",
25658
+ resize: "horizontal",
25659
+ height: "fit-content",
25660
+ overflow: "hidden",
25661
+ };
25662
+ const Default$b = () => {
25663
+ return (h("div", { style: resizable$1 },
25664
+ h(RewardExchangeView, Object.assign({}, test))));
25665
+ };
25666
+ const Default2 = () => {
25667
+ return (h("div", { style: { ...resizable$1, height: "700px" } },
25668
+ h(RewardExchangeView, Object.assign({}, test2))));
25669
+ };
25670
+
25671
+ const RewardExchangeList = /*#__PURE__*/Object.freeze({
25672
+ __proto__: null,
25673
+ 'default': RewardExchangeList_stories,
25674
+ Default: Default$b,
25675
+ Default2: Default2
25676
+ });
25677
+
24570
25678
  function deepFreeze(obj) {
24571
25679
  if (obj instanceof Map) {
24572
25680
  obj.clear = obj.delete = obj.set = function () {
@@ -27147,7 +28255,9 @@ const CucumberAddon = ({ story }, children) => {
27147
28255
  // No scenario or invalid. Ignoring.
27148
28256
  }
27149
28257
  return (h("div", null,
27150
- result && h("pre", { innerHTML: result.value }),
28258
+ h("details", null,
28259
+ h("summary", null, "Specs"),
28260
+ result && h("pre", { innerHTML: result.value })),
27151
28261
  children));
27152
28262
  };
27153
28263
 
@@ -27184,7 +28294,7 @@ const stories = [
27184
28294
  ReferralTableRewardsCell$1,
27185
28295
  UserName,
27186
28296
  PasswordField,
27187
- TaskCard,
28297
+ TaskCard$1,
27188
28298
  PortalTemplates,
27189
28299
  ProgramMenu$1,
27190
28300
  PoweredByImg,
@@ -27192,7 +28302,10 @@ const stories = [
27192
28302
  Hero,
27193
28303
  ReferralIframe$1,
27194
28304
  NameFields$1,
28305
+ RewardExchangeList,
27195
28306
  UseRewardExchangeList,
28307
+ UseTaskCard,
28308
+ UseRewardsTable
27196
28309
  ];
27197
28310
  const StencilStorybook = class {
27198
28311
  constructor(hostRef) {
@@ -27232,6 +28345,83 @@ const TableRow = class {
27232
28345
  }
27233
28346
  };
27234
28347
 
28348
+ const TaskCard$2 = class {
28349
+ constructor(hostRef) {
28350
+ registerInstance(this, hostRef);
28351
+ this.ignored = true;
28352
+ /**
28353
+ * @uiName Reward Amount
28354
+ */
28355
+ this.rewardAmount = 0;
28356
+ /**
28357
+ * @uiName Reward Unit
28358
+ */
28359
+ this.rewardUnit = "Points";
28360
+ /**
28361
+ * @uiName Title Text
28362
+ */
28363
+ this.cardTitle = "Title Text";
28364
+ /**
28365
+ * @uiName Description Text
28366
+ */
28367
+ this.description = "Description Text";
28368
+ /**
28369
+ * @uiName Goal Repeatable
28370
+ */
28371
+ this.repeatable = false;
28372
+ /**
28373
+ * @uiName Show Progress Bar
28374
+ */
28375
+ this.showProgressBar = false;
28376
+ /**
28377
+ * @uiName Goal Progress Source
28378
+ */
28379
+ this.progressSource = "";
28380
+ /**
28381
+ * @uiName Goal Completion Number
28382
+ */
28383
+ this.goal = 1;
28384
+ /**
28385
+ * @uiName Progress Bar Steps
28386
+ */
28387
+ this.steps = false;
28388
+ /**
28389
+ * @uiName Show Goal Expiry
28390
+ */
28391
+ this.showExpiry = false;
28392
+ /**
28393
+ * @uiName Date Goal Expires
28394
+ * @uiWidget DateRange
28395
+ * @uiOptions {"allowPastDates":true, "months": 1}
28396
+ */
28397
+ this.dateExpires = "/";
28398
+ /**
28399
+ * @uiName CTA Button Text
28400
+ */
28401
+ this.buttonText = "Complete Action";
28402
+ /**
28403
+ * @uiName CTA Button Link
28404
+ */
28405
+ this.buttonLink = "https://example.com/";
28406
+ /**
28407
+ * Select what type of stat to display for the goal. Manual paths are also supported.
28408
+ *
28409
+ * @uiWidget StatTypeSelectWidget
28410
+ * @uiName Stat Type
28411
+ * @uiOptions {"version": 1.1}
28412
+ */
28413
+ this.statType = "/programGoals/count/Referral-Started%2Freferrals";
28414
+ h$1(this);
28415
+ }
28416
+ disconnectedCallback() { }
28417
+ render() {
28418
+ const { props } = j$1() ? useDemoBigStat(this) : useBigStat(this);
28419
+ const { value, statvalue } = props;
28420
+ console.log(props, j$1());
28421
+ return (h(TaskCardView, Object.assign({}, getProps(this), { progress: value, loading: value === undefined })));
28422
+ }
28423
+ };
28424
+
27235
28425
  const debug$2 = browser("sq:global");
27236
28426
  const textStyles = `
27237
28427
  sqm-text {
@@ -27357,4 +28547,4 @@ function useUserNameDemo(props) {
27357
28547
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
27358
28548
  }
27359
28549
 
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 };
28550
+ 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 };