@beamimpact/web-sdk 1.57.5 → 1.58.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 (217) hide show
  1. package/dist/chunks/{_share-dialog-dependencies-DsJ2sKCC.esm.js → _share-dialog-dependencies-DPid-O65.esm.js} +2 -2
  2. package/dist/chunks/{_share-dialog-dependencies-DsJ2sKCC.esm.js.map → _share-dialog-dependencies-DPid-O65.esm.js.map} +1 -1
  3. package/dist/chunks/{cart-DKQHSz5X.esm.d.ts → cart-Cm16_NVB.esm.d.ts} +3 -4
  4. package/dist/chunks/{css-card-grid-CiqEjkwR.esm.js → css-card-grid-tjA36yWj.esm.js} +2 -2
  5. package/dist/chunks/{css-card-grid-CiqEjkwR.esm.js.map → css-card-grid-tjA36yWj.esm.js.map} +1 -1
  6. package/dist/chunks/{handlebars-B_i-to-h.esm.js → handlebars-3tRO54kz.esm.js} +7 -7
  7. package/dist/chunks/{handlebars-B_i-to-h.esm.js.map → handlebars-3tRO54kz.esm.js.map} +1 -1
  8. package/dist/chunks/{index-DGOC8m2r.esm.d.ts → index-BG63SUjk.esm.d.ts} +1 -1
  9. package/dist/chunks/index-BiOlmhqL.esm.js +32 -0
  10. package/dist/chunks/index-BiOlmhqL.esm.js.map +1 -0
  11. package/dist/chunks/{index-Bi9LFICg.esm.d.ts → index-Bn65er6F.esm.d.ts} +1 -1
  12. package/dist/chunks/index-BygeMtqf.esm.js +2 -0
  13. package/dist/chunks/{index-BaAhcyM6.esm.js.map → index-BygeMtqf.esm.js.map} +1 -1
  14. package/dist/chunks/{index-BebFL9KU.esm.js → index-C8pScO8d.esm.js} +4 -4
  15. package/dist/chunks/index-C8pScO8d.esm.js.map +1 -0
  16. package/dist/chunks/{index-h_-rDiMR.esm.d.ts → index-CSQv0_2I.esm.d.ts} +1 -1
  17. package/dist/chunks/index-CsNyA6Px.esm.js +2 -0
  18. package/dist/chunks/index-CsNyA6Px.esm.js.map +1 -0
  19. package/dist/chunks/index-DnFFgYbT.esm.js +2 -0
  20. package/dist/chunks/index-DnFFgYbT.esm.js.map +1 -0
  21. package/dist/chunks/index-U1QpwjdF.esm.js +32 -0
  22. package/dist/chunks/index-U1QpwjdF.esm.js.map +1 -0
  23. package/dist/chunks/{index-DQ89VjpD.esm.d.ts → index-_M2mg4n1.esm.d.ts} +1 -1
  24. package/dist/chunks/{index-B-QZylCa.esm.js → index-lSPlMuMz.esm.js} +4 -4
  25. package/dist/chunks/index-lSPlMuMz.esm.js.map +1 -0
  26. package/dist/chunks/{index-Beh5bQDw.esm.js → index-tkscjKkq.esm.js} +7 -7
  27. package/dist/chunks/{index-Beh5bQDw.esm.js.map → index-tkscjKkq.esm.js.map} +1 -1
  28. package/dist/chunks/{promo-pill-label-BWPhroK6.esm.js → promo-pill-label-DYR3PZH7.esm.js} +2 -2
  29. package/dist/chunks/{promo-pill-label-BWPhroK6.esm.js.map → promo-pill-label-DYR3PZH7.esm.js.map} +1 -1
  30. package/dist/chunks/{share-button-C-QLknal.esm.js → share-button-CqrSfHAr.esm.js} +2 -2
  31. package/dist/chunks/{share-button-C-QLknal.esm.js.map → share-button-CqrSfHAr.esm.js.map} +1 -1
  32. package/dist/chunks/{share-button-CIP03E7T.esm.js → share-button-DP2wLhmP.esm.js} +2 -2
  33. package/dist/chunks/{share-button-CIP03E7T.esm.js.map → share-button-DP2wLhmP.esm.js.map} +1 -1
  34. package/dist/chunks/statsig-DlszSNOf.esm.js +2 -0
  35. package/dist/chunks/statsig-DlszSNOf.esm.js.map +1 -0
  36. package/dist/chunks/{update-cart-B5Tr9N3V.esm.d.ts → update-cart-uoS0BDZq.esm.d.ts} +1 -1
  37. package/dist/chunks/{utils-BPcZ5h8J.esm.d.ts → utils-DfsVjUY-.esm.d.ts} +1 -0
  38. package/dist/chunks/{utils-C5hmbxa4.esm.js → utils-ly9wMwUO.esm.js} +2 -2
  39. package/dist/chunks/utils-ly9wMwUO.esm.js.map +1 -0
  40. package/dist/components/beam-partner-logos.d.ts +1 -1
  41. package/dist/components/community-impact.d.ts +1 -1
  42. package/dist/components/community-impact.esm.js +1 -1
  43. package/dist/components/community-impact.js +1 -1
  44. package/dist/components/cumulative-impact.d.ts +1 -1
  45. package/dist/components/cumulative-impact.esm.js +1 -1
  46. package/dist/components/cumulative-impact.js +1 -1
  47. package/dist/components/impact-overview.d.ts +1 -1
  48. package/dist/components/impact-overview.esm.js +1 -1
  49. package/dist/components/impact-overview.js +1 -1
  50. package/dist/components/index.d.ts +1 -1
  51. package/dist/components/index.esm.js +1 -1
  52. package/dist/components/index.js +1 -1
  53. package/dist/components/post-purchase.d.ts +1 -1
  54. package/dist/components/post-purchase.esm.js +1 -1
  55. package/dist/components/post-purchase.js +1 -1
  56. package/dist/components/product-details-page.d.ts +1 -1
  57. package/dist/components/product-details-page.esm.js +3 -3
  58. package/dist/components/product-details-page.js +3 -3
  59. package/dist/components/redeem-transaction.d.ts +1 -1
  60. package/dist/components/redeem-transaction.esm.js +1 -1
  61. package/dist/components/redeem-transaction.js +1 -1
  62. package/dist/components/select-nonprofit.d.ts +1 -1
  63. package/dist/components/select-nonprofit.esm.js +25 -27
  64. package/dist/components/select-nonprofit.esm.js.map +1 -1
  65. package/dist/components/select-nonprofit.js +25 -27
  66. package/dist/components/select-nonprofit.js.map +1 -1
  67. package/dist/components/select-subscription-nonprofit.d.ts +1 -1
  68. package/dist/components/select-subscription-nonprofit.esm.js +2 -2
  69. package/dist/components/select-subscription-nonprofit.esm.js.map +1 -1
  70. package/dist/components/select-subscription-nonprofit.js +2 -2
  71. package/dist/components/select-subscription-nonprofit.js.map +1 -1
  72. package/dist/components/shopify.d.ts +4 -4
  73. package/dist/components/shopify.esm.js +1 -1
  74. package/dist/components/shopify.esm.js.map +1 -1
  75. package/dist/components/shopify.js +1 -1
  76. package/dist/components/shopify.js.map +1 -1
  77. package/dist/components/social-share.d.ts +1 -1
  78. package/dist/components/social-share.esm.js +1 -1
  79. package/dist/components/social-share.js +1 -1
  80. package/dist/components/subscriber-select-nonprofit.d.ts +1 -1
  81. package/dist/components/subscriber-select-nonprofit.esm.js +4 -4
  82. package/dist/components/subscriber-select-nonprofit.esm.js.map +1 -1
  83. package/dist/components/subscriber-select-nonprofit.js +4 -4
  84. package/dist/components/subscriber-select-nonprofit.js.map +1 -1
  85. package/dist/components/subscription-impact.d.ts +1 -1
  86. package/dist/components/subscription-impact.esm.js +1 -1
  87. package/dist/components/subscription-impact.js +1 -1
  88. package/dist/components/subscription-management.d.ts +1 -1
  89. package/dist/components/subscription-management.esm.js +1 -1
  90. package/dist/components/subscription-management.esm.js.map +1 -1
  91. package/dist/components/subscription-management.js +1 -1
  92. package/dist/components/subscription-management.js.map +1 -1
  93. package/dist/index.d.ts +7 -7
  94. package/dist/index.esm.js +1 -1
  95. package/dist/index.js +1 -1
  96. package/dist/integrations/beam.d.ts +1 -1
  97. package/dist/integrations/beam.esm.js +1 -1
  98. package/dist/integrations/beam.js +1 -1
  99. package/dist/integrations/cart.d.ts +2 -2
  100. package/dist/integrations/cart.esm.js +1 -1
  101. package/dist/integrations/cart.js +1 -1
  102. package/dist/integrations/logs.d.ts +2 -2
  103. package/dist/integrations/logs.esm.js +1 -1
  104. package/dist/integrations/logs.js +1 -1
  105. package/dist/integrations/promoManager.d.ts +1 -1
  106. package/dist/integrations/promoManager.esm.js +1 -1
  107. package/dist/integrations/promoManager.js +1 -1
  108. package/dist/integrations/session.esm.js +1 -1
  109. package/dist/integrations/session.js +1 -1
  110. package/dist/integrations/shopify-order.d.ts +1 -1
  111. package/dist/integrations/shopify-order.esm.js +1 -1
  112. package/dist/integrations/shopify-order.js +1 -1
  113. package/dist/integrations/shopify.d.ts +3 -3
  114. package/dist/integrations/shopify.esm.js +1 -1
  115. package/dist/integrations/shopify.js +1 -1
  116. package/dist/integrations/statsig.d.ts +8 -5
  117. package/dist/integrations/statsig.esm.js +14 -14
  118. package/dist/integrations/statsig.esm.js.map +1 -1
  119. package/dist/integrations/statsig.js +14 -14
  120. package/dist/integrations/statsig.js.map +1 -1
  121. package/dist/integrations/utils.d.ts +1 -1
  122. package/dist/integrations/utils.esm.js +1 -1
  123. package/dist/integrations/utils.js +1 -1
  124. package/dist/react/beam-partner-logos.d.ts +1 -1
  125. package/dist/react/community-impact.d.ts +1 -1
  126. package/dist/react/community-impact.esm.js +1 -1
  127. package/dist/react/community-impact.js +1 -1
  128. package/dist/react/cumulative-impact.d.ts +1 -1
  129. package/dist/react/cumulative-impact.esm.js +1 -1
  130. package/dist/react/cumulative-impact.js +1 -1
  131. package/dist/react/impact-overview.d.ts +1 -1
  132. package/dist/react/impact-overview.esm.js +1 -1
  133. package/dist/react/impact-overview.js +1 -1
  134. package/dist/react/index.d.ts +1 -1
  135. package/dist/react/index.esm.js +1 -1
  136. package/dist/react/index.js +1 -1
  137. package/dist/react/post-purchase.d.ts +1 -1
  138. package/dist/react/post-purchase.esm.js +1 -1
  139. package/dist/react/post-purchase.js +1 -1
  140. package/dist/react/product-details-page.d.ts +1 -1
  141. package/dist/react/product-details-page.esm.js +1 -1
  142. package/dist/react/product-details-page.js +1 -1
  143. package/dist/react/redeem-transaction.d.ts +1 -1
  144. package/dist/react/redeem-transaction.esm.js +1 -1
  145. package/dist/react/redeem-transaction.js +1 -1
  146. package/dist/react/select-nonprofit.d.ts +1 -1
  147. package/dist/react/select-nonprofit.esm.js +1 -1
  148. package/dist/react/select-nonprofit.js +1 -1
  149. package/dist/react/select-subscription-nonprofit.d.ts +1 -1
  150. package/dist/react/select-subscription-nonprofit.esm.js +1 -1
  151. package/dist/react/select-subscription-nonprofit.js +1 -1
  152. package/dist/react/shopify.esm.js +1 -1
  153. package/dist/react/shopify.esm.js.map +1 -1
  154. package/dist/react/shopify.js +1 -1
  155. package/dist/react/shopify.js.map +1 -1
  156. package/dist/react/social-share.d.ts +1 -1
  157. package/dist/react/social-share.esm.js +1 -1
  158. package/dist/react/social-share.js +1 -1
  159. package/dist/react/subscriber-select-nonprofit.d.ts +1 -1
  160. package/dist/react/subscriber-select-nonprofit.esm.js +1 -1
  161. package/dist/react/subscriber-select-nonprofit.js +1 -1
  162. package/dist/react/subscription-impact.d.ts +1 -1
  163. package/dist/react/subscription-impact.esm.js +1 -1
  164. package/dist/react/subscription-impact.js +1 -1
  165. package/dist/react/subscription-management.d.ts +1 -1
  166. package/dist/react/subscription-management.esm.js +1 -1
  167. package/dist/react/subscription-management.js +1 -1
  168. package/dist/utils/beam-errors.d.ts +1 -1
  169. package/dist/utils/beam-errors.esm.js +1 -1
  170. package/dist/utils/beam-errors.js +1 -1
  171. package/dist/utils/cart.d.ts +1 -1
  172. package/dist/utils/cart.esm.js +1 -1
  173. package/dist/utils/cart.js +1 -1
  174. package/dist/utils/clear-beam-storage.d.ts +1 -1
  175. package/dist/utils/clear-beam-storage.esm.js +1 -1
  176. package/dist/utils/clear-beam-storage.js +1 -1
  177. package/dist/utils/cookies.d.ts +1 -1
  178. package/dist/utils/cookies.esm.js +1 -1
  179. package/dist/utils/cookies.js +1 -1
  180. package/dist/utils/events.d.ts +1 -1
  181. package/dist/utils/events.esm.js +1 -1
  182. package/dist/utils/events.js +1 -1
  183. package/dist/utils/local-storage.d.ts +1 -1
  184. package/dist/utils/local-storage.esm.js +1 -1
  185. package/dist/utils/local-storage.js +1 -1
  186. package/dist/utils/logger.d.ts +1 -1
  187. package/dist/utils/logger.esm.js +1 -1
  188. package/dist/utils/logger.js +1 -1
  189. package/dist/utils/makeApiKeyHeader.d.ts +1 -1
  190. package/dist/utils/makeApiKeyHeader.esm.js +1 -1
  191. package/dist/utils/makeApiKeyHeader.js +1 -1
  192. package/dist/utils/memoize-last.d.ts +1 -1
  193. package/dist/utils/memoize-last.esm.js +1 -1
  194. package/dist/utils/memoize-last.js +1 -1
  195. package/dist/utils/network-listeners.d.ts +1 -1
  196. package/dist/utils/network-listeners.esm.js +1 -1
  197. package/dist/utils/network-listeners.js +1 -1
  198. package/dist/utils/promoManager.d.ts +1 -1
  199. package/dist/utils/promoManager.esm.js +1 -1
  200. package/dist/utils/promoManager.js +1 -1
  201. package/dist/utils/remote-session.d.ts +1 -1
  202. package/dist/utils/remote-session.esm.js +1 -1
  203. package/dist/utils/remote-session.js +1 -1
  204. package/dist/utils/wait-for-element.d.ts +1 -1
  205. package/dist/utils/wait-for-element.esm.js +1 -1
  206. package/dist/utils/wait-for-element.js +1 -1
  207. package/package.json +2 -1
  208. package/dist/chunks/index-B-QZylCa.esm.js.map +0 -1
  209. package/dist/chunks/index-B8g4VHgI.esm.js +0 -32
  210. package/dist/chunks/index-B8g4VHgI.esm.js.map +0 -1
  211. package/dist/chunks/index-BX0p4BVY.esm.js +0 -32
  212. package/dist/chunks/index-BX0p4BVY.esm.js.map +0 -1
  213. package/dist/chunks/index-BaAhcyM6.esm.js +0 -2
  214. package/dist/chunks/index-BebFL9KU.esm.js.map +0 -1
  215. package/dist/chunks/index-Duq6tIq8.esm.js +0 -2
  216. package/dist/chunks/index-Duq6tIq8.esm.js.map +0 -1
  217. package/dist/chunks/utils-C5hmbxa4.esm.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{m as E,b as r,i as B,n as p,r as z,a as A,h as L}from"../chunks/lit-BEag9MFp.esm.js";import{u as b,B as G,l as W,A as M,c as R,d as k,e as D,f as _}from"../chunks/index-Beh5bQDw.esm.js";import{D as O,z as j,A as H,h as U,C as K,E as w,W as y,x as N,v as V,F as q,G as J,H as Y,I as Z,m as S}from"../chunks/utils-C5hmbxa4.esm.js";import{c as Q,d as X,e as ee}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{c as te}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{p as oe}from"../chunks/promo-pill-label-BWPhroK6.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const ae=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},ie=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return E(` border-radius: var(${a}-borderRadius, ${e});
