@saasquatch/mint-components 1.5.0-8 → 1.5.0-83

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 (790) hide show
  1. package/CHANGELOG.md +156 -24
  2. package/dist/cjs/GenericTableView-39e0998e.js +113 -0
  3. package/dist/cjs/{jss-preset-default.esm-6304d24f.js → JSS-c65a40f1.js} +5 -3
  4. package/dist/cjs/ReferralTableRewardsCell.stories-cd7b9c93.js +261 -0
  5. package/dist/cjs/RewardsTableCell.stories-b439d2e6.js +279 -0
  6. package/dist/cjs/ShadowViewAddon-92b80d99.js +2618 -0
  7. package/dist/cjs/extends-08099afd.js +21 -0
  8. package/dist/cjs/{global-89f66e76.js → global-4c495d76.js} +80 -140
  9. package/dist/cjs/{index.module-c0bf9df0.js → index.module-54724339.js} +51 -50
  10. package/dist/cjs/loader.cjs.js +6 -5
  11. package/dist/cjs/luxon-59ca7d19.js +8348 -0
  12. package/dist/cjs/mint-components.cjs.js +6 -5
  13. package/dist/cjs/{re-render-124b56ee.js → re-render-2f8d0f37.js} +7 -7
  14. package/dist/cjs/{sqm-asset-card-view-07f86880.js → sqm-asset-card-view-d9ac6a95.js} +2 -3
  15. package/dist/cjs/sqm-asset-card.cjs.entry.js +8 -7
  16. package/dist/cjs/sqm-big-stat-view-e5dc0877.js +40 -0
  17. package/dist/cjs/sqm-big-stat.cjs.entry.js +10 -8
  18. package/dist/cjs/sqm-brand_27.cjs.entry.js +7253 -0
  19. package/dist/cjs/sqm-empty_7.cjs.entry.js +245 -0
  20. package/dist/cjs/sqm-form-message.cjs.entry.js +31 -0
  21. package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +9 -8
  22. package/dist/cjs/{sqm-hero-view-bb3d00a1.js → sqm-hero-view-a13795c0.js} +6 -7
  23. package/dist/cjs/sqm-hero.cjs.entry.js +7 -6
  24. package/dist/cjs/sqm-leaderboard-rank-view-35015d30.js +10 -0
  25. package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +11 -13
  26. package/dist/cjs/{sqm-name-fields-view-24614ac7.js → sqm-name-fields-view-c95e4768.js} +2 -3
  27. package/dist/cjs/sqm-name-fields.cjs.entry.js +9 -8
  28. package/dist/cjs/{sqm-navigation-sidebar-item-view-a2bdcf05.js → sqm-navigation-sidebar-item-view-da648fbc.js} +7 -6
  29. package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +10 -9
  30. package/dist/cjs/{sqm-navigation-sidebar-view-d06e1885.js → sqm-navigation-sidebar-view-36632c96.js} +2 -3
  31. package/dist/cjs/sqm-navigation-sidebar.cjs.entry.js +5 -4
  32. package/dist/cjs/sqm-password-field.cjs.entry.js +581 -0
  33. package/dist/cjs/sqm-popup-container.cjs.entry.js +6 -5
  34. package/dist/cjs/{sqm-portal-container-view-d144735a.js → sqm-portal-container-view-fdfb3656.js} +9 -5
  35. package/dist/cjs/{sqm-portal-email-verification-view-5093ac20.js → sqm-portal-email-verification-view-1552442a.js} +5 -6
  36. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +23 -15
  37. package/dist/cjs/{sqm-portal-footer-view-03408484.js → sqm-portal-footer-view-15ce261b.js} +3 -4
  38. package/dist/cjs/sqm-portal-footer.cjs.entry.js +9 -8
  39. package/dist/cjs/{sqm-portal-forgot-password-view-1704d285.js → sqm-portal-forgot-password-view-10c0b54f.js} +3 -4
  40. package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +30 -17
  41. package/dist/cjs/sqm-portal-logout.cjs.entry.js +7 -6
  42. package/dist/cjs/{sqm-portal-profile-view-fa2db439.js → sqm-portal-profile-view-659635e9.js} +5 -6
  43. package/dist/cjs/sqm-portal-profile.cjs.entry.js +19 -18
  44. package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +10 -9
  45. package/dist/cjs/{sqm-portal-reset-password-view-4d78fd6d.js → sqm-portal-reset-password-view-1fdc957e.js} +3 -4
  46. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +27 -18
  47. package/dist/cjs/{sqm-portal-section-view-3b008930.js → sqm-portal-section-view-186a5f7e.js} +4 -6
  48. package/dist/cjs/{sqm-portal-verify-email-view-b595e302.js → sqm-portal-verify-email-view-4c78e231.js} +3 -4
  49. package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +29 -20
  50. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +502 -0
  51. package/dist/cjs/sqm-refresh-button.cjs.entry.js +54 -0
  52. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +778 -0
  53. package/dist/cjs/{sqm-stat-container-view-ee7b00ff.js → sqm-stat-container-view-5b2db929.js} +3 -4
  54. package/dist/cjs/sqm-stat-container.cjs.entry.js +6 -5
  55. package/dist/cjs/sqm-stencilbook.cjs.entry.js +13849 -0
  56. package/dist/cjs/sqm-tab.cjs.entry.js +23 -0
  57. package/dist/cjs/sqm-tabs.cjs.entry.js +61 -0
  58. package/dist/cjs/{sqm-text-span-view-b5ae787b.js → sqm-text-span-view-f101dedf.js} +2 -3
  59. package/dist/cjs/sqm-text-span.cjs.entry.js +5 -4
  60. package/dist/cjs/{extends-0302d27d.js → stencil-hooks.module-87a1f4f7.js} +0 -19
  61. package/dist/cjs/use-callback-e754042f.js +7 -0
  62. package/dist/cjs/useChildElements-a68699b4.js +21 -0
  63. package/dist/cjs/{useDemoBigStat-5d71bbdf.js → useDemoBigStat-426e3319.js} +22 -48
  64. package/dist/cjs/useReferralTable-45f295ba.js +349 -0
  65. package/dist/cjs/{utils-95e5317c.js → utils-01dbfd4a.js} +9 -0
  66. package/dist/collection/collection-manifest.json +45 -5
  67. package/dist/collection/components/sqm-asset-card/sqm-asset-card-view.js +2 -4
  68. package/dist/collection/components/sqm-big-stat/BigStat.stories.js +12 -1
  69. package/dist/collection/components/sqm-big-stat/sqm-big-stat-view.js +2 -4
  70. package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +21 -1
  71. package/dist/collection/components/sqm-big-stat/useBigStat.js +14 -4
  72. package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +2 -0
  73. package/dist/collection/components/sqm-brand/SqmBrand.stories.js +19 -0
  74. package/dist/collection/components/sqm-brand/sqm-brand.js +34 -4
  75. package/dist/collection/components/sqm-card-feed/CardFeed.stories.js +185 -0
  76. package/dist/collection/components/sqm-card-feed/sqm-card-feed-view.js +27 -0
  77. package/dist/collection/components/sqm-card-feed/sqm-card-feed.js +79 -0
  78. package/dist/collection/components/sqm-divided-layout/sqm-divided-layout-view.js +2 -4
  79. package/dist/collection/components/sqm-empty/sqm-empty-view.js +18 -0
  80. package/dist/collection/components/sqm-empty/sqm-empty.js +97 -0
  81. package/dist/collection/components/sqm-hero/sqm-hero-view.js +2 -4
  82. package/dist/collection/components/sqm-hero-image/HeroImage.stories.js +56 -0
  83. package/dist/collection/components/sqm-hero-image/sqm-hero-image-view.js +130 -0
  84. package/dist/collection/components/sqm-hero-image/sqm-hero-image.js +453 -0
  85. package/dist/collection/components/sqm-image/Image.stories.js +26 -0
  86. package/dist/collection/components/sqm-image/sqm-image-view.js +30 -0
  87. package/dist/collection/components/sqm-image/sqm-image.js +116 -0
  88. package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +527 -9
  89. package/dist/collection/components/sqm-leaderboard/UseLeaderboard.stories.js +62 -8
  90. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +86 -11
  91. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +115 -21
  92. package/dist/collection/components/sqm-leaderboard/useLeaderboard.js +31 -3
  93. package/dist/collection/components/sqm-leaderboard-rank/sqm-leaderboard-rank.js +1 -4
  94. package/dist/collection/components/sqm-leaderboard-rank/useLeaderboardRank.js +1 -1
  95. package/dist/collection/components/sqm-name-fields/sqm-name-fields-view.js +2 -4
  96. package/dist/collection/components/sqm-navigation-sidebar/sqm-navigation-sidebar-view.js +2 -4
  97. package/dist/collection/components/sqm-navigation-sidebar-item/sqm-navigation-sidebar-item-view.js +5 -5
  98. package/dist/collection/components/sqm-navigation-sidebar-item/sqm-navigation-sidebar-item.js +1 -1
  99. package/dist/collection/components/sqm-password-field/passwordValidation.js +2 -4
  100. package/dist/collection/components/sqm-password-field/sqm-password-field-view.js +2 -4
  101. package/dist/collection/components/sqm-portal-change-password/sqm-portal-change-password-view.js +2 -4
  102. package/dist/collection/components/sqm-portal-container/PortalContainer.stories.js +47 -0
  103. package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +9 -6
  104. package/dist/collection/components/sqm-portal-container/sqm-portal-container.js +78 -0
  105. package/dist/collection/components/sqm-portal-email-verification/sqm-portal-email-verification-view.js +4 -6
  106. package/dist/collection/components/sqm-portal-email-verification/sqm-portal-email-verification.js +27 -0
  107. package/dist/collection/components/sqm-portal-email-verification/usePortalEmailVerification.js +2 -1
  108. package/dist/collection/components/sqm-portal-footer/sqm-portal-footer-view.js +2 -4
  109. package/dist/collection/components/sqm-portal-forgot-password/PortalForgotPassword.stories.js +4 -0
  110. package/dist/collection/components/sqm-portal-forgot-password/sqm-portal-forgot-password-view.js +2 -4
  111. package/dist/collection/components/sqm-portal-forgot-password/sqm-portal-forgot-password.js +55 -3
  112. package/dist/collection/components/sqm-portal-forgot-password/usePortalForgotPassword.js +4 -2
  113. package/dist/collection/components/sqm-portal-frame/sqm-portal-frame-view.js +2 -4
  114. package/dist/collection/components/sqm-portal-login/PortalLogin.stories.js +6 -0
  115. package/dist/collection/components/sqm-portal-login/sqm-portal-login-view.js +3 -5
  116. package/dist/collection/components/sqm-portal-login/sqm-portal-login.js +59 -4
  117. package/dist/collection/components/sqm-portal-login/usePortalLogin.js +4 -2
  118. package/dist/collection/components/sqm-portal-profile/PortalProfile.stories.js +1 -7
  119. package/dist/collection/components/sqm-portal-profile/sqm-portal-profile-view.js +2 -4
  120. package/dist/collection/components/sqm-portal-register/PortalRegister.stories.js +12 -0
  121. package/dist/collection/components/sqm-portal-register/sqm-portal-register-view.js +3 -4
  122. package/dist/collection/components/sqm-portal-register/sqm-portal-register.js +56 -2
  123. package/dist/collection/components/sqm-portal-register/usePortalRegister.js +3 -0
  124. package/dist/collection/components/sqm-portal-reset-password/sqm-portal-reset-password-view.js +3 -5
  125. package/dist/collection/components/sqm-portal-reset-password/sqm-portal-reset-password.js +30 -1
  126. package/dist/collection/components/sqm-portal-reset-password/usePortalResetPassword.js +1 -1
  127. package/dist/collection/components/sqm-portal-verify-email/sqm-portal-verify-email-view.js +2 -4
  128. package/dist/collection/components/sqm-portal-verify-email/sqm-portal-verify-email.js +30 -1
  129. package/dist/collection/components/sqm-portal-verify-email/usePortalVerifyEmail.js +2 -2
  130. package/dist/collection/components/sqm-program-explainer/ProgramExplainer.stories.js +14 -43
  131. package/dist/collection/components/sqm-program-explainer/sqm-program-explainer-view.js +33 -30
  132. package/dist/collection/components/sqm-program-explainer/sqm-program-explainer.js +7 -47
  133. package/dist/collection/components/sqm-program-explainer-step/ProgramExplainerStep.stories.js +9 -17
  134. package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step-view.js +43 -38
  135. package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step.js +33 -10
  136. package/dist/collection/components/sqm-referral-card/ReferralCard.stories.js +62 -0
  137. package/dist/collection/components/sqm-referral-card/sqm-referral-card-view.js +52 -0
  138. package/dist/collection/components/sqm-referral-card/sqm-referral-card.js +62 -0
  139. package/dist/collection/components/sqm-referral-iframe/sqm-referral-iframe-view.js +2 -4
  140. package/dist/collection/components/sqm-referral-table/ReferralTable.stories.js +105 -69
  141. package/dist/collection/components/sqm-referral-table/ReferralTableCell.stories.js +10 -1
  142. package/dist/collection/components/sqm-referral-table/ReferralTableRewardsCell.stories.js +34 -25
  143. package/dist/collection/components/sqm-referral-table/UseReferralTable.stories.js +119 -0
  144. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-date-cell.js +23 -5
  145. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.js +197 -26
  146. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-status-cell.js +14 -1
  147. package/dist/collection/components/sqm-referral-table/cells/sqm-referral-table-user-cell.js +2 -3
  148. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-date-column.js +9 -5
  149. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.js +156 -3
  150. package/dist/collection/components/sqm-referral-table/sqm-referral-table-view.js +3 -7
  151. package/dist/collection/components/sqm-referral-table/sqm-referral-table.js +107 -20
  152. package/dist/collection/components/sqm-referral-table/useReferralTable.js +379 -16
  153. package/dist/collection/components/sqm-refresh-button/RefreshButtonView.js +8 -0
  154. package/dist/collection/components/sqm-refresh-button/sqm-refresh-button.js +66 -0
  155. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +15 -8
  156. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +171 -34
  157. package/dist/collection/components/sqm-reward-exchange-list/assets/Reward-image.png +0 -0
  158. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +321 -205
  159. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +258 -14
  160. package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +20 -8
  161. package/dist/collection/components/sqm-rewards-table/RewardsTable.stories.js +118 -0
  162. package/dist/collection/components/sqm-rewards-table/RewardsTableCell.stories.js +227 -0
  163. package/dist/collection/components/sqm-rewards-table/UseRewardsTable.stories.js +79 -1
  164. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-date-cell.js +22 -3
  165. package/dist/collection/components/sqm-rewards-table/cells/{sqm-rewards-table-rewards-cell.js → sqm-rewards-table-reward-cell.js} +89 -53
  166. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-source-cell.js +142 -30
  167. package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.js +155 -2
  168. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-date-column.js +8 -4
  169. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-reward-column.js +42 -16
  170. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-source-column.js +83 -3
  171. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-status-column.js +34 -6
  172. package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +103 -19
  173. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +28 -19
  174. package/dist/collection/components/sqm-scroll/Scroll.stories.js +59 -0
  175. package/dist/collection/components/sqm-scroll/sqm-scroll.js +111 -0
  176. package/dist/collection/components/sqm-share-button/ShareButton.stories.js +63 -6
  177. package/dist/collection/components/sqm-share-button/sqm-share-button-view.js +67 -11
  178. package/dist/collection/components/sqm-share-button/sqm-share-button.js +71 -13
  179. package/dist/collection/components/sqm-share-button/useShareButton.js +1 -1
  180. package/dist/collection/components/sqm-share-code/ShareCode.stories.js +17 -0
  181. package/dist/collection/components/sqm-share-code/sqm-share-code.js +1 -1
  182. package/dist/collection/components/sqm-share-link/ShareLink.stories.js +4 -0
  183. package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +2 -4
  184. package/dist/collection/components/sqm-stat-container/sqm-stat-container-view.js +3 -5
  185. package/dist/collection/components/sqm-stencilbook/AutoColor.js +10 -10
  186. package/dist/collection/components/sqm-stencilbook/Resizer.js +1 -0
  187. package/dist/collection/components/sqm-stencilbook/Themes.js +3 -11
  188. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +27 -1
  189. package/dist/collection/components/sqm-tab/sqm-tab-view.js +4 -0
  190. package/dist/collection/components/sqm-tab/sqm-tab.js +33 -0
  191. package/dist/collection/{tables → components/sqm-table-cell}/sqm-table-cell.js +0 -0
  192. package/dist/collection/{tables → components/sqm-table-row}/sqm-table-row.js +0 -0
  193. package/dist/collection/components/sqm-tabs/Tabs.stories.js +81 -0
  194. package/dist/collection/components/sqm-tabs/sqm-tabs-view.js +26 -0
  195. package/dist/collection/components/sqm-tabs/sqm-tabs.js +17 -0
  196. package/dist/collection/components/sqm-tabs/useTabs.js +12 -0
  197. package/dist/collection/components/sqm-task-card/DetailsView.js +53 -0
  198. package/dist/collection/components/sqm-task-card/TaskCard.stories.js +169 -164
  199. package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +28 -2
  200. package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +1 -1
  201. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +349 -319
  202. package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +247 -205
  203. package/dist/collection/components/sqm-task-card/sqm-task-card.js +227 -25
  204. package/dist/collection/components/sqm-task-card/useTaskCard.js +43 -0
  205. package/dist/collection/components/sqm-text/sqm-text.js +30 -29
  206. package/dist/collection/components/sqm-text-span/sqm-text-span-view.js +2 -4
  207. package/dist/collection/components/sqm-timeline/SVGs.js +10 -0
  208. package/dist/collection/components/sqm-timeline/Timeline.stories.js +70 -0
  209. package/dist/collection/components/sqm-timeline/sqm-timeline-entry.js +203 -0
  210. package/dist/collection/components/sqm-timeline/sqm-timeline.js +118 -0
  211. package/dist/collection/components/sqm-titled-section/TitledSection.stories.js +237 -0
  212. package/dist/collection/components/sqm-titled-section/sqm-portal-section-view.js +4 -7
  213. package/dist/collection/components/sqm-titled-section/sqm-titled-section.js +39 -3
  214. package/dist/collection/components/sqm-user-name/sqm-user-name.js +1 -1
  215. package/dist/collection/components/sqm-user-name/useUserName.js +1 -1
  216. package/dist/collection/global/global.js +1 -1
  217. package/dist/collection/global/styles.js +14 -72
  218. package/dist/collection/global/styles.ts +14 -72
  219. package/dist/collection/stories/NewPortal.stories.js +17 -19
  220. package/dist/collection/styling/JSS.js +9 -0
  221. package/dist/collection/tables/GenericTableView.js +93 -36
  222. package/dist/collection/tables/TableSlots.js +9 -1
  223. package/dist/collection/utils/RequiredPropsError.js +2 -4
  224. package/dist/collection/utils/utils.js +8 -0
  225. package/dist/esm/GenericTableView-0c811879.js +111 -0
  226. package/dist/esm/{jss-preset-default.esm-71fae192.js → JSS-96eeab98.js} +5 -2
  227. package/dist/esm/ReferralTableRewardsCell.stories-c3df1aa2.js +251 -0
  228. package/dist/esm/RewardsTableCell.stories-21ae3b86.js +262 -0
  229. package/dist/esm/ShadowViewAddon-8cb393d4.js +2582 -0
  230. package/dist/esm/extends-c31f1eff.js +19 -0
  231. package/dist/esm/{global-e0e25c22.js → global-c2179248.js} +19 -77
  232. package/dist/esm/{index.module-eb50a8d2.js → index.module-ec3dcc82.js} +11 -10
  233. package/dist/esm/loader.js +6 -5
  234. package/dist/esm/luxon-5fa22651.js +8346 -0
  235. package/dist/esm/mint-components.js +6 -5
  236. package/dist/esm/{re-render-6d5b856e.js → re-render-43311710.js} +5 -5
  237. package/dist/esm/{sqm-asset-card-view-6f360937.js → sqm-asset-card-view-f9ca5345.js} +2 -3
  238. package/dist/esm/sqm-asset-card.entry.js +7 -6
  239. package/dist/esm/sqm-big-stat-view-309f7c1f.js +38 -0
  240. package/dist/esm/sqm-big-stat.entry.js +8 -6
  241. package/dist/esm/sqm-brand_27.entry.js +7223 -0
  242. package/dist/esm/sqm-empty_7.entry.js +235 -0
  243. package/dist/esm/sqm-form-message.entry.js +27 -0
  244. package/dist/esm/sqm-graphql-client-provider.entry.js +7 -6
  245. package/dist/esm/{sqm-hero-view-bfd8abd1.js → sqm-hero-view-190bc812.js} +4 -5
  246. package/dist/esm/sqm-hero.entry.js +6 -5
  247. package/dist/esm/sqm-leaderboard-rank-view-da91f5f3.js +8 -0
  248. package/dist/esm/sqm-leaderboard-rank.entry.js +9 -11
  249. package/dist/esm/{sqm-name-fields-view-4162fb7b.js → sqm-name-fields-view-69b1583f.js} +2 -3
  250. package/dist/esm/sqm-name-fields.entry.js +7 -6
  251. package/dist/esm/{sqm-navigation-sidebar-item-view-2d8c368c.js → sqm-navigation-sidebar-item-view-a6f7f96c.js} +7 -6
  252. package/dist/esm/sqm-navigation-sidebar-item.entry.js +9 -8
  253. package/dist/esm/{sqm-navigation-sidebar-view-2242502c.js → sqm-navigation-sidebar-view-816558e3.js} +2 -3
  254. package/dist/esm/sqm-navigation-sidebar.entry.js +4 -3
  255. package/dist/esm/sqm-password-field.entry.js +577 -0
  256. package/dist/esm/sqm-popup-container.entry.js +5 -4
  257. package/dist/esm/{sqm-portal-container-view-73757ca5.js → sqm-portal-container-view-f74db584.js} +9 -5
  258. package/dist/esm/{sqm-portal-email-verification-view-2af31979.js → sqm-portal-email-verification-view-8acdcd89.js} +5 -6
  259. package/dist/esm/sqm-portal-email-verification.entry.js +18 -10
  260. package/dist/esm/{sqm-portal-footer-view-60cd9ae5.js → sqm-portal-footer-view-9995ad03.js} +4 -5
  261. package/dist/esm/sqm-portal-footer.entry.js +8 -7
  262. package/dist/esm/{sqm-portal-forgot-password-view-e3a6a716.js → sqm-portal-forgot-password-view-fa088f83.js} +3 -4
  263. package/dist/esm/sqm-portal-forgot-password.entry.js +25 -12
  264. package/dist/esm/sqm-portal-logout.entry.js +6 -5
  265. package/dist/esm/{sqm-portal-profile-view-f1deea0f.js → sqm-portal-profile-view-71c84f2e.js} +5 -6
  266. package/dist/esm/sqm-portal-profile.entry.js +12 -11
  267. package/dist/esm/sqm-portal-protected-route.entry.js +8 -7
  268. package/dist/esm/{sqm-portal-reset-password-view-a4e50da2.js → sqm-portal-reset-password-view-73e14282.js} +3 -4
  269. package/dist/esm/sqm-portal-reset-password.entry.js +23 -14
  270. package/dist/esm/{sqm-portal-section-view-f0876545.js → sqm-portal-section-view-88a80af9.js} +4 -6
  271. package/dist/esm/{sqm-portal-verify-email-view-6f18bac2.js → sqm-portal-verify-email-view-cbf1cfdc.js} +3 -4
  272. package/dist/esm/sqm-portal-verify-email.entry.js +21 -12
  273. package/dist/esm/sqm-referral-table_11.entry.js +488 -0
  274. package/dist/esm/sqm-refresh-button.entry.js +50 -0
  275. package/dist/esm/sqm-rewards-table_9.entry.js +766 -0
  276. package/dist/esm/{sqm-stat-container-view-4133feb6.js → sqm-stat-container-view-8a565c5a.js} +3 -4
  277. package/dist/esm/sqm-stat-container.entry.js +5 -4
  278. package/dist/esm/sqm-stencilbook.entry.js +13845 -0
  279. package/dist/esm/sqm-tab.entry.js +19 -0
  280. package/dist/esm/sqm-tabs.entry.js +57 -0
  281. package/dist/esm/{sqm-text-span-view-1781df94.js → sqm-text-span-view-7e61c95c.js} +2 -3
  282. package/dist/esm/sqm-text-span.entry.js +4 -3
  283. package/dist/esm/{extends-3a3f9fe2.js → stencil-hooks.module-2f159754.js} +1 -19
  284. package/dist/esm/{use-callback-b38a1523.js → use-callback-d8ef4b5d.js} +1 -1
  285. package/dist/esm/useChildElements-0146a8bd.js +19 -0
  286. package/dist/esm/{useDemoBigStat-d227b2f9.js → useDemoBigStat-022e116d.js} +20 -45
  287. package/dist/esm/useReferralTable-596519fc.js +346 -0
  288. package/dist/esm/{utils-454405f5.js → utils-1d345130.js} +9 -1
  289. package/dist/esm-es5/GenericTableView-0c811879.js +1 -0
  290. package/dist/esm-es5/{jss-preset-default.esm-71fae192.js → JSS-96eeab98.js} +2 -2
  291. package/dist/esm-es5/ReferralTableRewardsCell.stories-c3df1aa2.js +1 -0
  292. package/dist/esm-es5/RewardsTableCell.stories-21ae3b86.js +1 -0
  293. package/dist/esm-es5/ShadowViewAddon-8cb393d4.js +1 -0
  294. package/dist/esm-es5/extends-c31f1eff.js +1 -0
  295. package/dist/esm-es5/{global-e0e25c22.js → global-c2179248.js} +2 -2
  296. package/dist/esm-es5/index.module-ec3dcc82.js +1 -0
  297. package/dist/esm-es5/loader.js +1 -1
  298. package/dist/esm-es5/luxon-5fa22651.js +1 -0
  299. package/dist/esm-es5/mint-components.js +1 -1
  300. package/dist/esm-es5/re-render-43311710.js +1 -0
  301. package/dist/esm-es5/sqm-asset-card-view-f9ca5345.js +1 -0
  302. package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
  303. package/dist/esm-es5/sqm-big-stat-view-309f7c1f.js +1 -0
  304. package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
  305. package/dist/esm-es5/sqm-brand_27.entry.js +1 -0
  306. package/dist/esm-es5/sqm-empty_7.entry.js +1 -0
  307. package/dist/esm-es5/sqm-form-message.entry.js +1 -0
  308. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  309. package/dist/esm-es5/sqm-hero-view-190bc812.js +1 -0
  310. package/dist/esm-es5/sqm-hero.entry.js +1 -1
  311. package/dist/esm-es5/sqm-leaderboard-rank-view-da91f5f3.js +1 -0
  312. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  313. package/dist/esm-es5/sqm-name-fields-view-69b1583f.js +1 -0
  314. package/dist/esm-es5/sqm-name-fields.entry.js +1 -1
  315. package/dist/esm-es5/sqm-navigation-sidebar-item-view-a6f7f96c.js +1 -0
  316. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  317. package/dist/esm-es5/sqm-navigation-sidebar-view-816558e3.js +1 -0
  318. package/dist/esm-es5/sqm-navigation-sidebar.entry.js +1 -1
  319. package/dist/esm-es5/sqm-password-field.entry.js +1 -0
  320. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  321. package/dist/esm-es5/sqm-portal-container-view-f74db584.js +1 -0
  322. package/dist/esm-es5/sqm-portal-email-verification-view-8acdcd89.js +1 -0
  323. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  324. package/dist/esm-es5/sqm-portal-footer-view-9995ad03.js +1 -0
  325. package/dist/esm-es5/sqm-portal-footer.entry.js +1 -1
  326. package/dist/esm-es5/sqm-portal-forgot-password-view-fa088f83.js +1 -0
  327. package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
  328. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  329. package/dist/esm-es5/sqm-portal-profile-view-71c84f2e.js +1 -0
  330. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  331. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  332. package/dist/esm-es5/sqm-portal-reset-password-view-73e14282.js +1 -0
  333. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  334. package/dist/esm-es5/sqm-portal-section-view-88a80af9.js +1 -0
  335. package/dist/esm-es5/sqm-portal-verify-email-view-cbf1cfdc.js +1 -0
  336. package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
  337. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -0
  338. package/dist/esm-es5/sqm-refresh-button.entry.js +1 -0
  339. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -0
  340. package/dist/esm-es5/sqm-stat-container-view-8a565c5a.js +1 -0
  341. package/dist/esm-es5/sqm-stat-container.entry.js +1 -1
  342. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -0
  343. package/dist/esm-es5/sqm-tab.entry.js +1 -0
  344. package/dist/esm-es5/sqm-tabs.entry.js +1 -0
  345. package/dist/esm-es5/sqm-text-span-view-7e61c95c.js +1 -0
  346. package/dist/esm-es5/sqm-text-span.entry.js +1 -1
  347. package/dist/esm-es5/{extends-3a3f9fe2.js → stencil-hooks.module-2f159754.js} +1 -1
  348. package/dist/esm-es5/use-callback-d8ef4b5d.js +1 -0
  349. package/dist/esm-es5/useChildElements-0146a8bd.js +1 -0
  350. package/dist/esm-es5/useDemoBigStat-022e116d.js +1 -0
  351. package/dist/esm-es5/useReferralTable-596519fc.js +1 -0
  352. package/dist/esm-es5/utils-1d345130.js +1 -0
  353. package/dist/mint-components/assets/Reward-image.png +0 -0
  354. package/dist/mint-components/global/styles.ts +14 -72
  355. package/dist/mint-components/mint-components.esm.js +1 -1
  356. package/dist/mint-components/mint-components.js +1 -1
  357. package/dist/mint-components/p-01748c80.system.entry.js +1 -0
  358. package/dist/mint-components/p-023dcaee.js +1 -0
  359. package/dist/mint-components/p-07b64287.entry.js +1 -0
  360. package/dist/mint-components/p-092d50be.js +161 -0
  361. package/dist/mint-components/p-0c19f830.entry.js +1 -0
  362. package/dist/mint-components/p-0d66fc45.js +239 -0
  363. package/dist/mint-components/p-0fa2ba69.js +1 -0
  364. package/dist/mint-components/p-10731460.entry.js +1 -0
  365. package/dist/mint-components/p-1288be55.entry.js +1 -0
  366. package/dist/mint-components/{p-0e8ae7e3.system.js → p-134f64dc.system.js} +11 -11
  367. package/dist/mint-components/{p-24fa8920.system.entry.js → p-136e2028.system.entry.js} +1 -1
  368. package/dist/mint-components/p-179988b5.js +1 -0
  369. package/dist/mint-components/p-182b47d2.system.entry.js +1 -0
  370. package/dist/mint-components/p-1959da16.system.js +1 -0
  371. package/dist/mint-components/p-197d1027.system.entry.js +1 -0
  372. package/dist/mint-components/p-1c17892a.system.js +1 -0
  373. package/dist/mint-components/p-1d1e9197.js +1 -0
  374. package/dist/mint-components/p-1f5124fb.system.js +1 -0
  375. package/dist/mint-components/p-1fbde87d.js +1 -0
  376. package/dist/mint-components/p-204fd08c.js +1 -0
  377. package/dist/mint-components/p-232db563.system.entry.js +1 -0
  378. package/dist/mint-components/p-233dfb7d.system.js +1 -0
  379. package/dist/mint-components/p-2454f30a.system.entry.js +1 -0
  380. package/dist/mint-components/p-249a778c.system.entry.js +1 -0
  381. package/dist/mint-components/p-27d25a4d.system.js +1 -0
  382. package/dist/mint-components/p-27e04aaf.entry.js +1 -0
  383. package/dist/mint-components/p-348461ec.system.entry.js +1 -0
  384. package/dist/mint-components/p-373fa002.js +1 -0
  385. package/dist/mint-components/p-396b5489.js +1 -0
  386. package/dist/mint-components/p-3a139510.entry.js +9 -0
  387. package/dist/mint-components/p-3b184c32.js +1 -0
  388. package/dist/mint-components/{p-1b7d89a7.system.js → p-3bbb90a9.system.js} +2 -2
  389. package/dist/mint-components/p-3d4a2da3.system.js +1 -0
  390. package/dist/mint-components/p-3e556042.js +1 -0
  391. package/dist/mint-components/p-4275c957.system.entry.js +1 -0
  392. package/dist/mint-components/p-4279da4b.system.js +1 -0
  393. package/dist/mint-components/p-48a408fe.system.entry.js +1 -0
  394. package/dist/mint-components/p-4932906c.system.entry.js +1 -0
  395. package/dist/mint-components/p-49c9ff69.entry.js +1 -0
  396. package/dist/mint-components/p-4a1b7d35.js +1 -0
  397. package/dist/mint-components/p-4e05c65a.js +1 -0
  398. package/dist/mint-components/p-51a0961b.system.js +1 -0
  399. package/dist/mint-components/p-53af4433.system.js +1 -0
  400. package/dist/mint-components/p-54986541.entry.js +1 -0
  401. package/dist/mint-components/p-58e718de.entry.js +1 -0
  402. package/dist/mint-components/p-591de129.js +1 -0
  403. package/dist/mint-components/p-5c75acad.js +1 -0
  404. package/dist/mint-components/p-614451ff.system.entry.js +1 -0
  405. package/dist/mint-components/p-616a0d9b.entry.js +1 -0
  406. package/dist/mint-components/p-63a6475a.system.entry.js +1 -0
  407. package/dist/mint-components/p-668bbbf4.system.js +1 -0
  408. package/dist/mint-components/p-6b43e4cc.system.js +1 -0
  409. package/dist/mint-components/p-6bff2131.entry.js +90 -0
  410. package/dist/mint-components/p-72a978c8.entry.js +1 -0
  411. package/dist/mint-components/p-73d5306f.js +1 -0
  412. package/dist/mint-components/p-76325d9c.system.entry.js +1 -0
  413. package/dist/mint-components/p-77fd4d51.system.entry.js +1 -0
  414. package/dist/mint-components/p-7ba0e231.js +1 -0
  415. package/dist/mint-components/p-7c423f5c.system.entry.js +1 -0
  416. package/dist/mint-components/p-7cfaab53.system.js +1 -0
  417. package/dist/mint-components/p-7d74b018.system.entry.js +1 -0
  418. package/dist/mint-components/p-81681ebd.system.entry.js +1 -0
  419. package/dist/mint-components/p-81f34787.js +1 -0
  420. package/dist/mint-components/p-839a13d1.js +1 -0
  421. package/dist/mint-components/p-871536c7.entry.js +1 -0
  422. package/dist/mint-components/p-88be9a23.js +1 -0
  423. package/dist/mint-components/p-89101dc5.system.js +1 -0
  424. package/dist/mint-components/p-8a55dda8.system.js +1 -0
  425. package/dist/mint-components/p-8bcaafaf.system.js +1 -0
  426. package/dist/mint-components/p-91d119ad.system.js +1 -0
  427. package/dist/mint-components/p-9294bb29.system.js +1 -0
  428. package/dist/mint-components/{p-015b683f.system.js → p-9580888c.system.js} +2 -2
  429. package/dist/mint-components/p-96c971fa.entry.js +1 -0
  430. package/dist/mint-components/p-975d4358.js +1 -0
  431. package/dist/mint-components/p-97f843f9.system.entry.js +1 -0
  432. package/dist/mint-components/p-98393bf0.entry.js +1 -0
  433. package/dist/mint-components/p-9b48d01e.js +1 -0
  434. package/dist/mint-components/p-9f65904f.entry.js +1 -0
  435. package/dist/mint-components/p-a09e3176.system.js +1 -0
  436. package/dist/mint-components/p-a10bbd50.system.entry.js +1 -0
  437. package/dist/mint-components/p-a5a7c655.js +1 -0
  438. package/dist/mint-components/p-a674c833.system.entry.js +1 -0
  439. package/dist/mint-components/p-a85dd98a.js +1 -0
  440. package/dist/mint-components/p-aecf30cf.js +30 -0
  441. package/dist/mint-components/p-b0c32d15.system.js +1 -0
  442. package/dist/mint-components/p-b0d6a380.system.js +1 -0
  443. package/dist/mint-components/p-b0e8c584.system.entry.js +1 -0
  444. package/dist/mint-components/p-b3201e4c.entry.js +1 -0
  445. package/dist/mint-components/p-b3af1c6f.js +1 -0
  446. package/dist/mint-components/p-b474a676.system.entry.js +1 -0
  447. package/dist/mint-components/p-b62cb89c.system.js +1 -0
  448. package/dist/mint-components/p-b69365f5.entry.js +1 -0
  449. package/dist/mint-components/{p-44578b22.js → p-b7da9a8a.js} +1 -1
  450. package/dist/mint-components/p-b8434fc0.system.js +1 -0
  451. package/dist/mint-components/p-b9974b87.entry.js +1 -0
  452. package/dist/mint-components/p-bc19e1c2.system.js +1 -0
  453. package/dist/mint-components/p-bf055b6c.system.js +1 -0
  454. package/dist/mint-components/p-c3f300e8.system.js +1 -0
  455. package/dist/mint-components/p-c432ee49.entry.js +13 -0
  456. package/dist/mint-components/p-c7c42e0d.entry.js +1 -0
  457. package/dist/mint-components/p-ca48cd52.entry.js +150 -0
  458. package/dist/mint-components/p-caad0168.entry.js +1 -0
  459. package/dist/mint-components/p-ce0ec1c4.system.js +1 -0
  460. package/dist/mint-components/p-d1520098.js +1 -0
  461. package/dist/mint-components/p-d312db42.entry.js +1 -0
  462. package/dist/mint-components/p-d33eb961.js +1 -0
  463. package/dist/mint-components/p-d6ef4765.system.entry.js +1 -0
  464. package/dist/mint-components/p-dcff1a85.entry.js +1 -0
  465. package/dist/mint-components/p-df466813.system.js +1 -0
  466. package/dist/mint-components/p-e00e11b1.system.js +1 -0
  467. package/dist/mint-components/p-e08f5f8e.js +1 -0
  468. package/dist/mint-components/p-e1166d9b.system.entry.js +1 -0
  469. package/dist/mint-components/{p-8fd8682c.js → p-e43c77bd.js} +153 -153
  470. package/dist/mint-components/p-e7b20665.entry.js +1 -0
  471. package/dist/mint-components/p-ea110693.system.js +1 -0
  472. package/dist/mint-components/p-ea197664.js +1 -0
  473. package/dist/mint-components/p-efae86df.system.js +1 -0
  474. package/dist/mint-components/p-f241ee8a.system.entry.js +1 -0
  475. package/dist/mint-components/p-f2a74222.system.entry.js +1 -0
  476. package/dist/mint-components/p-f2fccdea.system.entry.js +1 -0
  477. package/dist/mint-components/p-f372c8d8.entry.js +1 -0
  478. package/dist/mint-components/p-f5cba1f7.system.entry.js +1 -0
  479. package/dist/mint-components/{p-e608f340.entry.js → p-f6989de4.entry.js} +2 -2
  480. package/dist/mint-components/p-f8d95abc.system.js +1 -0
  481. package/dist/mint-components/p-fdf7b1d0.entry.js +1 -0
  482. package/dist/types/components/sqm-big-stat/BigStat.stories.d.ts +3 -0
  483. package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +1 -0
  484. package/dist/types/components/sqm-big-stat/sqm-big-stat.d.ts +6 -0
  485. package/dist/types/components/sqm-big-stat/useBigStat.d.ts +1 -0
  486. package/dist/types/components/sqm-brand/SqmBrand.stories.d.ts +4 -0
  487. package/dist/types/components/sqm-brand/sqm-brand.d.ts +8 -0
  488. package/dist/types/components/sqm-card-feed/CardFeed.stories.d.ts +12 -0
  489. package/dist/types/components/sqm-card-feed/sqm-card-feed-view.d.ts +6 -0
  490. package/dist/types/components/sqm-card-feed/sqm-card-feed.d.ts +18 -0
  491. package/dist/types/components/sqm-empty/sqm-empty-view.d.ts +7 -0
  492. package/dist/types/components/sqm-empty/sqm-empty.d.ts +18 -0
  493. package/dist/types/components/sqm-hero-image/HeroImage.stories.d.ts +23 -0
  494. package/dist/types/components/sqm-hero-image/sqm-hero-image-view.d.ts +21 -0
  495. package/dist/types/components/sqm-hero-image/sqm-hero-image.d.ts +88 -0
  496. package/dist/types/components/sqm-image/Image.stories.d.ts +13 -0
  497. package/dist/types/components/sqm-image/sqm-image-view.d.ts +10 -0
  498. package/dist/types/components/sqm-image/sqm-image.d.ts +27 -0
  499. package/dist/types/components/sqm-leaderboard/Leaderboard.stories.d.ts +7 -1
  500. package/dist/types/components/sqm-leaderboard/UseLeaderboard.stories.d.ts +6 -0
  501. package/dist/types/components/sqm-leaderboard/sqm-leaderboard-view.d.ts +10 -0
  502. package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +12 -2
  503. package/dist/types/components/sqm-leaderboard/useLeaderboard.d.ts +3 -0
  504. package/dist/types/components/sqm-navigation-sidebar-item/sqm-navigation-sidebar-item.d.ts +2 -0
  505. package/dist/types/components/sqm-portal-container/PortalContainer.stories.d.ts +15 -0
  506. package/dist/types/components/sqm-portal-container/sqm-portal-container-view.d.ts +3 -0
  507. package/dist/types/components/sqm-portal-container/sqm-portal-container.d.ts +14 -0
  508. package/dist/types/components/sqm-portal-email-verification/sqm-portal-email-verification.d.ts +6 -0
  509. package/dist/types/components/sqm-portal-forgot-password/sqm-portal-forgot-password-view.d.ts +1 -0
  510. package/dist/types/components/sqm-portal-forgot-password/sqm-portal-forgot-password.d.ts +10 -0
  511. package/dist/types/components/sqm-portal-forgot-password/usePortalForgotPassword.d.ts +3 -1
  512. package/dist/types/components/sqm-portal-login/sqm-portal-login-view.d.ts +2 -0
  513. package/dist/types/components/sqm-portal-login/sqm-portal-login.d.ts +8 -0
  514. package/dist/types/components/sqm-portal-login/usePortalLogin.d.ts +3 -3
  515. package/dist/types/components/sqm-portal-register/PortalRegister.stories.d.ts +1 -0
  516. package/dist/types/components/sqm-portal-register/sqm-portal-register-view.d.ts +6 -3
  517. package/dist/types/components/sqm-portal-register/sqm-portal-register.d.ts +10 -0
  518. package/dist/types/components/sqm-portal-register/usePortalRegister.d.ts +1 -0
  519. package/dist/types/components/sqm-portal-reset-password/sqm-portal-reset-password.d.ts +8 -0
  520. package/dist/types/components/sqm-portal-verify-email/sqm-portal-verify-email.d.ts +8 -0
  521. package/dist/types/components/sqm-portal-verify-email/usePortalVerifyEmail.d.ts +2 -1
  522. package/dist/types/components/sqm-program-explainer/ProgramExplainer.stories.d.ts +4 -2
  523. package/dist/types/components/sqm-program-explainer/sqm-program-explainer-view.d.ts +2 -4
  524. package/dist/types/components/sqm-program-explainer/sqm-program-explainer.d.ts +5 -13
  525. package/dist/types/components/sqm-program-explainer-step/ProgramExplainerStep.stories.d.ts +5 -1
  526. package/dist/types/components/sqm-program-explainer-step/sqm-program-explainer-step-view.d.ts +5 -4
  527. package/dist/types/components/sqm-program-explainer-step/sqm-program-explainer-step.d.ts +15 -6
  528. package/dist/types/components/sqm-referral-card/ReferralCard.stories.d.ts +15 -0
  529. package/dist/types/components/sqm-referral-card/sqm-referral-card-view.d.ts +9 -0
  530. package/dist/types/components/sqm-referral-card/sqm-referral-card.d.ts +15 -0
  531. package/dist/types/components/sqm-referral-table/ReferralTable.stories.d.ts +30 -0
  532. package/dist/types/components/sqm-referral-table/ReferralTableCell.stories.d.ts +3 -0
  533. package/dist/types/components/sqm-referral-table/ReferralTableRewardsCell.stories.d.ts +3 -0
  534. package/dist/types/components/sqm-referral-table/UseReferralTable.stories.d.ts +28 -0
  535. package/dist/types/components/sqm-referral-table/cells/sqm-referral-table-date-cell.d.ts +2 -1
  536. package/dist/types/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.d.ts +7 -0
  537. package/dist/types/components/sqm-referral-table/cells/sqm-referral-table-user-cell.d.ts +1 -1
  538. package/dist/types/components/sqm-referral-table/columns/ReferralTableColumn.d.ts +1 -1
  539. package/dist/types/components/sqm-referral-table/columns/sqm-referral-table-date-column.d.ts +1 -1
  540. package/dist/types/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.d.ts +25 -1
  541. package/dist/types/components/sqm-referral-table/sqm-referral-table-view.d.ts +1 -1
  542. package/dist/types/components/sqm-referral-table/sqm-referral-table.d.ts +8 -2
  543. package/dist/types/components/sqm-referral-table/useReferralTable.d.ts +4 -2
  544. package/dist/types/components/sqm-refresh-button/RefreshButtonView.d.ts +15 -0
  545. package/dist/types/components/sqm-refresh-button/sqm-refresh-button.d.ts +12 -0
  546. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +12 -4
  547. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +571 -6
  548. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +3 -0
  549. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list.d.ts +47 -0
  550. package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +0 -1
  551. package/dist/types/components/sqm-rewards-table/RewardsTable.stories.d.ts +14 -0
  552. package/dist/types/components/sqm-rewards-table/RewardsTableCell.stories.d.ts +33 -0
  553. package/dist/types/components/sqm-rewards-table/UseRewardsTable.stories.d.ts +18 -0
  554. package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-date-cell.d.ts +1 -0
  555. package/dist/types/components/sqm-rewards-table/cells/{sqm-rewards-table-rewards-cell.d.ts → sqm-rewards-table-reward-cell.d.ts} +3 -1
  556. package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-source-cell.d.ts +6 -0
  557. package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.d.ts +5 -0
  558. package/dist/types/components/sqm-rewards-table/columns/RewardTableColumn.d.ts +1 -1
  559. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-date-column.d.ts +1 -1
  560. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-reward-column.d.ts +9 -5
  561. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-source-column.d.ts +15 -1
  562. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-status-column.d.ts +6 -2
  563. package/dist/types/components/sqm-rewards-table/sqm-rewards-table.d.ts +6 -2
  564. package/dist/types/components/sqm-scroll/Scroll.stories.d.ts +7 -0
  565. package/dist/types/components/sqm-scroll/sqm-scroll.d.ts +11 -0
  566. package/dist/types/components/sqm-share-button/ShareButton.stories.d.ts +8 -1
  567. package/dist/types/components/sqm-share-button/sqm-share-button-view.d.ts +3 -0
  568. package/dist/types/components/sqm-share-button/sqm-share-button.d.ts +18 -2
  569. package/dist/types/components/sqm-share-code/ShareCode.stories.d.ts +10 -0
  570. package/dist/types/components/sqm-share-link/ShareLink.stories.d.ts +3 -0
  571. package/dist/types/components/sqm-stencilbook/Resizer.d.ts +1 -1
  572. package/dist/types/components/sqm-stencilbook/Themes.d.ts +1 -1
  573. package/dist/types/components/sqm-tab/sqm-tab-view.d.ts +4 -0
  574. package/dist/types/components/sqm-tab/sqm-tab.d.ts +6 -0
  575. package/dist/types/{tables → components/sqm-table-cell}/sqm-table-cell.d.ts +0 -0
  576. package/dist/types/{tables → components/sqm-table-row}/sqm-table-row.d.ts +0 -0
  577. package/dist/types/components/sqm-tabs/Tabs.stories.d.ts +14 -0
  578. package/dist/types/components/sqm-tabs/sqm-tabs-view.d.ts +8 -0
  579. package/dist/types/components/sqm-tabs/sqm-tabs.d.ts +5 -0
  580. package/dist/types/components/sqm-tabs/useTabs.d.ts +6 -0
  581. package/dist/types/components/sqm-task-card/DetailsView.d.ts +41 -0
  582. package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +6 -0
  583. package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +1 -1
  584. package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +32 -15
  585. package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +49 -5
  586. package/dist/types/components/sqm-task-card/useTaskCard.d.ts +11 -0
  587. package/dist/types/components/sqm-timeline/SVGs.d.ts +3 -0
  588. package/dist/types/components/sqm-timeline/Timeline.stories.d.ts +11 -0
  589. package/dist/types/components/sqm-timeline/sqm-timeline-entry.d.ts +31 -0
  590. package/dist/types/components/sqm-timeline/sqm-timeline.d.ts +15 -0
  591. package/dist/types/components/sqm-titled-section/TitledSection.stories.d.ts +12 -0
  592. package/dist/types/components/sqm-titled-section/sqm-portal-section-view.d.ts +1 -0
  593. package/dist/types/components/sqm-titled-section/sqm-titled-section.d.ts +12 -1
  594. package/dist/types/components/sqm-user-name/sqm-user-name.d.ts +1 -1
  595. package/dist/types/components.d.ts +1122 -101
  596. package/dist/types/global/styles.d.ts +1 -1
  597. package/dist/types/saasquatch.d.ts +5 -0
  598. package/dist/types/styling/JSS.d.ts +7 -0
  599. package/dist/types/tables/GenericTableView.d.ts +4 -1
  600. package/dist/types/tables/TableSlots.d.ts +1 -0
  601. package/dist/types/utils/utils.d.ts +1 -0
  602. package/grapesjs/grapesjs.js +1 -1
  603. package/package.json +10 -11
  604. package/dist/cjs/ShadowViewAddon-475e00d3.js +0 -127
  605. package/dist/cjs/sqm-brand_38.cjs.entry.js +0 -29924
  606. package/dist/cjs/sqm-leaderboard-rank-view-510f16d3.js +0 -131
  607. package/dist/cjs/sqm-leaderboard.cjs.entry.js +0 -69
  608. package/dist/cjs/sqm-portal-container.cjs.entry.js +0 -35
  609. package/dist/cjs/sqm-program-explainer-step-view-6a01cda0.js +0 -70
  610. package/dist/cjs/sqm-program-explainer-step.cjs.entry.js +0 -22
  611. package/dist/cjs/sqm-program-explainer-view-8a4af972.js +0 -45
  612. package/dist/cjs/sqm-program-explainer.cjs.entry.js +0 -23
  613. package/dist/cjs/sqm-referral-table-column.cjs.entry.js +0 -30
  614. package/dist/cjs/sqm-referral-table-date-column.cjs.entry.js +0 -47
  615. package/dist/cjs/sqm-referral-table-rewards-column.cjs.entry.js +0 -38
  616. package/dist/cjs/sqm-referral-table-status-column.cjs.entry.js +0 -45
  617. package/dist/cjs/sqm-referral-table-user-column.cjs.entry.js +0 -57
  618. package/dist/cjs/sqm-share-code.cjs.entry.js +0 -106
  619. package/dist/cjs/sqm-share-link-view-a935d07e.js +0 -24
  620. package/dist/cjs/sqm-titled-section.cjs.entry.js +0 -36
  621. package/dist/cjs/use-callback-fadb2643.js +0 -7
  622. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.css +0 -37
  623. package/dist/collection/components/sqm-reward-exchange-list/assets/placeholder.png +0 -0
  624. package/dist/esm/ShadowViewAddon-558fabb7.js +0 -122
  625. package/dist/esm/sqm-brand_38.entry.js +0 -29883
  626. package/dist/esm/sqm-leaderboard-rank-view-cd1e8962.js +0 -128
  627. package/dist/esm/sqm-leaderboard.entry.js +0 -65
  628. package/dist/esm/sqm-portal-container.entry.js +0 -31
  629. package/dist/esm/sqm-program-explainer-step-view-41c1eecd.js +0 -68
  630. package/dist/esm/sqm-program-explainer-step.entry.js +0 -18
  631. package/dist/esm/sqm-program-explainer-view-098a64a9.js +0 -43
  632. package/dist/esm/sqm-program-explainer.entry.js +0 -19
  633. package/dist/esm/sqm-referral-table-column.entry.js +0 -26
  634. package/dist/esm/sqm-referral-table-date-column.entry.js +0 -43
  635. package/dist/esm/sqm-referral-table-rewards-column.entry.js +0 -34
  636. package/dist/esm/sqm-referral-table-status-column.entry.js +0 -41
  637. package/dist/esm/sqm-referral-table-user-column.entry.js +0 -53
  638. package/dist/esm/sqm-share-code.entry.js +0 -102
  639. package/dist/esm/sqm-share-link-view-9282b8e8.js +0 -22
  640. package/dist/esm/sqm-titled-section.entry.js +0 -32
  641. package/dist/esm-es5/ShadowViewAddon-558fabb7.js +0 -1
  642. package/dist/esm-es5/index.module-eb50a8d2.js +0 -1
  643. package/dist/esm-es5/re-render-6d5b856e.js +0 -1
  644. package/dist/esm-es5/sqm-asset-card-view-6f360937.js +0 -1
  645. package/dist/esm-es5/sqm-brand_38.entry.js +0 -1
  646. package/dist/esm-es5/sqm-hero-view-bfd8abd1.js +0 -1
  647. package/dist/esm-es5/sqm-leaderboard-rank-view-cd1e8962.js +0 -1
  648. package/dist/esm-es5/sqm-leaderboard.entry.js +0 -1
  649. package/dist/esm-es5/sqm-name-fields-view-4162fb7b.js +0 -1
  650. package/dist/esm-es5/sqm-navigation-sidebar-item-view-2d8c368c.js +0 -1
  651. package/dist/esm-es5/sqm-navigation-sidebar-view-2242502c.js +0 -1
  652. package/dist/esm-es5/sqm-portal-container-view-73757ca5.js +0 -1
  653. package/dist/esm-es5/sqm-portal-container.entry.js +0 -1
  654. package/dist/esm-es5/sqm-portal-email-verification-view-2af31979.js +0 -1
  655. package/dist/esm-es5/sqm-portal-footer-view-60cd9ae5.js +0 -1
  656. package/dist/esm-es5/sqm-portal-forgot-password-view-e3a6a716.js +0 -1
  657. package/dist/esm-es5/sqm-portal-profile-view-f1deea0f.js +0 -1
  658. package/dist/esm-es5/sqm-portal-reset-password-view-a4e50da2.js +0 -1
  659. package/dist/esm-es5/sqm-portal-section-view-f0876545.js +0 -1
  660. package/dist/esm-es5/sqm-portal-verify-email-view-6f18bac2.js +0 -1
  661. package/dist/esm-es5/sqm-program-explainer-step-view-41c1eecd.js +0 -1
  662. package/dist/esm-es5/sqm-program-explainer-step.entry.js +0 -1
  663. package/dist/esm-es5/sqm-program-explainer-view-098a64a9.js +0 -1
  664. package/dist/esm-es5/sqm-program-explainer.entry.js +0 -1
  665. package/dist/esm-es5/sqm-referral-table-column.entry.js +0 -1
  666. package/dist/esm-es5/sqm-referral-table-date-column.entry.js +0 -1
  667. package/dist/esm-es5/sqm-referral-table-rewards-column.entry.js +0 -1
  668. package/dist/esm-es5/sqm-referral-table-status-column.entry.js +0 -1
  669. package/dist/esm-es5/sqm-referral-table-user-column.entry.js +0 -1
  670. package/dist/esm-es5/sqm-share-code.entry.js +0 -1
  671. package/dist/esm-es5/sqm-share-link-view-9282b8e8.js +0 -1
  672. package/dist/esm-es5/sqm-stat-container-view-4133feb6.js +0 -1
  673. package/dist/esm-es5/sqm-text-span-view-1781df94.js +0 -1
  674. package/dist/esm-es5/sqm-titled-section.entry.js +0 -1
  675. package/dist/esm-es5/use-callback-b38a1523.js +0 -1
  676. package/dist/esm-es5/useDemoBigStat-d227b2f9.js +0 -1
  677. package/dist/esm-es5/utils-454405f5.js +0 -1
  678. package/dist/mint-components/assets/placeholder.png +0 -0
  679. package/dist/mint-components/p-02dc36a4.system.js +0 -1
  680. package/dist/mint-components/p-03e93c82.system.js +0 -1
  681. package/dist/mint-components/p-0a39b23c.system.entry.js +0 -1
  682. package/dist/mint-components/p-0bcefa93.entry.js +0 -1
  683. package/dist/mint-components/p-0d8b2757.system.entry.js +0 -1
  684. package/dist/mint-components/p-10103ce2.system.js +0 -1
  685. package/dist/mint-components/p-12071042.system.entry.js +0 -1
  686. package/dist/mint-components/p-1575e8a3.system.js +0 -1
  687. package/dist/mint-components/p-1705e549.entry.js +0 -1
  688. package/dist/mint-components/p-1b5b5928.system.js +0 -1
  689. package/dist/mint-components/p-1e182e88.system.js +0 -1
  690. package/dist/mint-components/p-1f95b411.js +0 -1
  691. package/dist/mint-components/p-2027edc0.system.entry.js +0 -1
  692. package/dist/mint-components/p-20c95798.entry.js +0 -1
  693. package/dist/mint-components/p-21b4044a.entry.js +0 -1
  694. package/dist/mint-components/p-21df3f85.system.entry.js +0 -1
  695. package/dist/mint-components/p-221bd06e.js +0 -1
  696. package/dist/mint-components/p-2338162a.entry.js +0 -1
  697. package/dist/mint-components/p-282ed862.js +0 -1
  698. package/dist/mint-components/p-29ee7d11.system.entry.js +0 -1
  699. package/dist/mint-components/p-2e63dcfd.system.js +0 -1
  700. package/dist/mint-components/p-3143cce4.entry.js +0 -1
  701. package/dist/mint-components/p-34112d74.entry.js +0 -1
  702. package/dist/mint-components/p-34696973.system.js +0 -1
  703. package/dist/mint-components/p-35476f7e.system.js +0 -1
  704. package/dist/mint-components/p-40e83a85.system.js +0 -1
  705. package/dist/mint-components/p-412d31b1.js +0 -1
  706. package/dist/mint-components/p-46493de5.system.entry.js +0 -1
  707. package/dist/mint-components/p-4658d225.system.entry.js +0 -1
  708. package/dist/mint-components/p-4b719313.js +0 -1
  709. package/dist/mint-components/p-509dda90.js +0 -1
  710. package/dist/mint-components/p-53b0c355.system.js +0 -1
  711. package/dist/mint-components/p-53e51b3f.entry.js +0 -1
  712. package/dist/mint-components/p-53ec4863.entry.js +0 -1
  713. package/dist/mint-components/p-547a0354.system.js +0 -1
  714. package/dist/mint-components/p-55f8387d.system.js +0 -1
  715. package/dist/mint-components/p-562199e3.system.js +0 -1
  716. package/dist/mint-components/p-5939212e.system.entry.js +0 -1
  717. package/dist/mint-components/p-5d925bb6.js +0 -1
  718. package/dist/mint-components/p-5e4e7f01.system.js +0 -1
  719. package/dist/mint-components/p-60ae1ec5.system.js +0 -1
  720. package/dist/mint-components/p-61acba7a.js +0 -1
  721. package/dist/mint-components/p-65c79eec.entry.js +0 -1
  722. package/dist/mint-components/p-69f28472.system.js +0 -1
  723. package/dist/mint-components/p-6d27cd05.system.entry.js +0 -1
  724. package/dist/mint-components/p-739b3032.js +0 -1
  725. package/dist/mint-components/p-748ad4f5.entry.js +0 -1
  726. package/dist/mint-components/p-759d3800.entry.js +0 -13
  727. package/dist/mint-components/p-760762d3.entry.js +0 -13
  728. package/dist/mint-components/p-7cdbe82a.entry.js +0 -1
  729. package/dist/mint-components/p-7ff22998.system.entry.js +0 -1
  730. package/dist/mint-components/p-81786aa0.js +0 -1
  731. package/dist/mint-components/p-85efd952.entry.js +0 -1
  732. package/dist/mint-components/p-86255b95.entry.js +0 -1
  733. package/dist/mint-components/p-88fdfd94.system.entry.js +0 -1
  734. package/dist/mint-components/p-8ec5127e.system.entry.js +0 -1
  735. package/dist/mint-components/p-952ed169.js +0 -1
  736. package/dist/mint-components/p-97b946c2.system.entry.js +0 -1
  737. package/dist/mint-components/p-99f1208f.js +0 -1
  738. package/dist/mint-components/p-9b4f2af6.js +0 -1
  739. package/dist/mint-components/p-9be0cb19.entry.js +0 -1
  740. package/dist/mint-components/p-9c79643f.system.js +0 -1
  741. package/dist/mint-components/p-a0a26fc5.system.entry.js +0 -1
  742. package/dist/mint-components/p-a355eeaf.system.entry.js +0 -1
  743. package/dist/mint-components/p-a565e753.entry.js +0 -1
  744. package/dist/mint-components/p-a8246a50.system.entry.js +0 -1
  745. package/dist/mint-components/p-a831de18.entry.js +0 -1
  746. package/dist/mint-components/p-a833dbb3.js +0 -1
  747. package/dist/mint-components/p-a88a08bb.system.js +0 -1
  748. package/dist/mint-components/p-a8b913a8.js +0 -1
  749. package/dist/mint-components/p-a9a6f205.entry.js +0 -1
  750. package/dist/mint-components/p-aaf68d9d.system.js +0 -1
  751. package/dist/mint-components/p-aee83885.system.entry.js +0 -1
  752. package/dist/mint-components/p-b86cbac3.system.entry.js +0 -1
  753. package/dist/mint-components/p-b90574e5.entry.js +0 -372
  754. package/dist/mint-components/p-ba505a8c.js +0 -1
  755. package/dist/mint-components/p-bb76c6f3.system.js +0 -1
  756. package/dist/mint-components/p-bd903567.js +0 -1
  757. package/dist/mint-components/p-be3a0cc4.system.js +0 -1
  758. package/dist/mint-components/p-c0f9d0b1.entry.js +0 -1
  759. package/dist/mint-components/p-c3bf9440.entry.js +0 -1
  760. package/dist/mint-components/p-c65cfc9d.system.js +0 -1
  761. package/dist/mint-components/p-ca40dbaa.system.entry.js +0 -1
  762. package/dist/mint-components/p-cc189fc4.system.js +0 -1
  763. package/dist/mint-components/p-cc652a53.entry.js +0 -1
  764. package/dist/mint-components/p-d19d6012.js +0 -235
  765. package/dist/mint-components/p-d3c7dbfc.entry.js +0 -1
  766. package/dist/mint-components/p-d4a1bce9.system.entry.js +0 -1
  767. package/dist/mint-components/p-d68f6b64.system.entry.js +0 -1
  768. package/dist/mint-components/p-d7d6bf44.system.js +0 -1
  769. package/dist/mint-components/p-db5a1e78.js +0 -1
  770. package/dist/mint-components/p-e069bc2d.entry.js +0 -1
  771. package/dist/mint-components/p-e14c15ca.system.entry.js +0 -1
  772. package/dist/mint-components/p-e36ff7fa.entry.js +0 -1
  773. package/dist/mint-components/p-e426715b.js +0 -1
  774. package/dist/mint-components/p-e43cc1f8.system.entry.js +0 -1
  775. package/dist/mint-components/p-e7cb4274.system.entry.js +0 -1
  776. package/dist/mint-components/p-ebcd8a59.js +0 -1
  777. package/dist/mint-components/p-ee684b5f.js +0 -1
  778. package/dist/mint-components/p-ef7f70f2.system.entry.js +0 -1
  779. package/dist/mint-components/p-f20d9204.system.entry.js +0 -1
  780. package/dist/mint-components/p-f5cfc52a.entry.js +0 -1
  781. package/dist/mint-components/p-f7f87338.js +0 -1
  782. package/dist/mint-components/p-f85f36c6.system.entry.js +0 -1
  783. package/dist/mint-components/p-f9ada3d7.system.js +0 -1
  784. package/dist/mint-components/p-f9cb55dc.entry.js +0 -1
  785. package/dist/mint-components/p-faf66fdb.js +0 -17
  786. package/dist/mint-components/p-fb1b6fdf.js +0 -1
  787. package/dist/mint-components/p-fcd03042.entry.js +0 -1
  788. package/dist/mint-components/p-fd281e6b.system.entry.js +0 -1
  789. package/dist/mint-components/p-fee468b7.system.entry.js +0 -1
  790. package/dist/mint-components/p-fee6801c.js +0 -1
