@beamimpact/web-sdk 1.29.0-beta.1 → 1.29.0-beta.2

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 (107) hide show
  1. package/README.md +9 -0
  2. package/dist/chunks/{_share-dialog-dependencies-uWBh5ejr.esm.js → _share-dialog-dependencies-SPLB_3ny.esm.js} +2 -2
  3. package/dist/chunks/_share-dialog-dependencies-SPLB_3ny.esm.js.map +1 -0
  4. package/dist/chunks/{_share-dialog-dependencies-d9W7-qTW.esm.js → _share-dialog-dependencies-rhp3w_bc.esm.js} +2 -2
  5. package/dist/chunks/_share-dialog-dependencies-rhp3w_bc.esm.js.map +1 -0
  6. package/dist/chunks/index-B6ZVcw-2.esm.js +2 -0
  7. package/dist/chunks/index-B6ZVcw-2.esm.js.map +1 -0
  8. package/dist/chunks/{index-dG8DWaaH.esm.d.ts → index-G6h0AEAz.esm.d.ts} +6 -6
  9. package/dist/chunks/index-IeUA7g43.esm.js +2 -0
  10. package/dist/chunks/index-IeUA7g43.esm.js.map +1 -0
  11. package/dist/chunks/index-k7UbsAvh.esm.js +2 -0
  12. package/dist/chunks/index-k7UbsAvh.esm.js.map +1 -0
  13. package/dist/chunks/index-nrUfRMjl.esm.js +2 -0
  14. package/dist/chunks/index-nrUfRMjl.esm.js.map +1 -0
  15. package/dist/chunks/index-zaXXznPD.esm.js +2 -0
  16. package/dist/chunks/index-zaXXznPD.esm.js.map +1 -0
  17. package/dist/chunks/{order-page-yvantjI2.esm.js → order-page-0Hp4NoQq.esm.js} +2 -2
  18. package/dist/chunks/{order-page-yvantjI2.esm.js.map → order-page-0Hp4NoQq.esm.js.map} +1 -1
  19. package/dist/chunks/{order-page-cPB3srgo.esm.js → order-page-a46zvUZT.esm.js} +2 -2
  20. package/dist/chunks/{order-page-cPB3srgo.esm.js.map → order-page-a46zvUZT.esm.js.map} +1 -1
  21. package/dist/chunks/routes-MZb9Fq0P.esm.js +2 -0
  22. package/dist/chunks/routes-MZb9Fq0P.esm.js.map +1 -0
  23. package/dist/chunks/{update-cart-19PtzbXK.esm.js → update-cart-vHXpyCQh.esm.js} +2 -2
  24. package/dist/chunks/{update-cart-19PtzbXK.esm.js.map → update-cart-vHXpyCQh.esm.js.map} +1 -1
  25. package/dist/components/community-impact.esm.js +1 -1
  26. package/dist/components/community-impact.js +1 -1
  27. package/dist/components/cumulative-impact.esm.js +1 -1
  28. package/dist/components/cumulative-impact.js +1 -1
  29. package/dist/components/impact-overview.esm.js +1 -1
  30. package/dist/components/impact-overview.esm.js.map +1 -1
  31. package/dist/components/impact-overview.js +1 -1
  32. package/dist/components/impact-overview.js.map +1 -1
  33. package/dist/components/index.esm.js +1 -1
  34. package/dist/components/index.js +1 -1
  35. package/dist/components/post-purchase.d.ts +1 -1
  36. package/dist/components/post-purchase.esm.js +4 -4
  37. package/dist/components/post-purchase.esm.js.map +1 -1
  38. package/dist/components/post-purchase.js +4 -4
  39. package/dist/components/post-purchase.js.map +1 -1
  40. package/dist/components/redeem-transaction.esm.js +1 -1
  41. package/dist/components/redeem-transaction.js +1 -1
  42. package/dist/components/select-nonprofit.esm.js +1 -1
  43. package/dist/components/select-nonprofit.js +1 -1
  44. package/dist/components/shopify.esm.js +1 -1
  45. package/dist/components/shopify.js +1 -1
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.esm.js +1 -1
  48. package/dist/index.js +1 -1
  49. package/dist/integrations/cart.esm.js +1 -1
  50. package/dist/integrations/cart.js +1 -1
  51. package/dist/integrations/index.esm.js +1 -1
  52. package/dist/integrations/index.js +1 -1
  53. package/dist/integrations/shopify.esm.js +1 -1
  54. package/dist/integrations/shopify.js +1 -1
  55. package/dist/react/beam-partner-logos.d.ts +1 -1
  56. package/dist/react/beam-partner-logos.esm.js +1 -1
  57. package/dist/react/beam-partner-logos.esm.js.map +1 -1
  58. package/dist/react/beam-partner-logos.js +1 -1
  59. package/dist/react/beam-partner-logos.js.map +1 -1
  60. package/dist/react/community-impact.d.ts +1 -1
  61. package/dist/react/community-impact.esm.js +1 -1
  62. package/dist/react/community-impact.esm.js.map +1 -1
  63. package/dist/react/community-impact.js +1 -1
  64. package/dist/react/community-impact.js.map +1 -1
  65. package/dist/react/cumulative-impact.d.ts +1 -1
  66. package/dist/react/cumulative-impact.esm.js +1 -1
  67. package/dist/react/cumulative-impact.esm.js.map +1 -1
  68. package/dist/react/cumulative-impact.js +1 -1
  69. package/dist/react/cumulative-impact.js.map +1 -1
  70. package/dist/react/impact-overview.d.ts +1 -1
  71. package/dist/react/impact-overview.esm.js +1 -1
  72. package/dist/react/impact-overview.esm.js.map +1 -1
  73. package/dist/react/impact-overview.js +1 -1
  74. package/dist/react/impact-overview.js.map +1 -1
  75. package/dist/react/index.d.ts +6 -6
  76. package/dist/react/index.esm.js +1 -1
  77. package/dist/react/index.js +1 -1
  78. package/dist/react/post-purchase.d.ts +1 -1
  79. package/dist/react/post-purchase.esm.js +1 -1
  80. package/dist/react/post-purchase.esm.js.map +1 -1
  81. package/dist/react/post-purchase.js +1 -1
  82. package/dist/react/post-purchase.js.map +1 -1
  83. package/dist/react/redeem-transaction.d.ts +1 -1
  84. package/dist/react/redeem-transaction.esm.js +1 -1
  85. package/dist/react/redeem-transaction.esm.js.map +1 -1
  86. package/dist/react/redeem-transaction.js +1 -1
  87. package/dist/react/redeem-transaction.js.map +1 -1
  88. package/dist/react/select-nonprofit.d.ts +1 -1
  89. package/dist/react/select-nonprofit.esm.js +1 -1
  90. package/dist/react/select-nonprofit.esm.js.map +1 -1
  91. package/dist/react/select-nonprofit.js +1 -1
  92. package/dist/react/select-nonprofit.js.map +1 -1
  93. package/package.json +1 -1
  94. package/dist/chunks/_share-dialog-dependencies-d9W7-qTW.esm.js.map +0 -1
  95. package/dist/chunks/_share-dialog-dependencies-uWBh5ejr.esm.js.map +0 -1
  96. package/dist/chunks/index-BW-QdExJ.esm.js +0 -2
  97. package/dist/chunks/index-BW-QdExJ.esm.js.map +0 -1
  98. package/dist/chunks/index-DCwz1LOg.esm.js +0 -2
  99. package/dist/chunks/index-DCwz1LOg.esm.js.map +0 -1
  100. package/dist/chunks/index-NHpZM_uW.esm.js +0 -2
  101. package/dist/chunks/index-NHpZM_uW.esm.js.map +0 -1
  102. package/dist/chunks/index-m6WKjTPD.esm.js +0 -2
  103. package/dist/chunks/index-m6WKjTPD.esm.js.map +0 -1
  104. package/dist/chunks/index-w1rUrZm2.esm.js +0 -2
  105. package/dist/chunks/index-w1rUrZm2.esm.js.map +0 -1
  106. package/dist/chunks/routes-S9p8QYNm.esm.js +0 -2
  107. package/dist/chunks/routes-S9p8QYNm.esm.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{BeamCommunityImpact as C}from"./community-impact.esm.js";import{BeamCumulativeImpact as d}from"./cumulative-impact.esm.js";import{BeamImpactOverview as w}from"./impact-overview.esm.js";import{BeamSelectNonprofit as N}from"./select-nonprofit.esm.js";import{BeamRedeemTransaction as R}from"./redeem-transaction.esm.js";import{BeamPostPurchase as T}from"./post-purchase.esm.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-S9p8QYNm.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";export{C as BeamCommunityImpact,d as BeamCumulativeImpact,w as BeamImpactOverview,T as BeamPostPurchase,R as BeamRedeemTransaction,N as BeamSelectNonprofit};
1
+ import{BeamCommunityImpact as C}from"./community-impact.esm.js";import{BeamCumulativeImpact as d}from"./cumulative-impact.esm.js";import{BeamImpactOverview as w}from"./impact-overview.esm.js";import{BeamSelectNonprofit as N}from"./select-nonprofit.esm.js";import{BeamRedeemTransaction as R}from"./redeem-transaction.esm.js";import{BeamPostPurchase as T}from"./post-purchase.esm.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-MZb9Fq0P.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";export{C as BeamCommunityImpact,d as BeamCumulativeImpact,w as BeamImpactOverview,T as BeamPostPurchase,R as BeamRedeemTransaction,N as BeamSelectNonprofit};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1,2 +1,2 @@
1
- import{BeamCommunityImpact as C}from"./community-impact.js";import{BeamCumulativeImpact as d}from"./cumulative-impact.js";import{BeamImpactOverview as w}from"./impact-overview.js";import{BeamSelectNonprofit as N}from"./select-nonprofit.js";import{BeamRedeemTransaction as R}from"./redeem-transaction.js";import{BeamPostPurchase as T}from"./post-purchase.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.js";import"../chunks/localize-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-S9p8QYNm.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";export{C as BeamCommunityImpact,d as BeamCumulativeImpact,w as BeamImpactOverview,T as BeamPostPurchase,R as BeamRedeemTransaction,N as BeamSelectNonprofit};
1
+ import{BeamCommunityImpact as C}from"./community-impact.js";import{BeamCumulativeImpact as d}from"./cumulative-impact.js";import{BeamImpactOverview as w}from"./impact-overview.js";import{BeamSelectNonprofit as N}from"./select-nonprofit.js";import{BeamRedeemTransaction as R}from"./redeem-transaction.js";import{BeamPostPurchase as T}from"./post-purchase.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.js";import"../chunks/localize-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-MZb9Fq0P.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";export{C as BeamCommunityImpact,d as BeamCumulativeImpact,w as BeamImpactOverview,T as BeamPostPurchase,R as BeamRedeemTransaction,N as BeamSelectNonprofit};
2
2
  //# sourceMappingURL=index.js.map