1
+ import{m as E,b as r,i as B,n as p,r as A,a as z,h as L}from"../chunks/lit-BEag9MFp.esm.js";import{u as b,B as G,l as W,A as M,c as R,d as k,e as D,f as _}from"../chunks/index-tkscjKkq.esm.js";import{D as O,A as j,C as H,h as U,E as K,F as w,W as y,y as N,x as V,G as q,H as J,I as Y,J as Z,m as S}from"../chunks/utils-ly9wMwUO.esm.js";import{c as Q,d as X,e as ee}from"../chunks/css-card-grid-tjA36yWj.esm.js";import{c as te}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{p as oe}from"../chunks/promo-pill-label-DYR3PZH7.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const ae=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},ie=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return E(` border-radius: var(${a}-borderRadius, ${e});
2
2
  border-style: var(${a}-borderStyle, ${t});
3
3
  border-color: var(${a}-borderColor, ${o});
4
4
  border-width: var(${a}-borderWidth, ${i});
@@ -17,7 +17,7 @@ import{m as E,b as r,i as B,n as p,r as z,a as A,h as L}from"../chunks/lit-BEag9
17
17
  <circle cx="12" cy="12" r="10"></circle>
18
18
  <path d="M12 16v-4"></path>
19
19
  <path d="M12 8h.01"></path>
