@beamimpact/web-sdk 1.48.0 → 1.50.1

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 (278) hide show
  1. package/dist/chunks/_share-dialog-dependencies-RmYWlyJ0.esm.js +2 -0
  2. package/dist/chunks/_share-dialog-dependencies-RmYWlyJ0.esm.js.map +1 -0
  3. package/dist/chunks/_share-dialog-dependencies-yCBFjXxQ.esm.js +2 -0
  4. package/dist/chunks/_share-dialog-dependencies-yCBFjXxQ.esm.js.map +1 -0
  5. package/dist/chunks/beam-errors-AMvTvR1C.esm.js +2 -0
  6. package/dist/chunks/beam-errors-AMvTvR1C.esm.js.map +1 -0
  7. package/dist/chunks/{beam-errors-fXDkG1zo.esm.d.ts → beam-errors-bKCZlkvr.esm.d.ts} +2 -7
  8. package/dist/chunks/cart-contents-6_ztOjrx.esm.d.ts +18 -0
  9. package/dist/chunks/cart-contents-h60geKWa.esm.js.map +1 -1
  10. package/dist/chunks/enforce-config-S8EGgEnO.esm.js +3 -0
  11. package/dist/chunks/enforce-config-S8EGgEnO.esm.js.map +1 -0
  12. package/dist/chunks/enforce-config-l-tNb_z7.esm.js +3 -0
  13. package/dist/chunks/enforce-config-l-tNb_z7.esm.js.map +1 -0
  14. package/dist/chunks/events-T3hYV1LF.esm.js +2 -0
  15. package/dist/chunks/events-T3hYV1LF.esm.js.map +1 -0
  16. package/dist/chunks/{events-ZCTR9JGZ.esm.d.ts → events-u_8n2LIU.esm.d.ts} +33 -4
  17. package/dist/chunks/{index-PA0NAKHV.esm.d.ts → index-0X3JKFYs.esm.d.ts} +1 -1
  18. package/dist/chunks/{index-XH3OS_sy.esm.d.ts → index-2qmtuEV_.esm.d.ts} +4 -4
  19. package/dist/chunks/index-44clOvXJ.esm.js +2 -0
  20. package/dist/chunks/index-44clOvXJ.esm.js.map +1 -0
  21. package/dist/chunks/index-B-9JPaCH.esm.js +2 -0
  22. package/dist/chunks/index-B-9JPaCH.esm.js.map +1 -0
  23. package/dist/chunks/{index-M7Ut5U3j.esm.js → index-CNVMNDM4.esm.js} +2 -2
  24. package/dist/chunks/index-CNVMNDM4.esm.js.map +1 -0
  25. package/dist/chunks/{index-XHm2EBaD.esm.js → index-HVGMpZIV.esm.js} +2 -2
  26. package/dist/chunks/{index-XHm2EBaD.esm.js.map → index-HVGMpZIV.esm.js.map} +1 -1
  27. package/dist/chunks/{index-WvOCqhxv.esm.js → index-UHchr4H_.esm.js} +2 -2
  28. package/dist/chunks/index-UHchr4H_.esm.js.map +1 -0
  29. package/dist/chunks/{index-JJjxnRZK.esm.js → index-XPlAZw7t.esm.js} +2 -2
  30. package/dist/chunks/{index-JJjxnRZK.esm.js.map → index-XPlAZw7t.esm.js.map} +1 -1
  31. package/dist/chunks/{index-v6fG3D6u.esm.d.ts → index-bhqIqVQJ.esm.d.ts} +1 -1
  32. package/dist/chunks/{index--z5MSe4-.esm.d.ts → index-cznI-EZa.esm.d.ts} +1 -1
  33. package/dist/chunks/index-dLnZQZlT.esm.js +2 -0
  34. package/dist/chunks/index-dLnZQZlT.esm.js.map +1 -0
  35. package/dist/chunks/index-f7fp9odj.esm.js +2 -0
  36. package/dist/chunks/index-f7fp9odj.esm.js.map +1 -0
  37. package/dist/chunks/index-kFulvjM4.esm.js +2 -0
  38. package/dist/chunks/index-kFulvjM4.esm.js.map +1 -0
  39. package/dist/chunks/index-m1LRybiJ.esm.js +2 -0
  40. package/dist/chunks/index-m1LRybiJ.esm.js.map +1 -0
  41. package/dist/chunks/index-puZGYsUA.esm.d.ts +46 -0
  42. package/dist/chunks/index-q2vZ79t1.esm.d.ts +46 -0
  43. package/dist/chunks/index-smGc5rsi.esm.js +2 -0
  44. package/dist/chunks/index-smGc5rsi.esm.js.map +1 -0
  45. package/dist/chunks/index-wz6Yfo37.esm.js +2 -0
  46. package/dist/chunks/index-wz6Yfo37.esm.js.map +1 -0
  47. package/dist/chunks/{localize-o-cYvHQf.esm.js → localize-7sMSg1W9.esm.js} +2 -2
  48. package/dist/chunks/{localize-o-cYvHQf.esm.js.map → localize-7sMSg1W9.esm.js.map} +1 -1
  49. package/dist/chunks/{localize-m-_ESmpk.esm.js → localize-OiRewTgu.esm.js} +2 -2
  50. package/dist/chunks/{localize-m-_ESmpk.esm.js.map → localize-OiRewTgu.esm.js.map} +1 -1
  51. package/dist/chunks/{openapi-spec-hjdK2L9Q.esm.d.ts → openapi-spec-bxGNhNMa.esm.d.ts} +332 -0
  52. package/dist/chunks/order-page-WPxvCNLM.esm.js +2 -0
  53. package/dist/chunks/{order-page-Z3WcYluU.esm.js.map → order-page-WPxvCNLM.esm.js.map} +1 -1
  54. package/dist/chunks/order-page-ZpOf35sP.esm.js +2 -0
  55. package/dist/chunks/{order-page-rrfJ4w9F.esm.js.map → order-page-ZpOf35sP.esm.js.map} +1 -1
  56. package/dist/chunks/{order-page-9clVUPaS.esm.d.ts → order-page-dlXIs0gJ.esm.d.ts} +6 -4
  57. package/dist/chunks/promo-types-aQ_hre6t.esm.d.ts +14 -0
  58. package/dist/chunks/promoManager--3WXq4at.esm.js +2 -0
  59. package/dist/chunks/promoManager--3WXq4at.esm.js.map +1 -0
  60. package/dist/chunks/promoManager-YUzbMtwY.esm.js +2 -0
  61. package/dist/chunks/promoManager-YUzbMtwY.esm.js.map +1 -0
  62. package/dist/chunks/routes-YPOoVIR2.esm.js +2 -0
  63. package/dist/chunks/routes-YPOoVIR2.esm.js.map +1 -0
  64. package/dist/chunks/{routes-iurI6dvR.esm.d.ts → routes-lGXt7ttd.esm.d.ts} +76 -3
  65. package/dist/chunks/routes-o-phF_L1.esm.js +2 -0
  66. package/dist/chunks/routes-o-phF_L1.esm.js.map +1 -0
  67. package/dist/chunks/{share-button-k_Xn5956.esm.js → share-button-EsUPw38-.esm.js} +2 -2
  68. package/dist/chunks/{share-button-diP8wKOc.esm.js.map → share-button-EsUPw38-.esm.js.map} +1 -1
  69. package/dist/chunks/{share-button-diP8wKOc.esm.js → share-button-r0y-bbwR.esm.js} +2 -2
  70. package/dist/chunks/{share-button-k_Xn5956.esm.js.map → share-button-r0y-bbwR.esm.js.map} +1 -1
  71. package/dist/chunks/{shoelace-components-wBxNHnyr.esm.js → shoelace-components-PB22pjfM.esm.js} +2 -2
  72. package/dist/chunks/{shoelace-components-wBxNHnyr.esm.js.map → shoelace-components-PB22pjfM.esm.js.map} +1 -1
  73. package/dist/chunks/{shoelace-components-xrhk189_.esm.js → shoelace-components-lr4iB8kL.esm.js} +2 -2
  74. package/dist/chunks/{shoelace-components-xrhk189_.esm.js.map → shoelace-components-lr4iB8kL.esm.js.map} +1 -1
  75. package/dist/chunks/{types-zbTZ8-KP.esm.d.ts → types-IbMT3Nwn.esm.d.ts} +5 -1
  76. package/dist/chunks/{update-cart-l86bU5uS.esm.d.ts → update-cart-JO4fuiim.esm.d.ts} +1 -1
  77. package/dist/chunks/update-cart-UuMHYehB.esm.js +2 -0
  78. package/dist/chunks/update-cart-UuMHYehB.esm.js.map +1 -0
  79. package/dist/chunks/update-cart-mNsQ9K-k.esm.js +2 -0
  80. package/dist/chunks/update-cart-mNsQ9K-k.esm.js.map +1 -0
  81. package/dist/components/community-impact.d.ts +1 -1
  82. package/dist/components/community-impact.esm.js +1 -1
  83. package/dist/components/community-impact.js +1 -1
  84. package/dist/components/cumulative-impact.d.ts +1 -1
  85. package/dist/components/cumulative-impact.esm.js +1 -1
  86. package/dist/components/cumulative-impact.js +1 -1
  87. package/dist/components/impact-overview.d.ts +6 -2
  88. package/dist/components/impact-overview.esm.js +2 -2
  89. package/dist/components/impact-overview.esm.js.map +1 -1
  90. package/dist/components/impact-overview.js +2 -2
  91. package/dist/components/impact-overview.js.map +1 -1
  92. package/dist/components/index.d.ts +4 -4
  93. package/dist/components/index.esm.js +1 -1
  94. package/dist/components/index.js +1 -1
  95. package/dist/components/post-purchase.d.ts +11 -3
  96. package/dist/components/post-purchase.esm.js +4 -4
  97. package/dist/components/post-purchase.esm.js.map +1 -1
  98. package/dist/components/post-purchase.js +4 -4
  99. package/dist/components/post-purchase.js.map +1 -1
  100. package/dist/components/product-details-page.d.ts +23 -4
  101. package/dist/components/product-details-page.esm.js +24 -24
  102. package/dist/components/product-details-page.esm.js.map +1 -1
  103. package/dist/components/product-details-page.js +24 -24
  104. package/dist/components/product-details-page.js.map +1 -1
  105. package/dist/components/redeem-transaction.d.ts +5 -14
  106. package/dist/components/redeem-transaction.esm.js +27 -27
  107. package/dist/components/redeem-transaction.esm.js.map +1 -1
  108. package/dist/components/redeem-transaction.js +27 -27
  109. package/dist/components/redeem-transaction.js.map +1 -1
  110. package/dist/components/select-nonprofit.d.ts +10 -3
  111. package/dist/components/select-nonprofit.esm.js +50 -45
  112. package/dist/components/select-nonprofit.esm.js.map +1 -1
  113. package/dist/components/select-nonprofit.js +50 -45
  114. package/dist/components/select-nonprofit.js.map +1 -1
  115. package/dist/components/select-subscription-nonprofit.d.ts +1 -1
  116. package/dist/components/select-subscription-nonprofit.esm.js +1 -1
  117. package/dist/components/select-subscription-nonprofit.js +1 -1
  118. package/dist/components/shopify.d.ts +8 -7
  119. package/dist/components/shopify.esm.js +1 -1
  120. package/dist/components/shopify.esm.js.map +1 -1
  121. package/dist/components/shopify.js +1 -1
  122. package/dist/components/shopify.js.map +1 -1
  123. package/dist/components/social-share.d.ts +1 -1
  124. package/dist/components/social-share.esm.js +1 -1
  125. package/dist/components/social-share.js +1 -1
  126. package/dist/components/subscription-impact.d.ts +2 -1
  127. package/dist/components/subscription-impact.esm.js +1 -1
  128. package/dist/components/subscription-impact.js +1 -1
  129. package/dist/components/subscription-management.d.ts +15 -4
  130. package/dist/components/subscription-management.esm.js +1 -1
  131. package/dist/components/subscription-management.js +1 -1
  132. package/dist/index.d.ts +16 -14
  133. package/dist/index.esm.js +1 -1
  134. package/dist/index.js +1 -1
  135. package/dist/integrations/beam.d.ts +1 -1
  136. package/dist/integrations/beam.esm.js +1 -1
  137. package/dist/integrations/beam.js +1 -1
  138. package/dist/integrations/cart.d.ts +3 -3
  139. package/dist/integrations/cart.esm.js +1 -1
  140. package/dist/integrations/cart.js +1 -1
  141. package/dist/integrations/index.d.ts +14 -12
  142. package/dist/integrations/index.esm.js +1 -1
  143. package/dist/integrations/index.js +1 -1
  144. package/dist/integrations/logs.d.ts +2 -2
  145. package/dist/integrations/logs.esm.js +1 -1
  146. package/dist/integrations/logs.js +1 -1
  147. package/dist/integrations/promoManager.d.ts +36 -0
  148. package/dist/integrations/promoManager.esm.js +2 -0
  149. package/dist/integrations/promoManager.esm.js.map +1 -0
  150. package/dist/integrations/promoManager.js +2 -0
  151. package/dist/integrations/promoManager.js.map +1 -0
  152. package/dist/integrations/session.esm.js +1 -1
  153. package/dist/integrations/session.js +1 -1
  154. package/dist/integrations/shopify.d.ts +6 -6
  155. package/dist/integrations/shopify.esm.js +1 -1
  156. package/dist/integrations/shopify.js +1 -1
  157. package/dist/integrations/statsig.d.ts +1 -1
  158. package/dist/integrations/statsig.esm.js +1 -1
  159. package/dist/integrations/statsig.js +1 -1
  160. package/dist/integrations/utils.d.ts +7 -5
  161. package/dist/integrations/utils.esm.js +1 -1
  162. package/dist/integrations/utils.js +1 -1
  163. package/dist/react/community-impact.d.ts +1 -1
  164. package/dist/react/community-impact.esm.js +1 -1
  165. package/dist/react/community-impact.js +1 -1
  166. package/dist/react/cumulative-impact.d.ts +1 -1
  167. package/dist/react/cumulative-impact.esm.js +1 -1
  168. package/dist/react/cumulative-impact.js +1 -1
  169. package/dist/react/impact-overview.d.ts +1 -1
  170. package/dist/react/impact-overview.esm.js +1 -1
  171. package/dist/react/impact-overview.js +1 -1
  172. package/dist/react/index.d.ts +6 -5
  173. package/dist/react/index.esm.js +1 -1
  174. package/dist/react/index.js +1 -1
  175. package/dist/react/post-purchase.d.ts +3 -3
  176. package/dist/react/post-purchase.esm.js +1 -1
  177. package/dist/react/post-purchase.esm.js.map +1 -1
  178. package/dist/react/post-purchase.js +1 -1
  179. package/dist/react/post-purchase.js.map +1 -1
  180. package/dist/react/product-details-page.d.ts +1 -1
  181. package/dist/react/product-details-page.esm.js +1 -1
  182. package/dist/react/product-details-page.esm.js.map +1 -1
  183. package/dist/react/product-details-page.js +1 -1
  184. package/dist/react/product-details-page.js.map +1 -1
  185. package/dist/react/redeem-transaction.d.ts +5 -4
  186. package/dist/react/redeem-transaction.esm.js +1 -1
  187. package/dist/react/redeem-transaction.js +1 -1
  188. package/dist/react/select-nonprofit.d.ts +5 -4
  189. package/dist/react/select-nonprofit.esm.js +1 -1
  190. package/dist/react/select-nonprofit.esm.js.map +1 -1
  191. package/dist/react/select-nonprofit.js +1 -1
  192. package/dist/react/select-nonprofit.js.map +1 -1
  193. package/dist/react/select-subscription-nonprofit.d.ts +5 -4
  194. package/dist/react/select-subscription-nonprofit.esm.js +1 -1
  195. package/dist/react/select-subscription-nonprofit.js +1 -1
  196. package/dist/react/social-share.d.ts +1 -1
  197. package/dist/react/social-share.esm.js +1 -1
  198. package/dist/react/social-share.js +1 -1
  199. package/dist/react/subscription-impact.d.ts +1 -1
  200. package/dist/react/subscription-impact.esm.js +1 -1
  201. package/dist/react/subscription-impact.js +1 -1
  202. package/dist/react/subscription-management.d.ts +4 -4
  203. package/dist/react/subscription-management.esm.js +1 -1
  204. package/dist/react/subscription-management.js +1 -1
  205. package/dist/utils/beam-errors.d.ts +1 -1
  206. package/dist/utils/beam-errors.esm.js +1 -1
  207. package/dist/utils/beam-errors.js +1 -1
  208. package/dist/utils/cart.esm.js +1 -1
  209. package/dist/utils/cart.js +1 -1
  210. package/dist/utils/cookies.esm.js +1 -1
  211. package/dist/utils/cookies.esm.js.map +1 -1
  212. package/dist/utils/cookies.js +1 -1
  213. package/dist/utils/cookies.js.map +1 -1
  214. package/dist/utils/events.d.ts +5 -4
  215. package/dist/utils/events.esm.js +1 -1
  216. package/dist/utils/events.js +1 -1
  217. package/dist/utils/index.d.ts +7 -5
  218. package/dist/utils/index.esm.js +1 -1
  219. package/dist/utils/index.js +1 -1
  220. package/dist/utils/local-storage.esm.js +1 -1
  221. package/dist/utils/local-storage.js +1 -1
  222. package/dist/utils/network-listeners.esm.js +1 -1
  223. package/dist/utils/network-listeners.esm.js.map +1 -1
  224. package/dist/utils/network-listeners.js +1 -1
  225. package/dist/utils/network-listeners.js.map +1 -1
  226. package/dist/utils/promoManager.d.ts +123 -0
  227. package/dist/utils/promoManager.esm.js +2 -0
  228. package/dist/utils/promoManager.esm.js.map +1 -0
  229. package/dist/utils/promoManager.js +2 -0
  230. package/dist/utils/promoManager.js.map +1 -0
  231. package/dist/utils/remote-session.esm.js +1 -1
  232. package/dist/utils/remote-session.js +1 -1
  233. package/dist/utils/wait-for-element.esm.js +1 -1
  234. package/dist/utils/wait-for-element.js +1 -1
  235. package/package.json +2 -2
  236. package/dist/chunks/_share-dialog-dependencies-2jzbs44g.esm.js +0 -2
  237. package/dist/chunks/_share-dialog-dependencies-2jzbs44g.esm.js.map +0 -1
  238. package/dist/chunks/_share-dialog-dependencies-C8uChjuF.esm.js +0 -2
  239. package/dist/chunks/_share-dialog-dependencies-C8uChjuF.esm.js.map +0 -1
  240. package/dist/chunks/beam-errors-P-Lu07Ce.esm.js +0 -2
  241. package/dist/chunks/beam-errors-P-Lu07Ce.esm.js.map +0 -1
  242. package/dist/chunks/cart-contents-CMm57qu0.esm.d.ts +0 -11
  243. package/dist/chunks/enforce-config-ZAI7WYAd.esm.js +0 -3
  244. package/dist/chunks/enforce-config-ZAI7WYAd.esm.js.map +0 -1
  245. package/dist/chunks/enforce-config-ZyPq_4CF.esm.js +0 -3
  246. package/dist/chunks/enforce-config-ZyPq_4CF.esm.js.map +0 -1
  247. package/dist/chunks/events-6Z5MkCRr.esm.js +0 -2
  248. package/dist/chunks/events-6Z5MkCRr.esm.js.map +0 -1
  249. package/dist/chunks/index-2bLOkP4H.esm.d.ts +0 -32
  250. package/dist/chunks/index-CsWTfuok.esm.js +0 -2
  251. package/dist/chunks/index-CsWTfuok.esm.js.map +0 -1
  252. package/dist/chunks/index-GynYZRPI.esm.d.ts +0 -32
  253. package/dist/chunks/index-M7Ut5U3j.esm.js.map +0 -1
  254. package/dist/chunks/index-MIp7LlXH.esm.js +0 -2
  255. package/dist/chunks/index-MIp7LlXH.esm.js.map +0 -1
  256. package/dist/chunks/index-WvOCqhxv.esm.js.map +0 -1
  257. package/dist/chunks/index-YJNgLCif.esm.js +0 -2
  258. package/dist/chunks/index-YJNgLCif.esm.js.map +0 -1
  259. package/dist/chunks/index-a6oXV2ro.esm.js +0 -2
  260. package/dist/chunks/index-a6oXV2ro.esm.js.map +0 -1
  261. package/dist/chunks/index-dkwGkvOu.esm.js +0 -2
  262. package/dist/chunks/index-dkwGkvOu.esm.js.map +0 -1
  263. package/dist/chunks/index-iK195-B9.esm.js +0 -2
  264. package/dist/chunks/index-iK195-B9.esm.js.map +0 -1
  265. package/dist/chunks/index-nstmHC95.esm.js +0 -2
  266. package/dist/chunks/index-nstmHC95.esm.js.map +0 -1
  267. package/dist/chunks/index-vq14EaW4.esm.js +0 -2
  268. package/dist/chunks/index-vq14EaW4.esm.js.map +0 -1
  269. package/dist/chunks/order-page-Z3WcYluU.esm.js +0 -2
  270. package/dist/chunks/order-page-rrfJ4w9F.esm.js +0 -2
  271. package/dist/chunks/routes-Dmf2ZNnZ.esm.js +0 -2
  272. package/dist/chunks/routes-Dmf2ZNnZ.esm.js.map +0 -1
  273. package/dist/chunks/routes-o1QpF40R.esm.js +0 -2
  274. package/dist/chunks/routes-o1QpF40R.esm.js.map +0 -1
  275. package/dist/chunks/update-cart-EGTcbNRX.esm.js +0 -2
  276. package/dist/chunks/update-cart-EGTcbNRX.esm.js.map +0 -1
  277. package/dist/chunks/update-cart-FwtFnnGe.esm.js +0 -2
  278. package/dist/chunks/update-cart-FwtFnnGe.esm.js.map +0 -1
