@beamimpact/web-sdk 1.39.2 → 1.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/chunks/_share-dialog-dependencies-1vD2dmjh.esm.js +2 -0
  2. package/dist/chunks/_share-dialog-dependencies-1vD2dmjh.esm.js.map +1 -0
  3. package/dist/chunks/_share-dialog-dependencies-jvbBs-cC.esm.js +2 -0
  4. package/dist/chunks/_share-dialog-dependencies-jvbBs-cC.esm.js.map +1 -0
  5. package/dist/chunks/index-FIfx75-P.esm.js +2 -0
  6. package/dist/chunks/index-FIfx75-P.esm.js.map +1 -0
  7. package/dist/chunks/index-GocMPeWn.esm.js +2 -0
  8. package/dist/chunks/index-GocMPeWn.esm.js.map +1 -0
  9. package/dist/chunks/index-HyzTMHYl.esm.js +2 -0
  10. package/dist/chunks/index-HyzTMHYl.esm.js.map +1 -0
  11. package/dist/chunks/index-LmCqzg5B.esm.js +2 -0
  12. package/dist/chunks/index-LmCqzg5B.esm.js.map +1 -0
  13. package/dist/chunks/index-bUooCSdc.esm.js +2 -0
  14. package/dist/chunks/index-bUooCSdc.esm.js.map +1 -0
  15. package/dist/chunks/{index-XlnH7ARQ.esm.js → index-fINTvZVX.esm.js} +2 -2
  16. package/dist/chunks/{index-XlnH7ARQ.esm.js.map → index-fINTvZVX.esm.js.map} +1 -1
  17. package/dist/chunks/index-iMRMlkF3.esm.js +2 -0
  18. package/dist/chunks/index-iMRMlkF3.esm.js.map +1 -0
  19. package/dist/chunks/{index-dsJIs5Sr.esm.js → index-kxMe_AX1.esm.js} +2 -2
  20. package/dist/chunks/{index-dsJIs5Sr.esm.js.map → index-kxMe_AX1.esm.js.map} +1 -1
  21. package/dist/chunks/{order-page-6Q-6CHug.esm.js → order-page-0azkW5QD.esm.js} +2 -2
  22. package/dist/chunks/{order-page-6Q-6CHug.esm.js.map → order-page-0azkW5QD.esm.js.map} +1 -1
  23. package/dist/chunks/{order-page-mYYXHDVr.esm.js → order-page-n12hvsCN.esm.js} +2 -2
  24. package/dist/chunks/{order-page-mYYXHDVr.esm.js.map → order-page-n12hvsCN.esm.js.map} +1 -1
  25. package/dist/chunks/{routes-b8sncPq8.esm.js → routes-31m626dW.esm.js} +2 -2
  26. package/dist/chunks/{routes-b8sncPq8.esm.js.map → routes-31m626dW.esm.js.map} +1 -1
  27. package/dist/chunks/{routes-3jKReDai.esm.js → routes-sbqL3QFm.esm.js} +2 -2
  28. package/dist/chunks/{routes-3jKReDai.esm.js.map → routes-sbqL3QFm.esm.js.map} +1 -1
  29. package/dist/chunks/{update-cart-GaVMWI6J.esm.js → update-cart-NEt4A8dB.esm.js} +2 -2
  30. package/dist/chunks/{update-cart-GaVMWI6J.esm.js.map → update-cart-NEt4A8dB.esm.js.map} +1 -1
  31. package/dist/chunks/{update-cart-xW6a5_bz.esm.js → update-cart-XAwwFxhS.esm.js} +2 -2
  32. package/dist/chunks/{update-cart-xW6a5_bz.esm.js.map → update-cart-XAwwFxhS.esm.js.map} +1 -1
  33. package/dist/components/community-impact.esm.js +1 -1
  34. package/dist/components/community-impact.js +1 -1
  35. package/dist/components/cumulative-impact.esm.js +1 -1
  36. package/dist/components/cumulative-impact.esm.js.map +1 -1
  37. package/dist/components/cumulative-impact.js +1 -1
  38. package/dist/components/cumulative-impact.js.map +1 -1
  39. package/dist/components/impact-overview.esm.js +7 -7
  40. package/dist/components/impact-overview.esm.js.map +1 -1
  41. package/dist/components/impact-overview.js +7 -7
  42. package/dist/components/impact-overview.js.map +1 -1
  43. package/dist/components/index.esm.js +1 -1
  44. package/dist/components/index.js +1 -1
  45. package/dist/components/post-purchase.d.ts +1 -1
  46. package/dist/components/post-purchase.esm.js +1 -1
  47. package/dist/components/post-purchase.esm.js.map +1 -1
  48. package/dist/components/post-purchase.js +1 -1
  49. package/dist/components/post-purchase.js.map +1 -1
  50. package/dist/components/product-details-page.d.ts +2 -2
  51. package/dist/components/product-details-page.esm.js +66 -18
  52. package/dist/components/product-details-page.esm.js.map +1 -1
  53. package/dist/components/product-details-page.js +66 -18
  54. package/dist/components/product-details-page.js.map +1 -1
  55. package/dist/components/redeem-transaction.d.ts +1 -1
  56. package/dist/components/redeem-transaction.esm.js +1 -1
  57. package/dist/components/redeem-transaction.js +1 -1
  58. package/dist/components/select-nonprofit.d.ts +1 -1
  59. package/dist/components/select-nonprofit.esm.js +1 -1
  60. package/dist/components/select-nonprofit.js +1 -1
  61. package/dist/components/shopify.esm.js +1 -1
  62. package/dist/components/shopify.esm.js.map +1 -1
  63. package/dist/components/shopify.js +1 -1
  64. package/dist/components/shopify.js.map +1 -1
  65. package/dist/components/subscription-management.d.ts +1 -1
  66. package/dist/components/subscription-management.esm.js +1 -1
  67. package/dist/components/subscription-management.esm.js.map +1 -1
  68. package/dist/components/subscription-management.js +1 -1
  69. package/dist/components/subscription-management.js.map +1 -1
  70. package/dist/index.esm.js +1 -1
  71. package/dist/index.js +1 -1
  72. package/dist/integrations/beam.esm.js +1 -1
  73. package/dist/integrations/beam.js +1 -1
  74. package/dist/integrations/cart.esm.js +1 -1
  75. package/dist/integrations/cart.js +1 -1
  76. package/dist/integrations/index.esm.js +1 -1
  77. package/dist/integrations/index.js +1 -1
  78. package/dist/integrations/logs.esm.js +1 -1
  79. package/dist/integrations/logs.js +1 -1
  80. package/dist/integrations/shopify.esm.js +1 -1
  81. package/dist/integrations/shopify.js +1 -1
  82. package/dist/integrations/statsig.esm.js +1 -1
  83. package/dist/integrations/statsig.js +1 -1
  84. package/dist/react/community-impact.esm.js +1 -1
  85. package/dist/react/community-impact.js +1 -1
  86. package/dist/react/cumulative-impact.esm.js +1 -1
  87. package/dist/react/cumulative-impact.js +1 -1
  88. package/dist/react/impact-overview.esm.js +1 -1
  89. package/dist/react/impact-overview.esm.js.map +1 -1
  90. package/dist/react/impact-overview.js +1 -1
  91. package/dist/react/impact-overview.js.map +1 -1
  92. package/dist/react/index.esm.js +1 -1
  93. package/dist/react/index.js +1 -1
  94. package/dist/react/post-purchase.esm.js +1 -1
  95. package/dist/react/post-purchase.esm.js.map +1 -1
  96. package/dist/react/post-purchase.js +1 -1
  97. package/dist/react/post-purchase.js.map +1 -1
  98. package/dist/react/product-details-page.esm.js +1 -1
  99. package/dist/react/product-details-page.esm.js.map +1 -1
  100. package/dist/react/product-details-page.js +1 -1
  101. package/dist/react/product-details-page.js.map +1 -1
  102. package/dist/react/redeem-transaction.esm.js +1 -1
  103. package/dist/react/redeem-transaction.js +1 -1
  104. package/dist/react/select-nonprofit.esm.js +1 -1
  105. package/dist/react/select-nonprofit.js +1 -1
  106. package/dist/react/subscription-management.esm.js +1 -1
  107. package/dist/react/subscription-management.esm.js.map +1 -1
  108. package/dist/react/subscription-management.js +1 -1
  109. package/dist/react/subscription-management.js.map +1 -1
  110. package/package.json +1 -1
  111. package/dist/chunks/_share-dialog-dependencies-K7WZWxUL.esm.js +0 -2
  112. package/dist/chunks/_share-dialog-dependencies-K7WZWxUL.esm.js.map +0 -1
  113. package/dist/chunks/_share-dialog-dependencies-VjhRF4_b.esm.js +0 -2
  114. package/dist/chunks/_share-dialog-dependencies-VjhRF4_b.esm.js.map +0 -1
  115. package/dist/chunks/index-EUMlzqI-.esm.js +0 -2
  116. package/dist/chunks/index-EUMlzqI-.esm.js.map +0 -1
  117. package/dist/chunks/index-U5URUABu.esm.js +0 -2
  118. package/dist/chunks/index-U5URUABu.esm.js.map +0 -1
  119. package/dist/chunks/index-VELk9_yH.esm.js +0 -2
  120. package/dist/chunks/index-VELk9_yH.esm.js.map +0 -1
  121. package/dist/chunks/index-q_XLkvqc.esm.js +0 -2
  122. package/dist/chunks/index-q_XLkvqc.esm.js.map +0 -1
  123. package/dist/chunks/index-xR738adx.esm.js +0 -2
  124. package/dist/chunks/index-xR738adx.esm.js.map +0 -1
  125. package/dist/chunks/index-xfPSpbUV.esm.js +0 -2
  126. package/dist/chunks/index-xfPSpbUV.esm.js.map +0 -1
  127. package/dist/chunks/shoelace-components-7XWYNn-Z.esm.js +0 -2
  128. package/dist/chunks/shoelace-components-7XWYNn-Z.esm.js.map +0 -1
  129. package/dist/chunks/shoelace-components-paAsUPkU.esm.js +0 -2
  130. package/dist/chunks/shoelace-components-paAsUPkU.esm.js.map +0 -1