20
- </svg>`,v={en:{ctaTitle:()=>"Choose Your Impact",ctaMessage:()=>"At no extra cost, 1% of every order will be donated to a nonprofit you choose. Add to cart to choose. Powered by Beam",inlineSeparator:()=>":"},fr:{ctaTitle:()=>"Choisissez votre impact",ctaMessage:()=>"Sans frais suppl\xE9mentaires, 1 % de chaque commande est revers\xE9 \xE0 l'association de votre choix. Ajoutez au panier pour choisir. Propuls\xE9 par Beam.",inlineSeparator:()=>":"},es:{ctaTitle:()=>"Elige tu impacto",ctaMessage:()=>"Sin coste adicional, el 1 % de cada pedido se dona a la organizaci\xF3n sin \xE1nimo de lucro que elijas. A\xF1\xE1delo al carrito para elegir. Impulsado por Beam.",inlineSeparator:()=>":"},de:{ctaTitle:()=>"W\xE4hlen Sie Ihren Impact",ctaMessage:()=>"Ohne zus\xE4tzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gew\xE4hlte gemeinn\xFCtzige Organisation gespendet. Zum Warenkorb hinzuf\xFCgen, um auszuw\xE4hlen. Unterst\xFCtzt von Beam.",inlineSeparator:()=>":"},it:{ctaTitle:()=>"Scegli il tuo impatto",ctaMessage:()=>"L'1 % di ogni acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a tua scelta. Aggiungi al carrello per scegliere. Promosso da Beam.",inlineSeparator:()=>":"},pl:{ctaTitle:()=>"Wybierz sw\xF3j wp\u0142yw",ctaMessage:()=>"1 % warto\u015Bci ka\u017Cdego zam\xF3wienia przekazywany jest na wybran\u0105 przez Ciebie organizacj\u0119 non-profit \u2013 bez dodatkowych koszt\xF3w. Dodaj do koszyka, aby wybra\u0107. Obs\u0142ugiwane przez Beam.",inlineSeparator:()=>":"},ja:{ctaTitle:()=>"\u5BC4\u4ED8\u5148\u3092\u304A\u9078\u3073\u304F\u3060\u3055\u3044\u3002",ctaMessage:()=>"\u8FFD\u52A0\u8CBB\u7528\u306A\u3057\u3067\u3001\u3054\u6CE8\u6587\u91D1\u984D\u306E1%\u3092\u975E\u55B6\u5229\u56E3\u4F53\u3078\u5BC4\u4ED8\u3067\u304D\u307E\u3059\u3002\u3054\u5E0C\u671B\u306E\u5834\u5408\u3001\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0\u3057\u3066\u5BC4\u4ED8\u5185\u5BB9\u3092\u304A\u9078\u3073\u304F\u3060\u3055\u3044\u3002Powered by Beam",inlineSeparator:()=>":"}};var se=Object.defineProperty,c=(n,e,t,o)=>{for(var i=void 0,a=n.length-1,l;a>=0;a--)(l=n[a])&&(i=l(e,t,i)||i);return i&&se(e,t,i),i};const le="--beam-ProductDetailsPage-imageUrl";class s extends A{constructor(){super(...arguments),this.baseUrl=O,this.lang="en",this.draftConfig=!1,this.debug=!1,this.localStorage=j(this),this.pluginPromoCodes=[],this.handlePromoCodesStored=e=>{const t=(e.detail.promoCodes?.unvalidatedPromoCodes??[]).map(o=>o.attributes?.value??o.attributes?.url??"").sort();this.pluginPromoCodes=t},this.postProductDetailsPageData=async()=>{ee(["apiKey","storeId"],this);const e=H(G,{apiKey:this.apiKey}),t=this.getManualPromoCodes(),o=U(t.map(l=>({value:l})),this.apiKey),i=o&&!K(o);i&&this.dispatchEvent(new w({source:y.product_details_page}));const a=await W({baseUrl:this.baseUrl,headers:N(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:y.product_details_page,draftConfig:this.draftConfig,remoteProductIdentifier:this.remoteProductIdentifier},requestBody:{...i&&{promos:o},beamCartId:e||void 0}});return this.handleValidatedPromoCodes(a),a},this.productDetailsPageDataController=new M(this,this.postProductDetailsPageData)}get configLang(){return V[this.lang]||"en"}get parsedPromoCodes(){return q(this.promoCodes)}getManualPromoCodes(){if(this.parsedPromoCodes&&this.parsedPromoCodes.length>0)return this.parsedPromoCodes;const e=this.localStorage.getItemJson("cart");return e?J(e):[]}async handleValidatedPromoCodes(e){e.promos?.validatedPromoCodes?.length&&(await Promise.all([Y({apiKey:this.apiKey,promoCodes:{validatedPromoCodes:e.promos.validatedPromoCodes,unvalidatedPromoCodes:[]}}),Z({validatedPromoCodes:e.promos.validatedPromoCodes,domain:this.domain})]),this.dispatchEvent(new w({source:y.product_details_page})))}async firstUpdated(){window.addEventListener(S.eventName,this.handlePromoCodesStored)}disconnectedCallback(){window.removeEventListener(S.eventName,this.handlePromoCodesStored),super.disconnectedCallback()}async updated(e){const t=["storeId","baseUrl","lang","apiKey","pluginPromoCodes","promoCodes"];this.pluginPromoCodes;for(const o of t)if(e.has(o)){await this.productDetailsPageDataController.exec();break}}render(){const{data:e,loading:t}=this.productDetailsPageDataController,o=this.cssVariables["--beam-ProductDetailsPage-image-placement"],i=P=>P!=="0px"&&P!=="0",a=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayPromoPill"]==="true",l=!!e?.config?.web?.promo,g=i(this.cssVariables["--beam-ProductDetailsPage-imageHeight"]),h=i(this.cssVariables["--beam-ProductDetailsPage-title-fontSize"]),u=a&&l&&g&&h,m=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayColon"]==="true";return t?r``:e==null?this.debug?R({error:new Error("No data")}):"":r`
20
+ </svg>`,v={en:{ctaTitle:()=>"Choose Your Impact",ctaMessage:()=>"At no extra cost, 1% of every order will be donated to a nonprofit you choose. Add to cart to choose. Powered by Beam",inlineSeparator:()=>":"},fr:{ctaTitle:()=>"Choisissez votre impact",ctaMessage:()=>"Sans frais suppl\xE9mentaires, 1 % de chaque commande est revers\xE9 \xE0 l'association de votre choix. Ajoutez au panier pour choisir. Propuls\xE9 par Beam.",inlineSeparator:()=>":"},es:{ctaTitle:()=>"Elige tu impacto",ctaMessage:()=>"Sin coste adicional, el 1 % de cada pedido se dona a la organizaci\xF3n sin \xE1nimo de lucro que elijas. A\xF1\xE1delo al carrito para elegir. Impulsado por Beam.",inlineSeparator:()=>":"},de:{ctaTitle:()=>"W\xE4hlen Sie Ihren Impact",ctaMessage:()=>"Ohne zus\xE4tzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gew\xE4hlte gemeinn\xFCtzige Organisation gespendet. Zum Warenkorb hinzuf\xFCgen, um auszuw\xE4hlen. Unterst\xFCtzt von Beam.",inlineSeparator:()=>":"},it:{ctaTitle:()=>"Scegli il tuo impatto",ctaMessage:()=>"L'1 % di ogni acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a tua scelta. Aggiungi al carrello per scegliere. Promosso da Beam.",inlineSeparator:()=>":"},pl:{ctaTitle:()=>"Wybierz sw\xF3j wp\u0142yw",ctaMessage:()=>"1 % warto\u015Bci ka\u017Cdego zam\xF3wienia przekazywany jest na wybran\u0105 przez Ciebie organizacj\u0119 non-profit \u2013 bez dodatkowych koszt\xF3w. Dodaj do koszyka, aby wybra\u0107. Obs\u0142ugiwane przez Beam.",inlineSeparator:()=>":"},ja:{ctaTitle:()=>"\u5BC4\u4ED8\u5148\u3092\u304A\u9078\u3073\u304F\u3060\u3055\u3044\u3002",ctaMessage:()=>"\u8FFD\u52A0\u8CBB\u7528\u306A\u3057\u3067\u3001\u3054\u6CE8\u6587\u91D1\u984D\u306E1%\u3092\u975E\u55B6\u5229\u56E3\u4F53\u3078\u5BC4\u4ED8\u3067\u304D\u307E\u3059\u3002\u3054\u5E0C\u671B\u306E\u5834\u5408\u3001\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0\u3057\u3066\u5BC4\u4ED8\u5185\u5BB9\u3092\u304A\u9078\u3073\u304F\u3060\u3055\u3044\u3002Powered by Beam",inlineSeparator:()=>":"}};var se=Object.defineProperty,c=(n,e,t,o)=>{for(var i=void 0,a=n.length-1,l;a>=0;a--)(l=n[a])&&(i=l(e,t,i)||i);return i&&se(e,t,i),i};const le="--beam-ProductDetailsPage-imageUrl";class s extends z{constructor(){super(...arguments),this.baseUrl=O,this.lang="en",this.draftConfig=!1,this.debug=!1,this.localStorage=j(this),this.pluginPromoCodes=[],this.handlePromoCodesStored=e=>{const t=(e.detail.promoCodes?.unvalidatedPromoCodes??[]).map(o=>o.attributes?.value??o.attributes?.url??"").sort();this.pluginPromoCodes=t},this.postProductDetailsPageData=async()=>{ee(["apiKey","storeId"],this);const e=H(G,{apiKey:this.apiKey}),t=this.getManualPromoCodes(),o=U(t.map(l=>({value:l})),this.apiKey),i=o&&!K(o);i&&this.dispatchEvent(new w({source:y.product_details_page}));const a=await W({baseUrl:this.baseUrl,headers:N(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:y.product_details_page,draftConfig:this.draftConfig,remoteProductIdentifier:this.remoteProductIdentifier},requestBody:{...i&&{promos:o},beamCartId:e||void 0}});return this.handleValidatedPromoCodes(a),a},this.productDetailsPageDataController=new M(this,this.postProductDetailsPageData)}get configLang(){return V[this.lang]||"en"}get parsedPromoCodes(){return q(this.promoCodes)}getManualPromoCodes(){if(this.parsedPromoCodes&&this.parsedPromoCodes.length>0)return this.parsedPromoCodes;const e=this.localStorage.getItemJson("cart");return e?J(e):[]}async handleValidatedPromoCodes(e){e.promos?.validatedPromoCodes?.length&&(await Promise.all([Y({apiKey:this.apiKey,promoCodes:{validatedPromoCodes:e.promos.validatedPromoCodes,unvalidatedPromoCodes:[]}}),Z({validatedPromoCodes:e.promos.validatedPromoCodes,domain:this.domain})]),this.dispatchEvent(new w({source:y.product_details_page})))}async firstUpdated(){window.addEventListener(S.eventName,this.handlePromoCodesStored)}disconnectedCallback(){window.removeEventListener(S.eventName,this.handlePromoCodesStored),super.disconnectedCallback()}async updated(e){const t=["storeId","baseUrl","lang","apiKey","pluginPromoCodes","promoCodes"];this.pluginPromoCodes;for(const o of t)if(e.has(o)){await this.productDetailsPageDataController.exec();break}}render(){const{data:e,loading:t}=this.productDetailsPageDataController,o=this.cssVariables["--beam-ProductDetailsPage-image-placement"],i=P=>P!=="0px"&&P!=="0",a=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayPromoPill"]==="true",l=!!e?.config?.web?.promo,g=i(this.cssVariables["--beam-ProductDetailsPage-imageHeight"]),h=i(this.cssVariables["--beam-ProductDetailsPage-title-fontSize"]),u=a&&l&&g&&h,m=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayColon"]==="true";return t?r``:e==null?this.debug?R({error:new Error("No data")}):"":r`
21
21
  <style>
