@beamimpact/web-sdk 1.36.6 → 1.36.8

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 (225) hide show
  1. package/dist/chunks/_share-dialog-dependencies-FglfQ7YP.esm.js +2 -0
  2. package/dist/chunks/_share-dialog-dependencies-FglfQ7YP.esm.js.map +1 -0
  3. package/dist/chunks/_share-dialog-dependencies-YbNiVx56.esm.js +2 -0
  4. package/dist/chunks/_share-dialog-dependencies-YbNiVx56.esm.js.map +1 -0
  5. package/dist/chunks/beam-errors-P-Lu07Ce.esm.js +2 -0
  6. package/dist/chunks/beam-errors-P-Lu07Ce.esm.js.map +1 -0
  7. package/dist/chunks/{beam-errors-bKCZlkvr.esm.d.ts → beam-errors-fXDkG1zo.esm.d.ts} +7 -2
  8. package/dist/chunks/{cart-contents-tEvcY9ip.esm.d.ts → cart-contents-Shc27L1J.esm.d.ts} +1 -1
  9. package/dist/chunks/enforce-config-fo8kIfoY.esm.js +22 -0
  10. package/dist/chunks/enforce-config-fo8kIfoY.esm.js.map +1 -0
  11. package/dist/chunks/enforce-config-qna7hEL6.esm.js +22 -0
  12. package/dist/chunks/enforce-config-qna7hEL6.esm.js.map +1 -0
  13. package/dist/chunks/{events-PZnG_xac.esm.d.ts → events-qTu4iIOo.esm.d.ts} +1 -1
  14. package/dist/chunks/index-1qXot92e.esm.js +2 -0
  15. package/dist/chunks/index-1qXot92e.esm.js.map +1 -0
  16. package/dist/chunks/{index-hbzssC4x.esm.d.ts → index-3Xf6QzNV.esm.d.ts} +1 -1
  17. package/dist/chunks/{index-aGYbEHXq.esm.js → index-5yFqo0yl.esm.js} +2 -2
  18. package/dist/chunks/index-5yFqo0yl.esm.js.map +1 -0
  19. package/dist/chunks/{index-G6h0AEAz.esm.d.ts → index-6t9MtjyS.esm.d.ts} +3 -1
  20. package/dist/chunks/{index-FAF7tYU6.esm.js → index-9gijHGwh.esm.js} +2 -2
  21. package/dist/chunks/index-9gijHGwh.esm.js.map +1 -0
  22. package/dist/chunks/{index-JL12lEnO.esm.js → index-EHubF2KN.esm.js} +2 -2
  23. package/dist/chunks/index-EHubF2KN.esm.js.map +1 -0
  24. package/dist/chunks/{index-rOz-i1aX.esm.d.ts → index-EZ_Bg1n7.esm.d.ts} +4 -4
  25. package/dist/chunks/index-EpanGShY.esm.js +2 -0
  26. package/dist/chunks/index-EpanGShY.esm.js.map +1 -0
  27. package/dist/chunks/{index-U2dW3lkm.esm.d.ts → index-GkPHba-I.esm.d.ts} +2 -2
  28. package/dist/chunks/{index-5-EnaNnJ.esm.d.ts → index-I8DBdgx0.esm.d.ts} +1 -1
  29. package/dist/chunks/index-IzAvjker.esm.js +2 -0
  30. package/dist/chunks/index-IzAvjker.esm.js.map +1 -0
  31. package/dist/chunks/{index-uqEAgdEf.esm.js → index-OnjTwvAw.esm.js} +2 -2
  32. package/dist/chunks/index-OnjTwvAw.esm.js.map +1 -0
  33. package/dist/chunks/{index-rrdYIcOi.esm.js → index-U8Oy2aur.esm.js} +2 -2
  34. package/dist/chunks/index-U8Oy2aur.esm.js.map +1 -0
  35. package/dist/chunks/index-XMD0b6ql.esm.js +2 -0
  36. package/dist/chunks/index-XMD0b6ql.esm.js.map +1 -0
  37. package/dist/chunks/{index-e6o8bmIt.esm.js → index-fqDBrscF.esm.js} +2 -2
  38. package/dist/chunks/{index-e6o8bmIt.esm.js.map → index-fqDBrscF.esm.js.map} +1 -1
  39. package/dist/chunks/{index-JfA-djTR.esm.js → index-gULINFkH.esm.js} +2 -2
  40. package/dist/chunks/{index-JfA-djTR.esm.js.map → index-gULINFkH.esm.js.map} +1 -1
  41. package/dist/chunks/index-ll8zLjbu.esm.js +2 -0
  42. package/dist/chunks/index-ll8zLjbu.esm.js.map +1 -0
  43. package/dist/chunks/index-o7YiP4gC.esm.js +2 -0
  44. package/dist/chunks/index-o7YiP4gC.esm.js.map +1 -0
  45. package/dist/chunks/{index--eKbxy32.esm.d.ts → index-oLz4lmx2.esm.d.ts} +3 -1
  46. package/dist/chunks/{index-PL4iasT1.esm.d.ts → index-pDraUd1x.esm.d.ts} +2 -2
  47. package/dist/chunks/index-r9Yb1UY4.esm.js +2 -0
  48. package/dist/chunks/index-r9Yb1UY4.esm.js.map +1 -0
  49. package/dist/chunks/index-t4uX5Dg1.esm.js +2 -0
  50. package/dist/chunks/index-t4uX5Dg1.esm.js.map +1 -0
  51. package/dist/chunks/{index-nJEBkWPL.esm.d.ts → index-wbrSi6cp.esm.d.ts} +1 -1
  52. package/dist/chunks/{index-w9_XpjIg.esm.js → index-wsdeaTHd.esm.js} +2 -2
  53. package/dist/chunks/index-wsdeaTHd.esm.js.map +1 -0
  54. package/dist/chunks/localize-GCkVUD8S.esm.js +10 -0
  55. package/dist/chunks/localize-GCkVUD8S.esm.js.map +1 -0
  56. package/dist/chunks/localize-pzAAkBvG.esm.js +10 -0
  57. package/dist/chunks/localize-pzAAkBvG.esm.js.map +1 -0
  58. package/dist/chunks/{openapi-spec-tJkr2i9K.esm.d.ts → openapi-spec-D_Zzbl2J.esm.d.ts} +215 -5
  59. package/dist/chunks/{order-page-LMEdbSdq.esm.js → order-page-JdaAppB7.esm.js} +2 -2
  60. package/dist/chunks/{order-page-LMEdbSdq.esm.js.map → order-page-JdaAppB7.esm.js.map} +1 -1
  61. package/dist/chunks/{order-page-sDLRWj-E.esm.js → order-page-W1jR35W9.esm.js} +2 -2
  62. package/dist/chunks/{order-page-sDLRWj-E.esm.js.map → order-page-W1jR35W9.esm.js.map} +1 -1
  63. package/dist/chunks/{order-page-cFAaDNWE.esm.d.ts → order-page-ydw5uXTI.esm.d.ts} +21 -2
  64. package/dist/chunks/routes-CqjzL4oL.esm.js +2 -0
  65. package/dist/chunks/{routes-bWWE2fXp.esm.js.map → routes-CqjzL4oL.esm.js.map} +1 -1
  66. package/dist/chunks/routes-lsOWIDmE.esm.js +2 -0
  67. package/dist/chunks/{routes-h6eWTToy.esm.js.map → routes-lsOWIDmE.esm.js.map} +1 -1
  68. package/dist/chunks/{update-cart-k_Y-sCyt.esm.js → update-cart-T32-282v.esm.js} +2 -2
  69. package/dist/chunks/{update-cart-k_Y-sCyt.esm.js.map → update-cart-T32-282v.esm.js.map} +1 -1
  70. package/dist/chunks/{update-cart-m3NdnSx2.esm.d.ts → update-cart-yCIzgmve.esm.d.ts} +1 -1
  71. package/dist/chunks/{update-cart-PflL_pK3.esm.js → update-cart-yneR8zk1.esm.js} +2 -2
  72. package/dist/chunks/{update-cart-PflL_pK3.esm.js.map → update-cart-yneR8zk1.esm.js.map} +1 -1
  73. package/dist/components/community-impact.esm.js +5 -4
  74. package/dist/components/community-impact.esm.js.map +1 -1
  75. package/dist/components/community-impact.js +5 -4
  76. package/dist/components/community-impact.js.map +1 -1
  77. package/dist/components/cumulative-impact.esm.js +3 -2
  78. package/dist/components/cumulative-impact.esm.js.map +1 -1
  79. package/dist/components/cumulative-impact.js +3 -2
  80. package/dist/components/cumulative-impact.js.map +1 -1
  81. package/dist/components/impact-overview.d.ts +0 -2
  82. package/dist/components/impact-overview.esm.js +6 -5
  83. package/dist/components/impact-overview.esm.js.map +1 -1
  84. package/dist/components/impact-overview.js +6 -5
  85. package/dist/components/impact-overview.js.map +1 -1
  86. package/dist/components/index.d.ts +3 -2
  87. package/dist/components/index.esm.js +1 -1
  88. package/dist/components/index.js +1 -1
  89. package/dist/components/post-purchase.d.ts +3 -4
  90. package/dist/components/post-purchase.esm.js +4 -5
  91. package/dist/components/post-purchase.esm.js.map +1 -1
  92. package/dist/components/post-purchase.js +4 -5
  93. package/dist/components/post-purchase.js.map +1 -1
  94. package/dist/components/redeem-transaction.d.ts +16 -6
  95. package/dist/components/redeem-transaction.esm.js +12 -11
  96. package/dist/components/redeem-transaction.esm.js.map +1 -1
  97. package/dist/components/redeem-transaction.js +12 -11
  98. package/dist/components/redeem-transaction.js.map +1 -1
  99. package/dist/components/select-nonprofit.d.ts +3 -3
  100. package/dist/components/select-nonprofit.esm.js +2 -1
  101. package/dist/components/select-nonprofit.esm.js.map +1 -1
  102. package/dist/components/select-nonprofit.js +2 -1
  103. package/dist/components/select-nonprofit.js.map +1 -1
  104. package/dist/components/shopify.d.ts +6 -6
  105. package/dist/components/shopify.esm.js +1 -1
  106. package/dist/components/shopify.esm.js.map +1 -1
  107. package/dist/components/shopify.js +1 -1
  108. package/dist/components/shopify.js.map +1 -1
  109. package/dist/components/subscription-management.d.ts +114 -0
  110. package/dist/components/subscription-management.esm.js +62 -0
  111. package/dist/components/subscription-management.esm.js.map +1 -0
  112. package/dist/components/subscription-management.js +62 -0
  113. package/dist/components/subscription-management.js.map +1 -0
  114. package/dist/index.d.ts +16 -14
  115. package/dist/index.esm.js +1 -1
  116. package/dist/index.js +1 -1
  117. package/dist/integrations/beam.esm.js +1 -1
  118. package/dist/integrations/beam.js +1 -1
  119. package/dist/integrations/cart.d.ts +3 -3
  120. package/dist/integrations/cart.esm.js +1 -1
  121. package/dist/integrations/cart.js +1 -1
  122. package/dist/integrations/index.d.ts +10 -10
  123. package/dist/integrations/index.esm.js +1 -1
  124. package/dist/integrations/index.js +1 -1
  125. package/dist/integrations/logs.d.ts +2 -2
  126. package/dist/integrations/logs.esm.js +1 -1
  127. package/dist/integrations/logs.js +1 -1
  128. package/dist/integrations/session.esm.js +1 -1
  129. package/dist/integrations/session.js +1 -1
  130. package/dist/integrations/shopify.d.ts +4 -4
  131. package/dist/integrations/shopify.esm.js +1 -1
  132. package/dist/integrations/shopify.js +1 -1
  133. package/dist/integrations/statsig.esm.js +1 -1
  134. package/dist/integrations/statsig.js +1 -1
  135. package/dist/integrations/utils.d.ts +4 -4
  136. package/dist/integrations/utils.esm.js +1 -1
  137. package/dist/integrations/utils.js +1 -1
  138. package/dist/react/community-impact.esm.js +1 -1
  139. package/dist/react/community-impact.esm.js.map +1 -1
  140. package/dist/react/community-impact.js +1 -1
  141. package/dist/react/community-impact.js.map +1 -1
  142. package/dist/react/cumulative-impact.esm.js +1 -1
  143. package/dist/react/cumulative-impact.esm.js.map +1 -1
  144. package/dist/react/cumulative-impact.js +1 -1
  145. package/dist/react/cumulative-impact.js.map +1 -1
  146. package/dist/react/impact-overview.esm.js +1 -1
  147. package/dist/react/impact-overview.esm.js.map +1 -1
  148. package/dist/react/impact-overview.js +1 -1
  149. package/dist/react/impact-overview.js.map +1 -1
  150. package/dist/react/index.d.ts +5 -3
  151. package/dist/react/index.esm.js +1 -1
  152. package/dist/react/index.js +1 -1
  153. package/dist/react/post-purchase.d.ts +2 -2
  154. package/dist/react/post-purchase.esm.js +1 -1
  155. package/dist/react/post-purchase.esm.js.map +1 -1
  156. package/dist/react/post-purchase.js +1 -1
  157. package/dist/react/post-purchase.js.map +1 -1
  158. package/dist/react/redeem-transaction.d.ts +3 -3
  159. package/dist/react/redeem-transaction.esm.js +1 -1
  160. package/dist/react/redeem-transaction.esm.js.map +1 -1
  161. package/dist/react/redeem-transaction.js +1 -1
  162. package/dist/react/redeem-transaction.js.map +1 -1
  163. package/dist/react/select-nonprofit.d.ts +3 -3
  164. package/dist/react/select-nonprofit.esm.js +1 -1
  165. package/dist/react/select-nonprofit.esm.js.map +1 -1
  166. package/dist/react/select-nonprofit.js +1 -1
  167. package/dist/react/select-nonprofit.js.map +1 -1
  168. package/dist/react/subscription-management.d.ts +11 -0
  169. package/dist/react/subscription-management.esm.js +2 -0
  170. package/dist/react/subscription-management.esm.js.map +1 -0
  171. package/dist/react/subscription-management.js +2 -0
  172. package/dist/react/subscription-management.js.map +1 -0
  173. package/dist/utils/beam-errors.d.ts +1 -1
  174. package/dist/utils/beam-errors.esm.js +1 -1
  175. package/dist/utils/beam-errors.js +1 -1
  176. package/dist/utils/cookies.d.ts +1 -1
  177. package/dist/utils/cookies.esm.js +1 -1
  178. package/dist/utils/cookies.esm.js.map +1 -1
  179. package/dist/utils/cookies.js +1 -1
  180. package/dist/utils/cookies.js.map +1 -1
  181. package/dist/utils/events.d.ts +3 -3
  182. package/dist/utils/index.d.ts +4 -4
  183. package/dist/utils/index.esm.js +1 -1
  184. package/dist/utils/index.js +1 -1
  185. package/dist/utils/local-storage.esm.js +1 -1
  186. package/dist/utils/local-storage.js +1 -1
  187. package/dist/utils/remote-session.esm.js +1 -1
  188. package/dist/utils/remote-session.js +1 -1
  189. package/dist/utils/wait-for-element.esm.js +1 -1
  190. package/dist/utils/wait-for-element.js +1 -1
  191. package/package.json +2 -2
  192. package/dist/chunks/_share-dialog-dependencies-7OysCcbl.esm.js +0 -2
  193. package/dist/chunks/_share-dialog-dependencies-7OysCcbl.esm.js.map +0 -1
  194. package/dist/chunks/_share-dialog-dependencies-IH8H0M7S.esm.js +0 -2
  195. package/dist/chunks/_share-dialog-dependencies-IH8H0M7S.esm.js.map +0 -1
  196. package/dist/chunks/beam-errors-AMvTvR1C.esm.js +0 -2
  197. package/dist/chunks/beam-errors-AMvTvR1C.esm.js.map +0 -1
  198. package/dist/chunks/index-D7cyvlBG.esm.js +0 -2
  199. package/dist/chunks/index-D7cyvlBG.esm.js.map +0 -1
  200. package/dist/chunks/index-FAF7tYU6.esm.js.map +0 -1
  201. package/dist/chunks/index-Fvk8qalO.esm.js +0 -2
  202. package/dist/chunks/index-Fvk8qalO.esm.js.map +0 -1
  203. package/dist/chunks/index-JL12lEnO.esm.js.map +0 -1
  204. package/dist/chunks/index-K9rDxqim.esm.js +0 -2
  205. package/dist/chunks/index-K9rDxqim.esm.js.map +0 -1
  206. package/dist/chunks/index-LY8cCwxB.esm.js +0 -2
  207. package/dist/chunks/index-LY8cCwxB.esm.js.map +0 -1
  208. package/dist/chunks/index-Li9RyHWl.esm.js +0 -2
  209. package/dist/chunks/index-Li9RyHWl.esm.js.map +0 -1
  210. package/dist/chunks/index-YfVtHaFO.esm.js +0 -2
  211. package/dist/chunks/index-YfVtHaFO.esm.js.map +0 -1
  212. package/dist/chunks/index-YoXRWj_4.esm.js +0 -2
  213. package/dist/chunks/index-YoXRWj_4.esm.js.map +0 -1
  214. package/dist/chunks/index-aGYbEHXq.esm.js.map +0 -1
  215. package/dist/chunks/index-bo9Yq4jd.esm.js +0 -2
  216. package/dist/chunks/index-bo9Yq4jd.esm.js.map +0 -1
  217. package/dist/chunks/index-rrdYIcOi.esm.js.map +0 -1
  218. package/dist/chunks/index-uqEAgdEf.esm.js.map +0 -1
  219. package/dist/chunks/index-w9_XpjIg.esm.js.map +0 -1
  220. package/dist/chunks/localize-BGPniqcI.esm.js +0 -30
  221. package/dist/chunks/localize-BGPniqcI.esm.js.map +0 -1
  222. package/dist/chunks/localize-dXHrlK8g.esm.js +0 -30
  223. package/dist/chunks/localize-dXHrlK8g.esm.js.map +0 -1
  224. package/dist/chunks/routes-bWWE2fXp.esm.js +0 -2
  225. package/dist/chunks/routes-h6eWTToy.esm.js +0 -2