@@ -34,7 +34,7 @@ declare class BeamPostPurchase extends LitElement {
34
34
  private transactionId;
35
35
  private chainId;
36
36
  private localStorage;
37
- connectedCallback(): void;
37
+ protected firstUpdated(_changedProperties: PropertyValues): void;
38
38
  willUpdate(previousPropertyValues: PropertyValues): void;
39
39
  handlePostTransaction: () => Promise<{
40
40
  transactionId: string;
@@ -1,4 +1,4 @@
1
- import{f as r,t as a,g as I,y as h}from"../chunks/lit-h1W25hjN.esm.js";import{a as y}from"../chunks/cookies-BnIoXWd0.esm.js";import{c as u,d as g,e as m,A as C,_ as b}from"../chunks/localize-e-mss8ya.esm.js";import{c as v}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{D as f,g as $,a as S}from"../chunks/routes-S9p8QYNm.esm.js";import"./redeem-transaction.esm.js";import"./impact-overview.esm.js";import{B as U}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";var w=Object.defineProperty,K=Object.getOwnPropertyDescriptor,e=(d,o,i,n)=>{for(var s=n>1?void 0:n?K(o,i):o,c=d.length-1,p;c>=0;c--)(p=d[c])&&(s=(n?p(o,i,s):p(s))||s);return n&&s&&w(o,i,s),s};const l=["baseUrl","apiKey","orderId","email","cartTotal","currencyCode","lang"],A=["storeId","postalCode","countryCode","cart","discountCodes"];class t extends I{constructor(){super(...arguments),this.baseUrl=f,this.currencyCode="USD",this.lang="en",this.debug=!1,this.activeWidget="redeem-transaction",this.nonprofitId=null,this.selectionId=null,this.cartId=null,this.beamCartId=null,this.userId=null,this.transactionId=null,this.chainId=null,this.localStorage=v(this),this.handlePostTransaction=async()=>{if(m(l,this),!this.storeId&&this.postalCode&&this.countryCode){const i=await $({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{postalCode:this.postalCode,countryCode:this.countryCode,widgetName:"redeem-transaction",version:"1.0.0"}});this.storeId=i.store?.id}const o=await S({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{nonprofitId:this.nonprofitId??void 0,selectionId:this.selectionId??void 0,cartId:this.cartId??void 0,beamCartId:this.beamCartId??void 0,storeId:this.storeId,orderId:this.orderId,cartTotal:this.cartTotal,email:this.email,currencyCode:this.currencyCode,postalCode:this.postalCode,countryCode:this.countryCode,cart:this.cart,discountCodes:this.discountCodes}});return this.transactionId=o.transactionId,this.chainId=o.chainId,this.userId=o.beamUserId,this.nonprofitId=o.nonprofitId,this.nonprofitId&&(this.activeWidget="impact-overview"),this.localStorage.removeItem("transaction"),this.localStorage.removeItem("cart"),o},this.transactionDataController=new C(this,this.handlePostTransaction)}connectedCallback(){super.connectedCallback(),m(l,this),this.nonprofitId=Number(this.localStorage.getItem("nonprofit"))||null,this.selectionId=this.localStorage.getItem("transaction")||null,this.cartId=this.localStorage.getItemJson("cart")?.cartId||null,this.beamCartId=y(U)||null,this.selectionId&&this.nonprofitId&&(this.activeWidget="impact-overview")}willUpdate(o){[...l,...A].some(i=>o.has(i))&&this.transactionDataController.exec()}render(){return this.transactionDataController.loading?"":this.transactionDataController.error?this.debug?b({error:this.transactionDataController.error}):"":this.activeWidget==="redeem-transaction"?h`
1
+ import{f as o,t as a,g as I,y as l}from"../chunks/lit-h1W25hjN.esm.js";import{a as y}from"../chunks/cookies-BnIoXWd0.esm.js";import{c as u,d as g,e as m,A as C,_ as b}from"../chunks/localize-e-mss8ya.esm.js";import{c as f}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{D as v,g as $,a as S}from"../chunks/routes-MZb9Fq0P.esm.js";import"./redeem-transaction.esm.js";import"./impact-overview.esm.js";import{B as U}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";var w=Object.defineProperty,K=Object.getOwnPropertyDescriptor,e=(d,r,i,n)=>{for(var s=n>1?void 0:n?K(r,i):r,p=d.length-1,c;p>=0;p--)(c=d[p])&&(s=(n?c(r,i,s):c(s))||s);return n&&s&&w(r,i,s),s};const h=["baseUrl","apiKey","orderId","email","cartTotal","currencyCode","lang"],A=["storeId","postalCode","countryCode","cart","discountCodes"];class t extends I{constructor(){super(...arguments),this.baseUrl=v,this.currencyCode="USD",this.lang="en",this.debug=!1,this.activeWidget="redeem-transaction",this.nonprofitId=null,this.selectionId=null,this.cartId=null,this.beamCartId=null,this.userId=null,this.transactionId=null,this.chainId=null,this.localStorage=f(this),this.handlePostTransaction=async()=>{if(m(h,this),!this.storeId&&this.postalCode&&this.countryCode){const i=await $({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{postalCode:this.postalCode,countryCode:this.countryCode,widgetName:"redeem-transaction",version:"1.0.0"}});this.storeId=i.store?.id}const r=await S({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{nonprofitId:this.nonprofitId??void 0,selectionId:this.selectionId??void 0,cartId:this.cartId??void 0,beamCartId:this.beamCartId??void 0,storeId:this.storeId,orderId:this.orderId,cartTotal:this.cartTotal,email:this.email,currencyCode:this.currencyCode,postalCode:this.postalCode,countryCode:this.countryCode,cart:this.cart,discountCodes:this.discountCodes}});return this.transactionId=r.transactionId,this.chainId=r.chainId,this.userId=r.beamUserId,this.nonprofitId=r.nonprofitId,this.nonprofitId&&(this.activeWidget="impact-overview"),this.localStorage.removeItem("transaction"),this.localStorage.removeItem("cart"),r},this.transactionDataController=new C(this,this.handlePostTransaction)}firstUpdated(r){m(h,this),this.nonprofitId=Number(this.localStorage.getItem("nonprofit"))||null,this.selectionId=this.localStorage.getItem("transaction")||null,this.cartId=this.localStorage.getItemJson("cart")?.cartId||null,this.beamCartId=y(U)||null,this.selectionId&&this.nonprofitId&&(this.activeWidget="impact-overview")}willUpdate(r){[...h,...A].some(i=>r.has(i))&&this.transactionDataController.exec()}render(){return this.transactionDataController.loading?"":this.transactionDataController.error?this.debug?b({error:this.transactionDataController.error}):"":this.activeWidget==="redeem-transaction"?l`
2
2
  <beam-redeem-transaction
3
3
  part="redeem-transaction"
4
4
  baseUrl="${this.baseUrl}"
@@ -9,9 +9,9 @@ import{f as r,t as a,g as I,y as h}from"../chunks/lit-h1W25hjN.esm.js";import{a
9
9
  cart="${JSON.stringify(this.cart)}"
10
10
  lang="${this.lang}"
11
11
  ?debug="${this.debug}"
12
- @beamnonprofitselect="${o=>{if(!(o instanceof CustomEvent))return;const{selectedNonprofitId:i}=o.detail;this.nonprofitId=i??null,this.activeWidget="impact-overview"}}"
12
+ @beamnonprofitselect="${r=>{if(!(r instanceof CustomEvent))return;const{selectedNonprofitId:i}=r.detail;this.nonprofitId=i??null,this.activeWidget="impact-overview"}}"
13
13
  ></beam-redeem-transaction>
14
- `:this.activeWidget==="impact-overview"?h`
14
+ `:this.activeWidget==="impact-overview"?l`
15
15
  <beam-impact-overview
16
16
  part="impact-overview"
17
17
  baseUrl="${this.baseUrl}"
@@ -22,5 +22,5 @@ import{f as r,t as a,g as I,y as h}from"../chunks/lit-h1W25hjN.esm.js";import{a
22
22
  lang="${this.lang}"
23
23
  ?debug="${this.debug}"
24
24
  ></beam-impact-overview>
25
- `:""}}t.tagName="beam-post-purchase",t.styles=[u],e([r({type:String})],t.prototype,"baseUrl",2),e([r({type:String})],t.prototype,"apiKey",2),e([r({type:Number,reflect:!0})],t.prototype,"storeId",2),e([r({type:String})],t.prototype,"postalCode",2),e([r({type:String})],t.prototype,"countryCode",2),e([r({type:String})],t.prototype,"orderId",2),e([r({type:String})],t.prototype,"email",2),e([r({type:Number})],t.prototype,"cartTotal",2),e([r({type:String})],t.prototype,"currencyCode",2),e([r({type:String})],t.prototype,"lang",2),e([r({type:Object})],t.prototype,"cart",2),e([r({type:Array})],t.prototype,"discountCodes",2),e([r({type:Boolean})],t.prototype,"debug",2),e([a()],t.prototype,"activeWidget",2),e([a()],t.prototype,"nonprofitId",2),e([a()],t.prototype,"selectionId",2),e([a()],t.prototype,"cartId",2),e([a()],t.prototype,"beamCartId",2),e([a()],t.prototype,"userId",2),e([a()],t.prototype,"transactionId",2),e([a()],t.prototype,"chainId",2),g(t);export{t as BeamPostPurchase};
25
+ `:""}}t.tagName="beam-post-purchase",t.styles=[u],e([o({type:String})],t.prototype,"baseUrl",2),e([o({type:String})],t.prototype,"apiKey",2),e([o({type:Number,reflect:!0})],t.prototype,"storeId",2),e([o({type:String})],t.prototype,"postalCode",2),e([o({type:String})],t.prototype,"countryCode",2),e([o({type:String})],t.prototype,"orderId",2),e([o({type:String})],t.prototype,"email",2),e([o({type:Number})],t.prototype,"cartTotal",2),e([o({type:String})],t.prototype,"currencyCode",2),e([o({type:String})],t.prototype,"lang",2),e([o({type:Object})],t.prototype,"cart",2),e([o({type:Array})],t.prototype,"discountCodes",2),e([o({type:Boolean})],t.prototype,"debug",2),e([a()],t.prototype,"activeWidget",2),e([a()],t.prototype,"nonprofitId",2),e([a()],t.prototype,"selectionId",2),e([a()],t.prototype,"cartId",2),e([a()],t.prototype,"beamCartId",2),e([a()],t.prototype,"userId",2),e([a()],t.prototype,"transactionId",2),e([a()],t.prototype,"chainId",2),g(t);export{t as BeamPostPurchase};
26
26
  //# sourceMappingURL=post-purchase.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"post-purchase.esm.js","sources":["../../src/components/post-purchase/index.ts"],"sourcesContent":["import { html, LitElement, PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport { getCookieValue } from \"../../shared/cookies\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { createScopedLocalStorage } from \"../../shared/local-storage\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { DEFAULT_BASE_URL } from \"../../api-sdk/constants\";\nimport { getChainNonprofits, postTransaction } from \"../../api-sdk/v3/routes\";\nimport \"../redeem-transaction\";\nimport \"../impact-overview\";\nimport { BEAM_CART_COOKIE_NAME, TBeamCartLocalStorage, TCart } from \"../../shared/cart-contents\";\nimport { BeamNonprofitSelectEvent } from \"../../shared/events\";\n\nconst REQUIRED_DATA_PROPS = [\"baseUrl\", \"apiKey\", \"orderId\", \"email\", \"cartTotal\", \"currencyCode\", \"lang\"];\nconst OPTIONAL_DATA_PROPS = [\"storeId\", \"postalCode\", \"countryCode\", \"cart\", \"discountCodes\"];\n\nexport class BeamPostPurchase extends LitElement {\n static tagName = \"beam-post-purchase\";\n\n @property({ type: String })\n public baseUrl: string = DEFAULT_BASE_URL;\n\n @property({ type: String })\n public apiKey!: string;\n\n @property({ type: Number, reflect: true })\n public storeId?: number; // Either storeId or postalCode, countryCode must be provided\n\n @property({ type: String })\n public postalCode?: string;\n\n @property({ type: String })\n public countryCode?: string;\n\n @property({ type: String })\n public orderId!: string;\n\n @property({ type: String })\n public email!: string;\n\n @property({ type: Number })\n public cartTotal!: number;\n\n @property({ type: String })\n public currencyCode = \"USD\";\n\n @property({ type: String })\n public lang: LANGUAGES = \"en\";\n\n @property({ type: Object })\n public cart?: TCart;\n\n @property({ type: Array })\n public discountCodes?: string[];\n\n @property({ type: Boolean })\n public debug = false;\n\n @state() private activeWidget: \"redeem-transaction\" | \"impact-overview\" = \"redeem-transaction\";\n @state() private nonprofitId: number | null = null; // from localStorage or redeem-transaction result\n @state() private selectionId: string | null = null; // from localStorage\n @state() private cartId: string | null = null; // from localStorage, external cart ID\n @state() private beamCartId: string | null = null; // from cookie, Beam cart ID\n @state() private userId: string | null = null; // from postTransaction\n @state() private transactionId: string | null = null; // from postTransaction\n @state() private chainId: number | null = null; // from postTransaction, used by impact-overview\n\n private localStorage = createScopedLocalStorage(this);\n\n connectedCallback() {\n super.connectedCallback();\n enforceConfig(REQUIRED_DATA_PROPS, this);\n this.nonprofitId = Number(this.localStorage.getItem(\"nonprofit\")) || null;\n this.selectionId = this.localStorage.getItem(\"transaction\") || null;\n this.cartId = this.localStorage.getItemJson<TBeamCartLocalStorage>(\"cart\")?.cartId || null;\n // Reading beamCartId from cookies instead of localStorage allows it to work across subdomains\n this.beamCartId = getCookieValue(BEAM_CART_COOKIE_NAME) || null;\n\n if (this.selectionId && this.nonprofitId) {\n this.activeWidget = \"impact-overview\";\n }\n }\n\n willUpdate(previousPropertyValues: PropertyValues) {\n // Also fires on first load as props go from undefined => value\n const refreshOnChangeProps = [...REQUIRED_DATA_PROPS, ...OPTIONAL_DATA_PROPS];\n if (refreshOnChangeProps.some((p) => previousPropertyValues.has(p))) {\n this.transactionDataController.exec();\n }\n }\n\n handlePostTransaction = async () => {\n enforceConfig(REQUIRED_DATA_PROPS, this);\n\n if (!this.storeId && this.postalCode && this.countryCode) {\n const res = await getChainNonprofits({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n queryParams: {\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n widgetName: \"redeem-transaction\",\n version: \"1.0.0\",\n },\n });\n this.storeId = res.store?.id;\n }\n\n const result = await postTransaction({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n requestBody: {\n nonprofitId: this.nonprofitId ?? undefined,\n selectionId: this.selectionId ?? undefined,\n cartId: this.cartId ?? undefined,\n beamCartId: this.beamCartId ?? undefined,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n storeId: this.storeId!,\n orderId: this.orderId,\n cartTotal: this.cartTotal,\n email: this.email,\n currencyCode: this.currencyCode,\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n cart: this.cart,\n discountCodes: this.discountCodes,\n },\n });\n\n this.transactionId = result.transactionId;\n this.chainId = result.chainId;\n this.userId = result.beamUserId;\n this.nonprofitId = result.nonprofitId;\n\n if (this.nonprofitId) {\n this.activeWidget = \"impact-overview\";\n }\n\n this.localStorage.removeItem(\"transaction\");\n this.localStorage.removeItem(\"cart\");\n\n return result;\n };\n\n private transactionDataController = new AsyncController<typeof this.handlePostTransaction>(\n this,\n this.handlePostTransaction\n );\n\n render() {\n if (this.transactionDataController.loading) {\n return \"\";\n }\n if (this.transactionDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.transactionDataController.error });\n }\n return \"\";\n }\n if (this.activeWidget === \"redeem-transaction\") {\n return html`\n <beam-redeem-transaction\n part=\"redeem-transaction\"\n baseUrl=\"${this.baseUrl}\"\n apiKey=\"${this.apiKey}\"\n chainId=\"${this.chainId}\"\n storeId=\"${this.storeId}\"\n transactionId=\"${this.transactionId}\"\n cart=\"${JSON.stringify(this.cart)}\"\n lang=\"${this.lang}\"\n ?debug=\"${this.debug}\"\n @beamnonprofitselect=\"${(event: Event) => {\n if (!(event instanceof CustomEvent)) return; // TS guard\n const { selectedNonprofitId } = (event as BeamNonprofitSelectEvent).detail;\n this.nonprofitId = selectedNonprofitId ?? null;\n this.activeWidget = \"impact-overview\";\n }}\"\n ></beam-redeem-transaction>\n `;\n }\n if (this.activeWidget === \"impact-overview\") {\n return html`\n <beam-impact-overview\n part=\"impact-overview\"\n baseUrl=\"${this.baseUrl}\"\n apiKey=\"${this.apiKey}\"\n chainId=\"${this.chainId}\"\n userId=\"${this.userId}\"\n nonprofitId=\"${this.nonprofitId}\"\n lang=\"${this.lang}\"\n ?debug=\"${this.debug}\"\n ></beam-impact-overview>\n `;\n }\n return \"\";\n }\n\n static styles = [cssReset];\n}\n\ndefineCustomElement(BeamPostPurchase);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-post-purchase\": BeamPostPurchase;\n }\n}\n"],"names":["m","u","t","s","a","e","r","n","l","d","REQUIRED_DATA_PROPS","OPTIONAL_DATA_PROPS","BeamPostPurchase","LitElement","DEFAULT_BASE_URL","createScopedLocalStorage","enforceConfig","res","getChainNonprofits","result","postTransaction","AsyncController","getCookieValue","BEAM_CART_COOKIE_NAME","previousPropertyValues","p","_errorMessage","html","event","selectedNonprofitId","cssReset","__decorateClass","property","state","defineCustomElement"],"mappings":"y4BAAA,IAAAA,EAAA,OAAA,eAAAC,EAAA,OAAA,yBAAAC,EAAA,CAAAC,EAAAC,EAAAC,EAAAC,IAAA,CAAA,QAAAC,EAAAD,EAAA,EAAA,OAAAA,EAAAL,EAAAG,EAAAC,CAAA,EAAAD,EAAAI,EAAAL,EAAA,OAAA,EAAAM,EAAAD,GAAA,EAAAA,KAAAC,EAAAN,EAAAK,CAAA,KAAAD,GAAAD,EAAAG,EAAAL,EAAAC,EAAAE,CAAA,EAAAE,EAAAF,CAAA,IAAAA,GAAA,OAAAD,GAAAC,GAAAP,EAAAI,EAAAC,EAAAE,CAAA,EAAAA,CAAA,EAkBA,MAAMG,EAAsB,CAAC,UAAW,SAAU,UAAW,QAAS,YAAa,eAAgB,MAAM,EACnGC,EAAsB,CAAC,UAAW,aAAc,cAAe,OAAQ,eAAe,QAE/EC,UAAyBC,CAAW,CAA1C,aAIL,CAAA,MAAA,GAAA,SAAA,EAAA,KAAO,QAAkBC,EAwBzB,KAAO,aAAe,MAGtB,KAAO,KAAkB,KASzB,KAAO,MAAQ,GAEN,KAAQ,aAAyD,qBACjE,KAAQ,YAA6B,KACrC,KAAQ,YAA6B,KACrC,KAAQ,OAAwB,KAChC,KAAQ,WAA4B,KACpC,KAAQ,OAAwB,KAChC,KAAQ,cAA+B,KAC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,EAAA,CAAhBE,EA9CU,CAAA,EAAArB,EA8CM,0BACAmB,EAAA,CAAhBE,GA/CU,EAAArB,EA+CM,sBACAmB,EAAA,CAAhBE,GAhDU,EAAArB,EAgDM,6BACAmB,EAAA,CAAhBE,GAjDU,EAAArB,EAiDM,UA2InBsB,UAAAA,CAAAA,EAAAA,EAAoBtB,CAAgB"}
1
+ {"version":3,"file":"post-purchase.esm.js","sources":["../../src/components/post-purchase/index.ts"],"sourcesContent":["import { html, LitElement, PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport { getCookieValue } from \"../../shared/cookies\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { createScopedLocalStorage } from \"../../shared/local-storage\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { DEFAULT_BASE_URL } from \"../../api-sdk/constants\";\nimport { getChainNonprofits, postTransaction } from \"../../api-sdk/v3/routes\";\nimport \"../redeem-transaction\";\nimport \"../impact-overview\";\nimport { BEAM_CART_COOKIE_NAME, TBeamCartLocalStorage, TCart } from \"../../shared/cart-contents\";\nimport { BeamNonprofitSelectEvent } from \"../../shared/events\";\n\nconst REQUIRED_DATA_PROPS = [\"baseUrl\", \"apiKey\", \"orderId\", \"email\", \"cartTotal\", \"currencyCode\", \"lang\"];\nconst OPTIONAL_DATA_PROPS = [\"storeId\", \"postalCode\", \"countryCode\", \"cart\", \"discountCodes\"];\n\nexport class BeamPostPurchase extends LitElement {\n static tagName = \"beam-post-purchase\";\n\n @property({ type: String })\n public baseUrl: string = DEFAULT_BASE_URL;\n\n @property({ type: String })\n public apiKey!: string;\n\n @property({ type: Number, reflect: true })\n public storeId?: number; // Either storeId or postalCode, countryCode must be provided\n\n @property({ type: String })\n public postalCode?: string;\n\n @property({ type: String })\n public countryCode?: string;\n\n @property({ type: String })\n public orderId!: string;\n\n @property({ type: String })\n public email!: string;\n\n @property({ type: Number })\n public cartTotal!: number;\n\n @property({ type: String })\n public currencyCode = \"USD\";\n\n @property({ type: String })\n public lang: LANGUAGES = \"en\";\n\n @property({ type: Object })\n public cart?: TCart;\n\n @property({ type: Array })\n public discountCodes?: string[];\n\n @property({ type: Boolean })\n public debug = false;\n\n @state() private activeWidget: \"redeem-transaction\" | \"impact-overview\" = \"redeem-transaction\";\n @state() private nonprofitId: number | null = null; // from localStorage or redeem-transaction result\n @state() private selectionId: string | null = null; // from localStorage\n @state() private cartId: string | null = null; // from localStorage, external cart ID\n @state() private beamCartId: string | null = null; // from cookie, Beam cart ID\n @state() private userId: string | null = null; // from postTransaction\n @state() private transactionId: string | null = null; // from postTransaction\n @state() private chainId: number | null = null; // from postTransaction, used by impact-overview\n\n private localStorage = createScopedLocalStorage(this);\n\n protected firstUpdated(_changedProperties: PropertyValues) {\n enforceConfig(REQUIRED_DATA_PROPS, this);\n this.nonprofitId = Number(this.localStorage.getItem(\"nonprofit\")) || null;\n this.selectionId = this.localStorage.getItem(\"transaction\") || null;\n this.cartId = this.localStorage.getItemJson<TBeamCartLocalStorage>(\"cart\")?.cartId || null;\n // Reading beamCartId from cookies instead of localStorage allows it to work across subdomains\n this.beamCartId = getCookieValue(BEAM_CART_COOKIE_NAME) || null;\n\n if (this.selectionId && this.nonprofitId) {\n this.activeWidget = \"impact-overview\";\n }\n }\n\n willUpdate(previousPropertyValues: PropertyValues) {\n // Also fires on first load as props go from undefined => value\n const refreshOnChangeProps = [...REQUIRED_DATA_PROPS, ...OPTIONAL_DATA_PROPS];\n if (refreshOnChangeProps.some((p) => previousPropertyValues.has(p))) {\n this.transactionDataController.exec();\n }\n }\n\n handlePostTransaction = async () => {\n enforceConfig(REQUIRED_DATA_PROPS, this);\n\n if (!this.storeId && this.postalCode && this.countryCode) {\n const res = await getChainNonprofits({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n queryParams: {\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n widgetName: \"redeem-transaction\",\n version: \"1.0.0\",\n },\n });\n this.storeId = res.store?.id;\n }\n\n const result = await postTransaction({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n requestBody: {\n nonprofitId: this.nonprofitId ?? undefined,\n selectionId: this.selectionId ?? undefined,\n cartId: this.cartId ?? undefined,\n beamCartId: this.beamCartId ?? undefined,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n storeId: this.storeId!,\n orderId: this.orderId,\n cartTotal: this.cartTotal,\n email: this.email,\n currencyCode: this.currencyCode,\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n cart: this.cart,\n discountCodes: this.discountCodes,\n },\n });\n\n this.transactionId = result.transactionId;\n this.chainId = result.chainId;\n this.userId = result.beamUserId;\n this.nonprofitId = result.nonprofitId;\n\n if (this.nonprofitId) {\n this.activeWidget = \"impact-overview\";\n }\n\n this.localStorage.removeItem(\"transaction\");\n this.localStorage.removeItem(\"cart\");\n\n return result;\n };\n\n private transactionDataController = new AsyncController<typeof this.handlePostTransaction>(\n this,\n this.handlePostTransaction\n );\n\n render() {\n if (this.transactionDataController.loading) {\n return \"\";\n }\n if (this.transactionDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.transactionDataController.error });\n }\n return \"\";\n }\n if (this.activeWidget === \"redeem-transaction\") {\n return html`\n <beam-redeem-transaction\n part=\"redeem-transaction\"\n baseUrl=\"${this.baseUrl}\"\n apiKey=\"${this.apiKey}\"\n chainId=\"${this.chainId}\"\n storeId=\"${this.storeId}\"\n transactionId=\"${this.transactionId}\"\n cart=\"${JSON.stringify(this.cart)}\"\n lang=\"${this.lang}\"\n ?debug=\"${this.debug}\"\n @beamnonprofitselect=\"${(event: Event) => {\n if (!(event instanceof CustomEvent)) return; // TS guard\n const { selectedNonprofitId } = (event as BeamNonprofitSelectEvent).detail;\n this.nonprofitId = selectedNonprofitId ?? null;\n this.activeWidget = \"impact-overview\";\n }}\"\n ></beam-redeem-transaction>\n `;\n }\n if (this.activeWidget === \"impact-overview\") {\n return html`\n <beam-impact-overview\n part=\"impact-overview\"\n baseUrl=\"${this.baseUrl}\"\n apiKey=\"${this.apiKey}\"\n chainId=\"${this.chainId}\"\n userId=\"${this.userId}\"\n nonprofitId=\"${this.nonprofitId}\"\n lang=\"${this.lang}\"\n ?debug=\"${this.debug}\"\n ></beam-impact-overview>\n `;\n }\n return \"\";\n }\n\n static styles = [cssReset];\n}\n\ndefineCustomElement(BeamPostPurchase);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-post-purchase\": BeamPostPurchase;\n }\n}\n"],"names":["m","u","t","s","a","e","i","o","l","d","REQUIRED_DATA_PROPS","OPTIONAL_DATA_PROPS","BeamPostPurchase","LitElement","DEFAULT_BASE_URL","createScopedLocalStorage","enforceConfig","res","getChainNonprofits","result","postTransaction","AsyncController","_changedProperties","getCookieValue","BEAM_CART_COOKIE_NAME","previousPropertyValues","p","_errorMessage","html","event","selectedNonprofitId","cssReset","__decorateClass","property","state","defineCustomElement"],"mappings":"y4BAAA,IAAAA,EAAA,OAAA,eAAAC,EAAA,OAAA,yBAAAC,EAAA,CAAAC,EAAAC,EAAAC,EAAAC,IAAA,CAAA,QAAAC,EAAAD,EAAA,EAAA,OAAAA,EAAAL,EAAAG,EAAAC,CAAA,EAAAD,EAAAI,EAAAL,EAAA,OAAA,EAAAM,EAAAD,GAAA,EAAAA,KAAAC,EAAAN,EAAAK,CAAA,KAAAD,GAAAD,EAAAG,EAAAL,EAAAC,EAAAE,CAAA,EAAAE,EAAAF,CAAA,IAAAA,GAAA,OAAAD,GAAAC,GAAAP,EAAAI,EAAAC,EAAAE,CAAA,EAAAA,CAAA,EAkBA,MAAMG,EAAsB,CAAC,UAAW,SAAU,UAAW,QAAS,YAAa,eAAgB,MAAM,EACnG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,KAAM,KAAM,CAAC,CApCd,EAAArB,EAqCJ,6BAGAoB,EAAA,CADNC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAvChBrB,EAwCJ,UAAA,QAAA,CAAA,EAEUoB,EAAA,CAAhBE,GA1CU,EAAAtB,EA0CM,4BACAoB,EAAA,CAAhBE,GA3CU,EAAAtB,EA2CM,2BACAoB,EAAA,CAAhBE,EA5CU,CAAA,EAAAtB,EA4CM,2BACAoB,EAAA,CAAhBE,EA7CU,CAAA,EAAAtB,EA6CM,sBACAoB,EAAA,CAAhBE,EA9CU,CAAA,EAAAtB,EA8CM,0BACAoB,EAAA,CAAhBE,GA/CU,EAAAtB,EA+CM,sBACAoB,EAAA,CAAhBE,GAhDU,EAAAtB,EAgDM,6BACAoB,EAAA,CAAhBE,GAjDU,EAAAtB,EAiDM,UA0InBuB,UAAAA,CAAAA,EAAAA,EAAoBvB,CAAgB"}
@@ -1,4 +1,4 @@
1
- import{f as r,t as a,g as I,y as h}from"../chunks/lit-h1W25hjN.esm.js";import{a as y}from"../chunks/cookies-BnIoXWd0.esm.js";import{c as u,d as g,e as m,A as C,_ as b}from"../chunks/localize-e-mss8ya.esm.js";import{c as v}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{D as f,g as $,a as S}from"../chunks/routes-S9p8QYNm.esm.js";import"./redeem-transaction.js";import"./impact-overview.js";import{B as U}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";var w=Object.defineProperty,K=Object.getOwnPropertyDescriptor,e=(d,o,i,n)=>{for(var s=n>1?void 0:n?K(o,i):o,c=d.length-1,p;c>=0;c--)(p=d[c])&&(s=(n?p(o,i,s):p(s))||s);return n&&s&&w(o,i,s),s};const l=["baseUrl","apiKey","orderId","email","cartTotal","currencyCode","lang"],A=["storeId","postalCode","countryCode","cart","discountCodes"];class t extends I{constructor(){super(...arguments),this.baseUrl=f,this.currencyCode="USD",this.lang="en",this.debug=!1,this.activeWidget="redeem-transaction",this.nonprofitId=null,this.selectionId=null,this.cartId=null,this.beamCartId=null,this.userId=null,this.transactionId=null,this.chainId=null,this.localStorage=v(this),this.handlePostTransaction=async()=>{if(m(l,this),!this.storeId&&this.postalCode&&this.countryCode){const i=await $({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{postalCode:this.postalCode,countryCode:this.countryCode,widgetName:"redeem-transaction",version:"1.0.0"}});this.storeId=i.store?.id}const o=await S({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{nonprofitId:this.nonprofitId??void 0,selectionId:this.selectionId??void 0,cartId:this.cartId??void 0,beamCartId:this.beamCartId??void 0,storeId:this.storeId,orderId:this.orderId,cartTotal:this.cartTotal,email:this.email,currencyCode:this.currencyCode,postalCode:this.postalCode,countryCode:this.countryCode,cart:this.cart,discountCodes:this.discountCodes}});return this.transactionId=o.transactionId,this.chainId=o.chainId,this.userId=o.beamUserId,this.nonprofitId=o.nonprofitId,this.nonprofitId&&(this.activeWidget="impact-overview"),this.localStorage.removeItem("transaction"),this.localStorage.removeItem("cart"),o},this.transactionDataController=new C(this,this.handlePostTransaction)}connectedCallback(){super.connectedCallback(),m(l,this),this.nonprofitId=Number(this.localStorage.getItem("nonprofit"))||null,this.selectionId=this.localStorage.getItem("transaction")||null,this.cartId=this.localStorage.getItemJson("cart")?.cartId||null,this.beamCartId=y(U)||null,this.selectionId&&this.nonprofitId&&(this.activeWidget="impact-overview")}willUpdate(o){[...l,...A].some(i=>o.has(i))&&this.transactionDataController.exec()}render(){return this.transactionDataController.loading?"":this.transactionDataController.error?this.debug?b({error:this.transactionDataController.error}):"":this.activeWidget==="redeem-transaction"?h`
1
+ import{f as o,t as a,g as I,y as l}from"../chunks/lit-h1W25hjN.esm.js";import{a as y}from"../chunks/cookies-BnIoXWd0.esm.js";import{c as u,d as g,e as m,A as C,_ as b}from"../chunks/localize-e-mss8ya.esm.js";import{c as f}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{D as v,g as $,a as S}from"../chunks/routes-MZb9Fq0P.esm.js";import"./redeem-transaction.js";import"./impact-overview.js";import{B as U}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";var w=Object.defineProperty,K=Object.getOwnPropertyDescriptor,e=(d,r,i,n)=>{for(var s=n>1?void 0:n?K(r,i):r,p=d.length-1,c;p>=0;p--)(c=d[p])&&(s=(n?c(r,i,s):c(s))||s);return n&&s&&w(r,i,s),s};const h=["baseUrl","apiKey","orderId","email","cartTotal","currencyCode","lang"],A=["storeId","postalCode","countryCode","cart","discountCodes"];class t extends I{constructor(){super(...arguments),this.baseUrl=v,this.currencyCode="USD",this.lang="en",this.debug=!1,this.activeWidget="redeem-transaction",this.nonprofitId=null,this.selectionId=null,this.cartId=null,this.beamCartId=null,this.userId=null,this.transactionId=null,this.chainId=null,this.localStorage=f(this),this.handlePostTransaction=async()=>{if(m(h,this),!this.storeId&&this.postalCode&&this.countryCode){const i=await $({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{postalCode:this.postalCode,countryCode:this.countryCode,widgetName:"redeem-transaction",version:"1.0.0"}});this.storeId=i.store?.id}const r=await S({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{nonprofitId:this.nonprofitId??void 0,selectionId:this.selectionId??void 0,cartId:this.cartId??void 0,beamCartId:this.beamCartId??void 0,storeId:this.storeId,orderId:this.orderId,cartTotal:this.cartTotal,email:this.email,currencyCode:this.currencyCode,postalCode:this.postalCode,countryCode:this.countryCode,cart:this.cart,discountCodes:this.discountCodes}});return this.transactionId=r.transactionId,this.chainId=r.chainId,this.userId=r.beamUserId,this.nonprofitId=r.nonprofitId,this.nonprofitId&&(this.activeWidget="impact-overview"),this.localStorage.removeItem("transaction"),this.localStorage.removeItem("cart"),r},this.transactionDataController=new C(this,this.handlePostTransaction)}firstUpdated(r){m(h,this),this.nonprofitId=Number(this.localStorage.getItem("nonprofit"))||null,this.selectionId=this.localStorage.getItem("transaction")||null,this.cartId=this.localStorage.getItemJson("cart")?.cartId||null,this.beamCartId=y(U)||null,this.selectionId&&this.nonprofitId&&(this.activeWidget="impact-overview")}willUpdate(r){[...h,...A].some(i=>r.has(i))&&this.transactionDataController.exec()}render(){return this.transactionDataController.loading?"":this.transactionDataController.error?this.debug?b({error:this.transactionDataController.error}):"":this.activeWidget==="redeem-transaction"?l`
2
2
  <beam-redeem-transaction
3
3
  part="redeem-transaction"
4
4
  baseUrl="${this.baseUrl}"
@@ -9,9 +9,9 @@ import{f as r,t as a,g as I,y as h}from"../chunks/lit-h1W25hjN.esm.js";import{a
9
9
  cart="${JSON.stringify(this.cart)}"
10
10
  lang="${this.lang}"
11
11
  ?debug="${this.debug}"
12
- @beamnonprofitselect="${o=>{if(!(o instanceof CustomEvent))return;const{selectedNonprofitId:i}=o.detail;this.nonprofitId=i??null,this.activeWidget="impact-overview"}}"
12
+ @beamnonprofitselect="${r=>{if(!(r instanceof CustomEvent))return;const{selectedNonprofitId:i}=r.detail;this.nonprofitId=i??null,this.activeWidget="impact-overview"}}"
13
13
  ></beam-redeem-transaction>
14
- `:this.activeWidget==="impact-overview"?h`
14
+ `:this.activeWidget==="impact-overview"?l`
15
15
  <beam-impact-overview
16
16
  part="impact-overview"
17
17
  baseUrl="${this.baseUrl}"
@@ -22,5 +22,5 @@ import{f as r,t as a,g as I,y as h}from"../chunks/lit-h1W25hjN.esm.js";import{a
22
22
  lang="${this.lang}"
23
23
  ?debug="${this.debug}"
24
24
  ></beam-impact-overview>
25
- `:""}}t.tagName="beam-post-purchase",t.styles=[u],e([r({type:String})],t.prototype,"baseUrl",2),e([r({type:String})],t.prototype,"apiKey",2),e([r({type:Number,reflect:!0})],t.prototype,"storeId",2),e([r({type:String})],t.prototype,"postalCode",2),e([r({type:String})],t.prototype,"countryCode",2),e([r({type:String})],t.prototype,"orderId",2),e([r({type:String})],t.prototype,"email",2),e([r({type:Number})],t.prototype,"cartTotal",2),e([r({type:String})],t.prototype,"currencyCode",2),e([r({type:String})],t.prototype,"lang",2),e([r({type:Object})],t.prototype,"cart",2),e([r({type:Array})],t.prototype,"discountCodes",2),e([r({type:Boolean})],t.prototype,"debug",2),e([a()],t.prototype,"activeWidget",2),e([a()],t.prototype,"nonprofitId",2),e([a()],t.prototype,"selectionId",2),e([a()],t.prototype,"cartId",2),e([a()],t.prototype,"beamCartId",2),e([a()],t.prototype,"userId",2),e([a()],t.prototype,"transactionId",2),e([a()],t.prototype,"chainId",2),g(t);export{t as BeamPostPurchase};
25
+ `:""}}t.tagName="beam-post-purchase",t.styles=[u],e([o({type:String})],t.prototype,"baseUrl",2),e([o({type:String})],t.prototype,"apiKey",2),e([o({type:Number,reflect:!0})],t.prototype,"storeId",2),e([o({type:String})],t.prototype,"postalCode",2),e([o({type:String})],t.prototype,"countryCode",2),e([o({type:String})],t.prototype,"orderId",2),e([o({type:String})],t.prototype,"email",2),e([o({type:Number})],t.prototype,"cartTotal",2),e([o({type:String})],t.prototype,"currencyCode",2),e([o({type:String})],t.prototype,"lang",2),e([o({type:Object})],t.prototype,"cart",2),e([o({type:Array})],t.prototype,"discountCodes",2),e([o({type:Boolean})],t.prototype,"debug",2),e([a()],t.prototype,"activeWidget",2),e([a()],t.prototype,"nonprofitId",2),e([a()],t.prototype,"selectionId",2),e([a()],t.prototype,"cartId",2),e([a()],t.prototype,"beamCartId",2),e([a()],t.prototype,"userId",2),e([a()],t.prototype,"transactionId",2),e([a()],t.prototype,"chainId",2),g(t);export{t as BeamPostPurchase};
26
26
  //# sourceMappingURL=post-purchase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"post-purchase.js","sources":["../../src/components/post-purchase/index.ts"],"sourcesContent":["import { html, LitElement, PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport { getCookieValue } from \"../../shared/cookies\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { createScopedLocalStorage } from \"../../shared/local-storage\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { DEFAULT_BASE_URL } from \"../../api-sdk/constants\";\nimport { getChainNonprofits, postTransaction } from \"../../api-sdk/v3/routes\";\nimport \"../redeem-transaction\";\nimport \"../impact-overview\";\nimport { BEAM_CART_COOKIE_NAME, TBeamCartLocalStorage, TCart } from \"../../shared/cart-contents\";\nimport { BeamNonprofitSelectEvent } from \"../../shared/events\";\n\nconst REQUIRED_DATA_PROPS = [\"baseUrl\", \"apiKey\", \"orderId\", \"email\", \"cartTotal\", \"currencyCode\", \"lang\"];\nconst OPTIONAL_DATA_PROPS = [\"storeId\", \"postalCode\", \"countryCode\", \"cart\", \"discountCodes\"];\n\nexport class BeamPostPurchase extends LitElement {\n static tagName = \"beam-post-purchase\";\n\n @property({ type: String })\n public baseUrl: string = DEFAULT_BASE_URL;\n\n @property({ type: String })\n public apiKey!: string;\n\n @property({ type: Number, reflect: true })\n public storeId?: number; // Either storeId or postalCode, countryCode must be provided\n\n @property({ type: String })\n public postalCode?: string;\n\n @property({ type: String })\n public countryCode?: string;\n\n @property({ type: String })\n public orderId!: string;\n\n @property({ type: String })\n public email!: string;\n\n @property({ type: Number })\n public cartTotal!: number;\n\n @property({ type: String })\n public currencyCode = \"USD\";\n\n @property({ type: String })\n public lang: LANGUAGES = \"en\";\n\n @property({ type: Object })\n public cart?: TCart;\n\n @property({ type: Array })\n public discountCodes?: string[];\n\n @property({ type: Boolean })\n public debug = false;\n\n @state() private activeWidget: \"redeem-transaction\" | \"impact-overview\" = \"redeem-transaction\";\n @state() private nonprofitId: number | null = null; // from localStorage or redeem-transaction result\n @state() private selectionId: string | null = null; // from localStorage\n @state() private cartId: string | null = null; // from localStorage, external cart ID\n @state() private beamCartId: string | null = null; // from cookie, Beam cart ID\n @state() private userId: string | null = null; // from postTransaction\n @state() private transactionId: string | null = null; // from postTransaction\n @state() private chainId: number | null = null; // from postTransaction, used by impact-overview\n\n private localStorage = createScopedLocalStorage(this);\n\n connectedCallback() {\n super.connectedCallback();\n enforceConfig(REQUIRED_DATA_PROPS, this);\n this.nonprofitId = Number(this.localStorage.getItem(\"nonprofit\")) || null;\n this.selectionId = this.localStorage.getItem(\"transaction\") || null;\n this.cartId = this.localStorage.getItemJson<TBeamCartLocalStorage>(\"cart\")?.cartId || null;\n // Reading beamCartId from cookies instead of localStorage allows it to work across subdomains\n this.beamCartId = getCookieValue(BEAM_CART_COOKIE_NAME) || null;\n\n if (this.selectionId && this.nonprofitId) {\n this.activeWidget = \"impact-overview\";\n }\n }\n\n willUpdate(previousPropertyValues: PropertyValues) {\n // Also fires on first load as props go from undefined => value\n const refreshOnChangeProps = [...REQUIRED_DATA_PROPS, ...OPTIONAL_DATA_PROPS];\n if (refreshOnChangeProps.some((p) => previousPropertyValues.has(p))) {\n this.transactionDataController.exec();\n }\n }\n\n handlePostTransaction = async () => {\n enforceConfig(REQUIRED_DATA_PROPS, this);\n\n if (!this.storeId && this.postalCode && this.countryCode) {\n const res = await getChainNonprofits({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n queryParams: {\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n widgetName: \"redeem-transaction\",\n version: \"1.0.0\",\n },\n });\n this.storeId = res.store?.id;\n }\n\n const result = await postTransaction({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n requestBody: {\n nonprofitId: this.nonprofitId ?? undefined,\n selectionId: this.selectionId ?? undefined,\n cartId: this.cartId ?? undefined,\n beamCartId: this.beamCartId ?? undefined,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n storeId: this.storeId!,\n orderId: this.orderId,\n cartTotal: this.cartTotal,\n email: this.email,\n currencyCode: this.currencyCode,\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n cart: this.cart,\n discountCodes: this.discountCodes,\n },\n });\n\n this.transactionId = result.transactionId;\n this.chainId = result.chainId;\n this.userId = result.beamUserId;\n this.nonprofitId = result.nonprofitId;\n\n if (this.nonprofitId) {\n this.activeWidget = \"impact-overview\";\n }\n\n this.localStorage.removeItem(\"transaction\");\n this.localStorage.removeItem(\"cart\");\n\n return result;\n };\n\n private transactionDataController = new AsyncController<typeof this.handlePostTransaction>(\n this,\n this.handlePostTransaction\n );\n\n render() {\n if (this.transactionDataController.loading) {\n return \"\";\n }\n if (this.transactionDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.transactionDataController.error });\n }\n return \"\";\n }\n if (this.activeWidget === \"redeem-transaction\") {\n return html`\n <beam-redeem-transaction\n part=\"redeem-transaction\"\n baseUrl=\"${this.baseUrl}\"\n apiKey=\"${this.apiKey}\"\n chainId=\"${this.chainId}\"\n storeId=\"${this.storeId}\"\n transactionId=\"${this.transactionId}\"\n cart=\"${JSON.stringify(this.cart)}\"\n lang=\"${this.lang}\"\n ?debug=\"${this.debug}\"\n @beamnonprofitselect=\"${(event: Event) => {\n if (!(event instanceof CustomEvent)) return; // TS guard\n const { selectedNonprofitId } = (event as BeamNonprofitSelectEvent).detail;\n this.nonprofitId = selectedNonprofitId ?? null;\n this.activeWidget = \"impact-overview\";\n }}\"\n ></beam-redeem-transaction>\n `;\n }\n if (this.activeWidget === \"impact-overview\") {\n return html`\n <beam-impact-overview\n part=\"impact-overview\"\n baseUrl=\"${this.baseUrl}\"\n apiKey=\"${this.apiKey}\"\n chainId=\"${this.chainId}\"\n userId=\"${this.userId}\"\n nonprofitId=\"${this.nonprofitId}\"\n lang=\"${this.lang}\"\n ?debug=\"${this.debug}\"\n ></beam-impact-overview>\n `;\n }\n return \"\";\n }\n\n static styles = [cssReset];\n}\n\ndefineCustomElement(BeamPostPurchase);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-post-purchase\": BeamPostPurchase;\n }\n}\n"],"names":["m","u","t","s","a","e","r","n","l","d","REQUIRED_DATA_PROPS","OPTIONAL_DATA_PROPS","BeamPostPurchase","LitElement","DEFAULT_BASE_URL","createScopedLocalStorage","enforceConfig","res","getChainNonprofits","result","postTransaction","AsyncController","getCookieValue","BEAM_CART_COOKIE_NAME","previousPropertyValues","p","_errorMessage","html","event","selectedNonprofitId","cssReset","__decorateClass","property","state","defineCustomElement"],"mappings":"63BAAA,IAAAA,EAAA,OAAA,eAAAC,EAAA,OAAA,yBAAAC,EAAA,CAAAC,EAAAC,EAAAC,EAAAC,IAAA,CAAA,QAAAC,EAAAD,EAAA,EAAA,OAAAA,EAAAL,EAAAG,EAAAC,CAAA,EAAAD,EAAAI,EAAAL,EAAA,OAAA,EAAAM,EAAAD,GAAA,EAAAA,KAAAC,EAAAN,EAAAK,CAAA,KAAAD,GAAAD,EAAAG,EAAAL,EAAAC,EAAAE,CAAA,EAAAE,EAAAF,CAAA,IAAAA,GAAA,OAAAD,GAAAC,GAAAP,EAAAI,EAAAC,EAAAE,CAAA,EAAAA,CAAA,EAkBA,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C,GAjCfpB,EAkCJ,UAAA,OAAA,CAAA,EAGAmB,EAAA,CADNC,EAAS,CAAE,KAAM,KAAM,CAAC,CApCd,EAAApB,EAqCJ,6BAGAmB,EAAA,CADNC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAvChBpB,EAwCJ,UAAA,QAAA,CAAA,EAEUmB,EAAA,CAAhBE,GA1CU,EAAArB,EA0CM,4BACAmB,EAAA,CAAhBE,GA3CU,EAAArB,EA2CM,2BACAmB,EAAA,CAAhBE,EA5CU,CAAA,EAAArB,EA4CM,2BACAmB,EAAA,CAAhBE,EA7CU,CAAA,EAAArB,EA6CM,sBACAmB,EAAA,CAAhBE,EA9CU,CAAA,EAAArB,EA8CM,0BACAmB,EAAA,CAAhBE,GA/CU,EAAArB,EA+CM,sBACAmB,EAAA,CAAhBE,GAhDU,EAAArB,EAgDM,6BACAmB,EAAA,CAAhBE,GAjDU,EAAArB,EAiDM,UA2InBsB,UAAAA,CAAAA,EAAAA,EAAoBtB,CAAgB"}
1
+ {"version":3,"file":"post-purchase.js","sources":["../../src/components/post-purchase/index.ts"],"sourcesContent":["import { html, LitElement, PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport { getCookieValue } from \"../../shared/cookies\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { createScopedLocalStorage } from \"../../shared/local-storage\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { DEFAULT_BASE_URL } from \"../../api-sdk/constants\";\nimport { getChainNonprofits, postTransaction } from \"../../api-sdk/v3/routes\";\nimport \"../redeem-transaction\";\nimport \"../impact-overview\";\nimport { BEAM_CART_COOKIE_NAME, TBeamCartLocalStorage, TCart } from \"../../shared/cart-contents\";\nimport { BeamNonprofitSelectEvent } from \"../../shared/events\";\n\nconst REQUIRED_DATA_PROPS = [\"baseUrl\", \"apiKey\", \"orderId\", \"email\", \"cartTotal\", \"currencyCode\", \"lang\"];\nconst OPTIONAL_DATA_PROPS = [\"storeId\", \"postalCode\", \"countryCode\", \"cart\", \"discountCodes\"];\n\nexport class BeamPostPurchase extends LitElement {\n static tagName = \"beam-post-purchase\";\n\n @property({ type: String })\n public baseUrl: string = DEFAULT_BASE_URL;\n\n @property({ type: String })\n public apiKey!: string;\n\n @property({ type: Number, reflect: true })\n public storeId?: number; // Either storeId or postalCode, countryCode must be provided\n\n @property({ type: String })\n public postalCode?: string;\n\n @property({ type: String })\n public countryCode?: string;\n\n @property({ type: String })\n public orderId!: string;\n\n @property({ type: String })\n public email!: string;\n\n @property({ type: Number })\n public cartTotal!: number;\n\n @property({ type: String })\n public currencyCode = \"USD\";\n\n @property({ type: String })\n public lang: LANGUAGES = \"en\";\n\n @property({ type: Object })\n public cart?: TCart;\n\n @property({ type: Array })\n public discountCodes?: string[];\n\n @property({ type: Boolean })\n public debug = false;\n\n @state() private activeWidget: \"redeem-transaction\" | \"impact-overview\" = \"redeem-transaction\";\n @state() private nonprofitId: number | null = null; // from localStorage or redeem-transaction result\n @state() private selectionId: string | null = null; // from localStorage\n @state() private cartId: string | null = null; // from localStorage, external cart ID\n @state() private beamCartId: string | null = null; // from cookie, Beam cart ID\n @state() private userId: string | null = null; // from postTransaction\n @state() private transactionId: string | null = null; // from postTransaction\n @state() private chainId: number | null = null; // from postTransaction, used by impact-overview\n\n private localStorage = createScopedLocalStorage(this);\n\n protected firstUpdated(_changedProperties: PropertyValues) {\n enforceConfig(REQUIRED_DATA_PROPS, this);\n this.nonprofitId = Number(this.localStorage.getItem(\"nonprofit\")) || null;\n this.selectionId = this.localStorage.getItem(\"transaction\") || null;\n this.cartId = this.localStorage.getItemJson<TBeamCartLocalStorage>(\"cart\")?.cartId || null;\n // Reading beamCartId from cookies instead of localStorage allows it to work across subdomains\n this.beamCartId = getCookieValue(BEAM_CART_COOKIE_NAME) || null;\n\n if (this.selectionId && this.nonprofitId) {\n this.activeWidget = \"impact-overview\";\n }\n }\n\n willUpdate(previousPropertyValues: PropertyValues) {\n // Also fires on first load as props go from undefined => value\n const refreshOnChangeProps = [...REQUIRED_DATA_PROPS, ...OPTIONAL_DATA_PROPS];\n if (refreshOnChangeProps.some((p) => previousPropertyValues.has(p))) {\n this.transactionDataController.exec();\n }\n }\n\n handlePostTransaction = async () => {\n enforceConfig(REQUIRED_DATA_PROPS, this);\n\n if (!this.storeId && this.postalCode && this.countryCode) {\n const res = await getChainNonprofits({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n queryParams: {\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n widgetName: \"redeem-transaction\",\n version: \"1.0.0\",\n },\n });\n this.storeId = res.store?.id;\n }\n\n const result = await postTransaction({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n requestBody: {\n nonprofitId: this.nonprofitId ?? undefined,\n selectionId: this.selectionId ?? undefined,\n cartId: this.cartId ?? undefined,\n beamCartId: this.beamCartId ?? undefined,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n storeId: this.storeId!,\n orderId: this.orderId,\n cartTotal: this.cartTotal,\n email: this.email,\n currencyCode: this.currencyCode,\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n cart: this.cart,\n discountCodes: this.discountCodes,\n },\n });\n\n this.transactionId = result.transactionId;\n this.chainId = result.chainId;\n this.userId = result.beamUserId;\n this.nonprofitId = result.nonprofitId;\n\n if (this.nonprofitId) {\n this.activeWidget = \"impact-overview\";\n }\n\n this.localStorage.removeItem(\"transaction\");\n this.localStorage.removeItem(\"cart\");\n\n return result;\n };\n\n private transactionDataController = new AsyncController<typeof this.handlePostTransaction>(\n this,\n this.handlePostTransaction\n );\n\n render() {\n if (this.transactionDataController.loading) {\n return \"\";\n }\n if (this.transactionDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.transactionDataController.error });\n }\n return \"\";\n }\n if (this.activeWidget === \"redeem-transaction\") {\n return html`\n <beam-redeem-transaction\n part=\"redeem-transaction\"\n baseUrl=\"${this.baseUrl}\"\n apiKey=\"${this.apiKey}\"\n chainId=\"${this.chainId}\"\n storeId=\"${this.storeId}\"\n transactionId=\"${this.transactionId}\"\n cart=\"${JSON.stringify(this.cart)}\"\n lang=\"${this.lang}\"\n ?debug=\"${this.debug}\"\n @beamnonprofitselect=\"${(event: Event) => {\n if (!(event instanceof CustomEvent)) return; // TS guard\n const { selectedNonprofitId } = (event as BeamNonprofitSelectEvent).detail;\n this.nonprofitId = selectedNonprofitId ?? null;\n this.activeWidget = \"impact-overview\";\n }}\"\n ></beam-redeem-transaction>\n `;\n }\n if (this.activeWidget === \"impact-overview\") {\n return html`\n <beam-impact-overview\n part=\"impact-overview\"\n baseUrl=\"${this.baseUrl}\"\n apiKey=\"${this.apiKey}\"\n chainId=\"${this.chainId}\"\n userId=\"${this.userId}\"\n nonprofitId=\"${this.nonprofitId}\"\n lang=\"${this.lang}\"\n ?debug=\"${this.debug}\"\n ></beam-impact-overview>\n `;\n }\n return \"\";\n }\n\n static styles = [cssReset];\n}\n\ndefineCustomElement(BeamPostPurchase);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-post-purchase\": BeamPostPurchase;\n }\n}\n"],"names":["m","u","t","s","a","e","i","o","l","d","REQUIRED_DATA_PROPS","OPTIONAL_DATA_PROPS","BeamPostPurchase","LitElement","DEFAULT_BASE_URL","createScopedLocalStorage","enforceConfig","res","getChainNonprofits","result","postTransaction","AsyncController","_changedProperties","getCookieValue","BEAM_CART_COOKIE_NAME","previousPropertyValues","p","_errorMessage","html","event","selectedNonprofitId","cssReset","__decorateClass","property","state","defineCustomElement"],"mappings":"63BAAA,IAAAA,EAAA,OAAA,eAAAC,EAAA,OAAA,yBAAAC,EAAA,CAAAC,EAAAC,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,QAAA,CAAA,EAGAoB,EAAA,CADNC,EAAS,CAAE,KAAM,MAAO,CAAC,CAxBf,EAAArB,EAyBJ,UAGAoB,YAAAA,CAAAA,EAAAA,EAAA,CADNC,EAAS,CAAE,KAAM,MAAO,CAAC,CA3Bf,EAAArB,EA4BJ,4BAGAoB,EAAA,CADNC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EA9BfrB,EA+BJ,UAGAoB,OAAAA,CAAAA,EAAAA,EAAA,CADNC,EAAS,CAAE,KAAM,MAAO,CAAC,GAjCfrB,EAkCJ,UAAA,OAAA,CAAA,EAGAoB,EAAA,CADNC,EAAS,CAAE,KAAM,KAAM,CAAC,CApCd,EAAArB,EAqCJ,6BAGAoB,EAAA,CADNC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAvChBrB,EAwCJ,UAAA,QAAA,CAAA,EAEUoB,EAAA,CAAhBE,GA1CU,EAAAtB,EA0CM,4BACAoB,EAAA,CAAhBE,GA3CU,EAAAtB,EA2CM,2BACAoB,EAAA,CAAhBE,EA5CU,CAAA,EAAAtB,EA4CM,2BACAoB,EAAA,CAAhBE,EA7CU,CAAA,EAAAtB,EA6CM,sBACAoB,EAAA,CAAhBE,EA9CU,CAAA,EAAAtB,EA8CM,0BACAoB,EAAA,CAAhBE,GA/CU,EAAAtB,EA+CM,sBACAoB,EAAA,CAAhBE,GAhDU,EAAAtB,EAgDM,6BACAoB,EAAA,CAAhBE,GAjDU,EAAAtB,EAiDM,UA0InBuB,UAAAA,CAAAA,EAAAA,EAAoBvB,CAAgB"}
@@ -1,4 +1,4 @@
1
- import{y as m,m as y,h as S,f as c,t as k,g as $,q as v,p as z,k as D}from"../chunks/lit-h1W25hjN.esm.js";import{d as N}from"../chunks/lodash-ZxBiuGue.esm.js";import{c as I,u,d as L,e as x,A as B,b as h,f as E,a as W,_ as R,i as p}from"../chunks/localize-e-mss8ya.esm.js";import{D as U,c as P,e as A,S as M}from"../chunks/routes-S9p8QYNm.esm.js";import{p as F}from"../chunks/progress-bar-w3yfrrxD.esm.js";import{partnerLogosConfigDefaults as j}from"./beam-partner-logos.esm.js";import{B as O}from"../chunks/beam-errors-l02WBee5.esm.js";import{c as K}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{c as _}from"../chunks/css-card-grid-RRkoiUTl.esm.js";import{a as V}from"../chunks/events-rRSQYdP1.esm.js";import"../chunks/logger-ad87ovol.esm.js";const H=({height:i="1em",width:e="1em"}={})=>m`
1
+ import{y as m,m as y,h as S,f as c,t as k,g as $,q as v,p as z,k as D}from"../chunks/lit-h1W25hjN.esm.js";import{d as N}from"../chunks/lodash-ZxBiuGue.esm.js";import{c as I,u,d as L,e as x,A as B,b as h,f as E,a as W,_ as R,i as p}from"../chunks/localize-e-mss8ya.esm.js";import{D as U,c as P,e as A,S as M}from"../chunks/routes-MZb9Fq0P.esm.js";import{p as F}from"../chunks/progress-bar-w3yfrrxD.esm.js";import{partnerLogosConfigDefaults as j}from"./beam-partner-logos.esm.js";import{B as O}from"../chunks/beam-errors-l02WBee5.esm.js";import{c as K}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{c as _}from"../chunks/css-card-grid-RRkoiUTl.esm.js";import{a as V}from"../chunks/events-rRSQYdP1.esm.js";import"../chunks/logger-ad87ovol.esm.js";const H=({height:i="1em",width:e="1em"}={})=>m`
2
2
  <svg
3
3
  style="${y({height:i,width:e,position:"relative",bottom:"0"})}"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -1,4 +1,4 @@
1
- import{y as m,m as y,h as S,f as c,t as k,g as $,q as v,p as z,k as D}from"../chunks/lit-h1W25hjN.esm.js";import{d as N}from"../chunks/lodash-ZxBiuGue.esm.js";import{c as I,u,d as L,e as x,A as B,b as h,f as E,a as W,_ as R,i as p}from"../chunks/localize-e-mss8ya.esm.js";import{D as U,c as P,e as A,S as M}from"../chunks/routes-S9p8QYNm.esm.js";import{p as F}from"../chunks/progress-bar-w3yfrrxD.esm.js";import{partnerLogosConfigDefaults as j}from"./beam-partner-logos.js";import{B as O}from"../chunks/beam-errors-l02WBee5.esm.js";import{c as K}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{c as _}from"../chunks/css-card-grid-RRkoiUTl.esm.js";import{a as V}from"../chunks/events-rRSQYdP1.esm.js";import"../chunks/logger-ad87ovol.esm.js";const H=({height:i="1em",width:e="1em"}={})=>m`
1
+ import{y as m,m as y,h as S,f as c,t as k,g as $,q as v,p as z,k as D}from"../chunks/lit-h1W25hjN.esm.js";import{d as N}from"../chunks/lodash-ZxBiuGue.esm.js";import{c as I,u,d as L,e as x,A as B,b as h,f as E,a as W,_ as R,i as p}from"../chunks/localize-e-mss8ya.esm.js";import{D as U,c as P,e as A,S as M}from"../chunks/routes-MZb9Fq0P.esm.js";import{p as F}from"../chunks/progress-bar-w3yfrrxD.esm.js";import{partnerLogosConfigDefaults as j}from"./beam-partner-logos.js";import{B as O}from"../chunks/beam-errors-l02WBee5.esm.js";import{c as K}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{c as _}from"../chunks/css-card-grid-RRkoiUTl.esm.js";import{a as V}from"../chunks/events-rRSQYdP1.esm.js";import"../chunks/logger-ad87ovol.esm.js";const H=({height:i="1em",width:e="1em"}={})=>m`
2
2
  <svg
3
3
  style="${y({height:i,width:e,position:"relative",bottom:"0"})}"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -1,4 +1,4 @@
1
- import{h as x,f as l,g as w,y as b,p as k,m as z,k as $}from"../chunks/lit-h1W25hjN.esm.js";import{c as L,u as m,d as D,e as u,A as S,b as p,f as A,a as E,_ as y,i as d}from"../chunks/localize-e-mss8ya.esm.js";import{D as T,c as B,d as P,S as U}from"../chunks/routes-S9p8QYNm.esm.js";import{p as F}from"../chunks/progress-bar-w3yfrrxD.esm.js";import{c as W}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{a as N,B as C}from"../chunks/events-rRSQYdP1.esm.js";import{a as v}from"../chunks/cookies-BnIoXWd0.esm.js";import{c as M}from"../chunks/responsive-Rehmv-eo.esm.js";import{B as O}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";const h={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose your impact",ctaMessage:({donationPercentage:r="1"}={})=>`Select a nonprofit and ${r}% of your purchase will be donated, at no extra cost.`,inlineSeparator:()=>": "},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choisissez votre cause",ctaMessage:({donationPercentage:r="1"}={})=>`Choisissez un organisme \xE0 but non lucratif et ${r} % lui sera vers\xE9 en votre nom, sans frais suppl\xE9mentaires.`,inlineSeparator:()=>" : "},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"W\xE4hle deinen Impact",ctaMessage:({donationPercentage:r="1"}={})=>`W\xE4hle eine der gemeinn\xFCtzigen Organisationen und spende ${r}% deines Einkaufs ohne zus\xE4tzliche Kosten`,inlineSeparator:()=>": "},es:{beamAttribution:()=>"Ofrecido por Beam",ctaTitle:()=>"Elige tu contribuci\xF3n",ctaMessage:({donationPercentage:r="1"}={})=>`Elige una organizaci\xF3n sin fines de lucro y donaremos ${r}% de tu compra sin coste adicional.`,inlineSeparator:()=>": "},it:{beamAttribution:()=>"Gestito da Beam",ctaTitle:()=>"Scegli dove fare la differenza",ctaMessage:({donationPercentage:r="1"}={})=>`Seleziona un'organizzazione no-profit a cui devolvere l\u2019${r}% del tuo acquisto, senza costi aggiuntivi`,inlineSeparator:()=>": "},pl:{beamAttribution:()=>"Wspierany przez Beam",ctaTitle:()=>"Wybierz inicjatyw\u0119, kt\xF3r\u0105 chcesz wesprze\u0107",ctaMessage:({donationPercentage:r="1"}={})=>`Wybierz organizacj\u0119, kt\xF3rej przeka\u017Cesz ${r}% warto\u015Bci Twoich zakup\xF3w \u2013 bez \u017Cadnych dodatkowych koszt\xF3w!`,inlineSeparator:()=>": "}};var R=Object.defineProperty,K=Object.getOwnPropertyDescriptor,c=(r,t,e,i)=>{for(var n=i>1?void 0:i?K(t,e):t,a=r.length-1,o;a>=0;a--)(o=r[a])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&R(t,e,n),n};class s extends w{constructor(){super(...arguments),this.baseUrl=T,this.selectedNonprofitId=null,this.lang="en",this.debug=!1,this.enableNonprofitDeselection=!1,this.getChainNonprofits=async()=>{u(["apiKey","chainId"],this);const t=this.cart?.schema?{schema:this.cart?.schema,content:this.cart?.content}:void 0,e=await B({baseUrl:this.baseUrl,apiRoot:"/api/v3",headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{chainId:this.chainId,storeId:this.storeId,widgetName:"select-nonprofit",postalCode:this.postalCode,countryCode:this.countryCode,version:"1.0.0",lang:this.configLang,cart:t}});return this.enableNonprofitDeselection=!!e.config.enableNonprofitDeselection,this.selectedNonprofitId&&!e.nonprofits.map(i=>i.nonprofit.id).includes(this.selectedNonprofitId)&&(this.selectedNonprofitId=null,this.dispatchEvent(new N({selectedNonprofitId:this.selectedNonprofitId,selectionId:this.selectionId,nonprofitName:null}))),e.store?.id&&e.store.id!==this.storeId&&(this.storeId=e.store.id),this.localStorage.setItemJson("chainNonprofits",{createdAt:new Date,data:e}),e},this.postSelectNonprofit=async({selectedNonprofitId:t})=>{u(["apiKey","chainId","storeId"],this);const e=this.getExternalCartId(),i=this.getBeamCartId(),n=await P({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{nonprofitId:t,selectionId:this.selectionId,storeId:this.storeId,cartId:e,beamCartId:i}});this.selectionId=n?.selectionId,this.localStorage.setItem("transaction",this.selectionId),this.localStorage.setItem("nonprofit",t),await this.updateComplete;const a=this.getNonprofitById(t);this.dispatchEvent(new N({selectedNonprofitId:t,selectionId:this.selectionId,nonprofitName:a?.nonprofit?.name}))},this.nonprofitListDataController=new S(this,this.getChainNonprofits),this.selectionDataController=new S(this,this.postSelectNonprofit),this.localStorage=W(this),this.handleCartChange=t=>{this.cart=t.detail},this.makeHandleSelect=(t,e,i)=>async n=>{const a=this.selectedNonprofitId;if(n instanceof KeyboardEvent){let o=null;switch(n.key){case"ArrowUp":case"ArrowLeft":e===0?o=i[i.length-1]:o=i[e-1],n.preventDefault();break;case"ArrowRight":case"ArrowDown":e===i.length-1?o=i[0]:o=i[e+1],n.preventDefault();break;case"Enter":case" ":n.preventDefault();break;default:return}if(o){a!=null&&(this.selectedNonprofitId=o.nonprofit.id);const f=this.renderRoot.querySelector(`[data-value="${o.nonprofit.id}"]`);f!==null&&(f.tabIndex=0,f.focus());return}}if(n.currentTarget instanceof HTMLElement)if(a===t)if(this.enableNonprofitDeselection)this.selectedNonprofitId=null;else return;else this.selectedNonprofitId=t;await this.selectionDataController.exec({selectedNonprofitId:this.selectedNonprofitId})}}get configLang(){return U[this.lang]||"en"}getNonprofitById(t){return t?this.nonprofitListDataController?.data?.nonprofits.find(e=>e.nonprofit.id===t):null}async willUpdate(t){const e=["chainId","baseUrl","storeId","apiKey","countryCode","postalCode","cart","lang"];for(const i of e)if(t.has(i)){await this.nonprofitListDataController.exec();break}}async firstUpdated(t){await this.restoreStateFromCache()}connectedCallback(){super.connectedCallback(),window.addEventListener(C.eventName,this.handleCartChange)}disconnectedCallback(){window.removeEventListener(C.eventName,this.handleCartChange),super.disconnectedCallback()}getExternalCartId(){return this.localStorage.getItemJson("cart")?.cartId??v("cart")}getBeamCartId(){return v(O)}async restoreStateFromCache(){u(["apiKey","chainId","storeId"],this);try{this.selectedNonprofitId=parseInt(this.localStorage.getItem("nonprofit")||"")||null,this.selectionId=this.localStorage.getItem("transaction")??void 0,this.cart=this.localStorage.getItemJson("cart")??void 0;const{createdAt:t=0,data:e}=this.localStorage.getItemJson("chainNonprofits")||{},i=2*60*60*1e3;if(new Date(t).valueOf()+i>new Date().valueOf()&&(this.nonprofitListDataController.data=e,this.nonprofitListDataController.loading=!1),this.selectedNonprofitId&&!this.selectionId&&await this.selectionDataController.exec({selectedNonprofitId:this.selectedNonprofitId}),this.selectedNonprofitId){const n=this.getNonprofitById(this.selectedNonprofitId);this.dispatchEvent(new N({selectedNonprofitId:this.selectedNonprofitId,selectionId:this.selectionId,nonprofitName:n?.nonprofit?.name}))}}catch{}}get cssVariables(){const t={"--beam-fontFamily":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...F,"--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--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-borderColor":"currentColor","--beam-SelectNonprofit-details-backgroundColor":"inherit",...p("--beam-SelectNonprofit-title",{fontSize:"1.25em",fontWeight:"bold"}),...p("--beam-SelectNonprofit-title-inline",{fontWeight:"bold"}),"--beam-SelectNonprofit-title-inline-textTransform":"none",...p("--beam-SelectNonprofit-description",{marginTop:"0.5em"}),...p("--beam-SelectNonprofit-description-inline"),...p("--beam-SelectNonprofit-details-cause",{fontSize:"0.85em",fontWeight:"bold"}),...p("--beam-SelectNonprofit-details-beamAttribution",{fontSize:"0.85em"}),...p("--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",...p("--beam-SelectNonprofit-details-fundingProgressLabel",{fontSize:"0.85em"})},e=this.nonprofitListDataController?.data?.config?.web?.theme||{},i={...t,...e};return Object.assign(Object.create({toCSS(){return A(this)}}),i)}render(){const{selectedNonprofitId:t}=this,{data:e,loading:i}=this.nonprofitListDataController;if(i&&!e)return E();if(this.nonprofitListDataController.error)return this.debug?y({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return y({error:this.selectionDataController.error});const n=e?.nonprofits||[],a=n.find(o=>o.nonprofit.id===t)||null;return b`
1
+ import{h as x,f as l,g as w,y as b,p as k,m as z,k as $}from"../chunks/lit-h1W25hjN.esm.js";import{c as L,u as m,d as D,e as u,A as S,b as p,f as A,a as E,_ as y,i as d}from"../chunks/localize-e-mss8ya.esm.js";import{D as T,c as B,d as P,S as U}from"../chunks/routes-MZb9Fq0P.esm.js";import{p as F}from"../chunks/progress-bar-w3yfrrxD.esm.js";import{c as W}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{a as N,B as C}from"../chunks/events-rRSQYdP1.esm.js";import{a as v}from"../chunks/cookies-BnIoXWd0.esm.js";import{c as M}from"../chunks/responsive-Rehmv-eo.esm.js";import{B as O}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";const h={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose your impact",ctaMessage:({donationPercentage:r="1"}={})=>`Select a nonprofit and ${r}% of your purchase will be donated, at no extra cost.`,inlineSeparator:()=>": "},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choisissez votre cause",ctaMessage:({donationPercentage:r="1"}={})=>`Choisissez un organisme \xE0 but non lucratif et ${r} % lui sera vers\xE9 en votre nom, sans frais suppl\xE9mentaires.`,inlineSeparator:()=>" : "},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"W\xE4hle deinen Impact",ctaMessage:({donationPercentage:r="1"}={})=>`W\xE4hle eine der gemeinn\xFCtzigen Organisationen und spende ${r}% deines Einkaufs ohne zus\xE4tzliche Kosten`,inlineSeparator:()=>": "},es:{beamAttribution:()=>"Ofrecido por Beam",ctaTitle:()=>"Elige tu contribuci\xF3n",ctaMessage:({donationPercentage:r="1"}={})=>`Elige una organizaci\xF3n sin fines de lucro y donaremos ${r}% de tu compra sin coste adicional.`,inlineSeparator:()=>": "},it:{beamAttribution:()=>"Gestito da Beam",ctaTitle:()=>"Scegli dove fare la differenza",ctaMessage:({donationPercentage:r="1"}={})=>`Seleziona un'organizzazione no-profit a cui devolvere l\u2019${r}% del tuo acquisto, senza costi aggiuntivi`,inlineSeparator:()=>": "},pl:{beamAttribution:()=>"Wspierany przez Beam",ctaTitle:()=>"Wybierz inicjatyw\u0119, kt\xF3r\u0105 chcesz wesprze\u0107",ctaMessage:({donationPercentage:r="1"}={})=>`Wybierz organizacj\u0119, kt\xF3rej przeka\u017Cesz ${r}% warto\u015Bci Twoich zakup\xF3w \u2013 bez \u017Cadnych dodatkowych koszt\xF3w!`,inlineSeparator:()=>": "}};var R=Object.defineProperty,K=Object.getOwnPropertyDescriptor,c=(r,t,e,i)=>{for(var n=i>1?void 0:i?K(t,e):t,a=r.length-1,o;a>=0;a--)(o=r[a])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&R(t,e,n),n};class s extends w{constructor(){super(...arguments),this.baseUrl=T,this.selectedNonprofitId=null,this.lang="en",this.debug=!1,this.enableNonprofitDeselection=!1,this.getChainNonprofits=async()=>{u(["apiKey","chainId"],this);const t=this.cart?.schema?{schema:this.cart?.schema,content:this.cart?.content}:void 0,e=await B({baseUrl:this.baseUrl,apiRoot:"/api/v3",headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{chainId:this.chainId,storeId:this.storeId,widgetName:"select-nonprofit",postalCode:this.postalCode,countryCode:this.countryCode,version:"1.0.0",lang:this.configLang,cart:t}});return this.enableNonprofitDeselection=!!e.config.enableNonprofitDeselection,this.selectedNonprofitId&&!e.nonprofits.map(i=>i.nonprofit.id).includes(this.selectedNonprofitId)&&(this.selectedNonprofitId=null,this.dispatchEvent(new N({selectedNonprofitId:this.selectedNonprofitId,selectionId:this.selectionId,nonprofitName:null}))),e.store?.id&&e.store.id!==this.storeId&&(this.storeId=e.store.id),this.localStorage.setItemJson("chainNonprofits",{createdAt:new Date,data:e}),e},this.postSelectNonprofit=async({selectedNonprofitId:t})=>{u(["apiKey","chainId","storeId"],this);const e=this.getExternalCartId(),i=this.getBeamCartId(),n=await P({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{nonprofitId:t,selectionId:this.selectionId,storeId:this.storeId,cartId:e,beamCartId:i}});this.selectionId=n?.selectionId,this.localStorage.setItem("transaction",this.selectionId),this.localStorage.setItem("nonprofit",t),await this.updateComplete;const a=this.getNonprofitById(t);this.dispatchEvent(new N({selectedNonprofitId:t,selectionId:this.selectionId,nonprofitName:a?.nonprofit?.name}))},this.nonprofitListDataController=new S(this,this.getChainNonprofits),this.selectionDataController=new S(this,this.postSelectNonprofit),this.localStorage=W(this),this.handleCartChange=t=>{this.cart=t.detail},this.makeHandleSelect=(t,e,i)=>async n=>{const a=this.selectedNonprofitId;if(n instanceof KeyboardEvent){let o=null;switch(n.key){case"ArrowUp":case"ArrowLeft":e===0?o=i[i.length-1]:o=i[e-1],n.preventDefault();break;case"ArrowRight":case"ArrowDown":e===i.length-1?o=i[0]:o=i[e+1],n.preventDefault();break;case"Enter":case" ":n.preventDefault();break;default:return}if(o){a!=null&&(this.selectedNonprofitId=o.nonprofit.id);const f=this.renderRoot.querySelector(`[data-value="${o.nonprofit.id}"]`);f!==null&&(f.tabIndex=0,f.focus());return}}if(n.currentTarget instanceof HTMLElement)if(a===t)if(this.enableNonprofitDeselection)this.selectedNonprofitId=null;else return;else this.selectedNonprofitId=t;await this.selectionDataController.exec({selectedNonprofitId:this.selectedNonprofitId})}}get configLang(){return U[this.lang]||"en"}getNonprofitById(t){return t?this.nonprofitListDataController?.data?.nonprofits.find(e=>e.nonprofit.id===t):null}async willUpdate(t){const e=["chainId","baseUrl","storeId","apiKey","countryCode","postalCode","cart","lang"];for(const i of e)if(t.has(i)){await this.nonprofitListDataController.exec();break}}async firstUpdated(t){await this.restoreStateFromCache()}connectedCallback(){super.connectedCallback(),window.addEventListener(C.eventName,this.handleCartChange)}disconnectedCallback(){window.removeEventListener(C.eventName,this.handleCartChange),super.disconnectedCallback()}getExternalCartId(){return this.localStorage.getItemJson("cart")?.cartId??v("cart")}getBeamCartId(){return v(O)}async restoreStateFromCache(){u(["apiKey","chainId","storeId"],this);try{this.selectedNonprofitId=parseInt(this.localStorage.getItem("nonprofit")||"")||null,this.selectionId=this.localStorage.getItem("transaction")??void 0,this.cart=this.localStorage.getItemJson("cart")??void 0;const{createdAt:t=0,data:e}=this.localStorage.getItemJson("chainNonprofits")||{},i=2*60*60*1e3;if(new Date(t).valueOf()+i>new Date().valueOf()&&(this.nonprofitListDataController.data=e,this.nonprofitListDataController.loading=!1),this.selectedNonprofitId&&!this.selectionId&&await this.selectionDataController.exec({selectedNonprofitId:this.selectedNonprofitId}),this.selectedNonprofitId){const n=this.getNonprofitById(this.selectedNonprofitId);this.dispatchEvent(new N({selectedNonprofitId:this.selectedNonprofitId,selectionId:this.selectionId,nonprofitName:n?.nonprofit?.name}))}}catch{}}get cssVariables(){const t={"--beam-fontFamily":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...F,"--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--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-borderColor":"currentColor","--beam-SelectNonprofit-details-backgroundColor":"inherit",...p("--beam-SelectNonprofit-title",{fontSize:"1.25em",fontWeight:"bold"}),...p("--beam-SelectNonprofit-title-inline",{fontWeight:"bold"}),"--beam-SelectNonprofit-title-inline-textTransform":"none",...p("--beam-SelectNonprofit-description",{marginTop:"0.5em"}),...p("--beam-SelectNonprofit-description-inline"),...p("--beam-SelectNonprofit-details-cause",{fontSize:"0.85em",fontWeight:"bold"}),...p("--beam-SelectNonprofit-details-beamAttribution",{fontSize:"0.85em"}),...p("--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",...p("--beam-SelectNonprofit-details-fundingProgressLabel",{fontSize:"0.85em"})},e=this.nonprofitListDataController?.data?.config?.web?.theme||{},i={...t,...e};return Object.assign(Object.create({toCSS(){return A(this)}}),i)}render(){const{selectedNonprofitId:t}=this,{data:e,loading:i}=this.nonprofitListDataController;if(i&&!e)return E();if(this.nonprofitListDataController.error)return this.debug?y({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return y({error:this.selectionDataController.error});const n=e?.nonprofits||[],a=n.find(o=>o.nonprofit.id===t)||null;return b`
2
2
  <style>
