@beamimpact/web-sdk 1.50.1 → 1.52.1

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 (352) hide show
  1. package/dist/chunks/_share-dialog-dependencies-BwdvNwrJ.esm.js +2 -0
  2. package/dist/chunks/_share-dialog-dependencies-BwdvNwrJ.esm.js.map +1 -0
  3. package/dist/chunks/_share-dialog-dependencies-QaTONkKb.esm.js +2 -0
  4. package/dist/chunks/_share-dialog-dependencies-QaTONkKb.esm.js.map +1 -0
  5. package/dist/chunks/{beam-errors-AMvTvR1C.esm.js → beam-errors-Ci0d3926.esm.js} +1 -1
  6. package/dist/chunks/{beam-errors-AMvTvR1C.esm.js.map → beam-errors-Ci0d3926.esm.js.map} +1 -1
  7. package/dist/chunks/{cart-contents-6_ztOjrx.esm.d.ts → cart-contents-CUgc4y1N.esm.d.ts} +1 -1
  8. package/dist/chunks/cart-contents-DkoytiZh.esm.js +2 -0
  9. package/dist/chunks/{cart-contents-h60geKWa.esm.js.map → cart-contents-DkoytiZh.esm.js.map} +1 -1
  10. package/dist/chunks/{css-card-grid-nEc--M5M.esm.js → css-card-grid-CvoGpsJH.esm.js} +2 -2
  11. package/dist/chunks/{css-card-grid-nEc--M5M.esm.js.map → css-card-grid-CvoGpsJH.esm.js.map} +1 -1
  12. package/dist/chunks/enforce-config-Ba1JkOHs.esm.js +3 -0
  13. package/dist/chunks/{enforce-config-S8EGgEnO.esm.js.map → enforce-config-Ba1JkOHs.esm.js.map} +1 -1
  14. package/dist/chunks/enforce-config-CZ3ToOgr.esm.js +3 -0
  15. package/dist/chunks/{enforce-config-l-tNb_z7.esm.js.map → enforce-config-CZ3ToOgr.esm.js.map} +1 -1
  16. package/dist/chunks/{events-u_8n2LIU.esm.d.ts → events-BKkf9u9l.esm.d.ts} +3 -3
  17. package/dist/chunks/{events-T3hYV1LF.esm.js → events-BohmT6Lp.esm.js} +2 -2
  18. package/dist/chunks/{events-T3hYV1LF.esm.js.map → events-BohmT6Lp.esm.js.map} +1 -1
  19. package/dist/chunks/index-B5vRxWI3.esm.js +2 -0
  20. package/dist/chunks/index-B5vRxWI3.esm.js.map +1 -0
  21. package/dist/chunks/{index-JDZQClkA.esm.js → index-BNjsFEGn.esm.js} +2 -2
  22. package/dist/chunks/{index-JDZQClkA.esm.js.map → index-BNjsFEGn.esm.js.map} +1 -1
  23. package/dist/chunks/{index-bhqIqVQJ.esm.d.ts → index-BqBEii8E.esm.d.ts} +1 -1
  24. package/dist/chunks/index-BsuCVFh-.esm.js +2 -0
  25. package/dist/chunks/index-BsuCVFh-.esm.js.map +1 -0
  26. package/dist/chunks/{index-dLnZQZlT.esm.js → index-C-beNpP0.esm.js} +2 -2
  27. package/dist/chunks/index-C-beNpP0.esm.js.map +1 -0
  28. package/dist/chunks/{index-E8H5A7Qq.esm.js → index-C3hpHWh1.esm.js} +1 -1
  29. package/dist/chunks/index-C3hpHWh1.esm.js.map +1 -0
  30. package/dist/chunks/index-C9SnlT_2.esm.js +2 -0
  31. package/dist/chunks/index-C9SnlT_2.esm.js.map +1 -0
  32. package/dist/chunks/index-CFZqe2Wn.esm.js +2 -0
  33. package/dist/chunks/index-CFZqe2Wn.esm.js.map +1 -0
  34. package/dist/chunks/{index-FQExZDX9.esm.js → index-CFtmDAHb.esm.js} +1 -1
  35. package/dist/chunks/index-CFtmDAHb.esm.js.map +1 -0
  36. package/dist/chunks/index-CTt5RnKY.esm.js +2 -0
  37. package/dist/chunks/index-CTt5RnKY.esm.js.map +1 -0
  38. package/dist/chunks/{index-0X3JKFYs.esm.d.ts → index-CbKkAM6h.esm.d.ts} +1 -1
  39. package/dist/chunks/{index-f7fp9odj.esm.js → index-CbWdmBet.esm.js} +2 -2
  40. package/dist/chunks/index-CbWdmBet.esm.js.map +1 -0
  41. package/dist/chunks/{index-XCMf22lv.esm.js → index-D6qJfs7_.esm.js} +1 -1
  42. package/dist/chunks/index-D6qJfs7_.esm.js.map +1 -0
  43. package/dist/chunks/{index-XPlAZw7t.esm.js → index-DElVAjg2.esm.js} +2 -2
  44. package/dist/chunks/{index-XPlAZw7t.esm.js.map → index-DElVAjg2.esm.js.map} +1 -1
  45. package/dist/chunks/{index-HVGMpZIV.esm.js → index-DTGB86pM.esm.js} +2 -2
  46. package/dist/chunks/{index-HVGMpZIV.esm.js.map → index-DTGB86pM.esm.js.map} +1 -1
  47. package/dist/chunks/index-DZt3Lbb4.esm.js +2 -0
  48. package/dist/chunks/index-DZt3Lbb4.esm.js.map +1 -0
  49. package/dist/chunks/{index-kFulvjM4.esm.js → index-DhtZDPvk.esm.js} +2 -2
  50. package/dist/chunks/index-DhtZDPvk.esm.js.map +1 -0
  51. package/dist/chunks/{index-q2vZ79t1.esm.d.ts → index-Dnm34FcO.esm.d.ts} +2 -2
  52. package/dist/chunks/{index-puZGYsUA.esm.d.ts → index-DvbUE31b.esm.d.ts} +2 -2
  53. package/dist/chunks/{index-m1LRybiJ.esm.js → index-GcpuX_TZ.esm.js} +2 -2
  54. package/dist/chunks/index-GcpuX_TZ.esm.js.map +1 -0
  55. package/dist/chunks/{index-eXilYHHK.esm.js → index-IKiJwo5v.esm.js} +2 -2
  56. package/dist/chunks/{index-eXilYHHK.esm.js.map → index-IKiJwo5v.esm.js.map} +1 -1
  57. package/dist/chunks/{index-cznI-EZa.esm.d.ts → index-TAxKoTC1.esm.d.ts} +4 -2
  58. package/dist/chunks/index-ki8pLX6n.esm.d.ts +15 -0
  59. package/dist/chunks/{index-PiMq5a49.esm.js → index-oGObXjk6.esm.js} +1 -1
  60. package/dist/chunks/index-oGObXjk6.esm.js.map +1 -0
  61. package/dist/chunks/{is-all-html-elements-SdSkxirh.esm.js → is-all-html-elements-fcB7UUA1.esm.js} +1 -1
  62. package/dist/chunks/{is-all-html-elements-SdSkxirh.esm.js.map → is-all-html-elements-fcB7UUA1.esm.js.map} +1 -1
  63. package/dist/chunks/lit-WqMxC_PA.esm.js +34 -0
  64. package/dist/chunks/lit-WqMxC_PA.esm.js.map +1 -0
  65. package/dist/chunks/loading-template-DG4lkIIc.esm.js +2 -0
  66. package/dist/chunks/{loading-template-t4fFsYtr.esm.js.map → loading-template-DG4lkIIc.esm.js.map} +1 -1
  67. package/dist/chunks/{localize-7sMSg1W9.esm.js → localize-Btu9xYcE.esm.js} +6 -6
  68. package/dist/chunks/{localize-7sMSg1W9.esm.js.map → localize-Btu9xYcE.esm.js.map} +1 -1
  69. package/dist/chunks/{localize-OiRewTgu.esm.js → localize-C25pEGnx.esm.js} +6 -6
  70. package/dist/chunks/{localize-OiRewTgu.esm.js.map → localize-C25pEGnx.esm.js.map} +1 -1
  71. package/dist/chunks/lodash-7H4x2457.esm.js +2 -0
  72. package/dist/chunks/lodash-7H4x2457.esm.js.map +1 -0
  73. package/dist/chunks/order-page-BbrDKYmJ.esm.js +2 -0
  74. package/dist/chunks/order-page-BbrDKYmJ.esm.js.map +1 -0
  75. package/dist/chunks/{order-page-dlXIs0gJ.esm.d.ts → order-page-Cerye00Q.esm.d.ts} +19 -7
  76. package/dist/chunks/order-page-stMlaqKK.esm.js +2 -0
  77. package/dist/chunks/order-page-stMlaqKK.esm.js.map +1 -0
  78. package/dist/chunks/{progress-bar-PMU_xI3L.esm.js → progress-bar-DF7UuuHb.esm.js} +4 -4
  79. package/dist/chunks/{progress-bar-PMU_xI3L.esm.js.map → progress-bar-DF7UuuHb.esm.js.map} +1 -1
  80. package/dist/chunks/promo-pill-label-CbW_Vcru.esm.js +16 -0
  81. package/dist/chunks/{promo-pill-label-P1X4xeAx.esm.js.map → promo-pill-label-CbW_Vcru.esm.js.map} +1 -1
  82. package/dist/chunks/{promo-types-aQ_hre6t.esm.d.ts → promo-types-C1unMpo2.esm.d.ts} +1 -1
  83. package/dist/chunks/{promoManager--3WXq4at.esm.js → promoManager-B9cTR1R3.esm.js} +2 -2
  84. package/dist/chunks/{promoManager--3WXq4at.esm.js.map → promoManager-B9cTR1R3.esm.js.map} +1 -1
  85. package/dist/chunks/{promoManager-YUzbMtwY.esm.js → promoManager-fl54hq13.esm.js} +2 -2
  86. package/dist/chunks/{promoManager-YUzbMtwY.esm.js.map → promoManager-fl54hq13.esm.js.map} +1 -1
  87. package/dist/chunks/{responsive-2lC2Wrtg.esm.js → responsive-BR8qUfBa.esm.js} +2 -2
  88. package/dist/chunks/{responsive-2lC2Wrtg.esm.js.map → responsive-BR8qUfBa.esm.js.map} +1 -1
  89. package/dist/chunks/routes-CAhDCFDX.esm.js +2 -0
  90. package/dist/chunks/{routes-o-phF_L1.esm.js.map → routes-CAhDCFDX.esm.js.map} +1 -1
  91. package/dist/chunks/routes-pcL-CUiQ.esm.js +2 -0
  92. package/dist/chunks/{routes-YPOoVIR2.esm.js.map → routes-pcL-CUiQ.esm.js.map} +1 -1
  93. package/dist/chunks/{share-button-hDn8fnBI.esm.d.ts → share-button-B9hpxBVr.esm.d.ts} +6 -1
  94. package/dist/chunks/share-button-BYVId0-U.esm.js +2 -0
  95. package/dist/chunks/share-button-BYVId0-U.esm.js.map +1 -0
  96. package/dist/chunks/share-button-BvUcpOcx.esm.js +167 -0
  97. package/dist/chunks/share-button-BvUcpOcx.esm.js.map +1 -0
  98. package/dist/chunks/share-button-C-DXj68Z.esm.js +2 -0
  99. package/dist/chunks/share-button-C-DXj68Z.esm.js.map +1 -0
  100. package/dist/chunks/share-button-CtklpZOO.esm.js +167 -0
  101. package/dist/chunks/share-button-CtklpZOO.esm.js.map +1 -0
  102. package/dist/chunks/{update-cart-UuMHYehB.esm.js → update-cart-BLsw_Faz.esm.js} +2 -2
  103. package/dist/chunks/{update-cart-UuMHYehB.esm.js.map → update-cart-BLsw_Faz.esm.js.map} +1 -1
  104. package/dist/chunks/{update-cart-JO4fuiim.esm.d.ts → update-cart-NiToHHJH.esm.d.ts} +2 -2
  105. package/dist/chunks/{update-cart-mNsQ9K-k.esm.js → update-cart-ciJaz8li.esm.js} +2 -2
  106. package/dist/chunks/{update-cart-mNsQ9K-k.esm.js.map → update-cart-ciJaz8li.esm.js.map} +1 -1
  107. package/dist/chunks/{vendor-GKiOHg2N.esm.js → vendor-KKSARHWL.esm.js} +2 -2
  108. package/dist/chunks/{vendor-GKiOHg2N.esm.js.map → vendor-KKSARHWL.esm.js.map} +1 -1
  109. package/dist/components/beam-partner-logos.d.ts +1 -1
  110. package/dist/components/beam-partner-logos.esm.js +4 -4
  111. package/dist/components/beam-partner-logos.esm.js.map +1 -1
  112. package/dist/components/beam-partner-logos.js +4 -4
  113. package/dist/components/beam-partner-logos.js.map +1 -1
  114. package/dist/components/community-impact.d.ts +3 -3
  115. package/dist/components/community-impact.esm.js +15 -15
  116. package/dist/components/community-impact.esm.js.map +1 -1
  117. package/dist/components/community-impact.js +15 -15
  118. package/dist/components/community-impact.js.map +1 -1
  119. package/dist/components/cumulative-impact.d.ts +2 -2
  120. package/dist/components/cumulative-impact.esm.js +8 -8
  121. package/dist/components/cumulative-impact.esm.js.map +1 -1
  122. package/dist/components/cumulative-impact.js +8 -8
  123. package/dist/components/cumulative-impact.js.map +1 -1
  124. package/dist/components/impact-overview.d.ts +4 -4
  125. package/dist/components/impact-overview.esm.js +26 -21
  126. package/dist/components/impact-overview.esm.js.map +1 -1
  127. package/dist/components/impact-overview.js +26 -21
  128. package/dist/components/impact-overview.js.map +1 -1
  129. package/dist/components/index.d.ts +8 -8
  130. package/dist/components/index.esm.js +1 -1
  131. package/dist/components/index.js +1 -1
  132. package/dist/components/post-purchase.d.ts +7 -7
  133. package/dist/components/post-purchase.esm.js +2 -2
  134. package/dist/components/post-purchase.esm.js.map +1 -1
  135. package/dist/components/post-purchase.js +2 -2
  136. package/dist/components/post-purchase.js.map +1 -1
  137. package/dist/components/product-details-page.d.ts +3 -4
  138. package/dist/components/product-details-page.esm.js +22 -11
  139. package/dist/components/product-details-page.esm.js.map +1 -1
  140. package/dist/components/product-details-page.js +22 -11
  141. package/dist/components/product-details-page.js.map +1 -1
  142. package/dist/components/redeem-transaction.d.ts +6 -6
  143. package/dist/components/redeem-transaction.esm.js +3 -3
  144. package/dist/components/redeem-transaction.esm.js.map +1 -1
  145. package/dist/components/redeem-transaction.js +3 -3
  146. package/dist/components/redeem-transaction.js.map +1 -1
  147. package/dist/components/select-nonprofit.d.ts +6 -6
  148. package/dist/components/select-nonprofit.esm.js +89 -89
  149. package/dist/components/select-nonprofit.esm.js.map +1 -1
  150. package/dist/components/select-nonprofit.js +89 -89
  151. package/dist/components/select-nonprofit.js.map +1 -1
  152. package/dist/components/select-subscription-nonprofit.d.ts +3 -3
  153. package/dist/components/select-subscription-nonprofit.esm.js +13 -13
  154. package/dist/components/select-subscription-nonprofit.esm.js.map +1 -1
  155. package/dist/components/select-subscription-nonprofit.js +13 -13
  156. package/dist/components/select-subscription-nonprofit.js.map +1 -1
  157. package/dist/components/shopify.d.ts +12 -12
  158. package/dist/components/shopify.esm.js +1 -1
  159. package/dist/components/shopify.esm.js.map +1 -1
  160. package/dist/components/shopify.js +1 -1
  161. package/dist/components/shopify.js.map +1 -1
  162. package/dist/components/social-share.d.ts +3 -3
  163. package/dist/components/social-share.esm.js +3 -3
  164. package/dist/components/social-share.esm.js.map +1 -1
  165. package/dist/components/social-share.js +3 -3
  166. package/dist/components/social-share.js.map +1 -1
  167. package/dist/components/subscription-impact.d.ts +4 -4
  168. package/dist/components/subscription-impact.esm.js +27 -25
  169. package/dist/components/subscription-impact.esm.js.map +1 -1
  170. package/dist/components/subscription-impact.js +27 -25
  171. package/dist/components/subscription-impact.js.map +1 -1
  172. package/dist/components/subscription-management.d.ts +7 -7
  173. package/dist/components/subscription-management.esm.js +9 -9
  174. package/dist/components/subscription-management.esm.js.map +1 -1
  175. package/dist/components/subscription-management.js +9 -9
  176. package/dist/components/subscription-management.js.map +1 -1
  177. package/dist/index.d.ts +22 -22
  178. package/dist/index.esm.js +1 -1
  179. package/dist/index.js +1 -1
  180. package/dist/integrations/beam.d.ts +1 -1
  181. package/dist/integrations/beam.esm.js +1 -1
  182. package/dist/integrations/beam.esm.js.map +1 -1
  183. package/dist/integrations/beam.js +1 -1
  184. package/dist/integrations/beam.js.map +1 -1
  185. package/dist/integrations/cart.d.ts +4 -4
  186. package/dist/integrations/cart.esm.js +1 -1
  187. package/dist/integrations/cart.js +1 -1
  188. package/dist/integrations/index.d.ts +18 -18
  189. package/dist/integrations/index.esm.js +1 -1
  190. package/dist/integrations/index.js +1 -1
  191. package/dist/integrations/logs.d.ts +2 -2
  192. package/dist/integrations/logs.esm.js +1 -1
  193. package/dist/integrations/logs.js +1 -1
  194. package/dist/integrations/promoManager.d.ts +1 -1
  195. package/dist/integrations/promoManager.esm.js +1 -1
  196. package/dist/integrations/promoManager.js +1 -1
  197. package/dist/integrations/session.d.ts +1 -1
  198. package/dist/integrations/session.esm.js +1 -1
  199. package/dist/integrations/session.js +1 -1
  200. package/dist/integrations/shopify.d.ts +10 -10
  201. package/dist/integrations/shopify.esm.js +1 -1
  202. package/dist/integrations/shopify.js +1 -1
  203. package/dist/integrations/statsig.d.ts +1 -1
  204. package/dist/integrations/statsig.esm.js +2 -2
  205. package/dist/integrations/statsig.esm.js.map +1 -1
  206. package/dist/integrations/statsig.js +2 -2
  207. package/dist/integrations/statsig.js.map +1 -1
  208. package/dist/integrations/utils.d.ts +6 -6
  209. package/dist/integrations/utils.esm.js +1 -1
  210. package/dist/integrations/utils.js +1 -1
  211. package/dist/react/beam-partner-logos.d.ts +1 -1
  212. package/dist/react/beam-partner-logos.esm.js +1 -1
  213. package/dist/react/beam-partner-logos.js +1 -1
  214. package/dist/react/community-impact.d.ts +3 -3
  215. package/dist/react/community-impact.esm.js +1 -1
  216. package/dist/react/community-impact.js +1 -1
  217. package/dist/react/cumulative-impact.d.ts +2 -2
  218. package/dist/react/cumulative-impact.esm.js +1 -1
  219. package/dist/react/cumulative-impact.js +1 -1
  220. package/dist/react/impact-overview.d.ts +4 -4
  221. package/dist/react/impact-overview.esm.js +1 -1
  222. package/dist/react/impact-overview.esm.js.map +1 -1
  223. package/dist/react/impact-overview.js +1 -1
  224. package/dist/react/impact-overview.js.map +1 -1
  225. package/dist/react/index.d.ts +10 -10
  226. package/dist/react/index.esm.js +1 -1
  227. package/dist/react/index.js +1 -1
  228. package/dist/react/post-purchase.d.ts +7 -7
  229. package/dist/react/post-purchase.esm.js +1 -1
  230. package/dist/react/post-purchase.esm.js.map +1 -1
  231. package/dist/react/post-purchase.js +1 -1
  232. package/dist/react/post-purchase.js.map +1 -1
  233. package/dist/react/product-details-page.d.ts +3 -3
  234. package/dist/react/product-details-page.esm.js +1 -1
  235. package/dist/react/product-details-page.js +1 -1
  236. package/dist/react/redeem-transaction.d.ts +8 -8
  237. package/dist/react/redeem-transaction.esm.js +1 -1
  238. package/dist/react/redeem-transaction.js +1 -1
  239. package/dist/react/select-nonprofit.d.ts +8 -8
  240. package/dist/react/select-nonprofit.esm.js +1 -1
  241. package/dist/react/select-nonprofit.js +1 -1
  242. package/dist/react/select-subscription-nonprofit.d.ts +7 -7
  243. package/dist/react/select-subscription-nonprofit.esm.js +1 -1
  244. package/dist/react/select-subscription-nonprofit.js +1 -1
  245. package/dist/react/social-share.d.ts +3 -3
  246. package/dist/react/social-share.esm.js +1 -1
  247. package/dist/react/social-share.esm.js.map +1 -1
  248. package/dist/react/social-share.js +1 -1
  249. package/dist/react/social-share.js.map +1 -1
  250. package/dist/react/subscription-impact.d.ts +4 -4
  251. package/dist/react/subscription-impact.esm.js +1 -1
  252. package/dist/react/subscription-impact.js +1 -1
  253. package/dist/react/subscription-management.d.ts +7 -7
  254. package/dist/react/subscription-management.esm.js +1 -1
  255. package/dist/react/subscription-management.js +1 -1
  256. package/dist/utils/beam-errors.d.ts +1 -1
  257. package/dist/utils/beam-errors.esm.js +1 -1
  258. package/dist/utils/beam-errors.js +1 -1
  259. package/dist/utils/cart.esm.js +1 -1
  260. package/dist/utils/cart.js +1 -1
  261. package/dist/utils/cookies.esm.js +1 -1
  262. package/dist/utils/cookies.esm.js.map +1 -1
  263. package/dist/utils/cookies.js +1 -1
  264. package/dist/utils/cookies.js.map +1 -1
  265. package/dist/utils/debounce.esm.js +1 -1
  266. package/dist/utils/debounce.js +1 -1
  267. package/dist/utils/events.d.ts +5 -5
  268. package/dist/utils/events.esm.js +1 -1
  269. package/dist/utils/events.js +1 -1
  270. package/dist/utils/index.d.ts +6 -6
  271. package/dist/utils/index.esm.js +1 -1
  272. package/dist/utils/index.js +1 -1
  273. package/dist/utils/is-equal.esm.js +1 -1
  274. package/dist/utils/is-equal.js +1 -1
  275. package/dist/utils/local-storage.esm.js +1 -1
  276. package/dist/utils/local-storage.js +1 -1
  277. package/dist/utils/memoize-last.esm.js +1 -1
  278. package/dist/utils/memoize-last.esm.js.map +1 -1
  279. package/dist/utils/memoize-last.js +1 -1
  280. package/dist/utils/memoize-last.js.map +1 -1
  281. package/dist/utils/network-listeners.esm.js +1 -1
  282. package/dist/utils/network-listeners.esm.js.map +1 -1
  283. package/dist/utils/network-listeners.js +1 -1
  284. package/dist/utils/network-listeners.js.map +1 -1
  285. package/dist/utils/promoManager.d.ts +3 -3
  286. package/dist/utils/promoManager.esm.js +1 -1
  287. package/dist/utils/promoManager.js +1 -1
  288. package/dist/utils/remote-session.esm.js +1 -1
  289. package/dist/utils/remote-session.js +1 -1
  290. package/dist/utils/wait-for-element.esm.js +1 -1
  291. package/dist/utils/wait-for-element.js +1 -1
  292. package/package.json +4 -4
  293. package/dist/chunks/_share-dialog-dependencies-RmYWlyJ0.esm.js +0 -2
  294. package/dist/chunks/_share-dialog-dependencies-RmYWlyJ0.esm.js.map +0 -1
  295. package/dist/chunks/_share-dialog-dependencies-yCBFjXxQ.esm.js +0 -2
  296. package/dist/chunks/_share-dialog-dependencies-yCBFjXxQ.esm.js.map +0 -1
  297. package/dist/chunks/cart-contents-h60geKWa.esm.js +0 -2
  298. package/dist/chunks/enforce-config-S8EGgEnO.esm.js +0 -3
  299. package/dist/chunks/enforce-config-l-tNb_z7.esm.js +0 -3
  300. package/dist/chunks/index-2qmtuEV_.esm.d.ts +0 -15
  301. package/dist/chunks/index-44clOvXJ.esm.js +0 -2
  302. package/dist/chunks/index-44clOvXJ.esm.js.map +0 -1
  303. package/dist/chunks/index-B-9JPaCH.esm.js +0 -2
  304. package/dist/chunks/index-B-9JPaCH.esm.js.map +0 -1
  305. package/dist/chunks/index-CNVMNDM4.esm.js +0 -2
  306. package/dist/chunks/index-CNVMNDM4.esm.js.map +0 -1
  307. package/dist/chunks/index-E8H5A7Qq.esm.js.map +0 -1
  308. package/dist/chunks/index-FQExZDX9.esm.js.map +0 -1
  309. package/dist/chunks/index-PiMq5a49.esm.js.map +0 -1
  310. package/dist/chunks/index-UHchr4H_.esm.js +0 -2
  311. package/dist/chunks/index-UHchr4H_.esm.js.map +0 -1
  312. package/dist/chunks/index-XCMf22lv.esm.js.map +0 -1
  313. package/dist/chunks/index-dLnZQZlT.esm.js.map +0 -1
  314. package/dist/chunks/index-f7fp9odj.esm.js.map +0 -1
  315. package/dist/chunks/index-kFulvjM4.esm.js.map +0 -1
  316. package/dist/chunks/index-m1LRybiJ.esm.js.map +0 -1
  317. package/dist/chunks/index-smGc5rsi.esm.js +0 -2
  318. package/dist/chunks/index-smGc5rsi.esm.js.map +0 -1
  319. package/dist/chunks/index-wz6Yfo37.esm.js +0 -2
  320. package/dist/chunks/index-wz6Yfo37.esm.js.map +0 -1
  321. package/dist/chunks/lit-iNN5L_Qk.esm.js +0 -34
  322. package/dist/chunks/lit-iNN5L_Qk.esm.js.map +0 -1
  323. package/dist/chunks/loading-template-t4fFsYtr.esm.js +0 -2
  324. package/dist/chunks/lodash-P8OIs-at.esm.js +0 -2
  325. package/dist/chunks/lodash-P8OIs-at.esm.js.map +0 -1
  326. package/dist/chunks/order-page-WPxvCNLM.esm.js +0 -2
  327. package/dist/chunks/order-page-WPxvCNLM.esm.js.map +0 -1
  328. package/dist/chunks/order-page-ZpOf35sP.esm.js +0 -2
  329. package/dist/chunks/order-page-ZpOf35sP.esm.js.map +0 -1
  330. package/dist/chunks/promo-pill-label-P1X4xeAx.esm.js +0 -16
  331. package/dist/chunks/routes-YPOoVIR2.esm.js +0 -2
  332. package/dist/chunks/routes-o-phF_L1.esm.js +0 -2
  333. package/dist/chunks/share-button-EsUPw38-.esm.js +0 -163
  334. package/dist/chunks/share-button-EsUPw38-.esm.js.map +0 -1
  335. package/dist/chunks/share-button-SNvuFDC9.esm.js +0 -2
  336. package/dist/chunks/share-button-SNvuFDC9.esm.js.map +0 -1
  337. package/dist/chunks/share-button-r0y-bbwR.esm.js +0 -163
  338. package/dist/chunks/share-button-r0y-bbwR.esm.js.map +0 -1
  339. package/dist/chunks/shoelace-components-PB22pjfM.esm.js +0 -2
  340. package/dist/chunks/shoelace-components-PB22pjfM.esm.js.map +0 -1
  341. package/dist/chunks/shoelace-components-lr4iB8kL.esm.js +0 -2
  342. package/dist/chunks/shoelace-components-lr4iB8kL.esm.js.map +0 -1
  343. /package/dist/chunks/{beam-errors-bKCZlkvr.esm.d.ts → beam-errors-CCe004HS.esm.d.ts} +0 -0
  344. /package/dist/chunks/{index-EGiUuWe-.esm.d.ts → index-C-hPf29c.esm.d.ts} +0 -0
  345. /package/dist/chunks/{index-hn6JhG_w.esm.d.ts → index-DXj15KHe.esm.d.ts} +0 -0
  346. /package/dist/chunks/{index-mTXm0DPh.esm.d.ts → index-DbaDUPup.esm.d.ts} +0 -0
  347. /package/dist/chunks/{openapi-spec-bxGNhNMa.esm.d.ts → openapi-spec-VAt3phhg.esm.d.ts} +0 -0
  348. /package/dist/chunks/{progress-bar-0VS_AmEf.esm.d.ts → progress-bar-CveZ8E6Q.esm.d.ts} +0 -0
  349. /package/dist/chunks/{promo-pill-label-3bA1z-la.esm.d.ts → promo-pill-label-BXRqZHET.esm.d.ts} +0 -0
  350. /package/dist/chunks/{routes-lGXt7ttd.esm.d.ts → routes-DDRd747e.esm.d.ts} +0 -0
  351. /package/dist/chunks/{types-aju0qrRe.esm.d.ts → types-C7gqAyyH.esm.d.ts} +0 -0
  352. /package/dist/chunks/{types-IbMT3Nwn.esm.d.ts → types-CPxMwnoR.esm.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"community-impact.js","sources":["../../src/components/community-impact/strings.ts","../../src/components/community-impact/index.ts"],"sourcesContent":["export const strings = {\n en: {\n fundedTimes: ({ times = 0 }) => `Funded <b>${times}</b> ${times > 1 ? \"times\" : \"time\"} so far`,\n learnMore: () => `Learn more`,\n seeAll: () => `See All`,\n },\n fr: {\n fundedTimes: ({ times = 0 }) => `Financé <b>${times}</b> fois pour l'instant`,\n learnMore: () => `En savoir plus`,\n seeAll: () => `Voir tout`,\n },\n de: {\n fundedTimes: ({ times = 0 }) => `<b>${times}</b> Mal finanziert`,\n learnMore: () => `Mehr erfahren`,\n seeAll: () => `Alle anzeigen`,\n },\n es: {\n fundedTimes: ({ times = 0 }) => `Financiado <b>${times}</b> ${times > 1 ? \"vez\" : \"veces\"}`,\n learnMore: () => `Saber más`,\n seeAll: () => `Ver Todo`,\n },\n it: {\n fundedTimes: ({ times = 0 }) => `Finanziato <b>${times}</b> ${times > 1 ? \"volta\" : \"volte\"}`,\n learnMore: () => `Scopri di più`,\n seeAll: () => `Vedi Tutto`,\n },\n pl: {\n fundedTimes: ({ times = 0 }) => `Udzielono wsparcia <b>${times}</b> ${times > 1 ? \"razy\" : \"raz\"}`,\n learnMore: () => `Dowiedz się więcej`,\n seeAll: () => `Zobacz wszystko`,\n },\n};\n","import { css, html, LitElement } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport \"../../shared/components/progress-bar\";\nimport \"../beam-partner-logos\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { getImpact } from \"../../api-sdk/v3/routes\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { _loading } from \"../../shared/fragments/loading-template\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES, WIDGET_NAMES } from \"../../api-sdk/constants\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { BeamError, MissingConfig } from \"../../utils/beam-errors\";\nimport { TNumericId } from \"../../shared/types\";\nimport { cssCardGrid } from \"../../shared/fragments/css-card-grid\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { progressBarConfigDefaults } from \"../../shared/components/progress-bar\";\nimport { partnerLogosConfigDefaults } from \"../beam-partner-logos\";\nimport { strings } from \"./strings\";\n\ntype RequiredConfig = {\n apiKey: string;\n chainId: TNumericId;\n};\n\ntype IAPIV3NonprofitImpact = Awaited<ReturnType<typeof getImpact>>[\"community\"][0];\n\n/**\n * Beam Impact Overview Widget\n * Displays a grid of cards highlighting progress against funding goals\n * for the non-profits the chain is supporting.\n */\nexport class BeamCommunityImpact extends LitElement {\n static tagName = \"beam-community-impact\";\n\n @property({ type: String }) public apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) public chainId?: RequiredConfig[\"chainId\"];\n\n @property({ type: String }) public baseUrl = DEFAULT_BASE_URL;\n\n @property({ type: String }) public cardStyle: \"icon\" | \"image\" = \"image\";\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public debug = false;\n\n @property({ type: Boolean }) public draftConfig = false;\n\n @state() private selectedFilter: string | null = null;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n private getImpactData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"chainId\"], this)) throw new MissingConfig();\n const res = getImpact({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n queryParams: {\n chainId: this.chainId,\n personalImpactLimit: 0,\n widgetName: WIDGET_NAMES.community_impact,\n version: \"1.0.0\",\n lang: this.configLang,\n draftConfig: this.draftConfig,\n },\n });\n\n return res;\n };\n\n private impactDataController = new AsyncController<typeof this.getImpactData>(this, this.getImpactData);\n\n async updated(changedProperties: Map<string, unknown>) {\n // Reload nonprofit list on change of any of these props:\n // Also fires on first load as props go from undefined => value\n const requireNewDataProps = [\"chainId\", \"baseUrl\", \"lang\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n this.impactDataController.exec();\n break;\n }\n }\n }\n\n private renderFilterTabs({ nonprofits }: { nonprofits: IAPIV3NonprofitImpact[] }) {\n const uniqueFilters = Array.from(new Set(nonprofits.flatMap((n) => n.filters || [])));\n if (uniqueFilters.length === 0) return \"\";\n const handleSeeAllFocus = () => {\n this.selectedFilter = null;\n };\n const handleFilterFocus = (filter: string) => {\n if (this.selectedFilter === filter) {\n this.selectedFilter = null;\n } else {\n this.selectedFilter = filter;\n }\n };\n return html` <div\n class=\"beam-filter-tabs\"\n part=\"filters\"\n style=\"display: inline-flex; flex-wrap: wrap; gap: 0.5em 1em\"\n >\n <span\n tabindex=\"0\"\n style=\"${styleMap({\n \"padding-bottom\": \"1px\",\n \"border-bottom-width\": \"2px\",\n \"border-bottom-style\": \"solid\",\n \"border-bottom-color\": this.selectedFilter === null ? \"currentColor\" : \"transparent\",\n })}\"\n @click=${handleSeeAllFocus}\n @keydown=${(evt: KeyboardEvent) => {\n if ([\"Enter\", \" \"].includes(evt.key)) {\n evt.preventDefault();\n handleSeeAllFocus();\n }\n }}\n >${strings[this.configLang].seeAll()}</span\n >\n ${uniqueFilters.map(\n (filter: string) =>\n html`<span\n tabindex=\"0\"\n @click=${() => handleFilterFocus(filter)}\n @keydown=${(evt: KeyboardEvent) => {\n if ([\"Enter\", \" \"].includes(evt.key)) {\n evt.preventDefault();\n handleFilterFocus(filter);\n }\n }}\n style=\"${styleMap({\n \"padding-bottom\": \"1px\",\n \"border-bottom-width\": \"2px\",\n \"border-bottom-style\": \"solid\",\n \"border-bottom-color\": this.selectedFilter === filter ? \"currentColor\" : \"transparent\",\n })}\"\n >${filter}</span\n >`\n )}\n </div>`;\n }\n\n private renderImageCard = (data: IAPIV3NonprofitImpact) => {\n const nonprofitImageAltText = `${data.nonprofit?.name} image`;\n const learnMoreLinkAriaLabel = `Learn more about ${data.nonprofit?.name}`;\n\n return html`\n <div class=\"image-card\" part=\"nonprofit-card\" style=\"display: flex; flex-direction: column;\">\n <div\n class=\"image-card-image-box\"\n style=\"background-image: url('${data.imageUrl}');\"\n aria-label=\"${nonprofitImageAltText}\"\n >\n <p class=\"image-card-cause\">${localizeUserString(this.configLang, data.nonprofit?.cause || \"\")}</p>\n <h4 class=\"image-card-name\">${localizeUserString(this.configLang, data.nonprofit?.name)}</h4>\n </div>\n <div\n style=\"padding: 5px 15px 15px; flex: 1 1 auto; border-radius: 0px; border: none; display: flex; flex-direction: column;\"\n >\n <div class=\"image-card-progress\" style=\"display: flex; align-items: center;\">\n <beam-progress-bar style=\"flex-grow: 1;\" value=\"${data.impact?.goalProgressPercentage}\"></beam-progress-bar>\n <span class=\"image-card-progressText\" style=\"margin-left: 20px;\"\n >${localizeUserString(this.configLang, data.impact?.goalProgressText)}</span\n >\n </div>\n <div class=\"image-card-description\">\n ${unsafeHTML(localizeUserString(this.configLang, data.impact?.description || \"\"))}\n </div>\n <div style=\"display: flex; align-items: end; flex-wrap: wrap; gap: 10px; flex: 1;\" class=\"image-card-footer\">\n <div class=\"image-card-goal-completion\" style=\"flex-grow: 1;\">\n ${unsafeHTML(localizeUserString(this.configLang, data.impact?.goalCompletionText))}\n </div>\n <a\n href=\"${data.nonprofit?.website}\"\n target=\"_blank\"\n class=\"image-card-link\"\n style=\"color: var(--beam-CommunityImpact-imageCard-link-color, inherit); white-space: nowrap\"\n aria-label=\"${learnMoreLinkAriaLabel}\"\n >\n ${localizeUserString(this.configLang, data.nonprofit?.websiteLinkText)}<span class=\"image-card-link-arrow\"\n >&nbsp;&rsaquo;</span\n >\n </a>\n </div>\n </div>\n </div>\n `;\n };\n\n private renderIconCard = (data: IAPIV3NonprofitImpact) => {\n const nonprofitIconAltText = `${data.nonprofit?.name} icon`;\n const learnMoreLinkAriaLabel = `Learn more about ${data.nonprofit?.name}`;\n\n return html`\n <div class=\"icon-card\" part=\"nonprofit-card\" style=\"display: flex; flex-direction: column;\">\n <img class=\"icon-card-icon\" src=\"${data.nonprofit?.causeIconUrl}\" alt=\"${nonprofitIconAltText}\" />\n <p class=\"icon-card-cause\">${data.nonprofit?.cause}</p>\n <h4 class=\"icon-card-name\">${data.nonprofit?.name}</h4>\n <div class=\"icon-card-description\" part=\"nonprofit-card-description\" style=\"flex: 1;\">\n ${unsafeHTML(localizeUserString(this.configLang, data.impact?.description || \"\"))}\n </div>\n <div class=\"icon-card-footer\" style=\"width: 100%; text-align: center;\">\n <div class=\"icon-card-progress\" style=\"display: flex; align-items: center; width: 100%;\">\n <beam-progress-bar style=\"flex: 1 0;\" value=\"${data.impact?.goalProgressPercentage}\"></beam-progress-bar>\n <span style=\"text-align: right; flex: 0 1; white-space: nowrap\" class=\"icon-card-progressText\"\n >${localizeUserString(this.configLang, data.impact?.goalProgressText)}</span\n >\n </div>\n <div class=\"icon-card-goal-completion\">\n ${unsafeHTML(localizeUserString(this.configLang, data.impact?.goalCompletionText))}\n </div>\n <a\n href=\"${data.nonprofit?.website}\"\n target=\"_blank\"\n class=\"icon-card-link\"\n style=\"color: var(--beam-CommunityImpact-iconCard-link-color, inherit); display: block\"\n aria-label=\"${learnMoreLinkAriaLabel}\"\n >${localizeUserString(this.configLang, data.nonprofit?.websiteLinkText) ||\n strings[this.configLang].learnMore()}<span class=\"icon-card-link-arrow\">&nbsp;&rsaquo;</span>\n </a>\n ${data.impact?.goalCompletionText === \"\" ? html`<div class=\"icon-card-goal-completion\">&nbsp;</div>` : \"\"}\n </div>\n </div>\n `;\n };\n\n private renderCards = ({ nonprofits }: { nonprofits: IAPIV3NonprofitImpact[] }) => {\n return html`\n <div class=\"beam-nonprofit-${this.cardStyle}-cards\" part=\"nonprofit-cards\">\n ${nonprofits?.map(this.cardStyle === \"image\" ? this.renderImageCard : this.renderIconCard)}\n </div>\n `;\n };\n\n render() {\n const { selectedFilter } = this;\n const { data, error, loading } = this.impactDataController;\n if (loading) {\n return _loading();\n }\n if (error) {\n if (this.debug) {\n return _errorMessage({ error });\n }\n return \"\";\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new BeamError(\"Missing data\") });\n }\n return \"\";\n }\n const { community: nonprofits } = data;\n const filteredNonprofits = selectedFilter\n ? nonprofits.filter((np) => np.filters?.includes(selectedFilter))\n : nonprofits;\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <beam-partner-logos\n part=\"logos\"\n partnerLogoUrl=\"${data.chain.logoUrl}\"\n partnerName=\"${data.chain.name}\"\n ></beam-partner-logos>\n\n ${this.renderFilterTabs({ nonprofits })} ${this.renderCards({ nonprofits: filteredNonprofits })}\n `;\n }\n\n public get cssVariables() {\n const defaults: Record<string, string> = {\n \"--beam-fontFamily\": \"inherit\",\n \"--beam-fontStyle\": \"inherit\",\n \"--beam-fontSize\": \"14px\",\n \"--beam-lineHeight\": \"1\",\n \"--beam-textColor\": \"inherit\",\n \"--beam-backgroundColor\": \"inherit\",\n ...partnerLogosConfigDefaults,\n ...progressBarConfigDefaults,\n \"--beam-CommunityImpact-filterTabs-textalign\": \"left\",\n \"--beam-CommunityImpact-filterTabs-marginBottom\": \"20px\",\n /* Image Card Styles */\n \"--beam-CommunityImpact-imageCard-borderColor\": \"currentColor\",\n \"--beam-CommunityImpact-imageCard-borderRadius\": \"0\",\n \"--beam-CommunityImpact-imageCard-borderWidth\": \"1px\",\n \"--beam-CommunityImpact-imageCard-backgroundColor\": \"inherit\",\n \"--beam-CommunityImpact-imageCard-foregroundColor\": \"inherit\",\n ...defineCustomText(\"--beam-CommunityImpact-filterTabs\", {\n fontSize: \"16px\",\n marginTop: \"10px\",\n fontWeight: \"bold\",\n }),\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-cause\", {\n fontSize: \"14px\",\n textTransform: \"uppercase\",\n color: \"#fff\",\n }),\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-name\", {\n fontSize: \"22px\",\n marginTop: \"0\",\n color: \"#fff\",\n }),\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-description\", {\n marginTop: \"10px\",\n lineHeight: \"1.3\",\n }),\n \"--beam-CommunityImpact-imageCard-link-color\": \"inherit\",\n \"--beam-CommunityImpact-imageCard-linkArrow-display\": \"none\",\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-link\", {\n fontSize: \"12px\",\n }),\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-goalCompletion\", {\n fontSize: \"12px\",\n }),\n \"--beam-CommunityImpact-imageCard-goalCompletion-fontStyle\": \"italic\",\n \"--beam-CommunityImpact-imageCard-progress-marginTop\": \"10px\",\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-progressText\"),\n \"--beam-CommunityImpact-imageCard-footer-marginTop\": \"10px\",\n /* Icon Card Styles */\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-cause\", {\n marginTop: \"10px\",\n }),\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-name\", {\n marginTop: \"5px\",\n fontWeight: \"bold\",\n }),\n \"--beam-CommunityImpact-iconCard-progress-marginTop\": \"10px\",\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-progressText\"),\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-description\", {\n marginTop: \"10px\",\n lineHeight: \"1.3\",\n }),\n \"--beam-CommunityImpact-iconCard-description-textAlign\": \"left\",\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-goalCompletion\", {\n marginTop: \"10px\",\n }),\n \"--beam-CommunityImpact-iconCard-link-color\": \"inherit\",\n \"--beam-CommunityImpact-iconCard-linkArrow-display\": \"none\",\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-link\", {\n marginTop: \"5px\",\n }),\n };\n\n const cardCount = this.impactDataController.data?.community.length || 0;\n const columnCount = cardCount === 3 ? 3 : this.cardStyle === \"icon\" ? 4 : 2;\n defaults[\"--beam-CommunityImpact-columns\"] = columnCount.toString();\n defaults[\"--beam-CommunityImpact-columns-minWidth\"] = this.cardStyle === \"image\" ? \"300px\" : \"200px\";\n\n const remoteConfig = this.impactDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n css`\n :host {\n display: block;\n font-family: var(--beam-fontFamily, inherit);\n font-style: var(--beam-fontStyle, inherit);\n font-size: var(--beam-fontSize, inherit);\n color: var(--beam-textColor, inherit);\n background-color: var(--beam-backgroundColor, inherit);\n line-height: var(--beam-lineHeight, 1);\n word-break: normal;\n }\n\n .beam-filter-tabs {\n ${useCustomText(\"--beam-CommunityImpact-filterTabs\")}\n margin-bottom: var(--beam-CommunityImpact-filterTabs-marginBottom, 10px);\n text-align: var(--beam-CommunityImpact-filterTabs-textalign, left);\n }\n\n .beam-nonprofit-image-cards,\n .beam-nonprofit-icon-cards {\n margin-top: 10px;\n }\n\n ${cssCardGrid({\n gap: \"20px\",\n className: \"beam-nonprofit-image-cards\",\n columnCount: \"var(--beam-CommunityImpact-columns)\",\n itemMinWidth: \"var(--beam-CommunityImpact-columns-minWidth)\",\n })}\n\n ${cssCardGrid({\n gap: \"40px\",\n className: \"beam-nonprofit-icon-cards\",\n columnCount: \"var(--beam-CommunityImpact-columns)\",\n itemMinWidth: \"var(--beam-CommunityImpact-columns-minWidth)\",\n })}\n\n /* Image Style Cards */\n\n .image-card {\n overflow-wrap: break-word;\n border-color: var(--beam-CommunityImpact-imageCard-borderColor);\n border-style: solid;\n border-width: var(--beam-CommunityImpact-imageCard-borderWidth);\n border-radius: var(--beam-CommunityImpact-imageCard-borderRadius);\n overflow: hidden;\n background-color: var(--beam-CommunityImpact-imageCard-backgroundColor);\n color: var(--beam-CommunityImpact-imageCard-foregroundColor);\n }\n\n .image-card-image-box {\n height: 200px;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n padding: 0 24px 16px;\n overflow-wrap: break-word;\n background-color: #555;\n background-blend-mode: overlay;\n background-size: cover;\n background-repeat: no-repeat;\n }\n\n .image-card-cause {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-cause\")}\n }\n\n .image-card-name {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-name\")}\n }\n\n .image-card-progress {\n margin-top: var(--beam-CommunityImpact-imageCard-progress-marginTop);\n }\n\n .image-card-progressText {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-progressText\")}\n }\n\n .image-card-description {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-description\")}\n }\n\n .image-card-link {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-link\")}\n }\n\n .image-card-link-arrow {\n display: var(--beam-CommunityImpact-imageCard-linkArrow-display, \"none\");\n }\n\n .image-card-goal-completion {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-goalCompletion\")}\n font-style: var(--beam-CommunityImpact-imageCard-goalCompletion-fontStyle, italic);\n }\n\n .image-card-footer {\n margin-top: var(--beam-CommunityImpact-imageCard-footer-marginTop);\n }\n\n /* Icon Style Cards */\n\n .icon-card {\n display: flex;\n flex-direction: column;\n justify-content: start;\n align-items: center;\n }\n\n .icon-card-icon {\n height: 50px;\n }\n\n .icon-card-cause {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-cause\")}\n }\n\n .icon-card-name {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-name\")}\n }\n\n .icon-card-progress {\n margin-top: var(--beam-CommunityImpact-iconCard-progress-marginTop);\n }\n\n .icon-card-progressText {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-progressText\")}\n margin-left: 10px;\n }\n\n .icon-card-description {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-description\")}\n text-align: var(--beam-CommunityImpact-iconCard-description-textAlign, left);\n }\n\n .icon-card-link {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-link\")}\n }\n\n .icon-card-link-arrow {\n display: var(--beam-CommunityImpact-iconCard-linkArrow-display, \"none\");\n }\n\n .icon-card-goal-completion {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-goalCompletion\")}\n font-style: var(--beam-CommunityImpact-iconCard-goalCompletion-fontStyle, italic);\n }\n\n .icon-card-footer {\n margin-top: var(--beam-CommunityImpact-iconCard-footer-marginTop);\n }\n `,\n ];\n}\n\ndefineCustomElement(BeamCommunityImpact);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-community-impact\": BeamCommunityImpact;\n }\n}\n"],"names":["strings","times","BeamCommunityImpact","LitElement","DEFAULT_BASE_URL","enforceConfig","getImpact","WIDGET_NAMES","AsyncController","data","nonprofitImageAltText","learnMoreLinkAriaLabel","html","localizeUserString","unsafeHTML","nonprofitIconAltText","nonprofits","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","uniqueFilters","n","handleSeeAllFocus","handleFilterFocus","filter","styleMap","evt","selectedFilter","error","loading","_loading","_errorMessage","BeamError","filteredNonprofits","np","defaults","partnerLogosConfigDefaults","progressBarConfigDefaults","defineCustomText","columnCount","remoteConfig","config","_cssVariableMap","cssReset","css","useCustomText","cssCardGrid","__decorateClass","property","state","defineCustomElement"],"mappings":"2pBAAO,MAAMA,EAAU,CACrB,GAAI,CACF,YAAa,CAAC,CAAE,MAAAC,EAAQ,CAAE,IAAM,aAAaA,CAAK,QAAQA,EAAQ,EAAI,QAAU,MAAM,UACtF,UAAW,IAAM,aACjB,OAAQ,IAAM,SAChB,EACA,GAAI,CACF,YAAa,CAAC,CAAE,MAAAA,EAAQ,CAAE,IAAM,iBAAcA,CAAK,2BACnD,UAAW,IAAM,iBACjB,OAAQ,IAAM,WAChB,EACA,GAAI,CACF,YAAa,CAAC,CAAE,MAAAA,EAAQ,C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AA,EA6dnBiD,EAAoBjD,CAAmB"}
