@beamimpact/web-sdk 1.55.2 → 1.55.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{_share-dialog-dependencies-oPfou2yz.esm.js → _share-dialog-dependencies-BVseSHLF.esm.js} +2 -2
- package/dist/chunks/{_share-dialog-dependencies-oPfou2yz.esm.js.map → _share-dialog-dependencies-BVseSHLF.esm.js.map} +1 -1
- package/dist/chunks/{_share-dialog-dependencies-CrXoTXJn.esm.js → _share-dialog-dependencies-o8GVV6gC.esm.js} +2 -2
- package/dist/chunks/{_share-dialog-dependencies-CrXoTXJn.esm.js.map → _share-dialog-dependencies-o8GVV6gC.esm.js.map} +1 -1
- package/dist/chunks/{index-ddFvDm5F.esm.js → index-BNHAn1OG.esm.js} +2 -2
- package/dist/chunks/{index-ddFvDm5F.esm.js.map → index-BNHAn1OG.esm.js.map} +1 -1
- package/dist/chunks/{index-Cb7UHLgc.esm.js → index-BWtaQiQa.esm.js} +16 -16
- package/dist/chunks/index-BWtaQiQa.esm.js.map +1 -0
- package/dist/chunks/{index-C0iBcnhO.esm.js → index-CIQxph2z.esm.js} +2 -2
- package/dist/chunks/index-CIQxph2z.esm.js.map +1 -0
- package/dist/chunks/index-CM59QOJP.esm.js +2 -0
- package/dist/chunks/index-CM59QOJP.esm.js.map +1 -0
- package/dist/chunks/{index-CXu50lhe.esm.js → index-CVNcspb0.esm.js} +2 -2
- package/dist/chunks/index-CVNcspb0.esm.js.map +1 -0
- package/dist/chunks/index-CYxuuwlv.esm.js +2 -0
- package/dist/chunks/index-CYxuuwlv.esm.js.map +1 -0
- package/dist/chunks/{index-BRwtueB0.esm.js → index-D1Pso4Mx.esm.js} +2 -2
- package/dist/chunks/{index-BRwtueB0.esm.js.map → index-D1Pso4Mx.esm.js.map} +1 -1
- package/dist/chunks/{index-BfJw1nDH.esm.js → index-DiNDMv3P.esm.js} +2 -2
- package/dist/chunks/index-DiNDMv3P.esm.js.map +1 -0
- package/dist/chunks/index-Dji1l8sT.esm.js +2 -0
- package/dist/chunks/index-Dji1l8sT.esm.js.map +1 -0
- package/dist/chunks/index-DsvbqqAd.esm.js +2 -0
- package/dist/chunks/index-DsvbqqAd.esm.js.map +1 -0
- package/dist/chunks/{index-CJLX6Cat.esm.js → index-IAa5EO-6.esm.js} +16 -16
- package/dist/chunks/index-IAa5EO-6.esm.js.map +1 -0
- package/dist/chunks/{index-DTnVjvy8.esm.js → index-MoK57RXU.esm.js} +2 -2
- package/dist/chunks/index-MoK57RXU.esm.js.map +1 -0
- package/dist/chunks/{order-page-qV21CdRx.esm.js → order-page-Brrq-LAx.esm.js} +2 -2
- package/dist/chunks/{order-page-qV21CdRx.esm.js.map → order-page-Brrq-LAx.esm.js.map} +1 -1
- package/dist/chunks/{order-page-BL4PDyMz.esm.js → order-page-C41TBLoV.esm.js} +2 -2
- package/dist/chunks/{order-page-BL4PDyMz.esm.js.map → order-page-C41TBLoV.esm.js.map} +1 -1
- package/dist/chunks/{promo-pill-label-CbW_Vcru.esm.js → promo-pill-label-BESRGLn7.esm.js} +3 -3
- package/dist/chunks/promo-pill-label-BESRGLn7.esm.js.map +1 -0
- package/dist/chunks/promo-pill-label-YOC47M3t.esm.js +16 -0
- package/dist/chunks/promo-pill-label-YOC47M3t.esm.js.map +1 -0
- package/dist/chunks/{routes-BAqFeD8S.esm.js → routes-BGx3ADhY.esm.js} +2 -2
- package/dist/chunks/{routes-BAqFeD8S.esm.js.map → routes-BGx3ADhY.esm.js.map} +1 -1
- package/dist/chunks/{routes-C75nl1NS.esm.js → routes-D0_9umO_.esm.js} +2 -2
- package/dist/chunks/{routes-C75nl1NS.esm.js.map → routes-D0_9umO_.esm.js.map} +1 -1
- package/dist/chunks/{share-button-BxWziSBl.esm.js → share-button-BmoEHT-C.esm.js} +2 -2
- package/dist/chunks/{share-button-BxWziSBl.esm.js.map → share-button-BmoEHT-C.esm.js.map} +1 -1
- package/dist/chunks/{share-button-BNp67BPn.esm.js → share-button-CV5FZFS9.esm.js} +2 -2
- package/dist/chunks/{share-button-BNp67BPn.esm.js.map → share-button-CV5FZFS9.esm.js.map} +1 -1
- package/dist/chunks/{share-button-BSHKEfJo.esm.js → share-button-D-c9M84d.esm.js} +2 -2
- package/dist/chunks/{share-button-BSHKEfJo.esm.js.map → share-button-D-c9M84d.esm.js.map} +1 -1
- package/dist/chunks/{share-button-DCMaVhyw.esm.js → share-button-DcaL0AYo.esm.js} +2 -2
- package/dist/chunks/{share-button-DCMaVhyw.esm.js.map → share-button-DcaL0AYo.esm.js.map} +1 -1
- package/dist/chunks/{update-cart-FKTMMTl5.esm.js → update-cart-CFB8JVgq.esm.js} +2 -2
- package/dist/chunks/{update-cart-FKTMMTl5.esm.js.map → update-cart-CFB8JVgq.esm.js.map} +1 -1
- package/dist/chunks/{update-cart-DPxyDjY9.esm.js → update-cart-Dsu0mPtW.esm.js} +2 -2
- package/dist/chunks/{update-cart-DPxyDjY9.esm.js.map → update-cart-Dsu0mPtW.esm.js.map} +1 -1
- package/dist/components/community-impact.esm.js +9 -9
- package/dist/components/community-impact.esm.js.map +1 -1
- package/dist/components/community-impact.js +9 -9
- package/dist/components/community-impact.js.map +1 -1
- package/dist/components/cumulative-impact.esm.js +1 -1
- package/dist/components/cumulative-impact.js +1 -1
- package/dist/components/impact-overview.esm.js +7 -7
- package/dist/components/impact-overview.esm.js.map +1 -1
- package/dist/components/impact-overview.js +7 -7
- package/dist/components/impact-overview.js.map +1 -1
- package/dist/components/index.esm.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/post-purchase.d.ts +1 -1
- package/dist/components/post-purchase.esm.js +1 -1
- package/dist/components/post-purchase.js +1 -1
- package/dist/components/product-details-page.d.ts +1 -1
- package/dist/components/product-details-page.esm.js +11 -11
- package/dist/components/product-details-page.esm.js.map +1 -1
- package/dist/components/product-details-page.js +11 -11
- package/dist/components/product-details-page.js.map +1 -1
- package/dist/components/redeem-transaction.d.ts +1 -1
- package/dist/components/redeem-transaction.esm.js +1 -1
- package/dist/components/redeem-transaction.js +1 -1
- package/dist/components/select-nonprofit.d.ts +1 -1
- package/dist/components/select-nonprofit.esm.js +9 -9
- package/dist/components/select-nonprofit.esm.js.map +1 -1
- package/dist/components/select-nonprofit.js +9 -9
- package/dist/components/select-nonprofit.js.map +1 -1
- package/dist/components/select-subscription-nonprofit.d.ts +1 -1
- package/dist/components/select-subscription-nonprofit.esm.js +7 -7
- package/dist/components/select-subscription-nonprofit.esm.js.map +1 -1
- package/dist/components/select-subscription-nonprofit.js +7 -7
- package/dist/components/select-subscription-nonprofit.js.map +1 -1
- package/dist/components/shopify.esm.js +1 -1
- package/dist/components/shopify.js +1 -1
- package/dist/components/social-share.esm.js +1 -1
- package/dist/components/social-share.js +1 -1
- package/dist/components/subscription-impact.d.ts +1 -1
- package/dist/components/subscription-impact.esm.js +3 -3
- package/dist/components/subscription-impact.esm.js.map +1 -1
- package/dist/components/subscription-impact.js +3 -3
- package/dist/components/subscription-impact.js.map +1 -1
- package/dist/components/subscription-management.d.ts +1 -1
- package/dist/components/subscription-management.esm.js +1 -1
- package/dist/components/subscription-management.esm.js.map +1 -1
- package/dist/components/subscription-management.js +1 -1
- package/dist/components/subscription-management.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/integrations/beam.esm.js +1 -1
- package/dist/integrations/beam.js +1 -1
- package/dist/integrations/cart.esm.js +1 -1
- package/dist/integrations/cart.js +1 -1
- package/dist/integrations/index.esm.js +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/logs.esm.js +1 -1
- package/dist/integrations/logs.js +1 -1
- package/dist/integrations/shopify.esm.js +1 -1
- package/dist/integrations/shopify.js +1 -1
- package/dist/integrations/statsig.esm.js +1 -1
- package/dist/integrations/statsig.js +1 -1
- package/dist/react/community-impact.esm.js +1 -1
- package/dist/react/community-impact.js +1 -1
- package/dist/react/cumulative-impact.esm.js +1 -1
- package/dist/react/cumulative-impact.js +1 -1
- package/dist/react/impact-overview.esm.js +1 -1
- package/dist/react/impact-overview.js +1 -1
- package/dist/react/index.esm.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/post-purchase.esm.js +1 -1
- package/dist/react/post-purchase.js +1 -1
- package/dist/react/product-details-page.esm.js +1 -1
- package/dist/react/product-details-page.esm.js.map +1 -1
- package/dist/react/product-details-page.js +1 -1
- package/dist/react/product-details-page.js.map +1 -1
- package/dist/react/redeem-transaction.esm.js +1 -1
- package/dist/react/redeem-transaction.esm.js.map +1 -1
- package/dist/react/redeem-transaction.js +1 -1
- package/dist/react/redeem-transaction.js.map +1 -1
- package/dist/react/select-nonprofit.esm.js +1 -1
- package/dist/react/select-nonprofit.esm.js.map +1 -1
- package/dist/react/select-nonprofit.js +1 -1
- package/dist/react/select-nonprofit.js.map +1 -1
- package/dist/react/select-subscription-nonprofit.esm.js +1 -1
- package/dist/react/select-subscription-nonprofit.js +1 -1
- package/dist/react/social-share.esm.js +1 -1
- package/dist/react/social-share.js +1 -1
- package/dist/react/subscription-impact.esm.js +1 -1
- package/dist/react/subscription-impact.esm.js.map +1 -1
- package/dist/react/subscription-impact.js +1 -1
- package/dist/react/subscription-impact.js.map +1 -1
- package/dist/react/subscription-management.esm.js +1 -1
- package/dist/react/subscription-management.esm.js.map +1 -1
- package/dist/react/subscription-management.js +1 -1
- package/dist/react/subscription-management.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/index-BfJw1nDH.esm.js.map +0 -1
- package/dist/chunks/index-C0iBcnhO.esm.js.map +0 -1
- package/dist/chunks/index-CB2FlO76.esm.js +0 -2
- package/dist/chunks/index-CB2FlO76.esm.js.map +0 -1
- package/dist/chunks/index-CFuuHEma.esm.js +0 -2
- package/dist/chunks/index-CFuuHEma.esm.js.map +0 -1
- package/dist/chunks/index-CJLX6Cat.esm.js.map +0 -1
- package/dist/chunks/index-CXu50lhe.esm.js.map +0 -1
- package/dist/chunks/index-Cb7UHLgc.esm.js.map +0 -1
- package/dist/chunks/index-DQU56kcv.esm.js +0 -2
- package/dist/chunks/index-DQU56kcv.esm.js.map +0 -1
- package/dist/chunks/index-DTnVjvy8.esm.js.map +0 -1
- package/dist/chunks/index-O-hdOxQR.esm.js +0 -2
- package/dist/chunks/index-O-hdOxQR.esm.js.map +0 -1
- package/dist/chunks/promo-pill-label-CbW_Vcru.esm.js.map +0 -1
- package/dist/utils/uuid.d.ts +0 -8
- package/dist/utils/uuid.esm.js +0 -2
- package/dist/utils/uuid.esm.js.map +0 -1
- package/dist/utils/uuid.js +0 -2
- package/dist/utils/uuid.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-impact.esm.js","sources":["../../src/shared/components/info-pill.ts","../../src/components/subscription-impact/strings.ts","../../src/components/subscription-impact/index.ts"],"sourcesContent":["import { css, html, LitElement } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport \"@shoelace-style/shoelace/dist/components/badge/badge.js\";\n\nexport class BeamInfoPill extends LitElement {\n @property({ type: String }) infoText = \"\";\n\n static get styles() {\n return css`\n sl-badge::part(base) {\n background-color: var(--beam-pillLabel-color-background, #000);\n color: var(--beam-pillLabel-color, #fff);\n border: var(--beam-pillLabel-border-width, 3px) solid var(--beam-pillLabel-border, #000);\n border-radius: 18.37px;\n font-family: var(--beam-pillLabel-font, inherit);\n font-size: var(--beam-pillLabel-font-size, 12px);\n font-style: var(--beam-pillLabel-font-style, italic);\n font-weight: var(--beam-pillLabel-font-weight, bold);\n text-transform: var(--beam-pillLabel-text-transform, none);\n padding: var(--beam-pillLabel-padding, 3px 4px);\n }\n `;\n }\n\n render() {\n return html`<sl-badge pill aria-label=\"${this.infoText}\">${this.infoText}</sl-badge>`;\n }\n}\n\ncustomElements.get(\"beam-info-pill\") || customElements.define(\"beam-info-pill\", BeamInfoPill);\n\nexport const infoPillLabelConfigDefaults = {\n \"--beam-pillLabel-color-background\": \"#0A323C\",\n \"--beam-pillLabel-color\": \"#fff\",\n \"--beam-pillLabel-border\": \"#0A323C\",\n \"--beam-pillLabel-border-width\": \"1px\",\n \"--beam-pillLabel-font-size\": \"10px\",\n \"--beam-pillLabel-font\": \"inherit\",\n \"--beam-pillLabel-font-weight\": \"400\",\n \"--beam-pillLabel-text-transform\": \"none\",\n \"--beam-pillLabel-font-style\": \"italic\",\n \"--beam-pillLabel-padding\": \"3px 4px\",\n} as const;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-info-pill\": BeamInfoPill;\n }\n}\n","export const strings = {\n en: {\n title: ({ causeName = \"\" }) => `Your Subscription is Going Towards ${causeName} With Every Order`,\n futureTenseTitle: ({ causeName = \"\" }) => `Your Subscription Will Go Towards ${causeName} With Every Order`,\n ctaMessagePrefix: () => `At no extra cost, `,\n description: ({ nonprofit = \"\" }) => `1% will be donated to ${nonprofit} for you, at no extra cost, every order.`,\n personalImpactTitle: () => `You're Currently Funding`,\n futureTensePersonalImpactTitle: () => `You’ll Be Funding`,\n communityImpactTitle: () => `Together We're Funding`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) => `Learn about ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Learn about ${brandName} impact${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `funded`,\n progressPillText: () => `🎉 Impact begins once order is charged`,\n },\n fr: {\n title: ({ causeName = \"\" }) => `Votre abonnement contribue à ${causeName} à chaque commande`,\n futureTenseTitle: ({ causeName = \"\" }) => `Votre abonnement contribuera à ${causeName} à chaque commande`,\n ctaMessagePrefix: () => `Sans frais supplémentaires, `,\n description: ({ nonprofit = \"\" }) =>\n `1% de chaque commande sera reversé à ${nonprofit} pour vous, sans frais supplémentaires.`,\n personalImpactTitle: () => `Vous financez actuellement`,\n futureTensePersonalImpactTitle: () => `Vous financerez`,\n communityImpactTitle: () => `Ensemble, nous finançons`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) =>\n `En savoir plus sur ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `En savoir plus sur l’impact de ${brandName}${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `financé`,\n progressPillText: () => `🎉 L’impact commence une fois la commande débitée`,\n },\n de: {\n title: ({ causeName = \"\" }) => `Ihr Abonnement unterstützt ${causeName} mit jeder Bestellung`,\n futureTenseTitle: ({ causeName = \"\" }) => `Ihr Abonnement wird ${causeName} mit jeder Bestellung unterstützen`,\n ctaMessagePrefix: () => `Ohne zusätzliche Kosten, `,\n description: ({ nonprofit = \"\" }) =>\n `1% jeder Bestellung wird im Rahmen Ihres Abonnements an ${nonprofit} gespendet.`,\n personalImpactTitle: () => `Sie unterstützen derzeit`,\n futureTensePersonalImpactTitle: () => `Sie werden unterstützen`,\n communityImpactTitle: () => `Gemeinsam unterstützen wir`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) =>\n `Mehr über ${nonprofit} erfahren${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Mehr über die Wirkung von ${brandName} erfahren${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `finanziert`,\n progressPillText: () => `🎉 Wirkung beginnt, sobald die Bestellung abgerechnet wird`,\n },\n es: {\n title: ({ causeName = \"\" }) => `Tu suscripción está apoyando a ${causeName} con cada pedido`,\n futureTenseTitle: ({ causeName = \"\" }) => `Tu suscripción apoyará a ${causeName} con cada pedido`,\n ctaMessagePrefix: () => `Sin coste adicional, `,\n description: ({ nonprofit = \"\" }) => `El 1% de cada pedido se donará a ${nonprofit} en tu nombre.`,\n personalImpactTitle: () => `Actualmente estás financiando`,\n futureTensePersonalImpactTitle: () => `Financiarás`,\n communityImpactTitle: () => `Juntos estamos financiando`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) =>\n `Conoce más sobre ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Conoce más sobre el impacto de ${brandName}${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `financiado`,\n progressPillText: () => `🎉 El impacto comienza una vez que se procese el pedido`,\n },\n it: {\n title: ({ causeName = \"\" }) => `Il tuo abbonamento sostiene ${causeName} con ogni ordine`,\n futureTenseTitle: ({ causeName = \"\" }) => `Il tuo abbonamento sosterrà ${causeName} con ogni ordine`,\n ctaMessagePrefix: () => `Senza alcun costo aggiuntivo, `,\n description: ({ nonprofit = \"\" }) => `L'1% di ogni ordine sarà donato a ${nonprofit} per te.`,\n personalImpactTitle: () => `Attualmente stai finanziando`,\n futureTensePersonalImpactTitle: () => `Finanzierai`,\n communityImpactTitle: () => `Insieme stiamo finanziando`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) =>\n `Scopri di più su ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Scopri di più sull’impatto di ${brandName}${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `finanziato`,\n progressPillText: () => `🎉 L’impatto inizia una volta che l’ordine è stato addebitato`,\n },\n pl: {\n title: ({ causeName = \"\" }) => `Twoja subskrypcja wspiera ${causeName} przy każdym zamówieniu`,\n futureTenseTitle: ({ causeName = \"\" }) => `Twoja subskrypcja będzie wspierać ${causeName} przy każdym zamówieniu`,\n ctaMessagePrefix: () => `Bez dodatkowych kosztów, `,\n description: ({ nonprofit = \"\" }) =>\n `1% z każdego zamówienia zostanie przekazane na rzecz ${nonprofit} w Twoim imieniu.`,\n personalImpactTitle: () => `Obecnie wspierasz`,\n futureTensePersonalImpactTitle: () => `Będziesz wspierać`,\n communityImpactTitle: () => `Razem wspieramy`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) =>\n `Dowiedz się więcej o ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Dowiedz się więcej o wpływie ${brandName}${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `sfinansowano`,\n progressPillText: () => `🎉 Wpływ rozpoczyna się po zrealizowaniu zamówienia`,\n },\n ja: {\n title: ({ causeName = \"\" }) => `Your Subscription is Going Towards ${causeName} With Every Order`,\n futureTenseTitle: ({ causeName = \"\" }) => `Your Subscription Will Go Towards ${causeName} With Every Order`,\n ctaMessagePrefix: () => `At no extra cost, `,\n description: ({ nonprofit = \"\" }) => `1% will be donated to ${nonprofit} for you, at no extra cost, every order.`,\n personalImpactTitle: () => `You're Currently Funding`,\n futureTensePersonalImpactTitle: () => `You’ll Be Funding`,\n communityImpactTitle: () => `Together We're Funding`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) => `Learn about ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Learn about ${brandName} impact${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `funded`,\n progressPillText: () => `🎉 Impact begins once order is charged`,\n },\n};\n","import { html, css, LitElement, PropertyValues } from \"lit\";\nimport debounce from \"lodash-es/debounce\";\nimport isNil from \"lodash-es/isNil\";\nimport { property } from \"lit/decorators/property.js\";\nimport { queryAll } from \"lit/decorators/query-all.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport { progressBarConfigDefaults } from \"../../shared/components/progress-bar\";\nimport { shareButtonConfigDefaults } from \"../../shared/components/share-button\";\nimport { infoPillLabelConfigDefaults } from \"../../shared/components/info-pill\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES } from \"../../api-sdk/constants\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { syncElementHeights } from \"../../shared/sync-element-heights\";\nimport { _loading } from \"../../shared/fragments/loading-template\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { TId, TNumericId, TUrl } from \"../../shared/types\";\nimport { MissingConfig } from \"../../utils/beam-errors\";\nimport { cssResponsiveUtils } from \"../../shared/responsive\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { getImpact } from \"../../api-sdk/v3/routes\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { logger } from \"../../utils/logger\";\nimport { cssCardGrid } from \"../../shared/fragments/css-card-grid\";\nimport { strings } from \"./strings\";\nimport \"../../shared/components/progress-bar\";\nimport \"../../shared/components/share-button\";\nimport \"../../shared/components/info-pill\";\n\ntype RequiredConfig = {\n apiKey: string;\n nonprofitId: TNumericId;\n beamUserId: TId;\n};\n\nexport class BeamSubscriptionImpact extends LitElement {\n static tagName = \"beam-subscription-impact\";\n\n @property({ type: String, reflect: true }) public baseUrl: TUrl = DEFAULT_BASE_URL;\n @property({ type: String, reflect: false }) apiKey?: RequiredConfig[\"apiKey\"];\n @property({ type: Number }) storeId?: number;\n @property({ type: String, reflect: true }) nonprofitId?: RequiredConfig[\"nonprofitId\"];\n @property({ type: String, reflect: true }) beamUserId?: RequiredConfig[\"beamUserId\"];\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n @property({ type: Boolean }) public debug = false;\n @property({ type: Boolean }) public draftConfig = false;\n\n @state() private isMobile = window.innerWidth < 720;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n getImpactData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"beamUserId\", \"nonprofitId\"], this)) throw new MissingConfig();\n const res = await getImpact({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n queryParams: {\n nonprofitId: this.nonprofitId,\n beamUserId: this.beamUserId,\n personalImpactLimit: 1,\n communityImpactLimit: 1,\n storeId: this.storeId,\n widgetName: \"subscription-impact\",\n draftConfig: this.draftConfig,\n version: \"1.0.0\",\n lang: this.configLang,\n },\n });\n\n return res;\n };\n\n private impactDataController = new AsyncController<typeof this.getImpactData>(this, this.getImpactData);\n\n @queryAll(\".card-title\")\n impactTitleRefs!: HTMLElement[];\n\n @queryAll(\".impact-link\")\n impactLinkRefs!: HTMLElement[];\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(\"resize\", this.evaluateBreakPoints);\n }\n\n async updated(changedProperties: PropertyValues): Promise<void> {\n // Fires on first load as props go from undefined => value\n const requireNewDataProps = [\"baseUrl\", \"storeId\", \"apiKey\", \"beamUserId\", \"lang\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.impactDataController.exec();\n break;\n }\n }\n this.resizeElements(); // Handle layout shifts immediately\n await this.handleFontLoad(this.resizeElements); // If content change triggered font load, resize again\n }\n\n disconnectedCallback() {\n window.removeEventListener(\"resize\", this.resizeElements);\n document.fonts.removeEventListener(\"loadingdone\", this.resizeElements);\n super.disconnectedCallback();\n }\n\n /**\n * Safari does not fire loading events on the document FontFaceSet, but it does implement the .ready Promise\n * Call this method to wait for font loads that may be triggered by content changes\n */\n async handleFontLoad<T = any>(callback: () => T | void) {\n if (document.fonts.status === \"loading\") {\n await document.fonts.ready.catch((e) => logger.error(e));\n return callback();\n }\n }\n\n public get cssVariables() {\n const defaults = {\n ...progressBarConfigDefaults,\n ...shareButtonConfigDefaults,\n ...infoPillLabelConfigDefaults,\n \"--beam-fontFamily\": \"inherit\",\n \"--beam-fontStyle\": \"inherit\",\n \"--beam-fontSize\": \"12px\",\n \"--beam-textColor\": \"inherit\",\n \"--beam-backgroundColor\": \"inherit\",\n \"--beam-subscriptionImpact-impactCards-maxWidth\": \"900px\",\n \"--beam-subscriptionImpact-headerContainer-desktop-textAlign\": \"left\",\n \"--beam-subscriptionImpact-headerContainer-mobile-textAlign\": \"center\",\n \"--beam-subscriptionImpact-descriptionContainer-marginTop\": \"10px\",\n \"--beam-subscriptionImpact-cardContainer-marginTop\": \"15px\",\n \"--beam-subscriptionImpact-cardContainer-gap\": \"20px\",\n \"--beam-subscriptionImpact-card-borderRadius\": \"8px\",\n \"--beam-subscriptionImpact-card-background\": \"#f8fbfb\",\n \"--beam-subscriptionImpact-card-padding\": \"24px 28px 24px 24px\",\n \"--beam-subscriptionImpact-card-marginRight\": \"0px\",\n \"--beam-subscriptionImpact-card-marginTop\": \"10px\",\n \"--beam-subscriptionImpact-card-gap\": \"5px\",\n \"--beam-subscriptionImpact-cardTitle-textAlign\": \"left\",\n \"--beam-subscriptionImpact-cardTitle-letterSpacing\": \"0.36px\",\n \"--beam-SubscriptionImpact-cardStyle\": \"'selected_icon'\",\n \"--beam-SubscriptionImpact-imagePosition\": \"'inline'\",\n \"--beam-subscriptionImpact-imageBlock-height\": \"120px\",\n \"--beam-subscriptionImpact-imageBlock-borderRadius\": \"4px\",\n \"--beam-subscriptionImpact-iconBackground-width\": \"50px\",\n \"--beam-subscriptionImpact-iconBackground-height\": \"50px\",\n \"--beam-subscriptionImpact-iconBackground-borderRadius\": \"50%\",\n \"--beam-subscriptionImpact-iconBackground-background\": \"#0a323c\",\n \"--beam-subscriptionImpact-icon-height\": \"28px\",\n \"--beam-subscriptionImpact-icon-margin\": \"auto\",\n \"--beam-subscriptionImpact-icon-padding\": \"10px\",\n \"--beam-subscriptionImpact-icon-borderRadius\": \"4px\",\n \"--beam-subscriptionImpact-image-borderRadius\": \"4px\",\n \"--beam-subscriptionImpact-image-minHeight\": \"0\",\n \"--beam-subscriptionImpact-image-minWidth\": \"0\",\n \"--beam-subscriptionImpact-cardDescription-padding\": \"0px\",\n \"--beam-subscriptionImpact-card-progressBar-padding\": \"8px 0px\",\n \"--beam-subscriptionImpact-card-progressBarLabel-gap\": \"10px\",\n \"--beam-subscriptionImpact-card-progressBarLabel-textAlign\": \"right\",\n \"--beam-subscriptionImpact-card-progressBarLabel-marginLeft\": \"8px\",\n \"--beam-subscriptionImpact-card-linkContainer-textAlign\": \"left\",\n \"--beam-subscriptionImpact-card-impactLink-textDecoration\": \"underline\",\n \"--beam-subscriptionImpact-footer-textAlign\": \"center\",\n \"--beam-subscriptionImpact-footer-marginTop\": \"10px\",\n \"--beam-subscriptionImpact-share-button-icon-name\": \"share-2\",\n \"--beam-subscriptionImpact-learnAbout-arrow-display\": \"block\",\n ...defineCustomText(\"--beam-subscriptionImpact-title\", {\n fontSize: \"20px\",\n fontWeight: \"bold\",\n lineHeight: \"120%\",\n textTransform: \"capitalize\",\n fontStyle: \"normal\",\n color: \"#0a323c\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-descriptionPrefix\", {\n fontSize: \"14px\",\n fontWeight: \"800\",\n lineHeight: \"138%\",\n fontStyle: \"normal\",\n color: \"#2f302d\",\n marginTop: \"9px\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-description\", {\n fontSize: \"14px\",\n fontWeight: \"400\",\n lineHeight: \"138%\",\n fontStyle: \"normal\",\n color: \"#2f302d\",\n marginTop: \"9px\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-cardTitle\", {\n fontSize: \"12px\",\n fontWeight: \"bold\",\n lineHeight: \"120%\",\n fontStyle: \"normal\",\n textTransform: \"uppercase\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-cardDescription\", {\n fontSize: \"12px\",\n fontWeight: \"400\",\n lineHeight: \"18.2px\",\n fontStyle: \"normal\",\n color: \"#454a47\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-card-progressBarLabel\", {\n fontSize: \"10px\",\n color: \"#878a92\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-card-impactLink\", {\n fontSize: \"12px\",\n fontWeight: \"600\",\n lineHeight: \"16px\",\n fontStyle: \"normal\",\n color: \"#454a47\",\n marginTop: \"auto\",\n }),\n };\n const remoteConfig = this.impactDataController?.data?.config?.web?.theme || {};\n const config = {\n ...defaults,\n ...remoteConfig,\n };\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n return Object.assign(serializable, config);\n }\n\n evaluateBreakPoints = debounce(\n () => {\n this.isMobile = window.innerWidth < 768;\n },\n 50,\n { maxWait: 50, leading: true }\n );\n\n resizeElements = debounce(\n () => {\n syncElementHeights(this.impactTitleRefs);\n syncElementHeights(this.impactLinkRefs);\n },\n 50,\n { maxWait: 50, leading: true }\n );\n\n render() {\n const { data, loading, error } = this.impactDataController;\n if (loading) {\n return _loading();\n }\n if (error || data == null) {\n return this.debug ? _errorMessage({ error: error || new Error(\"No data\") }) : \"\";\n }\n\n const communityImpact = data.community[0];\n const personalImpact = data.personal[0];\n\n const brandName = data.chain.name;\n const causeName = localizeUserString(this.configLang, personalImpact?.nonprofit.cause || \"\");\n const nonprofitName = personalImpact?.nonprofit.name;\n const personalProgressPercentage = personalImpact?.impact?.goalProgressPercentage || 0;\n const isPersonalProgressNotStarted = !(\n personalImpact?.impact?.goalProgressPercentage > 0 || personalImpact?.impact?.goalCompletionText?.length > 0\n );\n const communityProgressPercentage = communityImpact?.impact?.goalProgressPercentage || 0;\n const personalProgressDescription = `${personalProgressPercentage}% ${\n localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"percentFunded\"] || \"\") ||\n strings[this.configLang].percentFunded()\n }`;\n const communityProgressDescription = `${communityProgressPercentage}% ${\n localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"percentFunded\"] || \"\") ||\n strings[this.configLang].percentFunded()\n }`;\n const communityImage = communityImpact?.imageUrl || \"\";\n const personalImage = personalImpact?.imageUrl || \"\";\n const unselectedIcon = personalImpact?.nonprofit.causeIconUrl;\n const selectedIcon = personalImpact?.nonprofit.causeIconSelectedUrl;\n const cardStyle = this.cssVariables[\"--beam-SubscriptionImpact-cardStyle\"];\n const imagePosition = this.cssVariables[\"--beam-SubscriptionImpact-imagePosition\"];\n const isImage = cardStyle === \"'image'\";\n const iconImage = cardStyle === \"'selected_icon'\" ? selectedIcon : unselectedIcon;\n const communityCardImage = isImage ? communityImage : iconImage;\n const personalCardImage = isImage ? personalImage : iconImage;\n const personalTitle =\n localizeUserString(this.configLang, data?.config?.web?.dynamicStrings?.[\"ctaTitle\"] || \"\") ||\n strings[this.configLang].title({ causeName });\n\n const personalFutureTenseTitle =\n localizeUserString(this.configLang, data?.config?.web?.dynamicStrings?.[\"ctaFutureTenseTitle\"] || \"\") ||\n strings[this.configLang].futureTenseTitle({ causeName });\n const communityLink = isNil(data.store.communityPageURL)\n ? data.chain.communityImpactUrl\n : data.store.communityPageURL;\n const personalLink = personalImpact?.nonprofit?.website;\n const shareImage = personalImpact?.share?.imageUrl;\n const shareIcon = this.cssVariables[\"--beam-SubscriptionImpact-share-button-icon-name\"] || \"share-2\";\n const hideLearnAboutArrow = this.cssVariables[\"--beam-subscriptionImpact-learnAbout-arrow-display\"] === \"none\";\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n\n <div class=\"widget-container\" id=\"beam-subscription-impact-container\">\n <div\n class=\"header-container ${this.isMobile ? \"header-container-mobile\" : \"header-container-desktop\"}\"\n id=\"beam-subscriptionImpact-header-container\"\n >\n <h3 class=\"title\" part=\"title\" id=\"beam-subscriptionImpact-title\">\n ${isPersonalProgressNotStarted ? personalFutureTenseTitle : personalTitle}\n </h3>\n <div\n class=\"description-container ${this.isMobile\n ? \"header-container-mobile description-mobile\"\n : \"header-container-desktop description-desktop\"}\"\n >\n <span class=\"description-prefix\" part=\"description\">\n ${localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"ctaMessagePrefix\"] || \"\") ||\n strings[this.configLang].ctaMessagePrefix()}\n </span>\n <span class=\"description\" part=\"description\" id=\"beam-subscriptionImpact-description\">\n ${localizeUserString(this.configLang, data?.config?.web?.dynamicStrings?.[\"ctaMessage\"] || \"\") ||\n strings[this.configLang].description({ nonprofit: nonprofitName })}\n </span>\n </div>\n </div>\n <div class=\"root\">\n <div\n class=\"card-container cardGrid ${this.isMobile ? \"card-container-mobile\" : \"\"}\"\n id=\"beam-subscriptionImpact-card-container\"\n >\n ${this.renderInlineCard({\n title: isPersonalProgressNotStarted\n ? localizeUserString(\n this.configLang,\n data?.config?.web?.additionalStrings?.[\"futureTensePersonalImpactTitle\"] || \"\"\n ) || strings[this.configLang].futureTensePersonalImpactTitle()\n : localizeUserString(\n this.configLang,\n data?.config?.web?.additionalStrings?.[\"personalImpactTitle\"] || \"\"\n ) || strings[this.configLang].personalImpactTitle(),\n image: personalCardImage,\n description: localizeUserString(this.configLang, personalImpact?.impact?.description || \"\"),\n link: personalLink,\n linkText:\n localizeUserString(this.configLang, data?.config?.web?.dynamicStrings?.[\"personalLinkCopy\"] || \"\") ||\n strings[this.configLang].personalLinkCopy({ nonprofit: nonprofitName, hideArrow: hideLearnAboutArrow }),\n progressBarValue: personalProgressPercentage,\n progressBarText: personalProgressDescription,\n infoPill:\n localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"progressPillText\"] || \"\") ||\n strings[this.configLang].progressPillText(),\n imageType: cardStyle,\n cardType: \"personal\",\n imagePosition: imagePosition,\n })}\n ${this.renderInlineCard({\n title:\n localizeUserString(\n this.configLang,\n data?.config?.web?.additionalStrings?.[\"communityImpactTitle\"] || \"\"\n ) || strings[this.configLang].communityImpactTitle(),\n image: communityCardImage,\n description: localizeUserString(this.configLang, communityImpact?.impact?.description || \"\"),\n link: communityLink,\n linkText:\n localizeUserString(this.configLang, data?.config?.web?.dynamicStrings?.[\"communityLinkCopy\"] || \"\") ||\n strings[this.configLang].communityLinkCopy({ brandName: brandName, hideArrow: hideLearnAboutArrow }),\n progressBarValue: communityProgressPercentage,\n progressBarText: communityProgressDescription,\n infoPill:\n localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"progressPillText\"] || \"\") ||\n strings[this.configLang].progressPillText(),\n imageType: cardStyle,\n cardType: \"community\",\n imagePosition: imagePosition,\n })}\n </div>\n </div>\n <div class=\"footer\" part=\"social-share\">\n <beam-share-button\n imageUrl=\"${shareImage}\"\n brandName=\"${brandName}\"\n shareIcon=\"${shareIcon}\"\n buttonText=\"${localizeUserString(\n this.configLang,\n data?.config?.web?.additionalStrings?.[\"shareButtonText\"] || \"\"\n )}\"\n configLang=\"${this.configLang}\"\n ></beam-share-button>\n </div>\n </div>\n `;\n }\n\n renderInlineCard(impactCard: {\n title: string;\n description: string;\n image: string | null;\n link: string | null;\n linkText: string;\n progressBarValue?: number;\n progressBarText?: string;\n infoPill: string;\n imageType: \"'image'\" | \"'icon'\" | \"'selected_icon'\";\n cardType: \"personal\" | \"community\";\n imagePosition: \"'inline'\" | \"'block'\";\n }) {\n const isPersonalProgressBarValueLow =\n impactCard.progressBarValue !== undefined &&\n impactCard.progressBarValue <= 1 &&\n impactCard.cardType === \"personal\";\n return html`\n <div class=\"inline-card ${this.isMobile ? \"\" : \"inline-card-desktop\"}\">\n ${impactCard.image && impactCard.imagePosition === \"'block'\" && impactCard.imageType === \"'image'\"\n ? html` <div\n class=\"image-block-container\"\n style=\"background: url('${impactCard.image}');background-position: center;\n background-size: cover;\n background-repeat: no-repeat;\"\n ></div>`\n : \"\"}\n <h4 class=\"card-title\">${impactCard.title}</h4>\n <div class=\"inline-content\">\n ${impactCard.image && impactCard.imagePosition === \"'inline'\"\n ? html`${impactCard.imageType === \"'icon'\" || impactCard.imageType === \"'selected_icon'\"\n ? html` <div class=\"icon-container\">\n <div class=\"icon-background\">\n <img src=\"${impactCard.image}\" alt=\"\" role=\"presentation\" class=\"icon\" />\n </div>\n </div>`\n : html` <div class=\"image-container\">\n <img src=\"${impactCard.image}\" alt=\"\" role=\"presentation\" class=\"image\" />\n </div>`}`\n : \"\"}\n <div class=\"impact-container\" part=\"details\">\n <p class=\"card-description\">${impactCard.description}</p>\n <div class=\"card-progress-bar\">\n ${isPersonalProgressBarValueLow\n ? html` <beam-info-pill infoText=\"${impactCard.infoPill}\"></beam-info-pill> `\n : html`\n <beam-progress-bar value=\"${impactCard.progressBarValue}\" style=\"flex: 1 0;\"> </beam-progress-bar>\n <span class=\"details-funding-progress-label\"> ${impactCard.progressBarText} </span>\n `}\n </div>\n <div class=\"link-container\">\n <a href=\"${impactCard.link}\" class=\"impact-link\" target=\"_blank\">${impactCard.linkText}</a>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n\n static styles = [\n cssReset,\n cssResponsiveUtils,\n css`\n :host {\n display: block;\n font-family: var(--beam-fontFamily);\n font-style: var(--beam-fontStyle);\n font-size: var(--beam-fontSize);\n background-color: var(--beam-backgroundColor);\n color: var(--beam-textColor);\n max-width: var(--beam-subscriptionImpact-impactCards-maxWidth);\n word-break: normal;\n }\n\n /* subscription impact container and header css */\n\n .header-container-mobile {\n text-align: var(--beam-subscriptionImpact-headerContainer-mobile-textAlign);\n }\n\n .header-container-desktop {\n text-align: var(--beam-subscriptionImpact-headerContainer-desktop-textAlign);\n }\n\n .title {\n ${useCustomText(\"--beam-subscriptionImpact-title\")};\n }\n\n .description-container {\n margin-top: var(--beam-subscriptionImpact-descriptionContainer-marginTop);\n }\n\n .description-prefix {\n ${useCustomText(\"--beam-subscriptionImpact-descriptionPrefix\")};\n }\n\n .description {\n ${useCustomText(\"--beam-subscriptionImpact-description\")};\n }\n\n .root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n flex-shrink: 0;\n }\n\n .card-container {\n margin-top: var(--beam-subscriptionImpact-cardContainer-marginTop);\n gap: var(--beam-subscriptionImpact-cardContainer-gap);\n display: grid;\n justify-content: center;\n }\n\n .card-container-mobile {\n flex-direction: column;\n }\n\n /* subscription impact card css */\n .inline-card {\n border-radius: var(--beam-subscriptionImpact-card-borderRadius);\n background: var(--beam-subscriptionImpact-card-background);\n padding: var(--beam-subscriptionImpact-card-padding);\n flex: 2;\n flex-direction: column;\n margin-top: var(--beam-subscriptionImpact-card-marginTop);\n display: flex;\n gap: var(--beam-subscriptionImpact-card-gap);\n }\n\n .inline-card-desktop {\n margin-right: var(--beam-subscriptionImpact-card-marginRight);\n }\n\n .inline-content {\n display: flex;\n flex-direction: row;\n gap: 15px;\n height: 100%;\n }\n\n .card-title {\n text-align: var(--beam-subscriptionImpact-cardTitle-textAlign);\n letter-spacing: var(--beam-subscriptionImpact-cardTitle-letterSpacing);\n ${useCustomText(\"--beam-subscriptionImpact-cardTitle\")};\n }\n\n .icon-container {\n flex: 0;\n flex-direction: column;\n }\n\n .image-block-container {\n flex-shrink: 0;\n height: var(--beam-subscriptionImpact-imageBlock-height);\n border-radius: var(--beam-subscriptionImpact-imageBlock-borderRadius);\n }\n\n .image-container {\n flex: 4;\n display: flex;\n flex-direction: column;\n }\n\n .icon-background {\n width: var(--beam-subscriptionImpact-iconBackground-width);\n height: var(--beam-subscriptionImpact-iconBackground-height);\n border-radius: var(--beam-subscriptionImpact-iconBackground-borderRadius);\n padding: var(--beam-subscriptionImpact-icon-padding);\n overflow: hidden;\n background: var(--beam-subscriptionImpact-iconBackground-background);\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .icon {\n height: var(--beam-subscriptionImpact-icon-height);\n display: block;\n margin: var(--beam-subscriptionImpact-icon-margin);\n border-radius: var(--beam-subscriptionImpact-icon-borderRadius);\n }\n\n .image {\n flex: 4;\n height: auto;\n width: 100%;\n object-fit: cover;\n min-height: var(--beam-subscriptionImpact-image-minHeight);\n min-width: var(--beam-subscriptionImpact-image-minWidth);\n border-radius: var(--beam-subscriptionImpact-image-borderRadius);\n }\n\n .impact-container {\n flex: 1 1 67%;\n height: 100%;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-content: stretch;\n align-items: stretch;\n position: relative;\n }\n\n .card-description {\n flex-grow: 1;\n padding: var(--beam-subscriptionImpact-cardDescription-padding);\n ${useCustomText(\"--beam-subscriptionImpact-cardDescription\")};\n }\n\n .card-progress-bar {\n flex: 1 1;\n display: flex;\n align-items: center;\n padding: var(--beam-subscriptionImpact-card-progressBar-padding);\n }\n\n .details-funding-progress-label {\n gap: var(--beam-subscriptionImpact-card-progressBarLabel-gap);\n white-space: nowrap;\n text-align: var(--beam-subscriptionImpact-card-progressBarLabel-textAlign);\n flex: 0 1;\n margin-left: var(--beam-subscriptionImpact-card-progressBarLabel-marginLeft);\n ${useCustomText(\"--beam-subscriptionImpact-card-progressBarLabel\")};\n }\n\n .link-container {\n text-align: var(--beam-subscriptionImpact-card-linkContainer-textAlign);\n }\n\n .impact-link {\n display: inline-block;\n text-decoration-line: var(--beam-subscriptionImpact-card-impactLink-textDecoration);\n ${useCustomText(\"--beam-subscriptionImpact-card-impactLink\")};\n }\n\n /* share footer */\n .footer {\n text-align: var(--beam-subscriptionImpact-footer-textAlign);\n margin-top: var(--beam-subscriptionImpact-footer-marginTop);\n }\n `,\n cssCardGrid({\n gap: \"var(--beam-subscriptionImpact-cardContainer-gap)\",\n itemMinWidth: \"250px\",\n columnCount: \"2\",\n }),\n ];\n}\n\ndefineCustomElement(BeamSubscriptionImpact);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-subscription-impact\": BeamSubscriptionImpact;\n }\n}\n"],"names":["BeamInfoPill","LitElement","css","html","__decorateClass","property","infoPillLabelConfigDefaults","strings","causeName","nonprofit","hideArrow","brandName","BeamSubscriptionImpact","DEFAULT_BASE_URL","enforceConfig","getImpact","makeApiKeyHeader","AsyncController","debounce","syncElementHeights","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","callback","e","logger","defaults","progressBarConfigDefaults","shareButtonConfigDefaults","defineCustomText","remoteConfig","config","_cssVariableMap","data","loading","error","_loading","_errorMessage","communityImpact","personalImpact","localizeUserString","nonprofitName","personalProgressPercentage","isPersonalProgressNotStarted","communityProgressPercentage","personalProgressDescription","communityProgressDescription","communityImage","personalImage","unselectedIcon","selectedIcon","cardStyle","imagePosition","isImage","iconImage","communityCardImage","personalCardImage","personalTitle","personalFutureTenseTitle","communityLink","isNil","personalLink","shareImage","shareIcon","hideLearnAboutArrow","impactCard","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EAAS,aAAa,CAAA,EAzCZ7D,EA0CX,UAAA,iBAAA,EAGAR,EAAA,CADCqE,EAAS,cAAc,CA5Cb,EAAA7D,EA6CX,UA0jBF8D,gBAAAA,EAAAA,GAAoB9D,CAAsB"}
|
|
1
|
+
{"version":3,"file":"subscription-impact.esm.js","sources":["../../src/shared/components/info-pill.ts","../../src/components/subscription-impact/strings.ts","../../src/components/subscription-impact/index.ts"],"sourcesContent":["import { css, html, LitElement } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport \"../shoelace-components\";\nimport \"@shoelace-style/shoelace/dist/components/badge/badge.js\";\n\nexport class BeamInfoPill extends LitElement {\n @property({ type: String }) infoText = \"\";\n\n static get styles() {\n return css`\n sl-badge::part(base) {\n background-color: var(--beam-pillLabel-color-background, #000);\n color: var(--beam-pillLabel-color, #fff);\n border: var(--beam-pillLabel-border-width, 3px) solid var(--beam-pillLabel-border, #000);\n border-radius: 18.37px;\n font-family: var(--beam-pillLabel-font, inherit);\n font-size: var(--beam-pillLabel-font-size, 12px);\n font-style: var(--beam-pillLabel-font-style, italic);\n font-weight: var(--beam-pillLabel-font-weight, bold);\n text-transform: var(--beam-pillLabel-text-transform, none);\n padding: var(--beam-pillLabel-padding, 3px 4px);\n }\n `;\n }\n\n render() {\n return html`<sl-badge pill aria-label=\"${this.infoText}\">${this.infoText}</sl-badge>`;\n }\n}\n\ncustomElements.get(\"beam-info-pill\") || customElements.define(\"beam-info-pill\", BeamInfoPill);\n\nexport const infoPillLabelConfigDefaults = {\n \"--beam-pillLabel-color-background\": \"#0A323C\",\n \"--beam-pillLabel-color\": \"#fff\",\n \"--beam-pillLabel-border\": \"#0A323C\",\n \"--beam-pillLabel-border-width\": \"1px\",\n \"--beam-pillLabel-font-size\": \"10px\",\n \"--beam-pillLabel-font\": \"inherit\",\n \"--beam-pillLabel-font-weight\": \"400\",\n \"--beam-pillLabel-text-transform\": \"none\",\n \"--beam-pillLabel-font-style\": \"italic\",\n \"--beam-pillLabel-padding\": \"3px 4px\",\n} as const;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-info-pill\": BeamInfoPill;\n }\n}\n","export const strings = {\n en: {\n title: ({ causeName = \"\" }) => `Your Subscription is Going Towards ${causeName} With Every Order`,\n futureTenseTitle: ({ causeName = \"\" }) => `Your Subscription Will Go Towards ${causeName} With Every Order`,\n ctaMessagePrefix: () => `At no extra cost, `,\n description: ({ nonprofit = \"\" }) => `1% will be donated to ${nonprofit} for you, at no extra cost, every order.`,\n personalImpactTitle: () => `You're Currently Funding`,\n futureTensePersonalImpactTitle: () => `You’ll Be Funding`,\n communityImpactTitle: () => `Together We're Funding`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) => `Learn about ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Learn about ${brandName} impact${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `funded`,\n progressPillText: () => `🎉 Impact begins once order is charged`,\n },\n fr: {\n title: ({ causeName = \"\" }) => `Votre abonnement contribue à ${causeName} à chaque commande`,\n futureTenseTitle: ({ causeName = \"\" }) => `Votre abonnement contribuera à ${causeName} à chaque commande`,\n ctaMessagePrefix: () => `Sans frais supplémentaires, `,\n description: ({ nonprofit = \"\" }) =>\n `1% de chaque commande sera reversé à ${nonprofit} pour vous, sans frais supplémentaires.`,\n personalImpactTitle: () => `Vous financez actuellement`,\n futureTensePersonalImpactTitle: () => `Vous financerez`,\n communityImpactTitle: () => `Ensemble, nous finançons`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) =>\n `En savoir plus sur ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `En savoir plus sur l’impact de ${brandName}${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `financé`,\n progressPillText: () => `🎉 L’impact commence une fois la commande débitée`,\n },\n de: {\n title: ({ causeName = \"\" }) => `Ihr Abonnement unterstützt ${causeName} mit jeder Bestellung`,\n futureTenseTitle: ({ causeName = \"\" }) => `Ihr Abonnement wird ${causeName} mit jeder Bestellung unterstützen`,\n ctaMessagePrefix: () => `Ohne zusätzliche Kosten, `,\n description: ({ nonprofit = \"\" }) =>\n `1% jeder Bestellung wird im Rahmen Ihres Abonnements an ${nonprofit} gespendet.`,\n personalImpactTitle: () => `Sie unterstützen derzeit`,\n futureTensePersonalImpactTitle: () => `Sie werden unterstützen`,\n communityImpactTitle: () => `Gemeinsam unterstützen wir`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) =>\n `Mehr über ${nonprofit} erfahren${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Mehr über die Wirkung von ${brandName} erfahren${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `finanziert`,\n progressPillText: () => `🎉 Wirkung beginnt, sobald die Bestellung abgerechnet wird`,\n },\n es: {\n title: ({ causeName = \"\" }) => `Tu suscripción está apoyando a ${causeName} con cada pedido`,\n futureTenseTitle: ({ causeName = \"\" }) => `Tu suscripción apoyará a ${causeName} con cada pedido`,\n ctaMessagePrefix: () => `Sin coste adicional, `,\n description: ({ nonprofit = \"\" }) => `El 1% de cada pedido se donará a ${nonprofit} en tu nombre.`,\n personalImpactTitle: () => `Actualmente estás financiando`,\n futureTensePersonalImpactTitle: () => `Financiarás`,\n communityImpactTitle: () => `Juntos estamos financiando`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) =>\n `Conoce más sobre ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Conoce más sobre el impacto de ${brandName}${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `financiado`,\n progressPillText: () => `🎉 El impacto comienza una vez que se procese el pedido`,\n },\n it: {\n title: ({ causeName = \"\" }) => `Il tuo abbonamento sostiene ${causeName} con ogni ordine`,\n futureTenseTitle: ({ causeName = \"\" }) => `Il tuo abbonamento sosterrà ${causeName} con ogni ordine`,\n ctaMessagePrefix: () => `Senza alcun costo aggiuntivo, `,\n description: ({ nonprofit = \"\" }) => `L'1% di ogni ordine sarà donato a ${nonprofit} per te.`,\n personalImpactTitle: () => `Attualmente stai finanziando`,\n futureTensePersonalImpactTitle: () => `Finanzierai`,\n communityImpactTitle: () => `Insieme stiamo finanziando`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) =>\n `Scopri di più su ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Scopri di più sull’impatto di ${brandName}${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `finanziato`,\n progressPillText: () => `🎉 L’impatto inizia una volta che l’ordine è stato addebitato`,\n },\n pl: {\n title: ({ causeName = \"\" }) => `Twoja subskrypcja wspiera ${causeName} przy każdym zamówieniu`,\n futureTenseTitle: ({ causeName = \"\" }) => `Twoja subskrypcja będzie wspierać ${causeName} przy każdym zamówieniu`,\n ctaMessagePrefix: () => `Bez dodatkowych kosztów, `,\n description: ({ nonprofit = \"\" }) =>\n `1% z każdego zamówienia zostanie przekazane na rzecz ${nonprofit} w Twoim imieniu.`,\n personalImpactTitle: () => `Obecnie wspierasz`,\n futureTensePersonalImpactTitle: () => `Będziesz wspierać`,\n communityImpactTitle: () => `Razem wspieramy`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) =>\n `Dowiedz się więcej o ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Dowiedz się więcej o wpływie ${brandName}${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `sfinansowano`,\n progressPillText: () => `🎉 Wpływ rozpoczyna się po zrealizowaniu zamówienia`,\n },\n ja: {\n title: ({ causeName = \"\" }) => `Your Subscription is Going Towards ${causeName} With Every Order`,\n futureTenseTitle: ({ causeName = \"\" }) => `Your Subscription Will Go Towards ${causeName} With Every Order`,\n ctaMessagePrefix: () => `At no extra cost, `,\n description: ({ nonprofit = \"\" }) => `1% will be donated to ${nonprofit} for you, at no extra cost, every order.`,\n personalImpactTitle: () => `You're Currently Funding`,\n futureTensePersonalImpactTitle: () => `You’ll Be Funding`,\n communityImpactTitle: () => `Together We're Funding`,\n personalLinkCopy: ({ nonprofit = \"\", hideArrow = false }) => `Learn about ${nonprofit}${!hideArrow ? \" ›\" : \"\"}`,\n communityLinkCopy: ({ brandName = \"\", hideArrow = false }) =>\n `Learn about ${brandName} impact${!hideArrow ? \" ›\" : \"\"}`,\n percentFunded: () => `支援済み`,\n progressPillText: () => `🎉 Impact begins once order is charged`,\n },\n};\n","import { html, css, LitElement, PropertyValues } from \"lit\";\nimport debounce from \"lodash-es/debounce\";\nimport isNil from \"lodash-es/isNil\";\nimport { property } from \"lit/decorators/property.js\";\nimport { queryAll } from \"lit/decorators/query-all.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport { progressBarConfigDefaults } from \"../../shared/components/progress-bar\";\nimport { shareButtonConfigDefaults } from \"../../shared/components/share-button\";\nimport { infoPillLabelConfigDefaults } from \"../../shared/components/info-pill\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES } from \"../../api-sdk/constants\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { syncElementHeights } from \"../../shared/sync-element-heights\";\nimport { _loading } from \"../../shared/fragments/loading-template\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { TId, TNumericId, TUrl } from \"../../shared/types\";\nimport { MissingConfig } from \"../../utils/beam-errors\";\nimport { cssResponsiveUtils } from \"../../shared/responsive\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { getImpact } from \"../../api-sdk/v3/routes\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { logger } from \"../../utils/logger\";\nimport { cssCardGrid } from \"../../shared/fragments/css-card-grid\";\nimport { strings } from \"./strings\";\nimport \"../../shared/components/progress-bar\";\nimport \"../../shared/components/share-button\";\nimport \"../../shared/components/info-pill\";\n\ntype RequiredConfig = {\n apiKey: string;\n nonprofitId: TNumericId;\n beamUserId: TId;\n};\n\nexport class BeamSubscriptionImpact extends LitElement {\n static tagName = \"beam-subscription-impact\";\n\n @property({ type: String, reflect: true }) public baseUrl: TUrl = DEFAULT_BASE_URL;\n @property({ type: String, reflect: false }) apiKey?: RequiredConfig[\"apiKey\"];\n @property({ type: Number }) storeId?: number;\n @property({ type: String, reflect: true }) nonprofitId?: RequiredConfig[\"nonprofitId\"];\n @property({ type: String, reflect: true }) beamUserId?: RequiredConfig[\"beamUserId\"];\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n @property({ type: Boolean }) public debug = false;\n @property({ type: Boolean }) public draftConfig = false;\n\n @state() private isMobile = window.innerWidth < 720;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n getImpactData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"beamUserId\", \"nonprofitId\"], this)) throw new MissingConfig();\n const res = await getImpact({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n queryParams: {\n nonprofitId: this.nonprofitId,\n beamUserId: this.beamUserId,\n personalImpactLimit: 1,\n communityImpactLimit: 1,\n storeId: this.storeId,\n widgetName: \"subscription-impact\",\n draftConfig: this.draftConfig,\n version: \"1.0.0\",\n lang: this.configLang,\n },\n });\n\n return res;\n };\n\n private impactDataController = new AsyncController<typeof this.getImpactData>(this, this.getImpactData);\n\n @queryAll(\".card-title\")\n impactTitleRefs!: HTMLElement[];\n\n @queryAll(\".impact-link\")\n impactLinkRefs!: HTMLElement[];\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(\"resize\", this.evaluateBreakPoints);\n }\n\n async updated(changedProperties: PropertyValues): Promise<void> {\n // Fires on first load as props go from undefined => value\n const requireNewDataProps = [\"baseUrl\", \"storeId\", \"apiKey\", \"beamUserId\", \"lang\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.impactDataController.exec();\n break;\n }\n }\n this.resizeElements(); // Handle layout shifts immediately\n await this.handleFontLoad(this.resizeElements); // If content change triggered font load, resize again\n }\n\n disconnectedCallback() {\n window.removeEventListener(\"resize\", this.resizeElements);\n document.fonts.removeEventListener(\"loadingdone\", this.resizeElements);\n super.disconnectedCallback();\n }\n\n /**\n * Safari does not fire loading events on the document FontFaceSet, but it does implement the .ready Promise\n * Call this method to wait for font loads that may be triggered by content changes\n */\n async handleFontLoad<T = any>(callback: () => T | void) {\n if (document.fonts.status === \"loading\") {\n await document.fonts.ready.catch((e) => logger.error(e));\n return callback();\n }\n }\n\n public get cssVariables() {\n const defaults = {\n ...progressBarConfigDefaults,\n ...shareButtonConfigDefaults,\n ...infoPillLabelConfigDefaults,\n \"--beam-fontFamily\": \"inherit\",\n \"--beam-fontStyle\": \"inherit\",\n \"--beam-fontSize\": \"12px\",\n \"--beam-textColor\": \"inherit\",\n \"--beam-backgroundColor\": \"inherit\",\n \"--beam-subscriptionImpact-impactCards-maxWidth\": \"900px\",\n \"--beam-subscriptionImpact-headerContainer-desktop-textAlign\": \"left\",\n \"--beam-subscriptionImpact-headerContainer-mobile-textAlign\": \"center\",\n \"--beam-subscriptionImpact-descriptionContainer-marginTop\": \"10px\",\n \"--beam-subscriptionImpact-cardContainer-marginTop\": \"15px\",\n \"--beam-subscriptionImpact-cardContainer-gap\": \"20px\",\n \"--beam-subscriptionImpact-card-borderRadius\": \"8px\",\n \"--beam-subscriptionImpact-card-background\": \"#f8fbfb\",\n \"--beam-subscriptionImpact-card-padding\": \"24px 28px 24px 24px\",\n \"--beam-subscriptionImpact-card-marginRight\": \"0px\",\n \"--beam-subscriptionImpact-card-marginTop\": \"10px\",\n \"--beam-subscriptionImpact-card-gap\": \"5px\",\n \"--beam-subscriptionImpact-cardTitle-textAlign\": \"left\",\n \"--beam-subscriptionImpact-cardTitle-letterSpacing\": \"0.36px\",\n \"--beam-SubscriptionImpact-cardStyle\": \"'selected_icon'\",\n \"--beam-SubscriptionImpact-imagePosition\": \"'inline'\",\n \"--beam-subscriptionImpact-imageBlock-height\": \"120px\",\n \"--beam-subscriptionImpact-imageBlock-borderRadius\": \"4px\",\n \"--beam-subscriptionImpact-iconBackground-width\": \"50px\",\n \"--beam-subscriptionImpact-iconBackground-height\": \"50px\",\n \"--beam-subscriptionImpact-iconBackground-borderRadius\": \"50%\",\n \"--beam-subscriptionImpact-iconBackground-background\": \"#0a323c\",\n \"--beam-subscriptionImpact-icon-height\": \"28px\",\n \"--beam-subscriptionImpact-icon-margin\": \"auto\",\n \"--beam-subscriptionImpact-icon-padding\": \"10px\",\n \"--beam-subscriptionImpact-icon-borderRadius\": \"4px\",\n \"--beam-subscriptionImpact-image-borderRadius\": \"4px\",\n \"--beam-subscriptionImpact-image-minHeight\": \"0\",\n \"--beam-subscriptionImpact-image-minWidth\": \"0\",\n \"--beam-subscriptionImpact-cardDescription-padding\": \"0px\",\n \"--beam-subscriptionImpact-card-progressBar-padding\": \"8px 0px\",\n \"--beam-subscriptionImpact-card-progressBarLabel-gap\": \"10px\",\n \"--beam-subscriptionImpact-card-progressBarLabel-textAlign\": \"right\",\n \"--beam-subscriptionImpact-card-progressBarLabel-marginLeft\": \"8px\",\n \"--beam-subscriptionImpact-card-linkContainer-textAlign\": \"left\",\n \"--beam-subscriptionImpact-card-impactLink-textDecoration\": \"underline\",\n \"--beam-subscriptionImpact-footer-textAlign\": \"center\",\n \"--beam-subscriptionImpact-footer-marginTop\": \"10px\",\n \"--beam-subscriptionImpact-share-button-icon-name\": \"share-2\",\n \"--beam-subscriptionImpact-learnAbout-arrow-display\": \"block\",\n ...defineCustomText(\"--beam-subscriptionImpact-title\", {\n fontSize: \"20px\",\n fontWeight: \"bold\",\n lineHeight: \"120%\",\n textTransform: \"capitalize\",\n fontStyle: \"normal\",\n color: \"#0a323c\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-descriptionPrefix\", {\n fontSize: \"14px\",\n fontWeight: \"800\",\n lineHeight: \"138%\",\n fontStyle: \"normal\",\n color: \"#2f302d\",\n marginTop: \"9px\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-description\", {\n fontSize: \"14px\",\n fontWeight: \"400\",\n lineHeight: \"138%\",\n fontStyle: \"normal\",\n color: \"#2f302d\",\n marginTop: \"9px\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-cardTitle\", {\n fontSize: \"12px\",\n fontWeight: \"bold\",\n lineHeight: \"120%\",\n fontStyle: \"normal\",\n textTransform: \"uppercase\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-cardDescription\", {\n fontSize: \"12px\",\n fontWeight: \"400\",\n lineHeight: \"18.2px\",\n fontStyle: \"normal\",\n color: \"#454a47\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-card-progressBarLabel\", {\n fontSize: \"10px\",\n color: \"#878a92\",\n }),\n ...defineCustomText(\"--beam-subscriptionImpact-card-impactLink\", {\n fontSize: \"12px\",\n fontWeight: \"600\",\n lineHeight: \"16px\",\n fontStyle: \"normal\",\n color: \"#454a47\",\n marginTop: \"auto\",\n }),\n };\n const remoteConfig = this.impactDataController?.data?.config?.web?.theme || {};\n const config = {\n ...defaults,\n ...remoteConfig,\n };\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n return Object.assign(serializable, config);\n }\n\n evaluateBreakPoints = debounce(\n () => {\n this.isMobile = window.innerWidth < 768;\n },\n 50,\n { maxWait: 50, leading: true }\n );\n\n resizeElements = debounce(\n () => {\n syncElementHeights(this.impactTitleRefs);\n syncElementHeights(this.impactLinkRefs);\n },\n 50,\n { maxWait: 50, leading: true }\n );\n\n render() {\n const { data, loading, error } = this.impactDataController;\n if (loading) {\n return _loading();\n }\n if (error || data == null) {\n return this.debug ? _errorMessage({ error: error || new Error(\"No data\") }) : \"\";\n }\n\n const communityImpact = data.community[0];\n const personalImpact = data.personal[0];\n\n const brandName = data.chain.name;\n const causeName = localizeUserString(this.configLang, personalImpact?.nonprofit.cause || \"\");\n const nonprofitName = personalImpact?.nonprofit.name;\n const personalProgressPercentage = personalImpact?.impact?.goalProgressPercentage || 0;\n const isPersonalProgressNotStarted = !(\n personalImpact?.impact?.goalProgressPercentage > 0 || personalImpact?.impact?.goalCompletionText?.length > 0\n );\n const communityProgressPercentage = communityImpact?.impact?.goalProgressPercentage || 0;\n const personalProgressDescription = `${personalProgressPercentage}% ${\n localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"percentFunded\"] || \"\") ||\n strings[this.configLang].percentFunded()\n }`;\n const communityProgressDescription = `${communityProgressPercentage}% ${\n localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"percentFunded\"] || \"\") ||\n strings[this.configLang].percentFunded()\n }`;\n const communityImage = communityImpact?.imageUrl || \"\";\n const personalImage = personalImpact?.imageUrl || \"\";\n const unselectedIcon = personalImpact?.nonprofit.causeIconUrl;\n const selectedIcon = personalImpact?.nonprofit.causeIconSelectedUrl;\n const cardStyle = this.cssVariables[\"--beam-SubscriptionImpact-cardStyle\"];\n const imagePosition = this.cssVariables[\"--beam-SubscriptionImpact-imagePosition\"];\n const isImage = cardStyle === \"'image'\";\n const iconImage = cardStyle === \"'selected_icon'\" ? selectedIcon : unselectedIcon;\n const communityCardImage = isImage ? communityImage : iconImage;\n const personalCardImage = isImage ? personalImage : iconImage;\n const personalTitle =\n localizeUserString(this.configLang, data?.config?.web?.dynamicStrings?.[\"ctaTitle\"] || \"\") ||\n strings[this.configLang].title({ causeName });\n\n const personalFutureTenseTitle =\n localizeUserString(this.configLang, data?.config?.web?.dynamicStrings?.[\"ctaFutureTenseTitle\"] || \"\") ||\n strings[this.configLang].futureTenseTitle({ causeName });\n const communityLink = isNil(data.store.communityPageURL)\n ? data.chain.communityImpactUrl\n : data.store.communityPageURL;\n const personalLink = personalImpact?.nonprofit?.website;\n const shareImage = personalImpact?.share?.imageUrl;\n const shareIcon = this.cssVariables[\"--beam-SubscriptionImpact-share-button-icon-name\"] || \"share-2\";\n const hideLearnAboutArrow = this.cssVariables[\"--beam-subscriptionImpact-learnAbout-arrow-display\"] === \"none\";\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n\n <div class=\"widget-container\" id=\"beam-subscription-impact-container\">\n <div\n class=\"header-container ${this.isMobile ? \"header-container-mobile\" : \"header-container-desktop\"}\"\n id=\"beam-subscriptionImpact-header-container\"\n >\n <h3 class=\"title\" part=\"title\" id=\"beam-subscriptionImpact-title\">\n ${isPersonalProgressNotStarted ? personalFutureTenseTitle : personalTitle}\n </h3>\n <div\n class=\"description-container ${this.isMobile\n ? \"header-container-mobile description-mobile\"\n : \"header-container-desktop description-desktop\"}\"\n >\n <span class=\"description-prefix\" part=\"description\">\n ${localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"ctaMessagePrefix\"] || \"\") ||\n strings[this.configLang].ctaMessagePrefix()}\n </span>\n <span class=\"description\" part=\"description\" id=\"beam-subscriptionImpact-description\">\n ${localizeUserString(this.configLang, data?.config?.web?.dynamicStrings?.[\"ctaMessage\"] || \"\") ||\n strings[this.configLang].description({ nonprofit: nonprofitName })}\n </span>\n </div>\n </div>\n <div class=\"root\">\n <div\n class=\"card-container cardGrid ${this.isMobile ? \"card-container-mobile\" : \"\"}\"\n id=\"beam-subscriptionImpact-card-container\"\n >\n ${this.renderInlineCard({\n title: isPersonalProgressNotStarted\n ? localizeUserString(\n this.configLang,\n data?.config?.web?.additionalStrings?.[\"futureTensePersonalImpactTitle\"] || \"\"\n ) || strings[this.configLang].futureTensePersonalImpactTitle()\n : localizeUserString(\n this.configLang,\n data?.config?.web?.additionalStrings?.[\"personalImpactTitle\"] || \"\"\n ) || strings[this.configLang].personalImpactTitle(),\n image: personalCardImage,\n description: localizeUserString(this.configLang, personalImpact?.impact?.description || \"\"),\n link: personalLink,\n linkText:\n localizeUserString(this.configLang, data?.config?.web?.dynamicStrings?.[\"personalLinkCopy\"] || \"\") ||\n strings[this.configLang].personalLinkCopy({ nonprofit: nonprofitName, hideArrow: hideLearnAboutArrow }),\n progressBarValue: personalProgressPercentage,\n progressBarText: personalProgressDescription,\n infoPill:\n localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"progressPillText\"] || \"\") ||\n strings[this.configLang].progressPillText(),\n imageType: cardStyle,\n cardType: \"personal\",\n imagePosition: imagePosition,\n })}\n ${this.renderInlineCard({\n title:\n localizeUserString(\n this.configLang,\n data?.config?.web?.additionalStrings?.[\"communityImpactTitle\"] || \"\"\n ) || strings[this.configLang].communityImpactTitle(),\n image: communityCardImage,\n description: localizeUserString(this.configLang, communityImpact?.impact?.description || \"\"),\n link: communityLink,\n linkText:\n localizeUserString(this.configLang, data?.config?.web?.dynamicStrings?.[\"communityLinkCopy\"] || \"\") ||\n strings[this.configLang].communityLinkCopy({ brandName: brandName, hideArrow: hideLearnAboutArrow }),\n progressBarValue: communityProgressPercentage,\n progressBarText: communityProgressDescription,\n infoPill:\n localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"progressPillText\"] || \"\") ||\n strings[this.configLang].progressPillText(),\n imageType: cardStyle,\n cardType: \"community\",\n imagePosition: imagePosition,\n })}\n </div>\n </div>\n <div class=\"footer\" part=\"social-share\">\n <beam-share-button\n imageUrl=\"${shareImage}\"\n brandName=\"${brandName}\"\n shareIcon=\"${shareIcon}\"\n buttonText=\"${localizeUserString(\n this.configLang,\n data?.config?.web?.additionalStrings?.[\"shareButtonText\"] || \"\"\n )}\"\n configLang=\"${this.configLang}\"\n ></beam-share-button>\n </div>\n </div>\n `;\n }\n\n renderInlineCard(impactCard: {\n title: string;\n description: string;\n image: string | null;\n link: string | null;\n linkText: string;\n progressBarValue?: number;\n progressBarText?: string;\n infoPill: string;\n imageType: \"'image'\" | \"'icon'\" | \"'selected_icon'\";\n cardType: \"personal\" | \"community\";\n imagePosition: \"'inline'\" | \"'block'\";\n }) {\n const isPersonalProgressBarValueLow =\n impactCard.progressBarValue !== undefined &&\n impactCard.progressBarValue <= 1 &&\n impactCard.cardType === \"personal\";\n return html`\n <div class=\"inline-card ${this.isMobile ? \"\" : \"inline-card-desktop\"}\">\n ${impactCard.image && impactCard.imagePosition === \"'block'\" && impactCard.imageType === \"'image'\"\n ? html` <div\n class=\"image-block-container\"\n style=\"background: url('${impactCard.image}');background-position: center;\n background-size: cover;\n background-repeat: no-repeat;\"\n ></div>`\n : \"\"}\n <h4 class=\"card-title\">${impactCard.title}</h4>\n <div class=\"inline-content\">\n ${impactCard.image && impactCard.imagePosition === \"'inline'\"\n ? html`${impactCard.imageType === \"'icon'\" || impactCard.imageType === \"'selected_icon'\"\n ? html` <div class=\"icon-container\">\n <div class=\"icon-background\">\n <img src=\"${impactCard.image}\" alt=\"\" role=\"presentation\" class=\"icon\" />\n </div>\n </div>`\n : html` <div class=\"image-container\">\n <img src=\"${impactCard.image}\" alt=\"\" role=\"presentation\" class=\"image\" />\n </div>`}`\n : \"\"}\n <div class=\"impact-container\" part=\"details\">\n <p class=\"card-description\">${impactCard.description}</p>\n <div class=\"card-progress-bar\">\n ${isPersonalProgressBarValueLow\n ? html` <beam-info-pill infoText=\"${impactCard.infoPill}\"></beam-info-pill> `\n : html`\n <beam-progress-bar value=\"${impactCard.progressBarValue}\" style=\"flex: 1 0;\"> </beam-progress-bar>\n <span class=\"details-funding-progress-label\"> ${impactCard.progressBarText} </span>\n `}\n </div>\n <div class=\"link-container\">\n <a href=\"${impactCard.link}\" class=\"impact-link\" target=\"_blank\">${impactCard.linkText}</a>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n\n static styles = [\n cssReset,\n cssResponsiveUtils,\n css`\n :host {\n display: block;\n font-family: var(--beam-fontFamily);\n font-style: var(--beam-fontStyle);\n font-size: var(--beam-fontSize);\n background-color: var(--beam-backgroundColor);\n color: var(--beam-textColor);\n max-width: var(--beam-subscriptionImpact-impactCards-maxWidth);\n word-break: normal;\n }\n\n /* subscription impact container and header css */\n\n .header-container-mobile {\n text-align: var(--beam-subscriptionImpact-headerContainer-mobile-textAlign);\n }\n\n .header-container-desktop {\n text-align: var(--beam-subscriptionImpact-headerContainer-desktop-textAlign);\n }\n\n .title {\n ${useCustomText(\"--beam-subscriptionImpact-title\")};\n }\n\n .description-container {\n margin-top: var(--beam-subscriptionImpact-descriptionContainer-marginTop);\n }\n\n .description-prefix {\n ${useCustomText(\"--beam-subscriptionImpact-descriptionPrefix\")};\n }\n\n .description {\n ${useCustomText(\"--beam-subscriptionImpact-description\")};\n }\n\n .root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n flex-shrink: 0;\n }\n\n .card-container {\n margin-top: var(--beam-subscriptionImpact-cardContainer-marginTop);\n gap: var(--beam-subscriptionImpact-cardContainer-gap);\n display: grid;\n justify-content: center;\n }\n\n .card-container-mobile {\n flex-direction: column;\n }\n\n /* subscription impact card css */\n .inline-card {\n border-radius: var(--beam-subscriptionImpact-card-borderRadius);\n background: var(--beam-subscriptionImpact-card-background);\n padding: var(--beam-subscriptionImpact-card-padding);\n flex: 2;\n flex-direction: column;\n margin-top: var(--beam-subscriptionImpact-card-marginTop);\n display: flex;\n gap: var(--beam-subscriptionImpact-card-gap);\n }\n\n .inline-card-desktop {\n margin-right: var(--beam-subscriptionImpact-card-marginRight);\n }\n\n .inline-content {\n display: flex;\n flex-direction: row;\n gap: 15px;\n height: 100%;\n }\n\n .card-title {\n text-align: var(--beam-subscriptionImpact-cardTitle-textAlign);\n letter-spacing: var(--beam-subscriptionImpact-cardTitle-letterSpacing);\n ${useCustomText(\"--beam-subscriptionImpact-cardTitle\")};\n }\n\n .icon-container {\n flex: 0;\n flex-direction: column;\n }\n\n .image-block-container {\n flex-shrink: 0;\n height: var(--beam-subscriptionImpact-imageBlock-height);\n border-radius: var(--beam-subscriptionImpact-imageBlock-borderRadius);\n }\n\n .image-container {\n flex: 4;\n display: flex;\n flex-direction: column;\n }\n\n .icon-background {\n width: var(--beam-subscriptionImpact-iconBackground-width);\n height: var(--beam-subscriptionImpact-iconBackground-height);\n border-radius: var(--beam-subscriptionImpact-iconBackground-borderRadius);\n padding: var(--beam-subscriptionImpact-icon-padding);\n overflow: hidden;\n background: var(--beam-subscriptionImpact-iconBackground-background);\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .icon {\n height: var(--beam-subscriptionImpact-icon-height);\n display: block;\n margin: var(--beam-subscriptionImpact-icon-margin);\n border-radius: var(--beam-subscriptionImpact-icon-borderRadius);\n }\n\n .image {\n flex: 4;\n height: auto;\n width: 100%;\n object-fit: cover;\n min-height: var(--beam-subscriptionImpact-image-minHeight);\n min-width: var(--beam-subscriptionImpact-image-minWidth);\n border-radius: var(--beam-subscriptionImpact-image-borderRadius);\n }\n\n .impact-container {\n flex: 1 1 67%;\n height: 100%;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-content: stretch;\n align-items: stretch;\n position: relative;\n }\n\n .card-description {\n flex-grow: 1;\n padding: var(--beam-subscriptionImpact-cardDescription-padding);\n ${useCustomText(\"--beam-subscriptionImpact-cardDescription\")};\n }\n\n .card-progress-bar {\n flex: 1 1;\n display: flex;\n align-items: center;\n padding: var(--beam-subscriptionImpact-card-progressBar-padding);\n }\n\n .details-funding-progress-label {\n gap: var(--beam-subscriptionImpact-card-progressBarLabel-gap);\n white-space: nowrap;\n text-align: var(--beam-subscriptionImpact-card-progressBarLabel-textAlign);\n flex: 0 1;\n margin-left: var(--beam-subscriptionImpact-card-progressBarLabel-marginLeft);\n ${useCustomText(\"--beam-subscriptionImpact-card-progressBarLabel\")};\n }\n\n .link-container {\n text-align: var(--beam-subscriptionImpact-card-linkContainer-textAlign);\n }\n\n .impact-link {\n display: inline-block;\n text-decoration-line: var(--beam-subscriptionImpact-card-impactLink-textDecoration);\n ${useCustomText(\"--beam-subscriptionImpact-card-impactLink\")};\n }\n\n /* share footer */\n .footer {\n text-align: var(--beam-subscriptionImpact-footer-textAlign);\n margin-top: var(--beam-subscriptionImpact-footer-marginTop);\n }\n `,\n cssCardGrid({\n gap: \"var(--beam-subscriptionImpact-cardContainer-gap)\",\n itemMinWidth: \"250px\",\n columnCount: \"2\",\n }),\n ];\n}\n\ndefineCustomElement(BeamSubscriptionImpact);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-subscription-impact\": BeamSubscriptionImpact;\n }\n}\n"],"names":["BeamInfoPill","LitElement","css","html","__decorateClass","property","infoPillLabelConfigDefaults","strings","causeName","nonprofit","hideArrow","brandName","BeamSubscriptionImpact","DEFAULT_BASE_URL","enforceConfig","getImpact","makeApiKeyHeader","AsyncController","debounce","syncElementHeights","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","callback","e","logger","defaults","progressBarConfigDefaults","shareButtonConfigDefaults","defineCustomText","remoteConfig","config","_cssVariableMap","data","loading","error","_loading","_errorMessage","communityImpact","personalImpact","localizeUserString","nonprofitName","personalProgressPercentage","isPersonalProgressNotStarted","communityProgressPercentage","personalProgressDescription","communityProgressDescription","communityImage","personalImage","unselectedIcon","selectedIcon","cardStyle","imagePosition","isImage","iconImage","communityCardImage","personalCardImage","personalTitle","personalFutureTenseTitle","communityLink","isNil","personalLink","shareImage","shareIcon","hideLearnAboutArrow","impactCard","isPersonalProgressBarValueLow","cssReset","cssResponsiveUtils","useCustomText","cssCardGrid","state","queryAll","defineCustomElement"],"mappings":"qtCAKa,MAAAA,UAAqBC,CAAW,CAAtC,aACuB,CAAA,MAAA,GAAA,SAAA,EAAA,KAAA,SAAW,EAEvC,CAAA,WAAW,QAAS,CAClB,OAAOC;AAAAA;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p,g as m,t as O,p as C}from"../chunks/lit-WqMxC_PA.esm.js";import{d as z,b as G}from"../chunks/lodash-D3TLHRR_.esm.js";import{p as Y}from"../chunks/progress-bar-DF7UuuHb.esm.js";import{s as S,a as K}from"../chunks/share-button-
|
|
1
|
+
import{h as w,f as $,y as p,g as m,t as O,p as C}from"../chunks/lit-WqMxC_PA.esm.js";import{d as z,b as G}from"../chunks/lodash-D3TLHRR_.esm.js";import{p as Y}from"../chunks/progress-bar-DF7UuuHb.esm.js";import{s as S,a as K}from"../chunks/share-button-D-c9M84d.esm.js";import"../chunks/_share-dialog-dependencies-BVseSHLF.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import{D as q,g as J,S as Q}from"../chunks/routes-BGx3ADhY.esm.js";import{u as b,A as X,d as u,a as Z,_ as ee,i as n}from"../chunks/localize-C25pEGnx.esm.js";import{c as ie,d as ae,e as te}from"../chunks/enforce-config-Ba1JkOHs.esm.js";import{_ as ne}from"../chunks/loading-template-DG4lkIIc.esm.js";import{makeApiKeyHeader as re}from"../utils/makeApiKeyHeader.js";import{c as oe}from"../chunks/responsive-BR8qUfBa.esm.js";import{logger as se}from"../utils/logger.js";import{c as ce}from"../chunks/css-card-grid-CvoGpsJH.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-BmoEHT-C.esm.js";import"../chunks/promo-types-DKAOFHJr.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";var pe=Object.defineProperty,me=(i,e,r,l)=>{for(var t=void 0,a=i.length-1,d;a>=0;a--)(d=i[a])&&(t=d(e,r,t)||t);return t&&pe(e,r,t),t};class A extends w{constructor(){super(...arguments),this.infoText=""}static get styles(){return $`
|
|
2
2
|
sl-badge::part(base) {
|
|
3
3
|
background-color: var(--beam-pillLabel-color-background, #000);
|
|
4
4
|
color: var(--beam-pillLabel-color, #fff);
|
|
@@ -11,7 +11,7 @@ import{h as w,f as $,y as p,g as m,t as O,p as C}from"../chunks/lit-WqMxC_PA.esm
|
|
|
11
11
|
text-transform: var(--beam-pillLabel-text-transform, none);
|
|
12
12
|
padding: var(--beam-pillLabel-padding, 3px 4px);
|
|
13
13
|
}
|
|
14
|
-
`}render(){return p`<sl-badge pill aria-label="${this.infoText}">${this.infoText}</sl-badge>`}}me([m({type:String})],A.prototype,"infoText"),customElements.get("beam-info-pill")||customElements.define("beam-info-pill",A);const le={"--beam-pillLabel-color-background":"#0A323C","--beam-pillLabel-color":"#fff","--beam-pillLabel-border":"#0A323C","--beam-pillLabel-border-width":"1px","--beam-pillLabel-font-size":"10px","--beam-pillLabel-font":"inherit","--beam-pillLabel-font-weight":"400","--beam-pillLabel-text-transform":"none","--beam-pillLabel-font-style":"italic","--beam-pillLabel-padding":"3px 4px"},s={en:{title:({causeName:i=""})=>`Your Subscription is Going Towards ${i} With Every Order`,futureTenseTitle:({causeName:i=""})=>`Your Subscription Will Go Towards ${i} With Every Order`,ctaMessagePrefix:()=>"At no extra cost, ",description:({nonprofit:i=""})=>`1% will be donated to ${i} for you, at no extra cost, every order.`,personalImpactTitle:()=>"You're Currently Funding",futureTensePersonalImpactTitle:()=>"You\u2019ll Be Funding",communityImpactTitle:()=>"Together We're Funding",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Learn about ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Learn about ${i} impact${e?"":" \u203A"}`,percentFunded:()=>"funded",progressPillText:()=>"\u{1F389} Impact begins once order is charged"},fr:{title:({causeName:i=""})=>`Votre abonnement contribue \xE0 ${i} \xE0 chaque commande`,futureTenseTitle:({causeName:i=""})=>`Votre abonnement contribuera \xE0 ${i} \xE0 chaque commande`,ctaMessagePrefix:()=>"Sans frais suppl\xE9mentaires, ",description:({nonprofit:i=""})=>`1% de chaque commande sera revers\xE9 \xE0 ${i} pour vous, sans frais suppl\xE9mentaires.`,personalImpactTitle:()=>"Vous financez actuellement",futureTensePersonalImpactTitle:()=>"Vous financerez",communityImpactTitle:()=>"Ensemble, nous finan\xE7ons",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`En savoir plus sur ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`En savoir plus sur l\u2019impact de ${i}${e?"":" \u203A"}`,percentFunded:()=>"financ\xE9",progressPillText:()=>"\u{1F389} L\u2019impact commence une fois la commande d\xE9bit\xE9e"},de:{title:({causeName:i=""})=>`Ihr Abonnement unterst\xFCtzt ${i} mit jeder Bestellung`,futureTenseTitle:({causeName:i=""})=>`Ihr Abonnement wird ${i} mit jeder Bestellung unterst\xFCtzen`,ctaMessagePrefix:()=>"Ohne zus\xE4tzliche Kosten, ",description:({nonprofit:i=""})=>`1% jeder Bestellung wird im Rahmen Ihres Abonnements an ${i} gespendet.`,personalImpactTitle:()=>"Sie unterst\xFCtzen derzeit",futureTensePersonalImpactTitle:()=>"Sie werden unterst\xFCtzen",communityImpactTitle:()=>"Gemeinsam unterst\xFCtzen wir",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Mehr \xFCber ${i} erfahren${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Mehr \xFCber die Wirkung von ${i} erfahren${e?"":" \u203A"}`,percentFunded:()=>"finanziert",progressPillText:()=>"\u{1F389} Wirkung beginnt, sobald die Bestellung abgerechnet wird"},es:{title:({causeName:i=""})=>`Tu suscripci\xF3n est\xE1 apoyando a ${i} con cada pedido`,futureTenseTitle:({causeName:i=""})=>`Tu suscripci\xF3n apoyar\xE1 a ${i} con cada pedido`,ctaMessagePrefix:()=>"Sin coste adicional, ",description:({nonprofit:i=""})=>`El 1% de cada pedido se donar\xE1 a ${i} en tu nombre.`,personalImpactTitle:()=>"Actualmente est\xE1s financiando",futureTensePersonalImpactTitle:()=>"Financiar\xE1s",communityImpactTitle:()=>"Juntos estamos financiando",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Conoce m\xE1s sobre ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Conoce m\xE1s sobre el impacto de ${i}${e?"":" \u203A"}`,percentFunded:()=>"financiado",progressPillText:()=>"\u{1F389} El impacto comienza una vez que se procese el pedido"},it:{title:({causeName:i=""})=>`Il tuo abbonamento sostiene ${i} con ogni ordine`,futureTenseTitle:({causeName:i=""})=>`Il tuo abbonamento sosterr\xE0 ${i} con ogni ordine`,ctaMessagePrefix:()=>"Senza alcun costo aggiuntivo, ",description:({nonprofit:i=""})=>`L'1% di ogni ordine sar\xE0 donato a ${i} per te.`,personalImpactTitle:()=>"Attualmente stai finanziando",futureTensePersonalImpactTitle:()=>"Finanzierai",communityImpactTitle:()=>"Insieme stiamo finanziando",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Scopri di pi\xF9 su ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Scopri di pi\xF9 sull\u2019impatto di ${i}${e?"":" \u203A"}`,percentFunded:()=>"finanziato",progressPillText:()=>"\u{1F389} L\u2019impatto inizia una volta che l\u2019ordine \xE8 stato addebitato"},pl:{title:({causeName:i=""})=>`Twoja subskrypcja wspiera ${i} przy ka\u017Cdym zam\xF3wieniu`,futureTenseTitle:({causeName:i=""})=>`Twoja subskrypcja b\u0119dzie wspiera\u0107 ${i} przy ka\u017Cdym zam\xF3wieniu`,ctaMessagePrefix:()=>"Bez dodatkowych koszt\xF3w, ",description:({nonprofit:i=""})=>`1% z ka\u017Cdego zam\xF3wienia zostanie przekazane na rzecz ${i} w Twoim imieniu.`,personalImpactTitle:()=>"Obecnie wspierasz",futureTensePersonalImpactTitle:()=>"B\u0119dziesz wspiera\u0107",communityImpactTitle:()=>"Razem wspieramy",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Dowiedz si\u0119 wi\u0119cej o ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Dowiedz si\u0119 wi\u0119cej o wp\u0142ywie ${i}${e?"":" \u203A"}`,percentFunded:()=>"sfinansowano",progressPillText:()=>"\u{1F389} Wp\u0142yw rozpoczyna si\u0119 po zrealizowaniu zam\xF3wienia"},ja:{title:({causeName:i=""})=>`Your Subscription is Going Towards ${i} With Every Order`,futureTenseTitle:({causeName:i=""})=>`Your Subscription Will Go Towards ${i} With Every Order`,ctaMessagePrefix:()=>"At no extra cost, ",description:({nonprofit:i=""})=>`1% will be donated to ${i} for you, at no extra cost, every order.`,personalImpactTitle:()=>"You're Currently Funding",futureTensePersonalImpactTitle:()=>"You\u2019ll Be Funding",communityImpactTitle:()=>"Together We're Funding",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Learn about ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Learn about ${i} impact${e?"":" \u203A"}`,percentFunded:()=>"funded",progressPillText:()=>"\u{1F389} Impact begins once order is charged"}};var de=Object.defineProperty,c=(i,e,r,l)=>{for(var t=void 0,a=i.length-1,d;a>=0;a--)(d=i[a])&&(t=d(e,r,t)||t);return t&&de(e,r,t),t};class o extends w{constructor(){super(...arguments),this.baseUrl=q,this.lang="en",this.debug=!1,this.draftConfig=!1,this.isMobile=window.innerWidth<720,this.getImpactData=async()=>(te(["apiKey","beamUserId","nonprofitId"],this),await J({baseUrl:this.baseUrl,headers:re(this.apiKey),queryParams:{nonprofitId:this.nonprofitId,beamUserId:this.beamUserId,personalImpactLimit:1,communityImpactLimit:1,storeId:this.storeId,widgetName:"subscription-impact",draftConfig:this.draftConfig,version:"1.0.0",lang:this.configLang}})),this.impactDataController=new X(this,this.getImpactData),this.evaluateBreakPoints=z(()=>{this.isMobile=window.innerWidth<768},50,{maxWait:50,leading:!0}),this.resizeElements=z(()=>{S(this.impactTitleRefs),S(this.impactLinkRefs)},50,{maxWait:50,leading:!0})}get configLang(){return Q[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.evaluateBreakPoints)}async updated(e){const r=["baseUrl","storeId","apiKey","beamUserId","lang"];for(const l of r)if(e.has(l)){await this.impactDataController.exec();break}this.resizeElements(),await this.handleFontLoad(this.resizeElements)}disconnectedCallback(){window.removeEventListener("resize",this.resizeElements),document.fonts.removeEventListener("loadingdone",this.resizeElements),super.disconnectedCallback()}async handleFontLoad(e){if(document.fonts.status==="loading")return await document.fonts.ready.catch(r=>se.error(r)),e()}get cssVariables(){const e={...Y,...K,...le,"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"12px","--beam-textColor":"inherit","--beam-backgroundColor":"inherit","--beam-subscriptionImpact-impactCards-maxWidth":"900px","--beam-subscriptionImpact-headerContainer-desktop-textAlign":"left","--beam-subscriptionImpact-headerContainer-mobile-textAlign":"center","--beam-subscriptionImpact-descriptionContainer-marginTop":"10px","--beam-subscriptionImpact-cardContainer-marginTop":"15px","--beam-subscriptionImpact-cardContainer-gap":"20px","--beam-subscriptionImpact-card-borderRadius":"8px","--beam-subscriptionImpact-card-background":"#f8fbfb","--beam-subscriptionImpact-card-padding":"24px 28px 24px 24px","--beam-subscriptionImpact-card-marginRight":"0px","--beam-subscriptionImpact-card-marginTop":"10px","--beam-subscriptionImpact-card-gap":"5px","--beam-subscriptionImpact-cardTitle-textAlign":"left","--beam-subscriptionImpact-cardTitle-letterSpacing":"0.36px","--beam-SubscriptionImpact-cardStyle":"'selected_icon'","--beam-SubscriptionImpact-imagePosition":"'inline'","--beam-subscriptionImpact-imageBlock-height":"120px","--beam-subscriptionImpact-imageBlock-borderRadius":"4px","--beam-subscriptionImpact-iconBackground-width":"50px","--beam-subscriptionImpact-iconBackground-height":"50px","--beam-subscriptionImpact-iconBackground-borderRadius":"50%","--beam-subscriptionImpact-iconBackground-background":"#0a323c","--beam-subscriptionImpact-icon-height":"28px","--beam-subscriptionImpact-icon-margin":"auto","--beam-subscriptionImpact-icon-padding":"10px","--beam-subscriptionImpact-icon-borderRadius":"4px","--beam-subscriptionImpact-image-borderRadius":"4px","--beam-subscriptionImpact-image-minHeight":"0","--beam-subscriptionImpact-image-minWidth":"0","--beam-subscriptionImpact-cardDescription-padding":"0px","--beam-subscriptionImpact-card-progressBar-padding":"8px 0px","--beam-subscriptionImpact-card-progressBarLabel-gap":"10px","--beam-subscriptionImpact-card-progressBarLabel-textAlign":"right","--beam-subscriptionImpact-card-progressBarLabel-marginLeft":"8px","--beam-subscriptionImpact-card-linkContainer-textAlign":"left","--beam-subscriptionImpact-card-impactLink-textDecoration":"underline","--beam-subscriptionImpact-footer-textAlign":"center","--beam-subscriptionImpact-footer-marginTop":"10px","--beam-subscriptionImpact-share-button-icon-name":"share-2","--beam-subscriptionImpact-learnAbout-arrow-display":"block",...u("--beam-subscriptionImpact-title",{fontSize:"20px",fontWeight:"bold",lineHeight:"120%",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),...u("--beam-subscriptionImpact-descriptionPrefix",{fontSize:"14px",fontWeight:"800",lineHeight:"138%",fontStyle:"normal",color:"#2f302d",marginTop:"9px"}),...u("--beam-subscriptionImpact-description",{fontSize:"14px",fontWeight:"400",lineHeight:"138%",fontStyle:"normal",color:"#2f302d",marginTop:"9px"}),...u("--beam-subscriptionImpact-cardTitle",{fontSize:"12px",fontWeight:"bold",lineHeight:"120%",fontStyle:"normal",textTransform:"uppercase"}),...u("--beam-subscriptionImpact-cardDescription",{fontSize:"12px",fontWeight:"400",lineHeight:"18.2px",fontStyle:"normal",color:"#454a47"}),...u("--beam-subscriptionImpact-card-progressBarLabel",{fontSize:"10px",color:"#878a92"}),...u("--beam-subscriptionImpact-card-impactLink",{fontSize:"12px",fontWeight:"600",lineHeight:"16px",fontStyle:"normal",color:"#454a47",marginTop:"auto"})},r=this.impactDataController?.data?.config?.web?.theme||{},l={...e,...r};return Object.assign(Object.create({toCSS(){return Z(this)}}),l)}render(){const{data:e,loading:r,error:l}=this.impactDataController;if(r)return ne();if(l||e==null)return this.debug?ee({error:l||new Error("No data")}):"";const t=e.community[0],a=e.personal[0],d=e.chain.name,f=n(this.configLang,a?.nonprofit.cause||""),h=a?.nonprofit.name,x=a?.impact?.goalProgressPercentage||0,I=!(a?.impact?.goalProgressPercentage>0||a?.impact?.goalCompletionText?.length>0),y=t?.impact?.goalProgressPercentage||0,P=`${x}% ${n(this.configLang,e?.config?.web?.additionalStrings?.percentFunded||"")||s[this.configLang].percentFunded()}`,E=`${y}% ${n(this.configLang,e?.config?.web?.additionalStrings?.percentFunded||"")||s[this.configLang].percentFunded()}`,B=t?.imageUrl||"",F=a?.imageUrl||"",N=a?.nonprofit.causeIconUrl,W=a?.nonprofit.causeIconSelectedUrl,g=this.cssVariables["--beam-SubscriptionImpact-cardStyle"],T=this.cssVariables["--beam-SubscriptionImpact-imagePosition"],v=g==="'image'",L=g==="'selected_icon'"?W:N,R=v?B:L,U=v?F:L,M=n(this.configLang,e?.config?.web?.dynamicStrings?.ctaTitle||"")||s[this.configLang].title({causeName:f}),D=n(this.configLang,e?.config?.web?.dynamicStrings?.ctaFutureTenseTitle||"")||s[this.configLang].futureTenseTitle({causeName:f}),j=G(e.store.communityPageURL)?e.chain.communityImpactUrl:e.store.communityPageURL,V=a?.nonprofit?.website,_=a?.share?.imageUrl,H=this.cssVariables["--beam-SubscriptionImpact-share-button-icon-name"]||"share-2",k=this.cssVariables["--beam-subscriptionImpact-learnAbout-arrow-display"]==="none";return p`
|
|
14
|
+
`}render(){return p`<sl-badge pill aria-label="${this.infoText}">${this.infoText}</sl-badge>`}}me([m({type:String})],A.prototype,"infoText"),customElements.get("beam-info-pill")||customElements.define("beam-info-pill",A);const le={"--beam-pillLabel-color-background":"#0A323C","--beam-pillLabel-color":"#fff","--beam-pillLabel-border":"#0A323C","--beam-pillLabel-border-width":"1px","--beam-pillLabel-font-size":"10px","--beam-pillLabel-font":"inherit","--beam-pillLabel-font-weight":"400","--beam-pillLabel-text-transform":"none","--beam-pillLabel-font-style":"italic","--beam-pillLabel-padding":"3px 4px"},s={en:{title:({causeName:i=""})=>`Your Subscription is Going Towards ${i} With Every Order`,futureTenseTitle:({causeName:i=""})=>`Your Subscription Will Go Towards ${i} With Every Order`,ctaMessagePrefix:()=>"At no extra cost, ",description:({nonprofit:i=""})=>`1% will be donated to ${i} for you, at no extra cost, every order.`,personalImpactTitle:()=>"You're Currently Funding",futureTensePersonalImpactTitle:()=>"You\u2019ll Be Funding",communityImpactTitle:()=>"Together We're Funding",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Learn about ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Learn about ${i} impact${e?"":" \u203A"}`,percentFunded:()=>"funded",progressPillText:()=>"\u{1F389} Impact begins once order is charged"},fr:{title:({causeName:i=""})=>`Votre abonnement contribue \xE0 ${i} \xE0 chaque commande`,futureTenseTitle:({causeName:i=""})=>`Votre abonnement contribuera \xE0 ${i} \xE0 chaque commande`,ctaMessagePrefix:()=>"Sans frais suppl\xE9mentaires, ",description:({nonprofit:i=""})=>`1% de chaque commande sera revers\xE9 \xE0 ${i} pour vous, sans frais suppl\xE9mentaires.`,personalImpactTitle:()=>"Vous financez actuellement",futureTensePersonalImpactTitle:()=>"Vous financerez",communityImpactTitle:()=>"Ensemble, nous finan\xE7ons",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`En savoir plus sur ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`En savoir plus sur l\u2019impact de ${i}${e?"":" \u203A"}`,percentFunded:()=>"financ\xE9",progressPillText:()=>"\u{1F389} L\u2019impact commence une fois la commande d\xE9bit\xE9e"},de:{title:({causeName:i=""})=>`Ihr Abonnement unterst\xFCtzt ${i} mit jeder Bestellung`,futureTenseTitle:({causeName:i=""})=>`Ihr Abonnement wird ${i} mit jeder Bestellung unterst\xFCtzen`,ctaMessagePrefix:()=>"Ohne zus\xE4tzliche Kosten, ",description:({nonprofit:i=""})=>`1% jeder Bestellung wird im Rahmen Ihres Abonnements an ${i} gespendet.`,personalImpactTitle:()=>"Sie unterst\xFCtzen derzeit",futureTensePersonalImpactTitle:()=>"Sie werden unterst\xFCtzen",communityImpactTitle:()=>"Gemeinsam unterst\xFCtzen wir",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Mehr \xFCber ${i} erfahren${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Mehr \xFCber die Wirkung von ${i} erfahren${e?"":" \u203A"}`,percentFunded:()=>"finanziert",progressPillText:()=>"\u{1F389} Wirkung beginnt, sobald die Bestellung abgerechnet wird"},es:{title:({causeName:i=""})=>`Tu suscripci\xF3n est\xE1 apoyando a ${i} con cada pedido`,futureTenseTitle:({causeName:i=""})=>`Tu suscripci\xF3n apoyar\xE1 a ${i} con cada pedido`,ctaMessagePrefix:()=>"Sin coste adicional, ",description:({nonprofit:i=""})=>`El 1% de cada pedido se donar\xE1 a ${i} en tu nombre.`,personalImpactTitle:()=>"Actualmente est\xE1s financiando",futureTensePersonalImpactTitle:()=>"Financiar\xE1s",communityImpactTitle:()=>"Juntos estamos financiando",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Conoce m\xE1s sobre ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Conoce m\xE1s sobre el impacto de ${i}${e?"":" \u203A"}`,percentFunded:()=>"financiado",progressPillText:()=>"\u{1F389} El impacto comienza una vez que se procese el pedido"},it:{title:({causeName:i=""})=>`Il tuo abbonamento sostiene ${i} con ogni ordine`,futureTenseTitle:({causeName:i=""})=>`Il tuo abbonamento sosterr\xE0 ${i} con ogni ordine`,ctaMessagePrefix:()=>"Senza alcun costo aggiuntivo, ",description:({nonprofit:i=""})=>`L'1% di ogni ordine sar\xE0 donato a ${i} per te.`,personalImpactTitle:()=>"Attualmente stai finanziando",futureTensePersonalImpactTitle:()=>"Finanzierai",communityImpactTitle:()=>"Insieme stiamo finanziando",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Scopri di pi\xF9 su ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Scopri di pi\xF9 sull\u2019impatto di ${i}${e?"":" \u203A"}`,percentFunded:()=>"finanziato",progressPillText:()=>"\u{1F389} L\u2019impatto inizia una volta che l\u2019ordine \xE8 stato addebitato"},pl:{title:({causeName:i=""})=>`Twoja subskrypcja wspiera ${i} przy ka\u017Cdym zam\xF3wieniu`,futureTenseTitle:({causeName:i=""})=>`Twoja subskrypcja b\u0119dzie wspiera\u0107 ${i} przy ka\u017Cdym zam\xF3wieniu`,ctaMessagePrefix:()=>"Bez dodatkowych koszt\xF3w, ",description:({nonprofit:i=""})=>`1% z ka\u017Cdego zam\xF3wienia zostanie przekazane na rzecz ${i} w Twoim imieniu.`,personalImpactTitle:()=>"Obecnie wspierasz",futureTensePersonalImpactTitle:()=>"B\u0119dziesz wspiera\u0107",communityImpactTitle:()=>"Razem wspieramy",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Dowiedz si\u0119 wi\u0119cej o ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Dowiedz si\u0119 wi\u0119cej o wp\u0142ywie ${i}${e?"":" \u203A"}`,percentFunded:()=>"sfinansowano",progressPillText:()=>"\u{1F389} Wp\u0142yw rozpoczyna si\u0119 po zrealizowaniu zam\xF3wienia"},ja:{title:({causeName:i=""})=>`Your Subscription is Going Towards ${i} With Every Order`,futureTenseTitle:({causeName:i=""})=>`Your Subscription Will Go Towards ${i} With Every Order`,ctaMessagePrefix:()=>"At no extra cost, ",description:({nonprofit:i=""})=>`1% will be donated to ${i} for you, at no extra cost, every order.`,personalImpactTitle:()=>"You're Currently Funding",futureTensePersonalImpactTitle:()=>"You\u2019ll Be Funding",communityImpactTitle:()=>"Together We're Funding",personalLinkCopy:({nonprofit:i="",hideArrow:e=!1})=>`Learn about ${i}${e?"":" \u203A"}`,communityLinkCopy:({brandName:i="",hideArrow:e=!1})=>`Learn about ${i} impact${e?"":" \u203A"}`,percentFunded:()=>"\u652F\u63F4\u6E08\u307F",progressPillText:()=>"\u{1F389} Impact begins once order is charged"}};var de=Object.defineProperty,c=(i,e,r,l)=>{for(var t=void 0,a=i.length-1,d;a>=0;a--)(d=i[a])&&(t=d(e,r,t)||t);return t&&de(e,r,t),t};class o extends w{constructor(){super(...arguments),this.baseUrl=q,this.lang="en",this.debug=!1,this.draftConfig=!1,this.isMobile=window.innerWidth<720,this.getImpactData=async()=>(te(["apiKey","beamUserId","nonprofitId"],this),await J({baseUrl:this.baseUrl,headers:re(this.apiKey),queryParams:{nonprofitId:this.nonprofitId,beamUserId:this.beamUserId,personalImpactLimit:1,communityImpactLimit:1,storeId:this.storeId,widgetName:"subscription-impact",draftConfig:this.draftConfig,version:"1.0.0",lang:this.configLang}})),this.impactDataController=new X(this,this.getImpactData),this.evaluateBreakPoints=z(()=>{this.isMobile=window.innerWidth<768},50,{maxWait:50,leading:!0}),this.resizeElements=z(()=>{S(this.impactTitleRefs),S(this.impactLinkRefs)},50,{maxWait:50,leading:!0})}get configLang(){return Q[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.evaluateBreakPoints)}async updated(e){const r=["baseUrl","storeId","apiKey","beamUserId","lang"];for(const l of r)if(e.has(l)){await this.impactDataController.exec();break}this.resizeElements(),await this.handleFontLoad(this.resizeElements)}disconnectedCallback(){window.removeEventListener("resize",this.resizeElements),document.fonts.removeEventListener("loadingdone",this.resizeElements),super.disconnectedCallback()}async handleFontLoad(e){if(document.fonts.status==="loading")return await document.fonts.ready.catch(r=>se.error(r)),e()}get cssVariables(){const e={...Y,...K,...le,"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"12px","--beam-textColor":"inherit","--beam-backgroundColor":"inherit","--beam-subscriptionImpact-impactCards-maxWidth":"900px","--beam-subscriptionImpact-headerContainer-desktop-textAlign":"left","--beam-subscriptionImpact-headerContainer-mobile-textAlign":"center","--beam-subscriptionImpact-descriptionContainer-marginTop":"10px","--beam-subscriptionImpact-cardContainer-marginTop":"15px","--beam-subscriptionImpact-cardContainer-gap":"20px","--beam-subscriptionImpact-card-borderRadius":"8px","--beam-subscriptionImpact-card-background":"#f8fbfb","--beam-subscriptionImpact-card-padding":"24px 28px 24px 24px","--beam-subscriptionImpact-card-marginRight":"0px","--beam-subscriptionImpact-card-marginTop":"10px","--beam-subscriptionImpact-card-gap":"5px","--beam-subscriptionImpact-cardTitle-textAlign":"left","--beam-subscriptionImpact-cardTitle-letterSpacing":"0.36px","--beam-SubscriptionImpact-cardStyle":"'selected_icon'","--beam-SubscriptionImpact-imagePosition":"'inline'","--beam-subscriptionImpact-imageBlock-height":"120px","--beam-subscriptionImpact-imageBlock-borderRadius":"4px","--beam-subscriptionImpact-iconBackground-width":"50px","--beam-subscriptionImpact-iconBackground-height":"50px","--beam-subscriptionImpact-iconBackground-borderRadius":"50%","--beam-subscriptionImpact-iconBackground-background":"#0a323c","--beam-subscriptionImpact-icon-height":"28px","--beam-subscriptionImpact-icon-margin":"auto","--beam-subscriptionImpact-icon-padding":"10px","--beam-subscriptionImpact-icon-borderRadius":"4px","--beam-subscriptionImpact-image-borderRadius":"4px","--beam-subscriptionImpact-image-minHeight":"0","--beam-subscriptionImpact-image-minWidth":"0","--beam-subscriptionImpact-cardDescription-padding":"0px","--beam-subscriptionImpact-card-progressBar-padding":"8px 0px","--beam-subscriptionImpact-card-progressBarLabel-gap":"10px","--beam-subscriptionImpact-card-progressBarLabel-textAlign":"right","--beam-subscriptionImpact-card-progressBarLabel-marginLeft":"8px","--beam-subscriptionImpact-card-linkContainer-textAlign":"left","--beam-subscriptionImpact-card-impactLink-textDecoration":"underline","--beam-subscriptionImpact-footer-textAlign":"center","--beam-subscriptionImpact-footer-marginTop":"10px","--beam-subscriptionImpact-share-button-icon-name":"share-2","--beam-subscriptionImpact-learnAbout-arrow-display":"block",...u("--beam-subscriptionImpact-title",{fontSize:"20px",fontWeight:"bold",lineHeight:"120%",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),...u("--beam-subscriptionImpact-descriptionPrefix",{fontSize:"14px",fontWeight:"800",lineHeight:"138%",fontStyle:"normal",color:"#2f302d",marginTop:"9px"}),...u("--beam-subscriptionImpact-description",{fontSize:"14px",fontWeight:"400",lineHeight:"138%",fontStyle:"normal",color:"#2f302d",marginTop:"9px"}),...u("--beam-subscriptionImpact-cardTitle",{fontSize:"12px",fontWeight:"bold",lineHeight:"120%",fontStyle:"normal",textTransform:"uppercase"}),...u("--beam-subscriptionImpact-cardDescription",{fontSize:"12px",fontWeight:"400",lineHeight:"18.2px",fontStyle:"normal",color:"#454a47"}),...u("--beam-subscriptionImpact-card-progressBarLabel",{fontSize:"10px",color:"#878a92"}),...u("--beam-subscriptionImpact-card-impactLink",{fontSize:"12px",fontWeight:"600",lineHeight:"16px",fontStyle:"normal",color:"#454a47",marginTop:"auto"})},r=this.impactDataController?.data?.config?.web?.theme||{},l={...e,...r};return Object.assign(Object.create({toCSS(){return Z(this)}}),l)}render(){const{data:e,loading:r,error:l}=this.impactDataController;if(r)return ne();if(l||e==null)return this.debug?ee({error:l||new Error("No data")}):"";const t=e.community[0],a=e.personal[0],d=e.chain.name,f=n(this.configLang,a?.nonprofit.cause||""),h=a?.nonprofit.name,x=a?.impact?.goalProgressPercentage||0,I=!(a?.impact?.goalProgressPercentage>0||a?.impact?.goalCompletionText?.length>0),y=t?.impact?.goalProgressPercentage||0,P=`${x}% ${n(this.configLang,e?.config?.web?.additionalStrings?.percentFunded||"")||s[this.configLang].percentFunded()}`,F=`${y}% ${n(this.configLang,e?.config?.web?.additionalStrings?.percentFunded||"")||s[this.configLang].percentFunded()}`,E=t?.imageUrl||"",B=a?.imageUrl||"",N=a?.nonprofit.causeIconUrl,W=a?.nonprofit.causeIconSelectedUrl,g=this.cssVariables["--beam-SubscriptionImpact-cardStyle"],T=this.cssVariables["--beam-SubscriptionImpact-imagePosition"],v=g==="'image'",L=g==="'selected_icon'"?W:N,R=v?E:L,U=v?B:L,M=n(this.configLang,e?.config?.web?.dynamicStrings?.ctaTitle||"")||s[this.configLang].title({causeName:f}),D=n(this.configLang,e?.config?.web?.dynamicStrings?.ctaFutureTenseTitle||"")||s[this.configLang].futureTenseTitle({causeName:f}),j=G(e.store.communityPageURL)?e.chain.communityImpactUrl:e.store.communityPageURL,V=a?.nonprofit?.website,_=a?.share?.imageUrl,H=this.cssVariables["--beam-SubscriptionImpact-share-button-icon-name"]||"share-2",k=this.cssVariables["--beam-subscriptionImpact-learnAbout-arrow-display"]==="none";return p`
|
|
15
15
|
<style>
|
|
16
16
|
:host {
|
|
17
17
|
${this.cssVariables.toCSS()}
|
|
@@ -43,7 +43,7 @@ import{h as w,f as $,y as p,g as m,t as O,p as C}from"../chunks/lit-WqMxC_PA.esm
|
|
|
43
43
|
id="beam-subscriptionImpact-card-container"
|
|
44
44
|
>
|
|
45
45
|
${this.renderInlineCard({title:I?n(this.configLang,e?.config?.web?.additionalStrings?.futureTensePersonalImpactTitle||"")||s[this.configLang].futureTensePersonalImpactTitle():n(this.configLang,e?.config?.web?.additionalStrings?.personalImpactTitle||"")||s[this.configLang].personalImpactTitle(),image:U,description:n(this.configLang,a?.impact?.description||""),link:V,linkText:n(this.configLang,e?.config?.web?.dynamicStrings?.personalLinkCopy||"")||s[this.configLang].personalLinkCopy({nonprofit:h,hideArrow:k}),progressBarValue:x,progressBarText:P,infoPill:n(this.configLang,e?.config?.web?.additionalStrings?.progressPillText||"")||s[this.configLang].progressPillText(),imageType:g,cardType:"personal",imagePosition:T})}
|
|
46
|
-
${this.renderInlineCard({title:n(this.configLang,e?.config?.web?.additionalStrings?.communityImpactTitle||"")||s[this.configLang].communityImpactTitle(),image:R,description:n(this.configLang,t?.impact?.description||""),link:j,linkText:n(this.configLang,e?.config?.web?.dynamicStrings?.communityLinkCopy||"")||s[this.configLang].communityLinkCopy({brandName:d,hideArrow:k}),progressBarValue:y,progressBarText:
|
|
46
|
+
${this.renderInlineCard({title:n(this.configLang,e?.config?.web?.additionalStrings?.communityImpactTitle||"")||s[this.configLang].communityImpactTitle(),image:R,description:n(this.configLang,t?.impact?.description||""),link:j,linkText:n(this.configLang,e?.config?.web?.dynamicStrings?.communityLinkCopy||"")||s[this.configLang].communityLinkCopy({brandName:d,hideArrow:k}),progressBarValue:y,progressBarText:F,infoPill:n(this.configLang,e?.config?.web?.additionalStrings?.progressPillText||"")||s[this.configLang].progressPillText(),imageType:g,cardType:"community",imagePosition:T})}
|
|
47
47
|
</div>
|
|
48
48
|
</div>
|
|
49
49
|
<div class="footer" part="social-share">
|