@beamimpact/web-sdk 1.29.0-beta.6 → 1.29.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.
Files changed (82) hide show
  1. package/README.md +6 -3
  2. package/dist/chunks/{_share-dialog-dependencies-hd9fP3Yj.esm.js → _share-dialog-dependencies-aJgTOo_o.esm.js} +2 -2
  3. package/dist/chunks/_share-dialog-dependencies-aJgTOo_o.esm.js.map +1 -0
  4. package/dist/chunks/{_share-dialog-dependencies-6rpTDMSM.esm.js → _share-dialog-dependencies-qA2x2Hci.esm.js} +2 -2
  5. package/dist/chunks/_share-dialog-dependencies-qA2x2Hci.esm.js.map +1 -0
  6. package/dist/chunks/index-4z2o94Rr.esm.js +2 -0
  7. package/dist/chunks/index-4z2o94Rr.esm.js.map +1 -0
  8. package/dist/chunks/index-LW-Uv5ZW.esm.js +2 -0
  9. package/dist/chunks/index-LW-Uv5ZW.esm.js.map +1 -0
  10. package/dist/chunks/index-lFO9cyBH.esm.js +2 -0
  11. package/dist/chunks/index-lFO9cyBH.esm.js.map +1 -0
  12. package/dist/chunks/index-p4QxNz-z.esm.js +2 -0
  13. package/dist/chunks/index-p4QxNz-z.esm.js.map +1 -0
  14. package/dist/chunks/index-sHFANQ0S.esm.js +2 -0
  15. package/dist/chunks/index-sHFANQ0S.esm.js.map +1 -0
  16. package/dist/chunks/{order-page-94iMCraa.esm.js → order-page-ROlgTyhA.esm.js} +2 -2
  17. package/dist/chunks/{order-page-94iMCraa.esm.js.map → order-page-ROlgTyhA.esm.js.map} +1 -1
  18. package/dist/chunks/{order-page-STAG2OhW.esm.js → order-page-eEmqUebY.esm.js} +2 -2
  19. package/dist/chunks/{order-page-STAG2OhW.esm.js.map → order-page-eEmqUebY.esm.js.map} +1 -1
  20. package/dist/chunks/routes-52a2dOOE.esm.js +2 -0
  21. package/dist/chunks/{routes-Xnsh4jsO.esm.js.map → routes-52a2dOOE.esm.js.map} +1 -1
  22. package/dist/chunks/update-cart-c__LUZFg.esm.js +2 -0
  23. package/dist/chunks/update-cart-c__LUZFg.esm.js.map +1 -0
  24. package/dist/components/community-impact.esm.js +1 -1
  25. package/dist/components/community-impact.js +1 -1
  26. package/dist/components/cumulative-impact.esm.js +1 -1
  27. package/dist/components/cumulative-impact.js +1 -1
  28. package/dist/components/impact-overview.esm.js +1 -1
  29. package/dist/components/impact-overview.js +1 -1
  30. package/dist/components/index.esm.js +1 -1
  31. package/dist/components/index.js +1 -1
  32. package/dist/components/post-purchase.d.ts +1 -1
  33. package/dist/components/post-purchase.esm.js +1 -1
  34. package/dist/components/post-purchase.js +1 -1
  35. package/dist/components/redeem-transaction.d.ts +1 -1
  36. package/dist/components/redeem-transaction.esm.js +1 -1
  37. package/dist/components/redeem-transaction.js +1 -1
  38. package/dist/components/select-nonprofit.d.ts +1 -1
  39. package/dist/components/select-nonprofit.esm.js +1 -1
  40. package/dist/components/select-nonprofit.esm.js.map +1 -1
  41. package/dist/components/select-nonprofit.js +1 -1
  42. package/dist/components/select-nonprofit.js.map +1 -1
  43. package/dist/components/shopify.esm.js +1 -1
  44. package/dist/components/shopify.js +1 -1
  45. package/dist/index.esm.js +1 -1
  46. package/dist/index.js +1 -1
  47. package/dist/integrations/cart.esm.js +1 -1
  48. package/dist/integrations/cart.js +1 -1
  49. package/dist/integrations/index.esm.js +1 -1
  50. package/dist/integrations/index.js +1 -1
  51. package/dist/integrations/shopify.esm.js +1 -1
  52. package/dist/integrations/shopify.js +1 -1
  53. package/dist/react/community-impact.esm.js +1 -1
  54. package/dist/react/community-impact.js +1 -1
  55. package/dist/react/cumulative-impact.esm.js +1 -1
  56. package/dist/react/cumulative-impact.js +1 -1
  57. package/dist/react/impact-overview.esm.js +1 -1
  58. package/dist/react/impact-overview.js +1 -1
  59. package/dist/react/index.esm.js +1 -1
  60. package/dist/react/index.js +1 -1
  61. package/dist/react/post-purchase.esm.js +1 -1
  62. package/dist/react/post-purchase.js +1 -1
  63. package/dist/react/redeem-transaction.esm.js +1 -1
  64. package/dist/react/redeem-transaction.js +1 -1
  65. package/dist/react/select-nonprofit.esm.js +1 -1
  66. package/dist/react/select-nonprofit.js +1 -1
  67. package/package.json +8 -1
  68. package/dist/chunks/_share-dialog-dependencies-6rpTDMSM.esm.js.map +0 -1
  69. package/dist/chunks/_share-dialog-dependencies-hd9fP3Yj.esm.js.map +0 -1
  70. package/dist/chunks/index-Hm4mQjnj.esm.js +0 -2
  71. package/dist/chunks/index-Hm4mQjnj.esm.js.map +0 -1
  72. package/dist/chunks/index-P56wvflO.esm.js +0 -2
  73. package/dist/chunks/index-P56wvflO.esm.js.map +0 -1
  74. package/dist/chunks/index-PIFZakQ8.esm.js +0 -2
  75. package/dist/chunks/index-PIFZakQ8.esm.js.map +0 -1
  76. package/dist/chunks/index-PYdJGNef.esm.js +0 -2
  77. package/dist/chunks/index-PYdJGNef.esm.js.map +0 -1
  78. package/dist/chunks/index-gxb1Rhtv.esm.js +0 -2
  79. package/dist/chunks/index-gxb1Rhtv.esm.js.map +0 -1
  80. package/dist/chunks/routes-Xnsh4jsO.esm.js +0 -2
  81. package/dist/chunks/update-cart-K-xxdX-s.esm.js +0 -2
  82. package/dist/chunks/update-cart-K-xxdX-s.esm.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"select-nonprofit.js","sources":["../../src/components/select-nonprofit/strings.ts","../../src/components/select-nonprofit/index.ts"],"sourcesContent":["export const strings = {\n en: {\n beamAttribution: () => `Powered by Beam`,\n ctaTitle: () => `Choose your impact`,\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Select a nonprofit and ${donationPercentage}% of your purchase will be donated, at no extra cost.`,\n inlineSeparator: () => `: `,\n },\n fr: {\n beamAttribution: () => `Optimisé par Beam`,\n ctaTitle: () => `Choisissez votre cause`,\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Choisissez un organisme à but non lucratif et ${donationPercentage} % lui sera versé en votre nom, sans frais supplémentaires.`,\n inlineSeparator: () => ` : `,\n },\n de: {\n beamAttribution: () => `Unterstützt von Beam`,\n ctaTitle: () => `Wähle deinen Impact`,\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Wähle eine der gemeinnützigen Organisationen und spende ${donationPercentage}% deines Einkaufs ohne zusätzliche Kosten`,\n inlineSeparator: () => `: `,\n },\n es: {\n beamAttribution: () => \"Ofrecido por Beam\",\n ctaTitle: () => \"Elige tu contribución\",\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Elige una organización sin fines de lucro y donaremos ${donationPercentage}% de tu compra sin coste adicional.`,\n inlineSeparator: () => \": \",\n },\n it: {\n beamAttribution: () => \"Gestito da Beam\",\n ctaTitle: () => \"Scegli dove fare la differenza\",\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Seleziona un'organizzazione no-profit a cui devolvere l’${donationPercentage}% del tuo acquisto, senza costi aggiuntivi`,\n inlineSeparator: () => \": \",\n },\n pl: {\n beamAttribution: () => `Wspierany przez Beam`,\n ctaTitle: () => `Wybierz inicjatywę, którą chcesz wesprzeć`,\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Wybierz organizację, której przekażesz ${donationPercentage}% wartości Twoich zakupów – bez żadnych dodatkowych kosztów!`,\n inlineSeparator: () => `: `,\n },\n};\n","import { css, html, LitElement, PropertyValues } from \"lit\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { property } from \"lit/decorators/property.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES } from \"../../api-sdk/constants\";\nimport \"../../shared/components/progress-bar\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { _loading } from \"../../shared/fragments/loading-template\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { MissingConfig } from \"../../shared/beam-errors\";\nimport { TNumericId } from \"../../shared/types\";\nimport { createScopedLocalStorage } from \"../../shared/local-storage\";\nimport { postChainEligibleNonprofitsForCart, postSelectNonprofit } from \"../../api-sdk/v3/routes\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { BeamCartChangeEvent, BeamNonprofitSelectEvent } from \"../../shared/events\";\nimport { getCookieValue } from \"../../shared/cookies\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { progressBarConfigDefaults } from \"../../shared/components/progress-bar\";\nimport { cssResponsiveUtils } from \"../../shared/responsive\";\nimport { BEAM_CART_COOKIE_NAME, TBeamCartLocalStorage, TCart } from \"../../shared/cart-contents\";\nimport { strings } from \"./strings\";\n\ninterface RequiredConfig {\n apiKey: string;\n chainId: TNumericId;\n storeId: TNumericId;\n}\n\nexport class BeamSelectNonprofit extends LitElement {\n static tagName = \"beam-select-nonprofit\";\n\n @property({ type: String }) public baseUrl: string = DEFAULT_BASE_URL;\n\n @property({ type: String }) public apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) public chainId?: RequiredConfig[\"chainId\"];\n\n @property({ type: Number, reflect: true }) public storeId?: RequiredConfig[\"storeId\"];\n\n @property({ type: String }) public countryCode?: string;\n\n @property({ type: String }) public postalCode?: string;\n\n @property({ attribute: false }) public cart?: TCart;\n\n @property({ type: Number, reflect: true }) public selectedNonprofitId: TNumericId | null = null;\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public debug = false;\n\n private enableNonprofitDeselection = false;\n\n private selectionId?: string;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n private getChainNonprofits = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"chainId\"], this)) {\n throw new MissingConfig();\n }\n\n const cart: any = this.cart?.schema\n ? {\n schema: this.cart?.schema,\n content: this.cart?.content,\n }\n : undefined;\n\n // We use a POST method because we send a nested JSON with data that we don't want to serialize/expose in URL\n const res = await postChainEligibleNonprofitsForCart({\n baseUrl: this.baseUrl,\n apiRoot: \"/api/v3\",\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n requestBody: {\n chainId: this.chainId,\n storeId: this.storeId,\n widgetName: \"select-nonprofit\",\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n version: \"1.0.0\",\n lang: this.configLang,\n cart,\n },\n });\n\n this.enableNonprofitDeselection = !!res.config.enableNonprofitDeselection;\n\n // Reset selection if list doesn't include the current selected nonprofit\n if (this.selectedNonprofitId && !res.nonprofits.map((np) => np.nonprofit.id).includes(this.selectedNonprofitId)) {\n this.selectedNonprofitId = null;\n this.dispatchEvent(\n new BeamNonprofitSelectEvent({\n selectedNonprofitId: this.selectedNonprofitId,\n selectionId: this.selectionId,\n nonprofitName: null,\n })\n );\n }\n\n // If store ID was not provided, get the store ID from response here\n if (res.store?.id && res.store.id !== this.storeId) {\n this.storeId = res.store.id;\n }\n\n this.localStorage.setItemJson(\"chainNonprofits\", {\n createdAt: new Date(),\n data: res,\n });\n\n return res;\n };\n\n private postSelectNonprofit = async ({ selectedNonprofitId }: { selectedNonprofitId: TNumericId | null }) => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"chainId\", \"storeId\"], this)) {\n throw new MissingConfig();\n }\n const cartId = this.getExternalCartId();\n const beamCartId = this.getBeamCartId();\n const result = await postSelectNonprofit({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n requestBody: {\n nonprofitId: selectedNonprofitId,\n selectionId: this.selectionId,\n storeId: this.storeId,\n cartId,\n beamCartId,\n },\n });\n\n this.selectionId = result?.selectionId;\n this.localStorage.setItem(\"transaction\", this.selectionId);\n this.localStorage.setItem(\"nonprofit\", selectedNonprofitId);\n\n await this.updateComplete;\n\n const selectedNonprofit = this.getNonprofitById(selectedNonprofitId);\n\n this.dispatchEvent(\n new BeamNonprofitSelectEvent({\n selectedNonprofitId,\n selectionId: this.selectionId,\n nonprofitName: selectedNonprofit?.nonprofit?.name,\n })\n );\n };\n\n private nonprofitListDataController = new AsyncController<typeof this.getChainNonprofits>(\n this,\n this.getChainNonprofits\n );\n\n private selectionDataController = new AsyncController<typeof this.postSelectNonprofit>(\n this,\n this.postSelectNonprofit\n );\n\n private localStorage = createScopedLocalStorage(this as LitElement & RequiredConfig);\n\n private getNonprofitById(selectedNonprofitId: number | null) {\n if (!selectedNonprofitId) return null;\n return this.nonprofitListDataController?.data?.nonprofits.find((np) => np.nonprofit.id === selectedNonprofitId);\n }\n\n private handleCartChange = (evt: BeamCartChangeEvent) => {\n this.cart = evt.detail;\n };\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(BeamCartChangeEvent.eventName, this.handleCartChange as EventListener);\n }\n\n async firstUpdated(_changedProperties: PropertyValues) {\n await this.restoreStateFromCache();\n }\n\n async updated(previousPropertyValues: PropertyValues) {\n // Reload nonprofit list on change of any of these props:\n // Also fires on first load as props go from undefined => value\n const requireNewDataProps = [\n \"chainId\",\n \"baseUrl\",\n \"storeId\",\n \"apiKey\",\n \"countryCode\",\n \"postalCode\",\n \"cart\",\n \"lang\",\n ];\n for (const prop of requireNewDataProps) {\n if (previousPropertyValues.has(prop)) {\n await this.nonprofitListDataController.exec();\n break;\n }\n }\n }\n\n disconnectedCallback() {\n window.removeEventListener(BeamCartChangeEvent.eventName, this.handleCartChange as EventListener);\n super.disconnectedCallback();\n }\n\n private getExternalCartId() {\n return this.localStorage.getItemJson<TBeamCartLocalStorage>(\"cart\")?.cartId ?? getCookieValue(\"cart\");\n }\n\n private getBeamCartId() {\n return getCookieValue(BEAM_CART_COOKIE_NAME);\n }\n\n private async restoreStateFromCache() {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"chainId\", \"storeId\"], this)) throw new MissingConfig();\n try {\n // Restore previous selected nonprofit\n this.selectedNonprofitId = parseInt(this.localStorage.getItem(\"nonprofit\") || \"\") || null;\n // Restore previous transaction/selection\n // TODO: add max TTL for this cache item of 20 days [WEB-100]\n this.selectionId = this.localStorage.getItem(\"transaction\") ?? undefined;\n this.cart = this.localStorage.getItemJson<TBeamCartLocalStorage>(\"cart\") ?? undefined;\n\n // Try to restore nonprofit list if we have data and it's not too old\n // list will continue to refresh async and replace this data when ready\n const { createdAt = 0, data } =\n this.localStorage.getItemJson<{ createdAt: string; data: any }>(\"chainNonprofits\") || {};\n const cacheTtl = 2 * 60 * 60 * 1000;\n if (new Date(createdAt).valueOf() + cacheTtl > new Date().valueOf()) {\n this.nonprofitListDataController.data = data;\n this.nonprofitListDataController.loading = false;\n }\n\n // Create a new selection ID for the session (e.g., if restoring nonprofit after a completed order)\n if (this.selectedNonprofitId && !this.selectionId) {\n await this.selectionDataController.exec({ selectedNonprofitId: this.selectedNonprofitId });\n }\n\n if (this.selectedNonprofitId) {\n const selectedNonprofit = this.getNonprofitById(this.selectedNonprofitId);\n this.dispatchEvent(\n new BeamNonprofitSelectEvent({\n selectedNonprofitId: this.selectedNonprofitId,\n selectionId: this.selectionId,\n nonprofitName: selectedNonprofit?.nonprofit?.name,\n })\n );\n }\n } catch (err) {\n // ignore cache retrieval error and continue to fetch data\n }\n }\n\n /**\n * Factory for selection event handler\n *\n * Nonprofit selector implements radio-button semantics:\n * * If nothing is selected, tabbing into selector selects first card\n * * Arrow keys changes focus between cards, but doesn't select\n * * Enter/Space sets selection\n * * If a nonprofit is selected, arrow keys change focus AND selection\n * * Click sets selection\n * @param {number} id\n * @param {number} index\n * @param {{id: number}[]} nonprofits\n * @returns {(evt: Event) => void}\n */\n private makeHandleSelect =\n (id: number, index: number, nonprofits: { nonprofit: { id: number } }[]) => async (evt: Event) => {\n const currentId = this.selectedNonprofitId;\n if (evt instanceof KeyboardEvent) {\n let nextFocus = null;\n switch (evt.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n if (index === 0) {\n nextFocus = nonprofits[nonprofits.length - 1];\n } else {\n nextFocus = nonprofits[index - 1];\n }\n evt.preventDefault();\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n if (index === nonprofits.length - 1) {\n nextFocus = nonprofits[0];\n } else {\n nextFocus = nonprofits[index + 1];\n }\n evt.preventDefault();\n break;\n case \"Enter\":\n case \" \":\n evt.preventDefault();\n break; // continue to toggle-selection block below\n default:\n return;\n }\n if (nextFocus) {\n if (currentId != null) {\n this.selectedNonprofitId = nextFocus.nonprofit.id;\n }\n const focusTarget = this.renderRoot.querySelector(`[data-value=\"${nextFocus.nonprofit.id}\"]`) as HTMLElement;\n if (focusTarget !== null) {\n focusTarget.tabIndex = 0;\n focusTarget.focus();\n }\n return;\n }\n }\n // Handle selection with click or Enter/Space key\n const targetEl = evt.currentTarget;\n if (targetEl instanceof HTMLElement) {\n if (currentId === id) {\n if (this.enableNonprofitDeselection) {\n this.selectedNonprofitId = null; // unset\n } else {\n return;\n }\n } else {\n this.selectedNonprofitId = id;\n }\n }\n await this.selectionDataController.exec({ selectedNonprofitId: this.selectedNonprofitId });\n };\n\n public get cssVariables() {\n const defaults = {\n \"--beam-fontFamily\": \"inherit\",\n \"--beam-fontSize\": \"inherit\",\n \"--beam-textColor\": \"inherit\",\n \"--beam-backgroundColor\": \"inherit\",\n ...progressBarConfigDefaults,\n \"--beam-SelectNonprofit-title-textAlign\": \"inherit\",\n \"--beam-SelectNonprofit-description-textAlign\": \"inherit\",\n \"--beam-SelectNonprofit-maxWidth\": \"800px\",\n \"--beam-SelectNonprofit-options-marginTop\": \"0px\",\n \"--beam-SelectNonprofit-options-iconHeight\": \"24px\",\n \"--beam-SelectNonprofit-options-padding\": \"10px\",\n \"--beam-SelectNonprofit-options-borderRadius\": \"0px\",\n \"--beam-SelectNonprofit-options-borderColor\": \"currentColor\",\n \"--beam-SelectNonprofit-options--selected-borderColor\": \"currentColor\",\n \"--beam-SelectNonprofit-options-backgroundColor\": \"transparent\",\n \"--beam-SelectNonprofit-options-gap\": \"8px\",\n \"--beam-SelectNonprofit-options--selected-backgroundColor\": \"currentColor\",\n \"--beam-SelectNonprofit-details-marginTop\": \"10px\",\n \"--beam-SelectNonprofit-details-borderRadius\": \"0px\",\n \"--beam-SelectNonprofit-details-borderColor\": \"currentColor\",\n \"--beam-SelectNonprofit-details-backgroundColor\": \"inherit\",\n ...defineCustomText(\"--beam-SelectNonprofit-title\", {\n fontSize: \"1.25em\",\n fontWeight: \"bold\",\n }),\n ...defineCustomText(\"--beam-SelectNonprofit-title-inline\", {\n fontWeight: \"bold\",\n }),\n \"--beam-SelectNonprofit-title-inline-textTransform\": \"none\",\n ...defineCustomText(\"--beam-SelectNonprofit-description\", {\n marginTop: \"0.5em\",\n }),\n ...defineCustomText(\"--beam-SelectNonprofit-description-inline\"),\n ...defineCustomText(\"--beam-SelectNonprofit-details-cause\", {\n fontSize: \"0.85em\",\n fontWeight: \"bold\",\n }),\n ...defineCustomText(\"--beam-SelectNonprofit-details-beamAttribution\", {\n fontSize: \"0.85em\",\n }),\n ...defineCustomText(\"--beam-SelectNonprofit-details-impactDescription\", {\n fontSize: \"1em\",\n marginTop: \"10px\",\n }),\n \"--beam-SelectNonprofit-details-nonprofitName-fontWeight\": \"bold\",\n \"--beam-SelectNonprofit-details-nonprofitName-fontStyle\": \"inherit\",\n \"--beam-SelectNonprofit-details-fundingProgress-marginTop\": \"10px\",\n ...defineCustomText(\"--beam-SelectNonprofit-details-fundingProgressLabel\", {\n fontSize: \"0.85em\",\n }),\n };\n\n const remoteConfig = this.nonprofitListDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n cssResponsiveUtils,\n css`\n :host {\n display: block;\n max-width: var(--beam-SelectNonprofit-maxWidth, 800px);\n font-family: var(--beam-fontFamily);\n font-size: var(--beam-fontSize);\n background-color: var(--beam-backgroundColor);\n color: var(--beam-textColor);\n }\n\n .details-impactDescription {\n ${useCustomText(\"--beam-SelectNonprofit-details-impactDescription\")}\n }\n\n .details-impactDescription .nonprofitName {\n font-weight: var(--beam-SelectNonprofit-details-nonprofitName-fontWeight);\n font-style: var(--beam-SelectNonprofit-details-nonprofitName-fontStyle, inherit);\n }\n\n /* Note: title/description display is responsive */\n\n .title-block {\n ${useCustomText(\"--beam-SelectNonprofit-title\")}\n text-align: var(--beam-SelectNonprofit-title-textAlign);\n }\n\n .title-inline {\n line-height: var(--beam-SelectNonprofit-title-inline-lineHeight);\n font-size: var(--beam-SelectNonprofit-title-inline-fontSize);\n font-weight: var(--beam-SelectNonprofit-title-inline-fontWeight);\n color: var(--beam-SelectNonprofit-title-inline-color);\n font-family: var(--beam-SelectNonprofit-title-inline-fontFamily);\n text-transform: var(--beam-SelectNonprofit-title-inline-textTransform);\n }\n\n .description-inline {\n line-height: var(--beam-SelectNonprofit-description-inline-lineHeight);\n font-family: var(--beam-SelectNonprofit-description-inline-fontFamily);\n font-weight: var(--beam-SelectNonprofit-description-inline-fontWeight);\n color: var(--beam-SelectNonprofit-description-inline-color);\n text-transform: var(--beam-SelectNonprofit-description-inline-textTransform);\n font-size: var(--beam-SelectNonprofit-description-inline-fontSize);\n }\n\n .description {\n ${useCustomText(\"--beam-SelectNonprofit-description\")}\n text-align: var(--beam-SelectNonprofit-description-textAlign);\n }\n `,\n ];\n\n protected render() {\n const { selectedNonprofitId } = this;\n const { data, loading } = this.nonprofitListDataController;\n\n if (loading && !data) {\n // TODO: better loading UI\n return _loading(); // TODO: css theme first\n }\n if (this.nonprofitListDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.nonprofitListDataController.error });\n }\n return \"\";\n }\n if (this.selectionDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.selectionDataController.error });\n }\n // do not show error screen for interactive errors by default\n }\n const nonprofits = data?.nonprofits || [];\n const selectedNonprofit = nonprofits.find((np) => np.nonprofit.id === selectedNonprofitId) || null;\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div part=\"heading\">\n <h3 class=\"title-block d-none d-lg-block\" part=\"title\" id=\"beam-SelectNonprofit-title\">\n ${localizeUserString(this.configLang, data?.config?.web?.title || \"\") || strings[this.configLang].ctaTitle()}\n </h3>\n <p class=\"description\" part=\"description\">\n <span class=\"d-none d-lg-inline\">\n ${\n localizeUserString(this.configLang, data?.config?.web?.description || \"\") ||\n strings[this.configLang].ctaMessage()\n }\n </span>\n <div class=\"d-lg-none\">\n <span class=\"title-inline\" part=\"title\">\n ${\n (localizeUserString(this.configLang, data?.config?.web?.title || \"\") ||\n strings[this.configLang].ctaTitle()) + strings[this.configLang].inlineSeparator()\n }\n </span>\n <span class=\"description-inline\" part=\"description\">\n ${\n localizeUserString(this.configLang, data?.config?.web?.description || \"\") ||\n strings[this.configLang].ctaMessage()\n }\n </span>\n </div>\n </p>\n </div>\n <div\n class=\"options\"\n part=\"options\"\n role=\"radiogroup\"\n aria-labelledby=\"beam-SelectNonprofit-title\"\n style=\"display: flex; gap: var(--beam-SelectNonprofit-options-gap); margin: 10px 0 0 0;\"\n >\n ${repeat(\n nonprofits,\n (i) => i.nonprofit.id,\n ({ nonprofit }, index) => {\n const isSelected = selectedNonprofitId === nonprofit.id;\n const isFocusable = isSelected || (selectedNonprofit == null && index === 0);\n return html`\n <div\n class=\"option\"\n part=\"option\"\n role=\"radio\"\n tabindex=\"${isFocusable ? 0 : -1}\"\n data-value=${nonprofit.id}\n aria-checked=${isSelected}\n @click=${this.makeHandleSelect(nonprofit.id, index, nonprofits)}\n @keydown=${this.makeHandleSelect(nonprofit.id, index, nonprofits)}\n aria-label=\"${localizeUserString(this.configLang, nonprofit.cause || \"\")}\"\n style=\"${styleMap({\n cursor: \"pointer\",\n flex: \"1\",\n textAlign: \"center\",\n lineHeight: \"1\",\n marginTop: \"var(--beam-SelectNonprofit-options-marginTop, 0px)\",\n padding: \"var(--beam-SelectNonprofit-options-padding, 10px)\",\n borderWidth: \"var(--beam-SelectNonprofit-options-borderWidth, 1px)\",\n borderStyle: \"solid\",\n borderRadius: \"var(--beam-SelectNonprofit-options-borderRadius, 0)\",\n borderColor: isSelected\n ? nonprofit.causeColor || \"var(--beam-SelectNonprofit-options--selected-borderColor, currentColor)\"\n : \"var(--beam-SelectNonprofit-options-borderColor, currentColor)\",\n backgroundColor: isSelected\n ? nonprofit.causeColor ||\n \"var(--beam-SelectNonprofit-options--selected-backgroundColor, currentColor)\"\n : \"var(--beam-SelectNonprofit-options-backgroundColor, transparent)\",\n })}\"\n >\n <img\n src=\"${isSelected ? nonprofit.causeIconSelectedUrl : nonprofit.causeIconUrl}\"\n alt=\"\"\n role=\"presentation\"\n style=\"\n height: var(--beam-SelectNonprofit-options-iconHeight, 24px);\n user-select: none;\n \"\n />\n </div>\n `;\n }\n )}\n </div>\n ${\n selectedNonprofit != null\n ? html`\n <div\n class=\"details\"\n part=\"details\"\n style=\"\n border: 1px solid var(--beam-SelectNonprofit-details-borderColor);\n border-radius: var(--beam-SelectNonprofit-details-borderRadius);\n background-color: var(--beam-SelectNonprofit-details-backgroundColor);\n padding: 10px;\n margin-top: var(--beam-SelectNonprofit-details-marginTop)\n \"\n >\n <div\n style=\"display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap-reverse\"\n >\n <span\n class=\"details-cause\"\n style=\"flex: 0 1; white-space: nowrap; ${useCustomText(\"--beam-SelectNonprofit-details-cause\")}\"\n >\n ${localizeUserString(this.configLang, selectedNonprofit.nonprofit.cause || \"\")}\n </span>\n <span\n class=\"details-beamAttribution\"\n style=\"flex: 0 1; white-space: nowrap; ${useCustomText(\n \"--beam-SelectNonprofit-details-beamAttribution\"\n )}\"\n >\n ${strings[this.configLang].beamAttribution()}\n </span>\n </div>\n <p class=\"details-impactDescription\">\n ${unsafeHTML(localizeUserString(this.configLang, selectedNonprofit.impact.description || \"\"))}\n </p>\n <div\n style=\"display: flex; margin-top: var(--beam-SelectNonprofit-details-fundingProgress-marginTop); align-items: center;\"\n >\n <beam-progress-bar\n value=\"${selectedNonprofit.impact.goalProgressPercentage}\"\n style=\"flex: 1 0;\"\n ></beam-progress-bar>\n <span\n class=\"details-fundingProgressLabel\"\n style=\"${useCustomText(\n \"--beam-SelectNonprofit-details-fundingProgressLabel\"\n )} white-space: nowrap; text-align: right; flex: 0 1; margin-left: 15px;\"\n >\n ${localizeUserString(this.configLang, selectedNonprofit.impact.goalProgressText)}\n </span>\n </div>\n </div>\n `\n : \"\"\n }\n `;\n }\n}\n\ndefineCustomElement(BeamSelectNonprofit);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-select-nonprofit\": BeamSelectNonprofit;\n }\n}\n"],"names":["strings","donationPercentage","w","L","s","h","g","t","e","i","o","r","BeamSelectNonprofit","LitElement","DEFAULT_BASE_URL","enforceConfig","cart","res","postChainEligibleNonprofitsForCart","np","BeamNonprofitSelectEvent","selectedNonprofitId","cartId","beamCartId","result","postSelectNonprofit","selectedNonprofit","AsyncController","createScopedLocalStorage","evt","id","index","nonprofits","currentId","nextFocus","focusTarget","SUPPORTED_LANGUAGES","BeamCartChangeEvent","_changedProperties","previousPropertyValues","requireNewDataProps","prop","getCookieValue","BEAM_CART_COOKIE_NAME","createdAt","data","cacheTtl","defaults","progressBarConfigDefaults","defineCustomText","remoteConfig","config","_cssVariableMap","loading","_loading","_errorMessage","html","localizeUserString","repeat","nonprofit","isSelected","isFocusable","styleMap","useCustomText","unsafeHTML","cssReset","cssResponsiveUtils","css","__decorateClass","property","defineCustomElement"],"mappings":"itBAAO,MAAMA,EAAU,CACrB,GAAI,CACF,gBAAiB,IAAM,kBACvB,SAAU,IAAM,qBAChB,WAAY,CAAC,CAAE,mBAAAC,EAAqB,GAAI,EAAI,CAAA,IAC1C,0BAA0BA,CAAkB,wDAC9C,gBAAiB,IAAM,IACzB,EACA,GAAI,CACF,gBAAiB,IAAM,uBACvB,S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,CAAE,KAAM,MAAO,CAAC,GALfzD,EAKwB,UAAA,SAAA,CAAA,EAEAwD,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAPf,EAAAzD,EAOwB,UAEewD,UAAAA,CAAAA,EAAAA,EAAA,CAAjDC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAT9B,EAAAzD,EASuC,UAEfwD,UAAAA,CAAAA,EAAAA,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAXfzD,EAWwB,UAAA,cAAA,CAAA,EAEAwD,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAbf,EAAAzD,EAawB,UAEIwD,aAAAA,CAAAA,EAAAA,EAAA,CAAtCC,EAAS,CAAE,UAAW,EAAM,CAAC,CAAA,EAfnBzD,EAe4B,UAAA,OAAA,CAAA,EAEWwD,EAAA,CAAjDC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAjB9BzD,EAiBuC,UAAA,sBAAA,CAAA,EAEfwD,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAnBf,EAAAzD,EAmBwB,oBAECwD,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CArBhB,EAAAzD,EAqByB,UA8jBtC0D,QAAAA,CAAAA,EAAAA,EAAoB1D,CAAmB"}