@@ -0,0 +1,2 @@
1
+ import"./vendor-eeJfrOkP.esm.js";import"../components/impact-overview.js";import"./lit-yVXn5Cbs.esm.js";import"./lodash-P8OIs-at.esm.js";import"./routes-CqjzL4oL.esm.js";import"./beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"./progress-bar-7gWYaGlq.esm.js";import"./enforce-config-fo8kIfoY.esm.js";import"./localize-pzAAkBvG.esm.js";import"./is-all-html-elements-SdSkxirh.esm.js";import"../components/beam-partner-logos.js";import"./responsive-LYEag6TI.esm.js";
2
+ //# sourceMappingURL=_share-dialog-dependencies-FglfQ7YP.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_share-dialog-dependencies-FglfQ7YP.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import"./vendor-eeJfrOkP.esm.js";import"../components/impact-overview.esm.js";import"./lit-yVXn5Cbs.esm.js";import"./lodash-P8OIs-at.esm.js";import"./routes-lsOWIDmE.esm.js";import"./beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"./progress-bar-7gWYaGlq.esm.js";import"./enforce-config-qna7hEL6.esm.js";import"./localize-GCkVUD8S.esm.js";import"./is-all-html-elements-SdSkxirh.esm.js";import"../components/beam-partner-logos.esm.js";import"./responsive-LYEag6TI.esm.js";
2
+ //# sourceMappingURL=_share-dialog-dependencies-YbNiVx56.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_share-dialog-dependencies-YbNiVx56.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ class e extends Error{constructor(r,{cause:o,name:t="BeamError"}={}){super(r,{cause:o}),this.name=t,this.supportUrl="https://beamimpact.com"}}class a extends e{constructor(r,o,t){super(t,{name:"BeamNetworkError"}),this.response=r,this.body=o}}class n extends e{constructor(r=[],o){super(o,{name:"BeamMissingConfig"}),this.missingConfigKeyNames=r}}class i extends e{constructor(r="Both transactionId and subscriptionId cannot be specified at the same time."){super(r,{name:"BeamInvalidAttributeCombinationError"})}}class c extends e{constructor(r){super(r,{name:"BeamLocalStorageError"})}}class m extends e{constructor(r){super(r,{name:"BeamSetupError"})}}var u=Object.freeze({__proto__:null,BeamError:e,InvalidAttributeCombinationError:i,LocalStorageError:c,MissingConfig:n,NetworkError:a,SetupError:m});export{e as B,i as I,c as L,n as M,a as N,m as S,u as b};
2
+ //# sourceMappingURL=beam-errors-P-Lu07Ce.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"beam-errors-P-Lu07Ce.esm.js","sources":["../../src/utils/beam-errors.ts"],"sourcesContent":["export class BeamError extends Error {\n supportUrl: string;\n constructor(msg?: string, { cause, name = \"BeamError\" }: { cause?: any; name?: string } = {}) {\n super(msg, { cause });\n this.name = name;\n this.supportUrl = \"https://beamimpact.com\";\n }\n}\n\nexport class NetworkError extends BeamError {\n /** Fetch Response object with .ok, .status, etc.*/\n response: Response;\n /** If network response included JSON payload, it is parsed and available here */\n body?: Record<string, string>;\n constructor(response: Response, body?: Record<string, string>, msg?: string) {\n super(msg, { name: \"BeamNetworkError\" });\n this.response = response;\n this.body = body;\n }\n}\n\nexport class MissingConfig extends BeamError {\n missingConfigKeyNames: string[];\n constructor(missingConfigKeyNames: string[] = [], msg?: string) {\n super(msg, { name: \"BeamMissingConfig\" });\n this.missingConfigKeyNames = missingConfigKeyNames;\n }\n}\n\nexport class InvalidAttributeCombinationError extends BeamError {\n constructor(msg = \"Both transactionId and subscriptionId cannot be specified at the same time.\") {\n super(msg, { name: \"BeamInvalidAttributeCombinationError\" });\n }\n}\n\nexport class LocalStorageError extends BeamError {\n constructor(msg?: string) {\n super(msg, { name: \"BeamLocalStorageError\" });\n }\n}\n\nexport class SetupError extends BeamError {\n constructor(msg?: string) {\n super(msg, { name: \"BeamSetupError\" });\n }\n}\n"],"names":["BeamError","msg","cause","name","NetworkError","response","body","MissingConfig","missingConfigKeyNames","InvalidAttributeCombinationError","LocalStorageError","SetupError"],"mappings":"AAAa,MAAAA,UAAkB,KAAM,CAEnC,YAAYC,EAAc,CAAE,MAAAC,EAAO,KAAAC,EAAO,WAAY,EAAoC,CAAA,EAAI,CAC5F,MAAMF,EAAK,CAAE,MAAAC,CAAM,CAAC,EACpB,KAAK,KAAOC,EACZ,KAAK,WAAa,wBACpB,CACF,CAEO,MAAMC,UAAqBJ,CAAU,CAK1C,YAAYK,EAAoBC,EAA+BL,EAAc,CAC3E,MAAMA,EAAK,CAAE,KAAM,kBAAmB,CAAC,EACvC,KAAK,SAAWI,EAChB,KAAK,KAAOC,CACd,CACF,CAEO,MAAMC,UAAsBP,CAAU,CAE3C,YAAYQ,EAAkC,CAAIP,EAAAA,EAAc,CAC9D,MAAMA,EAAK,CAAE,KAAM,mBAAoB,CAAC,EACxC,KAAK,sBAAwBO,CAC/B,CACF,CAEO,MAAMC,UAAyCT,CAAU,CAC9D,YAAYC,EAAM,8EAA+E,CAC/F,MAAMA,EAAK,CAAE,KAAM,sCAAuC,CAAC,CAC7D,CACF,CAEa,MAAAS,UAA0BV,CAAU,CAC/C,YAAYC,EAAc,CACxB,MAAMA,EAAK,CAAE,KAAM,uBAAwB,CAAC,CAC9C,CACF,CAEa,MAAAU,UAAmBX,CAAU,CACxC,YAAYC,EAAc,CACxB,MAAMA,EAAK,CAAE,KAAM,gBAAiB,CAAC,CACvC,CACF"}
@@ -16,6 +16,9 @@ declare class MissingConfig extends BeamError {
16
16
  missingConfigKeyNames: string[];
17
17
  constructor(missingConfigKeyNames?: string[], msg?: string);
18
18
  }
19
+ declare class InvalidAttributeCombinationError extends BeamError {
20
+ constructor(msg?: string);
21
+ }
19
22
  declare class LocalStorageError extends BeamError {
20
23
  constructor(msg?: string);
21
24
  }