22
22
  :host {
23
23
  ${this.cssVariables.toCSS()}
@@ -287,5 +287,5 @@ import{m as E,b as r,i as B,n as p,r as z,a as A,h as L}from"../chunks/lit-BEag9
287
287
  color: var(--beam-ProductDetailsPage-TooltipIcon-color);
288
288
  height: auto;
289
289
  }
290
- `],c([p({type:String,reflect:!0})],s.prototype,"baseUrl"),c([p({type:String,reflect:!1})],s.prototype,"apiKey"),c([p({type:Number})],s.prototype,"storeId"),c([p({type:String})],s.prototype,"lang"),c([p({type:Boolean})],s.prototype,"draftConfig"),c([p({type:Boolean})],s.prototype,"debug"),c([p({type:String})],s.prototype,"remoteProductIdentifier"),c([p({type:String})],s.prototype,"promoCodes"),c([p({type:String})],s.prototype,"domain"),c([z()],s.prototype,"pluginPromoCodes"),X(s);export{s as BeamProductDetailsPage};
290
+ `],c([p({type:String,reflect:!0})],s.prototype,"baseUrl"),c([p({type:String,reflect:!1})],s.prototype,"apiKey"),c([p({type:Number})],s.prototype,"storeId"),c([p({type:String})],s.prototype,"lang"),c([p({type:Boolean})],s.prototype,"draftConfig"),c([p({type:Boolean})],s.prototype,"debug"),c([p({type:String})],s.prototype,"remoteProductIdentifier"),c([p({type:String})],s.prototype,"promoCodes"),c([p({type:String})],s.prototype,"domain"),c([A()],s.prototype,"pluginPromoCodes"),X(s);export{s as BeamProductDetailsPage};
291
291
  //# sourceMappingURL=product-details-page.js.map
@@ -2,7 +2,7 @@ import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement, PropertyValues } from 'lit';
4
4
  import * as lodash from 'lodash';
5
- import { c as TId, b as TNumericId, d as TCart, L as LANGUAGES } from '../chunks/utils-BPcZ5h8J.esm.js';
5
+ import { c as TId, b as TNumericId, d as TCart, L as LANGUAGES } from '../chunks/utils-DfsVjUY-.esm.js';
6
6
  import 'lodash-es/debounce';
7
7
  import 'lodash-es/isEqual';
8
8
 
@@ -1,2 +1,2 @@
1
- import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Beh5bQDw.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import{B as d}from"../chunks/index-BebFL9KU.esm.js";import"../chunks/share-button-CIP03E7T.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/promo-pill-label-BWPhroK6.esm.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";export{d as BeamRedeemTransaction};
1
+ import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-tkscjKkq.esm.js";import"../chunks/utils-ly9wMwUO.esm.js";import"../chunks/css-card-grid-tjA36yWj.esm.js";import{B as d}from"../chunks/index-C8pScO8d.esm.js";import"../chunks/share-button-DP2wLhmP.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/promo-pill-label-DYR3PZH7.esm.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";export{d as BeamRedeemTransaction};
2
2
  //# sourceMappingURL=redeem-transaction.esm.js.map
@@ -1,2 +1,2 @@
1
- import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Beh5bQDw.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import{B as d}from"../chunks/index-B-QZylCa.esm.js";import"../chunks/share-button-CIP03E7T.esm.js";import"./beam-partner-logos.js";import"../chunks/promo-pill-label-BWPhroK6.esm.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";export{d as BeamRedeemTransaction};
1
+ import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-tkscjKkq.esm.js";import"../chunks/utils-ly9wMwUO.esm.js";import"../chunks/css-card-grid-tjA36yWj.esm.js";import{B as d}from"../chunks/index-lSPlMuMz.esm.js";import"../chunks/share-button-DP2wLhmP.esm.js";import"./beam-partner-logos.js";import"../chunks/promo-pill-label-DYR3PZH7.esm.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";export{d as BeamRedeemTransaction};
2
2
  //# sourceMappingURL=redeem-transaction.js.map
@@ -2,7 +2,7 @@ import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement, PropertyValues } from 'lit';
4
4
  import * as lodash from 'lodash';
5
- import { b as TNumericId, d as TCart, L as LANGUAGES } from '../chunks/utils-BPcZ5h8J.esm.js';
5
+ import { b as TNumericId, d as TCart, L as LANGUAGES } from '../chunks/utils-DfsVjUY-.esm.js';
6
6
  import 'lodash-es/debounce';
7
7
  import 'lodash-es/isEqual';
8
8
 