1
+ {"version":3,"file":"select-nonprofit.js","sources":["../../src/components/select-nonprofit/strings.ts","../../src/components/select-nonprofit/index.ts"],"sourcesContent":["export const strings = {\n en: {\n beamAttribution: () => `Powered by Beam`,\n ctaTitle: () => `Choose your impact`,\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Select a nonprofit and ${donationPercentage}% of your purchase will be donated, at no extra cost.`,\n inlineSeparator: () => `: `,\n },\n fr: {\n beamAttribution: () => `Optimisé par Beam`,\n ctaTitle: () => `Choisissez votre cause`,\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Choisissez un organisme à but non lucratif et ${donationPercentage} % lui sera versé en votre nom, sans frais supplémentaires.`,\n inlineSeparator: () => ` : `,\n },\n de: {\n beamAttribution: () => `Unterstützt von Beam`,\n ctaTitle: () => `Wähle deinen Impact`,\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Wähle eine der gemeinnützigen Organisationen und spende ${donationPercentage}% deines Einkaufs ohne zusätzliche Kosten`,\n inlineSeparator: () => `: `,\n },\n es: {\n beamAttribution: () => \"Ofrecido por Beam\",\n ctaTitle: () => \"Elige tu contribución\",\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Elige una organización sin fines de lucro y donaremos ${donationPercentage}% de tu compra sin coste adicional.`,\n inlineSeparator: () => \": \",\n },\n it: {\n beamAttribution: () => \"Gestito da Beam\",\n ctaTitle: () => \"Scegli dove fare la differenza\",\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Seleziona un'organizzazione no-profit a cui devolvere l’${donationPercentage}% del tuo acquisto, senza costi aggiuntivi`,\n inlineSeparator: () => \": \",\n },\n pl: {\n beamAttribution: () => `Wspierany przez Beam`,\n ctaTitle: () => `Wybierz inicjatywę, którą chcesz wesprzeć`,\n ctaMessage: ({ donationPercentage = \"1\" } = {}) =>\n `Wybierz organizację, której przekażesz ${donationPercentage}% wartości Twoich zakupów – bez żadnych dodatkowych kosztów!`,\n inlineSeparator: () => `: `,\n },\n};\n","import { css, html, LitElement, PropertyValues } from \"lit\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { property } from \"lit/decorators/property.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES } from \"../../api-sdk/constants\";\nimport \"../../shared/components/progress-bar\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { _loading } from \"../../shared/fragments/loading-template\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { MissingConfig } from \"../../shared/beam-errors\";\nimport { TNumericId } from \"../../shared/types\";\nimport { createScopedLocalStorage } from \"../../shared/local-storage\";\nimport { postChainEligibleNonprofitsForCart, postSelectNonprofit } from \"../../api-sdk/v3/routes\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { BeamCartChangeEvent, BeamNonprofitSelectEvent } from \"../../shared/events\";\nimport { getCookieValue } from \"../../shared/cookies\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { progressBarConfigDefaults } from \"../../shared/components/progress-bar\";\nimport { cssResponsiveUtils } from \"../../shared/responsive\";\nimport { BEAM_CART_COOKIE_NAME, TBeamCartLocalStorage, TCart } from \"../../shared/cart-contents\";\nimport { strings } from \"./strings\";\n\ninterface RequiredConfig {\n apiKey: string;\n chainId: TNumericId;\n storeId: TNumericId;\n}\n\nexport class BeamSelectNonprofit extends LitElement {\n static tagName = \"beam-select-nonprofit\";\n\n @property({ type: String }) public baseUrl: string = DEFAULT_BASE_URL;\n\n @property({ type: String }) public apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) public chainId?: RequiredConfig[\"chainId\"];\n\n @property({ type: Number, reflect: true }) public storeId?: RequiredConfig[\"storeId\"];\n\n @property({ type: String }) public countryCode?: string;\n\n @property({ type: String }) public postalCode?: string;\n\n @property({ attribute: false }) public cart?: TCart;\n\n @property({ type: Number, reflect: true }) public selectedNonprofitId: TNumericId | null = null;\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public debug = false;\n\n private enableNonprofitDeselection = false;\n\n private selectionId?: string;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n private getChainNonprofits = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"chainId\"], this)) {\n throw new MissingConfig();\n }\n\n const cart: any = this.cart?.content\n ? {\n schema: this.cart?.schema,\n content: this.cart?.content,\n }\n : undefined;\n\n // We use a POST method because we send a nested JSON with data that we don't want to serialize/expose in URL\n const res = await postChainEligibleNonprofitsForCart({\n baseUrl: this.baseUrl,\n apiRoot: \"/api/v3\",\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n requestBody: {\n chainId: this.chainId,\n storeId: this.storeId,\n widgetName: \"select-nonprofit\",\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n version: \"1.0.0\",\n lang: this.configLang,\n cart,\n },\n });\n\n this.enableNonprofitDeselection = !!res.config.enableNonprofitDeselection;\n\n // Reset selection if list doesn't include the current selected nonprofit\n if (this.selectedNonprofitId && !res.nonprofits.map((np) => np.nonprofit.id).includes(this.selectedNonprofitId)) {\n this.selectedNonprofitId = null;\n this.dispatchEvent(\n new BeamNonprofitSelectEvent({\n selectedNonprofitId: this.selectedNonprofitId,\n selectionId: this.selectionId,\n nonprofitName: null,\n })\n );\n }\n\n // If store ID was not provided, get the store ID from response here\n if (res.store?.id && res.store.id !== this.storeId) {\n this.storeId = res.store.id;\n }\n\n this.localStorage.setItemJson(\"chainNonprofits\", {\n createdAt: new Date(),\n data: res,\n });\n\n return res;\n };\n\n private postSelectNonprofit = async ({ selectedNonprofitId }: { selectedNonprofitId: TNumericId | null }) => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"chainId\", \"storeId\"], this)) {\n throw new MissingConfig();\n }\n const cartId = this.getExternalCartId();\n const beamCartId = this.getBeamCartId();\n const result = await postSelectNonprofit({\n baseUrl: this.baseUrl,\n headers: {\n authorization: `Api-Key ${this.apiKey}`,\n },\n requestBody: {\n nonprofitId: selectedNonprofitId,\n selectionId: this.selectionId,\n storeId: this.storeId,\n cartId,\n beamCartId,\n },\n });\n\n this.selectionId = result?.selectionId;\n this.localStorage.setItem(\"transaction\", this.selectionId);\n this.localStorage.setItem(\"nonprofit\", selectedNonprofitId);\n\n await this.updateComplete;\n\n const selectedNonprofit = this.getNonprofitById(selectedNonprofitId);\n\n this.dispatchEvent(\n new BeamNonprofitSelectEvent({\n selectedNonprofitId,\n selectionId: this.selectionId,\n nonprofitName: selectedNonprofit?.nonprofit?.name,\n })\n );\n };\n\n private nonprofitListDataController = new AsyncController<typeof this.getChainNonprofits>(\n this,\n this.getChainNonprofits\n );\n\n private selectionDataController = new AsyncController<typeof this.postSelectNonprofit>(\n this,\n this.postSelectNonprofit\n );\n\n private localStorage = createScopedLocalStorage(this as LitElement & RequiredConfig);\n\n private getNonprofitById(selectedNonprofitId: number | null) {\n if (!selectedNonprofitId) return null;\n return this.nonprofitListDataController?.data?.nonprofits.find((np) => np.nonprofit.id === selectedNonprofitId);\n }\n\n private handleCartChange = (evt: BeamCartChangeEvent) => {\n this.cart = evt.detail;\n };\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(BeamCartChangeEvent.eventName, this.handleCartChange as EventListener);\n }\n\n async firstUpdated(_changedProperties: PropertyValues) {\n await this.restoreStateFromCache();\n }\n\n async updated(previousPropertyValues: PropertyValues) {\n // Reload nonprofit list on change of any of these props:\n // Also fires on first load as props go from undefined => value\n const requireNewDataProps = [\n \"chainId\",\n \"baseUrl\",\n \"storeId\",\n \"apiKey\",\n \"countryCode\",\n \"postalCode\",\n \"cart\",\n \"lang\",\n ];\n for (const prop of requireNewDataProps) {\n if (previousPropertyValues.has(prop)) {\n await this.nonprofitListDataController.exec();\n break;\n }\n }\n }\n\n disconnectedCallback() {\n window.removeEventListener(BeamCartChangeEvent.eventName, this.handleCartChange as EventListener);\n super.disconnectedCallback();\n }\n\n private getExternalCartId() {\n return this.localStorage.getItemJson<TBeamCartLocalStorage>(\"cart\")?.cartId ?? getCookieValue(\"cart\");\n }\n\n private getBeamCartId() {\n return getCookieValue(BEAM_CART_COOKIE_NAME);\n }\n\n private async restoreStateFromCache() {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"chainId\", \"storeId\"], this)) throw new MissingConfig();\n try {\n // Restore previous selected nonprofit\n this.selectedNonprofitId = parseInt(this.localStorage.getItem(\"nonprofit\") || \"\") || null;\n // Restore previous transaction/selection\n // TODO: add max TTL for this cache item of 20 days [WEB-100]\n this.selectionId = this.localStorage.getItem(\"transaction\") ?? undefined;\n this.cart = this.localStorage.getItemJson<TBeamCartLocalStorage>(\"cart\") ?? undefined;\n\n // Try to restore nonprofit list if we have data and it's not too old\n // list will continue to refresh async and replace this data when ready\n const { createdAt = 0, data } =\n this.localStorage.getItemJson<{ createdAt: string; data: any }>(\"chainNonprofits\") || {};\n const cacheTtl = 2 * 60 * 60 * 1000;\n if (new Date(createdAt).valueOf() + cacheTtl > new Date().valueOf()) {\n this.nonprofitListDataController.data = data;\n this.nonprofitListDataController.loading = false;\n }\n\n // Create a new selection ID for the session (e.g., if restoring nonprofit after a completed order)\n if (this.selectedNonprofitId && !this.selectionId) {\n await this.selectionDataController.exec({ selectedNonprofitId: this.selectedNonprofitId });\n }\n\n if (this.selectedNonprofitId) {\n const selectedNonprofit = this.getNonprofitById(this.selectedNonprofitId);\n this.dispatchEvent(\n new BeamNonprofitSelectEvent({\n selectedNonprofitId: this.selectedNonprofitId,\n selectionId: this.selectionId,\n nonprofitName: selectedNonprofit?.nonprofit?.name,\n })\n );\n }\n } catch (err) {\n // ignore cache retrieval error and continue to fetch data\n }\n }\n\n /**\n * Factory for selection event handler\n *\n * Nonprofit selector implements radio-button semantics:\n * * If nothing is selected, tabbing into selector selects first card\n * * Arrow keys changes focus between cards, but doesn't select\n * * Enter/Space sets selection\n * * If a nonprofit is selected, arrow keys change focus AND selection\n * * Click sets selection\n * @param {number} id\n * @param {number} index\n * @param {{id: number}[]} nonprofits\n * @returns {(evt: Event) => void}\n */\n private makeHandleSelect =\n (id: number, index: number, nonprofits: { nonprofit: { id: number } }[]) => async (evt: Event) => {\n const currentId = this.selectedNonprofitId;\n if (evt instanceof KeyboardEvent) {\n let nextFocus = null;\n switch (evt.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n if (index === 0) {\n nextFocus = nonprofits[nonprofits.length - 1];\n } else {\n nextFocus = nonprofits[index - 1];\n }\n evt.preventDefault();\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n if (index === nonprofits.length - 1) {\n nextFocus = nonprofits[0];\n } else {\n nextFocus = nonprofits[index + 1];\n }\n evt.preventDefault();\n break;\n case \"Enter\":\n case \" \":\n evt.preventDefault();\n break; // continue to toggle-selection block below\n default:\n return;\n }\n if (nextFocus) {\n if (currentId != null) {\n this.selectedNonprofitId = nextFocus.nonprofit.id;\n }\n const focusTarget = this.renderRoot.querySelector(`[data-value=\"${nextFocus.nonprofit.id}\"]`) as HTMLElement;\n if (focusTarget !== null) {\n focusTarget.tabIndex = 0;\n focusTarget.focus();\n }\n return;\n }\n }\n // Handle selection with click or Enter/Space key\n const targetEl = evt.currentTarget;\n if (targetEl instanceof HTMLElement) {\n if (currentId === id) {\n if (this.enableNonprofitDeselection) {\n this.selectedNonprofitId = null; // unset\n } else {\n return;\n }\n } else {\n this.selectedNonprofitId = id;\n }\n }\n await this.selectionDataController.exec({ selectedNonprofitId: this.selectedNonprofitId });\n };\n\n public get cssVariables() {\n const defaults = {\n \"--beam-fontFamily\": \"inherit\",\n \"--beam-fontSize\": \"inherit\",\n \"--beam-textColor\": \"inherit\",\n \"--beam-backgroundColor\": \"inherit\",\n ...progressBarConfigDefaults,\n \"--beam-SelectNonprofit-title-textAlign\": \"inherit\",\n \"--beam-SelectNonprofit-description-textAlign\": \"inherit\",\n \"--beam-SelectNonprofit-maxWidth\": \"800px\",\n \"--beam-SelectNonprofit-options-marginTop\": \"0px\",\n \"--beam-SelectNonprofit-options-iconHeight\": \"24px\",\n \"--beam-SelectNonprofit-options-padding\": \"10px\",\n \"--beam-SelectNonprofit-options-borderRadius\": \"0px\",\n \"--beam-SelectNonprofit-options-borderColor\": \"currentColor\",\n \"--beam-SelectNonprofit-options--selected-borderColor\": \"currentColor\",\n \"--beam-SelectNonprofit-options-backgroundColor\": \"transparent\",\n \"--beam-SelectNonprofit-options-gap\": \"8px\",\n \"--beam-SelectNonprofit-options--selected-backgroundColor\": \"currentColor\",\n \"--beam-SelectNonprofit-details-marginTop\": \"10px\",\n \"--beam-SelectNonprofit-details-borderRadius\": \"0px\",\n \"--beam-SelectNonprofit-details-borderColor\": \"currentColor\",\n \"--beam-SelectNonprofit-details-backgroundColor\": \"inherit\",\n ...defineCustomText(\"--beam-SelectNonprofit-title\", {\n fontSize: \"1.25em\",\n fontWeight: \"bold\",\n }),\n ...defineCustomText(\"--beam-SelectNonprofit-title-inline\", {\n fontWeight: \"bold\",\n }),\n \"--beam-SelectNonprofit-title-inline-textTransform\": \"none\",\n ...defineCustomText(\"--beam-SelectNonprofit-description\", {\n marginTop: \"0.5em\",\n }),\n ...defineCustomText(\"--beam-SelectNonprofit-description-inline\"),\n ...defineCustomText(\"--beam-SelectNonprofit-details-cause\", {\n fontSize: \"0.85em\",\n fontWeight: \"bold\",\n }),\n ...defineCustomText(\"--beam-SelectNonprofit-details-beamAttribution\", {\n fontSize: \"0.85em\",\n }),\n ...defineCustomText(\"--beam-SelectNonprofit-details-impactDescription\", {\n fontSize: \"1em\",\n marginTop: \"10px\",\n }),\n \"--beam-SelectNonprofit-details-nonprofitName-fontWeight\": \"bold\",\n \"--beam-SelectNonprofit-details-nonprofitName-fontStyle\": \"inherit\",\n \"--beam-SelectNonprofit-details-fundingProgress-marginTop\": \"10px\",\n ...defineCustomText(\"--beam-SelectNonprofit-details-fundingProgressLabel\", {\n fontSize: \"0.85em\",\n }),\n };\n\n const remoteConfig = this.nonprofitListDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n cssResponsiveUtils,\n css`\n :host {\n display: block;\n max-width: var(--beam-SelectNonprofit-maxWidth, 800px);\n font-family: var(--beam-fontFamily);\n font-size: var(--beam-fontSize);\n background-color: var(--beam-backgroundColor);\n color: var(--beam-textColor);\n }\n\n .details-impactDescription {\n ${useCustomText(\"--beam-SelectNonprofit-details-impactDescription\")}\n }\n\n .details-impactDescription .nonprofitName {\n font-weight: var(--beam-SelectNonprofit-details-nonprofitName-fontWeight);\n font-style: var(--beam-SelectNonprofit-details-nonprofitName-fontStyle, inherit);\n }\n\n /* Note: title/description display is responsive */\n\n .title-block {\n ${useCustomText(\"--beam-SelectNonprofit-title\")}\n text-align: var(--beam-SelectNonprofit-title-textAlign);\n }\n\n .title-inline {\n line-height: var(--beam-SelectNonprofit-title-inline-lineHeight);\n font-size: var(--beam-SelectNonprofit-title-inline-fontSize);\n font-weight: var(--beam-SelectNonprofit-title-inline-fontWeight);\n color: var(--beam-SelectNonprofit-title-inline-color);\n font-family: var(--beam-SelectNonprofit-title-inline-fontFamily);\n text-transform: var(--beam-SelectNonprofit-title-inline-textTransform);\n }\n\n .description-inline {\n line-height: var(--beam-SelectNonprofit-description-inline-lineHeight);\n font-family: var(--beam-SelectNonprofit-description-inline-fontFamily);\n font-weight: var(--beam-SelectNonprofit-description-inline-fontWeight);\n color: var(--beam-SelectNonprofit-description-inline-color);\n text-transform: var(--beam-SelectNonprofit-description-inline-textTransform);\n font-size: var(--beam-SelectNonprofit-description-inline-fontSize);\n }\n\n .description {\n ${useCustomText(\"--beam-SelectNonprofit-description\")}\n text-align: var(--beam-SelectNonprofit-description-textAlign);\n }\n `,\n ];\n\n protected render() {\n const { selectedNonprofitId } = this;\n const { data, loading } = this.nonprofitListDataController;\n\n if (loading && !data) {\n // TODO: better loading UI\n return _loading(); // TODO: css theme first\n }\n if (this.nonprofitListDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.nonprofitListDataController.error });\n }\n return \"\";\n }\n if (this.selectionDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.selectionDataController.error });\n }\n // do not show error screen for interactive errors by default\n }\n const nonprofits = data?.nonprofits || [];\n const selectedNonprofit = nonprofits.find((np) => np.nonprofit.id === selectedNonprofitId) || null;\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div part=\"heading\">\n <h3 class=\"title-block d-none d-lg-block\" part=\"title\" id=\"beam-SelectNonprofit-title\">\n ${localizeUserString(this.configLang, data?.config?.web?.title || \"\") || strings[this.configLang].ctaTitle()}\n </h3>\n <p class=\"description\" part=\"description\">\n <span class=\"d-none d-lg-inline\">\n ${\n localizeUserString(this.configLang, data?.config?.web?.description || \"\") ||\n strings[this.configLang].ctaMessage()\n }\n </span>\n <div class=\"d-lg-none\">\n <span class=\"title-inline\" part=\"title\">\n ${\n (localizeUserString(this.configLang, data?.config?.web?.title || \"\") ||\n strings[this.configLang].ctaTitle()) + strings[this.configLang].inlineSeparator()\n }\n </span>\n <span class=\"description-inline\" part=\"description\">\n ${\n localizeUserString(this.configLang, data?.config?.web?.description || \"\") ||\n strings[this.configLang].ctaMessage()\n }\n </span>\n </div>\n </p>\n </div>\n <div\n class=\"options\"\n part=\"options\"\n role=\"radiogroup\"\n aria-labelledby=\"beam-SelectNonprofit-title\"\n style=\"display: flex; gap: var(--beam-SelectNonprofit-options-gap); margin: 10px 0 0 0;\"\n >\n ${repeat(\n nonprofits,\n (i) => i.nonprofit.id,\n ({ nonprofit }, index) => {\n const isSelected = selectedNonprofitId === nonprofit.id;\n const isFocusable = isSelected || (selectedNonprofit == null && index === 0);\n return html`\n <div\n class=\"option\"\n part=\"option\"\n role=\"radio\"\n tabindex=\"${isFocusable ? 0 : -1}\"\n data-value=${nonprofit.id}\n aria-checked=${isSelected}\n @click=${this.makeHandleSelect(nonprofit.id, index, nonprofits)}\n @keydown=${this.makeHandleSelect(nonprofit.id, index, nonprofits)}\n aria-label=\"${localizeUserString(this.configLang, nonprofit.cause || \"\")}\"\n style=\"${styleMap({\n cursor: \"pointer\",\n flex: \"1\",\n textAlign: \"center\",\n lineHeight: \"1\",\n marginTop: \"var(--beam-SelectNonprofit-options-marginTop, 0px)\",\n padding: \"var(--beam-SelectNonprofit-options-padding, 10px)\",\n borderWidth: \"var(--beam-SelectNonprofit-options-borderWidth, 1px)\",\n borderStyle: \"solid\",\n borderRadius: \"var(--beam-SelectNonprofit-options-borderRadius, 0)\",\n borderColor: isSelected\n ? nonprofit.causeColor || \"var(--beam-SelectNonprofit-options--selected-borderColor, currentColor)\"\n : \"var(--beam-SelectNonprofit-options-borderColor, currentColor)\",\n backgroundColor: isSelected\n ? nonprofit.causeColor ||\n \"var(--beam-SelectNonprofit-options--selected-backgroundColor, currentColor)\"\n : \"var(--beam-SelectNonprofit-options-backgroundColor, transparent)\",\n })}\"\n >\n <img\n src=\"${isSelected ? nonprofit.causeIconSelectedUrl : nonprofit.causeIconUrl}\"\n alt=\"\"\n role=\"presentation\"\n style=\"\n height: var(--beam-SelectNonprofit-options-iconHeight, 24px);\n user-select: none;\n \"\n />\n </div>\n `;\n }\n )}\n </div>\n ${\n selectedNonprofit != null\n ? html`\n <div\n class=\"details\"\n part=\"details\"\n style=\"\n border: 1px solid var(--beam-SelectNonprofit-details-borderColor);\n border-radius: var(--beam-SelectNonprofit-details-borderRadius);\n background-color: var(--beam-SelectNonprofit-details-backgroundColor);\n padding: 10px;\n margin-top: var(--beam-SelectNonprofit-details-marginTop)\n \"\n >\n <div\n style=\"display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap-reverse\"\n >\n <span\n class=\"details-cause\"\n style=\"flex: 0 1; white-space: nowrap; ${useCustomText(\"--beam-SelectNonprofit-details-cause\")}\"\n >\n ${localizeUserString(this.configLang, selectedNonprofit.nonprofit.cause || \"\")}\n </span>\n <span\n class=\"details-beamAttribution\"\n style=\"flex: 0 1; white-space: nowrap; ${useCustomText(\n \"--beam-SelectNonprofit-details-beamAttribution\"\n )}\"\n >\n ${strings[this.configLang].beamAttribution()}\n </span>\n </div>\n <p class=\"details-impactDescription\">\n ${unsafeHTML(localizeUserString(this.configLang, selectedNonprofit.impact.description || \"\"))}\n </p>\n <div\n style=\"display: flex; margin-top: var(--beam-SelectNonprofit-details-fundingProgress-marginTop); align-items: center;\"\n >\n <beam-progress-bar\n value=\"${selectedNonprofit.impact.goalProgressPercentage}\"\n style=\"flex: 1 0;\"\n ></beam-progress-bar>\n <span\n class=\"details-fundingProgressLabel\"\n style=\"${useCustomText(\n \"--beam-SelectNonprofit-details-fundingProgressLabel\"\n )} white-space: nowrap; text-align: right; flex: 0 1; margin-left: 15px;\"\n >\n ${localizeUserString(this.configLang, selectedNonprofit.impact.goalProgressText)}\n </span>\n </div>\n </div>\n `\n : \"\"\n }\n `;\n }\n}\n\ndefineCustomElement(BeamSelectNonprofit);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-select-nonprofit\": BeamSelectNonprofit;\n }\n}\n"],"names":["strings","donationPercentage","w","L","s","h","g","t","e","i","o","r","BeamSelectNonprofit","LitElement","DEFAULT_BASE_URL","enforceConfig","cart","res","postChainEligibleNonprofitsForCart","np","BeamNonprofitSelectEvent","selectedNonprofitId","cartId","beamCartId","result","postSelectNonprofit","selectedNonprofit","AsyncController","createScopedLocalStorage","evt","id","index","nonprofits","currentId","nextFocus","focusTarget","SUPPORTED_LANGUAGES","BeamCartChangeEvent","_changedProperties","previousPropertyValues","requireNewDataProps","prop","getCookieValue","BEAM_CART_COOKIE_NAME","createdAt","data","cacheTtl","defaults","progressBarConfigDefaults","defineCustomText","remoteConfig","config","_cssVariableMap","loading","_loading","_errorMessage","html","localizeUserString","repeat","nonprofit","isSelected","isFocusable","styleMap","useCustomText","unsafeHTML","cssReset","cssResponsiveUtils","css","__decorateClass","property","defineCustomElement"],"mappings":"itBAAO,MAAMA,EAAU,CACrB,GAAI,CACF,gBAAiB,IAAM,kBACvB,SAAU,IAAM,qBAChB,WAAY,CAAC,CAAE,mBAAAC,EAAqB,GAAI,EAAI,CAAA,IAC1C,0BAA0BA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O,CAAC,CAAA,EAHfzD,EAGwB,UAAA,UAAA,CAAA,EAEAwD,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,GALfzD,EAKwB,UAAA,SAAA,CAAA,EAEAwD,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAPf,EAAAzD,EAOwB,UAEewD,UAAAA,CAAAA,EAAAA,EAAA,CAAjDC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAT9B,EAAAzD,EASuC,UAEfwD,UAAAA,CAAAA,EAAAA,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAXfzD,EAWwB,UAAA,cAAA,CAAA,EAEAwD,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAbf,EAAAzD,EAawB,UAEIwD,aAAAA,CAAAA,EAAAA,EAAA,CAAtCC,EAAS,CAAE,UAAW,EAAM,CAAC,CAAA,EAfnBzD,EAe4B,UAAA,OAAA,CAAA,EAEWwD,EAAA,CAAjDC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAjB9BzD,EAiBuC,UAAA,sBAAA,CAAA,EAEfwD,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAnBf,EAAAzD,EAmBwB,oBAECwD,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CArBhB,EAAAzD,EAqByB,UA8jBtC0D,QAAAA,CAAAA,EAAAA,EAAoB1D,CAAmB"}
@@ -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-STAG2OhW.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-K-xxdX-s.esm.js";import"../chunks/routes-Xnsh4jsO.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-eEmqUebY.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-c__LUZFg.esm.js";import"../chunks/routes-52a2dOOE.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-94iMCraa.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-K-xxdX-s.esm.js";import"../chunks/routes-Xnsh4jsO.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-ROlgTyhA.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-c__LUZFg.esm.js";import"../chunks/routes-52a2dOOE.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.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-Hm4mQjnj.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-Xnsh4jsO.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-PYdJGNef.esm.js";import"./chunks/order-page-STAG2OhW.esm.js";import"./chunks/update-cart-K-xxdX-s.esm.js";import"./chunks/index-IXwIgGSV.esm.js";import"./chunks/index-PIFZakQ8.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-LW-Uv5ZW.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-52a2dOOE.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-p4QxNz-z.esm.js";import"./chunks/order-page-eEmqUebY.esm.js";import"./chunks/update-cart-c__LUZFg.esm.js";import"./chunks/index-IXwIgGSV.esm.js";import"./chunks/index-4z2o94Rr.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-P56wvflO.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-Xnsh4jsO.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-gxb1Rhtv.esm.js";import"./chunks/order-page-94iMCraa.esm.js";import"./chunks/update-cart-K-xxdX-s.esm.js";import"./chunks/index-IXwIgGSV.esm.js";import"./chunks/index-PIFZakQ8.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-lFO9cyBH.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-52a2dOOE.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-sHFANQ0S.esm.js";import"./chunks/order-page-ROlgTyhA.esm.js";import"./chunks/update-cart-c__LUZFg.esm.js";import"./chunks/index-IXwIgGSV.esm.js";import"./chunks/index-4z2o94Rr.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-K-xxdX-s.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-Xnsh4jsO.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{K as u}from"../chunks/update-cart-c__LUZFg.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-52a2dOOE.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{x as s}from"../chunks/update-cart-K-xxdX-s.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-Xnsh4jsO.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{K as u}from"../chunks/update-cart-c__LUZFg.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/routes-52a2dOOE.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-PYdJGNef.esm.js";import{i as A}from"../chunks/index-IXwIgGSV.esm.js";import{i as D}from"../chunks/index-PIFZakQ8.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-STAG2OhW.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-K-xxdX-s.esm.js";import"../chunks/routes-Xnsh4jsO.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-p4QxNz-z.esm.js";import{i as A}from"../chunks/index-IXwIgGSV.esm.js";import{i as D}from"../chunks/index-4z2o94Rr.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-eEmqUebY.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-c__LUZFg.esm.js";import"../chunks/routes-52a2dOOE.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-gxb1Rhtv.esm.js";import{i as A}from"../chunks/index-IXwIgGSV.esm.js";import{i as D}from"../chunks/index-PIFZakQ8.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-94iMCraa.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-K-xxdX-s.esm.js";import"../chunks/routes-Xnsh4jsO.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-sHFANQ0S.esm.js";import{i as A}from"../chunks/index-IXwIgGSV.esm.js";import{i as D}from"../chunks/index-4z2o94Rr.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-ROlgTyhA.esm.js";import"../chunks/lodash-ZxBiuGue.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-c__LUZFg.esm.js";import"../chunks/routes-52a2dOOE.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-STAG2OhW.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-K-xxdX-s.esm.js";import"../chunks/routes-Xnsh4jsO.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-eEmqUebY.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-c__LUZFg.esm.js";import"../chunks/routes-52a2dOOE.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-94iMCraa.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-K-xxdX-s.esm.js";import"../chunks/routes-Xnsh4jsO.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-ROlgTyhA.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-c__LUZFg.esm.js";import"../chunks/routes-52a2dOOE.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
@@ -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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-Xnsh4jsO.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};
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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-52a2dOOE.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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-Xnsh4jsO.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};
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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-52a2dOOE.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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-Xnsh4jsO.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};
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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-52a2dOOE.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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-Xnsh4jsO.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};
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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-52a2dOOE.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-Xnsh4jsO.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-e-mss8ya.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};
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-52a2dOOE.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-e-mss8ya.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-Xnsh4jsO.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-e-mss8ya.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};
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-52a2dOOE.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-e-mss8ya.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
@@ -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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-Xnsh4jsO.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};
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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-52a2dOOE.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
@@ -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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-Xnsh4jsO.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};
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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-52a2dOOE.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-e-mss8ya.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-Xnsh4jsO.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};
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-e-mss8ya.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-52a2dOOE.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-e-mss8ya.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-Xnsh4jsO.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};
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-e-mss8ya.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-52a2dOOE.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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-Xnsh4jsO.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};
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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-52a2dOOE.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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-Xnsh4jsO.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};
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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-52a2dOOE.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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-Xnsh4jsO.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};
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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-52a2dOOE.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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-Xnsh4jsO.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};
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-e-mss8ya.esm.js";import"../chunks/beam-errors-l02WBee5.esm.js";import"../chunks/logger-ad87ovol.esm.js";import"../chunks/routes-52a2dOOE.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,7 +1,7 @@
1
1
  {
2
2
  "name": "@beamimpact/web-sdk",
3
3
  "private": false,
4
- "version": "1.29.0-beta.6",
4
+ "version": "1.29.0",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "engines": {
@@ -15,6 +15,13 @@
15
15
  "dist",
16
16
  "README.md"
17
17
  ],
18
+ "keywords": [
19
+ "nonprofit",
20
+ "donation",
21
+ "ecomm",
22
+ "ecommerce",
23
+ "sdk"
24
+ ],
18
25
  "scripts": {
19
26
  "start": "npm-run-all -p build:rollup:watch dev",
20
27
  "commitizen": "cz",
@@ -1 +0,0 @@
1
- {"version":3,"file":"_share-dialog-dependencies-6rpTDMSM.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"_share-dialog-dependencies-hd9fP3Yj.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{i}from"./index--XzN0d8d.esm.js";import{i as o}from"./index-PYdJGNef.esm.js";import{i as r}from"./index-IXwIgGSV.esm.js";import{i as e}from"./index-PIFZakQ8.esm.js";var t=Object.freeze({__proto__:null,Cart:e,Session:r,Shopify:o,Utils:i});export{t as i};
2
- //# sourceMappingURL=index-Hm4mQjnj.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Hm4mQjnj.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{i}from"./index--XzN0d8d.esm.js";import{i as o}from"./index-gxb1Rhtv.esm.js";import{i as r}from"./index-IXwIgGSV.esm.js";import{i as e}from"./index-PIFZakQ8.esm.js";var t=Object.freeze({__proto__:null,Cart:e,Session:r,Shopify:o,Utils:i});export{t as i};
2
- //# sourceMappingURL=index-P56wvflO.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-P56wvflO.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{x as e}from"./update-cart-K-xxdX-s.esm.js";var r=Object.freeze({__proto__:null,updateCart:e});export{r as i};
2
- //# sourceMappingURL=index-PIFZakQ8.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-PIFZakQ8.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-STAG2OhW.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-PYdJGNef.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-PYdJGNef.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-94iMCraa.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-gxb1Rhtv.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-gxb1Rhtv.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -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.6",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-Xnsh4jsO.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-Xnsh4jsO.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-K-xxdX-s.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-cart-K-xxdX-s.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,I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