@@ -1,8 +1,23 @@
1
- import{j as u,f as b,g as d,h as m,y as s,k as D}from"../chunks/lit-qtGbjGnK.esm.js";import{c as h,u as g,d as f,e as v,A as y,_ as x,i as P,a as p,b as C}from"../chunks/localize-F31ae3j6.esm.js";import{D as $,i as k,W as F,S}from"../chunks/routes-b8sncPq8.esm.js";import{makeApiKeyHeader as T}from"../utils/makeApiKeyHeader.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";import"../chunks/shoelace-components-7XWYNn-Z.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";const w=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},G=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return u(` border-radius: var(${a}-borderRadius, ${e});
1
+ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-qtGbjGnK.esm.js";import{c as D,u as g,d as f,e as v,A as y,_ as x,i as u,a as p,b as k}from"../chunks/localize-F31ae3j6.esm.js";import{D as w,j as C,W as $,S as F}from"../chunks/routes-31m626dW.esm.js";import{makeApiKeyHeader as T}from"../utils/makeApiKeyHeader.esm.js";import{c as S}from"../chunks/responsive-aWj_7ZN_.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";const G=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},I=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return P(` border-radius: var(${a}-borderRadius, ${e});
2
2
  border-style: var(${a}-borderStyle, ${t});
3
3
  border-color: var(${a}-borderColor, ${o});
4
4
  border-width: var(${a}-borderWidth, ${i});
5
- `)};var I=Object.defineProperty,W=Object.getOwnPropertyDescriptor,n=(r,e,t,o)=>{for(var i=o>1?void 0:o?W(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(o?c(e,t,i):c(i))||i);return o&&i&&I(e,t,i),i};const A="--beam-ProductDetailsPage-imageUrl";class l extends m{constructor(){super(...arguments),this.baseUrl=$,this.lang="en",this.debug=!1,this.getProductDetailsPageData=async()=>(v(["apiKey","storeId"],this),await k({baseUrl:this.baseUrl,headers:T(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:F.product_details_page}})),this.productDetailsPageDataController=new y(this,this.getProductDetailsPageData)}get configLang(){return S[this.lang]||"en"}async updated(e){const t=["storeId","baseUrl","lang","apiKey"];for(const o of t)if(e.has(o)){await this.productDetailsPageDataController.exec();break}}renderWidgetIcon(){const e=this.cssVariables[A];return e?s`
5
+ `)},L=()=>s` <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ width="24"
8
+ height="24"
9
+ viewBox="0 0 24 24"
10
+ fill="none"
11
+ stroke="currentColor"
12
+ stroke-width="2"
13
+ stroke-linecap="round"
14
+ stroke-linejoin="round"
15
+ part="svg"
16
+ >
17
+ <circle cx="12" cy="12" r="10"></circle>
18
+ <path d="M12 16v-4"></path>
19
+ <path d="M12 8h.01"></path>
20
+ </svg>`;var W=Object.defineProperty,A=Object.getOwnPropertyDescriptor,c=(r,e,t,o)=>{for(var i=o>1?void 0:o?A(e,t):e,a=r.length-1,n;a>=0;a--)(n=r[a])&&(i=(o?n(e,t,i):n(i))||i);return o&&i&&W(e,t,i),i};const R="--beam-ProductDetailsPage-imageUrl";class l extends m{constructor(){super(...arguments),this.baseUrl=w,this.lang="en",this.debug=!1,this.getProductDetailsPageData=async()=>(v(["apiKey","storeId"],this),await C({baseUrl:this.baseUrl,headers:T(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:$.product_details_page}})),this.productDetailsPageDataController=new y(this,this.getProductDetailsPageData)}get configLang(){return F[this.lang]||"en"}async updated(e){const t=["storeId","baseUrl","lang","apiKey"];for(const o of t)if(e.has(o)){await this.productDetailsPageDataController.exec();break}}renderWidgetIcon(){const e=this.cssVariables[R];return e?s`
6
21
  <span class="icon-container">
7
22
  <img src=${e} alt="Widget Icon"></img>
8
23
  </span>
@@ -16,23 +31,34 @@ import{j as u,f as b,g as d,h as m,y as s,k as D}from"../chunks/lit-qtGbjGnK.esm
16
31
  ${this.renderWidgetIcon()}
17
32
  <span class="info-container">
18
33
  <div class="title-block">
19
- <h3 class="title">${P(this.configLang,e.config?.web?.title)}</h3>
34
+ <h3 class="title">${u(this.configLang,e.config?.web?.title)}</h3>
20
35
  </div>
21
36
  <div class="description-block">
22
- <span class="description"> ${P(this.configLang,e.config?.web?.description)}</span
37
+ <span class="description"> ${u(this.configLang,e.config?.web?.description)}</span
23
38
  >${this.renderDisclosureTooltip()}
24
39
  </div>
25
40
  </span>
26
41
  </div>
27
- `}renderDisclosureTooltip(){const e=this.productDetailsPageDataController.data?.ppgfDisclosure;return e?s`<sl-tooltip class="ppgf-disclosure-tooltip">
28
- <div class="ppgf-disclosure-tooltip-content" slot="content">${D(e.copy)}</div>
29
- ${this.renderDisclosureTooltipIcon()}
30
- </sl-tooltip>`:s``}renderDisclosureTooltipIcon(){return s`<sl-icon
31
- library="lucide"
32
- name="info"
33
- label="ppgf-disclosure-tooltip-icon"
34
- class="ppgf-disclosure-tooltip-icon"
35
- ></sl-icon>`}renderDisclosureTooltipHyperlink(){const e=this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;return e?s`<a class="ppgf-disclosure-hyperlink" href="${e.url}" target="_blank">${e.copy}</a>`:s``}get cssVariables(){const e={"--beam-ProductDetailsPage-imageWidth":"24px","--beam-ProductDetailsPage-imageHeight":"24px","--beam-ProductDetailsPage-maxWidth":"346px","--beam-ProductDetailsPage-paddingTop":"8px","--beam-ProductDetailsPage-paddingRight":"12px","--beam-ProductDetailsPage-paddingBottom":"8px","--beam-ProductDetailsPage-paddingLeft":"15px","--beam-ProductDetailsPage-InfoContainer-marginLeft":"8px","--beam-ProductDetailsPage-backgroundColor":"unset","--beam-ProductDetailsPage-TooltipIcon-width":"10px","--beam-ProductDetailsPage-TooltipIcon-color":"inherit","--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor":"#000000","--beam-ProductDetailsPage-PPGFDisclosure-paddingTop":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingRight":"8px","--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft":"8px","--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color":"#5CA3FF",...p("--beam-ProductDetailsPage-title",{fontSize:"12px",fontWeight:"bold"}),"--beam-ProductDetailsPage-title-textAlign":"left",...p("--beam-ProductDetailsPage-description",{marginTop:"4px",fontSize:"12px",lineHeight:"15px"}),"--beam-ProductDetailsPage-description-textAlign":"left",...p("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent",{fontSize:"12px",lineHeight:"16px",color:"#FFFFFF"}),...w("--beam-ProductDetailsPage")},t=this.productDetailsPageDataController?.data?.config?.web?.theme||{},o={...e,...t};return Object.assign(Object.create({toCSS(){return C(this)}}),o)}}l.tagName="beam-product-details-page",l.styles=[h,b`
42
+ `}renderCloseTooltipIcon(){return s`<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
43
+ <path
44
+ d="M5.40836 5.40811L1.48828 1.48804M5.40836 5.40811L9.32843 9.32819M5.40836 5.40811L9.32843 1.48804M5.40836 5.40811L1.48828 9.32819"
45
+ stroke="white"
46
+ stroke-width="1.56803"
47
+ stroke-linecap="round"
48
+ stroke-linejoin="round"
49
+ />
50
+ </svg> `}renderDisclosureTooltip(){const e=()=>{const o=this.renderRoot.querySelector(".ppgf-disclosure-tooltip");o.open=!1},t=this.productDetailsPageDataController.data?.ppgfDisclosure;return t?s`<sl-tooltip class="ppgf-disclosure-tooltip">
51
+ <div class="ppgf-disclosure-tooltip-content" slot="content">
52
+ <button class="ppgf-disclosure-close" aria-label="Close tooltip" @click="${e}">
53
+ ${this.renderCloseTooltipIcon()}
54
+ </button>
55
+ <div class="ppgf-disclosure-tooltip-copy">${h(t.copy)}</div>
56
+ </div>
57
+ <span class="ppgf-disclosure-tooltip-trigger">
58
+ <div class="ppgf-disclosure-tooltip-trigger-mask d-lg-none"></div>
59
+ ${L()}
60
+ </span>
61
+ </sl-tooltip>`:s``}renderDisclosureTooltipHyperlink(){const e=this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;return e?s`<a class="ppgf-disclosure-hyperlink" href="${e.url}" target="_blank">${e.copy}</a>`:s``}get cssVariables(){const e={"--beam-ProductDetailsPage-imageWidth":"24px","--beam-ProductDetailsPage-imageHeight":"24px","--beam-ProductDetailsPage-maxWidth":"346px","--beam-ProductDetailsPage-paddingTop":"8px","--beam-ProductDetailsPage-paddingRight":"12px","--beam-ProductDetailsPage-paddingBottom":"8px","--beam-ProductDetailsPage-paddingLeft":"15px","--beam-ProductDetailsPage-InfoContainer-marginLeft":"8px","--beam-ProductDetailsPage-backgroundColor":"unset","--beam-ProductDetailsPage-TooltipIcon-width":"10px","--beam-ProductDetailsPage-TooltipIcon-color":"inherit","--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor":"#000000","--beam-ProductDetailsPage-PPGFDisclosure-paddingTop":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingRight":"8px","--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft":"8px","--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color":"#5CA3FF",...p("--beam-ProductDetailsPage-title",{fontSize:"12px",fontWeight:"bold"}),"--beam-ProductDetailsPage-title-textAlign":"left",...p("--beam-ProductDetailsPage-description",{marginTop:"4px",fontSize:"12px",lineHeight:"15px"}),"--beam-ProductDetailsPage-description-textAlign":"left",...p("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent",{fontSize:"12px",lineHeight:"16px",color:"#FFFFFF"}),...G("--beam-ProductDetailsPage"),"--beam-ProductDetailsPage-close-display":"initial","--beam-ProductDetailsPage-close-padding":"0"},t=this.productDetailsPageDataController?.data?.config?.web?.theme||{},o={...e,...t};return Object.assign(Object.create({toCSS(){return k(this)}}),o)}}l.tagName="beam-product-details-page",l.styles=[D,S,b`
36
62
  :host {
37
63
  font-family: var(--beam-fontFamily);
38
64
  font-style: var(--beam-fontStyle);
@@ -52,7 +78,7 @@ import{j as u,f as b,g as d,h as m,y as s,k as D}from"../chunks/lit-qtGbjGnK.esm
52
78
  padding-left: var(--beam-ProductDetailsPage-paddingLeft);
53
79
  width: 100%;
54
80
  background-color: var(--beam-ProductDetailsPage-backgroundColor);
55
- ${G("--beam-ProductDetailsPage")}
81
+ ${I("--beam-ProductDetailsPage")}
56
82
  }
57
83
  .icon-container {
58
84
  width: var(--beam-ProductDetailsPage-imageWidth);
@@ -95,20 +121,42 @@ import{j as u,f as b,g as d,h as m,y as s,k as D}from"../chunks/lit-qtGbjGnK.esm
95
121
  background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);
96
122
  }
97
123
  .ppgf-disclosure-tooltip-content {
124
+ display: flex;
125
+ flex-direction: column;
98
126
  ${g("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent")}
99
127
  }
100
- .ppgf-disclosure-tooltip-content > a {
128
+ .ppgf-disclosure-tooltip-copy > a,
129
+ .ppgf-disclosure-close {
101
130
  pointer-events: auto;
102
131
  color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);
103
132
  }
104
- .ppgf-disclosure-hyperlink:visited {
133
+ .ppgf-disclosure-close {
134
+ display: var(--beam-ProductDetailsPage-close-display);
135
+ padding: var(--beam-ProductDetailsPage-close-padding);
136
+ height: 12px;
137
+ background: none;
138
+ border: none;
139
+ margin-left: auto;
140
+ }
141
+ .ppgf-disclosure-tooltip-copy > a:visited {
105
142
  color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);
106
143
  }
107
- .ppgf-disclosure-tooltip-icon {
144
+ .ppgf-disclosure-tooltip-trigger {
145
+ position: relative;
146
+ }
147
+ .ppgf-disclosure-tooltip-trigger-mask {
148
+ position: absolute;
149
+ top: 50%;
150
+ left: 50%;
151
+ transform: translate(-50%, -50%);
152
+ width: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);
153
+ height: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);
154
+ }
155
+ .ppgf-disclosure-tooltip-trigger > svg {
108
156
  width: var(--beam-ProductDetailsPage-TooltipIcon-width);
109
157
  color: var(--beam-ProductDetailsPage-TooltipIcon-color);
110
158
  height: auto;
111
159
  vertical-align: middle;
112
160
  }