1
+ {"version":3,"file":"community-impact.js","sources":["../../src/components/community-impact/strings.ts","../../src/components/community-impact/index.ts"],"sourcesContent":["export const strings = {\n en: {\n fundedTimes: ({ times = 0 }) => `Funded <b>${times}</b> ${times > 1 ? \"times\" : \"time\"} so far`,\n learnMore: () => `Learn more`,\n seeAll: () => `See All`,\n },\n fr: {\n fundedTimes: ({ times = 0 }) => `Financé <b>${times}</b> fois pour l'instant`,\n learnMore: () => `En savoir plus`,\n seeAll: () => `Voir tout`,\n },\n de: {\n fundedTimes: ({ times = 0 }) => `<b>${times}</b> Mal finanziert`,\n learnMore: () => `Mehr erfahren`,\n seeAll: () => `Alle anzeigen`,\n },\n es: {\n fundedTimes: ({ times = 0 }) => `Financiado <b>${times}</b> ${times > 1 ? \"vez\" : \"veces\"}`,\n learnMore: () => `Saber más`,\n seeAll: () => `Ver Todo`,\n },\n it: {\n fundedTimes: ({ times = 0 }) => `Finanziato <b>${times}</b> ${times > 1 ? \"volta\" : \"volte\"}`,\n learnMore: () => `Scopri di più`,\n seeAll: () => `Vedi Tutto`,\n },\n pl: {\n fundedTimes: ({ times = 0 }) => `Udzielono wsparcia <b>${times}</b> ${times > 1 ? \"razy\" : \"raz\"}`,\n learnMore: () => `Dowiedz się więcej`,\n seeAll: () => `Zobacz wszystko`,\n },\n};\n","import { css, html, LitElement } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport \"../../shared/components/progress-bar\";\nimport \"../beam-partner-logos\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { getImpact } from \"../../api-sdk/v3/routes\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { _loading } from \"../../shared/fragments/loading-template\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES, WIDGET_NAMES } from \"../../api-sdk/constants\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { BeamError, MissingConfig } from \"../../utils/beam-errors\";\nimport { TNumericId } from \"../../shared/types\";\nimport { cssCardGrid } from \"../../shared/fragments/css-card-grid\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { progressBarConfigDefaults } from \"../../shared/components/progress-bar\";\nimport { partnerLogosConfigDefaults } from \"../beam-partner-logos\";\nimport { strings } from \"./strings\";\n\ntype RequiredConfig = {\n apiKey: string;\n chainId: TNumericId;\n};\n\ntype IAPIV3NonprofitImpact = Awaited<ReturnType<typeof getImpact>>[\"community\"][0];\n\n/**\n * Beam Impact Overview Widget\n * Displays a grid of cards highlighting progress against funding goals\n * for the non-profits the chain is supporting.\n */\nexport class BeamCommunityImpact extends LitElement {\n static tagName = \"beam-community-impact\";\n\n @property({ type: String }) public apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) public chainId?: RequiredConfig[\"chainId\"];\n\n @property({ type: String }) public baseUrl = DEFAULT_BASE_URL;\n\n @property({ type: String }) public cardStyle: \"icon\" | \"image\" = \"image\";\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public debug = false;\n\n @property({ type: Boolean }) public draftConfig = false;\n\n @state() private selectedFilter: string | null = null;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n private getImpactData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"chainId\"], this)) throw new MissingConfig();\n const res = getImpact({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n queryParams: {\n chainId: this.chainId,\n personalImpactLimit: 0,\n widgetName: WIDGET_NAMES.community_impact,\n version: \"1.0.0\",\n lang: this.configLang,\n draftConfig: this.draftConfig,\n },\n });\n\n return res;\n };\n\n private impactDataController = new AsyncController<typeof this.getImpactData>(this, this.getImpactData);\n\n async updated(changedProperties: Map<string, unknown>) {\n // Reload nonprofit list on change of any of these props:\n // Also fires on first load as props go from undefined => value\n const requireNewDataProps = [\"chainId\", \"baseUrl\", \"lang\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n this.impactDataController.exec();\n break;\n }\n }\n }\n\n private renderFilterTabs({ nonprofits }: { nonprofits: IAPIV3NonprofitImpact[] }) {\n const uniqueFilters = Array.from(new Set(nonprofits.flatMap((n) => n.filters || [])));\n if (uniqueFilters.length === 0) return \"\";\n const handleSeeAllFocus = () => {\n this.selectedFilter = null;\n };\n const handleFilterFocus = (filter: string) => {\n if (this.selectedFilter === filter) {\n this.selectedFilter = null;\n } else {\n this.selectedFilter = filter;\n }\n };\n return html` <div\n class=\"beam-filter-tabs\"\n part=\"filters\"\n style=\"display: inline-flex; flex-wrap: wrap; gap: 0.5em 1em\"\n >\n <span\n tabindex=\"0\"\n style=\"${styleMap({\n \"padding-bottom\": \"1px\",\n \"border-bottom-width\": \"2px\",\n \"border-bottom-style\": \"solid\",\n \"border-bottom-color\": this.selectedFilter === null ? \"currentColor\" : \"transparent\",\n })}\"\n @click=${handleSeeAllFocus}\n @keydown=${(evt: KeyboardEvent) => {\n if ([\"Enter\", \" \"].includes(evt.key)) {\n evt.preventDefault();\n handleSeeAllFocus();\n }\n }}\n >${strings[this.configLang].seeAll()}</span\n >\n ${uniqueFilters.map(\n (filter: string) =>\n html`<span\n tabindex=\"0\"\n @click=${() => handleFilterFocus(filter)}\n @keydown=${(evt: KeyboardEvent) => {\n if ([\"Enter\", \" \"].includes(evt.key)) {\n evt.preventDefault();\n handleFilterFocus(filter);\n }\n }}\n style=\"${styleMap({\n \"padding-bottom\": \"1px\",\n \"border-bottom-width\": \"2px\",\n \"border-bottom-style\": \"solid\",\n \"border-bottom-color\": this.selectedFilter === filter ? \"currentColor\" : \"transparent\",\n })}\"\n >${filter}</span\n >`\n )}\n </div>`;\n }\n\n private renderImageCard = (data: IAPIV3NonprofitImpact) => {\n const nonprofitImageAltText = `${data.nonprofit?.name} image`;\n const learnMoreLinkAriaLabel = `Learn more about ${data.nonprofit?.name}`;\n\n return html`\n <div class=\"image-card\" part=\"nonprofit-card\" style=\"display: flex; flex-direction: column;\">\n <div\n class=\"image-card-image-box\"\n style=\"background-image: url('${data.imageUrl}');\"\n aria-label=\"${nonprofitImageAltText}\"\n >\n <p class=\"image-card-cause\">${localizeUserString(this.configLang, data.nonprofit?.cause || \"\")}</p>\n <h2 class=\"image-card-name\">${localizeUserString(this.configLang, data.nonprofit?.name)}</h2>\n </div>\n <div\n style=\"padding: 5px 15px 15px; flex: 1 1 auto; border-radius: 0px; border: none; display: flex; flex-direction: column;\"\n >\n <div class=\"image-card-progress\" style=\"display: flex; align-items: center;\">\n <beam-progress-bar style=\"flex-grow: 1;\" value=\"${data.impact?.goalProgressPercentage}\"></beam-progress-bar>\n <span class=\"image-card-progressText\" style=\"margin-left: 20px;\"\n >${localizeUserString(this.configLang, data.impact?.goalProgressText)}</span\n >\n </div>\n <div class=\"image-card-description\">\n ${unsafeHTML(localizeUserString(this.configLang, data.impact?.description || \"\"))}\n </div>\n <div style=\"display: flex; align-items: end; flex-wrap: wrap; gap: 10px; flex: 1;\" class=\"image-card-footer\">\n <div class=\"image-card-goal-completion\" style=\"flex-grow: 1;\">\n ${unsafeHTML(localizeUserString(this.configLang, data.impact?.goalCompletionText))}\n </div>\n <a\n href=\"${data.nonprofit?.website}\"\n target=\"_blank\"\n class=\"image-card-link\"\n style=\"color: var(--beam-CommunityImpact-imageCard-link-color, inherit); white-space: nowrap\"\n aria-label=\"${learnMoreLinkAriaLabel}\"\n >\n ${localizeUserString(this.configLang, data.nonprofit?.websiteLinkText)}<span class=\"image-card-link-arrow\"\n >&nbsp;&rsaquo;</span\n >\n </a>\n </div>\n </div>\n </div>\n `;\n };\n\n private renderIconCard = (data: IAPIV3NonprofitImpact) => {\n const nonprofitIconAltText = `${data.nonprofit?.name} icon`;\n const learnMoreLinkAriaLabel = `Learn more about ${data.nonprofit?.name}`;\n\n return html`\n <div class=\"icon-card\" part=\"nonprofit-card\" style=\"display: flex; flex-direction: column;\">\n <img class=\"icon-card-icon\" src=\"${data.nonprofit?.causeIconUrl}\" alt=\"${nonprofitIconAltText}\" />\n <p class=\"icon-card-cause\">${data.nonprofit?.cause}</p>\n <h2 class=\"icon-card-name\">${data.nonprofit?.name}</h2>\n <div class=\"icon-card-description\" part=\"nonprofit-card-description\" style=\"flex: 1;\">\n ${unsafeHTML(localizeUserString(this.configLang, data.impact?.description || \"\"))}\n </div>\n <div class=\"icon-card-footer\" style=\"width: 100%; text-align: center;\">\n <div class=\"icon-card-progress\" style=\"display: flex; align-items: center; width: 100%;\">\n <beam-progress-bar style=\"flex: 1 0;\" value=\"${data.impact?.goalProgressPercentage}\"></beam-progress-bar>\n <span style=\"text-align: right; flex: 0 1; white-space: nowrap\" class=\"icon-card-progressText\"\n >${localizeUserString(this.configLang, data.impact?.goalProgressText)}</span\n >\n </div>\n <div class=\"icon-card-goal-completion\">\n ${unsafeHTML(localizeUserString(this.configLang, data.impact?.goalCompletionText))}\n </div>\n <a\n href=\"${data.nonprofit?.website}\"\n target=\"_blank\"\n class=\"icon-card-link\"\n style=\"color: var(--beam-CommunityImpact-iconCard-link-color, inherit); display: block\"\n aria-label=\"${learnMoreLinkAriaLabel}\"\n >${localizeUserString(this.configLang, data.nonprofit?.websiteLinkText) ||\n strings[this.configLang].learnMore()}<span class=\"icon-card-link-arrow\">&nbsp;&rsaquo;</span>\n </a>\n ${data.impact?.goalCompletionText === \"\" ? html`<div class=\"icon-card-goal-completion\">&nbsp;</div>` : \"\"}\n </div>\n </div>\n `;\n };\n\n private renderCards = ({ nonprofits }: { nonprofits: IAPIV3NonprofitImpact[] }) => {\n return html`\n <div class=\"beam-nonprofit-${this.cardStyle}-cards\" part=\"nonprofit-cards\">\n ${nonprofits?.map(this.cardStyle === \"image\" ? this.renderImageCard : this.renderIconCard)}\n </div>\n `;\n };\n\n render() {\n const { selectedFilter } = this;\n const { data, error, loading } = this.impactDataController;\n if (loading) {\n return _loading();\n }\n if (error) {\n if (this.debug) {\n return _errorMessage({ error });\n }\n return \"\";\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new BeamError(\"Missing data\") });\n }\n return \"\";\n }\n const { community: nonprofits } = data;\n const filteredNonprofits = selectedFilter\n ? nonprofits.filter((np) => np.filters?.includes(selectedFilter))\n : nonprofits;\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <beam-partner-logos\n part=\"logos\"\n partnerLogoUrl=\"${data.chain.logoUrl}\"\n partnerName=\"${data.chain.name}\"\n ></beam-partner-logos>\n\n ${this.renderFilterTabs({ nonprofits })} ${this.renderCards({ nonprofits: filteredNonprofits })}\n `;\n }\n\n public get cssVariables() {\n const defaults: Record<string, string> = {\n \"--beam-fontFamily\": \"inherit\",\n \"--beam-fontStyle\": \"inherit\",\n \"--beam-fontSize\": \"14px\",\n \"--beam-lineHeight\": \"1\",\n \"--beam-textColor\": \"inherit\",\n \"--beam-backgroundColor\": \"inherit\",\n ...partnerLogosConfigDefaults,\n ...progressBarConfigDefaults,\n \"--beam-CommunityImpact-filterTabs-textalign\": \"left\",\n \"--beam-CommunityImpact-filterTabs-marginBottom\": \"20px\",\n /* Image Card Styles */\n \"--beam-CommunityImpact-imageCard-borderColor\": \"currentColor\",\n \"--beam-CommunityImpact-imageCard-borderRadius\": \"0\",\n \"--beam-CommunityImpact-imageCard-borderWidth\": \"1px\",\n \"--beam-CommunityImpact-imageCard-backgroundColor\": \"inherit\",\n \"--beam-CommunityImpact-imageCard-foregroundColor\": \"inherit\",\n ...defineCustomText(\"--beam-CommunityImpact-filterTabs\", {\n fontSize: \"16px\",\n marginTop: \"10px\",\n fontWeight: \"bold\",\n }),\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-cause\", {\n fontSize: \"14px\",\n textTransform: \"uppercase\",\n color: \"#fff\",\n }),\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-name\", {\n fontSize: \"22px\",\n marginTop: \"0\",\n color: \"#fff\",\n }),\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-description\", {\n marginTop: \"10px\",\n lineHeight: \"1.3\",\n }),\n \"--beam-CommunityImpact-imageCard-link-color\": \"inherit\",\n \"--beam-CommunityImpact-imageCard-linkArrow-display\": \"none\",\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-link\", {\n fontSize: \"12px\",\n }),\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-goalCompletion\", {\n fontSize: \"12px\",\n }),\n \"--beam-CommunityImpact-imageCard-goalCompletion-fontStyle\": \"italic\",\n \"--beam-CommunityImpact-imageCard-progress-marginTop\": \"10px\",\n ...defineCustomText(\"--beam-CommunityImpact-imageCard-progressText\"),\n \"--beam-CommunityImpact-imageCard-footer-marginTop\": \"10px\",\n /* Icon Card Styles */\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-cause\", {\n marginTop: \"10px\",\n }),\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-name\", {\n marginTop: \"5px\",\n fontWeight: \"bold\",\n }),\n \"--beam-CommunityImpact-iconCard-progress-marginTop\": \"10px\",\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-progressText\"),\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-description\", {\n marginTop: \"10px\",\n lineHeight: \"1.3\",\n }),\n \"--beam-CommunityImpact-iconCard-description-textAlign\": \"left\",\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-goalCompletion\", {\n marginTop: \"10px\",\n }),\n \"--beam-CommunityImpact-iconCard-link-color\": \"inherit\",\n \"--beam-CommunityImpact-iconCard-linkArrow-display\": \"none\",\n ...defineCustomText(\"--beam-CommunityImpact-iconCard-link\", {\n marginTop: \"5px\",\n }),\n };\n\n const cardCount = this.impactDataController.data?.community.length || 0;\n const columnCount = cardCount === 3 ? 3 : this.cardStyle === \"icon\" ? 4 : 2;\n defaults[\"--beam-CommunityImpact-columns\"] = columnCount.toString();\n defaults[\"--beam-CommunityImpact-columns-minWidth\"] = this.cardStyle === \"image\" ? \"300px\" : \"200px\";\n\n const remoteConfig = this.impactDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n css`\n :host {\n display: block;\n font-family: var(--beam-fontFamily, inherit);\n font-style: var(--beam-fontStyle, inherit);\n font-size: var(--beam-fontSize, inherit);\n color: var(--beam-textColor, inherit);\n background-color: var(--beam-backgroundColor, inherit);\n line-height: var(--beam-lineHeight, 1);\n word-break: normal;\n }\n\n .beam-filter-tabs {\n ${useCustomText(\"--beam-CommunityImpact-filterTabs\")}\n margin-bottom: var(--beam-CommunityImpact-filterTabs-marginBottom, 10px);\n text-align: var(--beam-CommunityImpact-filterTabs-textalign, left);\n }\n\n .beam-nonprofit-image-cards,\n .beam-nonprofit-icon-cards {\n margin-top: 10px;\n }\n\n ${cssCardGrid({\n gap: \"20px\",\n className: \"beam-nonprofit-image-cards\",\n columnCount: \"var(--beam-CommunityImpact-columns)\",\n itemMinWidth: \"var(--beam-CommunityImpact-columns-minWidth)\",\n })}\n\n ${cssCardGrid({\n gap: \"40px\",\n className: \"beam-nonprofit-icon-cards\",\n columnCount: \"var(--beam-CommunityImpact-columns)\",\n itemMinWidth: \"var(--beam-CommunityImpact-columns-minWidth)\",\n })}\n\n /* Image Style Cards */\n\n .image-card {\n overflow-wrap: break-word;\n border-color: var(--beam-CommunityImpact-imageCard-borderColor);\n border-style: solid;\n border-width: var(--beam-CommunityImpact-imageCard-borderWidth);\n border-radius: var(--beam-CommunityImpact-imageCard-borderRadius);\n overflow: hidden;\n background-color: var(--beam-CommunityImpact-imageCard-backgroundColor);\n color: var(--beam-CommunityImpact-imageCard-foregroundColor);\n }\n\n .image-card-image-box {\n height: 200px;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n padding: 0 24px 16px;\n overflow-wrap: break-word;\n background-color: #555;\n background-blend-mode: overlay;\n background-size: cover;\n background-repeat: no-repeat;\n }\n\n .image-card-cause {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-cause\")}\n }\n\n .image-card-name {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-name\")}\n }\n\n .image-card-progress {\n margin-top: var(--beam-CommunityImpact-imageCard-progress-marginTop);\n }\n\n .image-card-progressText {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-progressText\")}\n }\n\n .image-card-description {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-description\")}\n }\n\n .image-card-link {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-link\")}\n }\n\n .image-card-link-arrow {\n display: var(--beam-CommunityImpact-imageCard-linkArrow-display, \"none\");\n }\n\n .image-card-goal-completion {\n ${useCustomText(\"--beam-CommunityImpact-imageCard-goalCompletion\")}\n font-style: var(--beam-CommunityImpact-imageCard-goalCompletion-fontStyle, italic);\n }\n\n .image-card-footer {\n margin-top: var(--beam-CommunityImpact-imageCard-footer-marginTop);\n }\n\n /* Icon Style Cards */\n\n .icon-card {\n display: flex;\n flex-direction: column;\n justify-content: start;\n align-items: center;\n }\n\n .icon-card-icon {\n height: 50px;\n }\n\n .icon-card-cause {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-cause\")}\n }\n\n .icon-card-name {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-name\")}\n }\n\n .icon-card-progress {\n margin-top: var(--beam-CommunityImpact-iconCard-progress-marginTop);\n }\n\n .icon-card-progressText {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-progressText\")}\n margin-left: 10px;\n }\n\n .icon-card-description {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-description\")}\n text-align: var(--beam-CommunityImpact-iconCard-description-textAlign, left);\n }\n\n .icon-card-link {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-link\")}\n }\n\n .icon-card-link-arrow {\n display: var(--beam-CommunityImpact-iconCard-linkArrow-display, \"none\");\n }\n\n .icon-card-goal-completion {\n ${useCustomText(\"--beam-CommunityImpact-iconCard-goalCompletion\")}\n font-style: var(--beam-CommunityImpact-iconCard-goalCompletion-fontStyle, italic);\n }\n\n .icon-card-footer {\n margin-top: var(--beam-CommunityImpact-iconCard-footer-marginTop);\n }\n `,\n ];\n}\n\ndefineCustomElement(BeamCommunityImpact);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-community-impact\": BeamCommunityImpact;\n }\n}\n"],"names":["strings","times","BeamCommunityImpact","LitElement","DEFAULT_BASE_URL","enforceConfig","getImpact","WIDGET_NAMES","AsyncController","data","nonprofitImageAltText","learnMoreLinkAriaLabel","html","localizeUserString","unsafeHTML","nonprofitIconAltText","nonprofits","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","uniqueFilters","n","handleSeeAllFocus","handleFilterFocus","filter","styleMap","evt","selectedFilter","error","loading","_loading","_errorMessage","BeamError","filteredNonprofits","np","defaults","partnerLogosConfigDefaults","progressBarConfigDefaults","defineCustomText","columnCount","remoteConfig","config","_cssVariableMap","cssReset","css","useCustomText","cssCardGrid","__decorateClass","property","state","defineCustomElement"],"mappings":"2pBAAO,MAAMA,EAAU,CACrB,GAAI,CACF,YAAa,CAAC,CAAE,MAAAC,EAAQ,CAAE,IAAM,aAAaA,CAAK,QAAQA,EAAQ,EAAI,QAAU,MAAM,UACtF,UAAW,IAAM,aACjB,OAAQ,IAAM,SAChB,EACA,GAAI,CACF,YAAa,CAAC,CAAE,MAAAA,EAAQ,CAAE,IAAM,iBAAcA,CAAK,2BACnD,UAAW,IAAM,iBACjB,OAAQ,IAAM,WAChB,EACA,GAAI,CACF,YAAa,CAAC,CAAE,MAAAA,EAAQ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 -2,8 +2,8 @@ import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
3
  import * as lit_html from 'lit-html';
4
4
  import * as lodash from 'lodash';
5
- import { T as TNumericId } from '../chunks/types-IbMT3Nwn.esm.js';
6
- import { L as LANGUAGES } from '../chunks/types-aju0qrRe.esm.js';
5
+ import { T as TNumericId } from '../chunks/types-CPxMwnoR.esm.js';
6
+ import { L as LANGUAGES } from '../chunks/types-C7gqAyyH.esm.js';
7
7
 
8
8
  declare class AnimatedCounter extends LitElement {
9
9
  finalValue: number;
@@ -1,4 +1,4 @@
1
- import{t as C,h as b,y as u,g as c,f as y,p as I}from"../chunks/lit-iNN5L_Qk.esm.js";import{d as x}from"../chunks/lodash-P8OIs-at.esm.js";import{c as T,d as S,e as E}from"../chunks/enforce-config-l-tNb_z7.esm.js";import{u as p,A as z,_ as f,i as d,d as v,a as B}from"../chunks/localize-7sMSg1W9.esm.js";import{D,k,S as L}from"../chunks/routes-o-phF_L1.esm.js";import{B as $}from"../chunks/beam-errors-AMvTvR1C.esm.js";import{_ as V}from"../chunks/loading-template-t4fFsYtr.esm.js";import{i as A}from"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../utils/logger.esm.js";var j=Object.defineProperty,R=Object.getOwnPropertyDescriptor,h=(s,e,t,a)=>{for(var i=a>1?void 0:a?R(e,t):e,o=s.length-1,r;o>=0;o--)(r=s[o])&&(i=(a?r(e,t,i):r(i))||i);return a&&i&&j(e,t,i),i};class m extends b{constructor(){super(...arguments),this.finalValue=0,this.duration=1500,this.counter=0,this.intervalId=0,this.handleCounterAnimateIfInView=e=>{e.some(t=>t.isIntersecting)&&(this.animateCounter(),this.unobserveScrollTarget())},this.animateCounter=()=>{const e=41.666666666666664,t=e/this.duration*this.finalValue;this.intervalId=setInterval(()=>{const a=this.counter+t;if(a>=this.finalValue){this.counter=this.finalValue,clearInterval(this.intervalId);return}else this.counter=a},e)},this.observer=new IntersectionObserver(this.handleCounterAnimateIfInView,{threshold:.1}),this.observeScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.observe(e)},this.unobserveScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.unobserve(e)}}connectedCallback(){super.connectedCallback();const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.duration===0||e?this.counter=this.finalValue:this.observeScrollTarget()}disconnectedCallback(){super.disconnectedCallback(),this.unobserveScrollTarget(),clearInterval(this.intervalId)}get scrollTargetElement(){return this.scrollTarget?document.querySelector(this.scrollTarget):this}render(){return u`${Math.ceil(this.counter).toLocaleString()}`}}h([c({type:Number})],m.prototype,"finalValue",2),h([c({type:Number})],m.prototype,"duration",2),h([c({type:String})],m.prototype,"scrollTarget",2),h([C()],m.prototype,"counter",2),customElements.get("animated-counter")||customElements.define("animated-counter",m);const O=s=>{const e=s instanceof NodeList?Array.from(s):s;if(e.length===0||!A(e))return;const t=e.sort((i,o)=>{const r=getComputedStyle(i).getPropertyValue("width").replace("px",""),g=getComputedStyle(o).getPropertyValue("width").replace("px","");return parseInt(g)-parseInt(r)})[0],a=getComputedStyle(t).getPropertyValue("width");for(const i of e)getComputedStyle(i).getPropertyValue("width")!==a&&(i.style.width=a)},w={en:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."},fr:{cumulativeImpactTitle:()=>"Ce que nous avons financ\xE9",cumulativeImpactDescription:()=>"Voici l'impact que notre communaut\xE9 a eu jusqu'\xE0 pr\xE9sent en partenariat avec Beam. Notre impact grandit chaque jour : faites d\xE9filer pour d\xE9couvrir les objectifs vers lesquels nous travaillons ensemble en ce moment."},de:{cumulativeImpactTitle:()=>"Was wir finanziert haben",cumulativeImpactDescription:()=>"Hier ist die Wirkung, die unsere Community bisher in Zusammenarbeit mit Beam erzielt hat. Unsere Wirkung w\xE4chst von Tag zu Tag - scrollen Sie, um einen Blick auf die Ziele zu werfen, auf die wir derzeit gemeinsam hinarbeiten."},es:{cumulativeImpactTitle:()=>"Lo que hemos financiado",cumulativeImpactDescription:()=>"Este es el impacto que nuestra comunidad ha tenido hasta ahora en asociaci\xF3n con Beam. Nuestro impacto crece cada d\xEDa; despl\xE1cese para ver los objetivos por los que estamos trabajando juntos en este momento."},it:{cumulativeImpactTitle:()=>"Cosa abbiamo finanziato",cumulativeImpactDescription:()=>"Ecco l'impatto che la nostra comunit\xE0 ha avuto finora in collaborazione con Beam. Il nostro impatto cresce ogni giorno: scorri per scoprire gli obiettivi a cui stiamo lavorando insieme in questo momento."},pl:{cumulativeImpactTitle:()=>"Co sfinansowali\u015Bmy",cumulativeImpactDescription:()=>"Oto wp\u0142yw, jaki nasza spo\u0142eczno\u015B\u0107 wywar\u0142a dotychczas we wsp\xF3\u0142pracy z Beam. Nasz wp\u0142yw ro\u015Bnie z ka\u017Cdym dniem \u2014 przewi\u0144, aby sprawdzi\u0107 cele, nad kt\xF3rymi obecnie wsp\xF3lnie pracujemy."}};var P=Object.defineProperty,q=Object.getOwnPropertyDescriptor,l=(s,e,t,a)=>{for(var i=a>1?void 0:a?q(e,t):e,o=s.length-1,r;o>=0;o--)(r=s[o])&&(i=(a?r(e,t,i):r(i))||i);return a&&i&&P(e,t,i),i};const U=1.5*1e3;class n extends b{constructor(){super(...arguments),this.baseUrl=D,this.lang="en",this.disableAnimation=!1,this.debug=!1,this.draftConfig=!1,this.getCumulativeImpactData=async()=>(E(["apiKey","chainId"],this),await k({baseUrl:this.baseUrl,pathParams:{chainId:this.chainId},headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.cumulativeImpactDataController=new z(this,this.getCumulativeImpactData),this.resizeElements=x(()=>{O(this.impactRowRefs)},50,{maxWait:50,leading:!0})}get configLang(){return L[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const t=["chainId","baseUrl","lang"];for(const a of t)if(e.has(a)){await this.cumulativeImpactDataController.exec();break}this.resizeElements()}render(){const{data:e,error:t,loading:a}=this.cumulativeImpactDataController;return a?V():t?this.debug?f({error:t}):"":e==null?this.debug?f({error:new $("Missing data")}):"":u`
1
+ import{t as C,h as b,y as u,g as l,f as y,p as I}from"../chunks/lit-WqMxC_PA.esm.js";import{d as x}from"../chunks/lodash-7H4x2457.esm.js";import{c as T,d as S,e as E}from"../chunks/enforce-config-CZ3ToOgr.esm.js";import{u as p,A as z,_ as f,i as d,d as v,a as B}from"../chunks/localize-Btu9xYcE.esm.js";import{D as k,k as D,S as L}from"../chunks/routes-pcL-CUiQ.esm.js";import{B as $}from"../chunks/beam-errors-Ci0d3926.esm.js";import{_ as V}from"../chunks/loading-template-DG4lkIIc.esm.js";import{i as A}from"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../utils/logger.esm.js";var R=Object.defineProperty,h=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&R(e,t,a),a};class c extends b{constructor(){super(...arguments),this.finalValue=0,this.duration=1500,this.counter=0,this.intervalId=0,this.handleCounterAnimateIfInView=e=>{e.some(t=>t.isIntersecting)&&(this.animateCounter(),this.unobserveScrollTarget())},this.animateCounter=()=>{const e=41.666666666666664,t=e/this.duration*this.finalValue;this.intervalId=setInterval(()=>{const i=this.counter+t;if(i>=this.finalValue){this.counter=this.finalValue,clearInterval(this.intervalId);return}else this.counter=i},e)},this.observer=new IntersectionObserver(this.handleCounterAnimateIfInView,{threshold:.1}),this.observeScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.observe(e)},this.unobserveScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.unobserve(e)}}connectedCallback(){super.connectedCallback();const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.duration===0||e?this.counter=this.finalValue:this.observeScrollTarget()}disconnectedCallback(){super.disconnectedCallback(),this.unobserveScrollTarget(),clearInterval(this.intervalId)}get scrollTargetElement(){return this.scrollTarget?document.querySelector(this.scrollTarget):this}render(){return u`${Math.ceil(this.counter).toLocaleString()}`}}h([l({type:Number})],c.prototype,"finalValue"),h([l({type:Number})],c.prototype,"duration"),h([l({type:String})],c.prototype,"scrollTarget"),h([C()],c.prototype,"counter"),customElements.get("animated-counter")||customElements.define("animated-counter",c);const j=n=>{const e=n instanceof NodeList?Array.from(n):n;if(e.length===0||!A(e))return;const t=e.sort((a,o)=>{const s=getComputedStyle(a).getPropertyValue("width").replace("px",""),g=getComputedStyle(o).getPropertyValue("width").replace("px","");return parseInt(g)-parseInt(s)})[0],i=getComputedStyle(t).getPropertyValue("width");for(const a of e)getComputedStyle(a).getPropertyValue("width")!==i&&(a.style.width=i)},w={en:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."},fr:{cumulativeImpactTitle:()=>"Ce que nous avons financ\xE9",cumulativeImpactDescription:()=>"Voici l'impact que notre communaut\xE9 a eu jusqu'\xE0 pr\xE9sent en partenariat avec Beam. Notre impact grandit chaque jour : faites d\xE9filer pour d\xE9couvrir les objectifs vers lesquels nous travaillons ensemble en ce moment."},de:{cumulativeImpactTitle:()=>"Was wir finanziert haben",cumulativeImpactDescription:()=>"Hier ist die Wirkung, die unsere Community bisher in Zusammenarbeit mit Beam erzielt hat. Unsere Wirkung w\xE4chst von Tag zu Tag - scrollen Sie, um einen Blick auf die Ziele zu werfen, auf die wir derzeit gemeinsam hinarbeiten."},es:{cumulativeImpactTitle:()=>"Lo que hemos financiado",cumulativeImpactDescription:()=>"Este es el impacto que nuestra comunidad ha tenido hasta ahora en asociaci\xF3n con Beam. Nuestro impacto crece cada d\xEDa; despl\xE1cese para ver los objetivos por los que estamos trabajando juntos en este momento."},it:{cumulativeImpactTitle:()=>"Cosa abbiamo finanziato",cumulativeImpactDescription:()=>"Ecco l'impatto che la nostra comunit\xE0 ha avuto finora in collaborazione con Beam. Il nostro impatto cresce ogni giorno: scorri per scoprire gli obiettivi a cui stiamo lavorando insieme in questo momento."},pl:{cumulativeImpactTitle:()=>"Co sfinansowali\u015Bmy",cumulativeImpactDescription:()=>"Oto wp\u0142yw, jaki nasza spo\u0142eczno\u015B\u0107 wywar\u0142a dotychczas we wsp\xF3\u0142pracy z Beam. Nasz wp\u0142yw ro\u015Bnie z ka\u017Cdym dniem \u2014 przewi\u0144, aby sprawdzi\u0107 cele, nad kt\xF3rymi obecnie wsp\xF3lnie pracujemy."}};var q=Object.defineProperty,m=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&q(e,t,a),a};const U=1.5*1e3;class r extends b{constructor(){super(...arguments),this.baseUrl=k,this.lang="en",this.disableAnimation=!1,this.debug=!1,this.draftConfig=!1,this.getCumulativeImpactData=async()=>(E(["apiKey","chainId"],this),await D({baseUrl:this.baseUrl,pathParams:{chainId:this.chainId},headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.cumulativeImpactDataController=new z(this,this.getCumulativeImpactData),this.resizeElements=x(()=>{j(this.impactRowRefs)},50,{maxWait:50,leading:!0})}get configLang(){return L[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const t=["chainId","baseUrl","lang"];for(const i of t)if(e.has(i)){await this.cumulativeImpactDataController.exec();break}this.resizeElements()}render(){const{data:e,error:t,loading:i}=this.cumulativeImpactDataController;return i?V():t?this.debug?f({error:t}):"":e==null?this.debug?f({error:new $("Missing data")}):"":u`
2
2
  <style>
3
3
  :host {
4
4
  ${this.cssVariables.toCSS()}
@@ -15,7 +15,7 @@ import{t as C,h as b,y as u,g as c,f as y,p as I}from"../chunks/lit-iNN5L_Qk.esm
15
15
  ${this.renderCumulativeImpact(e)}
16
16
  </div>
17
17
  </div>
18
- `}renderCumulativeImpact(e){const t=e.impacts?e.impacts?.map(o=>o.value||0):[],a=Math.max(...t),i=t.map(o=>U*Math.log(Math.max(o,1))/Math.log(a));return u`
18
+ `}renderCumulativeImpact(e){const t=e.impacts?e.impacts?.map(o=>o.value||0):[],i=Math.max(...t),a=t.map(o=>U*Math.log(Math.max(o,1))/Math.log(i));return u`
19
19
  <div class="main">
20
20
  <div class="title" role="heading">
21
21
  ${d(this.configLang,e?.config?.web?.title||"")||w[this.configLang].cumulativeImpactTitle()}
@@ -24,25 +24,25 @@ import{t as C,h as b,y as u,g as c,f as y,p as I}from"../chunks/lit-iNN5L_Qk.esm
24
24
  ${d(this.configLang,e?.config?.web?.description||"")||w[this.configLang].cumulativeImpactDescription()}
25
25
  </p>
26
26
  <div class="impact-list">
27
- ${e.impacts?.map((o,r)=>this.renderCumulativeImpactRow({impact:o,animationDuration:i[r]}))}
27
+ ${e.impacts?.map((o,s)=>this.renderCumulativeImpactRow({impact:o,animationDuration:a[s]}))}
28
28
  </div>
29
29
  </div>
30
- `}renderCumulativeImpactRow({impact:e,animationDuration:t}){const a=this.cumulativeImpactDataController.data?.config?.web.disableAnimation,i="impact-row-value-counter impact-row-value-floating-counter",o=a?0:t,r=d(this.configLang,e.unit||""),g=d(this.configLang,e.summary||"");return u`
30
+ `}renderCumulativeImpactRow({impact:e,animationDuration:t}){const i=this.cumulativeImpactDataController.data?.config?.web.disableAnimation,a="impact-row-value-counter impact-row-value-floating-counter",o=i?0:t,s=d(this.configLang,e.unit||""),g=d(this.configLang,e.summary||"");return u`
31
31
  <div class="impact-row">
32
32
  <div class="impact-row-value-container">
33
33
  <span class="impact-row-value-counter" style="visibility: hidden;" aria-hidden="true">
34
34
  ${e.value.toLocaleString()}
35
35
  </span>
36
36
  <animated-counter
37
- class="${i}"
37
+ class="${a}"
38
38
  finalValue=${e.value}
39
39
  duration=${o}
40
40
  ></animated-counter>
41
41
  </span>
42
42
  </div>
43
- <div class="impact-row-description">${r} ${g}</div>
43
+ <div class="impact-row-description">${s} ${g}</div>
44
44
  </div>
45
- `}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"16px","--beam-lineHeight":"1","--beam-textColor":"inherit",...v("--beam-CumulativeImpact-title",{fontSize:"32px"}),...v("--beam-CumulativeImpact-description",{marginTop:"16px",lineHeight:"1.3"}),"--beam-CumulativeImpact-impact-list-marginTop":"24px","--beam-CumulativeImpact-row-marginTop":"24px","--beam-CumulativeImpact-row-value-container-borderBottomWidth":"4px","--beam-CumulativeImpact-row-value-container-borderBottomColor":"currentColor","--beam-CumulativeImpact-row-value-container-paddingTop":"0","--beam-CumulativeImpact-row-value-container-paddingRight":"20px","--beam-CumulativeImpact-row-value-container-paddingBottom":"4px","--beam-CumulativeImpact-row-value-container-paddingLeft":"20px",...v("--beam-CumulativeImpact-row-value-counter",{color:"currentColor",fontSize:"24px",fontWeight:"normal"}),...v("--beam-CumulativeImpact-row-description",{color:"currentColor",fontSize:"16px",fontWeight:"normal",lineHeight:"1.3"}),"--beam-CumulativeImpact-row-description-paddingLeft":"24px","--beam-CumulativeImpact-row-description-paddingRight":"24px","--beam-CumulativeImpact-row-description-mobile-marginTop":"12px"},t=this.cumulativeImpactDataController.data?.config?.web?.theme||{},a={...e,...t};return Object.assign(Object.create({toCSS(){return B(this)}}),a)}}n.tagName="beam-cumulative-impact",n.styles=[T,y`
45
+ `}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"16px","--beam-lineHeight":"1","--beam-textColor":"inherit",...v("--beam-CumulativeImpact-title",{fontSize:"32px"}),...v("--beam-CumulativeImpact-description",{marginTop:"16px",lineHeight:"1.3"}),"--beam-CumulativeImpact-impact-list-marginTop":"24px","--beam-CumulativeImpact-row-marginTop":"24px","--beam-CumulativeImpact-row-value-container-borderBottomWidth":"4px","--beam-CumulativeImpact-row-value-container-borderBottomColor":"currentColor","--beam-CumulativeImpact-row-value-container-paddingTop":"0","--beam-CumulativeImpact-row-value-container-paddingRight":"20px","--beam-CumulativeImpact-row-value-container-paddingBottom":"4px","--beam-CumulativeImpact-row-value-container-paddingLeft":"20px",...v("--beam-CumulativeImpact-row-value-counter",{color:"currentColor",fontSize:"24px",fontWeight:"normal"}),...v("--beam-CumulativeImpact-row-description",{color:"currentColor",fontSize:"16px",fontWeight:"normal",lineHeight:"1.3"}),"--beam-CumulativeImpact-row-description-paddingLeft":"24px","--beam-CumulativeImpact-row-description-paddingRight":"24px","--beam-CumulativeImpact-row-description-mobile-marginTop":"12px"},t=this.cumulativeImpactDataController.data?.config?.web?.theme||{},i={...e,...t};return Object.assign(Object.create({toCSS(){return B(this)}}),i)}}r.tagName="beam-cumulative-impact",r.styles=[T,y`
46
46
  :host {
47
47
  display: block;
48
48
  font-family: var(--beam-fontFamily, inherit);
@@ -117,5 +117,5 @@ import{t as C,h as b,y as u,g as c,f as y,p as I}from"../chunks/lit-iNN5L_Qk.esm
117
117
  padding-bottom: 0;
118
118
  }
119
119
  }
120
- `],l([c({type:String})],n.prototype,"apiKey",2),l([c({type:Number})],n.prototype,"chainId",2),l([c({type:String})],n.prototype,"baseUrl",2),l([c({type:String})],n.prototype,"lang",2),l([c({type:Boolean})],n.prototype,"disableAnimation",2),l([c({type:Boolean})],n.prototype,"debug",2),l([c({type:Boolean})],n.prototype,"draftConfig",2),l([I(".impact-row-value-container")],n.prototype,"impactRowRefs",2),S(n);export{n as BeamCumulativeImpact};
120
+ `],m([l({type:String})],r.prototype,"apiKey"),m([l({type:Number})],r.prototype,"chainId"),m([l({type:String})],r.prototype,"baseUrl"),m([l({type:String})],r.prototype,"lang"),m([l({type:Boolean})],r.prototype,"disableAnimation"),m([l({type:Boolean})],r.prototype,"debug"),m([l({type:Boolean})],r.prototype,"draftConfig"),m([I(".impact-row-value-container")],r.prototype,"impactRowRefs"),S(r);export{r as BeamCumulativeImpact};
121
121
  //# sourceMappingURL=cumulative-impact.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cumulative-impact.esm.js","sources":["../../src/shared/components/animated-counter/index.ts","../../src/shared/sync-element-widths.ts","../../src/components/cumulative-impact/strings.ts","../../src/components/cumulative-impact/index.ts"],"sourcesContent":["import { html, LitElement } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { state } from \"lit/decorators.js\";\n\nexport class AnimatedCounter extends LitElement {\n @property({ type: Number }) finalValue = 0;\n @property({ type: Number }) duration = 1500;\n @property({ type: String }) scrollTarget?: string;\n\n @state() protected counter = 0;\n private intervalId = 0;\n\n connectedCallback() {\n super.connectedCallback();\n const userPrefersReducedMotion = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n if (this.duration === 0 || userPrefersReducedMotion) {\n this.counter = this.finalValue;\n } else {\n this.observeScrollTarget();\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.unobserveScrollTarget();\n clearInterval(this.intervalId);\n }\n\n private handleCounterAnimateIfInView: IntersectionObserverCallback = (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n this.animateCounter();\n this.unobserveScrollTarget();\n }\n };\n\n private animateCounter = () => {\n const ANIMATION_FRAME_RATE = 24;\n const MS_PER_FRAME = 1000 / ANIMATION_FRAME_RATE;\n const INCREMENT_RATE_PER_FRAME = MS_PER_FRAME / this.duration;\n const COUNTER_INCREMENT_PER_FRAME = INCREMENT_RATE_PER_FRAME * this.finalValue;\n\n this.intervalId = setInterval(() => {\n const result = this.counter + COUNTER_INCREMENT_PER_FRAME;\n if (result >= this.finalValue) {\n this.counter = this.finalValue;\n clearInterval(this.intervalId);\n return;\n } else {\n this.counter = result;\n }\n }, MS_PER_FRAME);\n };\n\n private observer = new IntersectionObserver(this.handleCounterAnimateIfInView, {\n threshold: 0.1,\n });\n\n private observeScrollTarget = () => {\n const target = this.scrollTargetElement;\n target && this.observer.observe(target);\n };\n\n private unobserveScrollTarget = () => {\n const target = this.scrollTargetElement;\n target && this.observer.unobserve(target);\n };\n\n get scrollTargetElement(): this | Element | null {\n if (this.scrollTarget) {\n return document.querySelector(this.scrollTarget);\n } else {\n return this;\n }\n }\n\n render() {\n return html`${Math.ceil(this.counter).toLocaleString()}`;\n }\n}\n\ncustomElements.get(\"animated-counter\") || customElements.define(\"animated-counter\", AnimatedCounter);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"animated-counter\": AnimatedCounter;\n }\n}\n","import { isAllHtmlElements } from \"./is-all-html-elements\";\n\n/**\n * Synchronize widths of elements\n * @param {Array<HTMLElement|null>} elements - Elements to synchronize\n */\nexport const syncElementWidths = (elements: Array<HTMLElement | null> | NodeList) => {\n const els = elements instanceof NodeList ? Array.from(elements) : elements;\n\n if (els.length === 0 || !isAllHtmlElements(els)) {\n return;\n }\n\n const widthSource = els.sort((a, b) => {\n const widthA = getComputedStyle(a).getPropertyValue(\"width\").replace(\"px\", \"\");\n const widthB = getComputedStyle(b).getPropertyValue(\"width\").replace(\"px\", \"\");\n return parseInt(widthB) - parseInt(widthA);\n })[0];\n\n const syncedWidth = getComputedStyle(widthSource).getPropertyValue(\"width\");\n\n for (const el of els) {\n if (getComputedStyle(el).getPropertyValue(\"width\") !== syncedWidth) {\n el.style[\"width\"] = syncedWidth;\n }\n }\n};\n","export const strings = {\n en: {\n cumulativeImpactTitle: () => `What we've funded`,\n cumulativeImpactDescription: () =>\n \"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day— scroll to check out the goals we're working toward together right now.\",\n },\n fr: {\n cumulativeImpactTitle: () => `Ce que nous avons financé`,\n cumulativeImpactDescription: () =>\n \"Voici l'impact que notre communauté a eu jusqu'à présent en partenariat avec Beam. Notre impact grandit chaque jour : faites défiler pour découvrir les objectifs vers lesquels nous travaillons ensemble en ce moment.\",\n },\n de: {\n cumulativeImpactTitle: () => `Was wir finanziert haben`,\n cumulativeImpactDescription: () =>\n \"Hier ist die Wirkung, die unsere Community bisher in Zusammenarbeit mit Beam erzielt hat. Unsere Wirkung wächst von Tag zu Tag - scrollen Sie, um einen Blick auf die Ziele zu werfen, auf die wir derzeit gemeinsam hinarbeiten.\",\n },\n es: {\n cumulativeImpactTitle: () => `Lo que hemos financiado`,\n cumulativeImpactDescription: () =>\n \"Este es el impacto que nuestra comunidad ha tenido hasta ahora en asociación con Beam. Nuestro impacto crece cada día; desplácese para ver los objetivos por los que estamos trabajando juntos en este momento.\",\n },\n it: {\n cumulativeImpactTitle: () => `Cosa abbiamo finanziato`,\n cumulativeImpactDescription: () =>\n \"Ecco l'impatto che la nostra comunità ha avuto finora in collaborazione con Beam. Il nostro impatto cresce ogni giorno: scorri per scoprire gli obiettivi a cui stiamo lavorando insieme in questo momento.\",\n },\n pl: {\n cumulativeImpactTitle: () => `Co sfinansowaliśmy`,\n cumulativeImpactDescription: () =>\n \"Oto wpływ, jaki nasza społeczność wywarła dotychczas we współpracy z Beam. Nasz wpływ rośnie z każdym dniem — przewiń, aby sprawdzić cele, nad którymi obecnie wspólnie pracujemy.\",\n },\n};\n","import { css, html, LitElement } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { queryAll } from \"lit/decorators/query-all.js\";\nimport debounce from \"lodash-es/debounce\";\nimport \"../../shared/components/animated-counter\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES } from \"../../api-sdk/constants\";\nimport { TNumericId } from \"../../shared/types\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { getCumulativeImpact } from \"../../api-sdk/v3/routes\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { BeamError, MissingConfig } from \"../../utils/beam-errors\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { _loading } from \"../../shared/fragments/loading-template\";\nimport { syncElementWidths } from \"../../shared/sync-element-widths\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { strings } from \"./strings\";\n\ntype RequiredConfig = {\n apiKey: string;\n chainId: TNumericId;\n};\n\ntype IAPIV3CumulativeImpact = Awaited<ReturnType<typeof getCumulativeImpact>>;\n\nconst MAX_COUNTER_ANIMATION_DURATION = 1.5 * 1000;\n\nexport class BeamCumulativeImpact extends LitElement {\n static tagName = \"beam-cumulative-impact\";\n\n @property({ type: String }) public apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) public chainId?: RequiredConfig[\"chainId\"];\n\n @property({ type: String }) public baseUrl = DEFAULT_BASE_URL;\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public disableAnimation = false;\n\n @property({ type: Boolean }) public debug = false;\n\n @property({ type: Boolean }) public draftConfig = false;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n private getCumulativeImpactData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"chainId\"], this)) {\n throw new MissingConfig();\n }\n const res = await getCumulativeImpact({\n baseUrl: this.baseUrl,\n pathParams: {\n chainId: this.chainId,\n },\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n queryParams: {\n version: \"1.0.0\",\n lang: this.configLang,\n draftConfig: this.draftConfig,\n },\n });\n\n return res;\n };\n\n private cumulativeImpactDataController = new AsyncController<typeof this.getCumulativeImpactData>(\n this,\n this.getCumulativeImpactData\n );\n\n @queryAll(\".impact-row-value-container\")\n impactRowRefs!: HTMLElement[];\n resizeElements = debounce(\n () => {\n syncElementWidths(this.impactRowRefs);\n },\n 50,\n { maxWait: 50, leading: true }\n );\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(\"resize\", this.resizeElements);\n }\n\n async updated(changedProperties: Map<string, unknown>) {\n // Reload nonprofit list on change of any of these props:\n // Also fires on first load as props go from undefined => value\n const requireNewDataProps = [\"chainId\", \"baseUrl\", \"lang\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.cumulativeImpactDataController.exec();\n break;\n }\n }\n\n this.resizeElements();\n }\n\n render() {\n const { data, error, loading } = this.cumulativeImpactDataController;\n if (loading) {\n return _loading();\n }\n if (error) {\n if (this.debug) {\n return _errorMessage({ error });\n }\n return \"\";\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new BeamError(\"Missing data\") });\n }\n return \"\";\n }\n\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div style=\"display: flex; flex-direction: column;\" class=\"root\">\n <div\n style=\"margin: 10px 0 0 0;\"\n tabindex=\"-1\"\n class=\"options\"\n part=\"options\"\n aria-labelledby=\"beam-RedeemTransaction-title\"\n >\n ${this.renderCumulativeImpact(data)}\n </div>\n </div>\n `;\n }\n\n private renderCumulativeImpact(data: IAPIV3CumulativeImpact) {\n const rawValues = data.impacts ? data.impacts?.map((impact) => impact.value || 0) : [];\n const maxRawValue = Math.max(...rawValues);\n const durations = rawValues.map(\n (val) => (MAX_COUNTER_ANIMATION_DURATION * Math.log(Math.max(val, 1))) / Math.log(maxRawValue)\n );\n return html`\n <div class=\"main\">\n <div class=\"title\" role=\"heading\">\n ${localizeUserString(this.configLang, data?.config?.web?.title || \"\") ||\n strings[this.configLang].cumulativeImpactTitle()}\n </div>\n <p class=\"description\">\n ${localizeUserString(this.configLang, data?.config?.web?.description || \"\") ||\n strings[this.configLang].cumulativeImpactDescription()}\n </p>\n <div class=\"impact-list\">\n ${data.impacts?.map((impact: any, idx: number) => {\n return this.renderCumulativeImpactRow({ impact, animationDuration: durations[idx] });\n })}\n </div>\n </div>\n `;\n }\n\n private renderCumulativeImpactRow({ impact, animationDuration }: { impact: any; animationDuration: number }) {\n const disableAnimation = this.cumulativeImpactDataController.data?.config?.web.disableAnimation;\n const floatingCounterClass = \"impact-row-value-counter impact-row-value-floating-counter\";\n const duration = disableAnimation ? 0 : animationDuration;\n\n const unitDisplay = localizeUserString(this.configLang, impact.unit || \"\");\n const summaryDisplay = localizeUserString(this.configLang, impact.summary || \"\");\n\n /**\n * because we set the width using JavaScript by forcing all impact-row-value-container elements\n * to match the width of the widest sibling, we use a hidden span with the total preloaded to\n * ensure that impact-row-value-container widths do not change as the animation runs.\n */\n return html`\n <div class=\"impact-row\">\n <div class=\"impact-row-value-container\">\n <span class=\"impact-row-value-counter\" style=\"visibility: hidden;\" aria-hidden=\"true\">\n ${impact.value.toLocaleString()}\n </span>\n <animated-counter\n class=\"${floatingCounterClass}\"\n finalValue=${impact.value}\n duration=${duration}\n ></animated-counter>\n </span>\n </div>\n <div class=\"impact-row-description\">${unitDisplay} ${summaryDisplay}</div>\n </div>\n `;\n }\n\n public get cssVariables() {\n const defaults: Record<string, string> = {\n \"--beam-fontFamily\": \"inherit\",\n \"--beam-fontStyle\": \"inherit\",\n \"--beam-fontSize\": \"16px\",\n \"--beam-lineHeight\": \"1\",\n \"--beam-textColor\": \"inherit\",\n // main\n ...defineCustomText(\"--beam-CumulativeImpact-title\", {\n fontSize: \"32px\",\n }),\n ...defineCustomText(\"--beam-CumulativeImpact-description\", {\n marginTop: \"16px\",\n lineHeight: \"1.3\",\n }),\n \"--beam-CumulativeImpact-impact-list-marginTop\": \"24px\",\n \"--beam-CumulativeImpact-row-marginTop\": \"24px\",\n // row value container\n \"--beam-CumulativeImpact-row-value-container-borderBottomWidth\": \"4px\",\n \"--beam-CumulativeImpact-row-value-container-borderBottomColor\": \"currentColor\",\n \"--beam-CumulativeImpact-row-value-container-paddingTop\": \"0\",\n \"--beam-CumulativeImpact-row-value-container-paddingRight\": \"20px\",\n \"--beam-CumulativeImpact-row-value-container-paddingBottom\": \"4px\",\n \"--beam-CumulativeImpact-row-value-container-paddingLeft\": \"20px\",\n // row value counter\n ...defineCustomText(\"--beam-CumulativeImpact-row-value-counter\", {\n color: \"currentColor\",\n fontSize: \"24px\",\n fontWeight: \"normal\",\n }),\n // row description\n ...defineCustomText(\"--beam-CumulativeImpact-row-description\", {\n color: \"currentColor\",\n fontSize: \"16px\",\n fontWeight: \"normal\",\n lineHeight: \"1.3\",\n }),\n \"--beam-CumulativeImpact-row-description-paddingLeft\": \"24px\",\n \"--beam-CumulativeImpact-row-description-paddingRight\": \"24px\",\n \"--beam-CumulativeImpact-row-description-mobile-marginTop\": \"12px\",\n };\n\n const remoteConfig = this.cumulativeImpactDataController.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n css`\n :host {\n display: block;\n font-family: var(--beam-fontFamily, inherit);\n font-style: var(--beam-fontStyle, inherit);\n font-size: var(--beam-fontSize, inherit);\n color: var(--beam-textColor, inherit);\n background-color: var(--beam-backgroundColor, inherit);\n line-height: var(--beam-lineHeight, 1);\n word-break: normal;\n }\n .main {\n text-align: left;\n }\n .title {\n ${useCustomText(\"--beam-CumulativeImpact-title\")}\n text-align: inherit;\n }\n .description {\n ${useCustomText(\"--beam-CumulativeImpact-description\")}\n text-align: inherit;\n }\n .impact-list {\n display: flex;\n flex-direction: column;\n margin-top: var(--beam-CumulativeImpact-impact-list-marginTop);\n }\n .impact-row {\n display: flex;\n align-items: center;\n margin-top: var(--beam-CumulativeImpact-row-marginTop);\n }\n .impact-row-value-container {\n position: relative;\n border-bottom-width: var(--beam-CumulativeImpact-row-value-container-borderBottomWidth);\n border-bottom-color: var(--beam-CumulativeImpact-row-value-container-borderBottomColor);\n border-bottom-style: solid;\n padding-top: var(--beam-CumulativeImpact-row-value-container-paddingTop);\n padding-right: var(--beam-CumulativeImpact-row-value-container-paddingRight);\n padding-bottom: var(--beam-CumulativeImpact-row-value-container-paddingBottom);\n padding-left: var(--beam-CumulativeImpact-row-value-container-paddingLeft);\n text-align: center;\n flex-shrink: 0;\n }\n .impact-row-value-counter {\n ${useCustomText(\"--beam-CumulativeImpact-row-value-counter\")}\n }\n .impact-row-value-floating-counter {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n }\n .impact-row-description {\n ${useCustomText(\"--beam-CumulativeImpact-row-description\")}\n padding-left: var(--beam-CumulativeImpact-row-description-paddingLeft);\n padding-right: var(--beam-CumulativeImpact-row-description-paddingRight);\n /* match padding of value of counter for proper centering */\n padding-bottom: var(--beam-CumulativeImpact-row-value-paddingBottom);\n text-align: inherit;\n flex-grow: 1;\n }\n @media (max-width: 500px) {\n .main {\n text-align: center;\n }\n .impact-row {\n flex-direction: column;\n }\n .impact-row-description {\n margin-top: var(--beam-CumulativeImpact-row-description-mobile-marginTop);\n padding-bottom: 0;\n }\n }\n `,\n ];\n}\n\ndefineCustomElement(BeamCumulativeImpact);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-cumulative-impact\": BeamCumulativeImpact;\n }\n}\n"],"names":["AnimatedCounter","LitElement","entries","entry","MS_PER_FRAME","COUNTER_INCREMENT_PER_FRAME","result","target","userPrefersReducedMotion","html","__decorateClass","property","state","syncElementWidths","elements","els","isAllHtmlElements","widthSource","a","b","widthA","widthB","syncedWidth","el","strings","f","h","r","m","i","e","MAX_COUNTER_ANIMATION_DURATION","BeamCumulativeImpact","DEFAULT_BASE_URL","enforceConfig","getCumulativeImpact","AsyncController","debounce","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","data","error","loading","_loading","_errorMessage","BeamError","rawValues","impact","maxRawValue","durations","val","localizeUserString","idx","animationDuration","disableAnimation","floatingCounterClass","duration","unitDisplay","summaryDisplay","defaults","defineCustomText","remoteConfig","config","_cssVariableMap","cssReset","css","useCustomText","queryAll","defineCustomElement"],"mappings":"ywBAIaA,UAAwBC,CAAW,CAAzC,aAAA,CAAA,MAAA,GAAA,SAAA,EACuB,KAAa,WAAA,EACb,KAAW,SAAA,KAG9B,KAAU,QAAU,EAC7B,KAAQ,WAAa,EAkBrB,KAAQ,6BAA8DC,GAAY,CAC5EA,EAAQ,KAAMC,GAAUA,EA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AAA,EAAA,CADC2D,EAAS,6BAA6B,GAhD5BrC,EAiDX,UAAA,gBAAA,CAAA,EAkQFsC,EAAoBtC,CAAoB"}