@@ -0,0 +1,2582 @@
1
+ import { h, c as Host, d as getAssetPath, g as getElement } from './index-17b4da69.js';
2
+ import { k as useState } from './stencil-hooks.module-2f159754.js';
3
+ import { i as intl } from './global-c2179248.js';
4
+ import { d as dist, M, n as ne, x, b as mn, D as De, f as D } from './index.module-ec3dcc82.js';
5
+ import { H as HostBlock, A as AuthWrapper, a as AuthColumn, b as AuthButtonsContainer, E as ErrorStyles } from './mixins-10353a39.js';
6
+ import { c as createStyleSheet } from './JSS-96eeab98.js';
7
+ import { l as luxon } from './luxon-5fa22651.js';
8
+ import { l as luxonLocale } from './utils-1d345130.js';
9
+ import { T as TextSpanView } from './sqm-text-span-view-7e61c95c.js';
10
+ import { P as PortalContainerView } from './sqm-portal-container-view-f74db584.js';
11
+ import { P as PortalSectionView } from './sqm-portal-section-view-88a80af9.js';
12
+
13
+ const medium = {
14
+ facebook: { color: "#1877f2", text: "#fff", icon: "facebook" },
15
+ twitter: { color: "#1da1f2", text: "#fff", icon: "twitter" },
16
+ email: { color: "#666666", text: "#fff", icon: "envelope" },
17
+ direct: { color: "var(--sl-color-primary-500)", text: "#fff", icon: "send" },
18
+ linkedin: { color: "#0077b5", text: "#fff", icon: "linkedin" },
19
+ sms: { color: "#34DA50", text: "#fff", icon: "chat" },
20
+ fbmessenger: { color: "#0084ff", text: "#fff", icon: "messenger" },
21
+ whatsapp: { color: "#25d366", text: "#fff", icon: "whatsapp" },
22
+ linemessenger: { color: "#00B300", text: "#fff", icon: "line" },
23
+ pinterest: { color: "#e60023", text: "#fff", icon: "pinterest" },
24
+ };
25
+ function ShareButtonView(props, children) {
26
+ const vanillaStyle = `
27
+ *::part(base) {
28
+ --sl-focus-ring-color-primary: ${props.backgroundcolor
29
+ ? props.backgroundcolor
30
+ : props.medium
31
+ ? medium[props.medium].color
32
+ : ""}80!important;
33
+
34
+ background: ${props.backgroundcolor
35
+ ? props.backgroundcolor
36
+ : props.medium
37
+ ? medium[props.medium].color
38
+ : ""};
39
+ color: ${props.textcolor
40
+ ? props.textcolor
41
+ : props.medium
42
+ ? medium[props.medium].text
43
+ : ""};
44
+ border-radius: ${props.borderradius ? props.borderradius + "px" : ""};
45
+ }
46
+
47
+ *::part(base):hover {
48
+ border-color: ${props.backgroundcolor
49
+ ? props.backgroundcolor
50
+ : props.medium
51
+ ? medium[props.medium].color
52
+ : ""}D1!important;
53
+ }
54
+
55
+ *::part(base):focus {
56
+ border-color: ${props.backgroundcolor
57
+ ? props.backgroundcolor
58
+ : props.medium
59
+ ? medium[props.medium].color
60
+ : ""}D1!important;
61
+ }
62
+
63
+ *::part(label) {
64
+ position: relative;
65
+ top: 2%;
66
+ }
67
+ `;
68
+ const style = {
69
+ HostBlock: HostBlock,
70
+ buttonStyle: {
71
+ display: "flex",
72
+ alignItems: "center",
73
+ justifyContent: "center",
74
+ lineHeight: "0",
75
+ },
76
+ };
77
+ const sheet = createStyleSheet(style);
78
+ const styleString = sheet.toString();
79
+ return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
80
+ h("style", { type: "text/css" }, styleString),
81
+ h("style", { type: "text/css" }, vanillaStyle),
82
+ h("sl-button", { class: sheet.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` },
83
+ !props.hideicon && (h("sl-icon", { slot: props.iconslot || "prefix", name: props.icon ? props.icon : medium[props.medium].icon, exportparts: "icon" })),
84
+ !props.hidetext && children)));
85
+ }
86
+
87
+ const style = {
88
+ HostBlock: HostBlock,
89
+ inputStyle: {
90
+ "&::part(base)": { background: "white", opacity: "1", cursor: "pointer" },
91
+ },
92
+ };
93
+ const sheet = createStyleSheet(style);
94
+ const styleString = sheet.toString();
95
+ function ShareLinkView(props) {
96
+ return (h("div", null,
97
+ h("style", { type: "text/css" }, styleString),
98
+ h("sl-tooltip", { trigger: "manual", content: props.tooltiptext, placement: "top-end", disabled: props.disabled, open: props.open },
99
+ h("sl-input", { class: sheet.classes.inputStyle, exportparts: "label: input-label", value: props.shareString, readonly: true },
100
+ h("sl-icon-button", { onClick: () => { var _a; return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props); }, slot: "suffix", name: "files", disabled: props.disabled })))));
101
+ }
102
+
103
+ const style$1 = {
104
+ Leaderboard: {
105
+ "& table": {
106
+ width: "100%",
107
+ borderCollapse: "collapse",
108
+ },
109
+ "& th": {
110
+ textAlign: "left",
111
+ padding: "var(--sl-spacing-medium)",
112
+ paddingTop: "0",
113
+ fontSize: "var(--sl-font-size-medium)",
114
+ fontWeight: "var(--sl-font-weight-semibold)",
115
+ },
116
+ "& tr:not(:first-child)": {
117
+ borderTop: "1px solid var(--sl-color-neutral-200)",
118
+ },
119
+ "& td": {
120
+ fontSize: "var(--sl-font-size-medium)",
121
+ fontWeight: "var(--sl-font-weight-normal)",
122
+ },
123
+ "& .ellipses": {
124
+ textAlign: "center",
125
+ padding: "0",
126
+ color: "var(--sl-color-neutral-500)",
127
+ },
128
+ "& .highlight": {
129
+ background: "var(--sl-color-primary-50)",
130
+ },
131
+ "& td, th": {
132
+ color: "var(--sl-color-gray-800)",
133
+ padding: "var(--sl-spacing-medium)",
134
+ },
135
+ "& .User": {
136
+ width: "100%",
137
+ },
138
+ "& .Score": {
139
+ width: "auto",
140
+ whiteSpace: "nowrap",
141
+ },
142
+ },
143
+ };
144
+ const sheet$1 = createStyleSheet(style$1);
145
+ const styleString$1 = sheet$1.toString();
146
+ const vanillaStyle = `
147
+ :host{
148
+ display: block;
149
+ }
150
+ `;
151
+ function LeaderboardView(props) {
152
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
153
+ const { states, data, elements } = props;
154
+ const { styles } = states;
155
+ if (states.loading)
156
+ return (h("div", { class: sheet$1.classes.Leaderboard },
157
+ h("style", { type: "text/css" },
158
+ styleString$1,
159
+ vanillaStyle),
160
+ elements.loadingstate));
161
+ let userSeenFlag = false;
162
+ return (h("div", { class: sheet$1.classes.Leaderboard },
163
+ h("style", { type: "text/css" },
164
+ styleString$1,
165
+ vanillaStyle),
166
+ h("table", null,
167
+ h("tr", null,
168
+ styles.showRank && h("th", { class: "Rank" }, styles.rankheading),
169
+ h("th", { class: "User" }, styles.usersheading),
170
+ h("th", { class: "Score" }, styles.statsheading)),
171
+ !states.hasLeaders && (h("tr", null,
172
+ h("td", { colSpan: 100 }, elements.empty))), (_a = data.leaderboard) === null || _a === void 0 ? void 0 :
173
+ _a.map((user) => {
174
+ var _a, _b;
175
+ if (user.rowNumber === ((_a = data.userRank) === null || _a === void 0 ? void 0 : _a.rowNumber))
176
+ userSeenFlag = true;
177
+ return (h("tr", { class: user.rowNumber === ((_b = data.userRank) === null || _b === void 0 ? void 0 : _b.rowNumber) ? "highlight" : "" },
178
+ styles.showRank && h("td", { class: "Rank" }, user.rank),
179
+ h("td", { class: "User" }, user.firstName && user.lastInitial
180
+ ? user.firstName + " " + user.lastInitial
181
+ : user.firstName || user.lastInitial
182
+ ? user.firstName || user.lastInitial
183
+ : styles.anonymousUser || "Anonymous User"),
184
+ h("td", { class: "Score" }, user.value)));
185
+ }),
186
+ states.hasLeaders && !userSeenFlag && data.showUser && (h("tr", null,
187
+ h("td", { colSpan: 100, class: "ellipses" },
188
+ h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
189
+ states.hasLeaders && !userSeenFlag && data.showUser && (h("tr", { class: "highlight" },
190
+ styles.showRank && (h("td", { class: "Rank" }, ((_b = data.userRank) === null || _b === void 0 ? void 0 : _b.rank) || "-")),
191
+ h("td", { class: "User" }, ((_c = data.userRank) === null || _c === void 0 ? void 0 : _c.firstName) && ((_d = data.userRank) === null || _d === void 0 ? void 0 : _d.lastInitial)
192
+ ? ((_e = data.userRank) === null || _e === void 0 ? void 0 : _e.firstName) + " " + ((_f = data.userRank) === null || _f === void 0 ? void 0 : _f.lastInitial)
193
+ : ((_g = data.userRank) === null || _g === void 0 ? void 0 : _g.firstName) || ((_h = data.userRank) === null || _h === void 0 ? void 0 : _h.lastInitial)
194
+ ? ((_j = data.userRank) === null || _j === void 0 ? void 0 : _j.firstName) || ((_k = data.userRank) === null || _k === void 0 ? void 0 : _k.lastInitial)
195
+ : styles.anonymousUser || "Anonymous User"),
196
+ h("td", { class: "Score" }, ((_l = data.userRank) === null || _l === void 0 ? void 0 : _l.value) || "0"))))));
197
+ }
198
+
199
+ const style$2 = {
200
+ HostBlock: HostBlock,
201
+ ":host": {
202
+ "min-height": "100vh",
203
+ },
204
+ Frame: {
205
+ "min-height": "100vh",
206
+ display: "flex",
207
+ "flex-direction": "column",
208
+ "box-sizing": "border-box",
209
+ },
210
+ FooterWrapper: {
211
+ width: "100%",
212
+ "max-width": "100%",
213
+ padding: "var(--sl-spacing-medium) var(--sl-spacing-x-large)",
214
+ background: "var(--sqm-footer-background)",
215
+ display: "flex",
216
+ "justify-content": "flex-end",
217
+ "align-items": "center",
218
+ "box-sizing": "border-box",
219
+ "margin-top": "auto",
220
+ },
221
+ HeaderWrapper: {
222
+ width: "100%",
223
+ "max-width": "100%",
224
+ "box-sizing": "border-box",
225
+ display: "flex",
226
+ "justify-content": "space-between",
227
+ padding: "var(--sl-spacing-small) var(--sl-spacing-large)",
228
+ "align-items": "center",
229
+ "background-color": "var(--sqm-header-background)",
230
+ "@media screen and (max-width: 499px)": {
231
+ "flex-direction": "row-reverse",
232
+ "justify-content": "flex-end",
233
+ padding: "0",
234
+ },
235
+ },
236
+ };
237
+ const sheet$2 = createStyleSheet(style$2);
238
+ const styleString$2 = sheet$2.toString();
239
+ function PortalFrameView(props, children) {
240
+ const { data } = props;
241
+ return (h("div", { class: sheet$2.classes.Frame },
242
+ h("style", { type: "text/css" }, styleString$2),
243
+ h("div", { class: sheet$2.classes.HeaderWrapper },
244
+ data.header,
245
+ h("slot", { name: "sqm-navigation-menu" })),
246
+ children,
247
+ h("div", { class: sheet$2.classes.FooterWrapper }, data.footer)));
248
+ }
249
+
250
+ const EditProfileView = (props) => {
251
+ var _a, _b, _c, _d;
252
+ const { states, callbacks } = props;
253
+ const { text } = states;
254
+ const { errors } = states.formState;
255
+ if (states.showEdit) {
256
+ return (h("div", { class: `CardWrapper ${!states.showEdit && "ShowEdit"}` },
257
+ h("h2", { style: {
258
+ fontSize: "var(--sl-font-size-x-large)",
259
+ margin: "0px",
260
+ textAlign: "center",
261
+ } }, text.editprofileheader),
262
+ h("form", { class: "FormWrapper", onSubmit: callbacks.onSubmit },
263
+ h("div", { class: "FormSection" },
264
+ states.formState.error && (h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
265
+ h("div", { part: "erroralert-text" }, states.formState.error))),
266
+ h("sl-input", Object.assign({ exportparts: "label: input-label", value: states.formState.firstName, onInput: callbacks.onChange, label: text.firstnametext, disabled: states.loading }, (errors.firstName && errors.firstName.status !== "valid"
267
+ ? { class: "ErrorStyles", helpText: "Cannot be empty" }
268
+ : []), { id: "firstName", name: "firstName", error: errors.firstName && errors.firstName.status !== "valid"
269
+ ? errors.firstName.message
270
+ : undefined })),
271
+ h("sl-input", Object.assign({ exportparts: "label: input-label", value: states.formState.lastName, onInput: callbacks.onChange, label: text.lastnametext, disabled: states.loading, id: "lastName", name: "lastName" }, (errors.lastName && errors.lastName.status !== "valid"
272
+ ? { class: "ErrorStyles", helpText: "Cannot be empty" }
273
+ : []), { error: errors.lastName && errors.lastName.status !== "valid"
274
+ ? errors.lastName.message
275
+ : undefined }))),
276
+ text.showregion && states.formState.currentRegion && (h("sl-input", { exportparts: "label: input-label", disabled: true, value: states.formState.currentRegion, label: text.currentregiontext, id: "currentRegion", name: "currentRegion" })),
277
+ h("div", { class: "ButtonWrapper" },
278
+ h("sl-button", { onClick: () => {
279
+ callbacks.setShowEdit(false);
280
+ }, exportparts: "base: defaultbutton-base" }, text.canceltext),
281
+ h("sl-button", { type: "primary", loading: states.loading, disabled: states.submitDisabled, onClick: (e) => {
282
+ callbacks.onSubmit(e);
283
+ }, submit: true, exportparts: "base: primarybutton-base" }, text.updatetext)))));
284
+ }
285
+ return (h("div", { class: `CardWrapper FormWrapper ${!states.showEdit && "ShowEdit"}` },
286
+ h("div", { class: "FormSection" },
287
+ h("h2", { style: {
288
+ fontSize: "var(--sl-font-size-x-large",
289
+ marginBottom: "0px",
290
+ textAlign: "center",
291
+ } }, text.editprofileheader),
292
+ h("div", null,
293
+ h("p", { style: { fontSize: "var(--sl-font-size-medium)" } }, (_a = states.user) === null || _a === void 0 ? void 0 :
294
+ _a.firstName,
295
+ " ", (_b = states.user) === null || _b === void 0 ? void 0 :
296
+ _b.lastName),
297
+ h("p", { style: { fontSize: "var(--sl-font-size-medium)" }, title: (_c = states.user) === null || _c === void 0 ? void 0 : _c.email }, (_d = states.user) === null || _d === void 0 ? void 0 : _d.email))),
298
+ h("sl-button", { type: "primary", loading: states.loading, onClick: () => {
299
+ callbacks.resetForm();
300
+ callbacks.setShowEdit(true);
301
+ }, exportparts: "base: primarybutton-base" }, text.editprofiletext)));
302
+ };
303
+
304
+ const MessageLinkQuery = dist.gql `
305
+ query ($programId: ID) {
306
+ user: viewer {
307
+ ... on User {
308
+ shareLink(programId: $programId)
309
+ }
310
+ }
311
+ }
312
+ `;
313
+ const WIDGET_ENGAGEMENT_EVENT = dist.gql `
314
+ mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
315
+ createUserAnalyticsEvent(eventMeta: $eventMeta)
316
+ }
317
+ `;
318
+ function useShareLink(props) {
319
+ var _a, _b;
320
+ const { programId = M() } = props;
321
+ const user = ne();
322
+ const engagementMedium = x();
323
+ const { data } = mn(MessageLinkQuery, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt));
324
+ const [sendLoadEvent] = De(WIDGET_ENGAGEMENT_EVENT);
325
+ const shareString = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink) !== null && _b !== void 0 ? _b :
326
+ // Shown during loading
327
+ "...";
328
+ const [open, setOpen] = useState(false);
329
+ function onClick() {
330
+ // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
331
+ // Only if called from a user-initiated event
332
+ navigator.clipboard.writeText(shareString);
333
+ setOpen(true);
334
+ setTimeout(() => setOpen(false), props.tooltiplifespan);
335
+ sendLoadEvent({
336
+ eventMeta: {
337
+ programId,
338
+ id: user === null || user === void 0 ? void 0 : user.id,
339
+ accountId: user === null || user === void 0 ? void 0 : user.accountId,
340
+ type: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",
341
+ meta: {
342
+ engagementMedium,
343
+ shareMedium: "DIRECT",
344
+ },
345
+ },
346
+ });
347
+ }
348
+ return { ...props, onClick, open, shareString };
349
+ }
350
+
351
+ const MessageLinkQuery$1 = dist.gql `
352
+ query (
353
+ $programId: ID
354
+ $engagementMedium: UserEngagementMedium!
355
+ $shareMedium: ReferralShareMedium!
356
+ ) {
357
+ viewer {
358
+ ... on User {
359
+ messageLink(
360
+ programId: $programId
361
+ engagementMedium: $engagementMedium
362
+ shareMedium: $shareMedium
363
+ )
364
+ shareLink(programId: $programId, engagementMedium: $engagementMedium)
365
+ }
366
+ }
367
+ }
368
+ `;
369
+ function NativeShare(props, directLink) {
370
+ const title = props.sharetitle || "Share title";
371
+ const text = props.sharetext || "Share text";
372
+ if (directLink === "undefined") {
373
+ return alert("error: message link undefined!");
374
+ }
375
+ if (window.navigator.share) {
376
+ window.navigator
377
+ .share({
378
+ title,
379
+ text,
380
+ url: directLink,
381
+ })
382
+ .catch((error) => console.error("Error on web share", error));
383
+ }
384
+ else {
385
+ alert("Not on a supported device");
386
+ }
387
+ }
388
+ function FacebookShare(directLink, res) {
389
+ var _a, _b;
390
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.messageLink) === "undefined" ||
391
+ directLink === "undefined") {
392
+ return alert("error: message link undefined!");
393
+ }
394
+ if (typeof SquatchAndroid.shareOnFacebook !== "undefined") {
395
+ return SquatchAndroid.shareOnFacebook(directLink, res.data.viewer.messageLink);
396
+ }
397
+ else {
398
+ return GenericShare(res);
399
+ }
400
+ }
401
+ function GenericShare(res) {
402
+ var _a, _b;
403
+ return ((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.messageLink) ? window.open(res.data.viewer.messageLink)
404
+ : alert("error: message link undefined!");
405
+ }
406
+ function useShareButton(props) {
407
+ var _a, _b;
408
+ const { sharetitle, sharetext, medium } = props;
409
+ const programId = props.programId ? props.programId : M();
410
+ const user = ne();
411
+ const variables = {
412
+ engagementMedium: x(),
413
+ programId: programId,
414
+ shareMedium: medium.toUpperCase(),
415
+ };
416
+ // only queries if a programId is available
417
+ const res = mn(MessageLinkQuery$1, variables, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
418
+ const directLink = (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.shareLink;
419
+ const environment = D();
420
+ const hide = (medium.toLocaleUpperCase() === "SMS" &&
421
+ window.orientation === undefined) ||
422
+ (medium.toLocaleUpperCase() === "DIRECT" && !window.navigator.share);
423
+ function onClick() {
424
+ if (medium.toLocaleUpperCase() === "FACEBOOK" &&
425
+ environment.type === "SquatchAndroid") {
426
+ FacebookShare(directLink, res);
427
+ }
428
+ else if (medium.toLocaleUpperCase() === "DIRECT") {
429
+ NativeShare({ sharetitle, sharetext }, directLink);
430
+ }
431
+ else {
432
+ GenericShare(res);
433
+ }
434
+ }
435
+ return { ...props, loading: res.loading, onClick, hide };
436
+ }
437
+
438
+ function PortalChangePasswordView(props) {
439
+ const { states, callbacks } = props;
440
+ const style = {
441
+ Dialog: {
442
+ padding: "0",
443
+ "&::part(close-button)": {
444
+ "margin-top": "var(--sl-spacing-medium)",
445
+ },
446
+ "&::part(body)": {
447
+ padding: "0 var(--sl-spacing-x-large) var(--sl-spacing-x-large) var(--sl-spacing-x-large)",
448
+ },
449
+ },
450
+ Error: {
451
+ "&::part(erroralert-base)": {
452
+ "margin-bottom": "15px",
453
+ },
454
+ },
455
+ Success: {
456
+ "&::part(successalert-base)": {
457
+ "margin-bottom": "15px",
458
+ },
459
+ },
460
+ InputContainer: {
461
+ "& > :not(:last-child)": {
462
+ "margin-bottom": "var(--sl-spacing-x-large)",
463
+ },
464
+ },
465
+ CancelButton: {
466
+ width: "25%",
467
+ margin: "var(--sl-spacing-large) auto",
468
+ },
469
+ PasswordField: {
470
+ marginBottom: "var(--sl-spacing-large) !important",
471
+ display: "block",
472
+ },
473
+ ChangePasswordButton: {
474
+ paddingTop: "var(--sl-spacing-x-large)",
475
+ },
476
+ };
477
+ const sheet = createStyleSheet(style);
478
+ const styleString = sheet.toString();
479
+ return (h("div", null,
480
+ h("style", { type: "text/css" }, styleString),
481
+ h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, "onSl-hide": () => callbacks.setOpen(false) },
482
+ h(PortalSectionView, Object.assign({}, {
483
+ labelMargin: "x-large",
484
+ padding: "none",
485
+ label: (h(TextSpanView, Object.assign({}, { type: "h2" }), states.content.modalChangePasswordHeader)),
486
+ content: (h(PortalContainerView, Object.assign({}, { direction: "column", padding: "none", gap: "32px" }),
487
+ states.error && (h("sqm-form-message", { class: sheet.classes.Error, type: "error", exportparts: "erroralert-icon" },
488
+ h("div", { part: "erroralert-text" }, states.error))),
489
+ states.success && (h("sqm-form-message", { class: sheet.classes.Success, type: "success", exportparts: "successalert-icon" },
490
+ h("div", { part: "successalert-text" }, states.content.successMessage))),
491
+ h("sl-form", { "onSl-submit": callbacks.submit },
492
+ h("div", { class: sheet.classes.InputContainer },
493
+ h("sqm-password-field", { exportparts: "input-label: input-label", class: sheet.classes.PasswordField, fieldLabel: states.content.passwordFieldLabel }),
494
+ h("sl-input", { exportparts: "label: input-label", name: "/confirmPassword", label: states.content.confirmPasswordFieldLabel, required: true, togglePassword: true, disabled: states.loading, type: "password" })),
495
+ h(PortalContainerView, Object.assign({}, { direction: "row", padding: "none", gap: "20px" }),
496
+ h("sl-button", { class: sheet.classes.ChangePasswordButton, type: "primary", submit: true, loading: states.loading }, states.content.changePasswordButtonText),
497
+ h("sl-button", { class: sheet.classes.CancelButton, type: "text", onClick: () => callbacks.setOpen(false) }, states.content.cancelText))))),
498
+ }))),
499
+ h(PortalSectionView, Object.assign({}, {
500
+ labelMargin: "x-large",
501
+ padding: "xxx-large",
502
+ label: (h(TextSpanView, Object.assign({}, { type: "h2" }), states.content.portalChangePasswordHeader)),
503
+ content: (h("sl-button", { onClick: () => callbacks.setOpen(true) }, states.content.portalChangePasswordButtonText)),
504
+ }),
505
+ h("style", { type: "text/css" }, styleString))));
506
+ }
507
+
508
+ const style$3 = {
509
+ Wrapper: AuthWrapper,
510
+ Column: AuthColumn,
511
+ ForgotButtonContainer: {
512
+ display: "inline",
513
+ cursor: "pointer",
514
+ "font-size": "13px",
515
+ "font-weight": "600",
516
+ color: "#AAAAAA",
517
+ margin: "0",
518
+ },
519
+ ButtonsContainer: AuthButtonsContainer,
520
+ };
521
+ const vanillaStyle$1 = `
522
+ :host {
523
+ display: block;
524
+ }
525
+ :host([hidden]): {
526
+ display: none;
527
+ }
528
+ `;
529
+ const sheet$3 = createStyleSheet(style$3);
530
+ const styleString$3 = sheet$3.toString();
531
+ function PortalLoginView(props) {
532
+ const { states, callbacks, content } = props;
533
+ return (h("div", { class: sheet$3.classes.Wrapper },
534
+ h("style", { type: "text/css" },
535
+ vanillaStyle$1,
536
+ styleString$3),
537
+ h(TextSpanView, { type: "h3" }, content.pageLabel),
538
+ h("sl-form", { class: sheet$3.classes.Column, "onSl-submit": callbacks.submit },
539
+ props.states.error && (h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
540
+ h("div", { part: "erroralert-text" }, props.states.error))),
541
+ h("sl-input", { exportparts: "label: input-label", type: "email", name: "/email", label: content.emailLabel || "Email", disabled: states.loading, required: true }),
542
+ h("div", null,
543
+ h("sl-input", { exportparts: "label: input-label", type: "password", name: "/password", label: content.passwordLabel || "Password", disabled: states.loading, required: true }),
544
+ h("div", { class: sheet$3.classes.ForgotButtonContainer }, content.forgotPasswordButton)),
545
+ h("div", { class: sheet$3.classes.ButtonsContainer },
546
+ h("sl-button", { submit: true, loading: states.loading, exportparts: "base: primarybutton-base", type: "primary" }, content.submitLabel || "Login"),
547
+ content.secondaryButton))));
548
+ }
549
+
550
+ const style$4 = {
551
+ Wrapper: { ...AuthWrapper, "max-width": "600px" },
552
+ Column: AuthColumn,
553
+ HostBlock: HostBlock,
554
+ ":host": {
555
+ margin: "0 auto",
556
+ width: "100%",
557
+ },
558
+ ButtonsContainer: AuthButtonsContainer,
559
+ ErrorStyle: ErrorStyles,
560
+ };
561
+ const vanillaStyle$2 = `
562
+ sqm-portal-register {
563
+ margin: 0 auto;
564
+ width: 100%;
565
+ display: block;
566
+ }
567
+
568
+ :host{
569
+ display: block;
570
+ }
571
+
572
+ :host([hidden]) {
573
+ display: none;
574
+ }
575
+ `;
576
+ const sheet$4 = createStyleSheet(style$4);
577
+ const styleString$4 = sheet$4.toString();
578
+ function PortalRegisterView(props) {
579
+ var _a, _b, _c, _d, _e, _f, _g, _h;
580
+ const { states, refs, callbacks, content } = props;
581
+ if (states.error) {
582
+ window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
583
+ }
584
+ return (h("div", { class: sheet$4.classes.Wrapper },
585
+ h("style", { type: "text/css" },
586
+ vanillaStyle$2,
587
+ styleString$4),
588
+ h(TextSpanView, { type: "h3" }, content.pageLabel),
589
+ h("sl-form", { class: sheet$4.classes.Column, "onSl-submit": callbacks.submit, ref: (el) => (refs.formRef.current = el), novalidate: true },
590
+ states.error && (h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
591
+ h("div", { part: "erroralert-text" }, props.states.error))),
592
+ content.formData,
593
+ !states.hideInputs && (h("sl-input", Object.assign({ exportparts: "label: input-label", type: "email", name: "/email", label: content.emailLabel || "Email", disabled: states.loading, required: true, validationError: ({ value }) => {
594
+ if (!value) {
595
+ return "Cannot be empty";
596
+ }
597
+ // this matches shoelace validation, but could be better
598
+ if (!value.includes("@")) {
599
+ return "Must be a valid email address";
600
+ }
601
+ } }, (((_b = (_a = states.validationState) === null || _a === void 0 ? void 0 : _a.validationErrors) === null || _b === void 0 ? void 0 : _b.email) ? {
602
+ class: sheet$4.classes.ErrorStyle,
603
+ helpText: ((_d = (_c = states.validationState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.email) ||
604
+ "Cannot be empty",
605
+ }
606
+ : [])))),
607
+ !states.hideInputs && (h("sqm-password-field", { fieldLabel: content.passwordLabel, "enable-validation": states.enablePasswordValidation })),
608
+ content.passwordField,
609
+ !states.hideInputs && states.confirmPassword && (h("sl-input", Object.assign({ exportparts: "label: input-label", type: "password", name: "/confirmPassword", label: content.confirmPasswordLabel, disabled: states.loading, required: true }, (((_f = (_e = states.validationState) === null || _e === void 0 ? void 0 : _e.validationErrors) === null || _f === void 0 ? void 0 : _f.confirmPassword) ? {
610
+ class: sheet$4.classes.ErrorStyle,
611
+ helpText: ((_h = (_g = states.validationState) === null || _g === void 0 ? void 0 : _g.validationErrors) === null || _h === void 0 ? void 0 : _h.confirmPassword) ||
612
+ "Cannot be empty",
613
+ }
614
+ : [])))),
615
+ content.terms,
616
+ h("div", { class: sheet$4.classes.ButtonsContainer },
617
+ h("sl-button", { submit: true, loading: states.loading, exportparts: "base: primarybutton-base", type: "primary" }, content.submitLabel || "Register"),
618
+ content.secondaryButton))));
619
+ }
620
+
621
+ const style$5 = {
622
+ Description: {
623
+ "& input[type=checkbox]": {
624
+ display: "none",
625
+ },
626
+ "& input:checked ~ .details": {
627
+ transform: "rotate(-180deg)",
628
+ },
629
+ "& .details": {
630
+ position: "absolute",
631
+ top: "var(--sl-spacing-medium)",
632
+ right: "var(--sl-spacing-medium)",
633
+ color: "var(--sl-color-neutral-700)",
634
+ fontSize: "var(--sl-font-size-large)",
635
+ "& :hover": {
636
+ color: "var(--sl-color-primary-700)",
637
+ },
638
+ transformOrigin: "50% 37%",
639
+ transition: "transform var(--sl-transition-medium) ease",
640
+ cursor: "pointer",
641
+ },
642
+ "& input:checked ~ .summary": {
643
+ transition: "all var(--sl-transition-medium) ease",
644
+ maxHeight: "300px",
645
+ marginBottom: "var(--sl-spacing-x-large)",
646
+ },
647
+ "& input:checked ~ .summary[progress-bar]": {
648
+ marginBottom: "var(--sl-spacing-xx-large)",
649
+ },
650
+ "& .summary": {
651
+ display: "block",
652
+ overflow: "hidden",
653
+ fontSize: "var(--sl-font-size-small)",
654
+ maxHeight: "0px",
655
+ transition: "all var(--sl-transition-fast) ease-out",
656
+ marginBottom: "var(--sl-spacing-medium)",
657
+ },
658
+ },
659
+ };
660
+ const sheet$5 = createStyleSheet(style$5);
661
+ const styleString$5 = sheet$5.toString();
662
+ function Details(props) {
663
+ const rid = Math.random().toString(36).slice(2);
664
+ return (h("div", null,
665
+ h("style", { type: "text/css" }, styleString$5),
666
+ h("span", { class: sheet$5.classes.Description },
667
+ h("input", { type: "checkbox", id: "details-" + rid }),
668
+ h("label", { class: "details", htmlFor: "details-" + rid },
669
+ h("sl-icon", { name: "chevron-down" })),
670
+ h("span", { class: "summary", "progress-bar": props.progressBar }, props.content.description))));
671
+ }
672
+
673
+ const Gift = () => {
674
+ return (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
675
+ h("path", { d: "M15 5H12.4508H9V16H13.5C14.0523 16 14.5 15.5523 14.5 15V9H15C15.5523 9 16 8.55228 16 8V6C16 5.44772 15.5523 5 15 5Z", fill: "#F2C94C" }),
676
+ h("path", { d: "M1.5 9V15C1.5 15.5523 1.94772 16 2.5 16H7V5H4.64242H1C0.447715 5 0 5.44772 0 6V8C0 8.55228 0.447715 9 1 9H1.5Z", fill: "#F2C94C" }),
677
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9V10H14.5V9H1.5Z", fill: "#BE9720" }),
678
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M14 2.70949C14 3.59565 12.6694 4.93746 12 5H9V16H7.00179V5H4.58792C3.21247 4.70182 2 3.64537 2 2.52072C2 1.42474 2.47603 0.556701 3.34184 0.182041C4.16921 -0.175986 5.12452 0.0203328 5.87976 0.544666C6.80676 1.18825 7.32679 2.3963 7.79856 3.49226C7.83996 3.58845 7.88099 3.68378 7.9219 3.77778C7.96173 3.68865 8.00186 3.59793 8.0425 3.50608C8.50995 2.44948 9.04359 1.24325 9.9404 0.59563C10.7332 0.0231438 11.741 -0.193157 12.6121 0.198945C13.5129 0.604397 14 1.53453 14 2.70949ZM10.6123 1.5C11.0928 1.15305 11.668 1.09012 12.1597 1.5C12.5879 1.85694 12.6108 2.02497 12.6658 2.42926L12.6755 2.5C12.6755 3.09851 12.1597 4 11.6439 4C11.2785 4 10.9914 3.99691 10.7224 3.99402C10.2319 3.98875 9.80131 3.98412 9.06496 4C9.20533 3.72786 9.31743 3.46669 9.42434 3.21761C9.71026 2.55143 9.95907 1.97176 10.6123 1.5ZM4.93861 1.5C4.70607 1.33855 4.17281 1.4106 3.95166 1.5063C3.76894 1.58537 3.49602 1.82658 3.49602 2.52072C3.49602 3.19524 4.58792 3.77778 4.58792 3.77778C4.58792 3.77778 5.45441 4 7.00179 4C6.47506 2.69451 5.7289 2.04867 4.93861 1.5Z", fill: "#EB5757" })));
679
+ };
680
+
681
+ const style$6 = {
682
+ ProgressBar: {
683
+ "& .progress-bar": {
684
+ height: "0",
685
+ marginTop: "var(--sl-spacing-large)",
686
+ marginBottom: "var(--sl-spacing-xxx-large)",
687
+ marginRight: "var(--sl-spacing-x-small)",
688
+ fontSize: "var(--sl-font-size-x-small)",
689
+ display: "grid",
690
+ lineHeight: "45px",
691
+ userSelect: "none",
692
+ },
693
+ "&[data-steps]": {
694
+ marginTop: "calc(-1*var(--sl-spacing-x-small))",
695
+ },
696
+ "&[data-steps] .progress-bar": {
697
+ marginTop: "var(--sl-spacing-medium)",
698
+ },
699
+ "&[data-expired] .progress-bar": {
700
+ filter: "grayscale(1)",
701
+ },
702
+ "& .progress-bar.repeatable-steps": {
703
+ marginLeft: "var(--sl-spacing-x-small)",
704
+ },
705
+ "& .filled:after": {
706
+ content: '""',
707
+ display: "flex",
708
+ width: "100%",
709
+ height: "4px",
710
+ borderRadius: "4px",
711
+ backgroundColor: "var(--sl-color-primary-300)",
712
+ },
713
+ "& .progress": {
714
+ display: "block",
715
+ textAlign: "center",
716
+ marginLeft: "-100px",
717
+ marginRight: "-100px",
718
+ },
719
+ "& .progress::after": {
720
+ content: '""',
721
+ width: "12px",
722
+ height: "12px",
723
+ display: "flex",
724
+ backgroundColor: "var(--sl-color-primary-300)",
725
+ borderRadius: "50%",
726
+ position: "relative",
727
+ left: "47%",
728
+ top: "-85%",
729
+ },
730
+ "& .progress.bg:after": {
731
+ width: "0",
732
+ height: "0",
733
+ border: "none",
734
+ },
735
+ "& .progress.top": {
736
+ position: "relative",
737
+ top: "-40px",
738
+ },
739
+ "& .progress.top:after": {
740
+ top: "-16%",
741
+ },
742
+ "& .empty": {
743
+ display: "block",
744
+ textAlign: "center",
745
+ marginLeft: "-100px",
746
+ marginRight: "-100px",
747
+ },
748
+ "& .empty::after": {
749
+ content: '""',
750
+ width: "12px",
751
+ height: "12px",
752
+ border: "2px solid #E0E0E0",
753
+ margin: "-2px",
754
+ display: "flex",
755
+ backgroundColor: "white",
756
+ borderRadius: "50%",
757
+ position: "relative",
758
+ left: "47%",
759
+ top: "-85%",
760
+ },
761
+ "& .empty.bg:after": {
762
+ width: "0",
763
+ height: "0",
764
+ border: "none",
765
+ },
766
+ "& .remain:after": {
767
+ content: '""',
768
+ display: "flex",
769
+ width: "100%",
770
+ height: "4px",
771
+ borderRadius: "4px",
772
+ backgroundColor: "#E0E0E0",
773
+ },
774
+ "& .gift.bw": {
775
+ filter: "grayscale(100%)",
776
+ },
777
+ "& .gift.start": {
778
+ transform: "scale(80%)",
779
+ top: "-20px",
780
+ },
781
+ "& .gift": {
782
+ textAlign: "center",
783
+ marginLeft: "-100px",
784
+ marginRight: "-100px",
785
+ position: "relative",
786
+ top: "-18px",
787
+ },
788
+ },
789
+ };
790
+ const sheet$6 = createStyleSheet(style$6, { classNamePrefix: "sqm-prog-bar" });
791
+ const styleString$6 = sheet$6.toString();
792
+ function ProgressBarView(props) {
793
+ var _a;
794
+ const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, expired = false, finite = 0, } = props;
795
+ let aggregate = buildProgressBar(repeatable, steps, props);
796
+ const { columns, items } = aggregate;
797
+ //@ts-ignore
798
+ console.log("PROGRESS BAR PROPS " + ((_a = props === null || props === void 0 ? void 0 : props.content) === null || _a === void 0 ? void 0 : _a.cardTitle));
799
+ console.log({ props });
800
+ return (h("div", { class: sheet$6.classes.ProgressBar, "data-expired": expired, "data-steps": steps, "data-done": goal <= progress },
801
+ h("style", { type: "text/css" }, styleString$6),
802
+ h("div", { class: (!Boolean(finite) && progress >= 2 * goal) ||
803
+ (Boolean(finite) && progress > 2 * goal)
804
+ ? "progress-bar repeatable-steps"
805
+ : "progress-bar", style: {
806
+ gridTemplateColumns: columns,
807
+ marginLeft: progress === 0 && !steps ? "var(--sl-spacing-x-small)" : "",
808
+ } }, items)));
809
+ }
810
+ function buildProgressBar(repeatable, steps, props) {
811
+ if (repeatable) {
812
+ if (steps) {
813
+ return addStepsRepeatable(props);
814
+ }
815
+ else {
816
+ return addLinearRepeatable(props);
817
+ }
818
+ }
819
+ // non repeatable
820
+ else {
821
+ if (steps) {
822
+ return addSteps(props);
823
+ }
824
+ else {
825
+ return addLinear(props);
826
+ }
827
+ }
828
+ }
829
+ function addSteps({ progress, goal }) {
830
+ const items = [];
831
+ const columns = [];
832
+ let ratio = 1 / goal;
833
+ for (let i = 1; i < goal; i++) {
834
+ columns.push(ratio + "fr");
835
+ columns.push("0fr");
836
+ if (i > progress) {
837
+ items.push(h("div", { class: "remain" }));
838
+ items.push(h("div", { class: "empty" }, i));
839
+ }
840
+ else {
841
+ items.push(h("div", { class: "filled" }));
842
+ items.push(h("div", { class: "progress" }, i));
843
+ }
844
+ }
845
+ columns.push(ratio + "fr");
846
+ columns.push("0fr");
847
+ // reward success
848
+ if (goal <= progress) {
849
+ columns.push("0fr");
850
+ items.push(h("div", { class: "filled" }));
851
+ items.push(h("div", { class: "progress bg" }, goal));
852
+ items.push(h("div", { class: "gift" }, h(Gift, null)));
853
+ }
854
+ // reward fail
855
+ else {
856
+ columns.push("0fr");
857
+ items.push(h("div", { class: "remain" }));
858
+ items.push(h("div", { class: "empty bg" }, goal));
859
+ items.push(h("div", { class: "gift bw" }, h(Gift, null)));
860
+ }
861
+ return {
862
+ items,
863
+ columns: columns.join(" "),
864
+ };
865
+ }
866
+ function addLinearRepeatable({ progress, goal, progressBarUnit, finite, }) {
867
+ let repetitions = Math.floor(progress / goal);
868
+ let ratio = ((progress % goal) / goal) * 0.5;
869
+ const items = [];
870
+ let columns = "";
871
+ // 0 repetition
872
+ if (repetitions == 0) {
873
+ columns = ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr 0.5fr 0fr 0fr";
874
+ items.push(h("div", { class: "filled" }));
875
+ items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progressBarUnit + progress));
876
+ items.push(h("div", { class: "remain" }));
877
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
878
+ items.push(h("div", { class: progress == goal ? "gift" : "gift bw" },
879
+ h(Gift, null)));
880
+ items.push(h("div", { class: "remain" }));
881
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
882
+ items.push(h("div", { class: "gift bw" }, h(Gift, null)));
883
+ }
884
+ // single repetition
885
+ else if (repetitions == 1) {
886
+ columns =
887
+ "0.5fr 0fr 0fr " + ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr";
888
+ items.push(h("div", { class: "filled" }));
889
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
890
+ items.push(h("div", { class: "gift" }, h(Gift, null)));
891
+ items.push(h("div", { class: "filled" }));
892
+ items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progress == goal ? "" : progressBarUnit + progress));
893
+ items.push(h("div", { class: "remain" }));
894
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
895
+ items.push(h("div", { class: "gift bw" }, h(Gift, null)));
896
+ }
897
+ // finite repetition hit
898
+ else if (finite && repetitions >= finite) {
899
+ if (repetitions > 2) {
900
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (finite - 2)));
901
+ items.push(h("div", { class: "gift start" }, h(Gift, null)));
902
+ columns = "0fr 0fr 0.5fr 0fr 0fr 0.5fr 0fr 0fr";
903
+ }
904
+ else {
905
+ columns = "0.5fr 0fr 0fr 0.5fr 0fr 0fr";
906
+ }
907
+ items.push(h("div", { class: "filled" }));
908
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (finite - 1)));
909
+ items.push(h("div", { class: "gift" }, h(Gift, null)));
910
+ items.push(h("div", { class: "filled" }));
911
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * finite));
912
+ items.push(h("div", { class: "gift" }, h(Gift, null)));
913
+ }
914
+ // multiple repetitions
915
+ else {
916
+ columns =
917
+ "0fr 0fr 0.5fr 0fr 0fr " +
918
+ ratio +
919
+ "fr 0fr " +
920
+ (0.5 - ratio) +
921
+ "fr 0fr 0fr";
922
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions - 1)));
923
+ items.push(h("div", { class: "gift start" }, h(Gift, null)));
924
+ items.push(h("div", { class: "filled" }));
925
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * repetitions));
926
+ items.push(h("div", { class: "gift" }, h(Gift, null)));
927
+ items.push(h("div", { class: "filled" }));
928
+ items.push(h("div", { class: progress == goal * repetitions ? "progress top bg" : "progress top" }, progress == goal * repetitions ? "" : progressBarUnit + progress));
929
+ items.push(h("div", { class: "remain" }));
930
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions + 1)));
931
+ items.push(h("div", { class: "gift bw" }, h(Gift, null)));
932
+ }
933
+ return { items, columns };
934
+ }
935
+ function addStepsRepeatable({ progress, goal, finite, }) {
936
+ const items = [];
937
+ const columns = [];
938
+ let repetitions = Math.floor(progress / goal);
939
+ // no or single repetition
940
+ if (repetitions < 2) {
941
+ let ratio = 1 / goal;
942
+ for (let i = 1; i < goal * 2 + 1; i++) {
943
+ columns.push(ratio + "fr");
944
+ columns.push("0fr");
945
+ if (i > progress) {
946
+ if (i == goal) {
947
+ columns.push("0fr");
948
+ items.push(h("div", { class: "remain" }));
949
+ items.push(h("div", { class: "empty bg" }, goal));
950
+ items.push(h("div", { class: "gift bw" }, h(Gift, null)));
951
+ }
952
+ else if (i == goal * 2) {
953
+ columns.push("0fr");
954
+ columns.push("0fr");
955
+ items.push(h("div", { class: "remain" }));
956
+ items.push(h("div", { class: "empty bg" }, goal * 2));
957
+ items.push(h("div", { class: "gift bw" }, h(Gift, null)));
958
+ }
959
+ else {
960
+ items.push(h("div", { class: "remain" }));
961
+ items.push(h("div", { class: "empty" }, i));
962
+ }
963
+ }
964
+ else if (i == goal) {
965
+ columns.push("0fr");
966
+ items.push(h("div", { class: "filled" }));
967
+ items.push(h("div", { class: "progress bg" }, i));
968
+ items.push(h("div", { class: "gift" }, h(Gift, null)));
969
+ }
970
+ else {
971
+ items.push(h("div", { class: "filled" }));
972
+ items.push(h("div", { class: "progress" }, i));
973
+ }
974
+ }
975
+ }
976
+ // finite repetition hit
977
+ else if (finite && repetitions >= finite) {
978
+ let ratio = 1 / goal;
979
+ if (repetitions > 2) {
980
+ columns.push("0fr");
981
+ columns.push("0fr");
982
+ items.push(h("div", { class: "progress bg" }, goal * (finite - 2)));
983
+ items.push(h("div", { class: "gift start" }, h(Gift, null)));
984
+ }
985
+ for (let i = 1; i < goal * 2 + 1; i++) {
986
+ columns.push(ratio + "fr");
987
+ columns.push("0fr");
988
+ if (i > progress) {
989
+ if (i == goal) {
990
+ columns.push("0fr");
991
+ items.push(h("div", { class: "remain" }));
992
+ items.push(h("div", { class: "progress bg" }, goal * (finite - 1)));
993
+ items.push(h("div", { class: "gift bw" }, h(Gift, null)));
994
+ }
995
+ }
996
+ else if (i == goal) {
997
+ columns.push("0fr");
998
+ items.push(h("div", { class: "filled" }));
999
+ items.push(h("div", { class: "progress bg" }, goal * (finite - 1)));
1000
+ items.push(h("div", { class: "gift" }, h(Gift, null)));
1001
+ }
1002
+ else if (i == goal * 2) {
1003
+ columns.push("0fr");
1004
+ columns.push("0fr");
1005
+ items.push(h("div", { class: "filled" }));
1006
+ items.push(h("div", { class: "progress bg" }, goal * finite));
1007
+ items.push(h("div", { class: "gift" }, h(Gift, null)));
1008
+ }
1009
+ else {
1010
+ items.push(h("div", { class: "filled" }));
1011
+ items.push(h("div", { class: "progress" }, i + goal * (finite - 2)));
1012
+ }
1013
+ }
1014
+ }
1015
+ // case repetition many
1016
+ else {
1017
+ let position = (progress % goal) + goal;
1018
+ let ratio = 1 / goal;
1019
+ columns.push("0fr");
1020
+ columns.push("0fr");
1021
+ items.push(h("div", { class: "progress bg" }, goal * (repetitions - 1)));
1022
+ items.push(h("div", { class: "gift start" }, h(Gift, null)));
1023
+ for (let i = 1; i < goal * 2 + 1; i++) {
1024
+ columns.push(ratio + "fr");
1025
+ columns.push("0fr");
1026
+ if (i <= goal) {
1027
+ if (i == goal) {
1028
+ columns.push("0fr");
1029
+ items.push(h("div", { class: "filled" }));
1030
+ items.push(h("div", { class: "progress bg" }, i + goal * (repetitions - 1)));
1031
+ items.push(h("div", { class: "gift" }, h(Gift, null)));
1032
+ }
1033
+ else {
1034
+ items.push(h("div", { class: "filled" }));
1035
+ items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
1036
+ }
1037
+ }
1038
+ else if (i > position) {
1039
+ if (i == goal * 2) {
1040
+ columns.push("0fr");
1041
+ columns.push("0fr");
1042
+ items.push(h("div", { class: "remain" }));
1043
+ items.push(h("div", { class: "empty bg" }, i + goal * (repetitions - 1)));
1044
+ items.push(h("div", { class: "gift bw" }, h(Gift, null)));
1045
+ }
1046
+ else {
1047
+ items.push(h("div", { class: "remain" }));
1048
+ items.push(h("div", { class: "empty" }, i + goal * (repetitions - 1)));
1049
+ }
1050
+ }
1051
+ else {
1052
+ items.push(h("div", { class: "filled" }));
1053
+ items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
1054
+ }
1055
+ }
1056
+ }
1057
+ return { items, columns: columns.join(" ") };
1058
+ }
1059
+ function addLinear({ progress, goal, progressBarUnit, }) {
1060
+ const items = [];
1061
+ let columns = "";
1062
+ const ratio = progress / goal;
1063
+ columns =
1064
+ clamp(ratio, 0, 1) + "fr 0fr " + clamp(1 - ratio, 0, 1) + "fr 0fr 0fr";
1065
+ items.push(h("div", { class: "filled" }));
1066
+ items.push(h("div", { class: clamp(progress, 0, goal) == goal ? "progress top bg" : "progress top" }, clamp(progress, 0, goal) == goal
1067
+ ? ""
1068
+ : progressBarUnit + clamp(progress, 0, goal)));
1069
+ items.push(h("div", { class: "remain" }));
1070
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
1071
+ items.push(h("div", { class: clamp(progress, 0, goal) == goal ? "gift" : "gift bw" },
1072
+ h(Gift, null)));
1073
+ return { items, columns };
1074
+ }
1075
+ function clamp(x, min, max) {
1076
+ return Math.min(Math.max(x, min), max);
1077
+ }
1078
+
1079
+ const checkmark_circle = () => {
1080
+ return (h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1081
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.81818 10C1.81818 5.48131 5.48131 1.81818 10 1.81818C14.5187 1.81818 18.1818 5.48131 18.1818 10C18.1818 14.5187 14.5187 18.1818 10 18.1818C5.48131 18.1818 1.81818 14.5187 1.81818 10ZM10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0ZM15.7692 6.96189C16.1398 6.48683 16.0551 5.80132 15.58 5.43077C15.1049 5.06022 14.4194 5.14495 14.0489 5.62001L8.72994 12.4391L5.86229 9.5715C5.43627 9.14548 4.74554 9.14548 4.31952 9.5715C3.89349 9.99752 3.89349 10.6882 4.31952 11.1143L8.05976 14.8545C8.28083 15.0756 8.58613 15.1912 8.89818 15.172C9.21023 15.1528 9.49905 15.0006 9.69133 14.7541L15.7692 6.96189Z", fill: "currentColor" })));
1082
+ };
1083
+ const checkmark_filled = () => {
1084
+ return (h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1085
+ h("circle", { cx: "10", cy: "10", r: "10", fill: "currentColor" }),
1086
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M14.65 6.19231C15.0459 6.5011 15.1165 7.07236 14.8077 7.46825L9.74277 13.9617C9.58254 14.1672 9.34186 14.294 9.08182 14.31C8.82178 14.326 8.56736 14.2297 8.38314 14.0454L5.26627 10.9286C4.91124 10.5735 4.91124 9.99794 5.26627 9.64292C5.62129 9.2879 6.19689 9.2879 6.55191 9.64292L8.94162 12.0326L13.3741 6.35001C13.6828 5.95412 14.2541 5.88352 14.65 6.19231Z", fill: "white" })));
1087
+ };
1088
+ const arrow_left_right = () => {
1089
+ return (h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1090
+ 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" })));
1091
+ };
1092
+
1093
+ const style$7 = {
1094
+ TaskCard: {
1095
+ display: "inline-block",
1096
+ width: "100%",
1097
+ "& .main": {
1098
+ position: "relative",
1099
+ boxSizing: "border-box",
1100
+ background: "var(--sl-color-neutral-0)",
1101
+ border: "1px solid var(--sl-color-neutral-200)",
1102
+ borderRadius: "var(--sl-border-radius-medium)",
1103
+ boxShadow: "1px 2px 4px rgba(211, 211, 211, 0.2)",
1104
+ fontSize: "var(--sl-font-size-small)",
1105
+ lineHeight: "var(--sl-line-height-dense)",
1106
+ color: "var(--sl-color-neutral-600)",
1107
+ },
1108
+ "& .main.complete": {
1109
+ background: "var(--sl-color-primary-50)",
1110
+ borderColor: "var(--sl-color-primary-500)",
1111
+ },
1112
+ "& .main.expired": {
1113
+ color: "var(--sl-color-neutral-600)",
1114
+ background: "var(--sl-color-neutral-50)",
1115
+ },
1116
+ "& .title": {
1117
+ fontSize: "var(--sl-font-size-medium)",
1118
+ color: "var(--sl-color-neutral-950)",
1119
+ },
1120
+ "& .container": {
1121
+ margin: "var(--sl-spacing-medium)",
1122
+ },
1123
+ "& .container.subdued": {
1124
+ opacity: "0.45",
1125
+ },
1126
+ "& .container > div": {
1127
+ margin: "var(--sl-spacing-medium) 0",
1128
+ },
1129
+ },
1130
+ NotStarted: {
1131
+ fontSize: "var(--sl-font-size-small)",
1132
+ padding: "var(--sl-spacing-medium)",
1133
+ color: "var(--sl-color-primary-600)",
1134
+ border: "1px solid var(--sl-color-neutral-200)",
1135
+ borderRadius: "var(--sl-border-radius-medium) var(--sl-border-radius-medium) 0 0",
1136
+ borderBottom: "none",
1137
+ background: "var(--sl-color-primary-50)",
1138
+ fontWeight: "var(--sl-font-weight-semibold)",
1139
+ lineHeight: "var(--sl-line-height-dense)",
1140
+ "& .icon": {
1141
+ position: "relative",
1142
+ top: "0.1em",
1143
+ marginRight: "var(--sl-spacing-small)",
1144
+ color: "var(--sl-color-primary-500)",
1145
+ },
1146
+ },
1147
+ Ended: {
1148
+ fontSize: "var(--sl-font-size-small)",
1149
+ padding: "var(--sl-spacing-medium)",
1150
+ color: "var(--sl-color-warning-600)",
1151
+ border: "1px solid var(--sl-color-neutral-200)",
1152
+ borderRadius: "var(--sl-border-radius-medium) var(--sl-border-radius-medium) 0 0",
1153
+ borderBottom: "none",
1154
+ background: "var(--sl-color-warning-50)",
1155
+ fontWeight: "var(--sl-font-weight-semibold)",
1156
+ lineHeight: "var(--sl-line-height-dense)",
1157
+ "& .icon": {
1158
+ position: "relative",
1159
+ top: "0.1em",
1160
+ marginRight: "var(--sl-spacing-small)",
1161
+ color: "var(--sl-color-warning-500)",
1162
+ },
1163
+ },
1164
+ Header: {
1165
+ display: "flex",
1166
+ "& .icon": {
1167
+ position: "relative",
1168
+ top: "5%",
1169
+ alignSelf: "center",
1170
+ lineHeight: "0",
1171
+ color: "var(--sl-color-primary-400)",
1172
+ fontSize: "var(--sl-font-size-large)",
1173
+ marginRight: "var(--sl-spacing-x-small)",
1174
+ },
1175
+ "& .value": {
1176
+ alignSelf: "center",
1177
+ fontSize: "var(--sl-font-size-x-large)",
1178
+ fontWeight: "var(--sl-font-weight-semibold)",
1179
+ color: "var(--sl-color-neutral-950)",
1180
+ lineHeight: "100%",
1181
+ marginRight: "var(--sl-spacing-xx-small)",
1182
+ },
1183
+ "& .text": {
1184
+ alignSelf: "end",
1185
+ textTransform: "uppercase",
1186
+ fontSize: "var(--sl-font-size-x-small)",
1187
+ color: "var(--sl-color-neutral-950)",
1188
+ lineHeight: "var(--sl-font-size-medium)",
1189
+ marginRight: "var(--sl-spacing-xx-small)",
1190
+ },
1191
+ "& .end": {
1192
+ color: "var(--sl-color-warning-500)",
1193
+ fontWeight: "var(--sl-font-weight-semibold)",
1194
+ marginBottom: "var(--sl-spacing-xx-small)",
1195
+ },
1196
+ "& .neutral": {
1197
+ color: "var(--sl-color-neutral-400)",
1198
+ },
1199
+ },
1200
+ Footer: {
1201
+ display: "flex",
1202
+ "& .icon": {
1203
+ fontSize: "var(--sl-font-size-xx-small)",
1204
+ marginRight: "var(--sl-spacing-xx-small)",
1205
+ verticalAlign: "middle",
1206
+ },
1207
+ "& .text": {
1208
+ marginTop: "auto",
1209
+ verticalAlign: "text-bottom",
1210
+ fontSize: "var(--sl-font-size-x-small)",
1211
+ color: "var(--sl-color-neutral-400)",
1212
+ },
1213
+ "& .success": {
1214
+ color: "var(--sl-color-primary-500)",
1215
+ fontWeight: "var(--sl-font-weight-semibold)",
1216
+ },
1217
+ "& .action": {
1218
+ marginTop: "auto",
1219
+ marginLeft: "auto",
1220
+ "&::part(base)": {
1221
+ color: "var(--sl-color-neutral-0)",
1222
+ borderRadius: "var(--sl-border-radius-medium)",
1223
+ },
1224
+ "&.disabled::part(base)": {
1225
+ border: "1px solid var(--sl-color-primary-400)",
1226
+ background: "var(--sl-color-primary-400)",
1227
+ },
1228
+ "&.neutral::part(base)": {
1229
+ border: "1px solid var(--sl-color-neutral-400)",
1230
+ background: "var(--sl-color-neutral-400)",
1231
+ },
1232
+ },
1233
+ "& .neutral": {
1234
+ color: "var(--sl-color-neutral-400)",
1235
+ },
1236
+ "& .datetime": {
1237
+ display: "block",
1238
+ marginTop: "var(--sl-spacing-xx-small)",
1239
+ color: "var(--sl-color-neutral-400)",
1240
+ },
1241
+ },
1242
+ };
1243
+ const sheet$7 = createStyleSheet(style$7);
1244
+ const styleString$7 = sheet$7.toString();
1245
+ function TaskCardView(props) {
1246
+ var _a, _b, _c;
1247
+ console.log("TASK CARD PROPS " + ((_a = props === null || props === void 0 ? void 0 : props.content) === null || _a === void 0 ? void 0 : _a.cardTitle));
1248
+ console.log({ props });
1249
+ const { callbacks, states, content } = props;
1250
+ const dateStart = content.rewardDuration &&
1251
+ luxon.DateTime.fromISO(content.rewardDuration.split("/")[0]);
1252
+ const dateEnd = content.rewardDuration &&
1253
+ luxon.DateTime.fromISO(content.rewardDuration.split("/")[1]);
1254
+ const dateToday = luxon.DateTime.now();
1255
+ if (content.displayDuration) {
1256
+ const start = (_b = content.displayDuration.split("/")) === null || _b === void 0 ? void 0 : _b[0];
1257
+ const end = (_c = content.displayDuration.split("/")) === null || _c === void 0 ? void 0 : _c[1];
1258
+ const displayDateStart = start ? luxon.DateTime.fromISO(start) : dateToday;
1259
+ const displayDateEnd = end ? luxon.DateTime.fromISO(end) : dateToday;
1260
+ console.log({ displayDateStart, dateToday, displayDateEnd });
1261
+ if (dateToday < displayDateStart || dateToday > displayDateEnd)
1262
+ return h("span", null);
1263
+ }
1264
+ const checkmark_circle$1 = checkmark_circle();
1265
+ const checkmark_filled$1 = checkmark_filled();
1266
+ const arrow_left_right$1 = arrow_left_right();
1267
+ const showComplete = states.progress >= content.goal;
1268
+ const repetitions = content.showProgressBar
1269
+ ? Math.floor(states.progress / content.goal)
1270
+ : states.progress;
1271
+ const taskComplete = (showComplete && content.repeatable === false) ||
1272
+ (content.finite && states.progress >= content.finite * content.goal);
1273
+ const taskEnded = content.rewardDuration && dateEnd <= dateToday;
1274
+ const taskNotStarted = content.rewardDuration && dateToday <= dateStart;
1275
+ const taskUnavailable = taskEnded || taskNotStarted;
1276
+ const vanillaStyle = `
1277
+ :host{
1278
+ display: block;
1279
+ margin-bottom: var(--sl-spacing-large);
1280
+ }
1281
+ `;
1282
+ return (h("div", { class: sheet$7.classes.TaskCard },
1283
+ h("style", { type: "text/css" },
1284
+ styleString$7,
1285
+ vanillaStyle),
1286
+ !states.loading && taskNotStarted && (h("div", { class: sheet$7.classes.NotStarted },
1287
+ h("span", { class: "icon" },
1288
+ h("sl-icon", { name: "info-circle-fill" })),
1289
+ intl.formatMessage({
1290
+ id: "startsOnMessage",
1291
+ defaultMessage: content.startsOnMessage,
1292
+ }, {
1293
+ startDate: dateStart
1294
+ .setLocale(luxonLocale(states.locale))
1295
+ .toLocaleString(luxon.DateTime.DATETIME_MED),
1296
+ }))),
1297
+ !states.loading && taskEnded && (h("div", { class: sheet$7.classes.Ended },
1298
+ h("span", { class: "icon" },
1299
+ h("sl-icon", { name: "exclamation-triangle-fill" })),
1300
+ intl.formatMessage({
1301
+ id: "endedMessage",
1302
+ defaultMessage: content.endedMessage,
1303
+ }, {
1304
+ endDate: dateEnd
1305
+ .setLocale(luxonLocale(states.locale))
1306
+ .toLocaleString(luxon.DateTime.DATETIME_MED),
1307
+ }))),
1308
+ h("div", { style: {
1309
+ borderRadius: taskUnavailable &&
1310
+ "0 0 var(--sl-border-radius-medium) var(--sl-border-radius-medium)",
1311
+ }, class: taskUnavailable
1312
+ ? "main expired"
1313
+ : taskComplete
1314
+ ? "main complete"
1315
+ : "main" },
1316
+ h("div", { class: taskComplete || taskUnavailable ? "container subdued" : "container" },
1317
+ h("div", { class: sheet$7.classes.Header }, states.loading ? (h("sl-skeleton", { style: { width: "22%", margin: "0" } })) : (h("div", null,
1318
+ showComplete && (h("span", { class: taskUnavailable ? "icon neutral" : "icon" }, taskComplete ? checkmark_filled$1 : checkmark_circle$1)),
1319
+ h("span", { class: "value" }, content.rewardAmount),
1320
+ h("span", { class: "text" }, content.rewardUnit)))),
1321
+ states.loading ? (h("sl-skeleton", { style: { width: "42%", margin: "var(--sl-spacing-medium) 0" } })) : (h("div", { class: "title", style: {
1322
+ marginBottom: !content.description
1323
+ ? content.steps
1324
+ ? "var(--sl-spacing-x-large)"
1325
+ : content.showProgressBar
1326
+ ? "var(--sl-spacing-xx-large)"
1327
+ : ""
1328
+ : "",
1329
+ } }, content.cardTitle)),
1330
+ states.loading ? (h("sl-skeleton", { style: { margin: "var(--sl-spacing-medium) 0" } })) : (content.description && h(Details, Object.assign({}, props))),
1331
+ content.showProgressBar && states.loading ? (h("sl-skeleton", { style: { margin: "var(--sl-spacing-medium) 0" } })) : (content.showProgressBar && (h(ProgressBarView, Object.assign({}, props.content, props.states, { complete: taskComplete, expired: taskUnavailable })))),
1332
+ h("div", { class: sheet$7.classes.Footer }, states.loading ? (h("sl-skeleton", { style: { width: "25%", marginLeft: "auto" } })) : (h("div", { style: { display: "contents" } },
1333
+ h("span", { class: "text" },
1334
+ content.repeatable && (h("div", null,
1335
+ h("span", { class: repetitions > 0
1336
+ ? taskUnavailable
1337
+ ? "icon neutral"
1338
+ : "icon success"
1339
+ : "icon" }, arrow_left_right$1),
1340
+ h("span", { class: repetitions > 0
1341
+ ? taskUnavailable
1342
+ ? "neutral"
1343
+ : "success"
1344
+ : "" }, intl.formatMessage({
1345
+ id: "completedMessage",
1346
+ defaultMessage: content.completedText,
1347
+ }, {
1348
+ finite: content.finite,
1349
+ count: content.finite
1350
+ ? Math.min(repetitions, content.finite)
1351
+ : repetitions,
1352
+ })))),
1353
+ dateEnd && !taskUnavailable && (h("span", { class: "datetime" }, intl.formatMessage({
1354
+ id: "expiryMessage",
1355
+ defaultMessage: content.expiryMessage,
1356
+ }, {
1357
+ endDate: dateEnd
1358
+ .setLocale(luxonLocale(states.locale))
1359
+ .toLocaleString(luxon.DateTime.DATETIME_MED),
1360
+ })))),
1361
+ h("sl-button", { class: taskUnavailable
1362
+ ? "action neutral"
1363
+ : taskComplete
1364
+ ? "action disabled"
1365
+ : "action", type: "primary", size: "small", onClick: callbacks.onClick, loading: states.loadingEvent, disabled: taskComplete || taskUnavailable }, content.buttonText))))))));
1366
+ }
1367
+
1368
+ function ReferralIframeView(props) {
1369
+ const { states, data } = props;
1370
+ const { content } = states;
1371
+ const style = {
1372
+ Container: {
1373
+ position: "relative",
1374
+ width: content.iframeWidth,
1375
+ height: content.iframeHeight,
1376
+ },
1377
+ IFrame: {
1378
+ position: "absolute",
1379
+ width: "100%",
1380
+ height: "100%",
1381
+ border: "0",
1382
+ top: "0",
1383
+ left: "0",
1384
+ right: "0",
1385
+ },
1386
+ };
1387
+ // JSS config
1388
+ const sheet = createStyleSheet(style);
1389
+ const styleString = sheet.toString();
1390
+ return (h("div", { class: sheet.classes.Container },
1391
+ h("style", { type: "text/css" }, styleString),
1392
+ h("iframe", { class: sheet.classes.IFrame, src: `${content.iframeSrc}?rsCode=${data.shareCode}` })));
1393
+ }
1394
+
1395
+ const CheckMark = () => (h("svg", { width: 12, height: 10, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1396
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.58.23c.475.371.56 1.057.19 1.532L5.69 9.554a1.091 1.091 0 0 1-1.631.1L.32 5.915a1.09 1.09 0 1 1 1.542-1.542L4.73 7.239 10.049.42A1.09 1.09 0 0 1 11.58.23Z", fill: "#fff" })));
1397
+ const CheckmarkFilled = () => (h("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1398
+ h("path", { d: "M0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9C18 13.9706 13.9706 18 9 18C4.02944 18 0 13.9706 0 9Z", fill: "currentColor" }),
1399
+ h("path", { d: "M5.68394 8.77046C5.28103 8.39273 4.64819 8.41315 4.27046 8.81606C3.89273 9.21897 3.91315 9.85181 4.31606 10.2295L5.68394 8.77046ZM7.66667 12L6.98273 12.7295C7.36738 13.0902 7.96595 13.0902 8.35061 12.7295L7.66667 12ZM13.6839 7.72954C14.0869 7.35181 14.1073 6.71897 13.7295 6.31606C13.3518 5.91315 12.719 5.89273 12.3161 6.27046L13.6839 7.72954ZM4.31606 10.2295L6.98273 12.7295L8.35061 11.2705L5.68394 8.77046L4.31606 10.2295ZM8.35061 12.7295L13.6839 7.72954L12.3161 6.27046L6.98273 11.2705L8.35061 12.7295Z", fill: "white" })));
1400
+ const Gift$1 = () => (h("svg", { width: 156, height: 157, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1401
+ h("path", { d: "M40.18 126h83.663a3 3 0 0 0 3-3V73.966a3 3 0 0 0-3-3H40.18a3 3 0 0 0-3 3V123a3 3 0 0 0 3 3Z", fill: "#FFD34F" }),
1402
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M37.18 73.862v7.966h89.663v-7.966H37.18Z", fill: "#E9BB30" }),
1403
+ h("path", { d: "M133.039 74.224a2.18 2.18 0 0 0 2.187-2.172v-19.19c0-1.2-.98-2.172-2.187-2.172H31.347a2.18 2.18 0 0 0-2.187 2.172v19.19c0 1.2.98 2.172 2.187 2.172H133.04Z", fill: "#FFC000" }),
1404
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M123.287 35.172c0 6.056-9.155 15.226-13.76 15.654H88.888V126H75.141V50.826H58.534c-9.462-2.038-17.803-9.258-17.803-16.944 0-7.49 3.274-13.422 9.23-15.983 5.693-2.446 12.265-1.105 17.46 2.479 6.378 4.398 9.956 12.654 13.202 20.144.284.657.567 1.308.848 1.95.274-.608.55-1.228.83-1.856 3.216-7.22 6.887-15.464 13.057-19.89 5.454-3.913 12.387-5.39 18.38-2.711 6.197 2.77 9.549 9.127 9.549 17.157Zm-23.306-8.266c3.305-2.37 7.262-2.8 10.645 0 2.946 2.44 3.103 3.588 3.482 6.351l.067.483c0 4.09-3.549 10.252-7.097 10.252-2.515 0-4.489-.022-6.34-.041-3.375-.036-6.337-.068-11.403.04.966-1.86 1.737-3.644 2.473-5.346 1.967-4.553 3.678-8.515 8.173-11.739Zm-39.034 0c-1.6-1.103-5.268-.61-6.79.043-1.257.54-3.134 2.19-3.134 6.933 0 4.61 7.511 8.59 7.511 8.59s5.962 1.52 16.607 1.52c-3.624-8.922-8.757-13.336-14.194-17.086Z", fill: "#EB5757" }),
1405
+ h("path", { d: "M75.086 74.224h13.85v7.604h-13.85v-7.604Z", fill: "#DD4747" }),
1406
+ h("g", { filter: "url(#a)" },
1407
+ h("ellipse", { cx: 82.008, cy: 141.207, rx: 36.813, ry: 5.793, fill: "#E0DDDD", "fill-opacity": 0.8 })),
1408
+ h("path", { d: "M150.446 79.134a.5.5 0 0 1 .9 0l1.133 2.336c.05.102.132.184.234.233l2.344 1.122a.5.5 0 0 1 0 .902l-2.344 1.122a.503.503 0 0 0-.234.233l-1.133 2.336a.5.5 0 0 1-.9 0l-1.134-2.336a.499.499 0 0 0-.234-.233l-2.343-1.122a.5.5 0 0 1 0-.902l2.343-1.122a.499.499 0 0 0 .234-.233l1.134-2.336Z", fill: "#FAB6B6" }),
1409
+ h("path", { d: "M14.86 29.168a.5.5 0 0 1 .9 0l1.133 2.336a.5.5 0 0 0 .234.233l2.344 1.122a.5.5 0 0 1 0 .902l-2.344 1.122a.5.5 0 0 0-.234.233l-1.133 2.336a.5.5 0 0 1-.9 0l-1.134-2.336a.5.5 0 0 0-.234-.233l-2.343-1.122a.5.5 0 0 1 0-.902l2.344-1.122a.5.5 0 0 0 .233-.233l1.134-2.336Z", fill: "#F4EFBC" }),
1410
+ h("path", { d: "m125.382 0 .712 1.466 1.475.706-1.475.707-.712 1.466-.711-1.466-1.476-.707 1.476-.706.711-1.466Z", fill: "#FDA802" }),
1411
+ h("path", { d: "m2.187 103.552.711 1.466 1.476.706-1.476.707-.711 1.466-.711-1.466L0 105.724l1.476-.706.71-1.466Z", fill: "#E4599C" }),
1412
+ h("defs", null,
1413
+ h("filter", { id: "a", x: 35.195, y: 125.414, width: 93.625, height: 31.586, filterUnits: "userSpaceOnUse", "color-interpolation-filters": "s-rGB" },
1414
+ h("feFlood", { "flood-opacity": 0, result: "BackgroundImageFix" }),
1415
+ h("feBlend", { in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
1416
+ h("feGaussianBlur", { stdDeviation: 5, result: "effect1_foregroundBlur_653_17907" })))));
1417
+
1418
+ function Dot({ active, completed, incomplete, stage, }) {
1419
+ return (h("div", { style: {
1420
+ display: "flex",
1421
+ } },
1422
+ h("div", { style: {
1423
+ backgroundColor: completed
1424
+ ? "var(--sl-color-success-500)"
1425
+ : incomplete
1426
+ ? "var(--sl-color-neutral-200)"
1427
+ : "var(--sl-color-neutral-0)",
1428
+ border: active
1429
+ ? "1px solid var(--sl-color-success-500)"
1430
+ : incomplete
1431
+ ? "1px solid var(--sl-color-neutral-200)"
1432
+ : "1px solid var(--sl-color-success-500)",
1433
+ borderRadius: "50%",
1434
+ width: "23px",
1435
+ height: "23px",
1436
+ margin: "-11px",
1437
+ zIndex: "1",
1438
+ boxSizing: "content-box",
1439
+ } }, completed ? (h("div", { style: { top: "-10.5%", left: "23.5%", position: "relative" } },
1440
+ h(CheckMark, null))) : (h("div", { style: {
1441
+ color: active
1442
+ ? "var(--sl-color-success-500)"
1443
+ : "var(--sl-color-neutral-50)",
1444
+ width: "23px",
1445
+ lineHeight: "24px",
1446
+ textAlign: "center",
1447
+ position: "relative",
1448
+ } }, stage + 1)))));
1449
+ }
1450
+ function ProgressLine({ incomplete = false, active = false, invisible = false, }) {
1451
+ return (h("div", { style: {
1452
+ content: "''",
1453
+ flex: "0.5 0.5 0",
1454
+ height: "4px",
1455
+ borderRadius: "4px",
1456
+ background: incomplete || active
1457
+ ? "var(--sl-color-neutral-200)"
1458
+ : "var(--sl-color-success-500)",
1459
+ position: "relative",
1460
+ bottom: "0",
1461
+ left: "0",
1462
+ display: "flex",
1463
+ justifyContent: "center",
1464
+ columnGap: "50px",
1465
+ marginRight: "-2px",
1466
+ boxSizing: "content-box",
1467
+ opacity: invisible ? "0" : "1",
1468
+ } }));
1469
+ }
1470
+ function Progress({ active, completed, incomplete, stage }) {
1471
+ return [
1472
+ h(ProgressLine, { incomplete: incomplete, invisible: stage === 0 }),
1473
+ h(Dot, { active: active, completed: completed, incomplete: incomplete, stage: stage }),
1474
+ h(ProgressLine, { incomplete: incomplete, active: active, invisible: stage === 2 }),
1475
+ ];
1476
+ }
1477
+ function ProgressBar({ stageCount, currentStage, }) {
1478
+ 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, stage: stage })))));
1479
+ }
1480
+
1481
+ const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
1482
+ function RewardExchangeView(props) {
1483
+ const { states, data, callbacks, refs } = props;
1484
+ const { selectedItem, selectedStep } = states;
1485
+ const stageProgressList = {
1486
+ chooseReward: states.content.text.chooseRewardTitle,
1487
+ chooseAmount: states.content.text.chooseAmountTitle,
1488
+ confirmation: states.content.text.confirmationTitle,
1489
+ };
1490
+ const style = {
1491
+ HostBlock: HostBlock,
1492
+ Container: {
1493
+ minWidth: "300px",
1494
+ position: "relative",
1495
+ },
1496
+ FullImage: {
1497
+ objectFit: "contain",
1498
+ maxWidth: "100%",
1499
+ height: "250px",
1500
+ display: "flex",
1501
+ margin: "0 auto",
1502
+ },
1503
+ Select: {
1504
+ "&::part(label)": {
1505
+ color: "var(--sl-color-primary-500)",
1506
+ },
1507
+ "&::part(menu)": {
1508
+ maxHeight: "50vh",
1509
+ },
1510
+ "& sl-menu-item::part(checked-icon)": {
1511
+ top: "8px",
1512
+ },
1513
+ "& sl-menu-item::part(base)": {
1514
+ flexDirection: "column",
1515
+ },
1516
+ "& sl-menu-item::part(base):focus": {
1517
+ background: "transparent",
1518
+ color: "var(--sl-color-gray-700)",
1519
+ },
1520
+ },
1521
+ ProgressBar: {
1522
+ maxWidth: "350px",
1523
+ width: "100%",
1524
+ margin: "auto",
1525
+ marginBottom: "var(--sl-spacing-xxx-large)",
1526
+ "& .text-area": {
1527
+ marginTop: "5px",
1528
+ display: "flex",
1529
+ justifyContent: "center",
1530
+ textAlign: "center",
1531
+ whiteSpace: "nowrap",
1532
+ marginBottom: "6px",
1533
+ "& .text": {
1534
+ marginBottom: "var(--sl-spacing-x-small)",
1535
+ flex: "1 1 0",
1536
+ },
1537
+ "& .text.subdued": {
1538
+ color: "var(--sl-color-neutral-200)",
1539
+ },
1540
+ },
1541
+ },
1542
+ CardLayout: {
1543
+ display: "flex",
1544
+ width: "100%",
1545
+ borderRadius: "3px",
1546
+ background: "rgba(0, 0, 0, 0)",
1547
+ },
1548
+ Card: {
1549
+ display: "flex",
1550
+ userSelect: "none",
1551
+ height: "120px",
1552
+ "&::part(base)": {
1553
+ boxShadow: "none",
1554
+ width: "100%",
1555
+ },
1556
+ "&::part(body)": {
1557
+ display: "flex",
1558
+ padding: 0,
1559
+ },
1560
+ "& .selected": {
1561
+ position: "relative",
1562
+ top: "-2%",
1563
+ left: "100%",
1564
+ color: "var(--sl-color-primary-500)",
1565
+ margin: "-9px",
1566
+ },
1567
+ },
1568
+ Image: {
1569
+ padding: "var(--sl-spacing-small)",
1570
+ minWidth: "96px",
1571
+ maxWidth: "96px",
1572
+ "& .image": {
1573
+ width: "100%",
1574
+ height: "100%",
1575
+ objectFit: "contain",
1576
+ borderRadius: "4px",
1577
+ },
1578
+ "& .image.subdued": {
1579
+ filter: "brightness(0.95)",
1580
+ opacity: "0.5",
1581
+ },
1582
+ },
1583
+ Square: {
1584
+ width: "120px",
1585
+ height: "118px",
1586
+ borderRadius: "3px 0 0 3px",
1587
+ "& .image": {
1588
+ width: "100%",
1589
+ height: "100%",
1590
+ objectFit: "contain",
1591
+ borderRadius: "inherit",
1592
+ },
1593
+ },
1594
+ TextArea: {
1595
+ textAlign: "left",
1596
+ padding: "var(--sl-spacing-small)",
1597
+ paddingLeft: "0",
1598
+ "& .title": {
1599
+ fontSize: "var(--sl-font-size-medium)",
1600
+ lineHeight: "var(--sl-line-height-dense)",
1601
+ fontWeight: "600",
1602
+ color: "var(--sl-color-neutral-1000)",
1603
+ display: "-webkit-box",
1604
+ "-webkit-line-clamp": "1",
1605
+ "-webkit-box-orient": "vertical",
1606
+ overflow: "hidden",
1607
+ },
1608
+ "& .amount": {
1609
+ fontSize: "var(--sl-font-size-small)",
1610
+ lineHeight: "var(--sl-line-height-dense)",
1611
+ marginTop: "var(--sl-spacing-x-small)",
1612
+ color: "var(--sl-color-neutral-500)",
1613
+ display: "-webkit-box",
1614
+ "-webkit-line-clamp": "1",
1615
+ "-webkit-box-orient": "vertical",
1616
+ overflow: "hidden",
1617
+ },
1618
+ "& .error": {
1619
+ fontSize: "var(--sl-font-size-small)",
1620
+ lineHeight: "var(--sl-line-height-dense)",
1621
+ marginTop: "var(--sl-spacing-x-small)",
1622
+ fontWeight: "600",
1623
+ color: "var(--sl-color-warning-600)",
1624
+ display: "-webkit-box",
1625
+ "-webkit-line-clamp": "1",
1626
+ "-webkit-box-orient": "vertical",
1627
+ overflow: "hidden",
1628
+ "& .icon": {
1629
+ position: "relative",
1630
+ top: "0.1em",
1631
+ marginRight: "var(--sl-spacing-xx-small)",
1632
+ },
1633
+ },
1634
+ },
1635
+ ChooseAmount: {
1636
+ display: "flex",
1637
+ alignItems: "center",
1638
+ justifyContent: "center",
1639
+ margin: "var(--sl-spacing-medium) 0",
1640
+ "& .wrapper": {
1641
+ display: "flex",
1642
+ justifyContent: "center",
1643
+ alignItems: "center",
1644
+ gap: "var(--sl-spacing-xx-large)",
1645
+ "@media (max-width: 799px)": {
1646
+ flexDirection: "column",
1647
+ },
1648
+ },
1649
+ "& .image": {
1650
+ width: "50%",
1651
+ objectFit: "contain",
1652
+ maxWidth: "100%",
1653
+ height: "250px",
1654
+ display: "flex",
1655
+ "@media (max-width: 799px)": {
1656
+ width: "auto",
1657
+ },
1658
+ },
1659
+ "& .text": {
1660
+ width: "50%",
1661
+ maxWidth: "400px",
1662
+ minWidth: "330px",
1663
+ "@media (max-width: 799px)": {
1664
+ width: "auto",
1665
+ margin: "auto",
1666
+ },
1667
+ },
1668
+ "& .title": {
1669
+ fontSize: "var(--sl-font-size-large)",
1670
+ fontWeight: "var(--sl-font-weight-semibold)",
1671
+ color: "var(--sl-color-neutral-1000)",
1672
+ },
1673
+ "& .points": {
1674
+ fontSize: "var(--sl-font-size-large)",
1675
+ fontWeight: "var(--sl-font-weight-semibold)",
1676
+ color: "var(--sl-color-primary-500)",
1677
+ },
1678
+ "& .description": {
1679
+ fontSize: "var(--sl-font-size-medium)",
1680
+ fontWeight: "var(--sl-font-weight-normal)",
1681
+ color: "var(--sl-color-neutral-500)",
1682
+ margin: "var(--sl-spacing-medium) 0",
1683
+ lineHeight: "var(--sl-line-height-dense)",
1684
+ marginTop: "var(--sl-spacing-xx-small)",
1685
+ },
1686
+ "& .space": {
1687
+ marginBottom: "var(--sl-spacing-xxx-large)",
1688
+ },
1689
+ "& sl-menu-item[disabled]::part(label)": {
1690
+ color: "var(--sl-color-neutral-200)",
1691
+ },
1692
+ "& sl-menu-item[disabled]": {
1693
+ "& .step-cost": {
1694
+ color: "var(--sl-color-neutral-200)",
1695
+ },
1696
+ },
1697
+ },
1698
+ SelectItem: {
1699
+ display: "flex",
1700
+ flexDirection: "column",
1701
+ "& > .step-cost": {
1702
+ color: "var(--sl-color-neutral-400)",
1703
+ height: "0",
1704
+ marginBottom: "5px",
1705
+ },
1706
+ "& > .step-value": {
1707
+ margin: "0",
1708
+ },
1709
+ },
1710
+ Success: {
1711
+ textAlign: "center",
1712
+ "& .title": {
1713
+ fontSize: "var(--sl-font-size-large)",
1714
+ fontWeight: "var(--sl-font-weight-semibold)",
1715
+ color: "var(--sl-color-neutral-1000)",
1716
+ },
1717
+ "& .description": {
1718
+ color: "var(--sl-color-neutral-400)",
1719
+ width: "100%",
1720
+ maxWidth: "350px",
1721
+ margin: "0 auto",
1722
+ lineHeight: "var(--sl-line-height-dense)",
1723
+ marginBottom: "var(--sl-spacing-xx-large)",
1724
+ marginTop: "var(--sl-spacing-xx-small)",
1725
+ },
1726
+ },
1727
+ Grid: {
1728
+ display: "grid",
1729
+ justifyContent: "center",
1730
+ gap: "20px",
1731
+ gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
1732
+ },
1733
+ Confirmation: {
1734
+ maxWidth: "800px",
1735
+ margin: "auto",
1736
+ "& .wrapper": {
1737
+ display: "flex",
1738
+ "@media (max-width: 499px)": {
1739
+ flexDirection: "column",
1740
+ },
1741
+ },
1742
+ "& .reward-item-container": {
1743
+ "@media (max-width: 499px)": {
1744
+ display: "flex",
1745
+ flexDirection: "row-reverse",
1746
+ justifyContent: "flex-end",
1747
+ alignItems: "center",
1748
+ },
1749
+ },
1750
+ "& .reward-item-container .reward-title": {
1751
+ paddingBottom: "var(--sl-spacing-medium)",
1752
+ lineHeight: "20px",
1753
+ "@media (max-width: 499px)": {
1754
+ paddingBottom: "none",
1755
+ paddingLeft: "var(--sl-spacing-small)",
1756
+ },
1757
+ },
1758
+ "& .padding": {
1759
+ padding: "var(--sl-spacing-medium) 0",
1760
+ "@media (max-width: 499px)": {
1761
+ padding: "var(--sl-spacing-small) 0",
1762
+ },
1763
+ },
1764
+ "& .field": {
1765
+ width: "30%",
1766
+ textTransform: "uppercase",
1767
+ fontSize: "var(--sl-font-size-medium)",
1768
+ fontWeight: "var(--sl-font-weight-normal)",
1769
+ color: "var(--sl-color-neutral-400)",
1770
+ textAlign: "left",
1771
+ paddingRight: "var(--sl-spacing-xxx-large)",
1772
+ "@media (max-width: 499px)": {
1773
+ width: "100%",
1774
+ paddingRight: "0",
1775
+ paddingBottom: "0",
1776
+ },
1777
+ },
1778
+ "& .value": {
1779
+ fontSize: "var(--sl-font-size-large)",
1780
+ fontWeight: "var(--sl-font-weight-semibold)",
1781
+ },
1782
+ "& .top-border": {
1783
+ borderTop: "1px solid var(--sl-color-neutral-200)",
1784
+ },
1785
+ "& .image": {
1786
+ width: "200px",
1787
+ "@media (max-width: 499px)": {
1788
+ width: "100px",
1789
+ },
1790
+ },
1791
+ },
1792
+ Button: {
1793
+ display: "flex",
1794
+ flexWrap: "wrap-reverse",
1795
+ margin: "var(--sl-spacing-medium) 0",
1796
+ "& .cancel": {
1797
+ marginLeft: "auto",
1798
+ marginRight: "var(--sl-spacing-medium)",
1799
+ "&::part(base)": {
1800
+ fontWeight: "var(--sl-font-weight-normal)",
1801
+ color: "var(--sl-color-neutral-1000)",
1802
+ },
1803
+ "@media (max-width: 499px)": {
1804
+ width: "100%",
1805
+ marginRight: "0",
1806
+ marginTop: "var(--sl-spacing-small)",
1807
+ },
1808
+ },
1809
+ "& .continue": {
1810
+ "&::part(base)": {
1811
+ background: "var(--sl-color-primary-500)",
1812
+ borderColor: "var(--sl-color-primary-500)",
1813
+ fontWeight: "var(--sl-font-weight-normal)",
1814
+ color: "var(--sl-color-neutral-0)",
1815
+ },
1816
+ "@media (max-width: 499px)": {
1817
+ width: "100%",
1818
+ },
1819
+ },
1820
+ "& .continue.right": {
1821
+ marginLeft: "auto",
1822
+ },
1823
+ "& .continue.center": {
1824
+ margin: "0 auto",
1825
+ },
1826
+ },
1827
+ Confetti: {
1828
+ pointerEvents: "none",
1829
+ position: "absolute",
1830
+ width: "100%",
1831
+ height: "100%",
1832
+ top: "0%",
1833
+ left: "0%",
1834
+ zIndex: "1",
1835
+ },
1836
+ };
1837
+ // JSS config
1838
+ const sheet = createStyleSheet(style);
1839
+ const styleString = sheet.toString();
1840
+ function getInput() {
1841
+ var _a, _b, _c;
1842
+ const item = states.selectedItem;
1843
+ if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
1844
+ return h("span", null, item === null || item === void 0 ? void 0 : item.prettySourceValue);
1845
+ if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
1846
+ return (h("p", null, intl.formatMessage({
1847
+ id: "notEnoughError",
1848
+ defaultMessage: states.content.text.notEnoughError,
1849
+ }, {
1850
+ sourceUnit: item.sourceUnit,
1851
+ })));
1852
+ }
1853
+ // console.log("SELECTED ITEM ", states.selectedStep);
1854
+ // console.log("CALLBACKS ", callbacks);
1855
+ return (h("sl-select", { style: { width: "auto" }, label: (_b = states === null || states === void 0 ? void 0 : states.content) === null || _b === void 0 ? void 0 : _b.text.selectText, class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
1856
+ var _a, _b, _c, _d, _e;
1857
+ return callbacks.setExchangeState({
1858
+ amount: (_c = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.sourceValue,
1859
+ selectedStep: (_e = (_d = e.detail) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.value,
1860
+ });
1861
+ } }, (_c = item.steps) === null || _c === void 0 ? void 0 : _c.map((step) => {
1862
+ // console.log(item.steps);
1863
+ var _a, _b;
1864
+ return (h("sl-menu-item", { value: step, disabled: !step.available },
1865
+ step.prettyDestinationValue,
1866
+ " ",
1867
+ h("br", null),
1868
+ step.unavailableReasonCode && (h("p", { style: {
1869
+ fontSize: "var(--sl-font-size-small)",
1870
+ color: "var(--sl-color-warning-500)",
1871
+ margin: "0",
1872
+ } }, intl.formatMessage({
1873
+ id: "unavailableCode",
1874
+ defaultMessage: (_b = (_a = states.content) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.notAvailableError,
1875
+ }, {
1876
+ unavailableReasonCode: step.unavailableReasonCode,
1877
+ sourceUnit: item.sourceUnit,
1878
+ sourceValue: step.prettySourceValue || item.prettySourceMinValue,
1879
+ }))),
1880
+ h("div", { class: "step-cost", slot: "suffix" }, step.prettySourceValue)));
1881
+ })));
1882
+ }
1883
+ function chooseReward() {
1884
+ var _a;
1885
+ return [
1886
+ h("div", null,
1887
+ h("h2", { style: { margin: "var(--sl-spacing-large) 0" } }, states.content.text.rewardTitle),
1888
+ states.loading ? (loading()) : (h("div", { class: sheet.classes.Grid }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
1889
+ var _a, _b, _c, _d, _e;
1890
+ const style = {
1891
+ boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
1892
+ ? "0 0 0 2px var(--sl-color-primary-500)"
1893
+ : "none",
1894
+ borderRadius: "4px",
1895
+ };
1896
+ return (h("div", { key: item.key, style: style },
1897
+ h("sl-card", { class: sheet.classes.Card, style: {
1898
+ cursor: item.unavailableReasonCode
1899
+ ? "not-allowed"
1900
+ : "pointer",
1901
+ }, onClick: () => item.available &&
1902
+ callbacks.setExchangeState({ selectedItem: item }) },
1903
+ item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (h("div", { class: "selected" },
1904
+ h(CheckmarkFilled, null))),
1905
+ h("div", { style: {
1906
+ display: "flex",
1907
+ width: "100%",
1908
+ height: "120px",
1909
+ borderRadius: "3px",
1910
+ background: item.unavailableReasonCode
1911
+ ? "rgba(0, 0, 0, 0.05)"
1912
+ : "rgba(0, 0, 0, 0)",
1913
+ } },
1914
+ h("div", { class: sheet.classes.Image, style: {
1915
+ opacity: item.unavailableReasonCode ? "0.5" : "1",
1916
+ } },
1917
+ h("img", { class: item.unavailableReasonCode
1918
+ ? "image subdued"
1919
+ : "image", src: (item === null || item === void 0 ? void 0 : item.imageUrl) ||
1920
+ getAssetPath("./assets/Reward-image.png") })),
1921
+ h("div", { class: sheet.classes.TextArea, style: {
1922
+ opacity: item.unavailableReasonCode ? "0.5" : "1",
1923
+ } },
1924
+ h("div", { class: "title", style: {
1925
+ "-webkit-line-clamp": item.unavailableReasonCode
1926
+ ? "1"
1927
+ : "2",
1928
+ } }, (_a = item.name) !== null && _a !== void 0 ? _a : ""),
1929
+ h("div", { class: "amount", style: {
1930
+ "-webkit-line-clamp": item.unavailableReasonCode
1931
+ ? "1"
1932
+ : "2",
1933
+ } }, intl.formatMessage({
1934
+ id: "sourceAmountMessage",
1935
+ defaultMessage: (_c = (_b = states.content) === null || _b === void 0 ? void 0 : _b.text) === null || _c === void 0 ? void 0 : _c.sourceAmountMessage,
1936
+ }, {
1937
+ ruleType: item.ruleType,
1938
+ sourceValue: item.prettySourceValue,
1939
+ sourceMinValue: item.prettySourceMinValue,
1940
+ sourceMaxValue: item.prettySourceMaxValue,
1941
+ })),
1942
+ item.unavailableReasonCode && (h("div", { class: "error" },
1943
+ h("sl-icon", { class: "icon", name: "exclamation-triangle-fill" }),
1944
+ intl.formatMessage({
1945
+ id: "unavailableCode",
1946
+ defaultMessage: (_e = (_d = states.content) === null || _d === void 0 ? void 0 : _d.text) === null || _e === void 0 ? void 0 : _e.notAvailableError,
1947
+ }, {
1948
+ unavailableReasonCode: item.unavailableReasonCode,
1949
+ sourceUnit: item.sourceUnit,
1950
+ sourceValue: item.prettySourceValue ||
1951
+ item.prettySourceMinValue,
1952
+ }))))))));
1953
+ }))),
1954
+ h("div", { class: sheet.classes.Button },
1955
+ h("sl-button", { class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), loading: states.loading, disabled: !states.selectedItem }, states.content.text.continueText))),
1956
+ ];
1957
+ }
1958
+ function chooseAmount() {
1959
+ var _a, _b, _c, _d;
1960
+ const input = getInput();
1961
+ const isDisabled = ((_a = states.selectedItem) === null || _a === void 0 ? void 0 : _a.ruleType) === "FIXED_GLOBAL_REWARD"
1962
+ ? false
1963
+ : input && !states.amount;
1964
+ console.log("input", input);
1965
+ console.log(states.amount);
1966
+ return (h("div", null,
1967
+ h("div", { class: sheet.classes.ChooseAmount },
1968
+ h("div", { class: "wrapper" },
1969
+ h("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
1970
+ getAssetPath("./assets/Reward-image.png") }),
1971
+ h("div", { class: "text" },
1972
+ h("div", { class: "title" }, (_b = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) !== null && _b !== void 0 ? _b : ""),
1973
+ ((_c = states.selectedItem) === null || _c === void 0 ? void 0 : _c.ruleType) === "FIXED_GLOBAL_REWARD" ? (h("div", { class: "points" }, input)) : (h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)),
1974
+ ((_d = states.selectedItem) === null || _d === void 0 ? void 0 : _d.ruleType) === "FIXED_GLOBAL_REWARD" ? (h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)) : (h("div", { class: "points" }, input)),
1975
+ h("div", { class: "space" }),
1976
+ h("div", { class: sheet.classes.Button },
1977
+ h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, states.content.text.cancelText),
1978
+ h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled }, states.content.text.continueToConfirmationText)))))));
1979
+ }
1980
+ function confirmation() {
1981
+ // console.log(selectedItem);
1982
+ // console.log(selectedStep);
1983
+ const cost = (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue) || selectedItem.prettySourceValue;
1984
+ const amount = selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue;
1985
+ return (h("div", null,
1986
+ h("h2", { style: { margin: "var(--sl-spacing-large) 0", textAlign: "center" } }, states.content.text.redeemTitle),
1987
+ h("div", { class: sheet.classes.Confirmation },
1988
+ h("div", { class: "wrapper" },
1989
+ h("div", { class: "field" }, states.content.text.rewardNameTitle),
1990
+ h("div", { class: "reward-item-container" },
1991
+ h("div", { class: "reward-title" }, selectedItem.name),
1992
+ h("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
1993
+ getAssetPath("./assets/Reward-image.png") }))),
1994
+ h("div", { class: "wrapper padding" },
1995
+ h("div", { class: "field" })),
1996
+ amount && (h("div", { class: "wrapper top-border padding" },
1997
+ h("div", { class: "field" }, states.content.text.rewardAmountTitle),
1998
+ h("div", null, amount))),
1999
+ h("div", { class: "wrapper top-border padding" },
2000
+ h("div", { class: "field" }, states.content.text.costTitle),
2001
+ h("div", { class: "value" }, cost)),
2002
+ h("div", { class: sheet.classes.Button },
2003
+ h("sl-button", { class: "cancel", type: "text", size: "large", onClick: () => callbacks.setStage("chooseAmount") }, states.content.text.backText),
2004
+ h("sl-button", { class: "continue", size: "large", loading: states.loading, onClick: callbacks.exchangeReward }, states.content.text.redeemText)))));
2005
+ }
2006
+ function success() {
2007
+ var _a, _b, _c, _d, _e;
2008
+ // console.log("success");
2009
+ return (h("div", { class: sheet.classes.Success },
2010
+ h(Gift$1, null),
2011
+ h(Confetti, null),
2012
+ h("div", { class: "title" }, states.content.text.rewardRedeemedText),
2013
+ h("div", { class: "description" }, intl.formatMessage({
2014
+ id: "successMessage",
2015
+ defaultMessage: states.content.text.redemptionSuccessText,
2016
+ }, {
2017
+ sourceValue: (_a = states.selectedItem.prettySourceValue) !== null && _a !== void 0 ? _a : (_b = states.selectedStep) === null || _b === void 0 ? void 0 : _b.prettySourceValue,
2018
+ destinationValue: ((_c = states.selectedStep) === null || _c === void 0 ? void 0 : _c.prettyDestinationValue) || ((_d = states.selectedItem) === null || _d === void 0 ? void 0 : _d.name) ||
2019
+ states.selectedItem.globalRewardKey,
2020
+ })),
2021
+ (data === null || data === void 0 ? void 0 : data.fuelTankCode) && (h("div", { style: {
2022
+ width: "40%",
2023
+ margin: "-30px auto var(--sl-spacing-xxx-large) auto",
2024
+ textAlign: "left",
2025
+ color: "var(--sl-color-neutral-700)",
2026
+ } },
2027
+ states.content.text.promoCode,
2028
+ h(ShareLinkView, { shareString: data.fuelTankCode, tooltiptext: (_e = states === null || states === void 0 ? void 0 : states.content) === null || _e === void 0 ? void 0 : _e.text.toopTipText, open: states.open, onClick: callbacks.copyFuelTankCode }))),
2029
+ h("div", { class: sheet.classes.Button },
2030
+ h("sl-button", { class: "continue center", type: "primary", size: "large", onClick: () => callbacks.resetState(true) }, states.content.text.doneText))));
2031
+ }
2032
+ const stages = {
2033
+ chooseReward: () => chooseReward(),
2034
+ chooseAmount: () => chooseAmount(),
2035
+ confirmation: () => confirmation(),
2036
+ success: () => success(),
2037
+ };
2038
+ const currentStage = stages[states.redeemStage];
2039
+ function stageMap() {
2040
+ const stageNumber = stageList.indexOf(states.redeemStage);
2041
+ return (h("div", { class: sheet.classes.ProgressBar },
2042
+ h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
2043
+ if (stageList.indexOf(stage) <= stageNumber) {
2044
+ return h("span", { class: "text" }, stageProgressList[stage]);
2045
+ }
2046
+ else {
2047
+ return (h("span", { class: "text subdued" }, stageProgressList[stage]));
2048
+ }
2049
+ })),
2050
+ h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
2051
+ }
2052
+ function loading() {
2053
+ return (h("div", { class: sheet.classes.Grid }, [...Array(states.content.text.skeletonCardNum)].map(() => {
2054
+ return (h("div", null,
2055
+ h("sl-card", { class: sheet.classes.Card },
2056
+ h("div", { class: sheet.classes.CardLayout },
2057
+ h("div", null,
2058
+ h("sl-skeleton", { style: {
2059
+ width: "100px",
2060
+ height: "100px",
2061
+ margin: "9px",
2062
+ "--border-radius": "4px",
2063
+ } })),
2064
+ h("div", { style: {
2065
+ margin: "var(--sl-spacing-small) var(--sl-spacing-small) 0 0",
2066
+ width: "100%",
2067
+ } },
2068
+ h("sl-skeleton", { style: { marginBottom: "var(--sl-spacing-small)" } }),
2069
+ h("sl-skeleton", { style: { marginBottom: "var(--sl-spacing-small)" } }),
2070
+ h("sl-skeleton", { style: { width: "45%" } }))))));
2071
+ })));
2072
+ }
2073
+ function errorMessage() {
2074
+ return (h("sl-alert", { type: "danger", open: true },
2075
+ h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
2076
+ states.content.text.redemptionError));
2077
+ }
2078
+ function queryErrorMessage() {
2079
+ return (h("sl-alert", { type: "danger", open: true },
2080
+ h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
2081
+ states.content.text.queryError));
2082
+ }
2083
+ function Confetti() {
2084
+ return (h("canvas", { ref: (canvas) => {
2085
+ if (!(refs === null || refs === void 0 ? void 0 : refs.canvasRef))
2086
+ return;
2087
+ refs.canvasRef.current = canvas;
2088
+ }, id: "my-canvas", class: sheet.classes.Confetti }));
2089
+ }
2090
+ return (h("div", { class: sheet.classes.Container },
2091
+ h("style", { type: "text/css" }, styleString),
2092
+ h("div", null,
2093
+ stageMap(),
2094
+ states.exchangeError && errorMessage(),
2095
+ states.queryError && queryErrorMessage(),
2096
+ currentStage && currentStage(),
2097
+ states.redeemStage === "success")));
2098
+ }
2099
+
2100
+ const baseResponse = (data, stage = "chooseReward", selectedItem = null, selectedStep = null, error = false, loading = false, fueltank = null) => ({
2101
+ states: {
2102
+ content: {
2103
+ text: {
2104
+ buttonText: "Exchange Rewards",
2105
+ notAvailableError: "{unavailableReasonCode, select, NOT_CHAMPION {CUSTOM ERROR MESSAGE } US_TAX {Exceeds tax limit for this year} INSUFFICIENT_REDEEMABLE_CREDIT {{sourceValue} required} AVAILABILITY_PREDICATE {Not available} other {unavailableReasonCode} }",
2106
+ chooseRewardTitle: "Rewards",
2107
+ chooseAmountTitle: "Select",
2108
+ confirmationTitle: "Confirm",
2109
+ rewardTitle: "Choose a reward",
2110
+ cancelText: "Cancel",
2111
+ backText: "Back",
2112
+ continueText: "Continue",
2113
+ continueToConfirmationText: "Continue to confirmation",
2114
+ redeemText: "Redeem",
2115
+ redeemTitle: "Confirm and redeem",
2116
+ redemptionSuccessText: "Redeemed {sourceValue} for {destinationValue}",
2117
+ doneText: "Done",
2118
+ toolTipText: "Copied!",
2119
+ selectText: "Select amount to receive",
2120
+ sourceAmountMessage: "{ruleType, select, FIXED_GLOBAL_REWARD {{sourceValue}} other {{sourceMinValue} to {sourceMaxValue}}}",
2121
+ rewardRedeemedText: "Reward redeemed",
2122
+ redemptionError: "An error occured trying to redeem this reward. Please try again",
2123
+ promoCode: "Promo code",
2124
+ skeletonCardNum: 8,
2125
+ rewardNameTitle: "Reward Name",
2126
+ rewardAmountTitle: "Reward Amount",
2127
+ costTitle: "Cost",
2128
+ },
2129
+ },
2130
+ redeemStage: stage,
2131
+ amount: 0,
2132
+ exchangeError: error,
2133
+ loading: loading,
2134
+ selectedItem: selectedItem,
2135
+ selectedStep: selectedStep,
2136
+ open: false,
2137
+ },
2138
+ data: {
2139
+ exchangeList: data,
2140
+ fuelTankCode: fueltank,
2141
+ },
2142
+ callbacks: {
2143
+ exchangeReward: null,
2144
+ resetState: null,
2145
+ setStage: null,
2146
+ setExchangeState: null,
2147
+ copyFuelTankCode: null,
2148
+ refs: null,
2149
+ },
2150
+ refs: null,
2151
+ });
2152
+ const baseReward = {
2153
+ key: "",
2154
+ name: "",
2155
+ description: "Description of reward. Lorem ipsum dolor sit amet, consectetur adipiscing. Id nec semper sapien dignissim rhoncus nunc.",
2156
+ imageUrl: "",
2157
+ available: true,
2158
+ unavailableReasonCode: null,
2159
+ ruleType: "FIXED_GLOBAL_REWARD",
2160
+ sourceUnit: "POINT",
2161
+ sourceValue: 10,
2162
+ prettySourceValue: "10 SaaSquatch Points",
2163
+ sourceMinValue: null,
2164
+ prettySourceMinValue: null,
2165
+ sourceMaxValue: null,
2166
+ prettySourceMaxValue: null,
2167
+ destinationMinValue: null,
2168
+ prettyDestinationMinValue: null,
2169
+ destinationMaxValue: null,
2170
+ prettyDestinationMaxValue: null,
2171
+ globalRewardKey: "",
2172
+ destinationUnit: null,
2173
+ steps: [],
2174
+ };
2175
+ const notEnoughPoints = {
2176
+ available: false,
2177
+ unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
2178
+ };
2179
+ const usTax = {
2180
+ available: false,
2181
+ unavailableReasonCode: "US_TAX",
2182
+ };
2183
+ const customError = {
2184
+ available: false,
2185
+ unavailableReasonCode: "NOT_CHAMPION",
2186
+ };
2187
+ const selected = {
2188
+ key: "r1",
2189
+ };
2190
+ const imageUrl = (props) => ({
2191
+ imageUrl: props,
2192
+ });
2193
+ const name = (props) => ({
2194
+ name: props,
2195
+ });
2196
+ const description = (props) => ({
2197
+ description: props,
2198
+ });
2199
+ const fixedValue = (props) => ({
2200
+ prettySourceValue: props,
2201
+ });
2202
+ const variableValue = (min, max, unit) => ({
2203
+ ruleType: "VARIABLE_CREDIT_REWARD",
2204
+ sourceMinValue: min,
2205
+ prettySourceMinValue: min + " " + unit,
2206
+ sourceMaxValue: max,
2207
+ prettySourceMaxValue: max + " " + unit,
2208
+ });
2209
+ const demoData = [
2210
+ {
2211
+ ...baseReward,
2212
+ ...name("Free swag with a promo code"),
2213
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png"),
2214
+ ...fixedValue("40 Points"),
2215
+ },
2216
+ {
2217
+ ...baseReward,
2218
+ ...selected,
2219
+ ...name("Visa® Prepaid Card USD"),
2220
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829161/tenant_test_a7iws76wkk4az/lmzj1rtxchiyquvazo5k.png"),
2221
+ ...variableValue(20, 80, "Points"),
2222
+ },
2223
+ {
2224
+ ...baseReward,
2225
+ ...name("$50 Store credit"),
2226
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829222/tenant_test_a7iws76wkk4az/wvxtrsytmr4h1ozhxspv.png"),
2227
+ ...fixedValue("100 Points"),
2228
+ },
2229
+ {
2230
+ ...baseReward,
2231
+ ...name("Variable amount of store credit"),
2232
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829263/tenant_test_a7iws76wkk4az/dbo8tb4qpwmhg5iudviq.png"),
2233
+ ...variableValue(20, 100, "Points"),
2234
+ },
2235
+ ];
2236
+ const data = [
2237
+ {
2238
+ ...baseReward,
2239
+ ...name("Free swag with a promo code"),
2240
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png"),
2241
+ ...fixedValue("40 SaaSquatch Points"),
2242
+ },
2243
+ {
2244
+ ...baseReward,
2245
+ ...selected,
2246
+ ...name("Visa® Prepaid Card USD"),
2247
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829161/tenant_test_a7iws76wkk4az/lmzj1rtxchiyquvazo5k.png"),
2248
+ ...variableValue(20, 80, "Points"),
2249
+ },
2250
+ {
2251
+ ...baseReward,
2252
+ ...name("A very exclusive gift box"),
2253
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829284/tenant_test_a7iws76wkk4az/cognmlwma874b5q94hqv.png"),
2254
+ ...fixedValue("30 SaaSquatch Points"),
2255
+ },
2256
+ {
2257
+ ...baseReward,
2258
+ ...name("$50 Store credit"),
2259
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829222/tenant_test_a7iws76wkk4az/wvxtrsytmr4h1ozhxspv.png"),
2260
+ ...fixedValue("100 SaaSquatch Points"),
2261
+ },
2262
+ {
2263
+ ...baseReward,
2264
+ ...name("Variable amount of store credit"),
2265
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829263/tenant_test_a7iws76wkk4az/dbo8tb4qpwmhg5iudviq.png"),
2266
+ ...variableValue(20, 100, "Points"),
2267
+ },
2268
+ {
2269
+ ...baseReward,
2270
+ ...notEnoughPoints,
2271
+ ...name("A very rare cactus"),
2272
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829341/tenant_test_a7iws76wkk4az/lgrlweifpsekh2y4zjih.png"),
2273
+ ...fixedValue("2000 SaaSquatch Points"),
2274
+ },
2275
+ {
2276
+ ...baseReward,
2277
+ ...usTax,
2278
+ ...name("$1000 Store credit with a really super long name in the front page"),
2279
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829384/tenant_test_a7iws76wkk4az/f0dzeyrx3hojncbgim8y.png"),
2280
+ ...fixedValue("2000 SaaSquatch Long Points"),
2281
+ },
2282
+ {
2283
+ ...baseReward,
2284
+ ...notEnoughPoints,
2285
+ ...name("A holiday gift box"),
2286
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829450/tenant_test_a7iws76wkk4az/ujzfhfkvwqb02dlgjx6q.png"),
2287
+ ...fixedValue("100 SaaSquatch Points"),
2288
+ },
2289
+ ];
2290
+ const rewardExchange = {
2291
+ ...baseResponse(data),
2292
+ };
2293
+ const demoRewardExchange = {
2294
+ ...baseResponse(demoData),
2295
+ };
2296
+ const rewardExchangeLongText = {
2297
+ ...baseResponse([
2298
+ {
2299
+ ...baseReward,
2300
+ ...notEnoughPoints,
2301
+ ...name("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
2302
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829450/tenant_test_a7iws76wkk4az/ujzfhfkvwqb02dlgjx6q.png"),
2303
+ ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
2304
+ },
2305
+ {
2306
+ ...baseReward,
2307
+ ...name("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
2308
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829384/tenant_test_a7iws76wkk4az/f0dzeyrx3hojncbgim8y.png"),
2309
+ ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
2310
+ },
2311
+ {
2312
+ ...baseReward,
2313
+ ...name("Suuuuuuuuper aweeeeesssssoooommme reward!!!!!!"),
2314
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829222/tenant_test_a7iws76wkk4az/wvxtrsytmr4h1ozhxspv.png"),
2315
+ ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
2316
+ },
2317
+ ...data,
2318
+ ]),
2319
+ };
2320
+ const rewardExchangeCustomErrorMsg = {
2321
+ ...baseResponse([
2322
+ {
2323
+ ...baseReward,
2324
+ ...customError,
2325
+ ...name("A very rare cactus"),
2326
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829341/tenant_test_a7iws76wkk4az/lgrlweifpsekh2y4zjih.png"),
2327
+ ...fixedValue("2000 SaaSquatch Points"),
2328
+ },
2329
+ ...data,
2330
+ ]),
2331
+ };
2332
+ const rewardExchangeSelected = {
2333
+ ...baseResponse(data, "chooseReward", {
2334
+ ...baseReward,
2335
+ ...selected,
2336
+ ...name("Visa® Prepaid Card USD"),
2337
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829161/tenant_test_a7iws76wkk4az/lmzj1rtxchiyquvazo5k.png"),
2338
+ ...variableValue(20, 80, "Points"),
2339
+ }),
2340
+ };
2341
+ const baseStep = (dst, dstUnit, src, srcUnit, available = true, unavailableReason = null) => ({
2342
+ destinationValue: dst,
2343
+ prettyDestinationValue: dstUnit + dst,
2344
+ sourceValue: src,
2345
+ prettySourceValue: src + " " + srcUnit,
2346
+ available: available,
2347
+ unavailableReasonCode: unavailableReason,
2348
+ });
2349
+ const chooseAmountVariable = {
2350
+ ...baseResponse(data, "chooseAmount", {
2351
+ ...baseReward,
2352
+ ...name("Visa® Prepaid Card USD"),
2353
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829161/tenant_test_a7iws76wkk4az/lmzj1rtxchiyquvazo5k.png"),
2354
+ ...variableValue(20, 80, "Points"),
2355
+ steps: [
2356
+ baseStep(20, "$", 40, "Points"),
2357
+ baseStep(30, "$", 60, "Points"),
2358
+ baseStep(40, "$", 80, "Points"),
2359
+ baseStep(50, "$", 100, "Points"),
2360
+ baseStep(60, "$", 120, "Points"),
2361
+ ],
2362
+ }),
2363
+ };
2364
+ const chooseAmountVariableNoDescription = {
2365
+ ...baseResponse(data, "chooseAmount", {
2366
+ ...baseReward,
2367
+ ...name("Visa® Prepaid Card USD"),
2368
+ ...description(""),
2369
+ ...imageUrl("https://i.imgur.com/veHErQX.png"),
2370
+ ...variableValue(20, 80, "Points"),
2371
+ steps: [
2372
+ baseStep(20, "$", 40, "Points"),
2373
+ baseStep(30, "$", 60, "Points"),
2374
+ baseStep(40, "$", 80, "Points"),
2375
+ baseStep(50, "$", 100, "Points"),
2376
+ baseStep(60, "$", 120, "Points"),
2377
+ ],
2378
+ }),
2379
+ };
2380
+ const chooseAmountVariableDisabled = {
2381
+ ...baseResponse(data, "chooseAmount", {
2382
+ ...baseReward,
2383
+ ...name("Visa® Prepaid Card USD"),
2384
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829161/tenant_test_a7iws76wkk4az/lmzj1rtxchiyquvazo5k.png"),
2385
+ ...variableValue(20, 80, "Points"),
2386
+ steps: [
2387
+ baseStep(20, "$", 40, "Points"),
2388
+ baseStep(30, "$", 60, "Points"),
2389
+ baseStep(40, "$", 80, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
2390
+ baseStep(50, "$", 100, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
2391
+ baseStep(60, "$", 120, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
2392
+ ],
2393
+ }),
2394
+ };
2395
+ const chooseAmountVariableUnavailable = {
2396
+ ...baseResponse(data, "chooseAmount", {
2397
+ ...baseReward,
2398
+ ...name("Visa® Prepaid Card USD"),
2399
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829161/tenant_test_a7iws76wkk4az/lmzj1rtxchiyquvazo5k.png"),
2400
+ ...variableValue(20, 80, "Points"),
2401
+ steps: [
2402
+ baseStep(20, "$", 40, "Points"),
2403
+ baseStep(30, "$", 60, "Points"),
2404
+ baseStep(40, "$", 80, "Points", false, "US_TAX"),
2405
+ baseStep(50, "$", 100, "Points", false, "US_TAX"),
2406
+ baseStep(60, "$", 120, "Points", false, "US_TAX"),
2407
+ ],
2408
+ }),
2409
+ };
2410
+ const chooseAmountFixed = {
2411
+ ...baseResponse(data, "chooseAmount", {
2412
+ ...baseReward,
2413
+ ...name("Free swag with a promo code"),
2414
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829486/tenant_test_a7iws76wkk4az/xtptk0dynrxxlkg0dctb.png"),
2415
+ ...fixedValue("40 SaaSquatch Points"),
2416
+ }),
2417
+ };
2418
+ const chooseAmountFixedNoDescription = {
2419
+ ...baseResponse(data, "chooseAmount", {
2420
+ ...baseReward,
2421
+ ...description(""),
2422
+ ...name("Free swag with a promo code"),
2423
+ ...imageUrl("https://i.imgur.com/n7vC4BR.png"),
2424
+ ...fixedValue("40 SaaSquatch Points"),
2425
+ }),
2426
+ };
2427
+ const confirmFixed = {
2428
+ ...baseResponse(data, "confirmation", {
2429
+ ...baseReward,
2430
+ ...name("Free swag with a promo code"),
2431
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829486/tenant_test_a7iws76wkk4az/xtptk0dynrxxlkg0dctb.png"),
2432
+ ...fixedValue("40 SaaSquatch Points"),
2433
+ }),
2434
+ };
2435
+ const confirmVariable = {
2436
+ ...baseResponse(data, "confirmation", {
2437
+ ...baseReward,
2438
+ ...name("Visa® Prepaid Card USD"),
2439
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829161/tenant_test_a7iws76wkk4az/lmzj1rtxchiyquvazo5k.png"),
2440
+ ...variableValue(20, 80, "Points"),
2441
+ }, baseStep(20, "$", 40, "Points")),
2442
+ };
2443
+ const error = {
2444
+ ...baseResponse(data, "confirmation", {
2445
+ ...baseReward,
2446
+ ...name("Visa® Prepaid Card USD"),
2447
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829161/tenant_test_a7iws76wkk4az/lmzj1rtxchiyquvazo5k.png"),
2448
+ ...variableValue(20, 80, "Points"),
2449
+ }, baseStep(20, "$", 40, "Points"), true),
2450
+ };
2451
+ const success = {
2452
+ ...baseResponse(data, "success", {
2453
+ ...baseReward,
2454
+ ...name("Free swag with a promo code"),
2455
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829486/tenant_test_a7iws76wkk4az/xtptk0dynrxxlkg0dctb.png"),
2456
+ ...fixedValue("40 SaaSquatch Points"),
2457
+ }, undefined, undefined, undefined, "4ah2-hh46-gk7r"),
2458
+ };
2459
+ const successVariable = {
2460
+ ...baseResponse(data, "success", {
2461
+ ...baseReward,
2462
+ ...name("Visa® Prepaid Card USD"),
2463
+ ...imageUrl("https://res.cloudinary.com/saasquatch-staging/image/upload/v1643829284/tenant_test_a7iws76wkk4az/cognmlwma874b5q94hqv.png"),
2464
+ ...variableValue(20, 80, "Points"),
2465
+ }, baseStep(20, "$", 40, "Points")),
2466
+ };
2467
+ const loading = {
2468
+ ...baseResponse(null, "chooseReward", null, null, false, true),
2469
+ };
2470
+
2471
+ function CardFeedView(props, children) {
2472
+ const style = {
2473
+ Container: {
2474
+ columnGap: props.gap + "px",
2475
+ columnWidth: props.width + "px",
2476
+ "& > div": {
2477
+ marginBottom: "24px",
2478
+ },
2479
+ },
2480
+ };
2481
+ const sheet = createStyleSheet(style);
2482
+ const styleString = sheet.toString();
2483
+ console.log(props);
2484
+ const vanillaStyle = `
2485
+ :host{
2486
+ display: block;
2487
+ }
2488
+
2489
+ `;
2490
+ return (h("div", null,
2491
+ h("style", { type: "text/css" },
2492
+ styleString,
2493
+ vanillaStyle),
2494
+ h("div", { class: sheet.classes.Container }, children)));
2495
+ }
2496
+
2497
+ function t(t,n,r){return Math.min(Math.max(t,r),n)}class n extends Error{constructor(t){super(`Failed to parse color: "${t}"`);}}function r(r){if("string"!=typeof r)throw new n(r);if("transparent"===r.trim().toLowerCase())return [0,0,0,0];let e=r.trim();e=u.test(r)?function(t){const r=t.toLowerCase().trim(),e=o[function(t){let n=5381,r=t.length;for(;r;)n=33*n^t.charCodeAt(--r);return (n>>>0)%2341}(r)];if(!e)throw new n(t);return `#${e}`}(r):r;const f=s.exec(e);if(f){const t=Array.from(f).slice(1);return [...t.slice(0,3).map(t=>parseInt(_(t,2),16)),parseInt(_(t[3]||"f",2),16)/255]}const p=i.exec(e);if(p){const t=Array.from(p).slice(1);return [...t.slice(0,3).map(t=>parseInt(t,16)),parseInt(t[3]||"ff",16)/255]}const z=a.exec(e);if(z){const t=Array.from(z).slice(1);return [...t.slice(0,3).map(t=>parseInt(t,10)),parseFloat(t[3]||"1")]}const h=c.exec(e);if(h){const[e,o,_,s]=Array.from(h).slice(1).map(parseFloat);if(t(0,100,o)!==o)throw new n(r);if(t(0,100,_)!==_)throw new n(r);return [...l(e,o,_),s||1]}throw new n(r)}const e=t=>parseInt(t.replace(/_/g,""),36),o="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,n)=>{const r=e(n.substring(0,3)),o=e(n.substring(3)).toString(16);let _="";for(let t=0;t<6-o.length;t++)_+="0";return t[r]=`${_}${o}`,t},{}),_=(t,n)=>Array.from(Array(n)).map(()=>t).join(""),s=new RegExp(`^#${_("([a-f0-9])",3)}([a-f0-9])?$`,"i"),i=new RegExp(`^#${_("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),a=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${_(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),c=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,u=/^[a-z]+$/i,f=t=>Math.round(255*t),l=(t,n,r)=>{let e=r/100;if(0===n)return [e,e,e].map(f);const o=(t%360+360)%360/60,_=(1-Math.abs(2*e-1))*(n/100),s=_*(1-Math.abs(o%2-1));let i=0,a=0,c=0;o>=0&&o<1?(i=_,a=s):o>=1&&o<2?(i=s,a=_):o>=2&&o<3?(a=_,c=s):o>=3&&o<4?(a=s,c=_):o>=4&&o<5?(i=s,c=_):o>=5&&o<6&&(i=_,c=s);const u=e-_/2;return [i+u,a+u,c+u].map(f)};function p(t){const[n,e,o,_]=r(t).map((t,n)=>3===n?t:t/255),s=Math.max(n,e,o),i=Math.min(n,e,o),a=(s+i)/2;if(s===i)return [0,0,a,_];const c=s-i;return [60*(n===s?(e-o)/c+(e<o?6:0):e===s?(o-n)/c+2:(n-e)/c+4),a>.5?c/(2-s-i):c/(s+i),a,_]}function z(n,r,e,o){return `hsla(${(n%360).toFixed()}, ${t(0,100,100*r).toFixed()}%, ${t(0,100,100*e).toFixed()}%, ${parseFloat(t(0,1,o).toFixed(3))})`}
2498
+
2499
+ const colorScale = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
2500
+ const lScale = [
2501
+ 0.95,
2502
+ 0.86,
2503
+ 0.76,
2504
+ 0.66,
2505
+ 0.56,
2506
+ 0.46,
2507
+ 0.39,
2508
+ 0.32,
2509
+ 0.25,
2510
+ 0.18,
2511
+ 0.15,
2512
+ ];
2513
+ // https://github.com/ricokahler/color2k/blob/main/src/parseToRgba.ts
2514
+ const hslaRegex = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i;
2515
+ function niceParseToHsla(color) {
2516
+ const normalizedColor = color.trim();
2517
+ const hslaMatch = hslaRegex.exec(normalizedColor);
2518
+ if (hslaMatch) {
2519
+ const [h, s, l, a] = Array.from(hslaMatch).slice(1).map(parseFloat);
2520
+ if (t(0, 100, s) !== s)
2521
+ throw new n(color);
2522
+ if (t(0, 100, l) !== l)
2523
+ throw new n(color);
2524
+ return [h, s / 100, l, a || 1];
2525
+ }
2526
+ // Warning -- converts to RGB first, so is lossy
2527
+ return p(color);
2528
+ }
2529
+ function generateScale(color, name = "primary") {
2530
+ const [h, s, l, a] = niceParseToHsla(color);
2531
+ return lScale
2532
+ .map((l) => z(h, s, l, a))
2533
+ .map((color, index) => {
2534
+ return `--sl-color-${name}-${colorScale[index]}: ${color};\n`;
2535
+ });
2536
+ }
2537
+ /**
2538
+ * Generated a Shoelace color scale css string from a base color
2539
+ *
2540
+ * @param color
2541
+ * @param name
2542
+ * @returns
2543
+ */
2544
+ function autoColorScaleCss(color, name = "primary") {
2545
+ return generateScale(color, name).join("\n");
2546
+ }
2547
+
2548
+ const map = new Map();
2549
+ function withShadowView(component) {
2550
+ // TODO: Could only do this if rendered in a Stencilbook environment to prevent unintended side-effects
2551
+ const element = getElement(component);
2552
+ let renderFn = component["render"].bind(component);
2553
+ const newRenderFn = () => {
2554
+ const key = element.getAttribute("stencilbook-shadow-view");
2555
+ if (key) {
2556
+ const value = map.get(key);
2557
+ if (value) {
2558
+ return value;
2559
+ }
2560
+ }
2561
+ return renderFn();
2562
+ };
2563
+ component["render"] = newRenderFn;
2564
+ }
2565
+ /**
2566
+ * Any story that defines `parameters.tagname` will be used as a wrapper component around the view
2567
+ */
2568
+ const ShadowViewAddon = ({ story }, children) => {
2569
+ var _a;
2570
+ let TagName = (_a = story.parent.parameters) === null || _a === void 0 ? void 0 : _a.tagname;
2571
+ if (!TagName)
2572
+ return children;
2573
+ const randomInt = Math.round(Math.random() * 100000);
2574
+ map.set(randomInt + "", children);
2575
+ const RandomTagName = "stencilbook-shawdow-view-" + randomInt;
2576
+ // This will only re-render when the tag name changes, so we use a random tag name every time.
2577
+ // Altneratively we could try to trick Stencil to call `forceUpdate` every time.
2578
+ return (h(RandomTagName, null,
2579
+ h(TagName, { "stencilbook-shadow-view": randomInt })));
2580
+ };
2581
+
2582
+ export { withShadowView as A, demoRewardExchange as B, CardFeedView as C, EditProfileView as E, LeaderboardView as L, PortalFrameView as P, ReferralIframeView as R, ShareButtonView as S, TaskCardView as T, ShareLinkView as a, useShareButton as b, PortalChangePasswordView as c, PortalLoginView as d, PortalRegisterView as e, ProgressBarView as f, RewardExchangeView as g, rewardExchangeLongText as h, rewardExchangeSelected as i, chooseAmountFixed as j, chooseAmountFixedNoDescription as k, chooseAmountVariable as l, chooseAmountVariableNoDescription as m, chooseAmountVariableDisabled as n, chooseAmountVariableUnavailable as o, confirmFixed as p, confirmVariable as q, rewardExchangeCustomErrorMsg as r, error as s, success as t, useShareLink as u, successVariable as v, loading as w, rewardExchange as x, autoColorScaleCss as y, ShadowViewAddon as z };