113
- `],n([d({type:String,reflect:!0})],l.prototype,"baseUrl",2),n([d({type:String,reflect:!1})],l.prototype,"apiKey",2),n([d({type:Number})],l.prototype,"storeId",2),n([d({type:String})],l.prototype,"lang",2),n([d({type:Boolean})],l.prototype,"debug",2),f(l);export{l as BeamProductDetailsPage};
161
+ `],c([d({type:String,reflect:!0})],l.prototype,"baseUrl",2),c([d({type:String,reflect:!1})],l.prototype,"apiKey",2),c([d({type:Number})],l.prototype,"storeId",2),c([d({type:String})],l.prototype,"lang",2),c([d({type:Boolean})],l.prototype,"debug",2),f(l);export{l as BeamProductDetailsPage};
114
162
  //# sourceMappingURL=product-details-page.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-details-page.esm.js","sources":["../../src/shared/fragments/custom-border.ts","../../src/components/product-details-page/index.ts"],"sourcesContent":["import { CSSResult, unsafeCSS } from \"lit\";\n\nexport const defineCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n [`${prefix}-borderRadius`]: borderRadius,\n [`${prefix}-borderStyle`]: borderStyle,\n [`${prefix}-borderColor`]: borderColor,\n [`${prefix}-borderWidth`]: borderWidth,\n };\n};\n\nexport const useCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): CSSResult => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return unsafeCSS(`\\\n border-radius: var(${prefix}-borderRadius, ${borderRadius});\n border-style: var(${prefix}-borderStyle, ${borderStyle});\n border-color: var(${prefix}-borderColor, ${borderColor});\n border-width: var(${prefix}-borderWidth, ${borderWidth});\n `);\n};\n","import { LitElement, css, html } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { getProductDetailsPage } from \"../../api-sdk/v3/routes\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES, WIDGET_NAMES } from \"../../api-sdk/constants\";\nimport { LANGUAGES, TUrl } from \"../../api-sdk/types\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { MissingConfig } from \"../../utils/beam-errors\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { defineCustomBorder, useCustomBorder } from \"../../shared/fragments/custom-border\";\n\n// shoelace html tag imports\nimport \"@shoelace-style/shoelace/dist/components/tooltip/tooltip.js\";\nimport \"../../shared/shoelace-components\";\n\ntype RequiredConfig = {\n apiKey: string;\n storeId: number;\n};\n\nconst IMAGE_URL_REMOTE_CONFIG_KEY = \"--beam-ProductDetailsPage-imageUrl\";\n\nexport class BeamProductDetailsPage extends LitElement {\n static tagName = \"beam-product-details-page\";\n\n @property({ type: String, reflect: true }) public baseUrl: TUrl = DEFAULT_BASE_URL;\n\n @property({ type: String, reflect: false }) apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) storeId?: number;\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public debug = false;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n getProductDetailsPageData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"storeId\"], this)) throw new MissingConfig();\n\n const res = await getProductDetailsPage({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n queryParams: {\n version: \"1.0.0\",\n lang: this.configLang,\n storeId: this.storeId,\n widgetName: WIDGET_NAMES.product_details_page,\n },\n });\n return res;\n };\n\n private productDetailsPageDataController = new AsyncController<typeof this.getProductDetailsPageData>(\n this,\n this.getProductDetailsPageData\n );\n\n async updated(changedProperties: Map<string, unknown>) {\n const requireNewDataProps = [\"storeId\", \"baseUrl\", \"lang\", \"apiKey\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.productDetailsPageDataController.exec();\n break;\n }\n }\n }\n\n renderWidgetIcon() {\n const imageUrl = this.cssVariables[IMAGE_URL_REMOTE_CONFIG_KEY];\n\n return imageUrl\n ? html`\n <span class=\"icon-container\">\n <img src=${imageUrl} alt=\"Widget Icon\"></img>\n </span>\n `\n : html``;\n }\n\n render() {\n const { data, loading } = this.productDetailsPageDataController;\n if (loading) {\n return html``;\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new Error(\"No data\") });\n }\n return \"\";\n }\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div class=\"root\">\n ${this.renderWidgetIcon()}\n <span class=\"info-container\">\n <div class=\"title-block\">\n <h3 class=\"title\">${localizeUserString(this.configLang, data.config?.web?.title)}</h3>\n </div>\n <div class=\"description-block\">\n <span class=\"description\"> ${localizeUserString(this.configLang, data.config?.web?.description)}</span\n >${this.renderDisclosureTooltip()}\n </div>\n </span>\n </div>\n `;\n }\n\n /* PayPal Giving Fund Disclosure */\n renderDisclosureTooltip() {\n const ppgfDisclosure = this.productDetailsPageDataController.data?.ppgfDisclosure;\n return ppgfDisclosure\n ? html`<sl-tooltip class=\"ppgf-disclosure-tooltip\">\n <div class=\"ppgf-disclosure-tooltip-content\" slot=\"content\">${unsafeHTML(ppgfDisclosure.copy)}</div>\n ${this.renderDisclosureTooltipIcon()}\n </sl-tooltip>`\n : html``;\n }\n\n renderDisclosureTooltipIcon() {\n return html`<sl-icon\n library=\"lucide\"\n name=\"info\"\n label=\"ppgf-disclosure-tooltip-icon\"\n class=\"ppgf-disclosure-tooltip-icon\"\n ></sl-icon>`;\n }\n\n renderDisclosureTooltipHyperlink() {\n const ppgfHyperlink = this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;\n return ppgfHyperlink\n ? html`<a class=\"ppgf-disclosure-hyperlink\" href=\"${ppgfHyperlink.url}\" target=\"_blank\">${ppgfHyperlink.copy}</a>`\n : html``;\n }\n /* End PayPal Giving Fund Disclosure */\n\n public get cssVariables() {\n const defaults = {\n \"--beam-ProductDetailsPage-imageWidth\": \"24px\",\n \"--beam-ProductDetailsPage-imageHeight\": \"24px\",\n \"--beam-ProductDetailsPage-maxWidth\": \"346px\",\n \"--beam-ProductDetailsPage-paddingTop\": \"8px\",\n \"--beam-ProductDetailsPage-paddingRight\": \"12px\",\n \"--beam-ProductDetailsPage-paddingBottom\": \"8px\",\n \"--beam-ProductDetailsPage-paddingLeft\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginLeft\": \"8px\",\n \"--beam-ProductDetailsPage-backgroundColor\": \"unset\",\n \"--beam-ProductDetailsPage-TooltipIcon-width\": \"10px\",\n \"--beam-ProductDetailsPage-TooltipIcon-color\": \"inherit\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor\": \"#000000\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingTop\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingRight\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color\": \"#5CA3FF\",\n ...defineCustomText(\"--beam-ProductDetailsPage-title\", {\n fontSize: \"12px\",\n fontWeight: \"bold\",\n }),\n \"--beam-ProductDetailsPage-title-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-description\", {\n marginTop: \"4px\",\n fontSize: \"12px\",\n lineHeight: \"15px\",\n }),\n \"--beam-ProductDetailsPage-description-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\", {\n fontSize: \"12px\",\n lineHeight: \"16px\",\n color: \"#FFFFFF\",\n }),\n ...defineCustomBorder(\"--beam-ProductDetailsPage\"),\n };\n const remoteConfig = this.productDetailsPageDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n css`\n :host {\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-ProductDetailsPage-maxWidth);\n word-break: normal;\n display: block;\n }\n .root {\n display: flex;\n align-items: center;\n padding-top: var(--beam-ProductDetailsPage-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-paddingLeft);\n width: 100%;\n background-color: var(--beam-ProductDetailsPage-backgroundColor);\n ${useCustomBorder(\"--beam-ProductDetailsPage\")}\n }\n .icon-container {\n width: var(--beam-ProductDetailsPage-imageWidth);\n height: var(--beam-ProductDetailsPage-imageHeight);\n flex-shrink: 0;\n }\n .icon-container > img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .info-container {\n margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);\n }\n .title {\n ${useCustomText(\"--beam-ProductDetailsPage-title\")}\n }\n .title-block {\n text-align: var(--beam-ProductDetailsPage-title-textAlign);\n line-height: var(--beam-ProductDetailsPage-title-lineHeight);\n }\n .description {\n ${useCustomText(\"--beam-ProductDetailsPage-description\")}\n }\n .description-block {\n text-align: var(--beam-ProductDetailsPage-description-textAlign);\n line-height: var(--beam-ProductDetailsPage-description-lineHeight);\n }\n .ppgf-disclosure-tooltip {\n --max-width: 268px;\n }\n .ppgf-disclosure-tooltip::part(body) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n padding-top: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft);\n }\n .ppgf-disclosure-tooltip::part(base__arrow) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n }\n .ppgf-disclosure-tooltip-content {\n ${useCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\")}\n }\n .ppgf-disclosure-tooltip-content > a {\n pointer-events: auto;\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-hyperlink:visited {\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-tooltip-icon {\n width: var(--beam-ProductDetailsPage-TooltipIcon-width);\n color: var(--beam-ProductDetailsPage-TooltipIcon-color);\n height: auto;\n vertical-align: middle;\n }\n `,\n ];\n}\n\ndefineCustomElement(BeamProductDetailsPage);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-product-details-page\": BeamProductDetailsPage;\n }\n}\n"],"names":["defineCustomBorder","namespace","borderRadius","borderStyle","borderColor","borderWidth","prefix","useCustomBorder","unsafeCSS","IMAGE_URL_REMOTE_CONFIG_KEY","BeamProductDetailsPage","LitElement","DEFAULT_BASE_URL","enforceConfig","getProductDetailsPage","makeApiKeyHeader","WIDGET_NAMES","AsyncController","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","imageUrl","html","data","loading","_errorMessage","localizeUserString","ppgfDisclosure","unsafeHTML","ppgfHyperlink","defaults","defineCustomText","remoteConfig","config","_cssVariableMap","cssReset","css","useCustomText","__decorateClass","property","defineCustomElement"],"mappings":"yfAEO,MAAMA,EAAqB,CAChCC,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EAAc,KAAM,EAAI,CAAA,IACrE,CAC3B,MAAMC,EAASL,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,MAAO,CACL,CAAC,GAAGK,CAAM,eAAe,EAAGJ,EAC5B,CAAC,GAAGI,CAAM,cAAc,EAAGH,EAC3B,CAAC,GAAG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A,EAEN6B,EAAA,CAA3CC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAM,CAAC,CAL/B,EAAA9B,EAKiC,UAEhB6B,SAAAA,CAAAA,EAAAA,EAAA,CAA3BC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAPf9B,EAOiB,UAAA,UAAA,CAAA,EAEO6B,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EATf9B,EASwB,UAEC6B,OAAAA,CAAAA,EAAAA,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAXhB,EAAA9B,EAWyB,UAmPtC+B,QAAAA,CAAAA,EAAAA,EAAoB/B,CAAsB"}