3
3
  :host {
4
4
  ${this.cssVariables.toCSS()}
@@ -1,4 +1,4 @@
1
- import{h as x,f as l,g as w,y as b,p as k,m as z,k as $}from"../chunks/lit-h1W25hjN.esm.js";import{c as L,u as m,d as D,e as u,A as S,b as p,f as A,a as E,_ as y,i as d}from"../chunks/localize-e-mss8ya.esm.js";import{D as T,c as B,d as P,S as U}from"../chunks/routes-S9p8QYNm.esm.js";import{p as F}from"../chunks/progress-bar-w3yfrrxD.esm.js";import{c as W}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{a as N,B as C}from"../chunks/events-rRSQYdP1.esm.js";import{a as v}from"../chunks/cookies-BnIoXWd0.esm.js";import{c as M}from"../chunks/responsive-Rehmv-eo.esm.js";import{B as O}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";const h={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose your impact",ctaMessage:({donationPercentage:r="1"}={})=>`Select a nonprofit and ${r}% of your purchase will be donated, at no extra cost.`,inlineSeparator:()=>": "},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choisissez votre cause",ctaMessage:({donationPercentage:r="1"}={})=>`Choisissez un organisme \xE0 but non lucratif et ${r} % lui sera vers\xE9 en votre nom, sans frais suppl\xE9mentaires.`,inlineSeparator:()=>" : "},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"W\xE4hle deinen Impact",ctaMessage:({donationPercentage:r="1"}={})=>`W\xE4hle eine der gemeinn\xFCtzigen Organisationen und spende ${r}% deines Einkaufs ohne zus\xE4tzliche Kosten`,inlineSeparator:()=>": "},es:{beamAttribution:()=>"Ofrecido por Beam",ctaTitle:()=>"Elige tu contribuci\xF3n",ctaMessage:({donationPercentage:r="1"}={})=>`Elige una organizaci\xF3n sin fines de lucro y donaremos ${r}% de tu compra sin coste adicional.`,inlineSeparator:()=>": "},it:{beamAttribution:()=>"Gestito da Beam",ctaTitle:()=>"Scegli dove fare la differenza",ctaMessage:({donationPercentage:r="1"}={})=>`Seleziona un'organizzazione no-profit a cui devolvere l\u2019${r}% del tuo acquisto, senza costi aggiuntivi`,inlineSeparator:()=>": "},pl:{beamAttribution:()=>"Wspierany przez Beam",ctaTitle:()=>"Wybierz inicjatyw\u0119, kt\xF3r\u0105 chcesz wesprze\u0107",ctaMessage:({donationPercentage:r="1"}={})=>`Wybierz organizacj\u0119, kt\xF3rej przeka\u017Cesz ${r}% warto\u015Bci Twoich zakup\xF3w \u2013 bez \u017Cadnych dodatkowych koszt\xF3w!`,inlineSeparator:()=>": "}};var R=Object.defineProperty,K=Object.getOwnPropertyDescriptor,c=(r,t,e,i)=>{for(var n=i>1?void 0:i?K(t,e):t,a=r.length-1,o;a>=0;a--)(o=r[a])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&R(t,e,n),n};class s extends w{constructor(){super(...arguments),this.baseUrl=T,this.selectedNonprofitId=null,this.lang="en",this.debug=!1,this.enableNonprofitDeselection=!1,this.getChainNonprofits=async()=>{u(["apiKey","chainId"],this);const t=this.cart?.schema?{schema:this.cart?.schema,content:this.cart?.content}:void 0,e=await B({baseUrl:this.baseUrl,apiRoot:"/api/v3",headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{chainId:this.chainId,storeId:this.storeId,widgetName:"select-nonprofit",postalCode:this.postalCode,countryCode:this.countryCode,version:"1.0.0",lang:this.configLang,cart:t}});return this.enableNonprofitDeselection=!!e.config.enableNonprofitDeselection,this.selectedNonprofitId&&!e.nonprofits.map(i=>i.nonprofit.id).includes(this.selectedNonprofitId)&&(this.selectedNonprofitId=null,this.dispatchEvent(new N({selectedNonprofitId:this.selectedNonprofitId,selectionId:this.selectionId,nonprofitName:null}))),e.store?.id&&e.store.id!==this.storeId&&(this.storeId=e.store.id),this.localStorage.setItemJson("chainNonprofits",{createdAt:new Date,data:e}),e},this.postSelectNonprofit=async({selectedNonprofitId:t})=>{u(["apiKey","chainId","storeId"],this);const e=this.getExternalCartId(),i=this.getBeamCartId(),n=await P({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{nonprofitId:t,selectionId:this.selectionId,storeId:this.storeId,cartId:e,beamCartId:i}});this.selectionId=n?.selectionId,this.localStorage.setItem("transaction",this.selectionId),this.localStorage.setItem("nonprofit",t),await this.updateComplete;const a=this.getNonprofitById(t);this.dispatchEvent(new N({selectedNonprofitId:t,selectionId:this.selectionId,nonprofitName:a?.nonprofit?.name}))},this.nonprofitListDataController=new S(this,this.getChainNonprofits),this.selectionDataController=new S(this,this.postSelectNonprofit),this.localStorage=W(this),this.handleCartChange=t=>{this.cart=t.detail},this.makeHandleSelect=(t,e,i)=>async n=>{const a=this.selectedNonprofitId;if(n instanceof KeyboardEvent){let o=null;switch(n.key){case"ArrowUp":case"ArrowLeft":e===0?o=i[i.length-1]:o=i[e-1],n.preventDefault();break;case"ArrowRight":case"ArrowDown":e===i.length-1?o=i[0]:o=i[e+1],n.preventDefault();break;case"Enter":case" ":n.preventDefault();break;default:return}if(o){a!=null&&(this.selectedNonprofitId=o.nonprofit.id);const f=this.renderRoot.querySelector(`[data-value="${o.nonprofit.id}"]`);f!==null&&(f.tabIndex=0,f.focus());return}}if(n.currentTarget instanceof HTMLElement)if(a===t)if(this.enableNonprofitDeselection)this.selectedNonprofitId=null;else return;else this.selectedNonprofitId=t;await this.selectionDataController.exec({selectedNonprofitId:this.selectedNonprofitId})}}get configLang(){return U[this.lang]||"en"}getNonprofitById(t){return t?this.nonprofitListDataController?.data?.nonprofits.find(e=>e.nonprofit.id===t):null}async willUpdate(t){const e=["chainId","baseUrl","storeId","apiKey","countryCode","postalCode","cart","lang"];for(const i of e)if(t.has(i)){await this.nonprofitListDataController.exec();break}}async firstUpdated(t){await this.restoreStateFromCache()}connectedCallback(){super.connectedCallback(),window.addEventListener(C.eventName,this.handleCartChange)}disconnectedCallback(){window.removeEventListener(C.eventName,this.handleCartChange),super.disconnectedCallback()}getExternalCartId(){return this.localStorage.getItemJson("cart")?.cartId??v("cart")}getBeamCartId(){return v(O)}async restoreStateFromCache(){u(["apiKey","chainId","storeId"],this);try{this.selectedNonprofitId=parseInt(this.localStorage.getItem("nonprofit")||"")||null,this.selectionId=this.localStorage.getItem("transaction")??void 0,this.cart=this.localStorage.getItemJson("cart")??void 0;const{createdAt:t=0,data:e}=this.localStorage.getItemJson("chainNonprofits")||{},i=2*60*60*1e3;if(new Date(t).valueOf()+i>new Date().valueOf()&&(this.nonprofitListDataController.data=e,this.nonprofitListDataController.loading=!1),this.selectedNonprofitId&&!this.selectionId&&await this.selectionDataController.exec({selectedNonprofitId:this.selectedNonprofitId}),this.selectedNonprofitId){const n=this.getNonprofitById(this.selectedNonprofitId);this.dispatchEvent(new N({selectedNonprofitId:this.selectedNonprofitId,selectionId:this.selectionId,nonprofitName:n?.nonprofit?.name}))}}catch{}}get cssVariables(){const t={"--beam-fontFamily":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...F,"--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--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-borderColor":"currentColor","--beam-SelectNonprofit-details-backgroundColor":"inherit",...p("--beam-SelectNonprofit-title",{fontSize:"1.25em",fontWeight:"bold"}),...p("--beam-SelectNonprofit-title-inline",{fontWeight:"bold"}),"--beam-SelectNonprofit-title-inline-textTransform":"none",...p("--beam-SelectNonprofit-description",{marginTop:"0.5em"}),...p("--beam-SelectNonprofit-description-inline"),...p("--beam-SelectNonprofit-details-cause",{fontSize:"0.85em",fontWeight:"bold"}),...p("--beam-SelectNonprofit-details-beamAttribution",{fontSize:"0.85em"}),...p("--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",...p("--beam-SelectNonprofit-details-fundingProgressLabel",{fontSize:"0.85em"})},e=this.nonprofitListDataController?.data?.config?.web?.theme||{},i={...t,...e};return Object.assign(Object.create({toCSS(){return A(this)}}),i)}render(){const{selectedNonprofitId:t}=this,{data:e,loading:i}=this.nonprofitListDataController;if(i&&!e)return E();if(this.nonprofitListDataController.error)return this.debug?y({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return y({error:this.selectionDataController.error});const n=e?.nonprofits||[],a=n.find(o=>o.nonprofit.id===t)||null;return b`
1
+ import{h as x,f as l,g as w,y as b,p as k,m as z,k as $}from"../chunks/lit-h1W25hjN.esm.js";import{c as L,u as m,d as D,e as u,A as S,b as p,f as A,a as E,_ as y,i as d}from"../chunks/localize-e-mss8ya.esm.js";import{D as T,c as B,d as P,S as U}from"../chunks/routes-MZb9Fq0P.esm.js";import{p as F}from"../chunks/progress-bar-w3yfrrxD.esm.js";import{c as W}from"../chunks/local-storage-Rrnk_Dg-.esm.js";import{a as N,B as C}from"../chunks/events-rRSQYdP1.esm.js";import{a as v}from"../chunks/cookies-BnIoXWd0.esm.js";import{c as M}from"../chunks/responsive-Rehmv-eo.esm.js";import{B as O}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";const h={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose your impact",ctaMessage:({donationPercentage:r="1"}={})=>`Select a nonprofit and ${r}% of your purchase will be donated, at no extra cost.`,inlineSeparator:()=>": "},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choisissez votre cause",ctaMessage:({donationPercentage:r="1"}={})=>`Choisissez un organisme \xE0 but non lucratif et ${r} % lui sera vers\xE9 en votre nom, sans frais suppl\xE9mentaires.`,inlineSeparator:()=>" : "},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"W\xE4hle deinen Impact",ctaMessage:({donationPercentage:r="1"}={})=>`W\xE4hle eine der gemeinn\xFCtzigen Organisationen und spende ${r}% deines Einkaufs ohne zus\xE4tzliche Kosten`,inlineSeparator:()=>": "},es:{beamAttribution:()=>"Ofrecido por Beam",ctaTitle:()=>"Elige tu contribuci\xF3n",ctaMessage:({donationPercentage:r="1"}={})=>`Elige una organizaci\xF3n sin fines de lucro y donaremos ${r}% de tu compra sin coste adicional.`,inlineSeparator:()=>": "},it:{beamAttribution:()=>"Gestito da Beam",ctaTitle:()=>"Scegli dove fare la differenza",ctaMessage:({donationPercentage:r="1"}={})=>`Seleziona un'organizzazione no-profit a cui devolvere l\u2019${r}% del tuo acquisto, senza costi aggiuntivi`,inlineSeparator:()=>": "},pl:{beamAttribution:()=>"Wspierany przez Beam",ctaTitle:()=>"Wybierz inicjatyw\u0119, kt\xF3r\u0105 chcesz wesprze\u0107",ctaMessage:({donationPercentage:r="1"}={})=>`Wybierz organizacj\u0119, kt\xF3rej przeka\u017Cesz ${r}% warto\u015Bci Twoich zakup\xF3w \u2013 bez \u017Cadnych dodatkowych koszt\xF3w!`,inlineSeparator:()=>": "}};var R=Object.defineProperty,K=Object.getOwnPropertyDescriptor,c=(r,t,e,i)=>{for(var n=i>1?void 0:i?K(t,e):t,a=r.length-1,o;a>=0;a--)(o=r[a])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&R(t,e,n),n};class s extends w{constructor(){super(...arguments),this.baseUrl=T,this.selectedNonprofitId=null,this.lang="en",this.debug=!1,this.enableNonprofitDeselection=!1,this.getChainNonprofits=async()=>{u(["apiKey","chainId"],this);const t=this.cart?.schema?{schema:this.cart?.schema,content:this.cart?.content}:void 0,e=await B({baseUrl:this.baseUrl,apiRoot:"/api/v3",headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{chainId:this.chainId,storeId:this.storeId,widgetName:"select-nonprofit",postalCode:this.postalCode,countryCode:this.countryCode,version:"1.0.0",lang:this.configLang,cart:t}});return this.enableNonprofitDeselection=!!e.config.enableNonprofitDeselection,this.selectedNonprofitId&&!e.nonprofits.map(i=>i.nonprofit.id).includes(this.selectedNonprofitId)&&(this.selectedNonprofitId=null,this.dispatchEvent(new N({selectedNonprofitId:this.selectedNonprofitId,selectionId:this.selectionId,nonprofitName:null}))),e.store?.id&&e.store.id!==this.storeId&&(this.storeId=e.store.id),this.localStorage.setItemJson("chainNonprofits",{createdAt:new Date,data:e}),e},this.postSelectNonprofit=async({selectedNonprofitId:t})=>{u(["apiKey","chainId","storeId"],this);const e=this.getExternalCartId(),i=this.getBeamCartId(),n=await P({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{nonprofitId:t,selectionId:this.selectionId,storeId:this.storeId,cartId:e,beamCartId:i}});this.selectionId=n?.selectionId,this.localStorage.setItem("transaction",this.selectionId),this.localStorage.setItem("nonprofit",t),await this.updateComplete;const a=this.getNonprofitById(t);this.dispatchEvent(new N({selectedNonprofitId:t,selectionId:this.selectionId,nonprofitName:a?.nonprofit?.name}))},this.nonprofitListDataController=new S(this,this.getChainNonprofits),this.selectionDataController=new S(this,this.postSelectNonprofit),this.localStorage=W(this),this.handleCartChange=t=>{this.cart=t.detail},this.makeHandleSelect=(t,e,i)=>async n=>{const a=this.selectedNonprofitId;if(n instanceof KeyboardEvent){let o=null;switch(n.key){case"ArrowUp":case"ArrowLeft":e===0?o=i[i.length-1]:o=i[e-1],n.preventDefault();break;case"ArrowRight":case"ArrowDown":e===i.length-1?o=i[0]:o=i[e+1],n.preventDefault();break;case"Enter":case" ":n.preventDefault();break;default:return}if(o){a!=null&&(this.selectedNonprofitId=o.nonprofit.id);const f=this.renderRoot.querySelector(`[data-value="${o.nonprofit.id}"]`);f!==null&&(f.tabIndex=0,f.focus());return}}if(n.currentTarget instanceof HTMLElement)if(a===t)if(this.enableNonprofitDeselection)this.selectedNonprofitId=null;else return;else this.selectedNonprofitId=t;await this.selectionDataController.exec({selectedNonprofitId:this.selectedNonprofitId})}}get configLang(){return U[this.lang]||"en"}getNonprofitById(t){return t?this.nonprofitListDataController?.data?.nonprofits.find(e=>e.nonprofit.id===t):null}async willUpdate(t){const e=["chainId","baseUrl","storeId","apiKey","countryCode","postalCode","cart","lang"];for(const i of e)if(t.has(i)){await this.nonprofitListDataController.exec();break}}async firstUpdated(t){await this.restoreStateFromCache()}connectedCallback(){super.connectedCallback(),window.addEventListener(C.eventName,this.handleCartChange)}disconnectedCallback(){window.removeEventListener(C.eventName,this.handleCartChange),super.disconnectedCallback()}getExternalCartId(){return this.localStorage.getItemJson("cart")?.cartId??v("cart")}getBeamCartId(){return v(O)}async restoreStateFromCache(){u(["apiKey","chainId","storeId"],this);try{this.selectedNonprofitId=parseInt(this.localStorage.getItem("nonprofit")||"")||null,this.selectionId=this.localStorage.getItem("transaction")??void 0,this.cart=this.localStorage.getItemJson("cart")??void 0;const{createdAt:t=0,data:e}=this.localStorage.getItemJson("chainNonprofits")||{},i=2*60*60*1e3;if(new Date(t).valueOf()+i>new Date().valueOf()&&(this.nonprofitListDataController.data=e,this.nonprofitListDataController.loading=!1),this.selectedNonprofitId&&!this.selectionId&&await this.selectionDataController.exec({selectedNonprofitId:this.selectedNonprofitId}),this.selectedNonprofitId){const n=this.getNonprofitById(this.selectedNonprofitId);this.dispatchEvent(new N({selectedNonprofitId:this.selectedNonprofitId,selectionId:this.selectionId,nonprofitName:n?.nonprofit?.name}))}}catch{}}get cssVariables(){const t={"--beam-fontFamily":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...F,"--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--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-borderColor":"currentColor","--beam-SelectNonprofit-details-backgroundColor":"inherit",...p("--beam-SelectNonprofit-title",{fontSize:"1.25em",fontWeight:"bold"}),...p("--beam-SelectNonprofit-title-inline",{fontWeight:"bold"}),"--beam-SelectNonprofit-title-inline-textTransform":"none",...p("--beam-SelectNonprofit-description",{marginTop:"0.5em"}),...p("--beam-SelectNonprofit-description-inline"),...p("--beam-SelectNonprofit-details-cause",{fontSize:"0.85em",fontWeight:"bold"}),...p("--beam-SelectNonprofit-details-beamAttribution",{fontSize:"0.85em"}),...p("--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",...p("--beam-SelectNonprofit-details-fundingProgressLabel",{fontSize:"0.85em"})},e=this.nonprofitListDataController?.data?.config?.web?.theme||{},i={...t,...e};return Object.assign(Object.create({toCSS(){return A(this)}}),i)}render(){const{selectedNonprofitId:t}=this,{data:e,loading:i}=this.nonprofitListDataController;if(i&&!e)return E();if(this.nonprofitListDataController.error)return this.debug?y({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return y({error:this.selectionDataController.error});const n=e?.nonprofits||[],a=n.find(o=>o.nonprofit.id===t)||null;return b`
2
2
  <style>