1
+ {"version":3,"file":"cumulative-impact.esm.js","sources":["../../src/shared/components/animated-counter/index.ts","../../src/shared/sync-element-widths.ts","../../src/components/cumulative-impact/strings.ts","../../src/components/cumulative-impact/index.ts"],"sourcesContent":["import { html, LitElement } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { state } from \"lit/decorators.js\";\n\nexport class AnimatedCounter extends LitElement {\n @property({ type: Number }) finalValue = 0;\n @property({ type: Number }) duration = 1500;\n @property({ type: String }) scrollTarget?: string;\n\n @state() protected counter = 0;\n private intervalId = 0;\n\n connectedCallback() {\n super.connectedCallback();\n const userPrefersReducedMotion = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n if (this.duration === 0 || userPrefersReducedMotion) {\n this.counter = this.finalValue;\n } else {\n this.observeScrollTarget();\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.unobserveScrollTarget();\n clearInterval(this.intervalId);\n }\n\n private handleCounterAnimateIfInView: IntersectionObserverCallback = (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n this.animateCounter();\n this.unobserveScrollTarget();\n }\n };\n\n private animateCounter = () => {\n const ANIMATION_FRAME_RATE = 24;\n const MS_PER_FRAME = 1000 / ANIMATION_FRAME_RATE;\n const INCREMENT_RATE_PER_FRAME = MS_PER_FRAME / this.duration;\n const COUNTER_INCREMENT_PER_FRAME = INCREMENT_RATE_PER_FRAME * this.finalValue;\n\n this.intervalId = setInterval(() => {\n const result = this.counter + COUNTER_INCREMENT_PER_FRAME;\n if (result >= this.finalValue) {\n this.counter = this.finalValue;\n clearInterval(this.intervalId);\n return;\n } else {\n this.counter = result;\n }\n }, MS_PER_FRAME);\n };\n\n private observer = new IntersectionObserver(this.handleCounterAnimateIfInView, {\n threshold: 0.1,\n });\n\n private observeScrollTarget = () => {\n const target = this.scrollTargetElement;\n target && this.observer.observe(target);\n };\n\n private unobserveScrollTarget = () => {\n const target = this.scrollTargetElement;\n target && this.observer.unobserve(target);\n };\n\n get scrollTargetElement(): this | Element | null {\n if (this.scrollTarget) {\n return document.querySelector(this.scrollTarget);\n } else {\n return this;\n }\n }\n\n render() {\n return html`${Math.ceil(this.counter).toLocaleString()}`;\n }\n}\n\ncustomElements.get(\"animated-counter\") || customElements.define(\"animated-counter\", AnimatedCounter);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"animated-counter\": AnimatedCounter;\n }\n}\n","import { isAllHtmlElements } from \"./is-all-html-elements\";\n\n/**\n * Synchronize widths of elements\n * @param {Array<HTMLElement|null>} elements - Elements to synchronize\n */\nexport const syncElementWidths = (elements: Array<HTMLElement | null> | NodeList) => {\n const els = elements instanceof NodeList ? Array.from(elements) : elements;\n\n if (els.length === 0 || !isAllHtmlElements(els)) {\n return;\n }\n\n const widthSource = els.sort((a, b) => {\n const widthA = getComputedStyle(a).getPropertyValue(\"width\").replace(\"px\", \"\");\n const widthB = getComputedStyle(b).getPropertyValue(\"width\").replace(\"px\", \"\");\n return parseInt(widthB) - parseInt(widthA);\n })[0];\n\n const syncedWidth = getComputedStyle(widthSource).getPropertyValue(\"width\");\n\n for (const el of els) {\n if (getComputedStyle(el).getPropertyValue(\"width\") !== syncedWidth) {\n el.style[\"width\"] = syncedWidth;\n }\n }\n};\n","export const strings = {\n en: {\n cumulativeImpactTitle: () => `What we've funded`,\n cumulativeImpactDescription: () =>\n \"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day— scroll to check out the goals we're working toward together right now.\",\n },\n fr: {\n cumulativeImpactTitle: () => `Ce que nous avons financé`,\n cumulativeImpactDescription: () =>\n \"Voici l'impact que notre communauté a eu jusqu'à présent en partenariat avec Beam. Notre impact grandit chaque jour : faites défiler pour découvrir les objectifs vers lesquels nous travaillons ensemble en ce moment.\",\n },\n de: {\n cumulativeImpactTitle: () => `Was wir finanziert haben`,\n cumulativeImpactDescription: () =>\n \"Hier ist die Wirkung, die unsere Community bisher in Zusammenarbeit mit Beam erzielt hat. Unsere Wirkung wächst von Tag zu Tag - scrollen Sie, um einen Blick auf die Ziele zu werfen, auf die wir derzeit gemeinsam hinarbeiten.\",\n },\n es: {\n cumulativeImpactTitle: () => `Lo que hemos financiado`,\n cumulativeImpactDescription: () =>\n \"Este es el impacto que nuestra comunidad ha tenido hasta ahora en asociación con Beam. Nuestro impacto crece cada día; desplácese para ver los objetivos por los que estamos trabajando juntos en este momento.\",\n },\n it: {\n cumulativeImpactTitle: () => `Cosa abbiamo finanziato`,\n cumulativeImpactDescription: () =>\n \"Ecco l'impatto che la nostra comunità ha avuto finora in collaborazione con Beam. Il nostro impatto cresce ogni giorno: scorri per scoprire gli obiettivi a cui stiamo lavorando insieme in questo momento.\",\n },\n pl: {\n cumulativeImpactTitle: () => `Co sfinansowaliśmy`,\n cumulativeImpactDescription: () =>\n \"Oto wpływ, jaki nasza społeczność wywarła dotychczas we współpracy z Beam. Nasz wpływ rośnie z każdym dniem — przewiń, aby sprawdzić cele, nad którymi obecnie wspólnie pracujemy.\",\n },\n};\n","import { css, html, LitElement } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { queryAll } from \"lit/decorators/query-all.js\";\nimport debounce from \"lodash-es/debounce\";\nimport \"../../shared/components/animated-counter\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES } from \"../../api-sdk/constants\";\nimport { TNumericId } from \"../../shared/types\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { getCumulativeImpact } from \"../../api-sdk/v3/routes\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { BeamError, MissingConfig } from \"../../utils/beam-errors\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { _loading } from \"../../shared/fragments/loading-template\";\nimport { syncElementWidths } from \"../../shared/sync-element-widths\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { strings } from \"./strings\";\n\ntype RequiredConfig = {\n apiKey: string;\n chainId: TNumericId;\n};\n\ntype IAPIV3CumulativeImpact = Awaited<ReturnType<typeof getCumulativeImpact>>;\n\nconst MAX_COUNTER_ANIMATION_DURATION = 1.5 * 1000;\n\nexport class BeamCumulativeImpact extends LitElement {\n static tagName = \"beam-cumulative-impact\";\n\n @property({ type: String }) public apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) public chainId?: RequiredConfig[\"chainId\"];\n\n @property({ type: String }) public baseUrl = DEFAULT_BASE_URL;\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public disableAnimation = false;\n\n @property({ type: Boolean }) public debug = false;\n\n @property({ type: Boolean }) public draftConfig = false;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n private getCumulativeImpactData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"chainId\"], this)) {\n throw new MissingConfig();\n }\n const res = await getCumulativeImpact({\n baseUrl: this.baseUrl,\n pathParams: {\n chainId: this.chainId,\n },\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n queryParams: {\n version: \"1.0.0\",\n lang: this.configLang,\n draftConfig: this.draftConfig,\n },\n });\n\n return res;\n };\n\n private cumulativeImpactDataController = new AsyncController<typeof this.getCumulativeImpactData>(\n this,\n this.getCumulativeImpactData\n );\n\n @queryAll(\".impact-row-value-container\")\n impactRowRefs!: HTMLElement[];\n resizeElements = debounce(\n () => {\n syncElementWidths(this.impactRowRefs);\n },\n 50,\n { maxWait: 50, leading: true }\n );\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(\"resize\", this.resizeElements);\n }\n\n async updated(changedProperties: Map<string, unknown>) {\n // Reload nonprofit list on change of any of these props:\n // Also fires on first load as props go from undefined => value\n const requireNewDataProps = [\"chainId\", \"baseUrl\", \"lang\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.cumulativeImpactDataController.exec();\n break;\n }\n }\n\n this.resizeElements();\n }\n\n render() {\n const { data, error, loading } = this.cumulativeImpactDataController;\n if (loading) {\n return _loading();\n }\n if (error) {\n if (this.debug) {\n return _errorMessage({ error });\n }\n return \"\";\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new BeamError(\"Missing data\") });\n }\n return \"\";\n }\n\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div style=\"display: flex; flex-direction: column;\" class=\"root\">\n <div\n style=\"margin: 10px 0 0 0;\"\n tabindex=\"-1\"\n class=\"options\"\n part=\"options\"\n aria-labelledby=\"beam-RedeemTransaction-title\"\n >\n ${this.renderCumulativeImpact(data)}\n </div>\n </div>\n `;\n }\n\n private renderCumulativeImpact(data: IAPIV3CumulativeImpact) {\n const rawValues = data.impacts ? data.impacts?.map((impact) => impact.value || 0) : [];\n const maxRawValue = Math.max(...rawValues);\n const durations = rawValues.map(\n (val) => (MAX_COUNTER_ANIMATION_DURATION * Math.log(Math.max(val, 1))) / Math.log(maxRawValue)\n );\n return html`\n <div class=\"main\">\n <div class=\"title\" role=\"heading\">\n ${localizeUserString(this.configLang, data?.config?.web?.title || \"\") ||\n strings[this.configLang].cumulativeImpactTitle()}\n </div>\n <p class=\"description\">\n ${localizeUserString(this.configLang, data?.config?.web?.description || \"\") ||\n strings[this.configLang].cumulativeImpactDescription()}\n </p>\n <div class=\"impact-list\">\n ${data.impacts?.map((impact: any, idx: number) => {\n return this.renderCumulativeImpactRow({ impact, animationDuration: durations[idx] });\n })}\n </div>\n </div>\n `;\n }\n\n private renderCumulativeImpactRow({ impact, animationDuration }: { impact: any; animationDuration: number }) {\n const disableAnimation = this.cumulativeImpactDataController.data?.config?.web.disableAnimation;\n const floatingCounterClass = \"impact-row-value-counter impact-row-value-floating-counter\";\n const duration = disableAnimation ? 0 : animationDuration;\n\n const unitDisplay = localizeUserString(this.configLang, impact.unit || \"\");\n const summaryDisplay = localizeUserString(this.configLang, impact.summary || \"\");\n\n /**\n * because we set the width using JavaScript by forcing all impact-row-value-container elements\n * to match the width of the widest sibling, we use a hidden span with the total preloaded to\n * ensure that impact-row-value-container widths do not change as the animation runs.\n */\n return html`\n <div class=\"impact-row\">\n <div class=\"impact-row-value-container\">\n <span class=\"impact-row-value-counter\" style=\"visibility: hidden;\" aria-hidden=\"true\">\n ${impact.value.toLocaleString()}\n </span>\n <animated-counter\n class=\"${floatingCounterClass}\"\n finalValue=${impact.value}\n duration=${duration}\n ></animated-counter>\n </span>\n </div>\n <div class=\"impact-row-description\">${unitDisplay} ${summaryDisplay}</div>\n </div>\n `;\n }\n\n public get cssVariables() {\n const defaults: Record<string, string> = {\n \"--beam-fontFamily\": \"inherit\",\n \"--beam-fontStyle\": \"inherit\",\n \"--beam-fontSize\": \"16px\",\n \"--beam-lineHeight\": \"1\",\n \"--beam-textColor\": \"inherit\",\n // main\n ...defineCustomText(\"--beam-CumulativeImpact-title\", {\n fontSize: \"32px\",\n }),\n ...defineCustomText(\"--beam-CumulativeImpact-description\", {\n marginTop: \"16px\",\n lineHeight: \"1.3\",\n }),\n \"--beam-CumulativeImpact-impact-list-marginTop\": \"24px\",\n \"--beam-CumulativeImpact-row-marginTop\": \"24px\",\n // row value container\n \"--beam-CumulativeImpact-row-value-container-borderBottomWidth\": \"4px\",\n \"--beam-CumulativeImpact-row-value-container-borderBottomColor\": \"currentColor\",\n \"--beam-CumulativeImpact-row-value-container-paddingTop\": \"0\",\n \"--beam-CumulativeImpact-row-value-container-paddingRight\": \"20px\",\n \"--beam-CumulativeImpact-row-value-container-paddingBottom\": \"4px\",\n \"--beam-CumulativeImpact-row-value-container-paddingLeft\": \"20px\",\n // row value counter\n ...defineCustomText(\"--beam-CumulativeImpact-row-value-counter\", {\n color: \"currentColor\",\n fontSize: \"24px\",\n fontWeight: \"normal\",\n }),\n // row description\n ...defineCustomText(\"--beam-CumulativeImpact-row-description\", {\n color: \"currentColor\",\n fontSize: \"16px\",\n fontWeight: \"normal\",\n lineHeight: \"1.3\",\n }),\n \"--beam-CumulativeImpact-row-description-paddingLeft\": \"24px\",\n \"--beam-CumulativeImpact-row-description-paddingRight\": \"24px\",\n \"--beam-CumulativeImpact-row-description-mobile-marginTop\": \"12px\",\n };\n\n const remoteConfig = this.cumulativeImpactDataController.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n css`\n :host {\n display: block;\n font-family: var(--beam-fontFamily, inherit);\n font-style: var(--beam-fontStyle, inherit);\n font-size: var(--beam-fontSize, inherit);\n color: var(--beam-textColor, inherit);\n background-color: var(--beam-backgroundColor, inherit);\n line-height: var(--beam-lineHeight, 1);\n word-break: normal;\n }\n .main {\n text-align: left;\n }\n .title {\n ${useCustomText(\"--beam-CumulativeImpact-title\")}\n text-align: inherit;\n }\n .description {\n ${useCustomText(\"--beam-CumulativeImpact-description\")}\n text-align: inherit;\n }\n .impact-list {\n display: flex;\n flex-direction: column;\n margin-top: var(--beam-CumulativeImpact-impact-list-marginTop);\n }\n .impact-row {\n display: flex;\n align-items: center;\n margin-top: var(--beam-CumulativeImpact-row-marginTop);\n }\n .impact-row-value-container {\n position: relative;\n border-bottom-width: var(--beam-CumulativeImpact-row-value-container-borderBottomWidth);\n border-bottom-color: var(--beam-CumulativeImpact-row-value-container-borderBottomColor);\n border-bottom-style: solid;\n padding-top: var(--beam-CumulativeImpact-row-value-container-paddingTop);\n padding-right: var(--beam-CumulativeImpact-row-value-container-paddingRight);\n padding-bottom: var(--beam-CumulativeImpact-row-value-container-paddingBottom);\n padding-left: var(--beam-CumulativeImpact-row-value-container-paddingLeft);\n text-align: center;\n flex-shrink: 0;\n }\n .impact-row-value-counter {\n ${useCustomText(\"--beam-CumulativeImpact-row-value-counter\")}\n }\n .impact-row-value-floating-counter {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n }\n .impact-row-description {\n ${useCustomText(\"--beam-CumulativeImpact-row-description\")}\n padding-left: var(--beam-CumulativeImpact-row-description-paddingLeft);\n padding-right: var(--beam-CumulativeImpact-row-description-paddingRight);\n /* match padding of value of counter for proper centering */\n padding-bottom: var(--beam-CumulativeImpact-row-value-paddingBottom);\n text-align: inherit;\n flex-grow: 1;\n }\n @media (max-width: 500px) {\n .main {\n text-align: center;\n }\n .impact-row {\n flex-direction: column;\n }\n .impact-row-description {\n margin-top: var(--beam-CumulativeImpact-row-description-mobile-marginTop);\n padding-bottom: 0;\n }\n }\n `,\n ];\n}\n\ndefineCustomElement(BeamCumulativeImpact);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-cumulative-impact\": BeamCumulativeImpact;\n }\n}\n"],"names":["AnimatedCounter","LitElement","entries","entry","MS_PER_FRAME","COUNTER_INCREMENT_PER_FRAME","result","target","userPrefersReducedMotion","html","__decorateClass","property","state","syncElementWidths","elements","els","isAllHtmlElements","widthSource","a","b","widthA","widthB","syncedWidth","el","strings","f","r","s","m","e","MAX_COUNTER_ANIMATION_DURATION","BeamCumulativeImpact","DEFAULT_BASE_URL","enforceConfig","getCumulativeImpact","AsyncController","debounce","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","data","error","loading","_loading","_errorMessage","BeamError","rawValues","impact","maxRawValue","durations","val","localizeUserString","idx","animationDuration","disableAnimation","floatingCounterClass","duration","unitDisplay","summaryDisplay","defaults","defineCustomText","remoteConfig","config","_cssVariableMap","cssReset","css","useCustomText","queryAll","defineCustomElement"],"mappings":"stBAIaA,UAAwBC,CAAW,CAAzC,aAAA,CAAA,MAAA,GAAA,SAAA,EACuB,KAAa,WAAA,EACb,KAA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,GAhD5BrC,EAiDX,UAAA,eAAA,EAkQFsC,EAAoBtC,CAAoB"}
@@ -1,4 +1,4 @@
1
- import{t as C,h as b,y as u,g as c,f as y,p as I}from"../chunks/lit-iNN5L_Qk.esm.js";import{d as x}from"../chunks/lodash-P8OIs-at.esm.js";import{c as T,d as S,e as E}from"../chunks/enforce-config-S8EGgEnO.esm.js";import{u as p,A as z,_ as f,i as d,d as v,a as B}from"../chunks/localize-OiRewTgu.esm.js";import{D,k,S as L}from"../chunks/routes-YPOoVIR2.esm.js";import{B as $}from"../chunks/beam-errors-AMvTvR1C.esm.js";import{_ as V}from"../chunks/loading-template-t4fFsYtr.esm.js";import{i as A}from"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../utils/logger.js";var j=Object.defineProperty,R=Object.getOwnPropertyDescriptor,h=(s,e,t,a)=>{for(var i=a>1?void 0:a?R(e,t):e,o=s.length-1,r;o>=0;o--)(r=s[o])&&(i=(a?r(e,t,i):r(i))||i);return a&&i&&j(e,t,i),i};class m extends b{constructor(){super(...arguments),this.finalValue=0,this.duration=1500,this.counter=0,this.intervalId=0,this.handleCounterAnimateIfInView=e=>{e.some(t=>t.isIntersecting)&&(this.animateCounter(),this.unobserveScrollTarget())},this.animateCounter=()=>{const e=41.666666666666664,t=e/this.duration*this.finalValue;this.intervalId=setInterval(()=>{const a=this.counter+t;if(a>=this.finalValue){this.counter=this.finalValue,clearInterval(this.intervalId);return}else this.counter=a},e)},this.observer=new IntersectionObserver(this.handleCounterAnimateIfInView,{threshold:.1}),this.observeScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.observe(e)},this.unobserveScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.unobserve(e)}}connectedCallback(){super.connectedCallback();const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.duration===0||e?this.counter=this.finalValue:this.observeScrollTarget()}disconnectedCallback(){super.disconnectedCallback(),this.unobserveScrollTarget(),clearInterval(this.intervalId)}get scrollTargetElement(){return this.scrollTarget?document.querySelector(this.scrollTarget):this}render(){return u`${Math.ceil(this.counter).toLocaleString()}`}}h([c({type:Number})],m.prototype,"finalValue",2),h([c({type:Number})],m.prototype,"duration",2),h([c({type:String})],m.prototype,"scrollTarget",2),h([C()],m.prototype,"counter",2),customElements.get("animated-counter")||customElements.define("animated-counter",m);const O=s=>{const e=s instanceof NodeList?Array.from(s):s;if(e.length===0||!A(e))return;const t=e.sort((i,o)=>{const r=getComputedStyle(i).getPropertyValue("width").replace("px",""),g=getComputedStyle(o).getPropertyValue("width").replace("px","");return parseInt(g)-parseInt(r)})[0],a=getComputedStyle(t).getPropertyValue("width");for(const i of e)getComputedStyle(i).getPropertyValue("width")!==a&&(i.style.width=a)},w={en:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."},fr:{cumulativeImpactTitle:()=>"Ce que nous avons financ\xE9",cumulativeImpactDescription:()=>"Voici l'impact que notre communaut\xE9 a eu jusqu'\xE0 pr\xE9sent en partenariat avec Beam. Notre impact grandit chaque jour : faites d\xE9filer pour d\xE9couvrir les objectifs vers lesquels nous travaillons ensemble en ce moment."},de:{cumulativeImpactTitle:()=>"Was wir finanziert haben",cumulativeImpactDescription:()=>"Hier ist die Wirkung, die unsere Community bisher in Zusammenarbeit mit Beam erzielt hat. Unsere Wirkung w\xE4chst von Tag zu Tag - scrollen Sie, um einen Blick auf die Ziele zu werfen, auf die wir derzeit gemeinsam hinarbeiten."},es:{cumulativeImpactTitle:()=>"Lo que hemos financiado",cumulativeImpactDescription:()=>"Este es el impacto que nuestra comunidad ha tenido hasta ahora en asociaci\xF3n con Beam. Nuestro impacto crece cada d\xEDa; despl\xE1cese para ver los objetivos por los que estamos trabajando juntos en este momento."},it:{cumulativeImpactTitle:()=>"Cosa abbiamo finanziato",cumulativeImpactDescription:()=>"Ecco l'impatto che la nostra comunit\xE0 ha avuto finora in collaborazione con Beam. Il nostro impatto cresce ogni giorno: scorri per scoprire gli obiettivi a cui stiamo lavorando insieme in questo momento."},pl:{cumulativeImpactTitle:()=>"Co sfinansowali\u015Bmy",cumulativeImpactDescription:()=>"Oto wp\u0142yw, jaki nasza spo\u0142eczno\u015B\u0107 wywar\u0142a dotychczas we wsp\xF3\u0142pracy z Beam. Nasz wp\u0142yw ro\u015Bnie z ka\u017Cdym dniem \u2014 przewi\u0144, aby sprawdzi\u0107 cele, nad kt\xF3rymi obecnie wsp\xF3lnie pracujemy."}};var P=Object.defineProperty,q=Object.getOwnPropertyDescriptor,l=(s,e,t,a)=>{for(var i=a>1?void 0:a?q(e,t):e,o=s.length-1,r;o>=0;o--)(r=s[o])&&(i=(a?r(e,t,i):r(i))||i);return a&&i&&P(e,t,i),i};const U=1.5*1e3;class n extends b{constructor(){super(...arguments),this.baseUrl=D,this.lang="en",this.disableAnimation=!1,this.debug=!1,this.draftConfig=!1,this.getCumulativeImpactData=async()=>(E(["apiKey","chainId"],this),await k({baseUrl:this.baseUrl,pathParams:{chainId:this.chainId},headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.cumulativeImpactDataController=new z(this,this.getCumulativeImpactData),this.resizeElements=x(()=>{O(this.impactRowRefs)},50,{maxWait:50,leading:!0})}get configLang(){return L[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const t=["chainId","baseUrl","lang"];for(const a of t)if(e.has(a)){await this.cumulativeImpactDataController.exec();break}this.resizeElements()}render(){const{data:e,error:t,loading:a}=this.cumulativeImpactDataController;return a?V():t?this.debug?f({error:t}):"":e==null?this.debug?f({error:new $("Missing data")}):"":u`
1
+ import{t as C,h as b,y as u,g as l,f as y,p as I}from"../chunks/lit-WqMxC_PA.esm.js";import{d as x}from"../chunks/lodash-7H4x2457.esm.js";import{c as T,d as S,e as E}from"../chunks/enforce-config-Ba1JkOHs.esm.js";import{u as p,A as z,_ as f,i as d,d as v,a as B}from"../chunks/localize-C25pEGnx.esm.js";import{D as k,k as D,S as L}from"../chunks/routes-CAhDCFDX.esm.js";import{B as $}from"../chunks/beam-errors-Ci0d3926.esm.js";import{_ as V}from"../chunks/loading-template-DG4lkIIc.esm.js";import{i as A}from"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../utils/logger.js";var R=Object.defineProperty,h=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&R(e,t,a),a};class c extends b{constructor(){super(...arguments),this.finalValue=0,this.duration=1500,this.counter=0,this.intervalId=0,this.handleCounterAnimateIfInView=e=>{e.some(t=>t.isIntersecting)&&(this.animateCounter(),this.unobserveScrollTarget())},this.animateCounter=()=>{const e=41.666666666666664,t=e/this.duration*this.finalValue;this.intervalId=setInterval(()=>{const i=this.counter+t;if(i>=this.finalValue){this.counter=this.finalValue,clearInterval(this.intervalId);return}else this.counter=i},e)},this.observer=new IntersectionObserver(this.handleCounterAnimateIfInView,{threshold:.1}),this.observeScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.observe(e)},this.unobserveScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.unobserve(e)}}connectedCallback(){super.connectedCallback();const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.duration===0||e?this.counter=this.finalValue:this.observeScrollTarget()}disconnectedCallback(){super.disconnectedCallback(),this.unobserveScrollTarget(),clearInterval(this.intervalId)}get scrollTargetElement(){return this.scrollTarget?document.querySelector(this.scrollTarget):this}render(){return u`${Math.ceil(this.counter).toLocaleString()}`}}h([l({type:Number})],c.prototype,"finalValue"),h([l({type:Number})],c.prototype,"duration"),h([l({type:String})],c.prototype,"scrollTarget"),h([C()],c.prototype,"counter"),customElements.get("animated-counter")||customElements.define("animated-counter",c);const j=n=>{const e=n instanceof NodeList?Array.from(n):n;if(e.length===0||!A(e))return;const t=e.sort((a,o)=>{const s=getComputedStyle(a).getPropertyValue("width").replace("px",""),g=getComputedStyle(o).getPropertyValue("width").replace("px","");return parseInt(g)-parseInt(s)})[0],i=getComputedStyle(t).getPropertyValue("width");for(const a of e)getComputedStyle(a).getPropertyValue("width")!==i&&(a.style.width=i)},w={en:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."},fr:{cumulativeImpactTitle:()=>"Ce que nous avons financ\xE9",cumulativeImpactDescription:()=>"Voici l'impact que notre communaut\xE9 a eu jusqu'\xE0 pr\xE9sent en partenariat avec Beam. Notre impact grandit chaque jour : faites d\xE9filer pour d\xE9couvrir les objectifs vers lesquels nous travaillons ensemble en ce moment."},de:{cumulativeImpactTitle:()=>"Was wir finanziert haben",cumulativeImpactDescription:()=>"Hier ist die Wirkung, die unsere Community bisher in Zusammenarbeit mit Beam erzielt hat. Unsere Wirkung w\xE4chst von Tag zu Tag - scrollen Sie, um einen Blick auf die Ziele zu werfen, auf die wir derzeit gemeinsam hinarbeiten."},es:{cumulativeImpactTitle:()=>"Lo que hemos financiado",cumulativeImpactDescription:()=>"Este es el impacto que nuestra comunidad ha tenido hasta ahora en asociaci\xF3n con Beam. Nuestro impacto crece cada d\xEDa; despl\xE1cese para ver los objetivos por los que estamos trabajando juntos en este momento."},it:{cumulativeImpactTitle:()=>"Cosa abbiamo finanziato",cumulativeImpactDescription:()=>"Ecco l'impatto che la nostra comunit\xE0 ha avuto finora in collaborazione con Beam. Il nostro impatto cresce ogni giorno: scorri per scoprire gli obiettivi a cui stiamo lavorando insieme in questo momento."},pl:{cumulativeImpactTitle:()=>"Co sfinansowali\u015Bmy",cumulativeImpactDescription:()=>"Oto wp\u0142yw, jaki nasza spo\u0142eczno\u015B\u0107 wywar\u0142a dotychczas we wsp\xF3\u0142pracy z Beam. Nasz wp\u0142yw ro\u015Bnie z ka\u017Cdym dniem \u2014 przewi\u0144, aby sprawdzi\u0107 cele, nad kt\xF3rymi obecnie wsp\xF3lnie pracujemy."}};var q=Object.defineProperty,m=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&q(e,t,a),a};const U=1.5*1e3;class r extends b{constructor(){super(...arguments),this.baseUrl=k,this.lang="en",this.disableAnimation=!1,this.debug=!1,this.draftConfig=!1,this.getCumulativeImpactData=async()=>(E(["apiKey","chainId"],this),await D({baseUrl:this.baseUrl,pathParams:{chainId:this.chainId},headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.cumulativeImpactDataController=new z(this,this.getCumulativeImpactData),this.resizeElements=x(()=>{j(this.impactRowRefs)},50,{maxWait:50,leading:!0})}get configLang(){return L[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const t=["chainId","baseUrl","lang"];for(const i of t)if(e.has(i)){await this.cumulativeImpactDataController.exec();break}this.resizeElements()}render(){const{data:e,error:t,loading:i}=this.cumulativeImpactDataController;return i?V():t?this.debug?f({error:t}):"":e==null?this.debug?f({error:new $("Missing data")}):"":u`
2
2
  <style>
3
3
  :host {
4
4
  ${this.cssVariables.toCSS()}
@@ -15,7 +15,7 @@ import{t as C,h as b,y as u,g as c,f as y,p as I}from"../chunks/lit-iNN5L_Qk.esm
15
15
  ${this.renderCumulativeImpact(e)}
16
16
  </div>
17
17
  </div>
18
- `}renderCumulativeImpact(e){const t=e.impacts?e.impacts?.map(o=>o.value||0):[],a=Math.max(...t),i=t.map(o=>U*Math.log(Math.max(o,1))/Math.log(a));return u`
18
+ `}renderCumulativeImpact(e){const t=e.impacts?e.impacts?.map(o=>o.value||0):[],i=Math.max(...t),a=t.map(o=>U*Math.log(Math.max(o,1))/Math.log(i));return u`
19
19
  <div class="main">
20
20
  <div class="title" role="heading">
21
21
  ${d(this.configLang,e?.config?.web?.title||"")||w[this.configLang].cumulativeImpactTitle()}
@@ -24,25 +24,25 @@ import{t as C,h as b,y as u,g as c,f as y,p as I}from"../chunks/lit-iNN5L_Qk.esm
24
24
  ${d(this.configLang,e?.config?.web?.description||"")||w[this.configLang].cumulativeImpactDescription()}
25
25
  </p>
26
26
  <div class="impact-list">
27
- ${e.impacts?.map((o,r)=>this.renderCumulativeImpactRow({impact:o,animationDuration:i[r]}))}
27
+ ${e.impacts?.map((o,s)=>this.renderCumulativeImpactRow({impact:o,animationDuration:a[s]}))}
28
28
  </div>
29
29
  </div>
30
- `}renderCumulativeImpactRow({impact:e,animationDuration:t}){const a=this.cumulativeImpactDataController.data?.config?.web.disableAnimation,i="impact-row-value-counter impact-row-value-floating-counter",o=a?0:t,r=d(this.configLang,e.unit||""),g=d(this.configLang,e.summary||"");return u`
30
+ `}renderCumulativeImpactRow({impact:e,animationDuration:t}){const i=this.cumulativeImpactDataController.data?.config?.web.disableAnimation,a="impact-row-value-counter impact-row-value-floating-counter",o=i?0:t,s=d(this.configLang,e.unit||""),g=d(this.configLang,e.summary||"");return u`
31
31
  <div class="impact-row">
32
32
  <div class="impact-row-value-container">
33
33
  <span class="impact-row-value-counter" style="visibility: hidden;" aria-hidden="true">
34
34
  ${e.value.toLocaleString()}
35
35
  </span>
36
36
  <animated-counter
37
- class="${i}"
37
+ class="${a}"
38
38
  finalValue=${e.value}
39
39
  duration=${o}
40
40
  ></animated-counter>
41
41
  </span>
42
42
  </div>
43
- <div class="impact-row-description">${r} ${g}</div>
43
+ <div class="impact-row-description">${s} ${g}</div>
44
44
  </div>
45
- `}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"16px","--beam-lineHeight":"1","--beam-textColor":"inherit",...v("--beam-CumulativeImpact-title",{fontSize:"32px"}),...v("--beam-CumulativeImpact-description",{marginTop:"16px",lineHeight:"1.3"}),"--beam-CumulativeImpact-impact-list-marginTop":"24px","--beam-CumulativeImpact-row-marginTop":"24px","--beam-CumulativeImpact-row-value-container-borderBottomWidth":"4px","--beam-CumulativeImpact-row-value-container-borderBottomColor":"currentColor","--beam-CumulativeImpact-row-value-container-paddingTop":"0","--beam-CumulativeImpact-row-value-container-paddingRight":"20px","--beam-CumulativeImpact-row-value-container-paddingBottom":"4px","--beam-CumulativeImpact-row-value-container-paddingLeft":"20px",...v("--beam-CumulativeImpact-row-value-counter",{color:"currentColor",fontSize:"24px",fontWeight:"normal"}),...v("--beam-CumulativeImpact-row-description",{color:"currentColor",fontSize:"16px",fontWeight:"normal",lineHeight:"1.3"}),"--beam-CumulativeImpact-row-description-paddingLeft":"24px","--beam-CumulativeImpact-row-description-paddingRight":"24px","--beam-CumulativeImpact-row-description-mobile-marginTop":"12px"},t=this.cumulativeImpactDataController.data?.config?.web?.theme||{},a={...e,...t};return Object.assign(Object.create({toCSS(){return B(this)}}),a)}}n.tagName="beam-cumulative-impact",n.styles=[T,y`
45
+ `}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"16px","--beam-lineHeight":"1","--beam-textColor":"inherit",...v("--beam-CumulativeImpact-title",{fontSize:"32px"}),...v("--beam-CumulativeImpact-description",{marginTop:"16px",lineHeight:"1.3"}),"--beam-CumulativeImpact-impact-list-marginTop":"24px","--beam-CumulativeImpact-row-marginTop":"24px","--beam-CumulativeImpact-row-value-container-borderBottomWidth":"4px","--beam-CumulativeImpact-row-value-container-borderBottomColor":"currentColor","--beam-CumulativeImpact-row-value-container-paddingTop":"0","--beam-CumulativeImpact-row-value-container-paddingRight":"20px","--beam-CumulativeImpact-row-value-container-paddingBottom":"4px","--beam-CumulativeImpact-row-value-container-paddingLeft":"20px",...v("--beam-CumulativeImpact-row-value-counter",{color:"currentColor",fontSize:"24px",fontWeight:"normal"}),...v("--beam-CumulativeImpact-row-description",{color:"currentColor",fontSize:"16px",fontWeight:"normal",lineHeight:"1.3"}),"--beam-CumulativeImpact-row-description-paddingLeft":"24px","--beam-CumulativeImpact-row-description-paddingRight":"24px","--beam-CumulativeImpact-row-description-mobile-marginTop":"12px"},t=this.cumulativeImpactDataController.data?.config?.web?.theme||{},i={...e,...t};return Object.assign(Object.create({toCSS(){return B(this)}}),i)}}r.tagName="beam-cumulative-impact",r.styles=[T,y`
46
46
  :host {
47
47
  display: block;
48
48
  font-family: var(--beam-fontFamily, inherit);
@@ -117,5 +117,5 @@ import{t as C,h as b,y as u,g as c,f as y,p as I}from"../chunks/lit-iNN5L_Qk.esm
117
117
  padding-bottom: 0;
118
118
  }
119
119
  }
120
- `],l([c({type:String})],n.prototype,"apiKey",2),l([c({type:Number})],n.prototype,"chainId",2),l([c({type:String})],n.prototype,"baseUrl",2),l([c({type:String})],n.prototype,"lang",2),l([c({type:Boolean})],n.prototype,"disableAnimation",2),l([c({type:Boolean})],n.prototype,"debug",2),l([c({type:Boolean})],n.prototype,"draftConfig",2),l([I(".impact-row-value-container")],n.prototype,"impactRowRefs",2),S(n);export{n as BeamCumulativeImpact};
120
+ `],m([l({type:String})],r.prototype,"apiKey"),m([l({type:Number})],r.prototype,"chainId"),m([l({type:String})],r.prototype,"baseUrl"),m([l({type:String})],r.prototype,"lang"),m([l({type:Boolean})],r.prototype,"disableAnimation"),m([l({type:Boolean})],r.prototype,"debug"),m([l({type:Boolean})],r.prototype,"draftConfig"),m([I(".impact-row-value-container")],r.prototype,"impactRowRefs"),S(r);export{r as BeamCumulativeImpact};
121
121
  //# sourceMappingURL=cumulative-impact.js.map