1
+ {"version":3,"file":"product-details-page.esm.js","sources":["../../src/shared/fragments/custom-border.ts","../../src/shared/fragments/info.ts","../../src/components/product-details-page/index.ts"],"sourcesContent":["import { CSSResult, unsafeCSS } from \"lit\";\n\nexport const defineCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n [`${prefix}-borderRadius`]: borderRadius,\n [`${prefix}-borderStyle`]: borderStyle,\n [`${prefix}-borderColor`]: borderColor,\n [`${prefix}-borderWidth`]: borderWidth,\n };\n};\n\nexport const useCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): CSSResult => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return unsafeCSS(`\\\n border-radius: var(${prefix}-borderRadius, ${borderRadius});\n border-style: var(${prefix}-borderStyle, ${borderStyle});\n border-color: var(${prefix}-borderColor, ${borderColor});\n border-width: var(${prefix}-borderWidth, ${borderWidth});\n `);\n};\n","import { html } from \"lit\";\n\nexport const _info = () => html` <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n part=\"svg\"\n>\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <path d=\"M12 16v-4\"></path>\n <path d=\"M12 8h.01\"></path>\n</svg>`;\n","import { LitElement, css, html } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { getProductDetailsPage } from \"../../api-sdk/v3/routes\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES, WIDGET_NAMES } from \"../../api-sdk/constants\";\nimport { LANGUAGES, TUrl } from \"../../api-sdk/types\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { MissingConfig } from \"../../utils/beam-errors\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { cssResponsiveUtils } from \"../../shared/responsive\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { defineCustomBorder, useCustomBorder } from \"../../shared/fragments/custom-border\";\n// shoelace html tag imports\nimport \"@shoelace-style/shoelace/dist/components/tooltip/tooltip.js\";\nimport { _info } from \"../../shared/fragments/info\";\n\ntype RequiredConfig = {\n apiKey: string;\n storeId: number;\n};\n\nconst IMAGE_URL_REMOTE_CONFIG_KEY = \"--beam-ProductDetailsPage-imageUrl\";\n\nexport class BeamProductDetailsPage extends LitElement {\n static tagName = \"beam-product-details-page\";\n\n @property({ type: String, reflect: true }) public baseUrl: TUrl = DEFAULT_BASE_URL;\n\n @property({ type: String, reflect: false }) apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) storeId?: number;\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public debug = false;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n getProductDetailsPageData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"storeId\"], this)) throw new MissingConfig();\n\n const res = await getProductDetailsPage({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n queryParams: {\n version: \"1.0.0\",\n lang: this.configLang,\n storeId: this.storeId,\n widgetName: WIDGET_NAMES.product_details_page,\n },\n });\n return res;\n };\n\n private productDetailsPageDataController = new AsyncController<typeof this.getProductDetailsPageData>(\n this,\n this.getProductDetailsPageData\n );\n\n async updated(changedProperties: Map<string, unknown>) {\n const requireNewDataProps = [\"storeId\", \"baseUrl\", \"lang\", \"apiKey\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.productDetailsPageDataController.exec();\n break;\n }\n }\n }\n\n renderWidgetIcon() {\n const imageUrl = this.cssVariables[IMAGE_URL_REMOTE_CONFIG_KEY];\n\n return imageUrl\n ? html`\n <span class=\"icon-container\">\n <img src=${imageUrl} alt=\"Widget Icon\"></img>\n </span>\n `\n : html``;\n }\n\n render() {\n const { data, loading } = this.productDetailsPageDataController;\n if (loading) {\n return html``;\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new Error(\"No data\") });\n }\n return \"\";\n }\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div class=\"root\">\n ${this.renderWidgetIcon()}\n <span class=\"info-container\">\n <div class=\"title-block\">\n <h3 class=\"title\">${localizeUserString(this.configLang, data.config?.web?.title)}</h3>\n </div>\n <div class=\"description-block\">\n <span class=\"description\"> ${localizeUserString(this.configLang, data.config?.web?.description)}</span\n >${this.renderDisclosureTooltip()}\n </div>\n </span>\n </div>\n `;\n }\n\n renderCloseTooltipIcon() {\n return html`<svg width=\"11\" height=\"11\" viewBox=\"0 0 11 11\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M5.40836 5.40811L1.48828 1.48804M5.40836 5.40811L9.32843 9.32819M5.40836 5.40811L9.32843 1.48804M5.40836 5.40811L1.48828 9.32819\"\n stroke=\"white\"\n stroke-width=\"1.56803\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg> `;\n }\n\n /* PayPal Giving Fund Disclosure */\n renderDisclosureTooltip() {\n const onClickClose = () => {\n // due to being strictly html, we need to assume any when overriding shoelace properties\n const tooltip = this.renderRoot.querySelector(\".ppgf-disclosure-tooltip\") as any;\n tooltip.open = false;\n };\n const ppgfDisclosure = this.productDetailsPageDataController.data?.ppgfDisclosure;\n return ppgfDisclosure\n ? html`<sl-tooltip class=\"ppgf-disclosure-tooltip\">\n <div class=\"ppgf-disclosure-tooltip-content\" slot=\"content\">\n <button class=\"ppgf-disclosure-close\" aria-label=\"Close tooltip\" @click=\"${onClickClose}\">\n ${this.renderCloseTooltipIcon()}\n </button>\n <div class=\"ppgf-disclosure-tooltip-copy\">${unsafeHTML(ppgfDisclosure.copy)}</div>\n </div>\n <span class=\"ppgf-disclosure-tooltip-trigger\">\n <div class=\"ppgf-disclosure-tooltip-trigger-mask d-lg-none\"></div>\n ${_info()}\n </span>\n </sl-tooltip>`\n : html``;\n }\n\n renderDisclosureTooltipHyperlink() {\n const ppgfHyperlink = this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;\n return ppgfHyperlink\n ? html`<a class=\"ppgf-disclosure-hyperlink\" href=\"${ppgfHyperlink.url}\" target=\"_blank\">${ppgfHyperlink.copy}</a>`\n : html``;\n }\n /* End PayPal Giving Fund Disclosure */\n\n public get cssVariables() {\n const defaults = {\n \"--beam-ProductDetailsPage-imageWidth\": \"24px\",\n \"--beam-ProductDetailsPage-imageHeight\": \"24px\",\n \"--beam-ProductDetailsPage-maxWidth\": \"346px\",\n \"--beam-ProductDetailsPage-paddingTop\": \"8px\",\n \"--beam-ProductDetailsPage-paddingRight\": \"12px\",\n \"--beam-ProductDetailsPage-paddingBottom\": \"8px\",\n \"--beam-ProductDetailsPage-paddingLeft\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginLeft\": \"8px\",\n \"--beam-ProductDetailsPage-backgroundColor\": \"unset\",\n \"--beam-ProductDetailsPage-TooltipIcon-width\": \"10px\",\n \"--beam-ProductDetailsPage-TooltipIcon-color\": \"inherit\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor\": \"#000000\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingTop\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingRight\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color\": \"#5CA3FF\",\n ...defineCustomText(\"--beam-ProductDetailsPage-title\", {\n fontSize: \"12px\",\n fontWeight: \"bold\",\n }),\n \"--beam-ProductDetailsPage-title-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-description\", {\n marginTop: \"4px\",\n fontSize: \"12px\",\n lineHeight: \"15px\",\n }),\n \"--beam-ProductDetailsPage-description-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\", {\n fontSize: \"12px\",\n lineHeight: \"16px\",\n color: \"#FFFFFF\",\n }),\n ...defineCustomBorder(\"--beam-ProductDetailsPage\"),\n \"--beam-ProductDetailsPage-close-display\": \"initial\",\n \"--beam-ProductDetailsPage-close-padding\": \"0\",\n };\n const remoteConfig = this.productDetailsPageDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n cssResponsiveUtils,\n css`\n :host {\n 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-ProductDetailsPage-maxWidth);\n word-break: normal;\n display: block;\n }\n .root {\n display: flex;\n align-items: center;\n padding-top: var(--beam-ProductDetailsPage-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-paddingLeft);\n width: 100%;\n background-color: var(--beam-ProductDetailsPage-backgroundColor);\n ${useCustomBorder(\"--beam-ProductDetailsPage\")}\n }\n .icon-container {\n width: var(--beam-ProductDetailsPage-imageWidth);\n height: var(--beam-ProductDetailsPage-imageHeight);\n flex-shrink: 0;\n }\n .icon-container > img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .info-container {\n margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);\n }\n .title {\n ${useCustomText(\"--beam-ProductDetailsPage-title\")}\n }\n .title-block {\n text-align: var(--beam-ProductDetailsPage-title-textAlign);\n line-height: var(--beam-ProductDetailsPage-title-lineHeight);\n }\n .description {\n ${useCustomText(\"--beam-ProductDetailsPage-description\")}\n }\n .description-block {\n text-align: var(--beam-ProductDetailsPage-description-textAlign);\n line-height: var(--beam-ProductDetailsPage-description-lineHeight);\n }\n .ppgf-disclosure-tooltip {\n --max-width: 268px;\n }\n .ppgf-disclosure-tooltip::part(body) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n padding-top: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft);\n }\n .ppgf-disclosure-tooltip::part(base__arrow) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n }\n .ppgf-disclosure-tooltip-content {\n display: flex;\n flex-direction: column;\n ${useCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\")}\n }\n .ppgf-disclosure-tooltip-copy > a,\n .ppgf-disclosure-close {\n pointer-events: auto;\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-close {\n display: var(--beam-ProductDetailsPage-close-display);\n padding: var(--beam-ProductDetailsPage-close-padding);\n height: 12px;\n background: none;\n border: none;\n margin-left: auto;\n }\n .ppgf-disclosure-tooltip-copy > a:visited {\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-tooltip-trigger {\n position: relative;\n }\n .ppgf-disclosure-tooltip-trigger-mask {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);\n height: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);\n }\n .ppgf-disclosure-tooltip-trigger > svg {\n width: var(--beam-ProductDetailsPage-TooltipIcon-width);\n color: var(--beam-ProductDetailsPage-TooltipIcon-color);\n height: auto;\n vertical-align: middle;\n }\n `,\n ];\n}\n\ndefineCustomElement(BeamProductDetailsPage);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-product-details-page\": BeamProductDetailsPage;\n }\n}\n"],"names":["defineCustomBorder","namespace","borderRadius","borderStyle","borderColor","borderWidth","prefix","useCustomBorder","unsafeCSS","_info","html","IMAGE_URL_REMOTE_CONFIG_KEY","BeamProductDetailsPage","LitElement","DEFAULT_BASE_URL","enforceConfig","getProductDetailsPage","makeApiKeyHeader","WIDGET_NAMES","AsyncController","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","imageUrl","data","loading","_errorMessage","localizeUserString","onClickClose","tooltip","ppgfDisclosure","unsafeHTML","ppgfHyperlink","defaults","defineCustomText","remoteConfig","config","_cssVariableMap","cssReset","cssResponsiveUtils","css","useCustomText","__decorateClass","property","defineCustomElement"],"mappings":"igBAEO,MAAMA,EAAqB,CAChCC,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EAAc,KAAM,EAAI,CAAA,IACrE,CAC3B,MAAMC,EAASL,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,MAAO,CACL,CAAC,GAAGK,CAAM,eAAe,EAAGJ,EAC5B,CAAC,GAAGI,CAAM,cAAc,EAAGH,EAC3B,CAAC,GAAGG,CAAM,cAAc,EAAGF,EAC3B,CAAC,GAAGE,CAAM,cAAc,EAAGD,CAC7B,CACF,EAEaE,EAAkB,CAC7BN,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EAAc,KAAM,EAAI,CAClF,IAAA,CACd,MAAMC,EAASL,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,OAAOO,EAAU,8BACUF,CAAM,kBAAkBJ,CAAY;AAAA,4BACrCI,CAAM,iBAAiBH,CAAW;AAAA,4BAClCG,CAAM,iBAAiBF,CAAW;AAAA,4BAClCE,CAAM,iBAAiBD,CAAW;AAAA,KACzD,CACL,ECxBaI,EAAQ,IAAMC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,wMCyB3B,MAAMC,EAA8B,2CAEvBC,UAA+BC,CAAW,CAAhD,aAGsC,CAAA,MAAA,GAAA,SAAA,EAAA,KAAO,QAAgBC,EAMtC,KAAO,KAAkB,KAExB,KAAO,MAAQ,GAM5C,KAA4B,0BAAA,UACrBC,EAA8B,CAAC,SA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CAAA,EATfhC,EASwB,UAEC+B,OAAAA,CAAAA,EAAAA,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAXhB,EAAAhC,EAWyB,UA4RtCiC,QAAAA,CAAAA,EAAAA,EAAoBjC,CAAsB"}
@@ -1,8 +1,23 @@
1
- import{j as u,f as b,g as d,h as m,y as s,k as D}from"../chunks/lit-qtGbjGnK.esm.js";import{c as h,u as g,d as f,e as v,A as y,_ as x,i as P,a as p,b as C}from"../chunks/localize-fH8KOrMi.esm.js";import{D as $,i as k,W as F,S}from"../chunks/routes-3jKReDai.esm.js";import{makeApiKeyHeader as T}from"../utils/makeApiKeyHeader.js";import"../chunks/vendor-jQ8cxMpw.esm.js";import"../chunks/shoelace-components-paAsUPkU.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";const w=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},G=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return u(` border-radius: var(${a}-borderRadius, ${e});
1
+ import{j as P,y as s,f as b,g as d,h as m,k as h}from"../chunks/lit-qtGbjGnK.esm.js";import{c as D,u as g,d as f,e as v,A as y,_ as x,i as u,a as p,b as k}from"../chunks/localize-fH8KOrMi.esm.js";import{D as w,j as C,W as $,S as F}from"../chunks/routes-sbqL3QFm.esm.js";import{makeApiKeyHeader as T}from"../utils/makeApiKeyHeader.js";import{c as S}from"../chunks/responsive-aWj_7ZN_.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";const G=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},I=(r="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=r.startsWith("--beam-")?r:`--beam-${r}`;return P(` border-radius: var(${a}-borderRadius, ${e});
2
2
  border-style: var(${a}-borderStyle, ${t});
3
3
  border-color: var(${a}-borderColor, ${o});
4
4
  border-width: var(${a}-borderWidth, ${i});
5
- `)};var I=Object.defineProperty,W=Object.getOwnPropertyDescriptor,n=(r,e,t,o)=>{for(var i=o>1?void 0:o?W(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(o?c(e,t,i):c(i))||i);return o&&i&&I(e,t,i),i};const A="--beam-ProductDetailsPage-imageUrl";class l extends m{constructor(){super(...arguments),this.baseUrl=$,this.lang="en",this.debug=!1,this.getProductDetailsPageData=async()=>(v(["apiKey","storeId"],this),await k({baseUrl:this.baseUrl,headers:T(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:F.product_details_page}})),this.productDetailsPageDataController=new y(this,this.getProductDetailsPageData)}get configLang(){return S[this.lang]||"en"}async updated(e){const t=["storeId","baseUrl","lang","apiKey"];for(const o of t)if(e.has(o)){await this.productDetailsPageDataController.exec();break}}renderWidgetIcon(){const e=this.cssVariables[A];return e?s`
5
+ `)},L=()=>s` <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ width="24"
8
+ height="24"
9
+ viewBox="0 0 24 24"
10
+ fill="none"
11
+ stroke="currentColor"
12
+ stroke-width="2"
13
+ stroke-linecap="round"
14
+ stroke-linejoin="round"
15
+ part="svg"
16
+ >
17
+ <circle cx="12" cy="12" r="10"></circle>
18
+ <path d="M12 16v-4"></path>
19
+ <path d="M12 8h.01"></path>
20
+ </svg>`;var W=Object.defineProperty,A=Object.getOwnPropertyDescriptor,c=(r,e,t,o)=>{for(var i=o>1?void 0:o?A(e,t):e,a=r.length-1,n;a>=0;a--)(n=r[a])&&(i=(o?n(e,t,i):n(i))||i);return o&&i&&W(e,t,i),i};const R="--beam-ProductDetailsPage-imageUrl";class l extends m{constructor(){super(...arguments),this.baseUrl=w,this.lang="en",this.debug=!1,this.getProductDetailsPageData=async()=>(v(["apiKey","storeId"],this),await C({baseUrl:this.baseUrl,headers:T(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:$.product_details_page}})),this.productDetailsPageDataController=new y(this,this.getProductDetailsPageData)}get configLang(){return F[this.lang]||"en"}async updated(e){const t=["storeId","baseUrl","lang","apiKey"];for(const o of t)if(e.has(o)){await this.productDetailsPageDataController.exec();break}}renderWidgetIcon(){const e=this.cssVariables[R];return e?s`
6
21
  <span class="icon-container">
7
22
  <img src=${e} alt="Widget Icon"></img>
8
23
  </span>
@@ -16,23 +31,34 @@ import{j as u,f as b,g as d,h as m,y as s,k as D}from"../chunks/lit-qtGbjGnK.esm
16
31
  ${this.renderWidgetIcon()}
17
32
  <span class="info-container">
18
33
  <div class="title-block">
19
- <h3 class="title">${P(this.configLang,e.config?.web?.title)}</h3>
34
+ <h3 class="title">${u(this.configLang,e.config?.web?.title)}</h3>
20
35
  </div>
21
36
  <div class="description-block">
22
- <span class="description"> ${P(this.configLang,e.config?.web?.description)}</span
37
+ <span class="description"> ${u(this.configLang,e.config?.web?.description)}</span
23
38
  >${this.renderDisclosureTooltip()}
24
39
  </div>
25
40
  </span>
26
41
  </div>
27
- `}renderDisclosureTooltip(){const e=this.productDetailsPageDataController.data?.ppgfDisclosure;return e?s`<sl-tooltip class="ppgf-disclosure-tooltip">
28
- <div class="ppgf-disclosure-tooltip-content" slot="content">${D(e.copy)}</div>
29
- ${this.renderDisclosureTooltipIcon()}
30
- </sl-tooltip>`:s``}renderDisclosureTooltipIcon(){return s`<sl-icon
31
- library="lucide"
32
- name="info"
33
- label="ppgf-disclosure-tooltip-icon"
34
- class="ppgf-disclosure-tooltip-icon"
35
- ></sl-icon>`}renderDisclosureTooltipHyperlink(){const e=this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;return e?s`<a class="ppgf-disclosure-hyperlink" href="${e.url}" target="_blank">${e.copy}</a>`:s``}get cssVariables(){const e={"--beam-ProductDetailsPage-imageWidth":"24px","--beam-ProductDetailsPage-imageHeight":"24px","--beam-ProductDetailsPage-maxWidth":"346px","--beam-ProductDetailsPage-paddingTop":"8px","--beam-ProductDetailsPage-paddingRight":"12px","--beam-ProductDetailsPage-paddingBottom":"8px","--beam-ProductDetailsPage-paddingLeft":"15px","--beam-ProductDetailsPage-InfoContainer-marginLeft":"8px","--beam-ProductDetailsPage-backgroundColor":"unset","--beam-ProductDetailsPage-TooltipIcon-width":"10px","--beam-ProductDetailsPage-TooltipIcon-color":"inherit","--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor":"#000000","--beam-ProductDetailsPage-PPGFDisclosure-paddingTop":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingRight":"8px","--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft":"8px","--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color":"#5CA3FF",...p("--beam-ProductDetailsPage-title",{fontSize:"12px",fontWeight:"bold"}),"--beam-ProductDetailsPage-title-textAlign":"left",...p("--beam-ProductDetailsPage-description",{marginTop:"4px",fontSize:"12px",lineHeight:"15px"}),"--beam-ProductDetailsPage-description-textAlign":"left",...p("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent",{fontSize:"12px",lineHeight:"16px",color:"#FFFFFF"}),...w("--beam-ProductDetailsPage")},t=this.productDetailsPageDataController?.data?.config?.web?.theme||{},o={...e,...t};return Object.assign(Object.create({toCSS(){return C(this)}}),o)}}l.tagName="beam-product-details-page",l.styles=[h,b`
42
+ `}renderCloseTooltipIcon(){return s`<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
43
+ <path
44
+ d="M5.40836 5.40811L1.48828 1.48804M5.40836 5.40811L9.32843 9.32819M5.40836 5.40811L9.32843 1.48804M5.40836 5.40811L1.48828 9.32819"
45
+ stroke="white"
46
+ stroke-width="1.56803"
47
+ stroke-linecap="round"
48
+ stroke-linejoin="round"
49
+ />
50
+ </svg> `}renderDisclosureTooltip(){const e=()=>{const o=this.renderRoot.querySelector(".ppgf-disclosure-tooltip");o.open=!1},t=this.productDetailsPageDataController.data?.ppgfDisclosure;return t?s`<sl-tooltip class="ppgf-disclosure-tooltip">
51
+ <div class="ppgf-disclosure-tooltip-content" slot="content">
52
+ <button class="ppgf-disclosure-close" aria-label="Close tooltip" @click="${e}">
53
+ ${this.renderCloseTooltipIcon()}
54
+ </button>
55
+ <div class="ppgf-disclosure-tooltip-copy">${h(t.copy)}</div>
56
+ </div>
57
+ <span class="ppgf-disclosure-tooltip-trigger">
58
+ <div class="ppgf-disclosure-tooltip-trigger-mask d-lg-none"></div>
59
+ ${L()}
60
+ </span>
61
+ </sl-tooltip>`:s``}renderDisclosureTooltipHyperlink(){const e=this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;return e?s`<a class="ppgf-disclosure-hyperlink" href="${e.url}" target="_blank">${e.copy}</a>`:s``}get cssVariables(){const e={"--beam-ProductDetailsPage-imageWidth":"24px","--beam-ProductDetailsPage-imageHeight":"24px","--beam-ProductDetailsPage-maxWidth":"346px","--beam-ProductDetailsPage-paddingTop":"8px","--beam-ProductDetailsPage-paddingRight":"12px","--beam-ProductDetailsPage-paddingBottom":"8px","--beam-ProductDetailsPage-paddingLeft":"15px","--beam-ProductDetailsPage-InfoContainer-marginLeft":"8px","--beam-ProductDetailsPage-backgroundColor":"unset","--beam-ProductDetailsPage-TooltipIcon-width":"10px","--beam-ProductDetailsPage-TooltipIcon-color":"inherit","--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor":"#000000","--beam-ProductDetailsPage-PPGFDisclosure-paddingTop":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingRight":"8px","--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom":"10px","--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft":"8px","--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color":"#5CA3FF",...p("--beam-ProductDetailsPage-title",{fontSize:"12px",fontWeight:"bold"}),"--beam-ProductDetailsPage-title-textAlign":"left",...p("--beam-ProductDetailsPage-description",{marginTop:"4px",fontSize:"12px",lineHeight:"15px"}),"--beam-ProductDetailsPage-description-textAlign":"left",...p("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent",{fontSize:"12px",lineHeight:"16px",color:"#FFFFFF"}),...G("--beam-ProductDetailsPage"),"--beam-ProductDetailsPage-close-display":"initial","--beam-ProductDetailsPage-close-padding":"0"},t=this.productDetailsPageDataController?.data?.config?.web?.theme||{},o={...e,...t};return Object.assign(Object.create({toCSS(){return k(this)}}),o)}}l.tagName="beam-product-details-page",l.styles=[D,S,b`
36
62
  :host {
37
63
  font-family: var(--beam-fontFamily);
38
64
  font-style: var(--beam-fontStyle);
@@ -52,7 +78,7 @@ import{j as u,f as b,g as d,h as m,y as s,k as D}from"../chunks/lit-qtGbjGnK.esm
52
78
  padding-left: var(--beam-ProductDetailsPage-paddingLeft);
53
79
  width: 100%;
54
80
  background-color: var(--beam-ProductDetailsPage-backgroundColor);
55
- ${G("--beam-ProductDetailsPage")}
81
+ ${I("--beam-ProductDetailsPage")}
56
82
  }
57
83
  .icon-container {
58
84
  width: var(--beam-ProductDetailsPage-imageWidth);
@@ -95,20 +121,42 @@ import{j as u,f as b,g as d,h as m,y as s,k as D}from"../chunks/lit-qtGbjGnK.esm
95
121
  background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);
96
122
  }