3
3
  :host {
4
4
  ${this.cssVariables.toCSS()}
@@ -1,2 +1,2 @@
1
- import{w as t}from"../chunks/network-listeners-CEOxhlYW.esm.js";import{i as b}from"../chunks/network-listeners-CEOxhlYW.esm.js";import{g as r,a as o}from"../chunks/cookies-BnIoXWd0.esm.js";import{e as A}from"../chunks/events-rRSQYdP1.esm.js";import{h as L,C as O,B as P,s as T,N as W}from"../chunks/order-page-yvantjI2.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-19PtzbXK.esm.js";import"../chunks/routes-S9p8QYNm.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"./post-purchase.esm.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"./redeem-transaction.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"./impact-overview.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";const i={waitForElement:t,getCookieMap:r,getCookieValue:o};export{L as addBeamAttributesToCart,A as events,O as getCurrentCart,b as initNetworkListeners,P as registerCartIntegration,T as showBeamOrderPageWidgets,W as trackCart,i as utils};
1
+ import{w as t}from"../chunks/network-listeners-CEOxhlYW.esm.js";import{i as b}from"../chunks/network-listeners-CEOxhlYW.esm.js";import{g as r,a as o}from"../chunks/cookies-BnIoXWd0.esm.js";import{e as A}from"../chunks/events-rRSQYdP1.esm.js";import{h as L,C as O,B as P,s as T,N as W}from"../chunks/order-page-0Hp4NoQq.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-vHXpyCQh.esm.js";import"../chunks/routes-MZb9Fq0P.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"./post-purchase.esm.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"./redeem-transaction.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"./impact-overview.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";const i={waitForElement:t,getCookieMap:r,getCookieValue:o};export{L as addBeamAttributesToCart,A as events,O as getCurrentCart,b as initNetworkListeners,P as registerCartIntegration,T as showBeamOrderPageWidgets,W as trackCart,i as utils};
2
2
  //# sourceMappingURL=shopify.esm.js.map
@@ -1,2 +1,2 @@
1
- import{w as t}from"../chunks/network-listeners-CEOxhlYW.esm.js";import{i as b}from"../chunks/network-listeners-CEOxhlYW.esm.js";import{g as r,a as o}from"../chunks/cookies-BnIoXWd0.esm.js";import{e as A}from"../chunks/events-rRSQYdP1.esm.js";import{h as L,C as O,B as P,s as T,N as W}from"../chunks/order-page-cPB3srgo.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-19PtzbXK.esm.js";import"../chunks/routes-S9p8QYNm.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"./post-purchase.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"./redeem-transaction.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"./impact-overview.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";const i={waitForElement:t,getCookieMap:r,getCookieValue:o};export{L as addBeamAttributesToCart,A as events,O as getCurrentCart,b as initNetworkListeners,P as registerCartIntegration,T as showBeamOrderPageWidgets,W as trackCart,i as utils};
1
+ import{w as t}from"../chunks/network-listeners-CEOxhlYW.esm.js";import{i as b}from"../chunks/network-listeners-CEOxhlYW.esm.js";import{g as r,a as o}from"../chunks/cookies-BnIoXWd0.esm.js";import{e as A}from"../chunks/events-rRSQYdP1.esm.js";import{h as L,C as O,B as P,s as T,N as W}from"../chunks/order-page-a46zvUZT.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-vHXpyCQh.esm.js";import"../chunks/routes-MZb9Fq0P.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"./post-purchase.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"./redeem-transaction.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"./beam-partner-logos.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"./impact-overview.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";const i={waitForElement:t,getCookieMap:r,getCookieValue:o};export{L as addBeamAttributesToCart,A as events,O as getCurrentCart,b as initNetworkListeners,P as registerCartIntegration,T as showBeamOrderPageWidgets,W as trackCart,i as utils};
2
2
  //# sourceMappingURL=shopify.js.map
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { i as WebComponents } from './chunks/index--eKbxy32.esm.js';
2
2
  export { i as Integrations } from './chunks/index-wuUhCB0N.esm.js';
3
- export { i as ReactComponents } from './chunks/index-dG8DWaaH.esm.js';
3
+ export { i as ReactComponents } from './chunks/index-G6h0AEAz.esm.js';
4
4
  import './components/community-impact.js';
5
5
  import 'lit';
6
6
  import 'lit-html';
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{i as L}from"./chunks/index-aGYbEHXq.esm.js";import{i as N}from"./chunks/index-m6WKjTPD.esm.js";import{i as P}from"./chunks/index-K9rDxqim.esm.js";import"./components/community-impact.esm.js";import"./chunks/lit-h1W25hjN.esm.js";import"./chunks/progress-bar-w3yfrrxD.esm.js";import"./components/beam-partner-logos.esm.js";import"./chunks/localize-e-mss8ya.esm.js";import"./chunks/beam-errors-l02WBee5.esm.js";import"./chunks/logger-ad87ovol.esm.js";import"./chunks/routes-S9p8QYNm.esm.js";import"./chunks/css-card-grid-RRkoiUTl.esm.js";import"./components/cumulative-impact.esm.js";import"./chunks/lodash-ZxBiuGue.esm.js";import"./chunks/is-all-html-elements-SdSkxirh.esm.js";import"./components/impact-overview.esm.js";import"./chunks/vendor-IGhQoYCM.esm.js";import"./chunks/responsive-Rehmv-eo.esm.js";import"./components/select-nonprofit.esm.js";import"./chunks/local-storage-Rrnk_Dg-.esm.js";import"./chunks/events-rRSQYdP1.esm.js";import"./chunks/cookies-BnIoXWd0.esm.js";import"./chunks/cart-contents-h60geKWa.esm.js";import"./components/redeem-transaction.esm.js";import"./components/post-purchase.esm.js";import"./chunks/index--XzN0d8d.esm.js";import"./chunks/network-listeners-CEOxhlYW.esm.js";import"./chunks/remote-session-mmQFfNd6.esm.js";import"./chunks/index-DCwz1LOg.esm.js";import"./chunks/order-page-yvantjI2.esm.js";import"./chunks/update-cart-19PtzbXK.esm.js";import"./chunks/index-IXwIgGSV.esm.js";import"./chunks/index-NHpZM_uW.esm.js";import"./react/community-impact.esm.js";import"react";import"./react/cumulative-impact.esm.js";import"./react/impact-overview.esm.js";import"./react/select-nonprofit.esm.js";import"./react/redeem-transaction.esm.js";import"./react/post-purchase.esm.js";export{N as Integrations,P as ReactComponents,L as WebComponents};
1
+ import{i as L}from"./chunks/index-aGYbEHXq.esm.js";import{i as N}from"./chunks/index-k7UbsAvh.esm.js";import{i as P}from"./chunks/index-K9rDxqim.esm.js";import"./components/community-impact.esm.js";import"./chunks/lit-h1W25hjN.esm.js";import"./chunks/progress-bar-w3yfrrxD.esm.js";import"./components/beam-partner-logos.esm.js";import"./chunks/localize-e-mss8ya.esm.js";import"./chunks/beam-errors-l02WBee5.esm.js";import"./chunks/logger-ad87ovol.esm.js";import"./chunks/routes-MZb9Fq0P.esm.js";import"./chunks/css-card-grid-RRkoiUTl.esm.js";import"./components/cumulative-impact.esm.js";import"./chunks/lodash-ZxBiuGue.esm.js";import"./chunks/is-all-html-elements-SdSkxirh.esm.js";import"./components/impact-overview.esm.js";import"./chunks/vendor-IGhQoYCM.esm.js";import"./chunks/responsive-Rehmv-eo.esm.js";import"./components/select-nonprofit.esm.js";import"./chunks/local-storage-Rrnk_Dg-.esm.js";import"./chunks/events-rRSQYdP1.esm.js";import"./chunks/cookies-BnIoXWd0.esm.js";import"./chunks/cart-contents-h60geKWa.esm.js";import"./components/redeem-transaction.esm.js";import"./components/post-purchase.esm.js";import"./chunks/index--XzN0d8d.esm.js";import"./chunks/network-listeners-CEOxhlYW.esm.js";import"./chunks/remote-session-mmQFfNd6.esm.js";import"./chunks/index-B6ZVcw-2.esm.js";import"./chunks/order-page-0Hp4NoQq.esm.js";import"./chunks/update-cart-vHXpyCQh.esm.js";import"./chunks/index-IXwIgGSV.esm.js";import"./chunks/index-nrUfRMjl.esm.js";import"./react/community-impact.esm.js";import"react";import"./react/cumulative-impact.esm.js";import"./react/impact-overview.esm.js";import"./react/select-nonprofit.esm.js";import"./react/redeem-transaction.esm.js";import"./react/post-purchase.esm.js";export{N as Integrations,P as ReactComponents,L as WebComponents};
2
2
  //# sourceMappingURL=index.esm.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{i as L}from"./chunks/index-bo9Yq4jd.esm.js";import{i as N}from"./chunks/index-w1rUrZm2.esm.js";import{i as P}from"./chunks/index-JL12lEnO.esm.js";import"./components/community-impact.js";import"./chunks/lit-h1W25hjN.esm.js";import"./chunks/progress-bar-w3yfrrxD.esm.js";import"./components/beam-partner-logos.js";import"./chunks/localize-e-mss8ya.esm.js";import"./chunks/beam-errors-l02WBee5.esm.js";import"./chunks/logger-ad87ovol.esm.js";import"./chunks/routes-S9p8QYNm.esm.js";import"./chunks/css-card-grid-RRkoiUTl.esm.js";import"./components/cumulative-impact.js";import"./chunks/lodash-ZxBiuGue.esm.js";import"./chunks/is-all-html-elements-SdSkxirh.esm.js";import"./components/impact-overview.js";import"./chunks/vendor-IGhQoYCM.esm.js";import"./chunks/responsive-Rehmv-eo.esm.js";import"./components/select-nonprofit.js";import"./chunks/local-storage-Rrnk_Dg-.esm.js";import"./chunks/events-rRSQYdP1.esm.js";import"./chunks/cookies-BnIoXWd0.esm.js";import"./chunks/cart-contents-h60geKWa.esm.js";import"./components/redeem-transaction.js";import"./components/post-purchase.js";import"./chunks/index--XzN0d8d.esm.js";import"./chunks/network-listeners-CEOxhlYW.esm.js";import"./chunks/remote-session-mmQFfNd6.esm.js";import"./chunks/index-BW-QdExJ.esm.js";import"./chunks/order-page-cPB3srgo.esm.js";import"./chunks/update-cart-19PtzbXK.esm.js";import"./chunks/index-IXwIgGSV.esm.js";import"./chunks/index-NHpZM_uW.esm.js";import"./react/community-impact.js";import"react";import"./react/cumulative-impact.js";import"./react/impact-overview.js";import"./react/select-nonprofit.js";import"./react/redeem-transaction.js";import"./react/post-purchase.js";export{N as Integrations,P as ReactComponents,L as WebComponents};
1
+ import{i as L}from"./chunks/index-bo9Yq4jd.esm.js";import{i as N}from"./chunks/index-IeUA7g43.esm.js";import{i as P}from"./chunks/index-JL12lEnO.esm.js";import"./components/community-impact.js";import"./chunks/lit-h1W25hjN.esm.js";import"./chunks/progress-bar-w3yfrrxD.esm.js";import"./components/beam-partner-logos.js";import"./chunks/localize-e-mss8ya.esm.js";import"./chunks/beam-errors-l02WBee5.esm.js";import"./chunks/logger-ad87ovol.esm.js";import"./chunks/routes-MZb9Fq0P.esm.js";import"./chunks/css-card-grid-RRkoiUTl.esm.js";import"./components/cumulative-impact.js";import"./chunks/lodash-ZxBiuGue.esm.js";import"./chunks/is-all-html-elements-SdSkxirh.esm.js";import"./components/impact-overview.js";import"./chunks/vendor-IGhQoYCM.esm.js";import"./chunks/responsive-Rehmv-eo.esm.js";import"./components/select-nonprofit.js";import"./chunks/local-storage-Rrnk_Dg-.esm.js";import"./chunks/events-rRSQYdP1.esm.js";import"./chunks/cookies-BnIoXWd0.esm.js";import"./chunks/cart-contents-h60geKWa.esm.js";import"./components/redeem-transaction.js";import"./components/post-purchase.js";import"./chunks/index--XzN0d8d.esm.js";import"./chunks/network-listeners-CEOxhlYW.esm.js";import"./chunks/remote-session-mmQFfNd6.esm.js";import"./chunks/index-zaXXznPD.esm.js";import"./chunks/order-page-a46zvUZT.esm.js";import"./chunks/update-cart-vHXpyCQh.esm.js";import"./chunks/index-IXwIgGSV.esm.js";import"./chunks/index-nrUfRMjl.esm.js";import"./react/community-impact.js";import"react";import"./react/cumulative-impact.js";import"./react/impact-overview.js";import"./react/select-nonprofit.js";import"./react/redeem-transaction.js";import"./react/post-purchase.js";export{N as Integrations,P as ReactComponents,L as WebComponents};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{x as s}from"../chunks/update-cart-19PtzbXK.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-S9p8QYNm.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";export{s as updateCart};
1
+ import{x as s}from"../chunks/update-cart-vHXpyCQh.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-MZb9Fq0P.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";export{s as updateCart};
2
2
  //# sourceMappingURL=cart.esm.js.map
@@ -1,2 +1,2 @@
1
- import{x as s}from"../chunks/update-cart-19PtzbXK.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-S9p8QYNm.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";export{s as updateCart};
1
+ import{x as s}from"../chunks/update-cart-vHXpyCQh.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-MZb9Fq0P.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";export{s as updateCart};
2
2
  //# sourceMappingURL=cart.js.map
@@ -1,2 +1,2 @@
1
- import{i as u}from"../chunks/index--XzN0d8d.esm.js";import{i as w}from"../chunks/index-DCwz1LOg.esm.js";import{i as A}from"../chunks/index-IXwIgGSV.esm.js";import{i as D}from"../chunks/index-NHpZM_uW.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/network-listeners-CEOxhlYW.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"../chunks/order-page-yvantjI2.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-19PtzbXK.esm.js";import"../chunks/routes-S9p8QYNm.esm.js";import"../components/post-purchase.esm.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"../components/redeem-transaction.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../components/impact-overview.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";export{D as Cart,A as Session,w as Shopify,u as Utils};
1
+ import{i as u}from"../chunks/index--XzN0d8d.esm.js";import{i as w}from"../chunks/index-B6ZVcw-2.esm.js";import{i as A}from"../chunks/index-IXwIgGSV.esm.js";import{i as D}from"../chunks/index-nrUfRMjl.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/network-listeners-CEOxhlYW.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"../chunks/order-page-0Hp4NoQq.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-vHXpyCQh.esm.js";import"../chunks/routes-MZb9Fq0P.esm.js";import"../components/post-purchase.esm.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"../components/redeem-transaction.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../components/impact-overview.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";export{D as Cart,A as Session,w as Shopify,u as Utils};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1,2 +1,2 @@
1
- import{i as u}from"../chunks/index--XzN0d8d.esm.js";import{i as w}from"../chunks/index-BW-QdExJ.esm.js";import{i as A}from"../chunks/index-IXwIgGSV.esm.js";import{i as D}from"../chunks/index-NHpZM_uW.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/network-listeners-CEOxhlYW.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"../chunks/order-page-cPB3srgo.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-19PtzbXK.esm.js";import"../chunks/routes-S9p8QYNm.esm.js";import"../components/post-purchase.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"../components/redeem-transaction.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../components/impact-overview.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";export{D as Cart,A as Session,w as Shopify,u as Utils};
1
+ import{i as u}from"../chunks/index--XzN0d8d.esm.js";import{i as w}from"../chunks/index-zaXXznPD.esm.js";import{i as A}from"../chunks/index-IXwIgGSV.esm.js";import{i as D}from"../chunks/index-nrUfRMjl.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/network-listeners-CEOxhlYW.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"../chunks/order-page-a46zvUZT.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-vHXpyCQh.esm.js";import"../chunks/routes-MZb9Fq0P.esm.js";import"../components/post-purchase.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"../components/redeem-transaction.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../components/impact-overview.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";export{D as Cart,A as Session,w as Shopify,u as Utils};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{h as N,C as O,B as P,s as T,N as W}from"../chunks/order-page-yvantjI2.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/network-listeners-CEOxhlYW.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-19PtzbXK.esm.js";import"../chunks/routes-S9p8QYNm.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"../components/post-purchase.esm.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"../components/redeem-transaction.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../components/impact-overview.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";export{N as addBeamAttributesToCart,O as getCurrentCart,P as registerCartIntegration,T as showBeamOrderPageWidgets,W as trackCart};
1
+ import{h as N,C as O,B as P,s as T,N as W}from"../chunks/order-page-0Hp4NoQq.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/network-listeners-CEOxhlYW.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-vHXpyCQh.esm.js";import"../chunks/routes-MZb9Fq0P.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"../components/post-purchase.esm.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"../components/redeem-transaction.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../components/impact-overview.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";export{N as addBeamAttributesToCart,O as getCurrentCart,P as registerCartIntegration,T as showBeamOrderPageWidgets,W as trackCart};
2
2
  //# sourceMappingURL=shopify.esm.js.map
@@ -1,2 +1,2 @@
1
- import{h as N,C as O,B as P,s as T,N as W}from"../chunks/order-page-cPB3srgo.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/network-listeners-CEOxhlYW.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-19PtzbXK.esm.js";import"../chunks/routes-S9p8QYNm.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"../components/post-purchase.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"../components/redeem-transaction.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../components/impact-overview.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";export{N as addBeamAttributesToCart,O as getCurrentCart,P as registerCartIntegration,T as showBeamOrderPageWidgets,W as trackCart};
1
+ import{h as N,C as O,B as P,s as T,N as W}from"../chunks/order-page-a46zvUZT.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/network-listeners-CEOxhlYW.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/events-rRSQYdP1.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-vHXpyCQh.esm.js";import"../chunks/routes-MZb9Fq0P.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/remote-session-mmQFfNd6.esm.js";import"../components/post-purchase.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-e-mss8ya.esm.js";import"../components/redeem-transaction.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../components/impact-overview.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";export{N as addBeamAttributesToCart,O as getCurrentCart,P as registerCartIntegration,T as showBeamOrderPageWidgets,W as trackCart};
2
2
  //# sourceMappingURL=shopify.js.map
@@ -6,4 +6,4 @@ import '../chunks/types-aju0qrRe.esm.js';
6
6
 
7
7
  declare const BeamPartnerLogos: _lit_react.ReactWebComponent<BeamPartnerLogos$1, {}>;
8
8
 
9
- export { BeamPartnerLogos };
9
+ export { BeamPartnerLogos, BeamPartnerLogos as default };
@@ -1,2 +1,2 @@
1
- import e from"react";import{l as o}from"../chunks/lit-h1W25hjN.esm.js";import{BeamPartnerLogos as r}from"../components/beam-partner-logos.esm.js";const t=o({tagName:"beam-partner-logos",elementClass:r,react:e,events:{}});export{t as BeamPartnerLogos};
1
+ import o from"react";import{l as r}from"../chunks/lit-h1W25hjN.esm.js";import{BeamPartnerLogos as a}from"../components/beam-partner-logos.esm.js";const e=r({tagName:"beam-partner-logos",elementClass:a,react:o,events:{}});export{e as BeamPartnerLogos,e as default};
2
2
  //# sourceMappingURL=beam-partner-logos.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"beam-partner-logos.esm.js","sources":["../../src/components/beam-partner-logos/react.ts"],"sourcesContent":["import React from \"react\";\nimport { createComponent } from \"@lit/react\";\nimport { BeamPartnerLogos as _BeamPartnerLogos } from \"./index\";\n\nexport const BeamPartnerLogos = createComponent({\n tagName: \"beam-partner-logos\",\n elementClass: _BeamPartnerLogos,\n react: React,\n events: {},\n});\n"],"names":["BeamPartnerLogos","createComponent","_BeamPartnerLogos","React"],"mappings":"kJAIO,MAAMA,EAAmBC,EAAgB,CAC9C,QAAS,qBACT,aAAcC,EACd,MAAOC,EACP,OAAQ,EACV,CAAC"}
1
+ {"version":3,"file":"beam-partner-logos.esm.js","sources":["../../src/components/beam-partner-logos/react.ts"],"sourcesContent":["import React from \"react\";\nimport { createComponent } from \"@lit/react\";\nimport { BeamPartnerLogos as _BeamPartnerLogos } from \"./index\";\n\nexport const BeamPartnerLogos = createComponent({\n tagName: \"beam-partner-logos\",\n elementClass: _BeamPartnerLogos,\n react: React,\n events: {},\n});\n\nexport default BeamPartnerLogos; // default alias for use with async import utils like next/dynamic and react.lazy\n"],"names":["BeamPartnerLogos","createComponent","_BeamPartnerLogos","React"],"mappings":"kJAIa,MAAAA,EAAmBC,EAAgB,CAC9C,QAAS,qBACT,aAAcC,EACd,MAAOC,EACP,OAAQ,EACV,CAAC"}
@@ -1,2 +1,2 @@
1
- import e from"react";import{l as o}from"../chunks/lit-h1W25hjN.esm.js";import{BeamPartnerLogos as r}from"../components/beam-partner-logos.js";const t=o({tagName:"beam-partner-logos",elementClass:r,react:e,events:{}});export{t as BeamPartnerLogos};
1
+ import o from"react";import{l as r}from"../chunks/lit-h1W25hjN.esm.js";import{BeamPartnerLogos as a}from"../components/beam-partner-logos.js";const e=r({tagName:"beam-partner-logos",elementClass:a,react:o,events:{}});export{e as BeamPartnerLogos,e as default};
2
2
  //# sourceMappingURL=beam-partner-logos.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"beam-partner-logos.js","sources":["../../src/components/beam-partner-logos/react.ts"],"sourcesContent":["import React from \"react\";\nimport { createComponent } from \"@lit/react\";\nimport { BeamPartnerLogos as _BeamPartnerLogos } from \"./index\";\n\nexport const BeamPartnerLogos = createComponent({\n tagName: \"beam-partner-logos\",\n elementClass: _BeamPartnerLogos,\n react: React,\n events: {},\n});\n"],"names":["BeamPartnerLogos","createComponent","_BeamPartnerLogos","React"],"mappings":"8IAIO,MAAMA,EAAmBC,EAAgB,CAC9C,QAAS,qBACT,aAAcC,EACd,MAAOC,EACP,OAAQ,EACV,CAAC"}
1
+ {"version":3,"file":"beam-partner-logos.js","sources":["../../src/components/beam-partner-logos/react.ts"],"sourcesContent":["import React from \"react\";\nimport { createComponent } from \"@lit/react\";\nimport { BeamPartnerLogos as _BeamPartnerLogos } from \"./index\";\n\nexport const BeamPartnerLogos = createComponent({\n tagName: \"beam-partner-logos\",\n elementClass: _BeamPartnerLogos,\n react: React,\n events: {},\n});\n\nexport default BeamPartnerLogos; // default alias for use with async import utils like next/dynamic and react.lazy\n"],"names":["BeamPartnerLogos","createComponent","_BeamPartnerLogos","React"],"mappings":"8IAIa,MAAAA,EAAmBC,EAAgB,CAC9C,QAAS,qBACT,aAAcC,EACd,MAAOC,EACP,OAAQ,EACV,CAAC"}
@@ -9,4 +9,4 @@ import '../chunks/types-4zLXwf8o.esm.js';
9
9
 
10
10
  declare const BeamCommunityImpact: _lit_react.ReactWebComponent<BeamCommunityImpact$1, {}>;
11
11
 
12
- export { BeamCommunityImpact };
12
+ export { BeamCommunityImpact, BeamCommunityImpact as default };