@@ -25,6 +28,8 @@ declare class SetupError extends BeamError {
25
28
 
26
29
  type beamErrors_BeamError = BeamError;
27
30
  declare const beamErrors_BeamError: typeof BeamError;
31
+ type beamErrors_InvalidAttributeCombinationError = InvalidAttributeCombinationError;
32
+ declare const beamErrors_InvalidAttributeCombinationError: typeof InvalidAttributeCombinationError;
28
33
  type beamErrors_LocalStorageError = LocalStorageError;
29
34
  declare const beamErrors_LocalStorageError: typeof LocalStorageError;
30
35
  type beamErrors_MissingConfig = MissingConfig;
@@ -34,7 +39,7 @@ declare const beamErrors_NetworkError: typeof NetworkError;
34
39
  type beamErrors_SetupError = SetupError;
35
40
  declare const beamErrors_SetupError: typeof SetupError;
36
41
  declare namespace beamErrors {
37
- export { beamErrors_BeamError as BeamError, beamErrors_LocalStorageError as LocalStorageError, beamErrors_MissingConfig as MissingConfig, beamErrors_NetworkError as NetworkError, beamErrors_SetupError as SetupError };
42
+ export { beamErrors_BeamError as BeamError, beamErrors_InvalidAttributeCombinationError as InvalidAttributeCombinationError, beamErrors_LocalStorageError as LocalStorageError, beamErrors_MissingConfig as MissingConfig, beamErrors_NetworkError as NetworkError, beamErrors_SetupError as SetupError };
38
43
  }
39
44
 
40
- export { BeamError as B, LocalStorageError as L, MissingConfig as M, NetworkError as N, SetupError as S, beamErrors as b };
45
+ export { BeamError as B, InvalidAttributeCombinationError as I, LocalStorageError as L, MissingConfig as M, NetworkError as N, SetupError as S, beamErrors as b };
@@ -1,4 +1,4 @@
1
- import { p as paths } from './openapi-spec-tJkr2i9K.esm.js';
1
+ import { p as paths } from './openapi-spec-D_Zzbl2J.esm.js';
2
2
 
3
3
  type TCartApi = paths["/chain/findEligibleNonprofitsForCart"]["post"]["requestBody"]["content"]["application/json"]["cart"];
4
4
  type TCart = TCartApi & {
@@ -0,0 +1,22 @@
1
+ import{f as l,y as r}from"./lit-yVXn5Cbs.esm.js";import{N as c,M as o,I as h}from"./beam-errors-P-Lu07Ce.esm.js";import{logger as d}from"../utils/logger.js";const p=l`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}ul{list-style:none}button,input,select{margin:0}html{box-sizing:border-box}*,*::before,*::after{box-sizing:inherit}img,video{/*height:auto;*/max-width:100%}iframe{border:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}`;function u(t,e=t.tagName){customElements.get(e)||customElements.define(e,t)}const m=t=>Object.entries(t).map(([e,s])=>`${e}: ${s};`).join(`
2
+ `);class f{constructor(e,s){this.data=null,this.loading=!1,this.error=null,(this.host=e).addController(this),this.asyncFn=s}async exec(...e){this.lastArgs=e,this.loading=!0,this.host.requestUpdate();try{this.data=await this.asyncFn(...e),this.error=null}catch(s){s instanceof Error&&(this.error=s,this.data=null)}return this.loading=!1,this.host.requestUpdate(),this.data}async retry(){return this.exec(...this.lastArgs||[])}hostDisconnected(){}}const a={errorTitle:"Beam encountered an error. Please try again.",retry:"Retry"},g=({error:t,retry:e})=>{let s=r``;if(t instanceof c){const i=JSON.stringify({status:t.response.status,statusText:t.response.statusText,url:t.response.url,body:t.body},null,4);s=r`
3
+ <p><b>Network Response:</b></p>
4
+ <p>${i}</p>
5
+ `}return t instanceof o&&(s=r`
6
+ <p><b>Missing Required Config Options:</b></p>
7
+ <p>${t.missingConfigKeyNames.join(", ")}</p>
8
+ `),r`<div class="beam-error" style="text-align: left">
9
+ <p>${a.errorTitle} ${e?r` <button type="reset" @click="${e}">${a.retry}</button>`:""}</p>
10
+ <br />
11
+ <details>
12
+ <div style="white-space: pre-wrap; font-family: monospace; line-height: 1;">
13
+ ${s}
14
+ <p><b>Message:</b> ${t.message||r`<i>None</i>`}</p>
15
+ <p><b>Stack:</b> ${t.stack}</p>
16
+ </div>
17
+ </details>
18
+ <br />
19
+ <p>Help: <a href="https://www.beamimpact.com">www.beamimpact.com</a></p>
20
+ </div>`};function b(t,e){const s=[],i=e;for(const n of t)i[n]==null&&s.push(n);if(s.length>0)throw d.error(`Beam Impact - Missing Required Config Values:
21
+ `,s.join(", "),e),new o(s);return!0}function y(t,e){return t.every(s=>s in e&&e[s]!=null)}function w(t,e){if(t.every(s=>e[s]!==null&&e[s]!==void 0))throw new h}export{f as A,g as _,m as a,w as b,p as c,u as d,b as e,y as f};
22
+ //# sourceMappingURL=enforce-config-fo8kIfoY.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforce-config-fo8kIfoY.esm.js","sources":["../../src/shared/css-reset.ts","../../src/shared/defineCustomElement.ts","../../src/shared/fragments/css-variable-map.ts","../../src/shared/controllers/async-controller.ts","../../src/shared/fragments/error-message-template.ts","../../src/shared/enforce-config.ts"],"sourcesContent":["import { css } from \"lit\";\n\n// minireset.css v0.0.7 | MIT License | github.com/jgthms/minireset.css\n// prettier-ignore\nexport const cssReset = css`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}ul{list-style:none}button,input,select{margin:0}html{box-sizing:border-box}*,*::before,*::after{box-sizing:inherit}img,video{/*height:auto;*/max-width:100%}iframe{border:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}`;\n","/**\n * Defines a custom element based on its static tagName property\n */\nexport function defineCustomElement(\n CustomElementClass: CustomElementConstructor & { tagName: string },\n tagName = CustomElementClass[\"tagName\"]\n) {\n customElements.get(tagName) || customElements.define(tagName, CustomElementClass);\n}\n","export const _cssVariableMap = (variables: Record<string, string>) => {\n return Object.entries(variables)\n .map(([k, v]) => `${k}: ${v};`)\n .join(\"\\n\");\n};\n","import { ReactiveController, ReactiveControllerHost } from \"lit\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncFunction = (...args: any[]) => Promise<any>;\n\n/**\n * Creates a declarative wrapper around async operations\n * @example\n * class MyElement extends LitElement {\n * private user = new AsyncController(\n * this,\n * async ({ id }) => get(url, { id }));\n *\n * async updated(changedProperties) {\n * if (changedProperties.has(\"userId\")) {\n * await this.user.exec({ id: this.userId })\n * }\n * }\n *\n * render() {\n * const { data, loading, error } = this.user;\n * if (loading) return html`Please wait...`\n * if (error) return html`Error! <button @click=${this.user.retry}>Reload</button>`;\n * return html`My name is: ${data.name}`\n * }\n * }\n */\nexport class AsyncController<TFn extends AsyncFunction> implements ReactiveController {\n public data: Awaited<ReturnType<TFn>> | null = null;\n public loading = false;\n public error: Error | null = null;\n\n private readonly host: ReactiveControllerHost;\n private readonly asyncFn: TFn;\n private lastArgs?: Parameters<TFn>;\n\n constructor(host: ReactiveControllerHost, asyncFn: TFn) {\n (this.host = host).addController(this);\n this.asyncFn = asyncFn;\n }\n\n public async exec(...args: Parameters<TFn>): Promise<ReturnType<TFn> | null> {\n this.lastArgs = args;\n this.loading = true;\n this.host.requestUpdate();\n try {\n // TODO: prevent race condition if later invocation returns before earlier\n this.data = await this.asyncFn(...args);\n this.error = null;\n } catch (err) {\n if (err instanceof Error) {\n this.error = err;\n this.data = null;\n }\n }\n this.loading = false;\n this.host.requestUpdate();\n return this.data;\n }\n\n public async retry() {\n return this.exec(...((this.lastArgs || []) as Parameters<TFn>));\n }\n\n hostDisconnected() {\n // TODO: cancel API calls\n }\n}\n","import { html } from \"lit\";\nimport { MissingConfig, NetworkError } from \"../../utils/beam-errors\";\n\nconst strings = {\n errorTitle: `Beam encountered an error. Please try again.`,\n retry: `Retry`,\n};\n\nexport const _errorMessage = ({ error, retry }: { error: Error; retry?: (...args: never) => void }) => {\n let details = html``;\n if (error instanceof NetworkError) {\n const response = JSON.stringify(\n {\n status: error.response.status,\n statusText: error.response.statusText,\n url: error.response.url,\n body: error.body,\n },\n null,\n 4\n );\n details = html`\n <p><b>Network Response:</b></p>\n <p>${response}</p>\n `;\n }\n if (error instanceof MissingConfig) {\n details = html`\n <p><b>Missing Required Config Options:</b></p>\n <p>${error.missingConfigKeyNames.join(\", \")}</p>\n `;\n }\n return html`<div class=\"beam-error\" style=\"text-align: left\">\n <p>${strings.errorTitle} ${retry ? html` <button type=\"reset\" @click=\"${retry}\">${strings.retry}</button>` : \"\"}</p>\n <br />\n <details>\n <div style=\"white-space: pre-wrap; font-family: monospace; line-height: 1;\">\n ${details}\n <p><b>Message:</b> ${error.message || html`<i>None</i>`}</p>\n <p><b>Stack:</b> ${error.stack}</p>\n </div>\n </details>\n <br />\n <p>Help: <a href=\"https://www.beamimpact.com\">www.beamimpact.com</a></p>\n </div>`;\n};\n","import { InvalidAttributeCombinationError, MissingConfig } from \"../utils/beam-errors\";\nimport { logger } from \"../utils/logger\";\n\nexport function enforceConfig<T>(keys: (keyof T)[], input: unknown): input is Required<T> {\n const missingKeys: string[] = [];\n const check = input as Record<string | number | symbol, unknown>;\n for (const key of keys) {\n if (check[key] == null) {\n missingKeys.push(key as string);\n }\n }\n if (missingKeys.length > 0) {\n logger.error(\"Beam Impact - Missing Required Config Values:\\n\", missingKeys.join(\", \"), input);\n throw new MissingConfig(missingKeys);\n }\n return true;\n}\n\nexport function areRequiredKeysDefined<T extends object>(requiredKeys: (keyof T)[], config: T): boolean {\n return requiredKeys.every((key) => key in config && config[key] != null);\n}\n\nexport function checkForInvalidAttributeCombinations<T>(keys: (keyof T)[], config: T): void {\n const InvalidAttributeCombinationsPresent = keys.every((key) => config[key] !== null && config[key] !== undefined);\n if (InvalidAttributeCombinationsPresent) {\n throw new InvalidAttributeCombinationError();\n }\n}\n"],"names":["cssReset","css","defineCustomElement","CustomElementClass","tagName","_cssVariableMap","variables","k","v","AsyncController","host","asyncFn","args","err","strings","_errorMessage","error","retry","details","html","NetworkError","response","MissingConfig","enforceConfig","keys","input","missingKeys","check","key","logger","areRequiredKeysDefined","requiredKeys","config","checkForInvalidAttributeCombinations","InvalidAttributeCombinationError"],"mappings":"6JAIO,MAAMA,EAAWC,gaCDjB,SAASC,EACdC,EACAC,EAAUD,EAAmB,QAC7B,CACA,eAAe,IAAIC,CAAO,GAAK,eAAe,OAAOA,EAASD,CAAkB,CAClF,CCRO,MAAME,EAAmBC,GACvB,OAAO,QAAQA,CAAS,EAC5B,IAAI,CAAC,CAACC,EAAGC,CAAC,IAAM,GAAGD,CAAC,KAAKC,CAAC,GAAG,EAC7B,KAAK;AAAA,CAAI,ECwBP,MAAMC,CAAyE,CASpF,YAAYC,EAA8BC,EAAc,CARxD,KAAO,KAAwC,KAC/C,KAAO,QAAU,GACjB,KAAO,MAAsB,MAO1B,KAAK,KAAOD,GAAM,cAAc,IAAI,EACrC,KAAK,QAAUC,CACjB,CAEA,MAAa,QAAQC,EAAwD,CAC3E,KAAK,SAAWA,EAChB,KAAK,QAAU,GACf,KAAK,KAAK,gBACV,GAAI,CAEF,KAAK,KAAO,MAAM,KAAK,QAAQ,GAAGA,CAAI,EACtC,KAAK,MAAQ,IACf,OAASC,EAAK,CACRA,aAAe,QACjB,KAAK,MAAQA,EACb,KAAK,KAAO,KAEhB,CACA,YAAK,QAAU,GACf,KAAK,KAAK,gBACH,KAAK,IACd,CAEA,MAAa,OAAQ,CACnB,OAAO,KAAK,KAAK,GAAK,KAAK,UAAY,CAAuB,CAAA,CAChE,CAEA,kBAAmB,CAGrB,CAAA,CChEA,MAAMC,EAAU,CACd,WAAY,+CACZ,MAAO,OACT,EAEaC,EAAgB,CAAC,CAAE,MAAAC,EAAO,MAAAC,CAAM,IAA0D,CACrG,IAAIC,EAAUC,IACd,GAAIH,aAAiBI,EAAc,CACjC,MAAMC,EAAW,KAAK,UACpB,CACE,OAAQL,EAAM,SAAS,OACvB,WAAYA,EAAM,SAAS,WAC3B,IAAKA,EAAM,SAAS,IACpB,KAAMA,EAAM,IACd,EACA,KACA,CACF,EACAE,EAAUC;AAAAA;AAAAA,WAEHE,CAAQ;AAAA,KAEjB,CACA,OAAIL,aAAiBM,IACnBJ,EAAUC;AAAAA;AAAAA,WAEHH,EAAM,sBAAsB,KAAK,IAAI,CAAC;AAAA,OAGxCG;AAAAA,SACAL,EAAQ,UAAU,IAAIG,EAAQE,kCAAqCF,CAAK,KAAKH,EAAQ,KAAK,YAAc,EAAE;AAAA;AAAA;AAAA;AAAA,UAIzGI,CAAO;AAAA,6BACYF,EAAM,SAAWG,cAAiB;AAAA,2BACpCH,EAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,SAMtC,EC1CO,SAASO,EAAiBC,EAAmBC,EAAsC,CACxF,MAAMC,EAAwB,CAAA,EACxBC,EAAQF,EACd,UAAWG,KAAOJ,EACZG,EAAMC,CAAG,GAAK,MAChBF,EAAY,KAAKE,CAAa,EAGlC,GAAIF,EAAY,OAAS,EACvB,MAAAG,EAAO,MAAM;AAAA,EAAmDH,EAAY,KAAK,IAAI,EAAGD,CAAK,EACvF,IAAIH,EAAcI,CAAW,EAErC,MAAO,EACT,CAEO,SAASI,EAAyCC,EAA2BC,EAAoB,CACtG,OAAOD,EAAa,MAAOH,GAAQA,KAAOI,GAAUA,EAAOJ,CAAG,GAAK,IAAI,CACzE,CAEO,SAASK,EAAwCT,EAAmBQ,EAAiB,CAE1F,GAD4CR,EAAK,MAAOI,GAAQI,EAAOJ,CAAG,IAAM,MAAQI,EAAOJ,CAAG,IAAM,MAAS,EAE/G,MAAM,IAAIM,CAEd"}
@@ -0,0 +1,22 @@
1
+ import{f as l,y as r}from"./lit-yVXn5Cbs.esm.js";import{N as c,M as o,I as h}from"./beam-errors-P-Lu07Ce.esm.js";import{logger as d}from"../utils/logger.esm.js";const p=l`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}ul{list-style:none}button,input,select{margin:0}html{box-sizing:border-box}*,*::before,*::after{box-sizing:inherit}img,video{/*height:auto;*/max-width:100%}iframe{border:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}`;function u(t,e=t.tagName){customElements.get(e)||customElements.define(e,t)}const m=t=>Object.entries(t).map(([e,s])=>`${e}: ${s};`).join(`
2
+ `);class f{constructor(e,s){this.data=null,this.loading=!1,this.error=null,(this.host=e).addController(this),this.asyncFn=s}async exec(...e){this.lastArgs=e,this.loading=!0,this.host.requestUpdate();try{this.data=await this.asyncFn(...e),this.error=null}catch(s){s instanceof Error&&(this.error=s,this.data=null)}return this.loading=!1,this.host.requestUpdate(),this.data}async retry(){return this.exec(...this.lastArgs||[])}hostDisconnected(){}}const a={errorTitle:"Beam encountered an error. Please try again.",retry:"Retry"},g=({error:t,retry:e})=>{let s=r``;if(t instanceof c){const i=JSON.stringify({status:t.response.status,statusText:t.response.statusText,url:t.response.url,body:t.body},null,4);s=r`
3
+ <p><b>Network Response:</b></p>
4
+ <p>${i}</p>
5
+ `}return t instanceof o&&(s=r`
6
+ <p><b>Missing Required Config Options:</b></p>
7
+ <p>${t.missingConfigKeyNames.join(", ")}</p>
8
+ `),r`<div class="beam-error" style="text-align: left">
9
+ <p>${a.errorTitle} ${e?r` <button type="reset" @click="${e}">${a.retry}</button>`:""}</p>
10
+ <br />
11
+ <details>
12
+ <div style="white-space: pre-wrap; font-family: monospace; line-height: 1;">
13
+ ${s}
14
+ <p><b>Message:</b> ${t.message||r`<i>None</i>`}</p>
15
+ <p><b>Stack:</b> ${t.stack}</p>
16
+ </div>
17
+ </details>
18
+ <br />
19
+ <p>Help: <a href="https://www.beamimpact.com">www.beamimpact.com</a></p>
20
+ </div>`};function b(t,e){const s=[],i=e;for(const n of t)i[n]==null&&s.push(n);if(s.length>0)throw d.error(`Beam Impact - Missing Required Config Values:
21
+ `,s.join(", "),e),new o(s);return!0}function y(t,e){return t.every(s=>s in e&&e[s]!=null)}function w(t,e){if(t.every(s=>e[s]!==null&&e[s]!==void 0))throw new h}export{f as A,g as _,m as a,w as b,p as c,u as d,b as e,y as f};
22
+ //# sourceMappingURL=enforce-config-qna7hEL6.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforce-config-qna7hEL6.esm.js","sources":["../../src/shared/css-reset.ts","../../src/shared/defineCustomElement.ts","../../src/shared/fragments/css-variable-map.ts","../../src/shared/controllers/async-controller.ts","../../src/shared/fragments/error-message-template.ts","../../src/shared/enforce-config.ts"],"sourcesContent":["import { css } from \"lit\";\n\n// minireset.css v0.0.7 | MIT License | github.com/jgthms/minireset.css\n// prettier-ignore\nexport const cssReset = css`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}ul{list-style:none}button,input,select{margin:0}html{box-sizing:border-box}*,*::before,*::after{box-sizing:inherit}img,video{/*height:auto;*/max-width:100%}iframe{border:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}`;\n","/**\n * Defines a custom element based on its static tagName property\n */\nexport function defineCustomElement(\n CustomElementClass: CustomElementConstructor & { tagName: string },\n tagName = CustomElementClass[\"tagName\"]\n) {\n customElements.get(tagName) || customElements.define(tagName, CustomElementClass);\n}\n","export const _cssVariableMap = (variables: Record<string, string>) => {\n return Object.entries(variables)\n .map(([k, v]) => `${k}: ${v};`)\n .join(\"\\n\");\n};\n","import { ReactiveController, ReactiveControllerHost } from \"lit\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncFunction = (...args: any[]) => Promise<any>;\n\n/**\n * Creates a declarative wrapper around async operations\n * @example\n * class MyElement extends LitElement {\n * private user = new AsyncController(\n * this,\n * async ({ id }) => get(url, { id }));\n *\n * async updated(changedProperties) {\n * if (changedProperties.has(\"userId\")) {\n * await this.user.exec({ id: this.userId })\n * }\n * }\n *\n * render() {\n * const { data, loading, error } = this.user;\n * if (loading) return html`Please wait...`\n * if (error) return html`Error! <button @click=${this.user.retry}>Reload</button>`;\n * return html`My name is: ${data.name}`\n * }\n * }\n */\nexport class AsyncController<TFn extends AsyncFunction> implements ReactiveController {\n public data: Awaited<ReturnType<TFn>> | null = null;\n public loading = false;\n public error: Error | null = null;\n\n private readonly host: ReactiveControllerHost;\n private readonly asyncFn: TFn;\n private lastArgs?: Parameters<TFn>;\n\n constructor(host: ReactiveControllerHost, asyncFn: TFn) {\n (this.host = host).addController(this);\n this.asyncFn = asyncFn;\n }\n\n public async exec(...args: Parameters<TFn>): Promise<ReturnType<TFn> | null> {\n this.lastArgs = args;\n this.loading = true;\n this.host.requestUpdate();\n try {\n // TODO: prevent race condition if later invocation returns before earlier\n this.data = await this.asyncFn(...args);\n this.error = null;\n } catch (err) {\n if (err instanceof Error) {\n this.error = err;\n this.data = null;\n }\n }\n this.loading = false;\n this.host.requestUpdate();\n return this.data;\n }\n\n public async retry() {\n return this.exec(...((this.lastArgs || []) as Parameters<TFn>));\n }\n\n hostDisconnected() {\n // TODO: cancel API calls\n }\n}\n","import { html } from \"lit\";\nimport { MissingConfig, NetworkError } from \"../../utils/beam-errors\";\n\nconst strings = {\n errorTitle: `Beam encountered an error. Please try again.`,\n retry: `Retry`,\n};\n\nexport const _errorMessage = ({ error, retry }: { error: Error; retry?: (...args: never) => void }) => {\n let details = html``;\n if (error instanceof NetworkError) {\n const response = JSON.stringify(\n {\n status: error.response.status,\n statusText: error.response.statusText,\n url: error.response.url,\n body: error.body,\n },\n null,\n 4\n );\n details = html`\n <p><b>Network Response:</b></p>\n <p>${response}</p>\n `;\n }\n if (error instanceof MissingConfig) {\n details = html`\n <p><b>Missing Required Config Options:</b></p>\n <p>${error.missingConfigKeyNames.join(\", \")}</p>\n `;\n }\n return html`<div class=\"beam-error\" style=\"text-align: left\">\n <p>${strings.errorTitle} ${retry ? html` <button type=\"reset\" @click=\"${retry}\">${strings.retry}</button>` : \"\"}</p>\n <br />\n <details>\n <div style=\"white-space: pre-wrap; font-family: monospace; line-height: 1;\">\n ${details}\n <p><b>Message:</b> ${error.message || html`<i>None</i>`}</p>\n <p><b>Stack:</b> ${error.stack}</p>\n </div>\n </details>\n <br />\n <p>Help: <a href=\"https://www.beamimpact.com\">www.beamimpact.com</a></p>\n </div>`;\n};\n","import { InvalidAttributeCombinationError, MissingConfig } from \"../utils/beam-errors\";\nimport { logger } from \"../utils/logger\";\n\nexport function enforceConfig<T>(keys: (keyof T)[], input: unknown): input is Required<T> {\n const missingKeys: string[] = [];\n const check = input as Record<string | number | symbol, unknown>;\n for (const key of keys) {\n if (check[key] == null) {\n missingKeys.push(key as string);\n }\n }\n if (missingKeys.length > 0) {\n logger.error(\"Beam Impact - Missing Required Config Values:\\n\", missingKeys.join(\", \"), input);\n throw new MissingConfig(missingKeys);\n }\n return true;\n}\n\nexport function areRequiredKeysDefined<T extends object>(requiredKeys: (keyof T)[], config: T): boolean {\n return requiredKeys.every((key) => key in config && config[key] != null);\n}\n\nexport function checkForInvalidAttributeCombinations<T>(keys: (keyof T)[], config: T): void {\n const InvalidAttributeCombinationsPresent = keys.every((key) => config[key] !== null && config[key] !== undefined);\n if (InvalidAttributeCombinationsPresent) {\n throw new InvalidAttributeCombinationError();\n }\n}\n"],"names":["cssReset","css","defineCustomElement","CustomElementClass","tagName","_cssVariableMap","variables","k","v","AsyncController","host","asyncFn","args","err","strings","_errorMessage","error","retry","details","html","NetworkError","response","MissingConfig","enforceConfig","keys","input","missingKeys","check","key","logger","areRequiredKeysDefined","requiredKeys","config","checkForInvalidAttributeCombinations","InvalidAttributeCombinationError"],"mappings":"iKAIO,MAAMA,EAAWC,gaCDjB,SAASC,EACdC,EACAC,EAAUD,EAAmB,QAC7B,CACA,eAAe,IAAIC,CAAO,GAAK,eAAe,OAAOA,EAASD,CAAkB,CAClF,CCRO,MAAME,EAAmBC,GACvB,OAAO,QAAQA,CAAS,EAC5B,IAAI,CAAC,CAACC,EAAGC,CAAC,IAAM,GAAGD,CAAC,KAAKC,CAAC,GAAG,EAC7B,KAAK;AAAA,CAAI,ECwBP,MAAMC,CAAyE,CASpF,YAAYC,EAA8BC,EAAc,CARxD,KAAO,KAAwC,KAC/C,KAAO,QAAU,GACjB,KAAO,MAAsB,MAO1B,KAAK,KAAOD,GAAM,cAAc,IAAI,EACrC,KAAK,QAAUC,CACjB,CAEA,MAAa,QAAQC,EAAwD,CAC3E,KAAK,SAAWA,EAChB,KAAK,QAAU,GACf,KAAK,KAAK,gBACV,GAAI,CAEF,KAAK,KAAO,MAAM,KAAK,QAAQ,GAAGA,CAAI,EACtC,KAAK,MAAQ,IACf,OAASC,EAAK,CACRA,aAAe,QACjB,KAAK,MAAQA,EACb,KAAK,KAAO,KAEhB,CACA,YAAK,QAAU,GACf,KAAK,KAAK,gBACH,KAAK,IACd,CAEA,MAAa,OAAQ,CACnB,OAAO,KAAK,KAAK,GAAK,KAAK,UAAY,CAAuB,CAAA,CAChE,CAEA,kBAAmB,CAGrB,CAAA,CChEA,MAAMC,EAAU,CACd,WAAY,+CACZ,MAAO,OACT,EAEaC,EAAgB,CAAC,CAAE,MAAAC,EAAO,MAAAC,CAAM,IAA0D,CACrG,IAAIC,EAAUC,IACd,GAAIH,aAAiBI,EAAc,CACjC,MAAMC,EAAW,KAAK,UACpB,CACE,OAAQL,EAAM,SAAS,OACvB,WAAYA,EAAM,SAAS,WAC3B,IAAKA,EAAM,SAAS,IACpB,KAAMA,EAAM,IACd,EACA,KACA,CACF,EACAE,EAAUC;AAAAA;AAAAA,WAEHE,CAAQ;AAAA,KAEjB,CACA,OAAIL,aAAiBM,IACnBJ,EAAUC;AAAAA;AAAAA,WAEHH,EAAM,sBAAsB,KAAK,IAAI,CAAC;AAAA,OAGxCG;AAAAA,SACAL,EAAQ,UAAU,IAAIG,EAAQE,kCAAqCF,CAAK,KAAKH,EAAQ,KAAK,YAAc,EAAE;AAAA;AAAA;AAAA;AAAA,UAIzGI,CAAO;AAAA,6BACYF,EAAM,SAAWG,cAAiB;AAAA,2BACpCH,EAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,SAMtC,EC1CO,SAASO,EAAiBC,EAAmBC,EAAsC,CACxF,MAAMC,EAAwB,CAAA,EACxBC,EAAQF,EACd,UAAWG,KAAOJ,EACZG,EAAMC,CAAG,GAAK,MAChBF,EAAY,KAAKE,CAAa,EAGlC,GAAIF,EAAY,OAAS,EACvB,MAAAG,EAAO,MAAM;AAAA,EAAmDH,EAAY,KAAK,IAAI,EAAGD,CAAK,EACvF,IAAIH,EAAcI,CAAW,EAErC,MAAO,EACT,CAEO,SAASI,EAAyCC,EAA2BC,EAAoB,CACtG,OAAOD,EAAa,MAAOH,GAAQA,KAAOI,GAAUA,EAAOJ,CAAG,GAAK,IAAI,CACzE,CAEO,SAASK,EAAwCT,EAAmBQ,EAAiB,CAE1F,GAD4CR,EAAK,MAAOI,GAAQI,EAAOJ,CAAG,IAAM,MAAQI,EAAOJ,CAAG,IAAM,MAAS,EAE/G,MAAM,IAAIM,CAEd"}
@@ -1,4 +1,4 @@
1
- import { a as TCartApi } from './cart-contents-tEvcY9ip.esm.js';
1
+ import { a as TCartApi } from './cart-contents-Shc27L1J.esm.js';
2
2
  import { c as TId } from './types-7kSi85Gv.esm.js';
3
3
 
4
4
  type NetworkEventDetail = {
@@ -0,0 +1,2 @@
1
+ import{h as e,C as r,O as t,s as a,L as o}from"./order-page-W1jR35W9.esm.js";var s=Object.freeze({__proto__:null,addBeamAttributesToCart:e,getCurrentCart:r,registerCartIntegration:t,showBeamOrderPageWidgets:a,trackCart:o});export{s as i};
2
+ //# sourceMappingURL=index-1qXot92e.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-1qXot92e.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { B as BeamCartAPIConfig, a as BeamCartValues, u as updateCart } from './update-cart-m3NdnSx2.esm.js';
1
+ import { B as BeamCartAPIConfig, a as BeamCartValues, u as updateCart } from './update-cart-yCIzgmve.esm.js';
2
2
 
3
3
  declare const index_BeamCartAPIConfig: typeof BeamCartAPIConfig;
4
4
  declare const index_BeamCartValues: typeof BeamCartValues;
@@ -1,2 +1,2 @@
1
- import{BeamCommunityImpact as m}from"../components/community-impact.esm.js";import{BeamCumulativeImpact as e}from"../components/cumulative-impact.esm.js";import{BeamImpactOverview as a}from"../components/impact-overview.esm.js";import{BeamSelectNonprofit as t}from"../components/select-nonprofit.esm.js";import{BeamRedeemTransaction as o}from"../components/redeem-transaction.esm.js";import{BeamPostPurchase as r}from"../components/post-purchase.esm.js";var i=Object.freeze({__proto__:null,BeamCommunityImpact:m,BeamCumulativeImpact:e,BeamImpactOverview:a,BeamPostPurchase:r,BeamRedeemTransaction:o,BeamSelectNonprofit:t});export{i};
2
- //# sourceMappingURL=index-aGYbEHXq.esm.js.map
1
+ import{BeamCommunityImpact as m}from"../components/community-impact.esm.js";import{BeamCumulativeImpact as e}from"../components/cumulative-impact.esm.js";import{BeamImpactOverview as a}from"../components/impact-overview.esm.js";import{BeamSelectNonprofit as t}from"../components/select-nonprofit.esm.js";import{BeamRedeemTransaction as o}from"../components/redeem-transaction.esm.js";import{BeamPostPurchase as r}from"../components/post-purchase.esm.js";import{BeamSubscriptionManagement as i}from"../components/subscription-management.esm.js";var p=Object.freeze({__proto__:null,BeamCommunityImpact:m,BeamCumulativeImpact:e,BeamImpactOverview:a,BeamPostPurchase:r,BeamRedeemTransaction:o,BeamSelectNonprofit:t,BeamSubscriptionManagement:i});export{p as i};
2
+ //# sourceMappingURL=index-5yFqo0yl.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-5yFqo0yl.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -4,6 +4,7 @@ import BeamImpactOverview from '../react/impact-overview.js';
4
4
  import BeamSelectNonprofit from '../react/select-nonprofit.js';
5
5
  import BeamRedeemTransaction from '../react/redeem-transaction.js';
6
6
  import BeamPostPurchase from '../react/post-purchase.js';
7
+ import BeamSubscriptionManagement from '../react/subscription-management.js';
7
8
 
8
9
  declare const index_BeamCommunityImpact: typeof BeamCommunityImpact;
9
10
  declare const index_BeamCumulativeImpact: typeof BeamCumulativeImpact;
@@ -11,8 +12,9 @@ declare const index_BeamImpactOverview: typeof BeamImpactOverview;
11
12
  declare const index_BeamPostPurchase: typeof BeamPostPurchase;
12
13
  declare const index_BeamRedeemTransaction: typeof BeamRedeemTransaction;
13
14
  declare const index_BeamSelectNonprofit: typeof BeamSelectNonprofit;
15
+ declare const index_BeamSubscriptionManagement: typeof BeamSubscriptionManagement;
14
16
  declare namespace index {
15
- export { index_BeamCommunityImpact as BeamCommunityImpact, index_BeamCumulativeImpact as BeamCumulativeImpact, index_BeamImpactOverview as BeamImpactOverview, index_BeamPostPurchase as BeamPostPurchase, index_BeamRedeemTransaction as BeamRedeemTransaction, index_BeamSelectNonprofit as BeamSelectNonprofit };
17
+ export { index_BeamCommunityImpact as BeamCommunityImpact, index_BeamCumulativeImpact as BeamCumulativeImpact, index_BeamImpactOverview as BeamImpactOverview, index_BeamPostPurchase as BeamPostPurchase, index_BeamRedeemTransaction as BeamRedeemTransaction, index_BeamSelectNonprofit as BeamSelectNonprofit, index_BeamSubscriptionManagement as BeamSubscriptionManagement };
16
18
  }
17
19
 
18
20
  export { index as i };
@@ -1,2 +1,2 @@
1
- import{b as e}from"./beam-errors-AMvTvR1C.esm.js";import{e as o}from"./events-5IECSF-x.esm.js";import{logger as r}from"../utils/logger.esm.js";import{fetchProxy as t,initNetworkListeners as i,xhrProxy as m}from"../utils/network-listeners.esm.js";import{createScopedLocalStorage as a}from"../utils/local-storage.esm.js";import{waitForElement as s}from"../utils/wait-for-element.esm.js";import{deleteCookieValue as l,getCookieMap as n,getCookieValue as p,setCookieValue as f}from"../utils/cookies.esm.js";import{getRemoteSession as g,saveRemoteSession as c}from"../utils/remote-session.esm.js";import{memoizeLast as u}from"../utils/memoize-last.esm.js";import{d as k,i as d}from"./lodash-P8OIs-at.esm.js";var x=Object.freeze({__proto__:null,createScopedLocalStorage:a,debounce:k,deleteCookieValue:l,errors:e,events:o,fetchProxy:t,getCookieMap:n,getCookieValue:p,getRemoteSession:g,initNetworkListeners:i,isEqual:d,logger:r,memoizeLast:u,saveRemoteSession:c,setCookieValue:f,waitForElement:s,xhrProxy:m});export{x as i};
2
- //# sourceMappingURL=index-FAF7tYU6.esm.js.map
1
+ import{b as e}from"./beam-errors-P-Lu07Ce.esm.js";import{e as o}from"./events-5IECSF-x.esm.js";import{logger as r}from"../utils/logger.esm.js";import{fetchProxy as t,initNetworkListeners as i,xhrProxy as m}from"../utils/network-listeners.esm.js";import{createScopedLocalStorage as a}from"../utils/local-storage.esm.js";import{waitForElement as s}from"../utils/wait-for-element.esm.js";import{deleteCookieValue as l,getCookieMap as n,getCookieValue as p,setCookieValue as f}from"../utils/cookies.esm.js";import{getRemoteSession as g,saveRemoteSession as c}from"../utils/remote-session.esm.js";import{memoizeLast as u}from"../utils/memoize-last.esm.js";import{d as k,i as d}from"./lodash-P8OIs-at.esm.js";var x=Object.freeze({__proto__:null,createScopedLocalStorage:a,debounce:k,deleteCookieValue:l,errors:e,events:o,fetchProxy:t,getCookieMap:n,getCookieValue:p,getRemoteSession:g,initNetworkListeners:i,isEqual:d,logger:r,memoizeLast:u,saveRemoteSession:c,setCookieValue:f,waitForElement:s,xhrProxy:m});export{x as i};
2
+ //# sourceMappingURL=index-9gijHGwh.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-9gijHGwh.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{BeamCommunityImpact as m}from"../react/community-impact.js";import{BeamCumulativeImpact as e}from"../react/cumulative-impact.js";import{BeamImpactOverview as a}from"../react/impact-overview.js";import{BeamSelectNonprofit as t}from"../react/select-nonprofit.js";import{BeamRedeemTransaction as o}from"../react/redeem-transaction.js";import{BeamPostPurchase as r}from"../react/post-purchase.js";var i=Object.freeze({__proto__:null,BeamCommunityImpact:m,BeamCumulativeImpact:e,BeamImpactOverview:a,BeamPostPurchase:r,BeamRedeemTransaction:o,BeamSelectNonprofit:t});export{i};
2
- //# sourceMappingURL=index-JL12lEnO.esm.js.map
1
+ import{BeamCommunityImpact as m}from"../react/community-impact.js";import{BeamCumulativeImpact as e}from"../react/cumulative-impact.js";import{BeamImpactOverview as a}from"../react/impact-overview.js";import{BeamSelectNonprofit as t}from"../react/select-nonprofit.js";import{BeamRedeemTransaction as o}from"../react/redeem-transaction.js";import{BeamPostPurchase as r}from"../react/post-purchase.js";import{BeamSubscriptionManagement as i}from"../react/subscription-management.js";var p=Object.freeze({__proto__:null,BeamCommunityImpact:m,BeamCumulativeImpact:e,BeamImpactOverview:a,BeamPostPurchase:r,BeamRedeemTransaction:o,BeamSelectNonprofit:t,BeamSubscriptionManagement:i});export{p as i};
2
+ //# sourceMappingURL=index-EHubF2KN.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-EHubF2KN.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,8 +1,8 @@
1
- import { i as index$5 } from './index-PL4iasT1.esm.js';
2
- import { i as index$4 } from './index-5-EnaNnJ.esm.js';
1
+ import { i as index$5 } from './index-pDraUd1x.esm.js';
2
+ import { i as index$4 } from './index-I8DBdgx0.esm.js';
3
3
  import { i as index$3 } from './index-EGiUuWe-.esm.js';
4
- import { i as index$1 } from './index-hbzssC4x.esm.js';
5
- import { i as index$2 } from './index-nJEBkWPL.esm.js';
4
+ import { i as index$1 } from './index-3Xf6QzNV.esm.js';
5
+ import { i as index$2 } from './index-wbrSi6cp.esm.js';
6
6
 
7
7
  /**
8
8
  * This file is used to provide type definitions
@@ -0,0 +1,2 @@
1
+ import{x as e}from"./update-cart-T32-282v.esm.js";var r=Object.freeze({__proto__:null,updateCart:e});export{r as i};
2
+ //# sourceMappingURL=index-EpanGShY.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-EpanGShY.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
- import { b as beamErrors } from './beam-errors-bKCZlkvr.esm.js';
2
- import { e as events } from './events-PZnG_xac.esm.js';
1
+ import { b as beamErrors } from './beam-errors-fXDkG1zo.esm.js';
2
+ import { e as events } from './events-qTu4iIOo.esm.js';
3
3
  import { logger } from '../utils/logger.js';
4
4
  import { fetchProxy, initNetworkListeners, xhrProxy } from '../utils/network-listeners.js';
5
5
  import { createScopedLocalStorage } from '../utils/local-storage.js';
@@ -1,4 +1,4 @@
1
- import { T as TBeamOrderPageParams, a as addBeamAttributesToCart, g as getCurrentCart, r as registerCartIntegration, s as showBeamOrderPageWidgets, t as trackCart } from './order-page-cFAaDNWE.esm.js';
1
+ import { T as TBeamOrderPageParams, a as addBeamAttributesToCart, g as getCurrentCart, r as registerCartIntegration, s as showBeamOrderPageWidgets, t as trackCart } from './order-page-ydw5uXTI.esm.js';
2
2
 
3
3
  declare const index_TBeamOrderPageParams: typeof TBeamOrderPageParams;
4
4
  declare const index_addBeamAttributesToCart: typeof addBeamAttributesToCart;
@@ -0,0 +1,2 @@
1
+ import{BeamCommunityImpact as m}from"../components/community-impact.js";import{BeamCumulativeImpact as e}from"../components/cumulative-impact.js";import{BeamImpactOverview as a}from"../components/impact-overview.js";import{BeamSelectNonprofit as t}from"../components/select-nonprofit.js";import{BeamRedeemTransaction as o}from"../components/redeem-transaction.js";import{BeamPostPurchase as r}from"../components/post-purchase.js";import{BeamSubscriptionManagement as i}from"../components/subscription-management.js";var p=Object.freeze({__proto__:null,BeamCommunityImpact:m,BeamCumulativeImpact:e,BeamImpactOverview:a,BeamPostPurchase:r,BeamRedeemTransaction:o,BeamSelectNonprofit:t,BeamSubscriptionManagement:i});export{p as i};
2
+ //# sourceMappingURL=index-IzAvjker.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-IzAvjker.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{b as e}from"./beam-errors-AMvTvR1C.esm.js";import{e as o}from"./events-5IECSF-x.esm.js";import{logger as r}from"../utils/logger.esm.js";import{fetchProxy as t,initNetworkListeners as i,xhrProxy as m}from"../utils/network-listeners.esm.js";import{createScopedLocalStorage as a}from"../utils/local-storage.esm.js";import{waitForElement as s}from"../utils/wait-for-element.esm.js";import{deleteCookieValue as l,getCookieMap as n,getCookieValue as p,setCookieValue as f}from"../utils/cookies.esm.js";import{getRemoteSession as g,saveRemoteSession as c}from"../utils/remote-session.esm.js";import{memoizeLast as u}from"../utils/memoize-last.esm.js";import{d as k,i as d}from"./lodash-P8OIs-at.esm.js";var x=Object.freeze({__proto__:null,createScopedLocalStorage:a,debounce:k,deleteCookieValue:l,errors:e,events:o,fetchProxy:t,getCookieMap:n,getCookieValue:p,getRemoteSession:g,initNetworkListeners:i,isEqual:d,logger:r,memoizeLast:u,saveRemoteSession:c,setCookieValue:f,waitForElement:s,xhrProxy:m});export{x as i};
2
- //# sourceMappingURL=index-uqEAgdEf.esm.js.map
1
+ import{b as e}from"./beam-errors-P-Lu07Ce.esm.js";import{e as o}from"./events-5IECSF-x.esm.js";import{logger as r}from"../utils/logger.esm.js";import{fetchProxy as t,initNetworkListeners as i,xhrProxy as m}from"../utils/network-listeners.esm.js";import{createScopedLocalStorage as a}from"../utils/local-storage.esm.js";import{waitForElement as s}from"../utils/wait-for-element.esm.js";import{deleteCookieValue as l,getCookieMap as n,getCookieValue as p,setCookieValue as f}from"../utils/cookies.esm.js";import{getRemoteSession as g,saveRemoteSession as c}from"../utils/remote-session.esm.js";import{memoizeLast as u}from"../utils/memoize-last.esm.js";import{d as k,i as d}from"./lodash-P8OIs-at.esm.js";var x=Object.freeze({__proto__:null,createScopedLocalStorage:a,debounce:k,deleteCookieValue:l,errors:e,events:o,fetchProxy:t,getCookieMap:n,getCookieValue:p,getRemoteSession:g,initNetworkListeners:i,isEqual:d,logger:r,memoizeLast:u,saveRemoteSession:c,setCookieValue:f,waitForElement:s,xhrProxy:m});export{x as i};
2
+ //# sourceMappingURL=index-OnjTwvAw.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-OnjTwvAw.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{b as e}from"./beam-errors-AMvTvR1C.esm.js";import{e as o}from"./events-5IECSF-x.esm.js";import{logger as r}from"../utils/logger.js";import{fetchProxy as t,initNetworkListeners as i,xhrProxy as m}from"../utils/network-listeners.js";import{createScopedLocalStorage as a}from"../utils/local-storage.js";import{waitForElement as s}from"../utils/wait-for-element.js";import{deleteCookieValue as l,getCookieMap as n,getCookieValue as p,setCookieValue as f}from"../utils/cookies.js";import{getRemoteSession as g,saveRemoteSession as c}from"../utils/remote-session.js";import{memoizeLast as u}from"../utils/memoize-last.js";import{d as k,i as d}from"./lodash-P8OIs-at.esm.js";var x=Object.freeze({__proto__:null,createScopedLocalStorage:a,debounce:k,deleteCookieValue:l,errors:e,events:o,fetchProxy:t,getCookieMap:n,getCookieValue:p,getRemoteSession:g,initNetworkListeners:i,isEqual:d,logger:r,memoizeLast:u,saveRemoteSession:c,setCookieValue:f,waitForElement:s,xhrProxy:m});export{x as i};
2
- //# sourceMappingURL=index-rrdYIcOi.esm.js.map
1
+ import{b as e}from"./beam-errors-P-Lu07Ce.esm.js";import{e as o}from"./events-5IECSF-x.esm.js";import{logger as r}from"../utils/logger.js";import{fetchProxy as t,initNetworkListeners as i,xhrProxy as m}from"../utils/network-listeners.js";import{createScopedLocalStorage as a}from"../utils/local-storage.js";import{waitForElement as s}from"../utils/wait-for-element.js";import{deleteCookieValue as l,getCookieMap as n,getCookieValue as p,setCookieValue as f}from"../utils/cookies.js";import{getRemoteSession as g,saveRemoteSession as c}from"../utils/remote-session.js";import{memoizeLast as u}from"../utils/memoize-last.js";import{d as k,i as d}from"./lodash-P8OIs-at.esm.js";var x=Object.freeze({__proto__:null,createScopedLocalStorage:a,debounce:k,deleteCookieValue:l,errors:e,events:o,fetchProxy:t,getCookieMap:n,getCookieValue:p,getRemoteSession:g,initNetworkListeners:i,isEqual:d,logger:r,memoizeLast:u,saveRemoteSession:c,setCookieValue:f,waitForElement:s,xhrProxy:m});export{x as i};
2
+ //# sourceMappingURL=index-U8Oy2aur.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-U8Oy2aur.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{i}from"./index-9gijHGwh.esm.js";import{i as o}from"./index-t4uX5Dg1.esm.js";import{i as r}from"./index-9YcaEQju.esm.js";import{i as e}from"./index-ll8zLjbu.esm.js";import{i as m}from"./index-gULINFkH.esm.js";var s=Object.freeze({__proto__:null,Cart:e,Logs:m,Session:r,Shopify:o,Utils:i});export{s as i};
2
+ //# sourceMappingURL=index-XMD0b6ql.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-XMD0b6ql.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{a as i,e as n}from"./routes-h6eWTToy.esm.js";import{logger as d}from"../utils/logger.js";async function e(o,r){const{apiKey:a,baseUrl:s}=o;try{await n({baseUrl:s||i,headers:{authorization:`Api-Key ${a}`},requestBody:{...r}})}catch(t){d.error("Failed to send log",t)}}var l=Object.freeze({__proto__:null,sendLog:e});export{l as i,e as s};
2
- //# sourceMappingURL=index-e6o8bmIt.esm.js.map
1
+ import{a as i,e as n}from"./routes-CqjzL4oL.esm.js";import{logger as d}from"../utils/logger.js";async function e(o,r){const{apiKey:a,baseUrl:s}=o;try{await n({baseUrl:s||i,headers:{authorization:`Api-Key ${a}`},requestBody:{...r}})}catch(t){d.error("Failed to send log",t)}}var l=Object.freeze({__proto__:null,sendLog:e});export{l as i,e as s};
2
+ //# sourceMappingURL=index-fqDBrscF.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-e6o8bmIt.esm.js","sources":["../../src/integrations/logs/index.ts"],"sourcesContent":["import { postLogs } from \"../../api-sdk/v3/routes\";\nimport { paths } from \"../../api-sdk/v3/openapi-spec\";\nimport { logger } from \"../../utils/logger\";\nimport { DEFAULT_LOG_URL } from \"../../api-sdk/constants\";\n\ntype PostLogsReq = paths[\"/logs\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\ninterface SendLogConfig {\n apiKey: string;\n baseUrl?: string;\n}\n\nexport async function sendLog(config: SendLogConfig, payload: PostLogsReq): Promise<void> {\n const { apiKey, baseUrl } = config;\n try {\n await postLogs({\n baseUrl: baseUrl || DEFAULT_LOG_URL,\n headers: {\n authorization: `Api-Key ${apiKey}`,\n },\n requestBody: {\n ...payload,\n },\n });\n } catch (err) {\n logger.error(\"Failed to send log\", err);\n }\n}\n"],"names":["sendLog","config","payload","apiKey","baseUrl","postLogs","DEFAULT_LOG_URL","err","logger"],"mappings":"gGAYA,eAAsBA,EAAQC,EAAuBC,EAAqC,CACxF,KAAM,CAAE,OAAAC,EAAQ,QAAAC,CAAQ,EAAIH,EAC5B,GAAI,CACF,MAAMI,EAAS,CACb,QAASD,GAAWE,EACpB,QAAS,CACP,cAAe,WAAWH,CAAM,EAClC,EACA,YAAa,CACX,GAAGD,CACL,CACF,CAAC,CACH,OAASK,EAAK,CACZC,EAAO,MAAM,qBAAsBD,CAAG,CACxC,CACF"}
1
+ {"version":3,"file":"index-fqDBrscF.esm.js","sources":["../../src/integrations/logs/index.ts"],"sourcesContent":["import { postLogs } from \"../../api-sdk/v3/routes\";\nimport { paths } from \"../../api-sdk/v3/openapi-spec\";\nimport { logger } from \"../../utils/logger\";\nimport { DEFAULT_LOG_URL } from \"../../api-sdk/constants\";\n\ntype PostLogsReq = paths[\"/logs\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\ninterface SendLogConfig {\n apiKey: string;\n baseUrl?: string;\n}\n\nexport async function sendLog(config: SendLogConfig, payload: PostLogsReq): Promise<void> {\n const { apiKey, baseUrl } = config;\n try {\n await postLogs({\n baseUrl: baseUrl || DEFAULT_LOG_URL,\n headers: {\n authorization: `Api-Key ${apiKey}`,\n },\n requestBody: {\n ...payload,\n },\n });\n } catch (err) {\n logger.error(\"Failed to send log\", err);\n }\n}\n"],"names":["sendLog","config","payload","apiKey","baseUrl","postLogs","DEFAULT_LOG_URL","err","logger"],"mappings":"gGAYA,eAAsBA,EAAQC,EAAuBC,EAAqC,CACxF,KAAM,CAAE,OAAAC,EAAQ,QAAAC,CAAQ,EAAIH,EAC5B,GAAI,CACF,MAAMI,EAAS,CACb,QAASD,GAAWE,EACpB,QAAS,CACP,cAAe,WAAWH,CAAM,EAClC,EACA,YAAa,CACX,GAAGD,CACL,CACF,CAAC,CACH,OAASK,EAAK,CACZC,EAAO,MAAM,qBAAsBD,CAAG,CACxC,CACF"}
@@ -1,2 +1,2 @@
1
- import{a as i,e as n}from"./routes-bWWE2fXp.esm.js";import{logger as d}from"../utils/logger.esm.js";async function e(o,r){const{apiKey:a,baseUrl:s}=o;try{await n({baseUrl:s||i,headers:{authorization:`Api-Key ${a}`},requestBody:{...r}})}catch(t){d.error("Failed to send log",t)}}var l=Object.freeze({__proto__:null,sendLog:e});export{l as i,e as s};
2
- //# sourceMappingURL=index-JfA-djTR.esm.js.map
1
+ import{a as i,e as n}from"./routes-lsOWIDmE.esm.js";import{logger as d}from"../utils/logger.esm.js";async function e(o,r){const{apiKey:a,baseUrl:s}=o;try{await n({baseUrl:s||i,headers:{authorization:`Api-Key ${a}`},requestBody:{...r}})}catch(t){d.error("Failed to send log",t)}}var l=Object.freeze({__proto__:null,sendLog:e});export{l as i,e as s};
2
+ //# sourceMappingURL=index-gULINFkH.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-JfA-djTR.esm.js","sources":["../../src/integrations/logs/index.ts"],"sourcesContent":["import { postLogs } from \"../../api-sdk/v3/routes\";\nimport { paths } from \"../../api-sdk/v3/openapi-spec\";\nimport { logger } from \"../../utils/logger\";\nimport { DEFAULT_LOG_URL } from \"../../api-sdk/constants\";\n\ntype PostLogsReq = paths[\"/logs\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\ninterface SendLogConfig {\n apiKey: string;\n baseUrl?: string;\n}\n\nexport async function sendLog(config: SendLogConfig, payload: PostLogsReq): Promise<void> {\n const { apiKey, baseUrl } = config;\n try {\n await postLogs({\n baseUrl: baseUrl || DEFAULT_LOG_URL,\n headers: {\n authorization: `Api-Key ${apiKey}`,\n },\n requestBody: {\n ...payload,\n },\n });\n } catch (err) {\n logger.error(\"Failed to send log\", err);\n }\n}\n"],"names":["sendLog","config","payload","apiKey","baseUrl","postLogs","DEFAULT_LOG_URL","err","logger"],"mappings":"oGAYA,eAAsBA,EAAQC,EAAuBC,EAAqC,CACxF,KAAM,CAAE,OAAAC,EAAQ,QAAAC,CAAQ,EAAIH,EAC5B,GAAI,CACF,MAAMI,EAAS,CACb,QAASD,GAAWE,EACpB,QAAS,CACP,cAAe,WAAWH,CAAM,EAClC,EACA,YAAa,CACX,GAAGD,CACL,CACF,CAAC,CACH,OAASK,EAAK,CACZC,EAAO,MAAM,qBAAsBD,CAAG,CACxC,CACF"}
1
+ {"version":3,"file":"index-gULINFkH.esm.js","sources":["../../src/integrations/logs/index.ts"],"sourcesContent":["import { postLogs } from \"../../api-sdk/v3/routes\";\nimport { paths } from \"../../api-sdk/v3/openapi-spec\";\nimport { logger } from \"../../utils/logger\";\nimport { DEFAULT_LOG_URL } from \"../../api-sdk/constants\";\n\ntype PostLogsReq = paths[\"/logs\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\ninterface SendLogConfig {\n apiKey: string;\n baseUrl?: string;\n}\n\nexport async function sendLog(config: SendLogConfig, payload: PostLogsReq): Promise<void> {\n const { apiKey, baseUrl } = config;\n try {\n await postLogs({\n baseUrl: baseUrl || DEFAULT_LOG_URL,\n headers: {\n authorization: `Api-Key ${apiKey}`,\n },\n requestBody: {\n ...payload,\n },\n });\n } catch (err) {\n logger.error(\"Failed to send log\", err);\n }\n}\n"],"names":["sendLog","config","payload","apiKey","baseUrl","postLogs","DEFAULT_LOG_URL","err","logger"],"mappings":"oGAYA,eAAsBA,EAAQC,EAAuBC,EAAqC,CACxF,KAAM,CAAE,OAAAC,EAAQ,QAAAC,CAAQ,EAAIH,EAC5B,GAAI,CACF,MAAMI,EAAS,CACb,QAASD,GAAWE,EACpB,QAAS,CACP,cAAe,WAAWH,CAAM,EAClC,EACA,YAAa,CACX,GAAGD,CACL,CACF,CAAC,CACH,OAASK,EAAK,CACZC,EAAO,MAAM,qBAAsBD,CAAG,CACxC,CACF"}
@@ -0,0 +1,2 @@
1
+ import{x as e}from"./update-cart-yneR8zk1.esm.js";var r=Object.freeze({__proto__:null,updateCart:e});export{r as i};
2
+ //# sourceMappingURL=index-ll8zLjbu.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-ll8zLjbu.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{BeamCommunityImpact as m}from"../react/community-impact.esm.js";import{BeamCumulativeImpact as e}from"../react/cumulative-impact.esm.js";import{BeamImpactOverview as a}from"../react/impact-overview.esm.js";import{BeamSelectNonprofit as t}from"../react/select-nonprofit.esm.js";import{BeamRedeemTransaction as o}from"../react/redeem-transaction.esm.js";import{BeamPostPurchase as r}from"../react/post-purchase.esm.js";import{BeamSubscriptionManagement as i}from"../react/subscription-management.esm.js";var p=Object.freeze({__proto__:null,BeamCommunityImpact:m,BeamCumulativeImpact:e,BeamImpactOverview:a,BeamPostPurchase:r,BeamRedeemTransaction:o,BeamSelectNonprofit:t,BeamSubscriptionManagement:i});export{p as i};
2
+ //# sourceMappingURL=index-o7YiP4gC.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-o7YiP4gC.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -4,6 +4,7 @@ import { BeamImpactOverview } from '../components/impact-overview.js';
4
4
  import { BeamSelectNonprofit } from '../components/select-nonprofit.js';
5
5
  import { BeamRedeemTransaction } from '../components/redeem-transaction.js';
6
6
  import { BeamPostPurchase } from '../components/post-purchase.js';
7
+ import { BeamSubscriptionManagement } from '../components/subscription-management.js';
7
8
 
8
9
  /**
9
10
  * This file is used to provide type definitions
@@ -15,8 +16,9 @@ declare const index_BeamImpactOverview: typeof BeamImpactOverview;
15
16
  declare const index_BeamPostPurchase: typeof BeamPostPurchase;
16
17
  declare const index_BeamRedeemTransaction: typeof BeamRedeemTransaction;
17
18
  declare const index_BeamSelectNonprofit: typeof BeamSelectNonprofit;
19
+ declare const index_BeamSubscriptionManagement: typeof BeamSubscriptionManagement;
18
20
  declare namespace index {
19
- export { index_BeamCommunityImpact as BeamCommunityImpact, index_BeamCumulativeImpact as BeamCumulativeImpact, index_BeamImpactOverview as BeamImpactOverview, index_BeamPostPurchase as BeamPostPurchase, index_BeamRedeemTransaction as BeamRedeemTransaction, index_BeamSelectNonprofit as BeamSelectNonprofit };
21
+ export { index_BeamCommunityImpact as BeamCommunityImpact, index_BeamCumulativeImpact as BeamCumulativeImpact, index_BeamImpactOverview as BeamImpactOverview, index_BeamPostPurchase as BeamPostPurchase, index_BeamRedeemTransaction as BeamRedeemTransaction, index_BeamSelectNonprofit as BeamSelectNonprofit, index_BeamSubscriptionManagement as BeamSubscriptionManagement };
20
22
  }
21
23
 
22
24
  export { index as i };
@@ -1,5 +1,5 @@
1
- import { b as beamErrors } from './beam-errors-bKCZlkvr.esm.js';
2
- import { e as events } from './events-PZnG_xac.esm.js';
1
+ import { b as beamErrors } from './beam-errors-fXDkG1zo.esm.js';
2
+ import { e as events } from './events-qTu4iIOo.esm.js';
3
3
  import { logger } from '../utils/logger.js';
4
4
  import { fetchProxy, initNetworkListeners, xhrProxy } from '../utils/network-listeners.js';
5
5
  import { createScopedLocalStorage } from '../utils/local-storage.js';
@@ -0,0 +1,2 @@
1
+ import{i}from"./index-U8Oy2aur.esm.js";import{i as o}from"./index-1qXot92e.esm.js";import{i as r}from"./index-Z1UUeVXR.esm.js";import{i as e}from"./index-EpanGShY.esm.js";import{i as m}from"./index-fqDBrscF.esm.js";var s=Object.freeze({__proto__:null,Cart:e,Logs:m,Session:r,Shopify:o,Utils:i});export{s as i};
2
+ //# sourceMappingURL=index-r9Yb1UY4.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-r9Yb1UY4.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{h as e,C as r,O as t,s as a,L as o}from"./order-page-JdaAppB7.esm.js";var s=Object.freeze({__proto__:null,addBeamAttributesToCart:e,getCurrentCart:r,registerCartIntegration:t,showBeamOrderPageWidgets:a,trackCart:o});export{s as i};
2
+ //# sourceMappingURL=index-t4uX5Dg1.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-t4uX5Dg1.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { p as paths } from './openapi-spec-tJkr2i9K.esm.js';
1
+ import { p as paths } from './openapi-spec-D_Zzbl2J.esm.js';
2
2
 
3
3
  type PostLogsReq = paths["/logs"]["post"]["requestBody"]["content"]["application/json"];
4
4
  interface SendLogConfig {
@@ -1,2 +1,2 @@
1
- import{b as e}from"./beam-errors-AMvTvR1C.esm.js";import{e as o}from"./events-5IECSF-x.esm.js";import{logger as r}from"../utils/logger.js";import{fetchProxy as t,initNetworkListeners as i,xhrProxy as m}from"../utils/network-listeners.js";import{createScopedLocalStorage as a}from"../utils/local-storage.js";import{waitForElement as s}from"../utils/wait-for-element.js";import{deleteCookieValue as l,getCookieMap as n,getCookieValue as p,setCookieValue as f}from"../utils/cookies.js";import{getRemoteSession as g,saveRemoteSession as c}from"../utils/remote-session.js";import{memoizeLast as u}from"../utils/memoize-last.js";import{d as k,i as d}from"./lodash-P8OIs-at.esm.js";var x=Object.freeze({__proto__:null,createScopedLocalStorage:a,debounce:k,deleteCookieValue:l,errors:e,events:o,fetchProxy:t,getCookieMap:n,getCookieValue:p,getRemoteSession:g,initNetworkListeners:i,isEqual:d,logger:r,memoizeLast:u,saveRemoteSession:c,setCookieValue:f,waitForElement:s,xhrProxy:m});export{x as i};
2
- //# sourceMappingURL=index-w9_XpjIg.esm.js.map
1
+ import{b as e}from"./beam-errors-P-Lu07Ce.esm.js";import{e as o}from"./events-5IECSF-x.esm.js";import{logger as r}from"../utils/logger.js";import{fetchProxy as t,initNetworkListeners as i,xhrProxy as m}from"../utils/network-listeners.js";import{createScopedLocalStorage as a}from"../utils/local-storage.js";import{waitForElement as s}from"../utils/wait-for-element.js";import{deleteCookieValue as l,getCookieMap as n,getCookieValue as p,setCookieValue as f}from"../utils/cookies.js";import{getRemoteSession as g,saveRemoteSession as c}from"../utils/remote-session.js";import{memoizeLast as u}from"../utils/memoize-last.js";import{d as k,i as d}from"./lodash-P8OIs-at.esm.js";var x=Object.freeze({__proto__:null,createScopedLocalStorage:a,debounce:k,deleteCookieValue:l,errors:e,events:o,fetchProxy:t,getCookieMap:n,getCookieValue:p,getRemoteSession:g,initNetworkListeners:i,isEqual:d,logger:r,memoizeLast:u,saveRemoteSession:c,setCookieValue:f,waitForElement:s,xhrProxy:m});export{x as i};
2
+ //# sourceMappingURL=index-wsdeaTHd.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-wsdeaTHd.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import{y as l,j as h}from"./lit-yVXn5Cbs.esm.js";import{logger as $}from"../utils/logger.esm.js";import{B as g}from"./beam-errors-P-Lu07Ce.esm.js";const c={loading:""},p=()=>l`<p class="beam-loading">${c.loading}</p>`,y=(o="",{fontFamily:n="inherit",fontStyle:r="inherit",fontSize:e="inherit",fontWeight:i="inherit",textTransform:a="none",marginTop:s="0",lineHeight:f="inherit",color:m="inherit"}={})=>{const t=o.startsWith("--beam-")?o:`--beam-${o}`;return{[`${t}-fontFamily`]:n,[`${t}-fontStyle`]:r,[`${t}-fontSize`]:e,[`${t}-fontWeight`]:i,[`${t}-textTransform`]:a,[`${t}-marginTop`]:s,[`${t}-lineHeight`]:f,[`${t}-color`]:m}},S=(o="",{fontFamily:n="inherit",fontStyle:r="inherit",fontSize:e="inherit",fontWeight:i="inherit",textTransform:a="none",marginTop:s="0",lineHeight:f="inherit",color:m="inherit"}={})=>{const t=o.startsWith("--beam-")?o:`--beam-${o}`;return h(` font-family: var(${t}-fontFamily, ${n});
2
+ font-style: var(${t}-fontStyle, ${r});
3
+ font-size: var(${t}-fontSize, ${e});
4
+ font-weight: var(${t}-fontWeight, ${i});
5
+ text-transform: var(${t}-textTransform, ${a});
6
+ margin-top: var(${t}-marginTop, ${s});
7
+ line-height: var(${t}-lineHeight, ${f});
8
+ color: var(${t}-color, ${m});
9
+ `)},T=(o,n)=>{if(n.startsWith("{"))try{const r=JSON.parse(n);return r[o]??r.en??n}catch{return $.error(new g("Failed to extract JSON translation from string"),n),n}return n};export{p as _,y as d,T as i,S as u};
10
+ //# sourceMappingURL=localize-GCkVUD8S.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localize-GCkVUD8S.esm.js","sources":["../../src/shared/fragments/loading-template.ts","../../src/shared/fragments/custom-text.ts","../../src/shared/localize.ts"],"sourcesContent":["import { html } from \"lit\";\n\nconst strings = {\n loading: \"\", // Default is no loading content\n};\n\nexport const _loading = () => {\n return html`<p class=\"beam-loading\">${strings.loading}</p>`;\n};\n","import { CSSResult, unsafeCSS } from \"lit\";\n\n/**\n * Create an object that can be passed to cssVariableMap\n * to define CSS variables in a style tag. The default properties\n * are the ones exposed for customization in the remote config interface.\n * @example\n * const variables = {\n * ...customizableTextJs(\"widget-header\",\n * \"widget-border-color\": \"red\"\n * };\n *\n * html`<style>:host { ${_cssVariableMap(variables)} }</style>`;\n * @returns {{[p: string]: string}}\n */\nexport const defineCustomText = (\n namespace = \"\",\n {\n fontFamily = \"inherit\",\n fontStyle = \"inherit\",\n fontSize = \"inherit\",\n fontWeight = \"inherit\",\n textTransform = \"none\",\n marginTop = \"0\",\n lineHeight = \"inherit\",\n color = \"inherit\",\n } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n [`${prefix}-fontFamily`]: fontFamily,\n [`${prefix}-fontStyle`]: fontStyle,\n [`${prefix}-fontSize`]: fontSize,\n [`${prefix}-fontWeight`]: fontWeight,\n [`${prefix}-textTransform`]: textTransform,\n [`${prefix}-marginTop`]: marginTop,\n [`${prefix}-lineHeight`]: lineHeight,\n [`${prefix}-color`]: color,\n };\n};\n\n/**\n * Returns a string that defines css properties based on variables,\n * which can be used in a css`` template. The default properties are the\n * ones exposed for customization in the remote config interface.\n * @example\n * css`.widget-header { ${customizableTextCss(\"widget-header\")} border: none; }`\n * @returns {CSSResult}\n */\nexport const useCustomText = (\n namespace = \"\",\n {\n fontFamily = \"inherit\",\n fontStyle = \"inherit\",\n fontSize = \"inherit\",\n fontWeight = \"inherit\",\n textTransform = \"none\",\n marginTop = \"0\",\n lineHeight = \"inherit\",\n color = \"inherit\",\n } = {}\n): CSSResult => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return unsafeCSS(`\\\n font-family: var(${prefix}-fontFamily, ${fontFamily});\n font-style: var(${prefix}-fontStyle, ${fontStyle});\n font-size: var(${prefix}-fontSize, ${fontSize});\n font-weight: var(${prefix}-fontWeight, ${fontWeight});\n text-transform: var(${prefix}-textTransform, ${textTransform});\n margin-top: var(${prefix}-marginTop, ${marginTop});\n line-height: var(${prefix}-lineHeight, ${lineHeight});\n color: var(${prefix}-color, ${color});\n `);\n};\n\n/**\n * Same as useCustomText except returns an object that can be passed to styleMap\n */\nexport const useCustomTextMap = (\n namespace = \"\",\n {\n fontSize = \"inherit\",\n fontStyle = \"inherit\",\n fontWeight = \"inherit\",\n textTransform = \"none\",\n marginTop = \"0\",\n lineHeight = \"inherit\",\n } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n fontSize: `var(${prefix}-fontSize, ${fontSize})`,\n fontStyle: `var(${prefix}-fontStyle, ${fontStyle})`,\n fontWeight: `var(${prefix}-fontWeight, ${fontWeight})`,\n textTransform: `var(${prefix}-textTransform, ${textTransform})`,\n marginTop: `var(${prefix}-marginTop, ${marginTop})`,\n lineHeight: `var(${prefix}-lineHeight, ${lineHeight})`,\n };\n};\n","import { LANGUAGES } from \"../api-sdk/types\";\nimport { logger } from \"../utils/logger\";\nimport { BeamError } from \"../utils/beam-errors\";\n\n/**\n * User-provided strings may include embedded translations in JSON form\n * This function extracts the string for the provided language\n * If it fails to parse, or the string is not json-like, it returns the whole string\n * TODO: consider returning unsafeHtml() or adding an option for it\n */\nconst localizeUserString = (lang: LANGUAGES, str: string): string => {\n const isJson = str.startsWith(\"{\");\n if (isJson) {\n try {\n const json = JSON.parse(str);\n return json[lang] ?? json[\"en\"] ?? str;\n } catch (err) {\n logger.error(new BeamError(\"Failed to extract JSON translation from string\"), str);\n return str;\n }\n }\n return str;\n};\n\nexport { localizeUserString };\n"],"names":["strings","_loading","html","defineCustomText","namespace","fontFamily","fontStyle","fontSize","fontWeight","textTransform","marginTop","lineHeight","color","prefix","useCustomText","unsafeCSS","localizeUserString","lang","str","json","logger","BeamError"],"mappings":"mJAEA,MAAMA,EAAU,CACd,QAAS,EACX,EAEaC,EAAW,IACfC,4BAA+BF,EAAQ,OAAO,OCQ1CG,EAAmB,CAC9BC,EAAY,GACZ,CACE,WAAAC,EAAa,UACb,UAAAC,EAAY,UACZ,SAAAC,EAAW,UACX,WAAAC,EAAa,UACb,cAAAC,EAAgB,OAChB,UAAAC,EAAY,IACZ,WAAAC,EAAa,UACb,MAAAC,EAAQ,SACV,EAAI,CAAA,IACuB,CAC3B,MAAMC,EAAST,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,MAAO,CACL,CAAC,GAAGS,CAAM,aAAa,EAAGR,EAC1B,CAAC,GAAGQ,CAAM,YAAY,EAAGP,EACzB,CAAC,GAAGO,CAAM,WAAW,EAAGN,EACxB,CAAC,GAAGM,CAAM,aAAa,EAAGL,EAC1B,CAAC,GAAGK,CAAM,gBAAgB,EAAGJ,EAC7B,CAAC,GAAGI,CAAM,YAAY,EAAGH,EACzB,CAAC,GAAGG,CAAM,aAAa,EAAGF,EAC1B,CAAC,GAAGE,CAAM,QAAQ,EAAGD,CACvB,CACF,EAUaE,EAAgB,CAC3BV,EAAY,GACZ,CACE,WAAAC,EAAa,UACb,UAAAC,EAAY,UACZ,SAAAC,EAAW,UACX,WAAAC,EAAa,UACb,cAAAC,EAAgB,OAChB,UAAAC,EAAY,IACZ,WAAAC,EAAa,UACb,MAAAC,EAAQ,SACV,EAAI,CACU,IAAA,CACd,MAAMC,EAAST,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,OAAOW,EAAU,4BACQF,CAAM,gBAAgBR,CAAU;AAAA,0BACjCQ,CAAM,eAAeP,CAAS;AAAA,yBAC/BO,CAAM,cAAcN,CAAQ;AAAA,2BAC1BM,CAAM,gBAAgBL,CAAU;AAAA,8BAC7BK,CAAM,mBAAmBJ,CAAa;AAAA,0BAC1CI,CAAM,eAAeH,CAAS;AAAA,2BAC7BG,CAAM,gBAAgBF,CAAU;AAAA,qBACtCE,CAAM,WAAWD,CAAK;AAAA,KACtC,CACL,EC/DMI,EAAqB,CAACC,EAAiBC,IAAwB,CAEnE,GADeA,EAAI,WAAW,GAAG,EAE/B,GAAI,CACF,MAAMC,EAAO,KAAK,MAAMD,CAAG,EAC3B,OAAOC,EAAKF,CAAI,GAAKE,EAAK,IAASD,CACrC,MAAc,CACZ,OAAAE,EAAO,MAAM,IAAIC,EAAU,gDAAgD,EAAGH,CAAG,EAC1EA,CACT,CAEF,OAAOA,CACT"}
@@ -0,0 +1,10 @@
1
+ import{y as l,j as h}from"./lit-yVXn5Cbs.esm.js";import{logger as $}from"../utils/logger.js";import{B as g}from"./beam-errors-P-Lu07Ce.esm.js";const c={loading:""},p=()=>l`<p class="beam-loading">${c.loading}</p>`,y=(o="",{fontFamily:n="inherit",fontStyle:r="inherit",fontSize:e="inherit",fontWeight:i="inherit",textTransform:a="none",marginTop:s="0",lineHeight:f="inherit",color:m="inherit"}={})=>{const t=o.startsWith("--beam-")?o:`--beam-${o}`;return{[`${t}-fontFamily`]:n,[`${t}-fontStyle`]:r,[`${t}-fontSize`]:e,[`${t}-fontWeight`]:i,[`${t}-textTransform`]:a,[`${t}-marginTop`]:s,[`${t}-lineHeight`]:f,[`${t}-color`]:m}},S=(o="",{fontFamily:n="inherit",fontStyle:r="inherit",fontSize:e="inherit",fontWeight:i="inherit",textTransform:a="none",marginTop:s="0",lineHeight:f="inherit",color:m="inherit"}={})=>{const t=o.startsWith("--beam-")?o:`--beam-${o}`;return h(` font-family: var(${t}-fontFamily, ${n});
2
+ font-style: var(${t}-fontStyle, ${r});
3
+ font-size: var(${t}-fontSize, ${e});
4
+ font-weight: var(${t}-fontWeight, ${i});
5
+ text-transform: var(${t}-textTransform, ${a});
6
+ margin-top: var(${t}-marginTop, ${s});
7
+ line-height: var(${t}-lineHeight, ${f});
8
+ color: var(${t}-color, ${m});
9
+ `)},T=(o,n)=>{if(n.startsWith("{"))try{const r=JSON.parse(n);return r[o]??r.en??n}catch{return $.error(new g("Failed to extract JSON translation from string"),n),n}return n};export{p as _,y as d,T as i,S as u};
10
+ //# sourceMappingURL=localize-pzAAkBvG.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localize-pzAAkBvG.esm.js","sources":["../../src/shared/fragments/loading-template.ts","../../src/shared/fragments/custom-text.ts","../../src/shared/localize.ts"],"sourcesContent":["import { html } from \"lit\";\n\nconst strings = {\n loading: \"\", // Default is no loading content\n};\n\nexport const _loading = () => {\n return html`<p class=\"beam-loading\">${strings.loading}</p>`;\n};\n","import { CSSResult, unsafeCSS } from \"lit\";\n\n/**\n * Create an object that can be passed to cssVariableMap\n * to define CSS variables in a style tag. The default properties\n * are the ones exposed for customization in the remote config interface.\n * @example\n * const variables = {\n * ...customizableTextJs(\"widget-header\",\n * \"widget-border-color\": \"red\"\n * };\n *\n * html`<style>:host { ${_cssVariableMap(variables)} }</style>`;\n * @returns {{[p: string]: string}}\n */\nexport const defineCustomText = (\n namespace = \"\",\n {\n fontFamily = \"inherit\",\n fontStyle = \"inherit\",\n fontSize = \"inherit\",\n fontWeight = \"inherit\",\n textTransform = \"none\",\n marginTop = \"0\",\n lineHeight = \"inherit\",\n color = \"inherit\",\n } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n [`${prefix}-fontFamily`]: fontFamily,\n [`${prefix}-fontStyle`]: fontStyle,\n [`${prefix}-fontSize`]: fontSize,\n [`${prefix}-fontWeight`]: fontWeight,\n [`${prefix}-textTransform`]: textTransform,\n [`${prefix}-marginTop`]: marginTop,\n [`${prefix}-lineHeight`]: lineHeight,\n [`${prefix}-color`]: color,\n };\n};\n\n/**\n * Returns a string that defines css properties based on variables,\n * which can be used in a css`` template. The default properties are the\n * ones exposed for customization in the remote config interface.\n * @example\n * css`.widget-header { ${customizableTextCss(\"widget-header\")} border: none; }`\n * @returns {CSSResult}\n */\nexport const useCustomText = (\n namespace = \"\",\n {\n fontFamily = \"inherit\",\n fontStyle = \"inherit\",\n fontSize = \"inherit\",\n fontWeight = \"inherit\",\n textTransform = \"none\",\n marginTop = \"0\",\n lineHeight = \"inherit\",\n color = \"inherit\",\n } = {}\n): CSSResult => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return unsafeCSS(`\\\n font-family: var(${prefix}-fontFamily, ${fontFamily});\n font-style: var(${prefix}-fontStyle, ${fontStyle});\n font-size: var(${prefix}-fontSize, ${fontSize});\n font-weight: var(${prefix}-fontWeight, ${fontWeight});\n text-transform: var(${prefix}-textTransform, ${textTransform});\n margin-top: var(${prefix}-marginTop, ${marginTop});\n line-height: var(${prefix}-lineHeight, ${lineHeight});\n color: var(${prefix}-color, ${color});\n `);\n};\n\n/**\n * Same as useCustomText except returns an object that can be passed to styleMap\n */\nexport const useCustomTextMap = (\n namespace = \"\",\n {\n fontSize = \"inherit\",\n fontStyle = \"inherit\",\n fontWeight = \"inherit\",\n textTransform = \"none\",\n marginTop = \"0\",\n lineHeight = \"inherit\",\n } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n fontSize: `var(${prefix}-fontSize, ${fontSize})`,\n fontStyle: `var(${prefix}-fontStyle, ${fontStyle})`,\n fontWeight: `var(${prefix}-fontWeight, ${fontWeight})`,\n textTransform: `var(${prefix}-textTransform, ${textTransform})`,\n marginTop: `var(${prefix}-marginTop, ${marginTop})`,\n lineHeight: `var(${prefix}-lineHeight, ${lineHeight})`,\n };\n};\n","import { LANGUAGES } from \"../api-sdk/types\";\nimport { logger } from \"../utils/logger\";\nimport { BeamError } from \"../utils/beam-errors\";\n\n/**\n * User-provided strings may include embedded translations in JSON form\n * This function extracts the string for the provided language\n * If it fails to parse, or the string is not json-like, it returns the whole string\n * TODO: consider returning unsafeHtml() or adding an option for it\n */\nconst localizeUserString = (lang: LANGUAGES, str: string): string => {\n const isJson = str.startsWith(\"{\");\n if (isJson) {\n try {\n const json = JSON.parse(str);\n return json[lang] ?? json[\"en\"] ?? str;\n } catch (err) {\n logger.error(new BeamError(\"Failed to extract JSON translation from string\"), str);\n return str;\n }\n }\n return str;\n};\n\nexport { localizeUserString };\n"],"names":["strings","_loading","html","defineCustomText","namespace","fontFamily","fontStyle","fontSize","fontWeight","textTransform","marginTop","lineHeight","color","prefix","useCustomText","unsafeCSS","localizeUserString","lang","str","json","logger","BeamError"],"mappings":"+IAEA,MAAMA,EAAU,CACd,QAAS,EACX,EAEaC,EAAW,IACfC,4BAA+BF,EAAQ,OAAO,OCQ1CG,EAAmB,CAC9BC,EAAY,GACZ,CACE,WAAAC,EAAa,UACb,UAAAC,EAAY,UACZ,SAAAC,EAAW,UACX,WAAAC,EAAa,UACb,cAAAC,EAAgB,OAChB,UAAAC,EAAY,IACZ,WAAAC,EAAa,UACb,MAAAC,EAAQ,SACV,EAAI,CAAA,IACuB,CAC3B,MAAMC,EAAST,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,MAAO,CACL,CAAC,GAAGS,CAAM,aAAa,EAAGR,EAC1B,CAAC,GAAGQ,CAAM,YAAY,EAAGP,EACzB,CAAC,GAAGO,CAAM,WAAW,EAAGN,EACxB,CAAC,GAAGM,CAAM,aAAa,EAAGL,EAC1B,CAAC,GAAGK,CAAM,gBAAgB,EAAGJ,EAC7B,CAAC,GAAGI,CAAM,YAAY,EAAGH,EACzB,CAAC,GAAGG,CAAM,aAAa,EAAGF,EAC1B,CAAC,GAAGE,CAAM,QAAQ,EAAGD,CACvB,CACF,EAUaE,EAAgB,CAC3BV,EAAY,GACZ,CACE,WAAAC,EAAa,UACb,UAAAC,EAAY,UACZ,SAAAC,EAAW,UACX,WAAAC,EAAa,UACb,cAAAC,EAAgB,OAChB,UAAAC,EAAY,IACZ,WAAAC,EAAa,UACb,MAAAC,EAAQ,SACV,EAAI,CACU,IAAA,CACd,MAAMC,EAAST,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,OAAOW,EAAU,4BACQF,CAAM,gBAAgBR,CAAU;AAAA,0BACjCQ,CAAM,eAAeP,CAAS;AAAA,yBAC/BO,CAAM,cAAcN,CAAQ;AAAA,2BAC1BM,CAAM,gBAAgBL,CAAU;AAAA,8BAC7BK,CAAM,mBAAmBJ,CAAa;AAAA,0BAC1CI,CAAM,eAAeH,CAAS;AAAA,2BAC7BG,CAAM,gBAAgBF,CAAU;AAAA,qBACtCE,CAAM,WAAWD,CAAK;AAAA,KACtC,CACL,EC/DMI,EAAqB,CAACC,EAAiBC,IAAwB,CAEnE,GADeA,EAAI,WAAW,GAAG,EAE/B,GAAI,CACF,MAAMC,EAAO,KAAK,MAAMD,CAAG,EAC3B,OAAOC,EAAKF,CAAI,GAAKE,EAAK,IAASD,CACrC,MAAc,CACZ,OAAAE,EAAO,MAAM,IAAIC,EAAU,gDAAgD,EAAGH,CAAG,EAC1EA,CACT,CAEF,OAAOA,CACT"}