97
123
  .ppgf-disclosure-tooltip-content {
124
+ display: flex;
125
+ flex-direction: column;
98
126
  ${g("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent")}
99
127
  }
100
- .ppgf-disclosure-tooltip-content > a {
128
+ .ppgf-disclosure-tooltip-copy > a,
129
+ .ppgf-disclosure-close {
101
130
  pointer-events: auto;
102
131
  color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);
103
132
  }
104
- .ppgf-disclosure-hyperlink:visited {
133
+ .ppgf-disclosure-close {
134
+ display: var(--beam-ProductDetailsPage-close-display);
135
+ padding: var(--beam-ProductDetailsPage-close-padding);
136
+ height: 12px;
137
+ background: none;
138
+ border: none;
139
+ margin-left: auto;
140
+ }
141
+ .ppgf-disclosure-tooltip-copy > a:visited {
105
142
  color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);
106
143
  }
107
- .ppgf-disclosure-tooltip-icon {
144
+ .ppgf-disclosure-tooltip-trigger {
145
+ position: relative;
146
+ }
147
+ .ppgf-disclosure-tooltip-trigger-mask {
148
+ position: absolute;
149
+ top: 50%;
150
+ left: 50%;
151
+ transform: translate(-50%, -50%);
152
+ width: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);
153
+ height: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);
154
+ }
155
+ .ppgf-disclosure-tooltip-trigger > svg {
108
156
  width: var(--beam-ProductDetailsPage-TooltipIcon-width);
109
157
  color: var(--beam-ProductDetailsPage-TooltipIcon-color);
110
158
  height: auto;
111
159
  vertical-align: middle;
112
160
  }