@@ -1,4 +1,4 @@
1
- import{a as D,i as L,b as d,n as f,r as I,e as v,k as J,j as A,h as Y}from"../chunks/lit-BEag9MFp.esm.js";import{i as Q,d as X}from"../chunks/lodash-CrMU6wKg.esm.js";import{u as S,B as z,h as Z,m as ee,A as B,e as u,f as te,_ as oe,c as T,d as m}from"../chunks/index-Beh5bQDw.esm.js";import{D as ie,A as M,J as F,h as ne,C as ae,E as K,W as C,L as O,B as P,K as re,z as se,M as E,N as le,v as ce,F as pe,G as de,H as fe,I as me,O as W,m as _,l as ge}from"../chunks/utils-C5hmbxa4.esm.js";import{c as he,d as ue,e as k}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as be}from"../chunks/share-button-CIP03E7T.esm.js";import{c as Se}from"../chunks/responsive-aN8P5PqD.esm.js";import{p as Ne}from"../chunks/promo-pill-label-BWPhroK6.esm.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";class ve extends D{static get styles(){return L`
1
+ import{a as D,i as L,b as d,n as f,r as I,e as C,k as J,j as A,h as Y}from"../chunks/lit-BEag9MFp.esm.js";import{i as Q,d as X}from"../chunks/lodash-CrMU6wKg.esm.js";import{u as S,B as z,h as Z,m as ee,A as B,e as u,f as te,_ as oe,c as T,d as m}from"../chunks/index-tkscjKkq.esm.js";import{D as ie,C as F,K as M,h as ne,E as ae,F as K,W as v,L as O,B as P,M as re,A as se,N as E,O as le,x as ce,G as pe,H as de,I as fe,J as me,P as W,m as _,l as he}from"../chunks/utils-ly9wMwUO.esm.js";import{c as ge,d as ue,e as k}from"../chunks/css-card-grid-tjA36yWj.esm.js";import{a as be}from"../chunks/share-button-DP2wLhmP.esm.js";import{c as Se}from"../chunks/responsive-aN8P5PqD.esm.js";import{p as Ne}from"../chunks/promo-pill-label-DYR3PZH7.esm.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";class Ce extends D{static get styles(){return L`
2
2
  :host {
3
3
  }
4
4
 
@@ -18,41 +18,41 @@ import{a as D,i as L,b as d,n as f,r as I,e as v,k as J,j as A,h as Y}from"../ch
18
18
  aria-label="Notification Blip"
19
19
  >
20
20
  <span class="notification-blip" part="notification-blip" role="button" tabindex="0" aria-hidden="true"></span>
21
- </div>`}}customElements.get("beam-notification-blip")||customElements.define("beam-notification-blip",ve);const Ce={"--beam-notificationBlip-color-background":"#000"},g={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose your impact",ctaPromoPrefixMessage:()=>"At no extra cost,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`select a nonprofit and ${o}% will be donated for you.`,ctaMessage:({donationPercentage:o="1"}={})=>`At no extra cost, select a nonprofit and ${o}% will be donated for you.`,inlineSeparator:()=>": "},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choisissez votre cause",ctaPromoPrefixMessage:()=>"Sans frais suppl\xE9mentaires,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`s\xE9lectionnez une association et ${o} % sera revers\xE9 en votre nom.`,ctaMessage:({donationPercentage:o="1"}={})=>`Sans frais suppl\xE9mentaires, choisissez une association et ${o} % de votre commande sera revers\xE9 en votre nom.`,inlineSeparator:()=>" : "},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"W\xE4hle deine Wirkung",ctaPromoPrefixMessage:()=>"Ohne zus\xE4tzliche Kosten,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`w\xE4hle eine Organisation und ${o}% deines Einkaufs werden gespendet.`,ctaMessage:({donationPercentage:o="1"}={})=>`Ohne zus\xE4tzliche Kosten kannst du eine gemeinn\xFCtzige Organisation ausw\xE4hlen und ${o}% deiner Bestellung werden gespendet.`,inlineSeparator:()=>": "},es:{beamAttribution:()=>"Ofrecido por Beam",ctaTitle:()=>"Elige tu impacto",ctaPromoPrefixMessage:()=>"Sin coste adicional,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`elige una organizaci\xF3n y donaremos el ${o}% en tu nombre.`,ctaMessage:({donationPercentage:o="1"}={})=>`Sin coste adicional, elige una organizaci\xF3n sin fines de lucro y donaremos el ${o}% de tu compra en tu nombre.`,inlineSeparator:()=>": "},it:{beamAttribution:()=>"Gestito da Beam",ctaTitle:()=>"Scegli il tuo impatto",ctaPromoPrefixMessage:()=>"Senza costi aggiuntivi,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`scegli un'organizzazione e doneremo l\u2019${o}% per te.`,ctaMessage:({donationPercentage:o="1"}={})=>`Senza costi aggiuntivi, seleziona un'organizzazione no-profit e doneremo l\u2019${o}% del tuo acquisto per te.`,inlineSeparator:()=>": "},pl:{beamAttribution:()=>"Obs\u0142ugiwane przez Beam",ctaTitle:()=>"Wybierz sw\xF3j wp\u0142yw",ctaPromoPrefixMessage:()=>"Bez dodatkowych koszt\xF3w,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`wybierz organizacj\u0119, a ${o}% zostanie przekazane w Twoim imieniu.`,ctaMessage:({donationPercentage:o="1"}={})=>`Bez dodatkowych koszt\xF3w wybierz organizacj\u0119, kt\xF3rej przeka\u017Cemy ${o}% warto\u015Bci Twojego zam\xF3wienia w Twoim imieniu.`,inlineSeparator:()=>": "},ja:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"\u5BC4\u4ED8\u5148\u3092\u304A\u9078\u3073\u304F\u3060\u3055\u3044\u3002",ctaPromoPrefixMessage:()=>"\u8FFD\u52A0\u8CBB\u7528\u306A\u3057\u3067\u3001",ctaPromoMessage:({donationPercentage:o="1"}={})=>`\u975E\u55B6\u5229\u56E3\u4F53\u3092\u9078\u3076\u3068\u3001${o}%\u304C\u305D\u306E\u56E3\u4F53\u306B\u5BC4\u4ED8\u3055\u308C\u307E\u3059\u3002`,ctaMessage:({donationPercentage:o="1"}={})=>`\u8FFD\u52A0\u8CBB\u7528\u306A\u3057\u3067\u975E\u55B6\u5229\u56E3\u4F53\u3092\u304A\u9078\u3073\u3044\u305F\u3060\u304F\u3068\u3001\u3054\u8CFC\u5165\u91D1\u984D\u306E${o}%\u304C\u5BC4\u4ED8\u3055\u308C\u307E\u3059\u3002`,inlineSeparator:()=>"\uFF1A"}};var ye=Object.defineProperty,p=(o,e,t,n)=>{for(var i=void 0,a=o.length-1,r;a>=0;a--)(r=o[a])&&(i=r(e,t,i)||i);return i&&ye(e,t,i),i};let U=!1;class l extends D{constructor(){super(...arguments),this.baseUrl=ie,this.selectedNonprofitId=null,this.lang="en",this.debug=!1,this.draftConfig=!1,this.lastSelectionActionDate=new Date,this.isMobile=window.innerWidth<768,this.enableNonprofitDeselection=!1,this.didTryToCreateNewSelectionFromCache=!1,this.pluginPromoCodes=[],this.handlePromoCodesStored=e=>{const t=(e.detail.promoCodes?.unvalidatedPromoCodes??[]).map(n=>n.attributes?.value??n.attributes?.url??"").sort();this.pluginPromoCodes=t},this.getChainNonprofits=async()=>{k(["apiKey"],this);const e=M(z,{apiKey:this.apiKey}),t=F("cart",{apiKey:this.apiKey}),n=this.cart?.content?{schema:this.cart?.schema,content:this.cart?.content}:void 0,i=this.getManualPromoCodes(),a=ne(i.map(h=>({value:h})),this.apiKey),r=a&&!ae(a);r&&this.dispatchEvent(new K({source:C.select_nonprofit}));const c=await Z({baseUrl:this.baseUrl,apiRoot:"/api/v3",headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{storeId:this.storeId,widgetName:C.select_nonprofit,postalCode:this.postalCode,countryCode:this.countryCode,beamCartId:e||void 0,cartId:t||void 0,version:"1.0.0",lang:this.configLang,...r&&{promos:a},options:{config:{draftConfig:this.draftConfig}},cart:n}});return this.enableNonprofitDeselection=!!c.config.enableNonprofitDeselection,this.selectedNonprofitId!==null&&this.selectedNonprofitId&&!c.nonprofits.map(h=>h.nonprofit.id).includes(this.selectedNonprofitId)&&(this.selectedNonprofitId=null,await this.postSelectNonprofit({selectedNonprofitId:null}),this.localStorage.setItem("nonprofit",null)),c.store?.id&&c.store.id!==this.storeId&&(this.storeId=c.store.id),await this.createNewSelectionForCachedNonprofit(),this.localStorage.setItemJson(O.CHAIN_NONPROFITS,{createdAt:new Date,data:c}),this.handleValidatedPromoCodes(c),c},this.postSelectNonprofit=async({selectedNonprofitId:e})=>{k(["apiKey","storeId"],this);const t=new Date;this.lastSelectionActionDate=t;const n=F("cart",{apiKey:this.apiKey}),i=M(z,{apiKey:this.apiKey}),a=await ee({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{nonprofitId:e,selectionId:this.selectionId,storeId:this.storeId,cartId:n||void 0,beamCartId:i||void 0,creationMethod:"cart",postalCode:this.postalCode,countryCode:this.countryCode}});this.selectionId=a?.selectionId,this.localStorage.setItem("transaction",this.selectionId),this.localStorage.setItem("nonprofit",e),this.localStorage.setItem("nonprofit_selected_at",t.toISOString()),await this.updateComplete;const r=this.getNonprofitById(e);e!==null&&this.dispatchEvent(new P({selectedNonprofitId:e,selectionId:this.selectionId,nonprofitName:r?.nonprofit?.name??null,source:C.select_nonprofit,timestamp:t})),e===null&&this.dispatchEvent(new re({newNonprofitId:null,selectionId:this.selectionId,timestamp:t}))},this.nonprofitListDataController=new B(this,this.getChainNonprofits),this.selectionDataController=new B(this,this.postSelectNonprofit),this.localStorage=se(this),this.handleCartChange=e=>{this.cart=e.detail},this.handleNonprofitSelect=e=>{const{selectionId:t,selectedNonprofitId:n,timestamp:i}=e.detail;!i||i<this.lastSelectionActionDate||(this.lastSelectionActionDate=i,this.selectionId!==t&&(this.selectionId=t),this.selectedNonprofitId!==n&&(this.selectedNonprofitId=n??null))},this.handleInitialNonprofitSync=e=>{if(U)return;const{nonprofitId:t,selectionId:n}=e.detail,i=t!==void 0&&this.selectedNonprofitId!==t,a=n!==void 0&&this.selectionId!==n;(i||a)&&(i&&(this.selectedNonprofitId=t),a&&(this.selectionId=n),this.requestUpdate(),U=!0,window.removeEventListener(E.eventName,this.handleInitialNonprofitSync))},this.makeHandleSelect=(e,t,n)=>async i=>{const a=this.selectedNonprofitId;if(i instanceof KeyboardEvent){let r=null;switch(i.key){case"ArrowUp":case"ArrowLeft":t===0?r=n[n.length-1]:r=n[t-1],i.preventDefault();break;case"ArrowRight":case"ArrowDown":t===n.length-1?r=n[0]:r=n[t+1],i.preventDefault();break;case"Enter":case" ":i.preventDefault();break;default:return}if(r){a!=null&&(this.selectedNonprofitId=r.nonprofit.id);const c=this.renderRoot.querySelector(`[data-value="${r.nonprofit.id}"]`);c!==null&&(c.tabIndex=0,c.focus());return}}if(i.currentTarget instanceof HTMLElement)if(a===e)if(this.enableNonprofitDeselection)this.selectedNonprofitId=null,this.localStorage.setItem("nonprofit",null);else return;else this.selectedNonprofitId=e;this.dispatchEvent(new le({})),window.removeEventListener(E.eventName,this.handleInitialNonprofitSync),await this.selectionDataController.exec({selectedNonprofitId:this.selectedNonprofitId})},this.evaluateBreakPoints=X(()=>{this.isMobile=window.innerWidth<768},50,{maxWait:50,leading:!0})}get configLang(){return ce[this.lang]||"en"}get parsedPromoCodes(){return pe(this.promoCodes)}getManualPromoCodes(){if(this.parsedPromoCodes&&this.parsedPromoCodes.length>0)return this.parsedPromoCodes;const e=this.localStorage.getItemJson("cart");return e?de(e):[]}async handleValidatedPromoCodes(e){e.promos?.validatedPromoCodes?.length&&(await Promise.all([fe({apiKey:this.apiKey,promoCodes:{validatedPromoCodes:e.promos.validatedPromoCodes,unvalidatedPromoCodes:[]}}),me({validatedPromoCodes:e.promos.validatedPromoCodes,domain:this.domain})]),this.dispatchEvent(new K({source:C.select_nonprofit})))}getNonprofitById(e){return e?this.nonprofitListDataController?.data?.nonprofits.find(t=>t.nonprofit.id===e):null}async connectedCallback(){super.connectedCallback(),window.addEventListener(E.eventName,this.handleInitialNonprofitSync),window.addEventListener(P.eventName,this.handleNonprofitSelect),this.nonprofitListDataController.loading=!0,window.addEventListener(W.eventName,this.handleCartChange),window.addEventListener("resize",this.evaluateBreakPoints)}async firstUpdated(){await this.restoreStateFromCache(),window.addEventListener(_.eventName,this.handlePromoCodesStored)}async updated(e){const t=["baseUrl","storeId","apiKey","countryCode","postalCode","cart","lang","promoCodes","pluginPromoCodes"];this.pluginPromoCodes;for(const n of t)if(e.has(n)){await this.nonprofitListDataController.exec();break}}disconnectedCallback(){window.removeEventListener(W.eventName,this.handleCartChange),window.removeEventListener("resize",this.evaluateBreakPoints),window.removeEventListener(_.eventName,this.handlePromoCodesStored),window.removeEventListener(P.eventName,this.handleNonprofitSelect),super.disconnectedCallback()}async restoreStateFromCache(){try{const e=new Date().valueOf();this.cart=this.localStorage.getItemJson("cart")??void 0;const t=720*60*60*1e3,n=this.localStorage.getItem("nonprofit_selected_at")??0,i=e>new Date(n).valueOf()+t;i?i&&this.selectedNonprofitId!==null&&(await this.postSelectNonprofit({selectedNonprofitId:null}),this.localStorage.setItem("nonprofit",null)):(this.selectedNonprofitId=parseInt(this.localStorage.getItem("nonprofit")||"")||null,this.selectionId=this.localStorage.getItem("transaction")??void 0);const{createdAt:a=0,data:r}=this.localStorage.getItemJson(O.CHAIN_NONPROFITS)||{},c=7200*1e3;!(e>new Date(a).valueOf()+c)&&this.nonprofitListDataController.loading&&(this.nonprofitListDataController.data=r,this.nonprofitListDataController.loading=!1)}catch(e){ge.error(e)}}async createNewSelectionForCachedNonprofit(){if(k(["apiKey"],this),!(!this.storeId||this.didTryToCreateNewSelectionFromCache))try{this.didTryToCreateNewSelectionFromCache=!0}catch{}}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...be,"--beam-SelectNonprofit-title-textAlign":"inherit","--beam-SelectNonprofit-description-textAlign":"inherit","--beam-SelectNonprofit-maxWidth":"800px","--beam-SelectNonprofit-options-marginTop":"0px","--beam-SelectNonprofit-options-iconHeight":"24px","--beam-SelectNonprofit-options-padding":"10px","--beam-SelectNonprofit-options-borderRadius":"0px","--beam-SelectNonprofit-options-borderColor":"currentColor","--beam-SelectNonprofit-options-borderWidth":"1px","--beam-SelectNonprofit-options--selected-borderColor":"currentColor","--beam-SelectNonprofit-options-backgroundColor":"transparent","--beam-SelectNonprofit-options-gap":"8px","--beam-SelectNonprofit-options--selected-backgroundColor":"currentColor","--beam-SelectNonprofit-details-marginTop":"10px","--beam-SelectNonprofit-details-borderRadius":"0px","--beam-SelectNonprofit-details-borderWidth":"1px","--beam-SelectNonprofit-details-borderColor":"currentColor","--beam-SelectNonprofit-details-backgroundColor":"inherit","--beam-SelectNonprofit-details-padding":"10px",...u("--beam-SelectNonprofit-title",{fontSize:"1.25em",fontWeight:"bold"}),"--beam-SelectNonprofit-header-inline-lineHeight":"inherit",...u("--beam-SelectNonprofit-title-inline",{fontWeight:"bold"}),"--beam-SelectNonprofit-title-inline-textTransform":"none","--beam-SelectNonprofit-title-block-margin-right":"8px",...u("--beam-SelectNonprofit-description",{marginTop:"0.5em"}),...u("--beam-SelectNonprofit-description-inline"),...u("--beam-SelectNonprofit-details-cause",{fontSize:"0.85em",fontWeight:"bold"}),...u("--beam-SelectNonprofit-details-beamAttribution",{fontSize:"0.85em"}),...u("--beam-SelectNonprofit-details-impactDescription",{fontSize:"1em",marginTop:"10px"}),"--beam-SelectNonprofit-details-nonprofitName-fontWeight":"bold","--beam-SelectNonprofit-details-nonprofitName-fontStyle":"inherit","--beam-SelectNonprofit-details-fundingProgress-marginTop":"10px",...u("--beam-SelectNonprofit-details-fundingProgressLabel",{fontSize:"0.85em"}),...Ce,...Ne,"--beam-SelectNonprofit-promo-block-header-justifyContent":"initial","--beam-SelectNonprofit-notification-blip-top":"4px","--beam-SelectNonprofit-notification-blip-left":"50%","--beam-SelectNonprofit-display-notification-blip":"true","--beam-SelectNonprofit-enable-inline-header":"false","--beam-SelectNonprofit-force-multiline-header":"false"},t=this.nonprofitListDataController?.data?.config?.web?.theme||{},n={...e,...t};return Object.assign(Object.create({toCSS(){return te(this)}}),n)}render(){const{selectedNonprofitId:e}=this,{data:t,loading:n}=this.nonprofitListDataController;if(n&&!t)return oe();if(this.nonprofitListDataController.error)return this.debug?T({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return T({error:this.selectionDataController.error});const i=t?.nonprofits||[],a=i.find(s=>s.nonprofit.id===e)||null,r=!!t?.config?.web?.promo,c=i.some(s=>!s.promo||!s.promo.isActive),h=s=>this.cssVariables[s],j=h("--beam-SelectNonprofit-display-notification-blip")==="true",y=h("--beam-SelectNonprofit-title-textAlign")==="center",R=h("--beam-SelectNonprofit-enable-inline-header")==="true",b=h("--beam-SelectNonprofit-force-multiline-header")!=="true"&&(R||this.isMobile),$=d`<h3
22
- class=${v({"title-block":!0,"d-none":!0,"d-block":!b})}
21
+ </div>`}}customElements.get("beam-notification-blip")||customElements.define("beam-notification-blip",Ce);const ve={"--beam-notificationBlip-color-background":"#000"},h={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose your impact",ctaPromoPrefixMessage:()=>"At no extra cost,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`select a nonprofit and ${o}% will be donated for you.`,ctaMessage:({donationPercentage:o="1"}={})=>`At no extra cost, select a nonprofit and ${o}% will be donated for you.`,inlineSeparator:()=>": "},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choisissez votre cause",ctaPromoPrefixMessage:()=>"Sans frais suppl\xE9mentaires,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`s\xE9lectionnez une association et ${o} % sera revers\xE9 en votre nom.`,ctaMessage:({donationPercentage:o="1"}={})=>`Sans frais suppl\xE9mentaires, choisissez une association et ${o} % de votre commande sera revers\xE9 en votre nom.`,inlineSeparator:()=>" : "},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"W\xE4hle deine Wirkung",ctaPromoPrefixMessage:()=>"Ohne zus\xE4tzliche Kosten,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`w\xE4hle eine Organisation und ${o}% deines Einkaufs werden gespendet.`,ctaMessage:({donationPercentage:o="1"}={})=>`Ohne zus\xE4tzliche Kosten kannst du eine gemeinn\xFCtzige Organisation ausw\xE4hlen und ${o}% deiner Bestellung werden gespendet.`,inlineSeparator:()=>": "},es:{beamAttribution:()=>"Ofrecido por Beam",ctaTitle:()=>"Elige tu impacto",ctaPromoPrefixMessage:()=>"Sin coste adicional,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`elige una organizaci\xF3n y donaremos el ${o}% en tu nombre.`,ctaMessage:({donationPercentage:o="1"}={})=>`Sin coste adicional, elige una organizaci\xF3n sin fines de lucro y donaremos el ${o}% de tu compra en tu nombre.`,inlineSeparator:()=>": "},it:{beamAttribution:()=>"Gestito da Beam",ctaTitle:()=>"Scegli il tuo impatto",ctaPromoPrefixMessage:()=>"Senza costi aggiuntivi,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`scegli un'organizzazione e doneremo l\u2019${o}% per te.`,ctaMessage:({donationPercentage:o="1"}={})=>`Senza costi aggiuntivi, seleziona un'organizzazione no-profit e doneremo l\u2019${o}% del tuo acquisto per te.`,inlineSeparator:()=>": "},pl:{beamAttribution:()=>"Obs\u0142ugiwane przez Beam",ctaTitle:()=>"Wybierz sw\xF3j wp\u0142yw",ctaPromoPrefixMessage:()=>"Bez dodatkowych koszt\xF3w,",ctaPromoMessage:({donationPercentage:o="1"}={})=>`wybierz organizacj\u0119, a ${o}% zostanie przekazane w Twoim imieniu.`,ctaMessage:({donationPercentage:o="1"}={})=>`Bez dodatkowych koszt\xF3w wybierz organizacj\u0119, kt\xF3rej przeka\u017Cemy ${o}% warto\u015Bci Twojego zam\xF3wienia w Twoim imieniu.`,inlineSeparator:()=>": "},ja:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"\u5BC4\u4ED8\u5148\u3092\u304A\u9078\u3073\u304F\u3060\u3055\u3044\u3002",ctaPromoPrefixMessage:()=>"\u8FFD\u52A0\u8CBB\u7528\u306A\u3057\u3067\u3001",ctaPromoMessage:({donationPercentage:o="1"}={})=>`\u975E\u55B6\u5229\u56E3\u4F53\u3092\u9078\u3076\u3068\u3001${o}%\u304C\u305D\u306E\u56E3\u4F53\u306B\u5BC4\u4ED8\u3055\u308C\u307E\u3059\u3002`,ctaMessage:({donationPercentage:o="1"}={})=>`\u8FFD\u52A0\u8CBB\u7528\u306A\u3057\u3067\u975E\u55B6\u5229\u56E3\u4F53\u3092\u304A\u9078\u3073\u3044\u305F\u3060\u304F\u3068\u3001\u3054\u8CFC\u5165\u91D1\u984D\u306E${o}%\u304C\u5BC4\u4ED8\u3055\u308C\u307E\u3059\u3002`,inlineSeparator:()=>"\uFF1A"}};var ye=Object.defineProperty,p=(o,e,t,n)=>{for(var i=void 0,a=o.length-1,r;a>=0;a--)(r=o[a])&&(i=r(e,t,i)||i);return i&&ye(e,t,i),i};let U=!1;class c extends D{constructor(){super(...arguments),this.baseUrl=ie,this.selectedNonprofitId=null,this.lang="en",this.debug=!1,this.draftConfig=!1,this.lastSelectionActionDate=new Date,this.isMobile=window.innerWidth<768,this.enableNonprofitDeselection=!1,this.didTryToCreateNewSelectionFromCache=!1,this.pluginPromoCodes=[],this.handlePromoCodesStored=e=>{const t=(e.detail.promoCodes?.unvalidatedPromoCodes??[]).map(n=>n.attributes?.value??n.attributes?.url??"").sort();this.pluginPromoCodes=t},this.getChainNonprofits=async()=>{k(["apiKey"],this);const e=F(z,{apiKey:this.apiKey}),t=M("cart",{apiKey:this.apiKey}),n=this.cart?.content?{schema:this.cart?.schema,content:this.cart?.content}:void 0,i=this.getManualPromoCodes(),a=ne(i.map(g=>({value:g})),this.apiKey),r=a&&!ae(a);r&&this.dispatchEvent(new K({source:v.select_nonprofit}));const l=await Z({baseUrl:this.baseUrl,apiRoot:"/api/v3",headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{storeId:this.storeId,widgetName:v.select_nonprofit,...this.postalCode&&{postalCode:this.postalCode},...this.countryCode&&{countryCode:this.countryCode},beamCartId:e||void 0,cartId:t||void 0,version:"1.0.0",lang:this.configLang,...r&&{promos:a},options:{config:{draftConfig:this.draftConfig}},cart:n}});return this.enableNonprofitDeselection=!!l.config.enableNonprofitDeselection,this.selectedNonprofitId!==null&&this.selectedNonprofitId&&!l.nonprofits.map(g=>g.nonprofit.id).includes(this.selectedNonprofitId)&&(this.selectedNonprofitId=null,await this.postSelectNonprofit({selectedNonprofitId:null}),this.localStorage.setItem("nonprofit",null)),l.store?.id&&l.store.id!==this.storeId&&(this.storeId=l.store.id),await this.createNewSelectionForCachedNonprofit(),this.localStorage.setItemJson(O.CHAIN_NONPROFITS,{createdAt:new Date,data:l}),this.handleValidatedPromoCodes(l),l},this.postSelectNonprofit=async({selectedNonprofitId:e})=>{k(["apiKey","storeId"],this);const t=new Date;this.lastSelectionActionDate=t;const n=M("cart",{apiKey:this.apiKey}),i=F(z,{apiKey:this.apiKey}),a=await ee({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{nonprofitId:e,selectionId:this.selectionId,storeId:this.storeId,cartId:n||void 0,beamCartId:i||void 0,creationMethod:"cart",...this.postalCode&&{postalCode:this.postalCode},...this.countryCode&&{countryCode:this.countryCode}}}),r=!this.selectionId;this.selectionId=a?.selectionId,this.localStorage.setItem("transaction",this.selectionId),this.localStorage.setItem("nonprofit",e),this.localStorage.setItem("nonprofit_selected_at",t.toISOString()),await this.updateComplete;const l=this.getNonprofitById(e);e!==null&&this.dispatchEvent(new P({selectedNonprofitId:e,selectionId:this.selectionId,nonprofitName:l?.nonprofit?.name??null,source:v.select_nonprofit,timestamp:t,isFirstSelection:r})),e===null&&this.dispatchEvent(new re({newNonprofitId:null,selectionId:this.selectionId,timestamp:t}))},this.nonprofitListDataController=new B(this,this.getChainNonprofits),this.selectionDataController=new B(this,this.postSelectNonprofit),this.localStorage=se(this),this.handleCartChange=e=>{this.cart=e.detail},this.handleNonprofitSelect=e=>{const{selectionId:t,selectedNonprofitId:n,timestamp:i}=e.detail;!i||i<this.lastSelectionActionDate||(this.lastSelectionActionDate=i,this.selectionId!==t&&(this.selectionId=t),this.selectedNonprofitId!==n&&(this.selectedNonprofitId=n??null))},this.handleInitialNonprofitSync=e=>{if(U)return;const{nonprofitId:t,selectionId:n}=e.detail,i=t!==void 0&&this.selectedNonprofitId!==t,a=n!==void 0&&this.selectionId!==n;(i||a)&&(i&&(this.selectedNonprofitId=t),a&&(this.selectionId=n),this.requestUpdate(),U=!0,window.removeEventListener(E.eventName,this.handleInitialNonprofitSync))},this.makeHandleSelect=(e,t,n)=>async i=>{const a=this.selectedNonprofitId;if(i instanceof KeyboardEvent){let r=null;switch(i.key){case"ArrowUp":case"ArrowLeft":t===0?r=n[n.length-1]:r=n[t-1],i.preventDefault();break;case"ArrowRight":case"ArrowDown":t===n.length-1?r=n[0]:r=n[t+1],i.preventDefault();break;case"Enter":case" ":i.preventDefault();break;default:return}if(r){a!=null&&(this.selectedNonprofitId=r.nonprofit.id);const l=this.renderRoot.querySelector(`[data-value="${r.nonprofit.id}"]`);l!==null&&(l.tabIndex=0,l.focus());return}}if(i.currentTarget instanceof HTMLElement)if(a===e)if(this.enableNonprofitDeselection)this.selectedNonprofitId=null,this.localStorage.setItem("nonprofit",null);else return;else this.selectedNonprofitId=e;this.dispatchEvent(new le({})),window.removeEventListener(E.eventName,this.handleInitialNonprofitSync),await this.selectionDataController.exec({selectedNonprofitId:this.selectedNonprofitId})},this.evaluateBreakPoints=X(()=>{this.isMobile=window.innerWidth<768},50,{maxWait:50,leading:!0})}get configLang(){return ce[this.lang]||"en"}get parsedPromoCodes(){return pe(this.promoCodes)}getManualPromoCodes(){if(this.parsedPromoCodes&&this.parsedPromoCodes.length>0)return this.parsedPromoCodes;const e=this.localStorage.getItemJson("cart");return e?de(e):[]}async handleValidatedPromoCodes(e){e.promos?.validatedPromoCodes?.length&&(await Promise.all([fe({apiKey:this.apiKey,promoCodes:{validatedPromoCodes:e.promos.validatedPromoCodes,unvalidatedPromoCodes:[]}}),me({validatedPromoCodes:e.promos.validatedPromoCodes,domain:this.domain})]),this.dispatchEvent(new K({source:v.select_nonprofit})))}getNonprofitById(e){return e?this.nonprofitListDataController?.data?.nonprofits.find(t=>t.nonprofit.id===e):null}async connectedCallback(){super.connectedCallback(),window.addEventListener(E.eventName,this.handleInitialNonprofitSync),window.addEventListener(P.eventName,this.handleNonprofitSelect),this.nonprofitListDataController.loading=!0,window.addEventListener(W.eventName,this.handleCartChange),window.addEventListener("resize",this.evaluateBreakPoints)}async firstUpdated(){await this.restoreStateFromCache(),window.addEventListener(_.eventName,this.handlePromoCodesStored)}async updated(e){const t=["baseUrl","storeId","apiKey","countryCode","postalCode","cart","lang","promoCodes","pluginPromoCodes"];this.pluginPromoCodes;for(const n of t)if(e.has(n)){await this.nonprofitListDataController.exec();break}}disconnectedCallback(){window.removeEventListener(W.eventName,this.handleCartChange),window.removeEventListener("resize",this.evaluateBreakPoints),window.removeEventListener(_.eventName,this.handlePromoCodesStored),window.removeEventListener(P.eventName,this.handleNonprofitSelect),super.disconnectedCallback()}async restoreStateFromCache(){try{const e=new Date().valueOf();this.cart=this.localStorage.getItemJson("cart")??void 0;const t=720*60*60*1e3,n=this.localStorage.getItem("nonprofit_selected_at")??0,i=e>new Date(n).valueOf()+t;i?i&&this.selectedNonprofitId!==null&&(await this.postSelectNonprofit({selectedNonprofitId:null}),this.localStorage.setItem("nonprofit",null)):(this.selectedNonprofitId=parseInt(this.localStorage.getItem("nonprofit")||"")||null,this.selectionId=this.localStorage.getItem("transaction")??void 0);const{createdAt:a=0,data:r}=this.localStorage.getItemJson(O.CHAIN_NONPROFITS)||{},l=7200*1e3;!(e>new Date(a).valueOf()+l)&&this.nonprofitListDataController.loading&&(this.nonprofitListDataController.data=r,this.nonprofitListDataController.loading=!1)}catch(e){he.error(e)}}async createNewSelectionForCachedNonprofit(){if(k(["apiKey"],this),!(!this.storeId||this.didTryToCreateNewSelectionFromCache))try{this.didTryToCreateNewSelectionFromCache=!0}catch{}}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...be,"--beam-SelectNonprofit-title-textAlign":"inherit","--beam-SelectNonprofit-description-textAlign":"inherit","--beam-SelectNonprofit-maxWidth":"800px","--beam-SelectNonprofit-options-marginTop":"0px","--beam-SelectNonprofit-options-iconHeight":"24px","--beam-SelectNonprofit-options-padding":"10px","--beam-SelectNonprofit-options-borderRadius":"0px","--beam-SelectNonprofit-options-borderColor":"currentColor","--beam-SelectNonprofit-options-borderWidth":"1px","--beam-SelectNonprofit-options--selected-borderColor":"currentColor","--beam-SelectNonprofit-options-backgroundColor":"transparent","--beam-SelectNonprofit-options-gap":"8px","--beam-SelectNonprofit-options--selected-backgroundColor":"currentColor","--beam-SelectNonprofit-details-marginTop":"10px","--beam-SelectNonprofit-details-borderRadius":"0px","--beam-SelectNonprofit-details-borderWidth":"1px","--beam-SelectNonprofit-details-borderColor":"currentColor","--beam-SelectNonprofit-details-backgroundColor":"inherit","--beam-SelectNonprofit-details-padding":"10px",...u("--beam-SelectNonprofit-title",{fontSize:"1.25em",fontWeight:"bold"}),"--beam-SelectNonprofit-header-inline-lineHeight":"inherit",...u("--beam-SelectNonprofit-title-inline",{fontWeight:"bold"}),"--beam-SelectNonprofit-title-inline-textTransform":"none","--beam-SelectNonprofit-title-block-margin-right":"8px",...u("--beam-SelectNonprofit-description",{marginTop:"0.5em"}),...u("--beam-SelectNonprofit-description-inline"),...u("--beam-SelectNonprofit-details-cause",{fontSize:"0.85em",fontWeight:"bold"}),...u("--beam-SelectNonprofit-details-beamAttribution",{fontSize:"0.85em"}),...u("--beam-SelectNonprofit-details-impactDescription",{fontSize:"1em",marginTop:"10px"}),"--beam-SelectNonprofit-details-nonprofitName-fontWeight":"bold","--beam-SelectNonprofit-details-nonprofitName-fontStyle":"inherit","--beam-SelectNonprofit-details-fundingProgress-marginTop":"10px",...u("--beam-SelectNonprofit-details-fundingProgressLabel",{fontSize:"0.85em"}),...ve,...Ne,"--beam-SelectNonprofit-promo-block-header-justifyContent":"initial","--beam-SelectNonprofit-notification-blip-top":"4px","--beam-SelectNonprofit-notification-blip-left":"50%","--beam-SelectNonprofit-display-notification-blip":"true","--beam-SelectNonprofit-enable-inline-header":"false","--beam-SelectNonprofit-force-multiline-header":"false"},t=this.nonprofitListDataController?.data?.config?.web?.theme||{},n={...e,...t};return Object.assign(Object.create({toCSS(){return te(this)}}),n)}render(){const{selectedNonprofitId:e}=this,{data:t,loading:n}=this.nonprofitListDataController;if(n&&!t)return oe();if(this.nonprofitListDataController.error)return this.debug?T({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return T({error:this.selectionDataController.error});const i=t?.nonprofits||[],a=i.find(s=>s.nonprofit.id===e)||null,r=!!t?.config?.web?.promo,l=i.some(s=>!s.promo||!s.promo.isActive),g=s=>this.cssVariables[s],j=g("--beam-SelectNonprofit-display-notification-blip")==="true",y=g("--beam-SelectNonprofit-title-textAlign")==="center",R=g("--beam-SelectNonprofit-enable-inline-header")==="true",b=g("--beam-SelectNonprofit-force-multiline-header")!=="true"&&(R||this.isMobile),$=d`<h3
22
+ class=${C({"title-block":!0,"d-none":!0,"d-block":!b})}
23
23
  part="title"
24
24
  id="beam-SelectNonprofit-title"
25
25
  >
26
- ${m(this.configLang,t?.config?.web?.title||"")||g[this.configLang].ctaTitle()}
27
- </h3>`,H=()=>{const s=v({"block-header-promo-pill-container":!b&&!y,"block-header-promo-pill-container-responsive":b&&!y,"block-header-promo-pill-center-block-container-responsive":!b&&y}),w=A({display:b?"flex":void 0});return r?d`<div class=${s} style=${w}>
26
+ ${m(this.configLang,t?.config?.web?.title||"")||h[this.configLang].ctaTitle()}
27
+ </h3>`,H=()=>{const s=C({"block-header-promo-pill-container":!b&&!y,"block-header-promo-pill-container-responsive":b&&!y,"block-header-promo-pill-center-block-container-responsive":!b&&y}),w=A({display:b?"flex":void 0});return r?d`<div class=${s} style=${w}>
28
28
  ${$}
29
29
  <beam-promo-info-pill .promo=${t?.config?.web?.promo}></beam-promo-info-pill>
30
30
  </div>`:$},q=()=>d`
31
31
  <div part="heading">
32
32
  ${H()}
33
33
  <p class="description" part="description">
34
- <span class=${v({"d-none":!0,"d-inline":!b})}>
34
+ <span class=${C({"d-none":!0,"d-inline":!b})}>
35
35
  ${r?d`<span style="font-weight:bold">
36
- ${m(this.configLang,t?.config?.web?.promoDescriptionPrefix||"")||g[this.configLang].ctaPromoPrefixMessage()}
36
+ ${m(this.configLang,t?.config?.web?.promoDescriptionPrefix||"")||h[this.configLang].ctaPromoPrefixMessage()}
37
37
  </span>
38
38
  <span>
39
- ${m(this.configLang,t?.config?.web?.promoDescription||"")||g[this.configLang].ctaPromoMessage()}
39
+ ${m(this.configLang,t?.config?.web?.promoDescription||"")||h[this.configLang].ctaPromoMessage()}
40
40
  </span>`:d`<span>
41
- ${m(this.configLang,t?.config?.web?.description||"")||g[this.configLang].ctaMessage()}
41
+ ${m(this.configLang,t?.config?.web?.description||"")||h[this.configLang].ctaMessage()}
42
42
  </span>`}
43
43
  </span>
44
- <div class=${v({"d-none":!b,"header-inline":!0})}>
44
+ <div class=${C({"d-none":!b,"header-inline":!0})}>
45
45
  <span class="title-inline" part="title">
46
- ${(m(this.configLang,t?.config?.web?.title||"")||g[this.configLang].ctaTitle())+g[this.configLang].inlineSeparator()}
46
+ ${(m(this.configLang,t?.config?.web?.title||"")||h[this.configLang].ctaTitle())+h[this.configLang].inlineSeparator()}
47
47
  </span>
48
48
  <span class="description-inline" part="description">
49
49
  ${r?d`<span style="font-weight:bold">
50
- ${m(this.configLang,t?.config?.web?.promoDescriptionPrefix||"")||g[this.configLang].ctaPromoPrefixMessage()}
50
+ ${m(this.configLang,t?.config?.web?.promoDescriptionPrefix||"")||h[this.configLang].ctaPromoPrefixMessage()}
51
51
  </span>
52
52
  <span>
53
- ${m(this.configLang,t?.config?.web?.promoDescription||"")||g[this.configLang].ctaPromoMessage()}
53
+ ${m(this.configLang,t?.config?.web?.promoDescription||"")||h[this.configLang].ctaPromoMessage()}
54
54
  </span>`:d`<span
55
- >${m(this.configLang,t?.config?.web?.description||"")||g[this.configLang].ctaMessage()}
55
+ >${m(this.configLang,t?.config?.web?.description||"")||h[this.configLang].ctaMessage()}
56
56
  </span>`}
57
57
  </div>
58
58
  </p>
@@ -70,7 +70,7 @@ import{a as D,i as L,b as d,n as f,r as I,e as v,k as J,j as A,h as Y}from"../ch
70
70
  aria-labelledby="beam-SelectNonprofit-title"
71
71
  style="display: flex; gap: var(--beam-SelectNonprofit-options-gap); margin: 10px 0 0 0;"
72
72
  >
73
- ${J(i,s=>s.nonprofit.id,({nonprofit:s,promo:w},x)=>{const N=e===s.id,G=N||a==null&&x===0,V=w?.isActive&&t?.config.web.promo&&c&&j;return d`
73
+ ${J(i,s=>s.nonprofit.id,({nonprofit:s,promo:w},x)=>{const N=e===s.id,G=N||a==null&&x===0,V=w?.isActive&&t?.config.web.promo&&l&&j;return d`
74
74
  <div
75
75
  class="option"
76
76
  part="option"
@@ -116,17 +116,15 @@ import{a as D,i as L,b as d,n as f,r as I,e as v,k as J,j as A,h as Y}from"../ch
116
116
  class="details-cause"
117
117
  style="flex: 0 1; white-space: nowrap; ${S("--beam-SelectNonprofit-details-cause")}"
118
118
  >
119
- ${a?.promo?.isActive&&c?t?.config.web.promo?.["promo-cause-alt-text"]||a.nonprofit.cause:m(this.configLang,a.nonprofit.cause||"")}
119
+ ${a?.promo?.isActive&&l?t?.config.web.promo?.["promo-cause-alt-text"]||a.nonprofit.cause:m(this.configLang,a.nonprofit.cause||"")}
120
+ </span>
121
+ <span
122
+ class="details-beamAttribution"
123
+ aria-hidden="true"
124
+ style="flex: 0 1; white-space: nowrap; ${S("--beam-SelectNonprofit-details-beamAttribution")}"
125
+ >
126
+ ${h[this.configLang].beamAttribution()}
120
127
  </span>
121
- <div aria-hidden="true">
122
- <span
123
- class="details-beamAttribution"
124
- aria-hidden="true"
125
- style="flex: 0 1; white-space: nowrap; ${S("--beam-SelectNonprofit-details-beamAttribution")}"
126
- >
127
- ${g[this.configLang].beamAttribution()}
128
- </span>
129
- </div>
130
128
  </div>
131
129
  <p class="details-impactDescription">
132
130
  ${Y(m(this.configLang,a.impact.description||""))}
@@ -147,7 +145,7 @@ import{a as D,i as L,b as d,n as f,r as I,e as v,k as J,j as A,h as Y}from"../ch
147
145
  </div>
148
146
  </div>
149
147
  `:""}
150
- `}}l.tagName="beam-select-nonprofit",l.styles=[he,Se,L`
148
+ `}}c.tagName="beam-select-nonprofit",c.styles=[ge,Se,L`
151
149
  :host {
152
150
  display: block;
153
151
  max-width: var(--beam-SelectNonprofit-maxWidth, 800px);
@@ -233,5 +231,5 @@ import{a as D,i as L,b as d,n as f,r as I,e as v,k as J,j as A,h as Y}from"../ch
233
231
  top: var(--beam-SelectNonprofit-notification-blip-top);
234
232
  left: var(--beam-SelectNonprofit-notification-blip-left);
235
233
  }
236
- `],p([f({type:String})],l.prototype,"baseUrl"),p([f({type:String})],l.prototype,"apiKey"),p([f({type:Number,reflect:!0})],l.prototype,"storeId"),p([f({type:String})],l.prototype,"countryCode"),p([f({type:String})],l.prototype,"postalCode"),p([f({attribute:!1,hasChanged:(o,e)=>!Q(o,e)})],l.prototype,"cart"),p([f({type:Number,reflect:!0})],l.prototype,"selectedNonprofitId"),p([f({type:String})],l.prototype,"lang"),p([f({type:Boolean})],l.prototype,"debug"),p([f({type:Boolean})],l.prototype,"draftConfig"),p([f({type:String})],l.prototype,"promoCodes"),p([f({type:String})],l.prototype,"domain"),p([I()],l.prototype,"lastSelectionActionDate"),p([I()],l.prototype,"isMobile"),p([I()],l.prototype,"pluginPromoCodes"),ue(l);export{l as BeamSelectNonprofit};
234
+ `],p([f({type:String})],c.prototype,"baseUrl"),p([f({type:String})],c.prototype,"apiKey"),p([f({type:Number,reflect:!0})],c.prototype,"storeId"),p([f({type:String})],c.prototype,"countryCode"),p([f({type:String})],c.prototype,"postalCode"),p([f({attribute:!1,hasChanged:(o,e)=>!Q(o,e)})],c.prototype,"cart"),p([f({type:Number,reflect:!0})],c.prototype,"selectedNonprofitId"),p([f({type:String})],c.prototype,"lang"),p([f({type:Boolean})],c.prototype,"debug"),p([f({type:Boolean})],c.prototype,"draftConfig"),p([f({type:String})],c.prototype,"promoCodes"),p([f({type:String})],c.prototype,"domain"),p([I()],c.prototype,"lastSelectionActionDate"),p([I()],c.prototype,"isMobile"),p([I()],c.prototype,"pluginPromoCodes"),ue(c);export{c as BeamSelectNonprofit};
237
235
  //# sourceMappingURL=select-nonprofit.esm.js.map