@@ -1 +1 @@
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/strings.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","export const strings = {\n en: {\n ctaTitle: () => `Choose your impact`,\n ctaMessage: () => `At no extra cost, 1% of every order is donated to a nonprofit you choose. Powered by Beam`,\n inlineSeparator: () => `:`,\n },\n fr: {\n ctaTitle: () => `Choisissez l'impact de votre choix`,\n ctaMessage: () =>\n `Sans frais supplémentaires, 1% de chaque commande est reversé à l'organisation caritative de votre choix. Développé par Beam`,\n inlineSeparator: () => `:`,\n },\n es: {\n ctaTitle: () => `Elige el impacto que deseas`,\n ctaMessage: () =>\n `Sin coste adicional, el 1% de cada pedido se dona a la organización sin ánimo de lucro que tú elijas. Desarrollado por Beam`,\n inlineSeparator: () => `:`,\n },\n de: {\n ctaTitle: () => `Wählen Sie Ihren Einfluss`,\n ctaMessage: () =>\n `Ohne zusätzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gewählte gemeinnützige Organisation gespendet. Von Beam unterstützt`,\n inlineSeparator: () => `:`,\n },\n it: {\n ctaTitle: () => `Scegliete chi sostenere`,\n ctaMessage: () =>\n `L'1% di ogni vostro acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a libera scelta. Promosso da Beam`,\n inlineSeparator: () => `:`,\n },\n pl: {\n ctaTitle: () => `Masz wpływ, dokonaj wyboru`,\n ctaMessage: () =>\n `1% kwoty każdego zamówienia jest przekazywane na rzecz wybranej przez Ciebie organizacji non-profit – bez dodatkowych kosztów. Obsługiwane przez Beam`,\n inlineSeparator: () => `:`,\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 { 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\";\nimport { promoPillLabelConfigDefaults } from \"../../shared/components/promo-pill-label\";\nimport { strings } from \"./strings\";\nimport \"../../shared/components/promo-pill-label\";\n\ntype RequiredConfig = {\n apiKey: string;\n storeId: number;\n};\ntype IAPIV3GetProductDetailsPage = Awaited<ReturnType<typeof getProductDetailsPage>>;\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 draftConfig = false;\n\n @property({ type: Boolean }) public debug = false;\n\n @property({ type: String }) remoteProductIdentifier?: string;\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 draftConfig: this.draftConfig,\n remoteProductIdentifier: this.remoteProductIdentifier,\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 render() {\n const { data, loading } = this.productDetailsPageDataController;\n const iconDisplay = this.cssVariables[\"--beam-ProductDetailsPage-image-placement\"];\n const isNonZero = (value: string) => value !== \"0px\" && value !== \"0\";\n const shouldDisplayPromoPill = this.cssVariables[\"--beam-ProductDetailsPage-shouldDisplayPromoPill\"] === \"true\";\n const isPromoActive = !!data?.config?.web?.promo;\n const hasValidImageHeight = isNonZero(this.cssVariables[\"--beam-ProductDetailsPage-imageHeight\"]);\n const hasValidTitleFontSize = isNonZero(this.cssVariables[\"--beam-ProductDetailsPage-title-fontSize\"]);\n const isPromoPillVisible =\n shouldDisplayPromoPill && // Determines if the promo pill is enabled for the marketing version of the PDP\n isPromoActive && // Is promo currently active\n hasValidImageHeight && // Ensures the promo pill is not displayed for the subtext version of the PDP\n hasValidTitleFontSize; // Ensures the promo pill is not displayed for the subtext version of the PDP\n const shouldShowPunctuation = this.cssVariables[\"--beam-ProductDetailsPage-shouldDisplayColon\"] === \"true\"; // Determines if a colon should be displayed in promo display\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 ${iconDisplay === \"block-center\" ? \"block-display\" : \"inline-display\"}\">\n ${iconDisplay === \"block-center\"\n ? html`\n ${this.renderWidgetIcon(iconDisplay)}\n ${isPromoPillVisible\n ? html`\n <div class=\"promo-container\">\n <beam-promo-info-pill .promo=${data?.config?.web?.promo}></beam-promo-info-pill>\n </div>\n `\n : html``}\n <div class=\"info-container\">${this.renderContent(isPromoPillVisible, shouldShowPunctuation, data)}</div>\n `\n : html`\n ${isPromoPillVisible\n ? html`\n <div class=\"promo-container\">\n <beam-promo-info-pill .promo=${data?.config?.web?.promo}></beam-promo-info-pill>\n </div>\n `\n : html``}\n <div class=\"content-inline\">\n ${this.renderWidgetIcon(iconDisplay)}\n <div class=\"info-container\">${this.renderContent(isPromoPillVisible, shouldShowPunctuation, data)}</div>\n </div>\n `}\n </div>\n `;\n }\n\n renderWidgetIcon(iconDisplay: string) {\n const imageUrl = this.cssVariables[IMAGE_URL_REMOTE_CONFIG_KEY];\n\n if (!imageUrl) return html``;\n\n const isBlockDisplay = iconDisplay === \"block-center\";\n const containerStyle = isBlockDisplay ? 'style=\"order:1\"' : \"\";\n\n return html`\n <span class=\"icon-container\" part=\"icon\" ${containerStyle}>\n <img src=${imageUrl} alt=\"Widget Icon\" />\n </span>\n `;\n }\n\n renderContent(isPromoPillVisible: boolean, shouldDisplayColon: boolean, data: IAPIV3GetProductDetailsPage) {\n const title = localizeUserString(this.configLang, data?.config?.web?.title) || strings[this.configLang].ctaTitle();\n const description =\n localizeUserString(this.configLang, data?.config?.web?.description) || strings[this.configLang].ctaMessage();\n return isPromoPillVisible\n ? html`\n <div class=\"info-inline-promo\">\n <span class=\"title\">${title + (shouldDisplayColon ? strings[this.configLang].inlineSeparator() : \"\")}</span>\n <span class=\"description\"> ${description} ${this.renderDisclosureTooltip()} </span>\n </div>\n `\n : html`\n <div class=\"title-block\">\n <h3 class=\"title\">${title}</h3>\n </div>\n <div class=\"description-block\">\n <span class=\"description\"> ${description} ${this.renderDisclosureTooltip()} </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\" part=\"tooltip\">\n <div class=\"ppgf-disclosure-tooltip-content\" slot=\"content\" part=\"tooltip-content\">\n <button\n class=\"ppgf-disclosure-close\"\n aria-label=\"Close tooltip\"\n part=\"tooltip-close-button\"\n @click=\"${onClickClose}\"\n >\n ${this.renderCloseTooltipIcon()}\n </button>\n <div class=\"ppgf-disclosure-tooltip-copy\" part=\"tooltip-disclosure-copy\">\n ${unsafeHTML(ppgfDisclosure.copy)}\n </div>\n </div>\n <span class=\"ppgf-disclosure-tooltip-trigger\" part=\"tooltip-disclosure-icon\">\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-InfoContainer-textAlign\": \"inherit\",\n \"--beam-ProductDetailsPage-InfoContainer-lineHeight\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginTop\": \"4px\",\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: \"0px\",\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 \"--beam-ProductDetailsPage-image-placement\": \"inline-left\", // options: \"inline-left\" || \"block-center\"\n \"--beam-ProductDetailsPage-blockImage-alignSelf\": \"center\",\n \"--beam-ProductDetailsPage-promoPill-marginTop\": \"4px\",\n \"--beam-ProductDetailsPage-promoPill-alignSelf\": \"left\",\n \"--beam-ProductDetailsPage-shouldDisplayColon\": \"true\",\n \"--beam-ProductDetailsPage-shouldDisplayPromoPill\": \"true\",\n ...promoPillLabelConfigDefaults,\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 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 display: flex;\n flex-direction: column;\n ${useCustomBorder(\"--beam-ProductDetailsPage\")}\n }\n /* When iconDisplay is inline-center */\n .inline-display {\n display: flex;\n }\n /* When iconDisplay is block-center */\n .block-display {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .promo-container {\n order: 2;\n display: flex;\n margin-top: var(--beam-ProductDetailsPage-promoPill-marginTop);\n align-self: var(--beam-ProductDetailsPage-promoPill-alignSelf);\n }\n .content-inline {\n order: 3;\n display: flex;\n align-items: center;\n }\n /* Info block for both inline and block layout */\n .info-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n text-align: var(--beam-ProductDetailsPage-InfoContainer-textAlign);\n line-height: var(--beam-ProductDetailsPage-InfoContainer-lineHeight);\n margin-top: var(--beam-ProductDetailsPage-InfoContainer-marginTop);\n margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);\n }\n .block-display .info-container {\n order: 3;\n }\n .root.inline-display .icon-container,\n .root.inline-display .info-container {\n display: inline-flex;\n }\n .root.inline-display {\n flex-direction: column;\n }\n .icon-container {\n width: var(--beam-ProductDetailsPage-imageWidth);\n height: var(--beam-ProductDetailsPage-imageHeight);\n align-self: var(--beam-ProductDetailsPage-blockImage-alignSelf);\n flex-shrink: 0;\n }\n .icon-container > img {\n width: 100%;\n height: 100%;\n object-fit: contain;\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 .info-inline-promo {\n margin-top: var(--beam-ProductDetailsPage-description-marginTop, 0px);\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 ${useCustomText(\"--beam-ProductDetailsPage-description\")}\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 vertical-align: text-bottom;\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","strings","y","v","l","p","n","e","o","t","r","IMAGE_URL_REMOTE_CONFIG_KEY","BeamProductDetailsPage","LitElement","DEFAULT_BASE_URL","enforceConfig","getProductDetailsPage","makeApiKeyHeader","WIDGET_NAMES","AsyncController","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","data","loading","iconDisplay","isNonZero","value","shouldDisplayPromoPill","isPromoActive","hasValidImageHeight","hasValidTitleFontSize","isPromoPillVisible","shouldShowPunctuation","_errorMessage","imageUrl","shouldDisplayColon","title","localizeUserString","description","onClickClose","tooltip","ppgfDisclosure","unsafeHTML","ppgfHyperlink","defaults","defineCustomText","promoPillLabelConfigDefaults","remoteConfig","config","_cssVariableMap","cssReset","cssResponsiveUtils","css","useCustomText","__decorateClass","property","defineCustomElement"],"mappings":"snBAEO,MAAMA,EAAqB,CAChCC,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc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EAEA4C,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAbhB7C,EAayB,UAAA,QAAA,CAAA,EAER4C,EAAA,CAA3BC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAff7C,EAeiB,UAAA,0BAAA,CAAA,EA+Y9B8C,EAAoB9C,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/strings.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","export const strings = {\n en: {\n ctaTitle: () => `Choose your impact`,\n ctaMessage: () => `At no extra cost, 1% of every order is donated to a nonprofit you choose. Powered by Beam`,\n inlineSeparator: () => `:`,\n },\n fr: {\n ctaTitle: () => `Choisissez l'impact de votre choix`,\n ctaMessage: () =>\n `Sans frais supplémentaires, 1% de chaque commande est reversé à l'organisation caritative de votre choix. Développé par Beam`,\n inlineSeparator: () => `:`,\n },\n es: {\n ctaTitle: () => `Elige el impacto que deseas`,\n ctaMessage: () =>\n `Sin coste adicional, el 1% de cada pedido se dona a la organización sin ánimo de lucro que tú elijas. Desarrollado por Beam`,\n inlineSeparator: () => `:`,\n },\n de: {\n ctaTitle: () => `Wählen Sie Ihren Einfluss`,\n ctaMessage: () =>\n `Ohne zusätzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gewählte gemeinnützige Organisation gespendet. Von Beam unterstützt`,\n inlineSeparator: () => `:`,\n },\n it: {\n ctaTitle: () => `Scegliete chi sostenere`,\n ctaMessage: () =>\n `L'1% di ogni vostro acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a libera scelta. Promosso da Beam`,\n inlineSeparator: () => `:`,\n },\n pl: {\n ctaTitle: () => `Masz wpływ, dokonaj wyboru`,\n ctaMessage: () =>\n `1% kwoty każdego zamówienia jest przekazywane na rzecz wybranej przez Ciebie organizacji non-profit – bez dodatkowych kosztów. Obsługiwane przez Beam`,\n inlineSeparator: () => `:`,\n },\n};\n","import { LitElement, css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { postProductDetailsPage } 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 { 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\";\nimport { promoPillLabelConfigDefaults } from \"../../shared/components/promo-pill-label\";\nimport {\n getPromoCodesFromCart,\n setPromoCodeInCookie,\n parseJsonStringArray,\n formatStoreAndReturnPromoCodes,\n setPromoCodesInLocalStorage,\n isEmptyPromoData,\n} from \"../../utils/promoManager\";\nimport \"../../shared/components/promo-pill-label\";\nimport { BEAM_CART_COOKIE_NAME, TBeamCartLocalStorage } from \"../../shared/cart-contents\";\nimport { createScopedLocalStorage } from \"../../utils/local-storage\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { BeamPromoCodesStoredEvent, BeamWidgetStoredPromoCodesEvent } from \"../../utils/events\";\nimport { getBeamCartId } from \"../../utils/cart\";\nimport { strings } from \"./strings\";\n\ntype RequiredConfig = {\n apiKey: string;\n storeId: number;\n};\ntype IAPIV3PostProductDetailsPage = Awaited<ReturnType<typeof postProductDetailsPage>>;\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 draftConfig = false;\n\n @property({ type: Boolean }) public debug = false;\n\n @property({ type: String }) remoteProductIdentifier?: string;\n\n @property({ type: String }) public promoCodes?: string;\n\n @property({ type: String }) public domain?: string;\n\n private localStorage = createScopedLocalStorage(this as LitElement & RequiredConfig);\n\n @state() private pluginPromoCodes: string[] = [];\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n get parsedPromoCodes(): string[] {\n return parseJsonStringArray(this.promoCodes);\n }\n\n private handlePromoCodesStored = (evt: BeamPromoCodesStoredEvent) => {\n const promoCodesFromPlugin = (evt.detail.promoCodes?.unvalidatedPromoCodes ?? [])\n .map((c) => c.attributes?.value ?? c.attributes?.url ?? \"\")\n .sort();\n this.pluginPromoCodes = promoCodesFromPlugin;\n };\n\n private getManualPromoCodes(): string[] {\n // Priority 1: Widget passed discount codes\n if (this.parsedPromoCodes && this.parsedPromoCodes.length > 0) {\n return this.parsedPromoCodes;\n }\n\n // Priority 2: Cart fallback\n const cart = this.localStorage.getItemJson<TBeamCartLocalStorage>(\"cart\");\n return cart ? getPromoCodesFromCart(cart) : [];\n }\n\n private async handleValidatedPromoCodes(response: IAPIV3PostProductDetailsPage) {\n if (response.promos?.validatedPromoCodes) {\n await Promise.all([\n setPromoCodesInLocalStorage({\n apiKey: this.apiKey,\n promoCodes: { validatedPromoCodes: response.promos.validatedPromoCodes, unvalidatedPromoCodes: [] },\n }),\n setPromoCodeInCookie({\n validatedPromoCodes: response.promos.validatedPromoCodes,\n domain: this.domain,\n }),\n ]);\n this.dispatchEvent(\n new BeamWidgetStoredPromoCodesEvent({\n source: WIDGET_NAMES.product_details_page,\n })\n );\n }\n }\n\n async firstUpdated() {\n window.addEventListener(BeamPromoCodesStoredEvent.eventName, this.handlePromoCodesStored as EventListener);\n }\n\n disconnectedCallback() {\n window.removeEventListener(BeamPromoCodesStoredEvent.eventName, this.handlePromoCodesStored as EventListener);\n super.disconnectedCallback();\n }\n\n postProductDetailsPageData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"storeId\"], this)) throw new MissingConfig();\n const beamCartId = getBeamCartId(BEAM_CART_COOKIE_NAME, { apiKey: this.apiKey });\n\n const manualPromoCodes = this.getManualPromoCodes();\n const formattedPromos = formatStoreAndReturnPromoCodes(\n manualPromoCodes.map((code) => ({ value: code })),\n this.apiKey\n );\n const shouldSendPromos = formattedPromos && !isEmptyPromoData(formattedPromos);\n\n if (shouldSendPromos) {\n this.dispatchEvent(\n new BeamWidgetStoredPromoCodesEvent({\n source: WIDGET_NAMES.product_details_page,\n })\n );\n }\n const res = await postProductDetailsPage({\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 draftConfig: this.draftConfig,\n remoteProductIdentifier: this.remoteProductIdentifier,\n },\n requestBody: {\n ...(shouldSendPromos && { promos: formattedPromos }),\n beamCartId: beamCartId ? beamCartId : undefined,\n },\n });\n this.handleValidatedPromoCodes(res);\n return res;\n };\n\n private productDetailsPageDataController = new AsyncController<typeof this.postProductDetailsPageData>(\n this,\n this.postProductDetailsPageData\n );\n\n async updated(changedProperties: Map<string, unknown>) {\n const requireNewDataProps = [\"storeId\", \"baseUrl\", \"lang\", \"apiKey\", \"pluginPromoCodes\"];\n void this.pluginPromoCodes;\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.productDetailsPageDataController.exec();\n break;\n }\n }\n }\n\n render() {\n const { data, loading } = this.productDetailsPageDataController;\n const iconDisplay = this.cssVariables[\"--beam-ProductDetailsPage-image-placement\"];\n const isNonZero = (value: string) => value !== \"0px\" && value !== \"0\";\n const shouldDisplayPromoPill = this.cssVariables[\"--beam-ProductDetailsPage-shouldDisplayPromoPill\"] === \"true\";\n const isPromoActive = !!data?.config?.web?.promo;\n const hasValidImageHeight = isNonZero(this.cssVariables[\"--beam-ProductDetailsPage-imageHeight\"]);\n const hasValidTitleFontSize = isNonZero(this.cssVariables[\"--beam-ProductDetailsPage-title-fontSize\"]);\n const isPromoPillVisible =\n shouldDisplayPromoPill && // Determines if the promo pill is enabled for the marketing version of the PDP\n isPromoActive && // Is promo currently active\n hasValidImageHeight && // Ensures the promo pill is not displayed for the subtext version of the PDP\n hasValidTitleFontSize; // Ensures the promo pill is not displayed for the subtext version of the PDP\n const shouldShowPunctuation = this.cssVariables[\"--beam-ProductDetailsPage-shouldDisplayColon\"] === \"true\"; // Determines if a colon should be displayed in promo display\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 ${iconDisplay === \"block-center\" ? \"block-display\" : \"inline-display\"}\">\n ${iconDisplay === \"block-center\"\n ? html`\n ${this.renderWidgetIcon(iconDisplay)}\n ${isPromoPillVisible\n ? html`\n <div class=\"promo-container\">\n <beam-promo-info-pill .promo=${data?.config?.web?.promo}></beam-promo-info-pill>\n </div>\n `\n : html``}\n <div class=\"info-container\">${this.renderContent(isPromoPillVisible, shouldShowPunctuation, data)}</div>\n `\n : html`\n ${isPromoPillVisible\n ? html`\n <div class=\"promo-container\">\n <beam-promo-info-pill .promo=${data?.config?.web?.promo}></beam-promo-info-pill>\n </div>\n `\n : html``}\n <div class=\"content-inline\">\n ${this.renderWidgetIcon(iconDisplay)}\n <div class=\"info-container\">${this.renderContent(isPromoPillVisible, shouldShowPunctuation, data)}</div>\n </div>\n `}\n </div>\n `;\n }\n\n renderWidgetIcon(iconDisplay: string) {\n const imageUrl = this.cssVariables[IMAGE_URL_REMOTE_CONFIG_KEY];\n\n if (!imageUrl) return html``;\n\n const isBlockDisplay = iconDisplay === \"block-center\";\n const containerStyle = isBlockDisplay ? 'style=\"order:1\"' : \"\";\n\n return html`\n <span class=\"icon-container\" part=\"icon\" ${containerStyle}>\n <img src=${imageUrl} alt=\"Widget Icon\" />\n </span>\n `;\n }\n\n renderContent(isPromoPillVisible: boolean, shouldDisplayColon: boolean, data: IAPIV3PostProductDetailsPage) {\n const title = localizeUserString(this.configLang, data?.config?.web?.title) || strings[this.configLang].ctaTitle();\n const description =\n localizeUserString(this.configLang, data?.config?.web?.description) || strings[this.configLang].ctaMessage();\n return isPromoPillVisible\n ? html`\n <div class=\"info-inline-promo\">\n <span class=\"title\">${title + (shouldDisplayColon ? strings[this.configLang].inlineSeparator() : \"\")}</span>\n <span class=\"description\"> ${description} ${this.renderDisclosureTooltip()} </span>\n </div>\n `\n : html`\n <div class=\"title-block\">\n <h3 class=\"title\">${title}</h3>\n </div>\n <div class=\"description-block\">\n <span class=\"description\"> ${description} ${this.renderDisclosureTooltip()} </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\" part=\"tooltip\">\n <div class=\"ppgf-disclosure-tooltip-content\" slot=\"content\" part=\"tooltip-content\">\n <button\n class=\"ppgf-disclosure-close\"\n aria-label=\"Close tooltip\"\n part=\"tooltip-close-button\"\n @click=\"${onClickClose}\"\n >\n ${this.renderCloseTooltipIcon()}\n </button>\n <div class=\"ppgf-disclosure-tooltip-copy\" part=\"tooltip-disclosure-copy\">\n ${unsafeHTML(ppgfDisclosure.copy)}\n </div>\n </div>\n <span class=\"ppgf-disclosure-tooltip-trigger\" part=\"tooltip-disclosure-icon\">\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-InfoContainer-textAlign\": \"inherit\",\n \"--beam-ProductDetailsPage-InfoContainer-lineHeight\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginTop\": \"4px\",\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: \"0px\",\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 \"--beam-ProductDetailsPage-image-placement\": \"inline-left\", // options: \"inline-left\" || \"block-center\"\n \"--beam-ProductDetailsPage-blockImage-alignSelf\": \"center\",\n \"--beam-ProductDetailsPage-promoPill-marginTop\": \"4px\",\n \"--beam-ProductDetailsPage-promoPill-alignSelf\": \"left\",\n \"--beam-ProductDetailsPage-shouldDisplayColon\": \"true\",\n \"--beam-ProductDetailsPage-shouldDisplayPromoPill\": \"true\",\n ...promoPillLabelConfigDefaults,\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 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 display: flex;\n flex-direction: column;\n ${useCustomBorder(\"--beam-ProductDetailsPage\")}\n }\n /* When iconDisplay is inline-center */\n .inline-display {\n display: flex;\n }\n /* When iconDisplay is block-center */\n .block-display {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .promo-container {\n order: 2;\n display: flex;\n margin-top: var(--beam-ProductDetailsPage-promoPill-marginTop);\n align-self: var(--beam-ProductDetailsPage-promoPill-alignSelf);\n }\n .content-inline {\n order: 3;\n display: flex;\n align-items: center;\n }\n /* Info block for both inline and block layout */\n .info-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n text-align: var(--beam-ProductDetailsPage-InfoContainer-textAlign);\n line-height: var(--beam-ProductDetailsPage-InfoContainer-lineHeight);\n margin-top: var(--beam-ProductDetailsPage-InfoContainer-marginTop);\n margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);\n }\n .block-display .info-container {\n order: 3;\n }\n .root.inline-display .icon-container,\n .root.inline-display .info-container {\n display: inline-flex;\n }\n .root.inline-display {\n flex-direction: column;\n }\n .icon-container {\n width: var(--beam-ProductDetailsPage-imageWidth);\n height: var(--beam-ProductDetailsPage-imageHeight);\n align-self: var(--beam-ProductDetailsPage-blockImage-alignSelf);\n flex-shrink: 0;\n }\n .icon-container > img {\n width: 100%;\n height: 100%;\n object-fit: contain;\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 .info-inline-promo {\n margin-top: var(--beam-ProductDetailsPage-description-marginTop, 0px);\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 ${useCustomText(\"--beam-ProductDetailsPage-description\")}\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 vertical-align: text-bottom;\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","strings","x","k","s","p","n","e","o","r","IMAGE_URL_REMOTE_CONFIG_KEY","BeamProductDetailsPage","LitElement","DEFAULT_BASE_URL","createScopedLocalStorage","evt","promoCodesFromPlugin","c","enforceConfig","beamCartId","getBeamCartId","BEAM_CART_COOKIE_NAME","manualPromoCodes","formattedPromos","formatStoreAndReturnPromoCodes","code","shouldSendPromos","isEmptyPromoData","BeamWidgetStoredPromoCodesEvent","WIDGET_NAMES","res","postProductDetailsPage","makeApiKeyHeader","AsyncController","SUPPORTED_LANGUAGES","parseJsonStringArray","cart","getPromoCodesFromCart","response","setPromoCodesInLocalStorage","setPromoCodeInCookie","BeamPromoCodesStoredEvent","changedProperties","requireNewDataProps","prop","data","loading","iconDisplay","isNonZero","value","shouldDisplayPromoPill","isPromoActive","hasValidImageHeight","hasValidTitleFontSize","isPromoPillVisible","shouldShowPunctuation","_errorMessage","imageUrl","shouldDisplayColon","title","localizeUserString","description","onClickClose","tooltip","ppgfDisclosure","unsafeHTML","ppgfHyperlink","defaults","defineCustomText","promoPillLabelConfigDefaults","remoteConfig","config","_cssVariableMap","cssReset","cssResponsiveUtils","css","useCustomText","__decorateClass","property","state","defineCustomElement"],"mappings":"i/BAEO,MAAMA,EAAqB,CAChCC,EAAY,GACZ,CAAE,aAAAC,EAAe,MAAO,YAAAC,EAAc,QAAS,YAAAC,EAAc,UAAW,YAAAC,EA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,UAAA,UAAA,CAAA,EAEOkE,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CATf,EAAAnE,EASwB,oBAECkE,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAXhB,EAAAnE,EAWyB,2BAEAkE,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAbhB,EAAAnE,EAayB,qBAERkE,EAAA,CAA3BC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAffnE,EAeiB,UAAA,0BAAA,CAAA,EAEOkE,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAjBfnE,EAiBwB,UAEAkE,aAAAA,CAAAA,EAAAA,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAnBfnE,EAmBwB,UAAA,SAAA,CAAA,EAIlBkE,EAAA,CAAhBE,EAvBU,CAAA,EAAApE,EAuBM,UAudnBqE,mBAAAA,CAAAA,EAAAA,EAAoBrE,CAAsB"}
@@ -1,8 +1,8 @@
1
- import{j as v,y as i,f as y,g as n,h as x,k as C}from"../chunks/lit-iNN5L_Qk.esm.js";import{u as g,A as k,_ as w,i as f,d as u,a as $}from"../chunks/localize-m-_ESmpk.esm.js";import{D as S,l as T,W as I,S as F}from"../chunks/routes-o1QpF40R.esm.js";import{makeApiKeyHeader as z}from"../utils/makeApiKeyHeader.js";import{c as L,d as W,e as B}from"../chunks/enforce-config-ZyPq_4CF.esm.js";import{c as E}from"../chunks/responsive-2lC2Wrtg.esm.js";import"../chunks/vendor-GKiOHg2N.esm.js";import{p as G}from"../chunks/promo-pill-label-P1X4xeAx.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";const A=(s="",{borderRadius:e="0px",borderStyle:o="unset",borderColor:t="#000000",borderWidth:r="1px"}={})=>{const a=s.startsWith("--beam-")?s:`--beam-${s}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:o,[`${a}-borderColor`]:t,[`${a}-borderWidth`]:r}},M=(s="",{borderRadius:e="0px",borderStyle:o="unset",borderColor:t="#000000",borderWidth:r="1px"}={})=>{const a=s.startsWith("--beam-")?s:`--beam-${s}`;return v(` border-radius: var(${a}-borderRadius, ${e});
1
+ import{j as x,y as r,f as k,g as d,t as w,h as S,k as $}from"../chunks/lit-iNN5L_Qk.esm.js";import{u as g,A as I,_ as T,i as f,d as m,a as F}from"../chunks/localize-OiRewTgu.esm.js";import{D as z,W as u,l as E,S as L}from"../chunks/routes-YPOoVIR2.esm.js";import{c as B,d as A,e as M}from"../chunks/enforce-config-S8EGgEnO.esm.js";import{c as W}from"../chunks/responsive-2lC2Wrtg.esm.js";import"../chunks/vendor-GKiOHg2N.esm.js";import{p as _}from"../chunks/promo-pill-label-P1X4xeAx.esm.js";import{f as G,i as j,e as H,h as R,k as K,s as U}from"../chunks/promoManager--3WXq4at.esm.js";import{B as V}from"../chunks/cart-contents-h60geKWa.esm.js";import{createScopedLocalStorage as O}from"../utils/local-storage.js";import{makeApiKeyHeader as N}from"../utils/makeApiKeyHeader.js";import{f as D,a as v}from"../chunks/events-T3hYV1LF.esm.js";import{getBeamCartId as q}from"../utils/cart.js";import"../chunks/beam-errors-AMvTvR1C.esm.js";import"../utils/logger.js";import"../utils/cookies.js";const J=(l="",{borderRadius:e="0px",borderStyle:o="unset",borderColor:t="#000000",borderWidth:i="1px"}={})=>{const a=l.startsWith("--beam-")?l:`--beam-${l}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:o,[`${a}-borderColor`]:t,[`${a}-borderWidth`]:i}},Q=(l="",{borderRadius:e="0px",borderStyle:o="unset",borderColor:t="#000000",borderWidth:i="1px"}={})=>{const a=l.startsWith("--beam-")?l:`--beam-${l}`;return x(` border-radius: var(${a}-borderRadius, ${e});
2
2
  border-style: var(${a}-borderStyle, ${o});
3
3
  border-color: var(${a}-borderColor, ${t});
4
- border-width: var(${a}-borderWidth, ${r});
5
- `)},j=()=>i` <svg
4
+ border-width: var(${a}-borderWidth, ${i});
5
+ `)},X=()=>r` <svg
6
6
  xmlns="http://www.w3.org/2000/svg"
7
7
  width="24"
8
8
  height="24"
@@ -17,50 +17,50 @@ import{j as v,y as i,f as y,g as n,h as x,k as C}from"../chunks/lit-iNN5L_Qk.esm
17
17
  <circle cx="12" cy="12" r="10"></circle>
18
18
  <path d="M12 16v-4"></path>
19
19
  <path d="M12 8h.01"></path>
20
- </svg>`,P={en:{ctaTitle:()=>"Choose your impact",ctaMessage:()=>"At no extra cost, 1% of every order is donated to a nonprofit you choose. Powered by Beam",inlineSeparator:()=>":"},fr:{ctaTitle:()=>"Choisissez l'impact de votre choix",ctaMessage:()=>"Sans frais suppl\xE9mentaires, 1% de chaque commande est revers\xE9 \xE0 l'organisation caritative de votre choix. D\xE9velopp\xE9 par Beam",inlineSeparator:()=>":"},es:{ctaTitle:()=>"Elige el impacto que deseas",ctaMessage:()=>"Sin coste adicional, el 1% de cada pedido se dona a la organizaci\xF3n sin \xE1nimo de lucro que t\xFA elijas. Desarrollado por Beam",inlineSeparator:()=>":"},de:{ctaTitle:()=>"W\xE4hlen Sie Ihren Einfluss",ctaMessage:()=>"Ohne zus\xE4tzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gew\xE4hlte gemeinn\xFCtzige Organisation gespendet. Von Beam unterst\xFCtzt",inlineSeparator:()=>":"},it:{ctaTitle:()=>"Scegliete chi sostenere",ctaMessage:()=>"L'1% di ogni vostro acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a libera scelta. Promosso da Beam",inlineSeparator:()=>":"},pl:{ctaTitle:()=>"Masz wp\u0142yw, dokonaj wyboru",ctaMessage:()=>"1% kwoty ka\u017Cdego zam\xF3wienia jest przekazywane na rzecz wybranej przez Ciebie organizacji non-profit \u2013 bez dodatkowych koszt\xF3w. Obs\u0142ugiwane przez Beam",inlineSeparator:()=>":"}};var H=Object.defineProperty,R=Object.getOwnPropertyDescriptor,c=(s,e,o,t)=>{for(var r=t>1?void 0:t?R(e,o):e,a=s.length-1,d;a>=0;a--)(d=s[a])&&(r=(t?d(e,o,r):d(r))||r);return t&&r&&H(e,o,r),r};const _="--beam-ProductDetailsPage-imageUrl";class l extends x{constructor(){super(...arguments),this.baseUrl=S,this.lang="en",this.draftConfig=!1,this.debug=!1,this.getProductDetailsPageData=async()=>(B(["apiKey","storeId"],this),await T({baseUrl:this.baseUrl,headers:z(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:I.product_details_page,draftConfig:this.draftConfig,remoteProductIdentifier:this.remoteProductIdentifier}})),this.productDetailsPageDataController=new k(this,this.getProductDetailsPageData)}get configLang(){return F[this.lang]||"en"}async updated(e){const o=["storeId","baseUrl","lang","apiKey"];for(const t of o)if(e.has(t)){await this.productDetailsPageDataController.exec();break}}render(){const{data:e,loading:o}=this.productDetailsPageDataController,t=this.cssVariables["--beam-ProductDetailsPage-image-placement"],r=b=>b!=="0px"&&b!=="0",a=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayPromoPill"]==="true",d=!!e?.config?.web?.promo,h=r(this.cssVariables["--beam-ProductDetailsPage-imageHeight"]),D=r(this.cssVariables["--beam-ProductDetailsPage-title-fontSize"]),p=a&&d&&h&&D,m=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayColon"]==="true";return o?i``:e==null?this.debug?w({error:new Error("No data")}):"":i`
20
+ </svg>`,P={en:{ctaTitle:()=>"Choose your impact",ctaMessage:()=>"At no extra cost, 1% of every order is donated to a nonprofit you choose. Powered by Beam",inlineSeparator:()=>":"},fr:{ctaTitle:()=>"Choisissez l'impact de votre choix",ctaMessage:()=>"Sans frais suppl\xE9mentaires, 1% de chaque commande est revers\xE9 \xE0 l'organisation caritative de votre choix. D\xE9velopp\xE9 par Beam",inlineSeparator:()=>":"},es:{ctaTitle:()=>"Elige el impacto que deseas",ctaMessage:()=>"Sin coste adicional, el 1% de cada pedido se dona a la organizaci\xF3n sin \xE1nimo de lucro que t\xFA elijas. Desarrollado por Beam",inlineSeparator:()=>":"},de:{ctaTitle:()=>"W\xE4hlen Sie Ihren Einfluss",ctaMessage:()=>"Ohne zus\xE4tzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gew\xE4hlte gemeinn\xFCtzige Organisation gespendet. Von Beam unterst\xFCtzt",inlineSeparator:()=>":"},it:{ctaTitle:()=>"Scegliete chi sostenere",ctaMessage:()=>"L'1% di ogni vostro acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a libera scelta. Promosso da Beam",inlineSeparator:()=>":"},pl:{ctaTitle:()=>"Masz wp\u0142yw, dokonaj wyboru",ctaMessage:()=>"1% kwoty ka\u017Cdego zam\xF3wienia jest przekazywane na rzecz wybranej przez Ciebie organizacji non-profit \u2013 bez dodatkowych koszt\xF3w. Obs\u0142ugiwane przez Beam",inlineSeparator:()=>":"}};var Y=Object.defineProperty,Z=Object.getOwnPropertyDescriptor,n=(l,e,o,t)=>{for(var i=t>1?void 0:t?Z(e,o):e,a=l.length-1,c;a>=0;a--)(c=l[a])&&(i=(t?c(e,o,i):c(i))||i);return t&&i&&Y(e,o,i),i};const ee="--beam-ProductDetailsPage-imageUrl";class s extends S{constructor(){super(...arguments),this.baseUrl=z,this.lang="en",this.draftConfig=!1,this.debug=!1,this.localStorage=O(this),this.pluginPromoCodes=[],this.handlePromoCodesStored=e=>{const o=(e.detail.promoCodes?.unvalidatedPromoCodes??[]).map(t=>t.attributes?.value??t.attributes?.url??"").sort();this.pluginPromoCodes=o},this.postProductDetailsPageData=async()=>{M(["apiKey","storeId"],this);const e=q(V,{apiKey:this.apiKey}),o=this.getManualPromoCodes(),t=G(o.map(c=>({value:c})),this.apiKey),i=t&&!j(t);i&&this.dispatchEvent(new D({source:u.product_details_page}));const a=await E({baseUrl:this.baseUrl,headers:N(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:u.product_details_page,draftConfig:this.draftConfig,remoteProductIdentifier:this.remoteProductIdentifier},requestBody:{...i&&{promos:t},beamCartId:e||void 0}});return this.handleValidatedPromoCodes(a),a},this.productDetailsPageDataController=new I(this,this.postProductDetailsPageData)}get configLang(){return L[this.lang]||"en"}get parsedPromoCodes(){return H(this.promoCodes)}getManualPromoCodes(){if(this.parsedPromoCodes&&this.parsedPromoCodes.length>0)return this.parsedPromoCodes;const e=this.localStorage.getItemJson("cart");return e?R(e):[]}async handleValidatedPromoCodes(e){e.promos?.validatedPromoCodes&&(await Promise.all([K({apiKey:this.apiKey,promoCodes:{validatedPromoCodes:e.promos.validatedPromoCodes,unvalidatedPromoCodes:[]}}),U({validatedPromoCodes:e.promos.validatedPromoCodes,domain:this.domain})]),this.dispatchEvent(new D({source:u.product_details_page})))}async firstUpdated(){window.addEventListener(v.eventName,this.handlePromoCodesStored)}disconnectedCallback(){window.removeEventListener(v.eventName,this.handlePromoCodesStored),super.disconnectedCallback()}async updated(e){const o=["storeId","baseUrl","lang","apiKey","pluginPromoCodes"];this.pluginPromoCodes;for(const t of o)if(e.has(t)){await this.productDetailsPageDataController.exec();break}}render(){const{data:e,loading:o}=this.productDetailsPageDataController,t=this.cssVariables["--beam-ProductDetailsPage-image-placement"],i=h=>h!=="0px"&&h!=="0",a=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayPromoPill"]==="true",c=!!e?.config?.web?.promo,y=i(this.cssVariables["--beam-ProductDetailsPage-imageHeight"]),C=i(this.cssVariables["--beam-ProductDetailsPage-title-fontSize"]),p=a&&c&&y&&C,b=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayColon"]==="true";return o?r``:e==null?this.debug?T({error:new Error("No data")}):"":r`
21
21
  <style>
22
22
  :host {
23
23
  ${this.cssVariables.toCSS()}
24
24
  }
25
25
  </style>
26
26
  <div class="root ${t==="block-center"?"block-display":"inline-display"}">
27
- ${t==="block-center"?i`
27
+ ${t==="block-center"?r`
28
28
  ${this.renderWidgetIcon(t)}
29
- ${p?i`
29
+ ${p?r`
30
30
  <div class="promo-container">
31
31
  <beam-promo-info-pill .promo=${e?.config?.web?.promo}></beam-promo-info-pill>
32
32
  </div>
33
- `:i``}
34
- <div class="info-container">${this.renderContent(p,m,e)}</div>
35
- `:i`
36
- ${p?i`
33
+ `:r``}
34
+ <div class="info-container">${this.renderContent(p,b,e)}</div>
35
+ `:r`
36
+ ${p?r`
37
37
  <div class="promo-container">
38
38
  <beam-promo-info-pill .promo=${e?.config?.web?.promo}></beam-promo-info-pill>
39
39
  </div>
40
- `:i``}
40
+ `:r``}
41
41
  <div class="content-inline">
42
42
  ${this.renderWidgetIcon(t)}
43
- <div class="info-container">${this.renderContent(p,m,e)}</div>
43
+ <div class="info-container">${this.renderContent(p,b,e)}</div>
44
44
  </div>
45
45
  `}
46
46
  </div>
47
- `}renderWidgetIcon(e){const o=this.cssVariables[_];return o?i`
47
+ `}renderWidgetIcon(e){const o=this.cssVariables[ee];return o?r`
48
48
  <span class="icon-container" part="icon" ${e==="block-center"?'style="order:1"':""}>
49
49
  <img src=${o} alt="Widget Icon" />
50
50
  </span>
51
- `:i``}renderContent(e,o,t){const r=f(this.configLang,t?.config?.web?.title)||P[this.configLang].ctaTitle(),a=f(this.configLang,t?.config?.web?.description)||P[this.configLang].ctaMessage();return e?i`
51
+ `:r``}renderContent(e,o,t){const i=f(this.configLang,t?.config?.web?.title)||P[this.configLang].ctaTitle(),a=f(this.configLang,t?.config?.web?.description)||P[this.configLang].ctaMessage();return e?r`
52
52
  <div class="info-inline-promo">
53
- <span class="title">${r+(o?P[this.configLang].inlineSeparator():"")}</span>
53
+ <span class="title">${i+(o?P[this.configLang].inlineSeparator():"")}</span>
54
54
  <span class="description"> ${a} ${this.renderDisclosureTooltip()} </span>
55
55
  </div>
56
- `:i`
56
+ `:r`
57
57
  <div class="title-block">
58
- <h3 class="title">${r}</h3>
58
+ <h3 class="title">${i}</h3>
59
59
  </div>
60
60
  <div class="description-block">
61
61
  <span class="description"> ${a} ${this.renderDisclosureTooltip()} </span>
62
62
  </div>
63
- `}renderCloseTooltipIcon(){return i`<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
63
+ `}renderCloseTooltipIcon(){return r`<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
64
64
  <path
65
65
  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"
66
66
  stroke="white"
@@ -68,7 +68,7 @@ import{j as v,y as i,f as y,g as n,h as x,k as C}from"../chunks/lit-iNN5L_Qk.esm
68
68
  stroke-linecap="round"
69
69
  stroke-linejoin="round"
70
70
  />
71
- </svg> `}renderDisclosureTooltip(){const e=()=>{const t=this.renderRoot.querySelector(".ppgf-disclosure-tooltip");t.open=!1},o=this.productDetailsPageDataController.data?.ppgfDisclosure;return o?i`<sl-tooltip class="ppgf-disclosure-tooltip" part="tooltip">
71
+ </svg> `}renderDisclosureTooltip(){const e=()=>{const t=this.renderRoot.querySelector(".ppgf-disclosure-tooltip");t.open=!1},o=this.productDetailsPageDataController.data?.ppgfDisclosure;return o?r`<sl-tooltip class="ppgf-disclosure-tooltip" part="tooltip">
72
72
  <div class="ppgf-disclosure-tooltip-content" slot="content" part="tooltip-content">
73
73
  <button
74
74
  class="ppgf-disclosure-close"
@@ -79,14 +79,14 @@ import{j as v,y as i,f as y,g as n,h as x,k as C}from"../chunks/lit-iNN5L_Qk.esm
79
79
  ${this.renderCloseTooltipIcon()}
80
80
  </button>
81
81
  <div class="ppgf-disclosure-tooltip-copy" part="tooltip-disclosure-copy">
82
- ${C(o.copy)}
82
+ ${$(o.copy)}
83
83
  </div>
84
84
  </div>
85
85
  <span class="ppgf-disclosure-tooltip-trigger" part="tooltip-disclosure-icon">
86
86
  <div class="ppgf-disclosure-tooltip-trigger-mask d-lg-none"></div>
87
- ${j()}
87
+ ${X()}
88
88
  </span>
89
- </sl-tooltip>`:i``}renderDisclosureTooltipHyperlink(){const e=this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;return e?i`<a class="ppgf-disclosure-hyperlink" href="${e.url}" target="_blank">${e.copy}</a>`:i``}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-InfoContainer-textAlign":"inherit","--beam-ProductDetailsPage-InfoContainer-lineHeight":"15px","--beam-ProductDetailsPage-InfoContainer-marginTop":"4px","--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",...u("--beam-ProductDetailsPage-title",{fontSize:"12px",fontWeight:"bold"}),"--beam-ProductDetailsPage-title-textAlign":"left",...u("--beam-ProductDetailsPage-description",{marginTop:"0px",fontSize:"12px",lineHeight:"15px"}),"--beam-ProductDetailsPage-description-textAlign":"left",...u("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent",{fontSize:"12px",lineHeight:"16px",color:"#FFFFFF"}),...A("--beam-ProductDetailsPage"),"--beam-ProductDetailsPage-close-display":"initial","--beam-ProductDetailsPage-close-padding":"0","--beam-ProductDetailsPage-image-placement":"inline-left","--beam-ProductDetailsPage-blockImage-alignSelf":"center","--beam-ProductDetailsPage-promoPill-marginTop":"4px","--beam-ProductDetailsPage-promoPill-alignSelf":"left","--beam-ProductDetailsPage-shouldDisplayColon":"true","--beam-ProductDetailsPage-shouldDisplayPromoPill":"true",...G},o=this.productDetailsPageDataController?.data?.config?.web?.theme||{},t={...e,...o};return Object.assign(Object.create({toCSS(){return $(this)}}),t)}}l.tagName="beam-product-details-page",l.styles=[L,E,y`
89
+ </sl-tooltip>`:r``}renderDisclosureTooltipHyperlink(){const e=this.productDetailsPageDataController.data?.ppgfDisclosureHyperlink;return e?r`<a class="ppgf-disclosure-hyperlink" href="${e.url}" target="_blank">${e.copy}</a>`:r``}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-InfoContainer-textAlign":"inherit","--beam-ProductDetailsPage-InfoContainer-lineHeight":"15px","--beam-ProductDetailsPage-InfoContainer-marginTop":"4px","--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",...m("--beam-ProductDetailsPage-title",{fontSize:"12px",fontWeight:"bold"}),"--beam-ProductDetailsPage-title-textAlign":"left",...m("--beam-ProductDetailsPage-description",{marginTop:"0px",fontSize:"12px",lineHeight:"15px"}),"--beam-ProductDetailsPage-description-textAlign":"left",...m("--beam-ProductDetailsPage-PPGFDisclosureTooltipContent",{fontSize:"12px",lineHeight:"16px",color:"#FFFFFF"}),...J("--beam-ProductDetailsPage"),"--beam-ProductDetailsPage-close-display":"initial","--beam-ProductDetailsPage-close-padding":"0","--beam-ProductDetailsPage-image-placement":"inline-left","--beam-ProductDetailsPage-blockImage-alignSelf":"center","--beam-ProductDetailsPage-promoPill-marginTop":"4px","--beam-ProductDetailsPage-promoPill-alignSelf":"left","--beam-ProductDetailsPage-shouldDisplayColon":"true","--beam-ProductDetailsPage-shouldDisplayPromoPill":"true",..._},o=this.productDetailsPageDataController?.data?.config?.web?.theme||{},t={...e,...o};return Object.assign(Object.create({toCSS(){return F(this)}}),t)}}s.tagName="beam-product-details-page",s.styles=[B,W,k`
90
90
  :host {
91
91
  font-family: var(--beam-fontFamily);
92
92
  font-style: var(--beam-fontStyle);
@@ -106,7 +106,7 @@ import{j as v,y as i,f as y,g as n,h as x,k as C}from"../chunks/lit-iNN5L_Qk.esm
106
106
  background-color: var(--beam-ProductDetailsPage-backgroundColor);
107
107
  display: flex;
108
108
  flex-direction: column;
109
- ${M("--beam-ProductDetailsPage")}
109
+ ${Q("--beam-ProductDetailsPage")}
110
110
  }
111
111
  /* When iconDisplay is inline-center */
112
112
  .inline-display {
@@ -231,5 +231,5 @@ import{j as v,y as i,f as y,g as n,h as x,k as C}from"../chunks/lit-iNN5L_Qk.esm
231
231
  height: auto;
232
232
  vertical-align: middle;
233
233
  }
234
- `],c([n({type:String,reflect:!0})],l.prototype,"baseUrl",2),c([n({type:String,reflect:!1})],l.prototype,"apiKey",2),c([n({type:Number})],l.prototype,"storeId",2),c([n({type:String})],l.prototype,"lang",2),c([n({type:Boolean})],l.prototype,"draftConfig",2),c([n({type:Boolean})],l.prototype,"debug",2),c([n({type:String})],l.prototype,"remoteProductIdentifier",2),W(l);export{l as BeamProductDetailsPage};
234
+ `],n([d({type:String,reflect:!0})],s.prototype,"baseUrl",2),n([d({type:String,reflect:!1})],s.prototype,"apiKey",2),n([d({type:Number})],s.prototype,"storeId",2),n([d({type:String})],s.prototype,"lang",2),n([d({type:Boolean})],s.prototype,"draftConfig",2),n([d({type:Boolean})],s.prototype,"debug",2),n([d({type:String})],s.prototype,"remoteProductIdentifier",2),n([d({type:String})],s.prototype,"promoCodes",2),n([d({type:String})],s.prototype,"domain",2),n([w()],s.prototype,"pluginPromoCodes",2),A(s);export{s as BeamProductDetailsPage};
235
235
  //# sourceMappingURL=product-details-page.js.map
@@ -1 +1 @@
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/strings.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","export const strings = {\n en: {\n ctaTitle: () => `Choose your impact`,\n ctaMessage: () => `At no extra cost, 1% of every order is donated to a nonprofit you choose. Powered by Beam`,\n inlineSeparator: () => `:`,\n },\n fr: {\n ctaTitle: () => `Choisissez l'impact de votre choix`,\n ctaMessage: () =>\n `Sans frais supplémentaires, 1% de chaque commande est reversé à l'organisation caritative de votre choix. Développé par Beam`,\n inlineSeparator: () => `:`,\n },\n es: {\n ctaTitle: () => `Elige el impacto que deseas`,\n ctaMessage: () =>\n `Sin coste adicional, el 1% de cada pedido se dona a la organización sin ánimo de lucro que tú elijas. Desarrollado por Beam`,\n inlineSeparator: () => `:`,\n },\n de: {\n ctaTitle: () => `Wählen Sie Ihren Einfluss`,\n ctaMessage: () =>\n `Ohne zusätzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gewählte gemeinnützige Organisation gespendet. Von Beam unterstützt`,\n inlineSeparator: () => `:`,\n },\n it: {\n ctaTitle: () => `Scegliete chi sostenere`,\n ctaMessage: () =>\n `L'1% di ogni vostro acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a libera scelta. Promosso da Beam`,\n inlineSeparator: () => `:`,\n },\n pl: {\n ctaTitle: () => `Masz wpływ, dokonaj wyboru`,\n ctaMessage: () =>\n `1% kwoty każdego zamówienia jest przekazywane na rzecz wybranej przez Ciebie organizacji non-profit – bez dodatkowych kosztów. Obsługiwane przez Beam`,\n inlineSeparator: () => `:`,\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 { 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\";\nimport { promoPillLabelConfigDefaults } from \"../../shared/components/promo-pill-label\";\nimport { strings } from \"./strings\";\nimport \"../../shared/components/promo-pill-label\";\n\ntype RequiredConfig = {\n apiKey: string;\n storeId: number;\n};\ntype IAPIV3GetProductDetailsPage = Awaited<ReturnType<typeof getProductDetailsPage>>;\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 draftConfig = false;\n\n @property({ type: Boolean }) public debug = false;\n\n @property({ type: String }) remoteProductIdentifier?: string;\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 draftConfig: this.draftConfig,\n remoteProductIdentifier: this.remoteProductIdentifier,\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 render() {\n const { data, loading } = this.productDetailsPageDataController;\n const iconDisplay = this.cssVariables[\"--beam-ProductDetailsPage-image-placement\"];\n const isNonZero = (value: string) => value !== \"0px\" && value !== \"0\";\n const shouldDisplayPromoPill = this.cssVariables[\"--beam-ProductDetailsPage-shouldDisplayPromoPill\"] === \"true\";\n const isPromoActive = !!data?.config?.web?.promo;\n const hasValidImageHeight = isNonZero(this.cssVariables[\"--beam-ProductDetailsPage-imageHeight\"]);\n const hasValidTitleFontSize = isNonZero(this.cssVariables[\"--beam-ProductDetailsPage-title-fontSize\"]);\n const isPromoPillVisible =\n shouldDisplayPromoPill && // Determines if the promo pill is enabled for the marketing version of the PDP\n isPromoActive && // Is promo currently active\n hasValidImageHeight && // Ensures the promo pill is not displayed for the subtext version of the PDP\n hasValidTitleFontSize; // Ensures the promo pill is not displayed for the subtext version of the PDP\n const shouldShowPunctuation = this.cssVariables[\"--beam-ProductDetailsPage-shouldDisplayColon\"] === \"true\"; // Determines if a colon should be displayed in promo display\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 ${iconDisplay === \"block-center\" ? \"block-display\" : \"inline-display\"}\">\n ${iconDisplay === \"block-center\"\n ? html`\n ${this.renderWidgetIcon(iconDisplay)}\n ${isPromoPillVisible\n ? html`\n <div class=\"promo-container\">\n <beam-promo-info-pill .promo=${data?.config?.web?.promo}></beam-promo-info-pill>\n </div>\n `\n : html``}\n <div class=\"info-container\">${this.renderContent(isPromoPillVisible, shouldShowPunctuation, data)}</div>\n `\n : html`\n ${isPromoPillVisible\n ? html`\n <div class=\"promo-container\">\n <beam-promo-info-pill .promo=${data?.config?.web?.promo}></beam-promo-info-pill>\n </div>\n `\n : html``}\n <div class=\"content-inline\">\n ${this.renderWidgetIcon(iconDisplay)}\n <div class=\"info-container\">${this.renderContent(isPromoPillVisible, shouldShowPunctuation, data)}</div>\n </div>\n `}\n </div>\n `;\n }\n\n renderWidgetIcon(iconDisplay: string) {\n const imageUrl = this.cssVariables[IMAGE_URL_REMOTE_CONFIG_KEY];\n\n if (!imageUrl) return html``;\n\n const isBlockDisplay = iconDisplay === \"block-center\";\n const containerStyle = isBlockDisplay ? 'style=\"order:1\"' : \"\";\n\n return html`\n <span class=\"icon-container\" part=\"icon\" ${containerStyle}>\n <img src=${imageUrl} alt=\"Widget Icon\" />\n </span>\n `;\n }\n\n renderContent(isPromoPillVisible: boolean, shouldDisplayColon: boolean, data: IAPIV3GetProductDetailsPage) {\n const title = localizeUserString(this.configLang, data?.config?.web?.title) || strings[this.configLang].ctaTitle();\n const description =\n localizeUserString(this.configLang, data?.config?.web?.description) || strings[this.configLang].ctaMessage();\n return isPromoPillVisible\n ? html`\n <div class=\"info-inline-promo\">\n <span class=\"title\">${title + (shouldDisplayColon ? strings[this.configLang].inlineSeparator() : \"\")}</span>\n <span class=\"description\"> ${description} ${this.renderDisclosureTooltip()} </span>\n </div>\n `\n : html`\n <div class=\"title-block\">\n <h3 class=\"title\">${title}</h3>\n </div>\n <div class=\"description-block\">\n <span class=\"description\"> ${description} ${this.renderDisclosureTooltip()} </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\" part=\"tooltip\">\n <div class=\"ppgf-disclosure-tooltip-content\" slot=\"content\" part=\"tooltip-content\">\n <button\n class=\"ppgf-disclosure-close\"\n aria-label=\"Close tooltip\"\n part=\"tooltip-close-button\"\n @click=\"${onClickClose}\"\n >\n ${this.renderCloseTooltipIcon()}\n </button>\n <div class=\"ppgf-disclosure-tooltip-copy\" part=\"tooltip-disclosure-copy\">\n ${unsafeHTML(ppgfDisclosure.copy)}\n </div>\n </div>\n <span class=\"ppgf-disclosure-tooltip-trigger\" part=\"tooltip-disclosure-icon\">\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-InfoContainer-textAlign\": \"inherit\",\n \"--beam-ProductDetailsPage-InfoContainer-lineHeight\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginTop\": \"4px\",\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: \"0px\",\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 \"--beam-ProductDetailsPage-image-placement\": \"inline-left\", // options: \"inline-left\" || \"block-center\"\n \"--beam-ProductDetailsPage-blockImage-alignSelf\": \"center\",\n \"--beam-ProductDetailsPage-promoPill-marginTop\": \"4px\",\n \"--beam-ProductDetailsPage-promoPill-alignSelf\": \"left\",\n \"--beam-ProductDetailsPage-shouldDisplayColon\": \"true\",\n \"--beam-ProductDetailsPage-shouldDisplayPromoPill\": \"true\",\n ...promoPillLabelConfigDefaults,\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 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 display: flex;\n flex-direction: column;\n ${useCustomBorder(\"--beam-ProductDetailsPage\")}\n }\n /* When iconDisplay is inline-center */\n .inline-display {\n display: flex;\n }\n /* When iconDisplay is block-center */\n .block-display {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .promo-container {\n order: 2;\n display: flex;\n margin-top: var(--beam-ProductDetailsPage-promoPill-marginTop);\n align-self: var(--beam-ProductDetailsPage-promoPill-alignSelf);\n }\n .content-inline {\n order: 3;\n display: flex;\n align-items: center;\n }\n /* Info block for both inline and block layout */\n .info-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n text-align: var(--beam-ProductDetailsPage-InfoContainer-textAlign);\n line-height: var(--beam-ProductDetailsPage-InfoContainer-lineHeight);\n margin-top: var(--beam-ProductDetailsPage-InfoContainer-marginTop);\n margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);\n }\n .block-display .info-container {\n order: 3;\n }\n .root.inline-display .icon-container,\n .root.inline-display .info-container {\n display: inline-flex;\n }\n .root.inline-display {\n flex-direction: column;\n }\n .icon-container {\n width: var(--beam-ProductDetailsPage-imageWidth);\n height: var(--beam-ProductDetailsPage-imageHeight);\n align-self: var(--beam-ProductDetailsPage-blockImage-alignSelf);\n flex-shrink: 0;\n }\n .icon-container > img {\n width: 100%;\n height: 100%;\n object-fit: contain;\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 .info-inline-promo {\n margin-top: var(--beam-ProductDetailsPage-description-marginTop, 0px);\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 ${useCustomText(\"--beam-ProductDetailsPage-description\")}\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 vertical-align: text-bottom;\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","strings","y","v","l","p","n","e","o","t","r","IMAGE_URL_REMOTE_CONFIG_KEY","BeamProductDetailsPage","LitElement","DEFAULT_BASE_URL","enforceConfig","getProductDetailsPage","makeApiKeyHeader","WIDGET_NAMES","AsyncController","SUPPORTED_LANGUAGES","changedProperties","requireNewDataProps","prop","data","loading","iconDisplay","isNonZero","value","shouldDisplayPromoPill","isPromoActive","hasValidImageHeight","hasValidTitleFontSize","isPromoPillVisible","shouldShowPunctuation","_errorMessage","imageUrl","shouldDisplayColon","title","localizeUserString","description","onClickClose","tooltip","ppgfDisclosure","unsafeHTML","ppgfHyperlink","defaults","defineCustomText","promoPillLabelConfigDefaults","remoteConfig","config","_cssVariableMap","cssReset","cssResponsiveUtils","css","useCustomText","__decorateClass","property","defineCustomElement"],"mappings":"8mBAEO,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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;AAAA;AAAA,KAqC/E,EAxZkDC,EAAA,CAAjDC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAH9B7C,EAGuC,UAAA,UAAA,CAAA,EAEN4C,EAAA,CAA3CC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAM,CAAC,CAAA,EAL/B7C,EAKiC,UAAA,SAAA,CAAA,EAEhB4C,EAAA,CAA3BC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAPf7C,EAOiB,UAAA,UAAA,CAAA,EAEO4C,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EATf7C,EASwB,UAAA,OAAA,CAAA,EAEC4C,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAXhB7C,EAWyB,UAAA,cAAA,CAAA,EAEA4C,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAbhB7C,EAayB,UAAA,QAAA,CAAA,EAER4C,EAAA,CAA3BC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAff7C,EAeiB,UAAA,0BAAA,CAAA,EA+Y9B8C,EAAoB9C,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/strings.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","export const strings = {\n en: {\n ctaTitle: () => `Choose your impact`,\n ctaMessage: () => `At no extra cost, 1% of every order is donated to a nonprofit you choose. Powered by Beam`,\n inlineSeparator: () => `:`,\n },\n fr: {\n ctaTitle: () => `Choisissez l'impact de votre choix`,\n ctaMessage: () =>\n `Sans frais supplémentaires, 1% de chaque commande est reversé à l'organisation caritative de votre choix. Développé par Beam`,\n inlineSeparator: () => `:`,\n },\n es: {\n ctaTitle: () => `Elige el impacto que deseas`,\n ctaMessage: () =>\n `Sin coste adicional, el 1% de cada pedido se dona a la organización sin ánimo de lucro que tú elijas. Desarrollado por Beam`,\n inlineSeparator: () => `:`,\n },\n de: {\n ctaTitle: () => `Wählen Sie Ihren Einfluss`,\n ctaMessage: () =>\n `Ohne zusätzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gewählte gemeinnützige Organisation gespendet. Von Beam unterstützt`,\n inlineSeparator: () => `:`,\n },\n it: {\n ctaTitle: () => `Scegliete chi sostenere`,\n ctaMessage: () =>\n `L'1% di ogni vostro acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a libera scelta. Promosso da Beam`,\n inlineSeparator: () => `:`,\n },\n pl: {\n ctaTitle: () => `Masz wpływ, dokonaj wyboru`,\n ctaMessage: () =>\n `1% kwoty każdego zamówienia jest przekazywane na rzecz wybranej przez Ciebie organizacji non-profit – bez dodatkowych kosztów. Obsługiwane przez Beam`,\n inlineSeparator: () => `:`,\n },\n};\n","import { LitElement, css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { postProductDetailsPage } 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 { 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\";\nimport { promoPillLabelConfigDefaults } from \"../../shared/components/promo-pill-label\";\nimport {\n getPromoCodesFromCart,\n setPromoCodeInCookie,\n parseJsonStringArray,\n formatStoreAndReturnPromoCodes,\n setPromoCodesInLocalStorage,\n isEmptyPromoData,\n} from \"../../utils/promoManager\";\nimport \"../../shared/components/promo-pill-label\";\nimport { BEAM_CART_COOKIE_NAME, TBeamCartLocalStorage } from \"../../shared/cart-contents\";\nimport { createScopedLocalStorage } from \"../../utils/local-storage\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { BeamPromoCodesStoredEvent, BeamWidgetStoredPromoCodesEvent } from \"../../utils/events\";\nimport { getBeamCartId } from \"../../utils/cart\";\nimport { strings } from \"./strings\";\n\ntype RequiredConfig = {\n apiKey: string;\n storeId: number;\n};\ntype IAPIV3PostProductDetailsPage = Awaited<ReturnType<typeof postProductDetailsPage>>;\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 draftConfig = false;\n\n @property({ type: Boolean }) public debug = false;\n\n @property({ type: String }) remoteProductIdentifier?: string;\n\n @property({ type: String }) public promoCodes?: string;\n\n @property({ type: String }) public domain?: string;\n\n private localStorage = createScopedLocalStorage(this as LitElement & RequiredConfig);\n\n @state() private pluginPromoCodes: string[] = [];\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n get parsedPromoCodes(): string[] {\n return parseJsonStringArray(this.promoCodes);\n }\n\n private handlePromoCodesStored = (evt: BeamPromoCodesStoredEvent) => {\n const promoCodesFromPlugin = (evt.detail.promoCodes?.unvalidatedPromoCodes ?? [])\n .map((c) => c.attributes?.value ?? c.attributes?.url ?? \"\")\n .sort();\n this.pluginPromoCodes = promoCodesFromPlugin;\n };\n\n private getManualPromoCodes(): string[] {\n // Priority 1: Widget passed discount codes\n if (this.parsedPromoCodes && this.parsedPromoCodes.length > 0) {\n return this.parsedPromoCodes;\n }\n\n // Priority 2: Cart fallback\n const cart = this.localStorage.getItemJson<TBeamCartLocalStorage>(\"cart\");\n return cart ? getPromoCodesFromCart(cart) : [];\n }\n\n private async handleValidatedPromoCodes(response: IAPIV3PostProductDetailsPage) {\n if (response.promos?.validatedPromoCodes) {\n await Promise.all([\n setPromoCodesInLocalStorage({\n apiKey: this.apiKey,\n promoCodes: { validatedPromoCodes: response.promos.validatedPromoCodes, unvalidatedPromoCodes: [] },\n }),\n setPromoCodeInCookie({\n validatedPromoCodes: response.promos.validatedPromoCodes,\n domain: this.domain,\n }),\n ]);\n this.dispatchEvent(\n new BeamWidgetStoredPromoCodesEvent({\n source: WIDGET_NAMES.product_details_page,\n })\n );\n }\n }\n\n async firstUpdated() {\n window.addEventListener(BeamPromoCodesStoredEvent.eventName, this.handlePromoCodesStored as EventListener);\n }\n\n disconnectedCallback() {\n window.removeEventListener(BeamPromoCodesStoredEvent.eventName, this.handlePromoCodesStored as EventListener);\n super.disconnectedCallback();\n }\n\n postProductDetailsPageData = async () => {\n if (!enforceConfig<RequiredConfig>([\"apiKey\", \"storeId\"], this)) throw new MissingConfig();\n const beamCartId = getBeamCartId(BEAM_CART_COOKIE_NAME, { apiKey: this.apiKey });\n\n const manualPromoCodes = this.getManualPromoCodes();\n const formattedPromos = formatStoreAndReturnPromoCodes(\n manualPromoCodes.map((code) => ({ value: code })),\n this.apiKey\n );\n const shouldSendPromos = formattedPromos && !isEmptyPromoData(formattedPromos);\n\n if (shouldSendPromos) {\n this.dispatchEvent(\n new BeamWidgetStoredPromoCodesEvent({\n source: WIDGET_NAMES.product_details_page,\n })\n );\n }\n const res = await postProductDetailsPage({\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 draftConfig: this.draftConfig,\n remoteProductIdentifier: this.remoteProductIdentifier,\n },\n requestBody: {\n ...(shouldSendPromos && { promos: formattedPromos }),\n beamCartId: beamCartId ? beamCartId : undefined,\n },\n });\n this.handleValidatedPromoCodes(res);\n return res;\n };\n\n private productDetailsPageDataController = new AsyncController<typeof this.postProductDetailsPageData>(\n this,\n this.postProductDetailsPageData\n );\n\n async updated(changedProperties: Map<string, unknown>) {\n const requireNewDataProps = [\"storeId\", \"baseUrl\", \"lang\", \"apiKey\", \"pluginPromoCodes\"];\n void this.pluginPromoCodes;\n for (const prop of requireNewDataProps) {\n if (changedProperties.has(prop)) {\n await this.productDetailsPageDataController.exec();\n break;\n }\n }\n }\n\n render() {\n const { data, loading } = this.productDetailsPageDataController;\n const iconDisplay = this.cssVariables[\"--beam-ProductDetailsPage-image-placement\"];\n const isNonZero = (value: string) => value !== \"0px\" && value !== \"0\";\n const shouldDisplayPromoPill = this.cssVariables[\"--beam-ProductDetailsPage-shouldDisplayPromoPill\"] === \"true\";\n const isPromoActive = !!data?.config?.web?.promo;\n const hasValidImageHeight = isNonZero(this.cssVariables[\"--beam-ProductDetailsPage-imageHeight\"]);\n const hasValidTitleFontSize = isNonZero(this.cssVariables[\"--beam-ProductDetailsPage-title-fontSize\"]);\n const isPromoPillVisible =\n shouldDisplayPromoPill && // Determines if the promo pill is enabled for the marketing version of the PDP\n isPromoActive && // Is promo currently active\n hasValidImageHeight && // Ensures the promo pill is not displayed for the subtext version of the PDP\n hasValidTitleFontSize; // Ensures the promo pill is not displayed for the subtext version of the PDP\n const shouldShowPunctuation = this.cssVariables[\"--beam-ProductDetailsPage-shouldDisplayColon\"] === \"true\"; // Determines if a colon should be displayed in promo display\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 ${iconDisplay === \"block-center\" ? \"block-display\" : \"inline-display\"}\">\n ${iconDisplay === \"block-center\"\n ? html`\n ${this.renderWidgetIcon(iconDisplay)}\n ${isPromoPillVisible\n ? html`\n <div class=\"promo-container\">\n <beam-promo-info-pill .promo=${data?.config?.web?.promo}></beam-promo-info-pill>\n </div>\n `\n : html``}\n <div class=\"info-container\">${this.renderContent(isPromoPillVisible, shouldShowPunctuation, data)}</div>\n `\n : html`\n ${isPromoPillVisible\n ? html`\n <div class=\"promo-container\">\n <beam-promo-info-pill .promo=${data?.config?.web?.promo}></beam-promo-info-pill>\n </div>\n `\n : html``}\n <div class=\"content-inline\">\n ${this.renderWidgetIcon(iconDisplay)}\n <div class=\"info-container\">${this.renderContent(isPromoPillVisible, shouldShowPunctuation, data)}</div>\n </div>\n `}\n </div>\n `;\n }\n\n renderWidgetIcon(iconDisplay: string) {\n const imageUrl = this.cssVariables[IMAGE_URL_REMOTE_CONFIG_KEY];\n\n if (!imageUrl) return html``;\n\n const isBlockDisplay = iconDisplay === \"block-center\";\n const containerStyle = isBlockDisplay ? 'style=\"order:1\"' : \"\";\n\n return html`\n <span class=\"icon-container\" part=\"icon\" ${containerStyle}>\n <img src=${imageUrl} alt=\"Widget Icon\" />\n </span>\n `;\n }\n\n renderContent(isPromoPillVisible: boolean, shouldDisplayColon: boolean, data: IAPIV3PostProductDetailsPage) {\n const title = localizeUserString(this.configLang, data?.config?.web?.title) || strings[this.configLang].ctaTitle();\n const description =\n localizeUserString(this.configLang, data?.config?.web?.description) || strings[this.configLang].ctaMessage();\n return isPromoPillVisible\n ? html`\n <div class=\"info-inline-promo\">\n <span class=\"title\">${title + (shouldDisplayColon ? strings[this.configLang].inlineSeparator() : \"\")}</span>\n <span class=\"description\"> ${description} ${this.renderDisclosureTooltip()} </span>\n </div>\n `\n : html`\n <div class=\"title-block\">\n <h3 class=\"title\">${title}</h3>\n </div>\n <div class=\"description-block\">\n <span class=\"description\"> ${description} ${this.renderDisclosureTooltip()} </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\" part=\"tooltip\">\n <div class=\"ppgf-disclosure-tooltip-content\" slot=\"content\" part=\"tooltip-content\">\n <button\n class=\"ppgf-disclosure-close\"\n aria-label=\"Close tooltip\"\n part=\"tooltip-close-button\"\n @click=\"${onClickClose}\"\n >\n ${this.renderCloseTooltipIcon()}\n </button>\n <div class=\"ppgf-disclosure-tooltip-copy\" part=\"tooltip-disclosure-copy\">\n ${unsafeHTML(ppgfDisclosure.copy)}\n </div>\n </div>\n <span class=\"ppgf-disclosure-tooltip-trigger\" part=\"tooltip-disclosure-icon\">\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-InfoContainer-textAlign\": \"inherit\",\n \"--beam-ProductDetailsPage-InfoContainer-lineHeight\": \"15px\",\n \"--beam-ProductDetailsPage-InfoContainer-marginTop\": \"4px\",\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: \"0px\",\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 \"--beam-ProductDetailsPage-image-placement\": \"inline-left\", // options: \"inline-left\" || \"block-center\"\n \"--beam-ProductDetailsPage-blockImage-alignSelf\": \"center\",\n \"--beam-ProductDetailsPage-promoPill-marginTop\": \"4px\",\n \"--beam-ProductDetailsPage-promoPill-alignSelf\": \"left\",\n \"--beam-ProductDetailsPage-shouldDisplayColon\": \"true\",\n \"--beam-ProductDetailsPage-shouldDisplayPromoPill\": \"true\",\n ...promoPillLabelConfigDefaults,\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 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 display: flex;\n flex-direction: column;\n ${useCustomBorder(\"--beam-ProductDetailsPage\")}\n }\n /* When iconDisplay is inline-center */\n .inline-display {\n display: flex;\n }\n /* When iconDisplay is block-center */\n .block-display {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n .promo-container {\n order: 2;\n display: flex;\n margin-top: var(--beam-ProductDetailsPage-promoPill-marginTop);\n align-self: var(--beam-ProductDetailsPage-promoPill-alignSelf);\n }\n .content-inline {\n order: 3;\n display: flex;\n align-items: center;\n }\n /* Info block for both inline and block layout */\n .info-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n text-align: var(--beam-ProductDetailsPage-InfoContainer-textAlign);\n line-height: var(--beam-ProductDetailsPage-InfoContainer-lineHeight);\n margin-top: var(--beam-ProductDetailsPage-InfoContainer-marginTop);\n margin-left: var(--beam-ProductDetailsPage-InfoContainer-marginLeft);\n }\n .block-display .info-container {\n order: 3;\n }\n .root.inline-display .icon-container,\n .root.inline-display .info-container {\n display: inline-flex;\n }\n .root.inline-display {\n flex-direction: column;\n }\n .icon-container {\n width: var(--beam-ProductDetailsPage-imageWidth);\n height: var(--beam-ProductDetailsPage-imageHeight);\n align-self: var(--beam-ProductDetailsPage-blockImage-alignSelf);\n flex-shrink: 0;\n }\n .icon-container > img {\n width: 100%;\n height: 100%;\n object-fit: contain;\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 .info-inline-promo {\n margin-top: var(--beam-ProductDetailsPage-description-marginTop, 0px);\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 ${useCustomText(\"--beam-ProductDetailsPage-description\")}\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 vertical-align: text-bottom;\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","strings","x","k","s","p","n","e","o","r","IMAGE_URL_REMOTE_CONFIG_KEY","BeamProductDetailsPage","LitElement","DEFAULT_BASE_URL","createScopedLocalStorage","evt","promoCodesFromPlugin","c","enforceConfig","beamCartId","getBeamCartId","BEAM_CART_COOKIE_NAME","manualPromoCodes","formattedPromos","formatStoreAndReturnPromoCodes","code","shouldSendPromos","isEmptyPromoData","BeamWidgetStoredPromoCodesEvent","WIDGET_NAMES","res","postProductDetailsPage","makeApiKeyHeader","AsyncController","SUPPORTED_LANGUAGES","parseJsonStringArray","cart","getPromoCodesFromCart","response","setPromoCodesInLocalStorage","setPromoCodeInCookie","BeamPromoCodesStoredEvent","changedProperties","requireNewDataProps","prop","data","loading","iconDisplay","isNonZero","value","shouldDisplayPromoPill","isPromoActive","hasValidImageHeight","hasValidTitleFontSize","isPromoPillVisible","shouldShowPunctuation","_errorMessage","imageUrl","shouldDisplayColon","title","localizeUserString","description","onClickClose","tooltip","ppgfDisclosure","unsafeHTML","ppgfHyperlink","defaults","defineCustomText","promoPillLabelConfigDefaults","remoteConfig","config","_cssVariableMap","cssReset","cssResponsiveUtils","css","useCustomText","__decorateClass","property","state","defineCustomElement"],"mappings":"69BAEO,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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o-pill-label-3bA1z-la.esm.js';
7
7
  import './beam-partner-logos.js';
8
- import { T as TNumericId, a as TId } from '../chunks/types-zbTZ8-KP.esm.js';
9
- import { T as TCart } from '../chunks/cart-contents-CMm57qu0.esm.js';
8
+ import { T as TNumericId, a as TId } from '../chunks/types-IbMT3Nwn.esm.js';
9
+ import { T as TCart } from '../chunks/cart-contents-6_ztOjrx.esm.js';
10
10
  import { L as LANGUAGES } from '../chunks/types-aju0qrRe.esm.js';
11
- import '../chunks/openapi-spec-hjdK2L9Q.esm.js';
11
+ import '../chunks/openapi-spec-bxGNhNMa.esm.js';
12
12
 
13
- interface TransactionRequiredConfig {
13
+ interface TRequiredConfig {
14
14
  apiKey: string;
15
15
  transactionId: TId;
16
16
  }
17
- interface SubscriptionRequiredConfig {
18
- apiKey: string;
19
- subscriptionId: string;
20
- }
21
- type TRequiredConfig = TransactionRequiredConfig | SubscriptionRequiredConfig;
22
17
  declare class BeamRedeemTransaction extends LitElement {
23
18
  static tagName: string;
24
19
  baseUrl: string;
25
20
  apiKey?: TRequiredConfig["apiKey"];
26
- transactionId?: TransactionRequiredConfig["transactionId"];
27
- subscriptionId?: SubscriptionRequiredConfig["subscriptionId"];
21
+ transactionId?: TRequiredConfig["transactionId"];
28
22
  storeId?: TNumericId;
29
23
  countryCode?: string;
30
24
  postalCode?: string;
@@ -38,11 +32,9 @@ declare class BeamRedeemTransaction extends LitElement {
38
32
  private shouldUsePromoUI;
39
33
  get configLang(): LANGUAGES;
40
34
  private get hasCorrectTransactionConfig();
41
- private get hasCorrectSubscriptionConfig();
42
35
  private getChainNonprofits;
43
36
  private updateNonprofitIdForRecord;
44
37
  private putTransaction;
45
- private putSubscription;
46
38
  private nonprofitListDataController;
47
39
  private selectionDataController;
48
40
  private localStorage;
@@ -69,7 +61,6 @@ declare class BeamRedeemTransaction extends LitElement {
69
61
  get allowChange(): boolean;
70
62
  get allowSubmit(): boolean;
71
63
  handleSubmit: () => Promise<void>;
72
- private get shouldUseStoredSelection();
73
64
  evaluateBreakPoints: lodash.DebouncedFuncLeading<() => void>;
74
65
  get cssVariables(): any;
75
66
  static styles: lit.CSSResult[];