113
- `],n([d({type:String,reflect:!0})],l.prototype,"baseUrl",2),n([d({type:String,reflect:!1})],l.prototype,"apiKey",2),n([d({type:Number})],l.prototype,"storeId",2),n([d({type:String})],l.prototype,"lang",2),n([d({type:Boolean})],l.prototype,"debug",2),f(l);export{l as BeamProductDetailsPage};
161
+ `],c([d({type:String,reflect:!0})],l.prototype,"baseUrl",2),c([d({type:String,reflect:!1})],l.prototype,"apiKey",2),c([d({type:Number})],l.prototype,"storeId",2),c([d({type:String})],l.prototype,"lang",2),c([d({type:Boolean})],l.prototype,"debug",2),f(l);export{l as BeamProductDetailsPage};
114
162
  //# sourceMappingURL=product-details-page.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-details-page.js","sources":["../../src/shared/fragments/custom-border.ts","../../src/components/product-details-page/index.ts"],"sourcesContent":["import { CSSResult, unsafeCSS } from \"lit\";\n\nexport const defineCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n [`${prefix}-borderRadius`]: borderRadius,\n [`${prefix}-borderStyle`]: borderStyle,\n [`${prefix}-borderColor`]: borderColor,\n [`${prefix}-borderWidth`]: borderWidth,\n };\n};\n\nexport const useCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): CSSResult => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return unsafeCSS(`\\\n border-radius: var(${prefix}-borderRadius, ${borderRadius});\n border-style: var(${prefix}-borderStyle, ${borderStyle});\n border-color: var(${prefix}-borderColor, ${borderColor});\n border-width: var(${prefix}-borderWidth, ${borderWidth});\n `);\n};\n","import { LitElement, css, html } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { getProductDetailsPage } from \"../../api-sdk/v3/routes\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES, WIDGET_NAMES } from \"../../api-sdk/constants\";\nimport { LANGUAGES, TUrl } from \"../../api-sdk/types\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { MissingConfig } from \"../../utils/beam-errors\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { defineCustomBorder, useCustomBorder } from \"../../shared/fragments/custom-border\";\n\n// shoelace html tag imports\nimport \"@shoelace-style/shoelace/dist/components/tooltip/tooltip.js\";\nimport \"../../shared/shoelace-components\";\n\ntype RequiredConfig = {\n apiKey: string;\n storeId: number;\n};\n\nconst IMAGE_URL_REMOTE_CONFIG_KEY = \"--beam-ProductDetailsPage-imageUrl\";\n\nexport class BeamProductDetailsPage extends LitElement {\n static tagName = \"beam-product-details-page\";\n\n @property({ type: String, reflect: true }) public baseUrl: TUrl = DEFAULT_BASE_URL;\n\n @property({ type: String, reflect: false }) apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) storeId?: number;\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public debug = false;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n getProductDetailsPageData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"storeId\"], this)) throw new MissingConfig();\n\n const res = await getProductDetailsPage({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n queryParams: {\n version: \"1.0.0\",\n lang: this.configLang,\n storeId: this.storeId,\n widgetName: WIDGET_NAMES.product_details_page,\n },\n });\n return res;\n };\n\n private productDetailsPageDataController = new AsyncController<typeof this.getProductDetailsPageData>(\n this,\n this.getProductDetailsPageData\n );\n\n async updated(changedProperties: Map<string, unknown>) {\n const requireNewDataProps = [\"storeId\", \"baseUrl\", \"lang\", \"apiKey\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.productDetailsPageDataController.exec();\n break;\n }\n }\n }\n\n renderWidgetIcon() {\n const imageUrl = this.cssVariables[IMAGE_URL_REMOTE_CONFIG_KEY];\n\n return imageUrl\n ? html`\n <span class=\"icon-container\">\n <img src=${imageUrl} alt=\"Widget Icon\"></img>\n </span>\n `\n : html``;\n }\n\n render() {\n const { data, loading } = this.productDetailsPageDataController;\n if (loading) {\n return html``;\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new Error(\"No data\") });\n }\n return \"\";\n }\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div class=\"root\">\n ${this.renderWidgetIcon()}\n <span class=\"info-container\">\n <div class=\"title-block\">\n <h3 class=\"title\">${localizeUserString(this.configLang, data.config?.web?.title)}</h3>\n </div>\n <div class=\"description-block\">\n <span class=\"description\"> ${localizeUserString(this.configLang, data.config?.web?.description)}</span\n >${this.renderDisclosureTooltip()}\n </div>\n </span>\n </div>\n `;\n }\n\n /* PayPal Giving Fund Disclosure */\n renderDisclosureTooltip() {\n const ppgfDisclosure = this.productDetailsPageDataController.data?.ppgfDisclosure;\n return ppgfDisclosure\n ? html`<sl-tooltip class=\"ppgf-disclosure-tooltip\">\n <div class=\"ppgf-disclosure-tooltip-content\" slot=\"content\">${unsafeHTML(ppgfDisclosure.copy)}</div>\n ${this.renderDisclosureTooltipIcon()}\n </sl-tooltip>`\n : html``;\n }\n\n renderDisclosureTooltipIcon() {\n return html`<sl-icon\n library=\"lucide\"\n name=\"info\"\n label=\"ppgf-disclosure-tooltip-icon\"\n class=\"ppgf-disclosure-tooltip-icon\"\n ></sl-icon>`;\n }\n\n renderDisclosureTooltipHyperlink() {\n const ppgfHyperlink = this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;\n return ppgfHyperlink\n ? html`<a class=\"ppgf-disclosure-hyperlink\" href=\"${ppgfHyperlink.url}\" target=\"_blank\">${ppgfHyperlink.copy}</a>`\n : html``;\n }\n /* End PayPal Giving Fund Disclosure */\n\n public get cssVariables() {\n const defaults = {\n \"--beam-ProductDetailsPage-imageWidth\": \"24px\",\n \"--beam-ProductDetailsPage-imageHeight\": \"24px\",\n \"--beam-ProductDetailsPage-maxWidth\": \"346px\",\n \"--beam-ProductDetailsPage-paddingTop\": \"8px\",\n \"--beam-ProductDetailsPage-paddingRight\": \"12px\",\n \"--beam-ProductDetailsPage-paddingBottom\": \"8px\",\n \"--beam-ProductDetailsPage-paddingLeft\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginLeft\": \"8px\",\n \"--beam-ProductDetailsPage-backgroundColor\": \"unset\",\n \"--beam-ProductDetailsPage-TooltipIcon-width\": \"10px\",\n \"--beam-ProductDetailsPage-TooltipIcon-color\": \"inherit\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor\": \"#000000\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingTop\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingRight\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color\": \"#5CA3FF\",\n ...defineCustomText(\"--beam-ProductDetailsPage-title\", {\n fontSize: \"12px\",\n fontWeight: \"bold\",\n }),\n \"--beam-ProductDetailsPage-title-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-description\", {\n marginTop: \"4px\",\n fontSize: \"12px\",\n lineHeight: \"15px\",\n }),\n \"--beam-ProductDetailsPage-description-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\", {\n fontSize: \"12px\",\n lineHeight: \"16px\",\n color: \"#FFFFFF\",\n }),\n ...defineCustomBorder(\"--beam-ProductDetailsPage\"),\n };\n const remoteConfig = this.productDetailsPageDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n css`\n :host {\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-ProductDetailsPage-maxWidth);\n word-break: normal;\n display: block;\n }\n .root {\n display: flex;\n align-items: center;\n padding-top: var(--beam-ProductDetailsPage-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-paddingLeft);\n width: 100%;\n background-color: var(--beam-ProductDetailsPage-backgroundColor);\n ${useCustomBorder(\"--beam-ProductDetailsPage\")}\n }\n .icon-container {\n width: var(--beam-ProductDetailsPage-imageWidth);\n height: var(--beam-ProductDetailsPage-imageHeight);\n flex-shrink: 0;\n }\n .icon-container > img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .info-container {\n margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);\n }\n .title {\n ${useCustomText(\"--beam-ProductDetailsPage-title\")}\n }\n .title-block {\n text-align: var(--beam-ProductDetailsPage-title-textAlign);\n line-height: var(--beam-ProductDetailsPage-title-lineHeight);\n }\n .description {\n ${useCustomText(\"--beam-ProductDetailsPage-description\")}\n }\n .description-block {\n text-align: var(--beam-ProductDetailsPage-description-textAlign);\n line-height: var(--beam-ProductDetailsPage-description-lineHeight);\n }\n .ppgf-disclosure-tooltip {\n --max-width: 268px;\n }\n .ppgf-disclosure-tooltip::part(body) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n padding-top: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft);\n }\n .ppgf-disclosure-tooltip::part(base__arrow) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n }\n .ppgf-disclosure-tooltip-content {\n ${useCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\")}\n }\n .ppgf-disclosure-tooltip-content > a {\n pointer-events: auto;\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-hyperlink:visited {\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-tooltip-icon {\n width: var(--beam-ProductDetailsPage-TooltipIcon-width);\n color: var(--beam-ProductDetailsPage-TooltipIcon-color);\n height: auto;\n vertical-align: middle;\n }\n `,\n ];\n}\n\ndefineCustomElement(BeamProductDetailsPage);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-product-details-page\": BeamProductDetailsPage;\n }\n}\n"],"names":["defineCustomBorder","namespace","borderRadius","borderStyle","borderColor","borderWidth","prefix","useCustomBorder","unsafeCSS","IMAGE_URL_REMOTE_CONFIG_KEY","BeamProductDetailsPage","LitElement","DEFAULT_BASE_URL","enforceConfig","getProductDetailsPage","makeApiKeyHeader","WIDGET_NAMES","AsyncController","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","imageUrl","html","data","loading","_errorMessage","localizeUserString","ppgfDisclosure","unsafeHTML","ppgfHyperlink","defaults","defineCustomText","remoteConfig","config","_cssVariableMap","cssReset","css","useCustomText","__decorateClass","property","defineCustomElement"],"mappings":"ifAEO,MAAMA,EAAqB,CAChCC,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EAAc,KAAM,EAAI,CAAA,IACrE,CAC3B,MAAMC,EAASL,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,MAAO,CACL,CAAC,GAAGK,CAAM,eAAe,EAAGJ,EAC5B,CAAC,GAAGI,CAAM,cAAc,EAAGH,EAC3B,CAAC,GAAGG,CA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EN6B,EAAA,CAA3CC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAM,CAAC,CAL/B,EAAA9B,EAKiC,UAEhB6B,SAAAA,CAAAA,EAAAA,EAAA,CAA3BC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAPf9B,EAOiB,UAAA,UAAA,CAAA,EAEO6B,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EATf9B,EASwB,UAEC6B,OAAAA,CAAAA,EAAAA,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAXhB,EAAA9B,EAWyB,UAmPtC+B,QAAAA,CAAAA,EAAAA,EAAoB/B,CAAsB"}
