@beamimpact/web-sdk 1.29.0-beta.7 → 1.30.0
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.
- package/README.md +11 -9
- package/dist/chunks/{_share-dialog-dependencies-Maa8_zem.esm.js → _share-dialog-dependencies-DgvDq7FK.esm.js} +2 -2
- package/dist/chunks/_share-dialog-dependencies-DgvDq7FK.esm.js.map +1 -0
- package/dist/chunks/{_share-dialog-dependencies-XILgIXBx.esm.js → _share-dialog-dependencies-kpIYmbPH.esm.js} +2 -2
- package/dist/chunks/_share-dialog-dependencies-kpIYmbPH.esm.js.map +1 -0
- package/dist/chunks/index-7h5FjeQX.esm.js +2 -0
- package/dist/chunks/index-7h5FjeQX.esm.js.map +1 -0
- package/dist/chunks/index-P0tq9Njz.esm.js +2 -0
- package/dist/chunks/index-P0tq9Njz.esm.js.map +1 -0
- package/dist/chunks/index-TLkr9fGm.esm.js +2 -0
- package/dist/chunks/index-TLkr9fGm.esm.js.map +1 -0
- package/dist/chunks/index-gkiwk1sL.esm.js +2 -0
- package/dist/chunks/index-gkiwk1sL.esm.js.map +1 -0
- package/dist/chunks/index-wLMSSZ0Y.esm.js +2 -0
- package/dist/chunks/index-wLMSSZ0Y.esm.js.map +1 -0
- package/dist/chunks/localize-nH-zlK_j.esm.js +30 -0
- package/dist/chunks/localize-nH-zlK_j.esm.js.map +1 -0
- package/dist/chunks/{order-page-9omqLrXP.esm.js → order-page-ES79iWIM.esm.js} +2 -2
- package/dist/chunks/{order-page-9omqLrXP.esm.js.map → order-page-ES79iWIM.esm.js.map} +1 -1
- package/dist/chunks/{order-page-WT58L0aH.esm.js → order-page-fbySwTP6.esm.js} +2 -2
- package/dist/chunks/{order-page-WT58L0aH.esm.js.map → order-page-fbySwTP6.esm.js.map} +1 -1
- package/dist/chunks/routes-64X-iWC0.esm.js +2 -0
- package/dist/chunks/{routes-Pca6QK46.esm.js.map → routes-64X-iWC0.esm.js.map} +1 -1
- package/dist/chunks/update-cart-QGC4d10_.esm.js +2 -0
- package/dist/chunks/update-cart-QGC4d10_.esm.js.map +1 -0
- package/dist/components/community-impact.esm.js +3 -2
- package/dist/components/community-impact.esm.js.map +1 -1
- package/dist/components/community-impact.js +3 -2
- package/dist/components/community-impact.js.map +1 -1
- package/dist/components/cumulative-impact.esm.js +5 -4
- package/dist/components/cumulative-impact.esm.js.map +1 -1
- package/dist/components/cumulative-impact.js +5 -4
- package/dist/components/cumulative-impact.js.map +1 -1
- package/dist/components/impact-overview.esm.js +9 -4
- package/dist/components/impact-overview.esm.js.map +1 -1
- package/dist/components/impact-overview.js +9 -4
- package/dist/components/impact-overview.js.map +1 -1
- package/dist/components/index.esm.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/post-purchase.esm.js +1 -1
- package/dist/components/post-purchase.js +1 -1
- package/dist/components/redeem-transaction.esm.js +3 -2
- package/dist/components/redeem-transaction.esm.js.map +1 -1
- package/dist/components/redeem-transaction.js +3 -2
- package/dist/components/redeem-transaction.js.map +1 -1
- package/dist/components/select-nonprofit.esm.js +7 -4
- package/dist/components/select-nonprofit.esm.js.map +1 -1
- package/dist/components/select-nonprofit.js +7 -4
- package/dist/components/select-nonprofit.js.map +1 -1
- package/dist/components/shopify.esm.js +1 -1
- package/dist/components/shopify.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/integrations/cart.esm.js +1 -1
- package/dist/integrations/cart.js +1 -1
- package/dist/integrations/index.esm.js +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/shopify.esm.js +1 -1
- package/dist/integrations/shopify.js +1 -1
- package/dist/react/community-impact.esm.js +1 -1
- package/dist/react/community-impact.js +1 -1
- package/dist/react/cumulative-impact.esm.js +1 -1
- package/dist/react/cumulative-impact.js +1 -1
- package/dist/react/impact-overview.esm.js +1 -1
- package/dist/react/impact-overview.js +1 -1
- package/dist/react/index.esm.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/post-purchase.esm.js +1 -1
- package/dist/react/post-purchase.js +1 -1
- package/dist/react/redeem-transaction.esm.js +1 -1
- package/dist/react/redeem-transaction.js +1 -1
- package/dist/react/select-nonprofit.esm.js +1 -1
- package/dist/react/select-nonprofit.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/_share-dialog-dependencies-Maa8_zem.esm.js.map +0 -1
- package/dist/chunks/_share-dialog-dependencies-XILgIXBx.esm.js.map +0 -1
- package/dist/chunks/index--wDYbcG3.esm.js +0 -2
- package/dist/chunks/index--wDYbcG3.esm.js.map +0 -1
- package/dist/chunks/index-HzNMkrTb.esm.js +0 -2
- package/dist/chunks/index-HzNMkrTb.esm.js.map +0 -1
- package/dist/chunks/index-Q3EACrsL.esm.js +0 -2
- package/dist/chunks/index-Q3EACrsL.esm.js.map +0 -1
- package/dist/chunks/index-XDtIqSyR.esm.js +0 -2
- package/dist/chunks/index-XDtIqSyR.esm.js.map +0 -1
- package/dist/chunks/index-zcucZ2Xs.esm.js +0 -2
- package/dist/chunks/index-zcucZ2Xs.esm.js.map +0 -1
- package/dist/chunks/localize-e-mss8ya.esm.js +0 -29
- package/dist/chunks/localize-e-mss8ya.esm.js.map +0 -1
- package/dist/chunks/routes-Pca6QK46.esm.js +0 -2
- package/dist/chunks/update-cart-Lh4D5-q_.esm.js +0 -2
- package/dist/chunks/update-cart-Lh4D5-q_.esm.js.map +0 -1
|
@@ -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-
|
|
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-ES79iWIM.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-QGC4d10_.esm.js";import"../chunks/routes-64X-iWC0.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-nH-zlK_j.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.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-
|
|
1
|
+
import{i as L}from"./chunks/index-aGYbEHXq.esm.js";import{i as N}from"./chunks/index-TLkr9fGm.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-nH-zlK_j.esm.js";import"./chunks/beam-errors-l02WBee5.esm.js";import"./chunks/logger-ad87ovol.esm.js";import"./chunks/routes-64X-iWC0.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-7h5FjeQX.esm.js";import"./chunks/order-page-fbySwTP6.esm.js";import"./chunks/update-cart-QGC4d10_.esm.js";import"./chunks/index-IXwIgGSV.esm.js";import"./chunks/index-wLMSSZ0Y.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-
|
|
1
|
+
import{i as L}from"./chunks/index-bo9Yq4jd.esm.js";import{i as N}from"./chunks/index-gkiwk1sL.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-nH-zlK_j.esm.js";import"./chunks/beam-errors-l02WBee5.esm.js";import"./chunks/logger-ad87ovol.esm.js";import"./chunks/routes-64X-iWC0.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-P0tq9Njz.esm.js";import"./chunks/order-page-ES79iWIM.esm.js";import"./chunks/update-cart-QGC4d10_.esm.js";import"./chunks/index-IXwIgGSV.esm.js";import"./chunks/index-wLMSSZ0Y.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{
|
|
1
|
+
import{K as u}from"../chunks/update-cart-QGC4d10_.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-64X-iWC0.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{u as updateCart};
|
|
2
2
|
//# sourceMappingURL=cart.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{K as u}from"../chunks/update-cart-QGC4d10_.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-64X-iWC0.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{u 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-
|
|
1
|
+
import{i as u}from"../chunks/index--XzN0d8d.esm.js";import{i as w}from"../chunks/index-7h5FjeQX.esm.js";import{i as A}from"../chunks/index-IXwIgGSV.esm.js";import{i as D}from"../chunks/index-wLMSSZ0Y.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-fbySwTP6.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-QGC4d10_.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../components/post-purchase.esm.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-nH-zlK_j.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-
|
|
1
|
+
import{i as u}from"../chunks/index--XzN0d8d.esm.js";import{i as w}from"../chunks/index-P0tq9Njz.esm.js";import{i as A}from"../chunks/index-IXwIgGSV.esm.js";import{i as D}from"../chunks/index-wLMSSZ0Y.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-ES79iWIM.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-QGC4d10_.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../components/post-purchase.js";import"../chunks/lit-h1W25hjN.esm.js";import"../chunks/localize-nH-zlK_j.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-
|
|
1
|
+
import{h as N,C as O,B as P,s as T,N as W}from"../chunks/order-page-fbySwTP6.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-QGC4d10_.esm.js";import"../chunks/routes-64X-iWC0.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-nH-zlK_j.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-
|
|
1
|
+
import{h as N,C as O,B as P,s as T,N as W}from"../chunks/order-page-ES79iWIM.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-QGC4d10_.esm.js";import"../chunks/routes-64X-iWC0.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-nH-zlK_j.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
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as a}from"../chunks/lit-h1W25hjN.esm.js";import{BeamCommunityImpact as m}from"../components/community-impact.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/localize-
|
|
1
|
+
import o from"react";import{l as a}from"../chunks/lit-h1W25hjN.esm.js";import{BeamCommunityImpact as m}from"../components/community-impact.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";const t=a({tagName:m.tagName,elementClass:m,react:o,events:{}});export{t as BeamCommunityImpact,t as default};
|
|
2
2
|
//# sourceMappingURL=community-impact.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as a}from"../chunks/lit-h1W25hjN.esm.js";import{BeamCommunityImpact as m}from"../components/community-impact.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.js";import"../chunks/localize-
|
|
1
|
+
import o from"react";import{l as a}from"../chunks/lit-h1W25hjN.esm.js";import{BeamCommunityImpact as m}from"../components/community-impact.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";const t=a({tagName:m.tagName,elementClass:m,react:o,events:{}});export{t as BeamCommunityImpact,t as default};
|
|
2
2
|
//# sourceMappingURL=community-impact.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import a from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{BeamCumulativeImpact as m}from"../components/cumulative-impact.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/localize-
|
|
1
|
+
import a from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{BeamCumulativeImpact as m}from"../components/cumulative-impact.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";const t=e({tagName:m.tagName,elementClass:m,react:a,events:{}});export{t as BeamCumulativeImpact,t as default};
|
|
2
2
|
//# sourceMappingURL=cumulative-impact.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import a from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{BeamCumulativeImpact as m}from"../components/cumulative-impact.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/localize-
|
|
1
|
+
import a from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{BeamCumulativeImpact as m}from"../components/cumulative-impact.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";const t=e({tagName:m.tagName,elementClass:m,react:a,events:{}});export{t as BeamCumulativeImpact,t as default};
|
|
2
2
|
//# sourceMappingURL=cumulative-impact.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{BeamImpactOverview as m}from"../components/impact-overview.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-
|
|
1
|
+
import r from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{BeamImpactOverview as m}from"../components/impact-overview.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";const t=e({tagName:m.tagName,elementClass:m,react:r,events:{}});export{t as BeamImpactOverview,t as default};
|
|
2
2
|
//# sourceMappingURL=impact-overview.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{BeamImpactOverview as m}from"../components/impact-overview.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-
|
|
1
|
+
import r from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{BeamImpactOverview as m}from"../components/impact-overview.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/vendor-IGhQoYCM.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../components/beam-partner-logos.js";import"../chunks/responsive-Rehmv-eo.esm.js";const t=e({tagName:m.tagName,elementClass:m,react:r,events:{}});export{t as BeamImpactOverview,t as default};
|
|
2
2
|
//# sourceMappingURL=impact-overview.js.map
|
package/dist/react/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{BeamCommunityImpact as O}from"./community-impact.esm.js";import{BeamCumulativeImpact as S}from"./cumulative-impact.esm.js";import{BeamImpactOverview as b}from"./impact-overview.esm.js";import{BeamSelectNonprofit as j}from"./select-nonprofit.esm.js";import{BeamRedeemTransaction as q}from"./redeem-transaction.esm.js";import{BeamPostPurchase as A}from"./post-purchase.esm.js";import"react";import"../chunks/lit-h1W25hjN.esm.js";import"../components/community-impact.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/localize-
|
|
1
|
+
import{BeamCommunityImpact as O}from"./community-impact.esm.js";import{BeamCumulativeImpact as S}from"./cumulative-impact.esm.js";import{BeamImpactOverview as b}from"./impact-overview.esm.js";import{BeamSelectNonprofit as j}from"./select-nonprofit.esm.js";import{BeamRedeemTransaction as q}from"./redeem-transaction.esm.js";import{BeamPostPurchase as A}from"./post-purchase.esm.js";import"react";import"../chunks/lit-h1W25hjN.esm.js";import"../components/community-impact.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-64X-iWC0.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"../chunks/events-rRSQYdP1.esm.js";import"../components/select-nonprofit.esm.js";import"../chunks/local-storage-Rrnk_Dg-.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";export{O as BeamCommunityImpact,S as BeamCumulativeImpact,b as BeamImpactOverview,A as BeamPostPurchase,q as BeamRedeemTransaction,j as BeamSelectNonprofit};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/react/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{BeamCommunityImpact as O}from"./community-impact.js";import{BeamCumulativeImpact as S}from"./cumulative-impact.js";import{BeamImpactOverview as b}from"./impact-overview.js";import{BeamSelectNonprofit as j}from"./select-nonprofit.js";import{BeamRedeemTransaction as q}from"./redeem-transaction.js";import{BeamPostPurchase as A}from"./post-purchase.js";import"react";import"../chunks/lit-h1W25hjN.esm.js";import"../components/community-impact.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.js";import"../chunks/localize-
|
|
1
|
+
import{BeamCommunityImpact as O}from"./community-impact.js";import{BeamCumulativeImpact as S}from"./cumulative-impact.js";import{BeamImpactOverview as b}from"./impact-overview.js";import{BeamSelectNonprofit as j}from"./select-nonprofit.js";import{BeamRedeemTransaction as q}from"./redeem-transaction.js";import{BeamPostPurchase as A}from"./post-purchase.js";import"react";import"../chunks/lit-h1W25hjN.esm.js";import"../components/community-impact.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-64X-iWC0.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"../chunks/events-rRSQYdP1.esm.js";import"../components/select-nonprofit.js";import"../chunks/local-storage-Rrnk_Dg-.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";export{O as BeamCommunityImpact,S as BeamCumulativeImpact,b as BeamImpactOverview,A as BeamPostPurchase,q as BeamRedeemTransaction,j as BeamSelectNonprofit};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as r}from"../chunks/lit-h1W25hjN.esm.js";import{BeamPostPurchase as t}from"../components/post-purchase.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/localize-
|
|
1
|
+
import o from"react";import{l as r}from"../chunks/lit-h1W25hjN.esm.js";import{BeamPostPurchase as t}from"../components/post-purchase.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../components/redeem-transaction.esm.js";import"../chunks/lodash-ZxBiuGue.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"../chunks/events-rRSQYdP1.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";import"../chunks/cart-contents-h60geKWa.esm.js";const m=r({tagName:t.tagName,elementClass:t,react:o,events:{}});export{m as BeamPostPurchase,m as default};
|
|
2
2
|
//# sourceMappingURL=post-purchase.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as r}from"../chunks/lit-h1W25hjN.esm.js";import{BeamPostPurchase as t}from"../components/post-purchase.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/localize-
|
|
1
|
+
import o from"react";import{l as r}from"../chunks/lit-h1W25hjN.esm.js";import{BeamPostPurchase as t}from"../components/post-purchase.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../components/redeem-transaction.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";import"../chunks/events-rRSQYdP1.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";import"../chunks/cart-contents-h60geKWa.esm.js";const m=r({tagName:t.tagName,elementClass:t,react:o,events:{}});export{m as BeamPostPurchase,m as default};
|
|
2
2
|
//# sourceMappingURL=post-purchase.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import m from"react";import{l as o}from"../chunks/lit-h1W25hjN.esm.js";import{a as r}from"../chunks/events-rRSQYdP1.esm.js";import{BeamRedeemTransaction as e}from"../components/redeem-transaction.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/localize-
|
|
1
|
+
import m from"react";import{l as o}from"../chunks/lit-h1W25hjN.esm.js";import{a as r}from"../chunks/events-rRSQYdP1.esm.js";import{BeamRedeemTransaction as e}from"../components/redeem-transaction.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";const t=o({tagName:e.tagName,elementClass:e,react:m,events:{onNonprofitSelect:r.eventName}});export{t as BeamRedeemTransaction,t as default};
|
|
2
2
|
//# sourceMappingURL=redeem-transaction.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import m from"react";import{l as o}from"../chunks/lit-h1W25hjN.esm.js";import{a as r}from"../chunks/events-rRSQYdP1.esm.js";import{BeamRedeemTransaction as e}from"../components/redeem-transaction.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/localize-
|
|
1
|
+
import m from"react";import{l as o}from"../chunks/lit-h1W25hjN.esm.js";import{a as r}from"../chunks/events-rRSQYdP1.esm.js";import{BeamRedeemTransaction as e}from"../components/redeem-transaction.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../components/beam-partner-logos.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/css-card-grid-RRkoiUTl.esm.js";const t=o({tagName:e.tagName,elementClass:e,react:m,events:{onNonprofitSelect:r.eventName}});export{t as BeamRedeemTransaction,t as default};
|
|
2
2
|
//# sourceMappingURL=redeem-transaction.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{a as m}from"../chunks/events-rRSQYdP1.esm.js";import{BeamSelectNonprofit as r}from"../components/select-nonprofit.esm.js";import"../chunks/localize-
|
|
1
|
+
import o from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{a as m}from"../chunks/events-rRSQYdP1.esm.js";import{BeamSelectNonprofit as r}from"../components/select-nonprofit.esm.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";const t=e({tagName:"beam-select-nonprofit",elementClass:r,react:o,events:{onNonprofitSelect:m.eventName}});export{t as BeamSelectNonprofit,t as default};
|
|
2
2
|
//# sourceMappingURL=select-nonprofit.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{a as m}from"../chunks/events-rRSQYdP1.esm.js";import{BeamSelectNonprofit as r}from"../components/select-nonprofit.js";import"../chunks/localize-
|
|
1
|
+
import o from"react";import{l as e}from"../chunks/lit-h1W25hjN.esm.js";import{a as m}from"../chunks/events-rRSQYdP1.esm.js";import{BeamSelectNonprofit as r}from"../components/select-nonprofit.js";import"../chunks/localize-nH-zlK_j.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-64X-iWC0.esm.js";import"../chunks/progress-bar-w3yfrrxD.esm.js";import"../chunks/local-storage-Rrnk_Dg-.esm.js";import"../chunks/cookies-BnIoXWd0.esm.js";import"../chunks/responsive-Rehmv-eo.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";const t=e({tagName:"beam-select-nonprofit",elementClass:r,react:o,events:{onNonprofitSelect:m.eventName}});export{t as BeamSelectNonprofit,t as default};
|
|
2
2
|
//# sourceMappingURL=select-nonprofit.js.map
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_share-dialog-dependencies-Maa8_zem.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_share-dialog-dependencies-XILgIXBx.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index--wDYbcG3.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as e,C as r,B as t,s as a,N as o}from"./order-page-9omqLrXP.esm.js";var s=Object.freeze({__proto__:null,addBeamAttributesToCart:e,getCurrentCart:r,registerCartIntegration:t,showBeamOrderPageWidgets:a,trackCart:o});export{s as i};
|
|
2
|
-
//# sourceMappingURL=index-HzNMkrTb.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-HzNMkrTb.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i}from"./index--XzN0d8d.esm.js";import{i as o}from"./index-zcucZ2Xs.esm.js";import{i as r}from"./index-IXwIgGSV.esm.js";import{i as e}from"./index--wDYbcG3.esm.js";var t=Object.freeze({__proto__:null,Cart:e,Session:r,Shopify:o,Utils:i});export{t as i};
|
|
2
|
-
//# sourceMappingURL=index-Q3EACrsL.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-Q3EACrsL.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i}from"./index--XzN0d8d.esm.js";import{i as o}from"./index-HzNMkrTb.esm.js";import{i as r}from"./index-IXwIgGSV.esm.js";import{i as e}from"./index--wDYbcG3.esm.js";var t=Object.freeze({__proto__:null,Cart:e,Session:r,Shopify:o,Utils:i});export{t as i};
|
|
2
|
-
//# sourceMappingURL=index-XDtIqSyR.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-XDtIqSyR.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as e,C as r,B as t,s as a,N as o}from"./order-page-WT58L0aH.esm.js";var s=Object.freeze({__proto__:null,addBeamAttributesToCart:e,getCurrentCart:r,registerCartIntegration:t,showBeamOrderPageWidgets:a,trackCart:o});export{s as i};
|
|
2
|
-
//# sourceMappingURL=index-zcucZ2Xs.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-zcucZ2Xs.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{h as g,y as s,j as p}from"./lit-h1W25hjN.esm.js";import{N as d,M as c,B as u}from"./beam-errors-l02WBee5.esm.js";import{l as m}from"./logger-ad87ovol.esm.js";const b=g`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}ul{list-style:none}button,input,select{margin:0}html{box-sizing:border-box}*,*::before,*::after{box-sizing:inherit}img,video{/*height:auto;*/max-width:100%}iframe{border:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}`;function $(t,e=t.tagName){customElements.get(e)||customElements.define(e,t)}const y=t=>Object.entries(t).map(([e,r])=>`${e}: ${r};`).join(`
|
|
2
|
-
`);class x{constructor(e,r){this.data=null,this.loading=!1,this.error=null,(this.host=e).addController(this),this.asyncFn=r}async exec(...e){this.lastArgs=e,this.loading=!0,this.host.requestUpdate();try{this.data=await this.asyncFn(...e),this.error=null}catch(r){r instanceof Error&&(this.error=r,this.data=null)}return this.loading=!1,this.host.requestUpdate(),this.data}async retry(){return this.exec(...this.lastArgs||[])}hostDisconnected(){}}const f={errorTitle:"Beam encountered an error. Please try again.",retry:"Retry"},w=({error:t,retry:e})=>{let r=s``;if(t instanceof d){const i=JSON.stringify({status:t.response.status,statusText:t.response.statusText,url:t.response.url,body:t.body},null,4);r=s`
|
|
3
|
-
<p><b>Network Response:</b></p>
|
|
4
|
-
<p>${i}</p>
|
|
5
|
-
`}return t instanceof c&&(r=s`
|
|
6
|
-
<p><b>Missing Required Config Options:</b></p>
|
|
7
|
-
<p>${t.missingConfigKeyNames.join(", ")}</p>
|
|
8
|
-
`),s`<div class="beam-error" style="text-align: left">
|
|
9
|
-
<p>${f.errorTitle} ${e?s` <button type="reset" @click="${e}">${f.retry}</button>`:""}</p>
|
|
10
|
-
<br />
|
|
11
|
-
<details>
|
|
12
|
-
<div style="white-space: pre-wrap; font-family: monospace; line-height: 1;">
|
|
13
|
-
${r}
|
|
14
|
-
<p><b>Message:</b> ${t.message||s`<i>None</i>`}</p>
|
|
15
|
-
<p><b>Stack:</b> ${t.stack}</p>
|
|
16
|
-
</div>
|
|
17
|
-
</details>
|
|
18
|
-
<br />
|
|
19
|
-
<p>Help: <a href="https://www.beamimpact.com">www.beamimpact.com</a></p>
|
|
20
|
-
</div>`},T={loading:""},v=()=>s`<p class="beam-loading">${T.loading}</p>`,C=(t="",{fontFamily:e="inherit",fontSize:r="inherit",fontWeight:i="inherit",textTransform:o="none",marginTop:a="0",lineHeight:l="inherit",color:h="inherit"}={})=>{const n=t.startsWith("--beam-")?t:`--beam-${t}`;return{[`${n}-fontFamily`]:e,[`${n}-fontSize`]:r,[`${n}-fontWeight`]:i,[`${n}-textTransform`]:o,[`${n}-marginTop`]:a,[`${n}-lineHeight`]:l,[`${n}-color`]:h}},N=(t="",{fontFamily:e="inherit",fontSize:r="inherit",fontWeight:i="inherit",textTransform:o="none",marginTop:a="0",lineHeight:l="inherit",color:h="inherit"}={})=>{const n=t.startsWith("--beam-")?t:`--beam-${t}`;return p(` font-family: var(${n}-fontFamily, ${e});
|
|
21
|
-
font-size: var(${n}-fontSize, ${r});
|
|
22
|
-
font-weight: var(${n}-fontWeight, ${i});
|
|
23
|
-
text-transform: var(${n}-textTransform, ${o});
|
|
24
|
-
margin-top: var(${n}-marginTop, ${a});
|
|
25
|
-
line-height: var(${n}-lineHeight, ${l});
|
|
26
|
-
color: var(${n}-color, ${h});
|
|
27
|
-
`)};function z(t,e){const r=[],i=e;for(const o of t)i[o]==null&&r.push(o);if(r.length>0)throw m.error(`Beam Impact - Missing Required Config Values:
|
|
28
|
-
`,r.join(", "),e),new c(r);return!0}const S=(t,e)=>{if(e.startsWith("{"))try{const r=JSON.parse(e);return r[t]??r.en??e}catch{return m.error(new u("Failed to extract JSON translation from string"),e),e}return e};export{x as A,w as _,v as a,C as b,b as c,$ as d,z as e,y as f,S as i,N as u};
|
|
29
|
-
//# sourceMappingURL=localize-e-mss8ya.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"localize-e-mss8ya.esm.js","sources":["../../src/shared/css-reset.ts","../../src/shared/defineCustomElement.ts","../../src/shared/fragments/css-variable-map.ts","../../src/shared/controllers/async-controller.ts","../../src/shared/fragments/error-message-template.ts","../../src/shared/fragments/loading-template.ts","../../src/shared/fragments/custom-text.ts","../../src/shared/enforce-config.ts","../../src/shared/localize.ts"],"sourcesContent":["import { css } from \"lit\";\n\n// minireset.css v0.0.7 | MIT License | github.com/jgthms/minireset.css\n// prettier-ignore\nexport const cssReset = css`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}ul{list-style:none}button,input,select{margin:0}html{box-sizing:border-box}*,*::before,*::after{box-sizing:inherit}img,video{/*height:auto;*/max-width:100%}iframe{border:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}`;\n","/**\n * Defines a custom element based on its static tagName property\n */\nexport function defineCustomElement(\n CustomElementClass: CustomElementConstructor & { tagName: string },\n tagName = CustomElementClass[\"tagName\"]\n) {\n customElements.get(tagName) || customElements.define(tagName, CustomElementClass);\n}\n","export const _cssVariableMap = (variables: Record<string, string>) => {\n return Object.entries(variables)\n .map(([k, v]) => `${k}: ${v};`)\n .join(\"\\n\");\n};\n","import { ReactiveController, ReactiveControllerHost } from \"lit\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncFunction = (...args: any[]) => Promise<any>;\n\n/**\n * Creates a declarative wrapper around async operations\n * @example\n * class MyElement extends LitElement {\n * private user = new AsyncController(\n * this,\n * async ({ id }) => get(url, { id }));\n *\n * async updated(changedProperties) {\n * if (changedProperties.has(\"userId\")) {\n * await this.user.exec({ id: this.userId })\n * }\n * }\n *\n * render() {\n * const { data, loading, error } = this.user;\n * if (loading) return html`Please wait...`\n * if (error) return html`Error! <button @click=${this.user.retry}>Reload</button>`;\n * return html`My name is: ${data.name}`\n * }\n * }\n */\nexport class AsyncController<TFn extends AsyncFunction> implements ReactiveController {\n public data: Awaited<ReturnType<TFn>> | null = null;\n public loading = false;\n public error: Error | null = null;\n\n private readonly host: ReactiveControllerHost;\n private readonly asyncFn: TFn;\n private lastArgs?: Parameters<TFn>;\n\n constructor(host: ReactiveControllerHost, asyncFn: TFn) {\n (this.host = host).addController(this);\n this.asyncFn = asyncFn;\n }\n\n public async exec(...args: Parameters<TFn>): Promise<ReturnType<TFn> | null> {\n this.lastArgs = args;\n this.loading = true;\n this.host.requestUpdate();\n try {\n // TODO: prevent race condition if later invocation returns before earlier\n this.data = await this.asyncFn(...args);\n this.error = null;\n } catch (err) {\n if (err instanceof Error) {\n this.error = err;\n this.data = null;\n }\n }\n this.loading = false;\n this.host.requestUpdate();\n return this.data;\n }\n\n public async retry() {\n return this.exec(...((this.lastArgs || []) as Parameters<TFn>));\n }\n\n hostDisconnected() {\n // TODO: cancel API calls\n }\n}\n","import { html } from \"lit\";\nimport { MissingConfig, NetworkError } from \"../beam-errors\";\n\nconst strings = {\n errorTitle: `Beam encountered an error. Please try again.`,\n retry: `Retry`,\n};\n\nexport const _errorMessage = ({ error, retry }: { error: Error; retry?: (...args: never) => void }) => {\n let details = html``;\n if (error instanceof NetworkError) {\n const response = JSON.stringify(\n {\n status: error.response.status,\n statusText: error.response.statusText,\n url: error.response.url,\n body: error.body,\n },\n null,\n 4\n );\n details = html`\n <p><b>Network Response:</b></p>\n <p>${response}</p>\n `;\n }\n if (error instanceof MissingConfig) {\n details = html`\n <p><b>Missing Required Config Options:</b></p>\n <p>${error.missingConfigKeyNames.join(\", \")}</p>\n `;\n }\n return html`<div class=\"beam-error\" style=\"text-align: left\">\n <p>${strings.errorTitle} ${retry ? html` <button type=\"reset\" @click=\"${retry}\">${strings.retry}</button>` : \"\"}</p>\n <br />\n <details>\n <div style=\"white-space: pre-wrap; font-family: monospace; line-height: 1;\">\n ${details}\n <p><b>Message:</b> ${error.message || html`<i>None</i>`}</p>\n <p><b>Stack:</b> ${error.stack}</p>\n </div>\n </details>\n <br />\n <p>Help: <a href=\"https://www.beamimpact.com\">www.beamimpact.com</a></p>\n </div>`;\n};\n","import { html } from \"lit\";\n\nconst strings = {\n loading: \"\", // Default is no loading content\n};\n\nexport const _loading = () => {\n return html`<p class=\"beam-loading\">${strings.loading}</p>`;\n};\n","import { CSSResult, unsafeCSS } from \"lit\";\n\n/**\n * Create an object that can be passed to cssVariableMap\n * to define CSS variables in a style tag. The default properties\n * are the ones exposed for customization in the remote config interface.\n * @example\n * const variables = {\n * ...customizableTextJs(\"widget-header\",\n * \"widget-border-color\": \"red\"\n * };\n *\n * html`<style>:host { ${_cssVariableMap(variables)} }</style>`;\n * @returns {{[p: string]: string}}\n */\nexport const defineCustomText = (\n namespace = \"\",\n {\n fontFamily = \"inherit\",\n fontSize = \"inherit\",\n fontWeight = \"inherit\",\n textTransform = \"none\",\n marginTop = \"0\",\n lineHeight = \"inherit\",\n color = \"inherit\",\n } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n [`${prefix}-fontFamily`]: fontFamily,\n [`${prefix}-fontSize`]: fontSize,\n [`${prefix}-fontWeight`]: fontWeight,\n [`${prefix}-textTransform`]: textTransform,\n [`${prefix}-marginTop`]: marginTop,\n [`${prefix}-lineHeight`]: lineHeight,\n [`${prefix}-color`]: color,\n };\n};\n\n/**\n * Returns a string that defines css properties based on variables,\n * which can be used in a css`` template. The default properties are the\n * ones exposed for customization in the remote config interface.\n * @example\n * css`.widget-header { ${customizableTextCss(\"widget-header\")} border: none; }`\n * @returns {CSSResult}\n */\nexport const useCustomText = (\n namespace = \"\",\n {\n fontFamily = \"inherit\",\n fontSize = \"inherit\",\n fontWeight = \"inherit\",\n textTransform = \"none\",\n marginTop = \"0\",\n lineHeight = \"inherit\",\n color = \"inherit\",\n } = {}\n): CSSResult => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return unsafeCSS(`\\\n font-family: var(${prefix}-fontFamily, ${fontFamily});\n font-size: var(${prefix}-fontSize, ${fontSize});\n font-weight: var(${prefix}-fontWeight, ${fontWeight});\n text-transform: var(${prefix}-textTransform, ${textTransform});\n margin-top: var(${prefix}-marginTop, ${marginTop});\n line-height: var(${prefix}-lineHeight, ${lineHeight});\n color: var(${prefix}-color, ${color});\n `);\n};\n\n/**\n * Same as useCustomText except returns an object that can be passed to styleMap\n */\nexport const useCustomTextMap = (\n namespace = \"\",\n { fontSize = \"inherit\", fontWeight = \"inherit\", textTransform = \"none\", marginTop = \"0\", lineHeight = \"inherit\" } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n fontSize: `var(${prefix}-fontSize, ${fontSize})`,\n fontWeight: `var(${prefix}-fontWeight, ${fontWeight})`,\n textTransform: `var(${prefix}-textTransform, ${textTransform})`,\n marginTop: `var(${prefix}-marginTop, ${marginTop})`,\n lineHeight: `var(${prefix}-lineHeight, ${lineHeight})`,\n };\n};\n","import { MissingConfig } from \"./beam-errors\";\nimport { logger } from \"./logger\";\n\nexport function enforceConfig<T>(keys: (keyof T)[], input: unknown): input is Required<T> {\n const missingKeys: string[] = [];\n const check = input as Record<string | number | symbol, unknown>;\n for (const key of keys) {\n if (check[key] == null) {\n missingKeys.push(key as string);\n }\n }\n if (missingKeys.length > 0) {\n logger.error(\"Beam Impact - Missing Required Config Values:\\n\", missingKeys.join(\", \"), input);\n throw new MissingConfig(missingKeys);\n }\n return true;\n}\n","import { LANGUAGES } from \"../api-sdk/types\";\nimport { logger } from \"./logger\";\nimport { BeamError } from \"./beam-errors\";\n\n/**\n * User-provided strings may include embedded translations in JSON form\n * This function extracts the string for the provided language\n * If it fails to parse, or the string is not json-like, it returns the whole string\n * TODO: consider returning unsafeHtml() or adding an option for it\n */\nconst localizeUserString = (lang: LANGUAGES, str: string): string => {\n const isJson = str.startsWith(\"{\");\n if (isJson) {\n try {\n const json = JSON.parse(str);\n return json[lang] ?? json[\"en\"] ?? str;\n } catch (err) {\n logger.error(new BeamError(\"Failed to extract JSON translation from string\"), str);\n return str;\n }\n }\n return str;\n};\n\nexport { localizeUserString };\n"],"names":["cssReset","css","defineCustomElement","CustomElementClass","tagName","_cssVariableMap","variables","k","v","AsyncController","host","asyncFn","args","err","strings","_errorMessage","error","retry","details","html","NetworkError","response","MissingConfig","_loading","defineCustomText","namespace","fontFamily","fontSize","fontWeight","textTransform","marginTop","lineHeight","color","prefix","useCustomText","unsafeCSS","enforceConfig","keys","input","missingKeys","check","key","logger","localizeUserString","lang","str","json","BeamError"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{B as w,N as d}from"./beam-errors-l02WBee5.esm.js";import{l as p}from"./logger-ad87ovol.esm.js";var C="1.29.0-beta.7",E={"@lit/react":"1.0.0","@lukeed/uuid":"2.0.0","@shoelace-style/shoelace":"2.11.2",lit:"2.6.1","lodash-es":"4.17.21","lucide-static":"0.292.0"};async function v(o,r){const c={method:"GET",...r,headers:{"Content-Type":"application/json",Accept:"application/json","X-Beam-Client":"WebSDK","X-Beam-Client-Version":C,...r?.headers},preflightContinue:!0,mode:r?.mode||"cors",body:r?.body!=null?r.body:void 0};let n;try{n=await fetch(o,c)}catch(e){const t=new w(`Network call failed (${c?.method.toUpperCase()} ${o})`);throw t.cause=e,p.error(t,o),t}let s,i;try{i=await n.text(),i&&(s=JSON.parse(i))}catch(e){let t=e;throw e instanceof SyntaxError&&(t=new d(n,s,`Response invalid. Expected JSON. Received: "${i}"`),t.cause=e),p.error(t),t}if(!n.ok){const e=new d(n,s,"Response was not OK");throw p.error(e),e}return s}const h="https://production-central-backend-ne.beamimpact.com",O={en:"en",fr:"fr",de:"de",es:"es",it:"it",pl:"pl"},a=(o,r,c)=>({[o]:async function({headers:n={},baseUrl:s=h,apiRoot:i="/api/v3",pathParams:e={},queryParams:t={},requestBody:m}){const f=Object.entries(e).reduce((N,[S,b])=>N.replace(`{${S}}`,b),o),u=JSON.parse(JSON.stringify(t)),l=new URLSearchParams(u).toString(),y=s+i+f+(l&&`?${l}`),g={headers:n,method:r,body:JSON.stringify(m)};return v(y,g)}})[o],R=a("/chain/{chainId}/nonprofits","get"),T=a("/impact","get"),U=a("/chain/{chainId}/cumulativeImpact","get"),k=a("/selectNonprofit","post"),A=a("/transaction","post"),B=a("/transaction/{transactionId}","put"),I=a("/cart","post"),J=a("/chain/findEligibleNonprofitsForCart","post");export{h as D,O as S,A as a,T as b,J as c,k as d,B as e,U as f,R as g,E as h,I as p};
|
|
2
|
-
//# sourceMappingURL=routes-Pca6QK46.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as g}from"./lodash-ZxBiuGue.esm.js";import{D as w,p as y}from"./routes-Pca6QK46.esm.js";import{B as E}from"./beam-errors-l02WBee5.esm.js";import{B as i}from"./cart-contents-h60geKWa.esm.js";import{a as b,s as h}from"./cookies-BnIoXWd0.esm.js";import{B as A}from"./events-rRSQYdP1.esm.js";import{c as K}from"./local-storage-Rrnk_Dg-.esm.js";import{g as S}from"./remote-session-mmQFfNd6.esm.js";async function _(e,t){try{const a=K({apiKey:e.apiKey}),m=e.baseUrl??w,r=a.getItemJson("cart"),o=await b(i)??null,n=S(e)??void 0;if(g({...t,beamCartId:o},r)||t.itemCount===0&&(!o||r?.itemCount===0))return;const{cartId:c,subtotal:d,itemCount:u,currencyCode:p,content:{items:C=[]}={},schema:l={source:"generic"}}=t,I=await y({baseUrl:m,headers:{authorization:`Api-Key ${e.apiKey}`},requestBody:{beamCartId:o,storeId:e.storeId,remoteSessionId:n,cartId:c,subtotal:d,itemCount:u,currencyCode:p}}),{beamCartId:s,expiresAt:f}=I;await h({name:i,domain:e.domain,value:s,expires:new Date(f).getTime()}),a.setItemJson("cart",{...t,beamCartId:s});const B={schema:l,content:{items:C}};window.dispatchEvent(new A(B))}catch(a){throw new E("Could not update cart in Beam",{cause:a})}}export{_ as x};
|
|
2
|
-
//# sourceMappingURL=update-cart-Lh4D5-q_.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-cart-Lh4D5-q_.esm.js","sources":["../../src/integrations/cart/update-cart.ts"],"sourcesContent":["import isEqual from \"lodash-es/isEqual\";\nimport { DEFAULT_BASE_URL } from \"../../api-sdk/constants\";\nimport { BeamBaseAPIConfig } from \"../../api-sdk/types\";\nimport { postCart } from \"../../api-sdk/v3/routes\";\nimport { BeamError } from \"../../shared/beam-errors\";\nimport { BEAM_CART_COOKIE_NAME, TBeamCartLocalStorage, TCartApi } from \"../../shared/cart-contents\";\nimport { getCookieValue, setCookieValue } from \"../../shared/cookies\";\nimport { BeamCartChangeEvent } from \"../../shared/events\";\nimport { createScopedLocalStorage } from \"../../shared/local-storage\";\nimport { getRemoteSession } from \"../../shared/remote-session\";\n\nexport type BeamCartAPIConfig = BeamBaseAPIConfig & {\n storeId: number;\n domain?: string; // Domain to set cookies on\n};\n\nexport type BeamCartValues = {\n cartId?: string; // External (partner) cart ID\n itemCount?: number;\n subtotal?: number;\n currencyCode?: string;\n} & Partial<TCartApi>;\n\n/**\n * Sends cart information to Beam\n * @side-effects Sets beam_cart cookie, set cart data in localstorage\n * @example\n * const BeamConfig = { apiKey: 'abc-123' }\n * const { beamCartId } = await updateCart(BeamConfig, { beamCartId, itemCount, subtotal, currencyCode })\n * */\nasync function updateCart(config: BeamCartAPIConfig, cartValues: BeamCartValues) {\n try {\n const localStorage = createScopedLocalStorage({ apiKey: config.apiKey });\n const baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;\n\n // The cart cache is used to detect changes after page refreshes / across tabs\n const cachedCart: TBeamCartLocalStorage | null = localStorage.getItemJson(\"cart\");\n // The Beam cart cookie is used to identify the cart across subdomains\n // Use explicit null if empty because API requires it\n const beamCartId: string | null = (await getCookieValue(BEAM_CART_COOKIE_NAME)) ?? null;\n // Remote session ID (ie, device ID from an A/B testing tool) will be linked to the cart\n const remoteSessionId: string | undefined = getRemoteSession(config) ?? undefined;\n\n // Early return conditions. Skip sending cart to Beam if any apply:\n // 1. The cart has not changed\n // 2. Cart is empty, unless the cart was not empty before\n if (\n isEqual({ ...cartValues, beamCartId }, cachedCart) || // cart has not changed, OR\n (cartValues.itemCount === 0 && // nothing in current cart, AND\n (!beamCartId || cachedCart?.itemCount === 0)) // no/expired prev cart or prev cart was empty\n ) {\n return;\n }\n\n const {\n cartId,\n subtotal,\n itemCount,\n currencyCode,\n content: { items = [] } = {},\n schema = { source: \"generic\" },\n } = cartValues;\n\n const response = await postCart({\n baseUrl,\n headers: {\n authorization: `Api-Key ${config.apiKey}`,\n },\n requestBody: {\n beamCartId, // backwards compat: explicitly sending null here is required to get initial beamCartId\n storeId: config.storeId,\n remoteSessionId,\n cartId,\n subtotal,\n itemCount,\n currencyCode,\n },\n });\n\n // Response will contain a new beamCartId if one was not provided, or old one expired\n const { beamCartId: newBeamCartId, expiresAt } = response;\n\n await setCookieValue({\n name: BEAM_CART_COOKIE_NAME,\n domain: config.domain,\n value: newBeamCartId,\n // If we don't set an expiration, the cookie will be cleared when the tab is closed\n expires: new Date(expiresAt).getTime(),\n });\n\n localStorage.setItemJson(\"cart\", {\n ...cartValues,\n beamCartId: newBeamCartId,\n });\n\n const eventDetail: TCartApi = {\n schema: schema as any, // TS union type can't figure out what variant applies here\n content: {\n items: items as any,\n },\n };\n window.dispatchEvent(new BeamCartChangeEvent(eventDetail));\n } catch (err) {\n throw new BeamError(\"Could not update cart in Beam\", { cause: err });\n }\n}\n\nexport { updateCart };\n"],"names":["updateCart","config","cartValues","localStorage","createScopedLocalStorage","baseUrl","DEFAULT_BASE_URL","cachedCart","beamCartId","getCookieValue","BEAM_CART_COOKIE_NAME","remoteSessionId","getRemoteSession","isEqual","cartId","subtotal","itemCount","currencyCode","items","schema","response","postCart","newBeamCartId","expiresAt","setCookieValue","eventDetail","BeamCartChangeEvent","err","BeamError"],"mappings":"kZA8BA,eAAeA,EAAWC,EAA2BC,EAA4B,CAC/E,GAAI,CACF,MAAMC,EAAeC,EAAyB,CAAE,OAAQH,EAAO,MAAO,CAAC,EACjEI,EAAUJ,EAAO,SAAWK,EAG5BC,EAA2CJ,EAAa,YAAY,MAAM,EAG1EK,EAA6B,MAAMC,EAAeC,CAAqB,GAAM,KAE7EC,EAAsCC,EAAiBX,CAAM,GAAK,OAKxE,GACEY,EAAQ,CAAE,GAAGX,EAAY,WAAAM,CAAW,EAAGD,CAAU,GAChDL,EAAW,YAAc,IACvB,CAACM,GAAcD,GAAY,YAAc,GAE5C,OAGF,KAAM,CACJ,OAAAO,EACA,SAAAC,EACA,UAAAC,EACA,aAAAC,EACA,QAAS,CAAE,MAAAC,EAAQ,EAAG,EAAI,CAAC,EAC3B,OAAAC,EAAS,CAAE,OAAQ,SAAU,CAC/B,EAAIjB,EAEEkB,EAAW,MAAMC,EAAS,CAC9B,QAAAhB,EACA,QAAS,CACP,cAAe,WAAWJ,EAAO,MAAM,EACzC,EACA,YAAa,CACX,WAAAO,EACA,QAASP,EAAO,QAChB,gBAAAU,EACA,OAAAG,EACA,SAAAC,EACA,UAAAC,EACA,aAAAC,CACF,CACF,CAAC,EAGK,CAAE,WAAYK,EAAe,UAAAC,CAAU,EAAIH,EAEjD,MAAMI,EAAe,CACnB,KAAMd,EACN,OAAQT,EAAO,OACf,MAAOqB,EAEP,QAAS,IAAI,KAAKC,CAAS,EAAE,QAAQ,CACvC,CAAC,EAEDpB,EAAa,YAAY,OAAQ,CAC/B,GAAGD,EACH,WAAYoB,CACd,CAAC,EAED,MAAMG,EAAwB,CAC5B,OAAQN,EACR,QAAS,CACP,MAAOD,CACT,CACF,EACA,OAAO,cAAc,IAAIQ,EAAoBD,CAAW,CAAC,CAC3D,OAASE,EAAK,CACZ,MAAM,IAAIC,EAAU,gCAAiC,CAAE,MAAOD,CAAI,CAAC,CACrE,CACF"}
|