1
+ {"version":3,"file":"product-details-page.js","sources":["../../src/shared/fragments/custom-border.ts","../../src/shared/fragments/info.ts","../../src/components/product-details-page/index.ts"],"sourcesContent":["import { CSSResult, unsafeCSS } from \"lit\";\n\nexport const defineCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): Record<string, string> => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return {\n [`${prefix}-borderRadius`]: borderRadius,\n [`${prefix}-borderStyle`]: borderStyle,\n [`${prefix}-borderColor`]: borderColor,\n [`${prefix}-borderWidth`]: borderWidth,\n };\n};\n\nexport const useCustomBorder = (\n namespace = \"\",\n { borderRadius = \"0px\", borderStyle = \"unset\", borderColor = \"#000000\", borderWidth = \"1px\" } = {}\n): CSSResult => {\n const prefix = namespace.startsWith(\"--beam-\") ? namespace : `--beam-${namespace}`;\n return unsafeCSS(`\\\n border-radius: var(${prefix}-borderRadius, ${borderRadius});\n border-style: var(${prefix}-borderStyle, ${borderStyle});\n border-color: var(${prefix}-borderColor, ${borderColor});\n border-width: var(${prefix}-borderWidth, ${borderWidth});\n `);\n};\n","import { html } from \"lit\";\n\nexport const _info = () => html` <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n part=\"svg\"\n>\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <path d=\"M12 16v-4\"></path>\n <path d=\"M12 8h.01\"></path>\n</svg>`;\n","import { LitElement, css, html } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { getProductDetailsPage } from \"../../api-sdk/v3/routes\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES, WIDGET_NAMES } from \"../../api-sdk/constants\";\nimport { LANGUAGES, TUrl } from \"../../api-sdk/types\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { MissingConfig } from \"../../utils/beam-errors\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { cssResponsiveUtils } from \"../../shared/responsive\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { defineCustomBorder, useCustomBorder } from \"../../shared/fragments/custom-border\";\n// shoelace html tag imports\nimport \"@shoelace-style/shoelace/dist/components/tooltip/tooltip.js\";\nimport { _info } from \"../../shared/fragments/info\";\n\ntype RequiredConfig = {\n apiKey: string;\n storeId: number;\n};\n\nconst IMAGE_URL_REMOTE_CONFIG_KEY = \"--beam-ProductDetailsPage-imageUrl\";\n\nexport class BeamProductDetailsPage extends LitElement {\n static tagName = \"beam-product-details-page\";\n\n @property({ type: String, reflect: true }) public baseUrl: TUrl = DEFAULT_BASE_URL;\n\n @property({ type: String, reflect: false }) apiKey?: RequiredConfig[\"apiKey\"];\n\n @property({ type: Number }) storeId?: number;\n\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n\n @property({ type: Boolean }) public debug = false;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n getProductDetailsPageData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"storeId\"], this)) throw new MissingConfig();\n\n const res = await getProductDetailsPage({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n queryParams: {\n version: \"1.0.0\",\n lang: this.configLang,\n storeId: this.storeId,\n widgetName: WIDGET_NAMES.product_details_page,\n },\n });\n return res;\n };\n\n private productDetailsPageDataController = new AsyncController<typeof this.getProductDetailsPageData>(\n this,\n this.getProductDetailsPageData\n );\n\n async updated(changedProperties: Map<string, unknown>) {\n const requireNewDataProps = [\"storeId\", \"baseUrl\", \"lang\", \"apiKey\"];\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.productDetailsPageDataController.exec();\n break;\n }\n }\n }\n\n renderWidgetIcon() {\n const imageUrl = this.cssVariables[IMAGE_URL_REMOTE_CONFIG_KEY];\n\n return imageUrl\n ? html`\n <span class=\"icon-container\">\n <img src=${imageUrl} alt=\"Widget Icon\"></img>\n </span>\n `\n : html``;\n }\n\n render() {\n const { data, loading } = this.productDetailsPageDataController;\n if (loading) {\n return html``;\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new Error(\"No data\") });\n }\n return \"\";\n }\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div class=\"root\">\n ${this.renderWidgetIcon()}\n <span class=\"info-container\">\n <div class=\"title-block\">\n <h3 class=\"title\">${localizeUserString(this.configLang, data.config?.web?.title)}</h3>\n </div>\n <div class=\"description-block\">\n <span class=\"description\"> ${localizeUserString(this.configLang, data.config?.web?.description)}</span\n >${this.renderDisclosureTooltip()}\n </div>\n </span>\n </div>\n `;\n }\n\n renderCloseTooltipIcon() {\n return html`<svg width=\"11\" height=\"11\" viewBox=\"0 0 11 11\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M5.40836 5.40811L1.48828 1.48804M5.40836 5.40811L9.32843 9.32819M5.40836 5.40811L9.32843 1.48804M5.40836 5.40811L1.48828 9.32819\"\n stroke=\"white\"\n stroke-width=\"1.56803\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg> `;\n }\n\n /* PayPal Giving Fund Disclosure */\n renderDisclosureTooltip() {\n const onClickClose = () => {\n // due to being strictly html, we need to assume any when overriding shoelace properties\n const tooltip = this.renderRoot.querySelector(\".ppgf-disclosure-tooltip\") as any;\n tooltip.open = false;\n };\n const ppgfDisclosure = this.productDetailsPageDataController.data?.ppgfDisclosure;\n return ppgfDisclosure\n ? html`<sl-tooltip class=\"ppgf-disclosure-tooltip\">\n <div class=\"ppgf-disclosure-tooltip-content\" slot=\"content\">\n <button class=\"ppgf-disclosure-close\" aria-label=\"Close tooltip\" @click=\"${onClickClose}\">\n ${this.renderCloseTooltipIcon()}\n </button>\n <div class=\"ppgf-disclosure-tooltip-copy\">${unsafeHTML(ppgfDisclosure.copy)}</div>\n </div>\n <span class=\"ppgf-disclosure-tooltip-trigger\">\n <div class=\"ppgf-disclosure-tooltip-trigger-mask d-lg-none\"></div>\n ${_info()}\n </span>\n </sl-tooltip>`\n : html``;\n }\n\n renderDisclosureTooltipHyperlink() {\n const ppgfHyperlink = this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;\n return ppgfHyperlink\n ? html`<a class=\"ppgf-disclosure-hyperlink\" href=\"${ppgfHyperlink.url}\" target=\"_blank\">${ppgfHyperlink.copy}</a>`\n : html``;\n }\n /* End PayPal Giving Fund Disclosure */\n\n public get cssVariables() {\n const defaults = {\n \"--beam-ProductDetailsPage-imageWidth\": \"24px\",\n \"--beam-ProductDetailsPage-imageHeight\": \"24px\",\n \"--beam-ProductDetailsPage-maxWidth\": \"346px\",\n \"--beam-ProductDetailsPage-paddingTop\": \"8px\",\n \"--beam-ProductDetailsPage-paddingRight\": \"12px\",\n \"--beam-ProductDetailsPage-paddingBottom\": \"8px\",\n \"--beam-ProductDetailsPage-paddingLeft\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginLeft\": \"8px\",\n \"--beam-ProductDetailsPage-backgroundColor\": \"unset\",\n \"--beam-ProductDetailsPage-TooltipIcon-width\": \"10px\",\n \"--beam-ProductDetailsPage-TooltipIcon-color\": \"inherit\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor\": \"#000000\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingTop\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingRight\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom\": \"10px\",\n \"--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft\": \"8px\",\n \"--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color\": \"#5CA3FF\",\n ...defineCustomText(\"--beam-ProductDetailsPage-title\", {\n fontSize: \"12px\",\n fontWeight: \"bold\",\n }),\n \"--beam-ProductDetailsPage-title-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-description\", {\n marginTop: \"4px\",\n fontSize: \"12px\",\n lineHeight: \"15px\",\n }),\n \"--beam-ProductDetailsPage-description-textAlign\": \"left\",\n ...defineCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\", {\n fontSize: \"12px\",\n lineHeight: \"16px\",\n color: \"#FFFFFF\",\n }),\n ...defineCustomBorder(\"--beam-ProductDetailsPage\"),\n \"--beam-ProductDetailsPage-close-display\": \"initial\",\n \"--beam-ProductDetailsPage-close-padding\": \"0\",\n };\n const remoteConfig = this.productDetailsPageDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n cssResponsiveUtils,\n css`\n :host {\n 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-ProductDetailsPage-maxWidth);\n word-break: normal;\n display: block;\n }\n .root {\n display: flex;\n align-items: center;\n padding-top: var(--beam-ProductDetailsPage-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-paddingLeft);\n width: 100%;\n background-color: var(--beam-ProductDetailsPage-backgroundColor);\n ${useCustomBorder(\"--beam-ProductDetailsPage\")}\n }\n .icon-container {\n width: var(--beam-ProductDetailsPage-imageWidth);\n height: var(--beam-ProductDetailsPage-imageHeight);\n flex-shrink: 0;\n }\n .icon-container > img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .info-container {\n margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);\n }\n .title {\n ${useCustomText(\"--beam-ProductDetailsPage-title\")}\n }\n .title-block {\n text-align: var(--beam-ProductDetailsPage-title-textAlign);\n line-height: var(--beam-ProductDetailsPage-title-lineHeight);\n }\n .description {\n ${useCustomText(\"--beam-ProductDetailsPage-description\")}\n }\n .description-block {\n text-align: var(--beam-ProductDetailsPage-description-textAlign);\n line-height: var(--beam-ProductDetailsPage-description-lineHeight);\n }\n .ppgf-disclosure-tooltip {\n --max-width: 268px;\n }\n .ppgf-disclosure-tooltip::part(body) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n padding-top: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingTop);\n padding-right: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingRight);\n padding-bottom: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingBottom);\n padding-left: var(--beam-ProductDetailsPage-PPGFDisclosure-paddingLeft);\n }\n .ppgf-disclosure-tooltip::part(base__arrow) {\n background-color: var(--beam-ProductDetailsPage-PPGFDisclosure-backgroundColor);\n }\n .ppgf-disclosure-tooltip-content {\n display: flex;\n flex-direction: column;\n ${useCustomText(\"--beam-ProductDetailsPage-PPGFDisclosureTooltipContent\")}\n }\n .ppgf-disclosure-tooltip-copy > a,\n .ppgf-disclosure-close {\n pointer-events: auto;\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-close {\n display: var(--beam-ProductDetailsPage-close-display);\n padding: var(--beam-ProductDetailsPage-close-padding);\n height: 12px;\n background: none;\n border: none;\n margin-left: auto;\n }\n .ppgf-disclosure-tooltip-copy > a:visited {\n color: var(--beam-ProductDetailsPage-PPGFDisclosureHyperlink-color);\n }\n .ppgf-disclosure-tooltip-trigger {\n position: relative;\n }\n .ppgf-disclosure-tooltip-trigger-mask {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);\n height: calc(var(--beam-ProductDetailsPage-TooltipIcon-width) + 20px);\n }\n .ppgf-disclosure-tooltip-trigger > svg {\n width: var(--beam-ProductDetailsPage-TooltipIcon-width);\n color: var(--beam-ProductDetailsPage-TooltipIcon-color);\n height: auto;\n vertical-align: middle;\n }\n `,\n ];\n}\n\ndefineCustomElement(BeamProductDetailsPage);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-product-details-page\": BeamProductDetailsPage;\n }\n}\n"],"names":["defineCustomBorder","namespace","borderRadius","borderStyle","borderColor","borderWidth","prefix","useCustomBorder","unsafeCSS","_info","html","IMAGE_URL_REMOTE_CONFIG_KEY","BeamProductDetailsPage","LitElement","DEFAULT_BASE_URL","enforceConfig","getProductDetailsPage","makeApiKeyHeader","WIDGET_NAMES","AsyncController","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","imageUrl","data","loading","_errorMessage","localizeUserString","onClickClose","tooltip","ppgfDisclosure","unsafeHTML","ppgfHyperlink","defaults","defineCustomText","remoteConfig","config","_cssVariableMap","cssReset","cssResponsiveUtils","css","useCustomText","__decorateClass","property","defineCustomElement"],"mappings":"yfAEO,MAAMA,EAAqB,CAChCC,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EAAc,KAAM,EAAI,CAAA,IACrE,CAC3B,MAAMC,EAASL,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,MAAO,CACL,CAAC,GAAGK,CAAM,eAAe,EAAGJ,EAC5B,CAAC,GAAGI,CAAM,cAAc,EAAGH,EAC3B,CAAC,GAAGG,CAAM,cAAc,EAAGF,EAC3B,CAAC,GAAGE,CAAM,cAAc,EAAGD,CAC7B,CACF,EAEaE,EAAkB,CAC7BN,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EAAc,KAAM,EAAI,CAClF,IAAA,CACd,MAAMC,EAASL,EAAU,WAAW,SAAS,EAAIA,EAAY,UAAUA,CAAS,GAChF,OAAOO,EAAU,8BACUF,CAAM,kBAAkBJ,CAAY;AAAA,4BACrCI,CAAM,iBAAiBH,CAAW;AAAA,4BAClCG,CAAM,iBAAiBF,CAAW;AAAA,4BAClCE,CAAM,iBAAiBD,CAAW;AAAA,KACzD,CACL,ECxBaI,EAAQ,IAAMC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,wMCyB3B,MAAMC,EAA8B,2CAEvBC,UAA+BC,CAAW,CAAhD,aAGsC,CAAA,MAAA,GAAA,SAAA,EAAA,KAAO,QAAgBC,EAMtC,KAAO,KAAkB,KAExB,KAAO,MAAQ,GAM5C,KAA4B,0BAAA,UACrBC,EAA8B,CAAC,SAAU,SAAS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fhC,EASwB,UAEC+B,OAAAA,CAAAA,EAAAA,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAXhB,EAAAhC,EAWyB,UA4RtCiC,QAAAA,CAAAA,EAAAA,EAAoBjC,CAAsB"}
@@ -74,7 +74,7 @@ declare class BeamRedeemTransaction extends LitElement {
74
74
  static styles: lit.CSSResult[];
75
75
  private handleChooseClick;
76
76
  get shouldCollapse(): boolean;
77
- protected render(): "" | lit_html.TemplateResult<1>;
77
+ protected render(): lit_html.TemplateResult<1> | "";
78
78
  }
79
79
  declare global {
80
80
  interface HTMLElementTagNameMap {
@@ -1,4 +1,4 @@
1
- import{y as c,m as k,f as N,g as l,t as x,h as P,q as v,p as D,k as z}from"../chunks/lit-qtGbjGnK.esm.js";import{d as L}from"../chunks/lodash-P8OIs-at.esm.js";import{c as U,u as h,d as M,f as E,e as C,A as B,g as w,a as f,b as W,_ as y,i as m}from"../chunks/localize-F31ae3j6.esm.js";import{D as A,f as F,W as S,k as K,u as _,S as O}from"../chunks/routes-b8sncPq8.esm.js";import{p as j}from"../chunks/progress-bar-Sn2QspHy.esm.js";import{p as V}from"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import{partnerLogosConfigDefaults as q}from"./beam-partner-logos.esm.js";import{_ as G}from"../chunks/loading-template-Av0IUyKF.esm.js";import{M as H,B as J}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{createScopedLocalStorage as Z}from"../utils/local-storage.esm.js";import{c as Q}from"../chunks/css-card-grid-7tObtoJx.esm.js";import{c as X}from"../chunks/events-Y8fYvSqM.esm.js";import"../utils/logger.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";const Y=({height:i="1em",width:e="1em"}={})=>c`
1
+ import{y as c,m as k,f as N,g as l,t as x,h as P,q as v,p as D,k as z}from"../chunks/lit-qtGbjGnK.esm.js";import{d as L}from"../chunks/lodash-P8OIs-at.esm.js";import{c as U,u as h,d as M,f as E,e as C,A as B,g as w,a as f,b as W,_ as y,i as m}from"../chunks/localize-F31ae3j6.esm.js";import{D as A,e as F,W as S,i as K,u as _,S as O}from"../chunks/routes-31m626dW.esm.js";import{p as j}from"../chunks/progress-bar-Sn2QspHy.esm.js";import{p as V}from"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import{partnerLogosConfigDefaults as q}from"./beam-partner-logos.esm.js";import{_ as G}from"../chunks/loading-template-Av0IUyKF.esm.js";import{M as H,B as J}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{createScopedLocalStorage as Z}from"../utils/local-storage.esm.js";import{c as Q}from"../chunks/css-card-grid-7tObtoJx.esm.js";import{c as X}from"../chunks/events-Y8fYvSqM.esm.js";import"../utils/logger.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";const Y=({height:i="1em",width:e="1em"}={})=>c`
2
2
  <svg
3
3
  style="${k({height:i,width:e,position:"relative",bottom:"0"})}"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -1,4 +1,4 @@
1
- import{y as c,m as k,f as N,g as l,t as x,h as P,q as v,p as D,k as z}from"../chunks/lit-qtGbjGnK.esm.js";import{d as L}from"../chunks/lodash-P8OIs-at.esm.js";import{c as U,u as h,d as M,f as E,e as C,A as B,g as w,a as f,b as W,_ as y,i as m}from"../chunks/localize-fH8KOrMi.esm.js";import{D as A,f as F,W as S,k as K,u as _,S as O}from"../chunks/routes-3jKReDai.esm.js";import{p as j}from"../chunks/progress-bar-Sn2QspHy.esm.js";import{p as V}from"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import{partnerLogosConfigDefaults as q}from"./beam-partner-logos.js";import{_ as G}from"../chunks/loading-template-Av0IUyKF.esm.js";import{M as H,B as J}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{createScopedLocalStorage as Z}from"../utils/local-storage.js";import{c as Q}from"../chunks/css-card-grid-7tObtoJx.esm.js";import{c as X}from"../chunks/events-Y8fYvSqM.esm.js";import"../utils/logger.js";import"../chunks/vendor-jQ8cxMpw.esm.js";const Y=({height:i="1em",width:e="1em"}={})=>c`
1
+ import{y as c,m as k,f as N,g as l,t as x,h as P,q as v,p as D,k as z}from"../chunks/lit-qtGbjGnK.esm.js";import{d as L}from"../chunks/lodash-P8OIs-at.esm.js";import{c as U,u as h,d as M,f as E,e as C,A as B,g as w,a as f,b as W,_ as y,i as m}from"../chunks/localize-fH8KOrMi.esm.js";import{D as A,e as F,W as S,i as K,u as _,S as O}from"../chunks/routes-sbqL3QFm.esm.js";import{p as j}from"../chunks/progress-bar-Sn2QspHy.esm.js";import{p as V}from"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import{partnerLogosConfigDefaults as q}from"./beam-partner-logos.js";import{_ as G}from"../chunks/loading-template-Av0IUyKF.esm.js";import{M as H,B as J}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{createScopedLocalStorage as Z}from"../utils/local-storage.js";import{c as Q}from"../chunks/css-card-grid-7tObtoJx.esm.js";import{c as X}from"../chunks/events-Y8fYvSqM.esm.js";import"../utils/logger.js";import"../chunks/vendor-jQ8cxMpw.esm.js";const Y=({height:i="1em",width:e="1em"}={})=>c`
2
2
  <svg
3
3
  style="${k({height:i,width:e,position:"relative",bottom:"0"})}"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -69,7 +69,7 @@ declare class BeamSelectNonprofit extends LitElement {
69
69
  private makeHandleSelect;
70
70
  get cssVariables(): any;
71
71
  static styles: lit.CSSResult[];
72
- protected render(): "" | lit_html.TemplateResult<1>;
72
+ protected render(): lit_html.TemplateResult<1> | "";
73
73
  }
74
74
  declare global {
75
75
  interface HTMLElementTagNameMap {
@@ -1,4 +1,4 @@
1
- import{h as C,f as v,y as p,g as f,p as z,m as A,k as E}from"../chunks/lit-qtGbjGnK.esm.js";import{c as T,u as b,d as M,e as N,A as x,a as h,b as B,_ as I,i as c}from"../chunks/localize-F31ae3j6.esm.js";import{D as F,f as _,W as y,j as W,S as U}from"../chunks/routes-b8sncPq8.esm.js";import{p as O}from"../chunks/progress-bar-Sn2QspHy.esm.js";import{p as R}from"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import{_ as K}from"../chunks/loading-template-Av0IUyKF.esm.js";import{c as w,g as j,f as $}from"../chunks/events-Y8fYvSqM.esm.js";import{logger as H}from"../utils/logger.esm.js";import"../utils/network-listeners.esm.js";import{createScopedLocalStorage as q}from"../utils/local-storage.esm.js";import{getCookieValue as k}from"../utils/cookies.esm.js";import{i as G}from"../chunks/lodash-P8OIs-at.esm.js";import{c as J}from"../chunks/responsive-aWj_7ZN_.esm.js";import{B as V}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";class Q extends C{static get styles(){return v`
1
+ import{h as C,f as v,y as p,g as f,p as z,m as A,k as E}from"../chunks/lit-qtGbjGnK.esm.js";import{c as T,u as b,d as M,e as N,A as x,a as h,b as B,_ as I,i as c}from"../chunks/localize-F31ae3j6.esm.js";import{D as F,e as _,W as y,h as W,S as U}from"../chunks/routes-31m626dW.esm.js";import{p as O}from"../chunks/progress-bar-Sn2QspHy.esm.js";import{p as R}from"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import{_ as K}from"../chunks/loading-template-Av0IUyKF.esm.js";import{c as w,g as j,f as $}from"../chunks/events-Y8fYvSqM.esm.js";import{logger as H}from"../utils/logger.esm.js";import"../utils/network-listeners.esm.js";import{createScopedLocalStorage as q}from"../utils/local-storage.esm.js";import{getCookieValue as k}from"../utils/cookies.esm.js";import{i as G}from"../chunks/lodash-P8OIs-at.esm.js";import{c as J}from"../chunks/responsive-aWj_7ZN_.esm.js";import{B as V}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";class Q extends C{static get styles(){return v`
2
2
  :host {
3
3
  position: relative;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{h as C,f as v,y as p,g as f,p as z,m as A,k as E}from"../chunks/lit-qtGbjGnK.esm.js";import{c as T,u as b,d as M,e as N,A as x,a as h,b as B,_ as I,i as c}from"../chunks/localize-fH8KOrMi.esm.js";import{D as F,f as _,W as y,j as W,S as U}from"../chunks/routes-3jKReDai.esm.js";import{p as O}from"../chunks/progress-bar-Sn2QspHy.esm.js";import{p as R}from"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import{_ as K}from"../chunks/loading-template-Av0IUyKF.esm.js";import{c as w,g as j,f as $}from"../chunks/events-Y8fYvSqM.esm.js";import{logger as H}from"../utils/logger.js";import"../utils/network-listeners.js";import{createScopedLocalStorage as q}from"../utils/local-storage.js";import{getCookieValue as k}from"../utils/cookies.js";import{i as G}from"../chunks/lodash-P8OIs-at.esm.js";import{c as J}from"../chunks/responsive-aWj_7ZN_.esm.js";import{B as V}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";class Q extends C{static get styles(){return v`
1
+ import{h as C,f as v,y as p,g as f,p as z,m as A,k as E}from"../chunks/lit-qtGbjGnK.esm.js";import{c as T,u as b,d as M,e as N,A as x,a as h,b as B,_ as I,i as c}from"../chunks/localize-fH8KOrMi.esm.js";import{D as F,e as _,W as y,h as W,S as U}from"../chunks/routes-sbqL3QFm.esm.js";import{p as O}from"../chunks/progress-bar-Sn2QspHy.esm.js";import{p as R}from"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import{_ as K}from"../chunks/loading-template-Av0IUyKF.esm.js";import{c as w,g as j,f as $}from"../chunks/events-Y8fYvSqM.esm.js";import{logger as H}from"../utils/logger.js";import"../utils/network-listeners.js";import{createScopedLocalStorage as q}from"../utils/local-storage.js";import{getCookieValue as k}from"../utils/cookies.js";import{i as G}from"../chunks/lodash-P8OIs-at.esm.js";import{c as J}from"../chunks/responsive-aWj_7ZN_.esm.js";import{B as V}from"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";class Q extends C{static get styles(){return v`
2
2
  :host {
3
3
  position: relative;
4
4
  }
@@ -1,2 +1,2 @@
1
- import{waitForElement as t}from"../utils/wait-for-element.esm.js";import{getCookieMap as r,getCookieValue as o}from"../utils/cookies.esm.js";import{initNetworkListeners as N}from"../utils/network-listeners.esm.js";import{e as P}from"../chunks/events-Y8fYvSqM.esm.js";import{I as T,f as W,R as j,s as q,k as y}from"../chunks/order-page-6Q-6CHug.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../utils/logger.esm.js";import"../utils/local-storage.esm.js";import"../utils/memoize-last.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-xW6a5_bz.esm.js";import"../chunks/routes-b8sncPq8.esm.js";import"../utils/remote-session.esm.js";import"./post-purchase.esm.js";import"../chunks/lit-qtGbjGnK.esm.js";import"../chunks/localize-F31ae3j6.esm.js";import"./redeem-transaction.esm.js";import"../chunks/progress-bar-Sn2QspHy.esm.js";import"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/loading-template-Av0IUyKF.esm.js";import"../chunks/css-card-grid-7tObtoJx.esm.js";import"./impact-overview.esm.js";import"../chunks/shoelace-components-7XWYNn-Z.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-aWj_7ZN_.esm.js";const i={waitForElement:t,getCookieMap:r,getCookieValue:o};export{T as addBeamAttributesToCart,P as events,W as getCurrentCart,N as initNetworkListeners,j as registerCartIntegration,q as showBeamOrderPageWidgets,y as trackCart,i as utils};
1
+ import{waitForElement as t}from"../utils/wait-for-element.esm.js";import{getCookieMap as r,getCookieValue as o}from"../utils/cookies.esm.js";import{initNetworkListeners as L}from"../utils/network-listeners.esm.js";import{e as O}from"../chunks/events-Y8fYvSqM.esm.js";import{I as R,f as T,R as W,s as j,k as q}from"../chunks/order-page-0azkW5QD.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../utils/logger.esm.js";import"../utils/local-storage.esm.js";import"../utils/memoize-last.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-XAwwFxhS.esm.js";import"../chunks/routes-31m626dW.esm.js";import"../utils/remote-session.esm.js";import"./post-purchase.esm.js";import"../chunks/lit-qtGbjGnK.esm.js";import"../chunks/localize-F31ae3j6.esm.js";import"./redeem-transaction.esm.js";import"../chunks/progress-bar-Sn2QspHy.esm.js";import"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/loading-template-Av0IUyKF.esm.js";import"../chunks/css-card-grid-7tObtoJx.esm.js";import"./impact-overview.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-aWj_7ZN_.esm.js";const i={waitForElement:t,getCookieMap:r,getCookieValue:o};export{R as addBeamAttributesToCart,O as events,T as getCurrentCart,L as initNetworkListeners,W as registerCartIntegration,j as showBeamOrderPageWidgets,q as trackCart,i as utils};
2
2
  //# sourceMappingURL=shopify.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shopify.esm.js","sources":["../../src/components/shopify/index.ts"],"sourcesContent":["/**\n * @deprecated\n * This file is preserved for backwards compatability, but future users should import from:\n * - integrations/shopify\n * - integration/utils\n * */\n\nimport { waitForElement } from \"../../utils/wait-for-element\";\nimport { getCookieMap, getCookieValue } from \"../../utils/cookies\";\n\nconst utils = {\n waitForElement,\n getCookieMap,\n getCookieValue,\n};\n\nexport { utils };\nexport { initNetworkListeners } from \"../../utils/network-listeners\";\nexport * as events from \"../../utils/events\";\n\nexport * from \"../../integrations/shopify\";\n"],"names":["utils","waitForElement","getCookieMap","getCookieValue"],"mappings":"gzCAUA,MAAMA,EAAQ,CACZ,eAAAC,EACA,aAAAC,EACA,eAAAC,CACF"}
1
+ {"version":3,"file":"shopify.esm.js","sources":["../../src/components/shopify/index.ts"],"sourcesContent":["/**\n * @deprecated\n * This file is preserved for backwards compatability, but future users should import from:\n * - integrations/shopify\n * - integration/utils\n * */\n\nimport { waitForElement } from \"../../utils/wait-for-element\";\nimport { getCookieMap, getCookieValue } from \"../../utils/cookies\";\n\nconst utils = {\n waitForElement,\n getCookieMap,\n getCookieValue,\n};\n\nexport { utils };\nexport { initNetworkListeners } from \"../../utils/network-listeners\";\nexport * as events from \"../../utils/events\";\n\nexport * from \"../../integrations/shopify\";\n"],"names":["utils","waitForElement","getCookieMap","getCookieValue"],"mappings":"0vCAUA,MAAMA,EAAQ,CACZ,eAAAC,EACA,aAAAC,EACA,eAAAC,CACF"}
@@ -1,2 +1,2 @@
1
- import{waitForElement as t}from"../utils/wait-for-element.js";import{getCookieMap as r,getCookieValue as o}from"../utils/cookies.js";import{initNetworkListeners as N}from"../utils/network-listeners.js";import{e as P}from"../chunks/events-Y8fYvSqM.esm.js";import{I as T,f as W,R as j,s as q,k as y}from"../chunks/order-page-mYYXHDVr.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../utils/logger.js";import"../utils/local-storage.js";import"../utils/memoize-last.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-GaVMWI6J.esm.js";import"../chunks/routes-3jKReDai.esm.js";import"../utils/remote-session.js";import"./post-purchase.js";import"../chunks/lit-qtGbjGnK.esm.js";import"../chunks/localize-fH8KOrMi.esm.js";import"./redeem-transaction.js";import"../chunks/progress-bar-Sn2QspHy.esm.js";import"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";import"./beam-partner-logos.js";import"../chunks/loading-template-Av0IUyKF.esm.js";import"../chunks/css-card-grid-7tObtoJx.esm.js";import"./impact-overview.js";import"../chunks/shoelace-components-paAsUPkU.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-aWj_7ZN_.esm.js";const i={waitForElement:t,getCookieMap:r,getCookieValue:o};export{T as addBeamAttributesToCart,P as events,W as getCurrentCart,N as initNetworkListeners,j as registerCartIntegration,q as showBeamOrderPageWidgets,y as trackCart,i as utils};
1
+ import{waitForElement as t}from"../utils/wait-for-element.js";import{getCookieMap as r,getCookieValue as o}from"../utils/cookies.js";import{initNetworkListeners as L}from"../utils/network-listeners.js";import{e as O}from"../chunks/events-Y8fYvSqM.esm.js";import{I as R,f as T,R as W,s as j,k as q}from"../chunks/order-page-n12hvsCN.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../utils/logger.js";import"../utils/local-storage.js";import"../utils/memoize-last.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../chunks/update-cart-NEt4A8dB.esm.js";import"../chunks/routes-sbqL3QFm.esm.js";import"../utils/remote-session.js";import"./post-purchase.js";import"../chunks/lit-qtGbjGnK.esm.js";import"../chunks/localize-fH8KOrMi.esm.js";import"./redeem-transaction.js";import"../chunks/progress-bar-Sn2QspHy.esm.js";import"../chunks/promo-pill-label-j0A8qZ0c.esm.js";import"../chunks/vendor-jQ8cxMpw.esm.js";import"./beam-partner-logos.js";import"../chunks/loading-template-Av0IUyKF.esm.js";import"../chunks/css-card-grid-7tObtoJx.esm.js";import"./impact-overview.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-aWj_7ZN_.esm.js";const i={waitForElement:t,getCookieMap:r,getCookieValue:o};export{R as addBeamAttributesToCart,O as events,T as getCurrentCart,L as initNetworkListeners,W as registerCartIntegration,j as showBeamOrderPageWidgets,q as trackCart,i as utils};
2
2
  //# sourceMappingURL=shopify.js.map