stripe-pwa-elements 3.2.0 → 4.0.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 (237) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -3
  2. package/dist/cjs/error-FFC4kSs5.js +0 -3
  3. package/dist/cjs/{factory-CbbbSvkg.js → factory-Cd2VI_N2.js} +216 -77
  4. package/dist/cjs/{index-Ba1pBePA.js → index-CYbA1N_k.js} +24 -6
  5. package/dist/cjs/index-Dkb0SxZc.js +4694 -0
  6. package/dist/cjs/index.cjs.js +0 -1
  7. package/dist/cjs/ion-icon.cjs.entry.js +22 -13
  8. package/dist/cjs/loader.cjs.js +2 -3
  9. package/dist/cjs/stripe-address-element.cjs.entry.js +41 -26
  10. package/dist/cjs/stripe-card-element-modal.cjs.entry.js +6 -7
  11. package/dist/cjs/stripe-card-element_2.cjs.entry.js +129 -72
  12. package/dist/cjs/stripe-currency-selector.cjs.entry.js +20 -10
  13. package/dist/cjs/stripe-elements.cjs.js +31 -5
  14. package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +32 -22
  15. package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +20 -10
  16. package/dist/cjs/stripe-payment-element.cjs.entry.js +283 -167
  17. package/dist/cjs/stripe-payment-request-button.cjs.entry.js +30 -18
  18. package/dist/collection/collection-manifest.json +6 -5
  19. package/dist/collection/components/stripe-address-element/stripe-address-element.js +36 -21
  20. package/dist/collection/components/stripe-card-element/stripe-card-element.helpers.js +57 -0
  21. package/dist/collection/components/stripe-card-element/stripe-card-element.js +62 -68
  22. package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +15 -11
  23. package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js +17 -6
  24. package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js +35 -20
  25. package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js +19 -7
  26. package/dist/collection/components/stripe-modal/stripe-modal.js +18 -7
  27. package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +114 -0
  28. package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +162 -162
  29. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +48 -19
  30. package/dist/collection/index.js +0 -1
  31. package/dist/collection/interfaces.js +0 -1
  32. package/dist/collection/services/address-element-manager.js +3 -4
  33. package/dist/collection/services/card-element-manager.js +3 -4
  34. package/dist/collection/services/currency-selector-element-manager.js +3 -4
  35. package/dist/collection/services/express-checkout-element-manager.js +9 -10
  36. package/dist/collection/services/factory.js +0 -1
  37. package/dist/collection/services/interfaces.js +0 -1
  38. package/dist/collection/services/link-authentication-element-manager.js +3 -4
  39. package/dist/collection/services/payment-element-manager.js +4 -5
  40. package/dist/collection/services/stripe-service.js +27 -10
  41. package/dist/collection/utils/element-finder.js +2 -3
  42. package/dist/collection/utils/error.js +0 -1
  43. package/dist/collection/utils/i18n.js +0 -1
  44. package/dist/collection/utils/platform.js +0 -1
  45. package/dist/collection/utils/test-setup.js +0 -1
  46. package/dist/collection/utils/utils.js +2 -3
  47. package/dist/components/error.js +1 -16
  48. package/dist/components/factory.js +1 -3736
  49. package/dist/components/icon.js +1 -459
  50. package/dist/components/index.d.ts +2 -0
  51. package/dist/components/index.js +1 -4
  52. package/dist/components/index2.js +1 -192
  53. package/dist/components/ion-icon.js +1 -9
  54. package/dist/components/stripe-address-element.js +1 -327
  55. package/dist/components/stripe-card-element-modal.js +1 -174
  56. package/dist/components/stripe-card-element.js +1 -9
  57. package/dist/components/stripe-card-element2.js +1 -440
  58. package/dist/components/stripe-currency-selector.js +1 -218
  59. package/dist/components/stripe-express-checkout-element.js +1 -332
  60. package/dist/components/stripe-link-authentication-element.js +1 -256
  61. package/dist/components/stripe-modal.js +1 -9
  62. package/dist/components/stripe-modal2.js +1 -112
  63. package/dist/components/stripe-payment-element.js +1 -510
  64. package/dist/components/stripe-payment-request-button.js +1 -9
  65. package/dist/components/stripe-payment-request-button2.js +1 -224
  66. package/dist/components/utils.js +1 -89
  67. package/dist/esm/app-globals-DQuL1Twl.js +0 -3
  68. package/dist/esm/error-XRfh5Wrs.js +0 -3
  69. package/dist/esm/{factory-Drde6-y7.js → factory-VTa1Gc94.js} +216 -77
  70. package/dist/esm/index-C6bbmyga.js +4677 -0
  71. package/dist/esm/{index-BHDCxQOb.js → index-CBXaOfXU.js} +24 -6
  72. package/dist/esm/index.js +0 -1
  73. package/dist/esm/ion-icon.entry.js +22 -13
  74. package/dist/esm/loader.js +3 -4
  75. package/dist/esm/stripe-address-element.entry.js +41 -26
  76. package/dist/esm/stripe-card-element-modal.entry.js +6 -7
  77. package/dist/esm/stripe-card-element_2.entry.js +129 -72
  78. package/dist/esm/stripe-currency-selector.entry.js +20 -10
  79. package/dist/esm/stripe-elements.js +32 -6
  80. package/dist/esm/stripe-express-checkout-element.entry.js +32 -22
  81. package/dist/esm/stripe-link-authentication-element.entry.js +20 -10
  82. package/dist/esm/stripe-payment-element.entry.js +283 -167
  83. package/dist/esm/stripe-payment-request-button.entry.js +27 -15
  84. package/dist/stripe-elements/index.esm.js +0 -2
  85. package/dist/stripe-elements/p-1bd46766.entry.js +1 -0
  86. package/dist/stripe-elements/p-1c6e0a45.entry.js +1 -0
  87. package/dist/stripe-elements/p-3f42ca0c.entry.js +1 -0
  88. package/dist/stripe-elements/p-5cf62945.entry.js +1 -0
  89. package/dist/stripe-elements/p-74de1556.entry.js +1 -0
  90. package/dist/stripe-elements/p-76e57d78.entry.js +1 -0
  91. package/dist/stripe-elements/p-840d499f.entry.js +1 -0
  92. package/dist/stripe-elements/p-C6bbmyga.js +2 -0
  93. package/dist/stripe-elements/p-CBXaOfXU.js +1 -0
  94. package/dist/stripe-elements/p-CrjrbGJ3.js +1 -0
  95. package/dist/stripe-elements/p-DQuL1Twl.js +1 -2
  96. package/dist/stripe-elements/p-XRfh5Wrs.js +1 -2
  97. package/dist/stripe-elements/p-ae0c336e.entry.js +1 -0
  98. package/dist/stripe-elements/p-cfd8e081.entry.js +1 -0
  99. package/dist/stripe-elements/stripe-elements.esm.js +1 -2
  100. package/dist/stripe-elements/svg/.gitignore +4 -0
  101. package/dist/types/components/stripe-address-element/stripe-address-element.d.ts +6 -0
  102. package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +11 -1
  103. package/dist/types/components/stripe-card-element/stripe-card-element.helpers.d.ts +29 -0
  104. package/dist/types/components/stripe-card-element-modal/stripe-card-element-modal.d.ts +4 -4
  105. package/dist/types/components/stripe-currency-selector/stripe-currency-selector.d.ts +6 -0
  106. package/dist/types/components/stripe-express-checkout-element/stripe-express-checkout-element.d.ts +6 -0
  107. package/dist/types/components/stripe-link-authentication-element/stripe-link-authentication-element.d.ts +6 -0
  108. package/dist/types/components/stripe-modal/stripe-modal.d.ts +1 -0
  109. package/dist/types/components/stripe-payment-element/stripe-payment-element.d.ts +20 -2
  110. package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +54 -0
  111. package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts +14 -1
  112. package/dist/types/components.d.ts +139 -29
  113. package/dist/types/index.d.ts +1 -0
  114. package/dist/types/services/interfaces.d.ts +4 -3
  115. package/dist/types/services/stripe-service.d.ts +8 -4
  116. package/dist/types/stencil-public-runtime.d.ts +110 -5
  117. package/package.json +50 -30
  118. package/readme.md +386 -133
  119. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
  120. package/dist/cjs/error-FFC4kSs5.js.map +0 -1
  121. package/dist/cjs/factory-CbbbSvkg.js.map +0 -1
  122. package/dist/cjs/index-BXVW_rzh.js +0 -1932
  123. package/dist/cjs/index-BXVW_rzh.js.map +0 -1
  124. package/dist/cjs/index-Ba1pBePA.js.map +0 -1
  125. package/dist/cjs/index.cjs.js.map +0 -1
  126. package/dist/cjs/ion-icon.entry.cjs.js.map +0 -1
  127. package/dist/cjs/loader.cjs.js.map +0 -1
  128. package/dist/cjs/stripe-address-element.entry.cjs.js.map +0 -1
  129. package/dist/cjs/stripe-card-element-modal.entry.cjs.js.map +0 -1
  130. package/dist/cjs/stripe-card-element.stripe-modal.entry.cjs.js.map +0 -1
  131. package/dist/cjs/stripe-currency-selector.entry.cjs.js.map +0 -1
  132. package/dist/cjs/stripe-elements.cjs.js.map +0 -1
  133. package/dist/cjs/stripe-express-checkout-element.entry.cjs.js.map +0 -1
  134. package/dist/cjs/stripe-link-authentication-element.entry.cjs.js.map +0 -1
  135. package/dist/cjs/stripe-payment-element.entry.cjs.js.map +0 -1
  136. package/dist/cjs/stripe-payment-request-button.entry.cjs.js.map +0 -1
  137. package/dist/collection/components/stripe-address-element/stripe-address-element.js.map +0 -1
  138. package/dist/collection/components/stripe-card-element/stripe-card-element.js.map +0 -1
  139. package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js.map +0 -1
  140. package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js.map +0 -1
  141. package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js.map +0 -1
  142. package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js.map +0 -1
  143. package/dist/collection/components/stripe-modal/stripe-modal.js.map +0 -1
  144. package/dist/collection/components/stripe-payment-element/stripe-payment-element.js.map +0 -1
  145. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js.map +0 -1
  146. package/dist/collection/index.js.map +0 -1
  147. package/dist/collection/interfaces.js.map +0 -1
  148. package/dist/collection/services/address-element-manager.js.map +0 -1
  149. package/dist/collection/services/card-element-manager.js.map +0 -1
  150. package/dist/collection/services/currency-selector-element-manager.js.map +0 -1
  151. package/dist/collection/services/express-checkout-element-manager.js.map +0 -1
  152. package/dist/collection/services/factory.js.map +0 -1
  153. package/dist/collection/services/interfaces.js.map +0 -1
  154. package/dist/collection/services/link-authentication-element-manager.js.map +0 -1
  155. package/dist/collection/services/payment-element-manager.js.map +0 -1
  156. package/dist/collection/services/stripe-service.js.map +0 -1
  157. package/dist/collection/utils/element-finder.js.map +0 -1
  158. package/dist/collection/utils/error.js.map +0 -1
  159. package/dist/collection/utils/i18n.js.map +0 -1
  160. package/dist/collection/utils/platform.js.map +0 -1
  161. package/dist/collection/utils/test-setup.js.map +0 -1
  162. package/dist/collection/utils/utils.js.map +0 -1
  163. package/dist/components/error.js.map +0 -1
  164. package/dist/components/factory.js.map +0 -1
  165. package/dist/components/icon.js.map +0 -1
  166. package/dist/components/index.js.map +0 -1
  167. package/dist/components/index2.js.map +0 -1
  168. package/dist/components/ion-icon.js.map +0 -1
  169. package/dist/components/stripe-address-element.js.map +0 -1
  170. package/dist/components/stripe-card-element-modal.js.map +0 -1
  171. package/dist/components/stripe-card-element.js.map +0 -1
  172. package/dist/components/stripe-card-element2.js.map +0 -1
  173. package/dist/components/stripe-currency-selector.js.map +0 -1
  174. package/dist/components/stripe-express-checkout-element.js.map +0 -1
  175. package/dist/components/stripe-link-authentication-element.js.map +0 -1
  176. package/dist/components/stripe-modal.js.map +0 -1
  177. package/dist/components/stripe-modal2.js.map +0 -1
  178. package/dist/components/stripe-payment-element.js.map +0 -1
  179. package/dist/components/stripe-payment-request-button.js.map +0 -1
  180. package/dist/components/stripe-payment-request-button2.js.map +0 -1
  181. package/dist/components/utils.js.map +0 -1
  182. package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
  183. package/dist/esm/error-XRfh5Wrs.js.map +0 -1
  184. package/dist/esm/factory-Drde6-y7.js.map +0 -1
  185. package/dist/esm/index-BHDCxQOb.js.map +0 -1
  186. package/dist/esm/index-DJwTOfxZ.js +0 -1920
  187. package/dist/esm/index-DJwTOfxZ.js.map +0 -1
  188. package/dist/esm/index.js.map +0 -1
  189. package/dist/esm/ion-icon.entry.js.map +0 -1
  190. package/dist/esm/loader.js.map +0 -1
  191. package/dist/esm/stripe-address-element.entry.js.map +0 -1
  192. package/dist/esm/stripe-card-element-modal.entry.js.map +0 -1
  193. package/dist/esm/stripe-card-element.stripe-modal.entry.js.map +0 -1
  194. package/dist/esm/stripe-currency-selector.entry.js.map +0 -1
  195. package/dist/esm/stripe-elements.js.map +0 -1
  196. package/dist/esm/stripe-express-checkout-element.entry.js.map +0 -1
  197. package/dist/esm/stripe-link-authentication-element.entry.js.map +0 -1
  198. package/dist/esm/stripe-payment-element.entry.js.map +0 -1
  199. package/dist/esm/stripe-payment-request-button.entry.js.map +0 -1
  200. package/dist/stripe-elements/index.esm.js.map +0 -1
  201. package/dist/stripe-elements/ion-icon.entry.esm.js.map +0 -1
  202. package/dist/stripe-elements/loader.esm.js.map +0 -1
  203. package/dist/stripe-elements/p-02f6e421.entry.js +0 -2
  204. package/dist/stripe-elements/p-02f6e421.entry.js.map +0 -1
  205. package/dist/stripe-elements/p-19888fa6.entry.js +0 -2
  206. package/dist/stripe-elements/p-19888fa6.entry.js.map +0 -1
  207. package/dist/stripe-elements/p-4d505729.entry.js +0 -2
  208. package/dist/stripe-elements/p-4d505729.entry.js.map +0 -1
  209. package/dist/stripe-elements/p-7e7ad92a.entry.js +0 -2
  210. package/dist/stripe-elements/p-7e7ad92a.entry.js.map +0 -1
  211. package/dist/stripe-elements/p-8bb4212c.entry.js +0 -2
  212. package/dist/stripe-elements/p-8bb4212c.entry.js.map +0 -1
  213. package/dist/stripe-elements/p-9aee2b6b.entry.js +0 -2
  214. package/dist/stripe-elements/p-9aee2b6b.entry.js.map +0 -1
  215. package/dist/stripe-elements/p-BHDCxQOb.js +0 -2
  216. package/dist/stripe-elements/p-BHDCxQOb.js.map +0 -1
  217. package/dist/stripe-elements/p-DI2vmGaI.js +0 -2
  218. package/dist/stripe-elements/p-DI2vmGaI.js.map +0 -1
  219. package/dist/stripe-elements/p-DJwTOfxZ.js +0 -3
  220. package/dist/stripe-elements/p-DJwTOfxZ.js.map +0 -1
  221. package/dist/stripe-elements/p-DQuL1Twl.js.map +0 -1
  222. package/dist/stripe-elements/p-XRfh5Wrs.js.map +0 -1
  223. package/dist/stripe-elements/p-ba251393.entry.js +0 -2
  224. package/dist/stripe-elements/p-ba251393.entry.js.map +0 -1
  225. package/dist/stripe-elements/p-c649edfc.entry.js +0 -2
  226. package/dist/stripe-elements/p-c649edfc.entry.js.map +0 -1
  227. package/dist/stripe-elements/p-e8bb43ae.entry.js +0 -2
  228. package/dist/stripe-elements/p-e8bb43ae.entry.js.map +0 -1
  229. package/dist/stripe-elements/stripe-address-element.entry.esm.js.map +0 -1
  230. package/dist/stripe-elements/stripe-card-element-modal.entry.esm.js.map +0 -1
  231. package/dist/stripe-elements/stripe-card-element.stripe-modal.entry.esm.js.map +0 -1
  232. package/dist/stripe-elements/stripe-currency-selector.entry.esm.js.map +0 -1
  233. package/dist/stripe-elements/stripe-elements.esm.js.map +0 -1
  234. package/dist/stripe-elements/stripe-express-checkout-element.entry.esm.js.map +0 -1
  235. package/dist/stripe-elements/stripe-link-authentication-element.entry.esm.js.map +0 -1
  236. package/dist/stripe-elements/stripe-payment-element.entry.esm.js.map +0 -1
  237. package/dist/stripe-elements/stripe-payment-request-button.entry.esm.js.map +0 -1
@@ -1,9 +1,123 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-DJwTOfxZ.js';
2
- import { s as serviceFactory, c as checkPlatform, i as i18n } from './factory-Drde6-y7.js';
1
+ import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
2
+ import { s as serviceFactory, c as checkPlatform, i as i18n } from './factory-VTa1Gc94.js';
3
3
  import { S as StripeAPIError } from './error-XRfh5Wrs.js';
4
- import './index-BHDCxQOb.js';
4
+ import './index-CBXaOfXU.js';
5
5
 
6
- const stripePaymentElementCss = ":root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-payment-sheet-wrap{box-sizing:border-box}.stripe-payment-sheet-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:\"Roboto\", sans-serif;box-sizing:border-box}.stripe-payment-sheet-wrap button{cursor:pointer}.stripe-payment-sheet-wrap{display:block;width:100%;background:#fff;padding:32px 16px}.stripe-payment-sheet-wrap .StripeElement{padding:8px 16px;min-height:64px;border-radius:6px;display:flex;justify-content:center;align-items:center}.stripe-payment-sheet-wrap .StripeElement>.__PrivateStripeElement{width:100%}.stripe-payment-sheet-wrap .stripe-heading{font-size:24px;font-weight:bold;color:var(--color-heading-text);margin-bottom:24px}.stripe-payment-sheet-wrap .stripe-section-title{font-size:14px;font-weight:bold;color:var(--color-label);margin-bottom:8px}.stripe-payment-sheet-wrap .payment-info{margin-top:8px}.stripe-payment-sheet-wrap .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}.stripe-payment-sheet-wrap button{display:block;color:var(--color-button-text);background-color:var(--color-primary);width:100%;text-align:center;padding:16px 16px;font-size:18px;border-radius:6px;min-height:42px}.stripe-payment-sheet-wrap button:disabled{color:var(--color-button-text-disabled)}";
6
+ /**
7
+ * Determine whether the submit button should be disabled.
8
+ * For Checkout Session mode: the checkout is ready once Stripe finished loading.
9
+ * For Payment Intent / Setup Intent mode: an intent client secret must be present.
10
+ * @param params progress / loading state and the current mode information
11
+ * @returns true when the submit button should be disabled
12
+ */
13
+ const isSubmitButtonDisabled = (params) => {
14
+ const { progress, isCheckoutSession, loadStripeStatus, intentClientSecret } = params;
15
+ const hasValidSecret = isCheckoutSession ? loadStripeStatus === 'success' : intentClientSecret != null && intentClientSecret !== '';
16
+ return progress === 'loading' || !hasValidSecret;
17
+ };
18
+ /**
19
+ * Run the default Stripe confirmation flow for Payment Intent / Setup Intent mode.
20
+ * Calls `confirmPayment` or `confirmSetup` depending on the intent type.
21
+ * @param stripe the loaded Stripe.js instance
22
+ * @param elements the Stripe Elements instance bound to the payment element
23
+ * @param intentType the configured intent type
24
+ * @param returnUrl the URL Stripe should redirect back to when required
25
+ * @returns the confirmation result
26
+ * @throws StripeAPIError when Stripe returns an error
27
+ */
28
+ const confirmPaymentOrSetup = async (stripe, elements, intentType, returnUrl) => {
29
+ const result = await (() => {
30
+ if (intentType === 'payment') {
31
+ return stripe.confirmPayment({
32
+ elements,
33
+ confirmParams: {
34
+ return_url: returnUrl,
35
+ },
36
+ redirect: 'if_required',
37
+ });
38
+ }
39
+ return stripe.confirmSetup({
40
+ elements,
41
+ confirmParams: {
42
+ return_url: returnUrl,
43
+ },
44
+ redirect: 'if_required',
45
+ });
46
+ })();
47
+ if (result.error) {
48
+ throw new StripeAPIError(result.error);
49
+ }
50
+ return result;
51
+ };
52
+ /**
53
+ * Confirm a Checkout Session payment using the checkout actions.
54
+ * @param checkout the Stripe Checkout instance
55
+ * @param returnUrl the URL Stripe should redirect back to when required
56
+ * @returns the confirmation result
57
+ * @throws StripeAPIError when loading actions or confirming fails
58
+ */
59
+ const confirmCheckoutSession = async (checkout, returnUrl) => {
60
+ var _a;
61
+ // Load actions from the checkout session
62
+ const loadActionsResult = await checkout.loadActions();
63
+ if (loadActionsResult.type === 'error') {
64
+ // Create a StripeError-compatible object from the Checkout Session error
65
+ const stripeError = {
66
+ type: 'api_error',
67
+ code: loadActionsResult.error.code || 'checkout_session_error',
68
+ message: loadActionsResult.error.message,
69
+ };
70
+ throw new StripeAPIError(stripeError);
71
+ }
72
+ const { actions } = loadActionsResult;
73
+ // Confirm the payment using checkout session actions
74
+ const result = await actions.confirm({
75
+ returnUrl,
76
+ redirect: 'if_required',
77
+ });
78
+ if (result.type === 'error') {
79
+ // Create a StripeError-compatible object from the confirm error
80
+ const stripeError = {
81
+ type: 'card_error',
82
+ code: result.error.code || 'payment_failed',
83
+ message: result.error.message,
84
+ decline_code: result.error.code === 'paymentFailed' ? (_a = result.error.paymentFailed) === null || _a === void 0 ? void 0 : _a.declineCode : undefined,
85
+ };
86
+ throw new StripeAPIError(stripeError);
87
+ }
88
+ return result;
89
+ };
90
+ /**
91
+ * Resolve the mode-specific properties for a submit event.
92
+ * Picks the Checkout or Elements payload depending on the active mode and
93
+ * reports a descriptive error string when the required instance is missing.
94
+ * @param params the resolved Stripe instances and client secrets for the current mode
95
+ * @returns the submit event props, or an error message when an instance is missing
96
+ */
97
+ const buildSubmitEventProps = (params) => {
98
+ const { stripe, isCheckoutSession, checkout, checkoutSessionClientSecret, elements, intentClientSecret } = params;
99
+ const props = {
100
+ stripe,
101
+ };
102
+ if (isCheckoutSession) {
103
+ // Checkout Session mode
104
+ if (checkout == null) {
105
+ return { error: 'Checkout not properly initialized' };
106
+ }
107
+ props.checkout = checkout;
108
+ props.checkoutSessionClientSecret = checkoutSessionClientSecret;
109
+ return { props };
110
+ }
111
+ // Payment Intent / Setup Intent mode
112
+ if (elements == null) {
113
+ return { error: 'Elements not properly initialized' };
114
+ }
115
+ props.elements = elements;
116
+ props.intentClientSecret = intentClientSecret;
117
+ return { props };
118
+ };
119
+
120
+ const stripePaymentElementCss = () => `:root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-payment-sheet-wrap{box-sizing:border-box}.stripe-payment-sheet-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}.stripe-payment-sheet-wrap button{cursor:pointer}.stripe-payment-sheet-wrap{display:block;width:100%;background:#fff;padding:32px 16px}.stripe-payment-sheet-wrap .StripeElement{padding:8px 16px;min-height:64px;border-radius:6px;display:flex;justify-content:center;align-items:center}.stripe-payment-sheet-wrap .StripeElement>.__PrivateStripeElement{width:100%}.stripe-payment-sheet-wrap .stripe-heading{font-size:24px;font-weight:bold;color:var(--color-heading-text);margin-bottom:24px}.stripe-payment-sheet-wrap .stripe-section-title{font-size:14px;font-weight:bold;color:var(--color-label);margin-bottom:8px}.stripe-payment-sheet-wrap .payment-info{margin-top:8px}.stripe-payment-sheet-wrap .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}.stripe-payment-sheet-wrap button{display:block;color:var(--color-button-text);background-color:var(--color-primary);width:100%;text-align:center;padding:16px 16px;font-size:18px;border-radius:6px;min-height:42px}.stripe-payment-sheet-wrap button:disabled{color:var(--color-button-text-disabled)}`;
7
121
 
8
122
  const StripePaymentElement = class {
9
123
  /**
@@ -21,26 +135,14 @@ const StripePaymentElement = class {
21
135
  * ```
22
136
  */
23
137
  async initStripe(publishableKey, options) {
138
+ const generation = ++this.initGeneration;
24
139
  await this.stripeService.initialize(publishableKey, {
25
140
  stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
26
141
  applicationName: this.applicationName,
142
+ // Payment Element needs the client secret when the Elements group is created
143
+ clientSecret: this.intentClientSecret,
27
144
  });
28
- // If already successfully loaded, initialize elements immediately
29
- if (this.stripeService.state.loadStripeStatus === 'success') {
30
- await this.initElement();
31
- this.stripeLoadedEventHandler();
32
- }
33
- else {
34
- // Otherwise, wait for successful load
35
- const unsubscribe = this.stripeService.onChange('loadStripeStatus', async (newState) => {
36
- if (newState !== 'success') {
37
- return;
38
- }
39
- await this.initElement();
40
- this.stripeLoadedEventHandler();
41
- unsubscribe(); // Clean up listener after first success
42
- });
43
- }
145
+ await this.mountWhenLoaded(generation);
44
146
  }
45
147
  /**
46
148
  * Get Stripe.js and initialize with Checkout Session mode
@@ -62,27 +164,13 @@ const StripePaymentElement = class {
62
164
  * ```
63
165
  */
64
166
  async initStripeWithCheckoutSession(publishableKey, checkoutSessionClientSecret, options) {
167
+ const generation = ++this.initGeneration;
65
168
  await this.stripeService.initializeWithCheckoutSession(publishableKey, checkoutSessionClientSecret, {
66
169
  stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
67
170
  applicationName: this.applicationName,
68
171
  elementsOptions: options === null || options === void 0 ? void 0 : options.elementsOptions,
69
172
  });
70
- // If already successfully loaded, initialize elements immediately
71
- if (this.stripeService.state.loadStripeStatus === 'success') {
72
- await this.initElement();
73
- this.stripeLoadedEventHandler();
74
- }
75
- else {
76
- // Otherwise, wait for successful load
77
- const unsubscribe = this.stripeService.onChange('loadStripeStatus', async (newState) => {
78
- if (newState !== 'success') {
79
- return;
80
- }
81
- await this.initElement();
82
- this.stripeLoadedEventHandler();
83
- unsubscribe(); // Clean up listener after first success
84
- });
85
- }
173
+ await this.mountWhenLoaded(generation);
86
174
  }
87
175
  /**
88
176
  * Update the form submit progress
@@ -123,23 +211,37 @@ const StripePaymentElement = class {
123
211
  updatePublishableKey(publishableKey) {
124
212
  const options = {};
125
213
  options.stripeAccount = this.stripeService.state.stripeAccount;
126
- const hasOptionValue = Object.values(options).filter(Boolean).length > 0;
214
+ const hasOptionValue = Object.values(options).filter(value => value != null && value !== '').length > 0;
215
+ if (this.hasCheckoutSessionClientSecret()) {
216
+ this.initStripeWithCheckoutSession(publishableKey, this.checkoutSessionClientSecret, { stripeAccount: options.stripeAccount });
217
+ return;
218
+ }
127
219
  this.initStripe(publishableKey, hasOptionValue ? options : undefined);
128
220
  }
129
221
  updateStripeAccountId(stripeAccount) {
222
+ if (this.hasCheckoutSessionClientSecret()) {
223
+ this.initStripeWithCheckoutSession(this.stripeService.state.publishableKey, this.checkoutSessionClientSecret, { stripeAccount });
224
+ return;
225
+ }
130
226
  this.initStripe(this.stripeService.state.publishableKey, {
131
227
  stripeAccount: stripeAccount,
132
228
  });
133
229
  }
134
230
  async updateIntentClientSecret() {
135
- // Re-initialize the payment element when client secret changes
136
- if (this.stripeService.state.loadStripeStatus === 'success') {
137
- await this.initElement();
231
+ // Checkout Session mode takes precedence (same rule as startStripe); an intent secret must not switch the mode
232
+ if (this.checkoutSessionClientSecret != null && this.checkoutSessionClientSecret !== '') {
233
+ return;
138
234
  }
235
+ // The Elements group is bound to its client secret, so it has to be recreated when the secret changes
236
+ const { publishableKey, stripeAccount } = this.stripeService.state;
237
+ if (publishableKey == null || publishableKey === '') {
238
+ return;
239
+ }
240
+ await this.initStripe(publishableKey, { stripeAccount });
139
241
  }
140
242
  async updateCheckoutSessionClientSecret(newValue) {
141
243
  // Re-initialize with checkout session when client secret changes
142
- if (this.publishableKey && newValue) {
244
+ if (this.publishableKey != null && this.publishableKey !== '' && newValue != null && newValue !== '') {
143
245
  await this.initStripeWithCheckoutSession(this.publishableKey, newValue, {
144
246
  stripeAccount: this.stripeAccount,
145
247
  });
@@ -149,42 +251,31 @@ const StripePaymentElement = class {
149
251
  const event = {
150
252
  stripe: this.stripeService.getStripe(),
151
253
  };
152
- if (this.stripeDidLoaded) {
254
+ if (this.stripeDidLoaded != null) {
153
255
  this.stripeDidLoaded(event);
154
256
  }
155
257
  this.stripeLoaded.emit(event);
156
258
  }
157
259
  async formSubmitEventHandler() {
158
260
  const stripe = this.stripeService.getStripe();
159
- const isCheckoutSession = this.stripeService.state.isCheckoutSession;
160
- if (!stripe) {
261
+ const isCheckoutSession = this.stripeService.state.isCheckoutSession === true;
262
+ if (stripe == null) {
161
263
  console.error('Stripe not properly initialized');
162
264
  return;
163
265
  }
164
- const eventData = {
266
+ const result = buildSubmitEventProps({
165
267
  stripe,
166
- };
167
- if (isCheckoutSession) {
168
- // Checkout Session mode
169
- const checkout = this.stripeService.getCheckout();
170
- if (!checkout) {
171
- console.error('Checkout not properly initialized');
172
- return;
173
- }
174
- eventData.checkout = checkout;
175
- eventData.checkoutSessionClientSecret = this.checkoutSessionClientSecret;
176
- }
177
- else {
178
- // Payment Intent / Setup Intent mode
179
- const elements = this.stripeService.getElements();
180
- if (!elements) {
181
- console.error('Elements not properly initialized');
182
- return;
183
- }
184
- eventData.elements = elements;
185
- eventData.intentClientSecret = this.intentClientSecret;
268
+ isCheckoutSession,
269
+ checkout: this.stripeService.getCheckout(),
270
+ checkoutSessionClientSecret: this.checkoutSessionClientSecret,
271
+ elements: this.stripeService.getElements(),
272
+ intentClientSecret: this.intentClientSecret,
273
+ });
274
+ if ('error' in result) {
275
+ console.error(result.error);
276
+ return;
186
277
  }
187
- this.formSubmit.emit(eventData);
278
+ this.formSubmit.emit(result.props);
188
279
  }
189
280
  async defaultFormSubmitResultHandler(result) {
190
281
  this.defaultFormSubmitResult.emit(result);
@@ -193,12 +284,20 @@ const StripePaymentElement = class {
193
284
  this.checkoutSessionConfirmResult.emit(result);
194
285
  }
195
286
  componentWillRender() {
196
- if (!this.stripeService.state.publishableKey) {
287
+ const { publishableKey } = this.stripeService.state;
288
+ if (publishableKey == null || publishableKey === '') {
197
289
  return;
198
290
  }
199
291
  if (['success', 'loading'].includes(this.stripeService.state.loadStripeStatus)) {
200
292
  return;
201
293
  }
294
+ // Retry in the same mode as the initial start
295
+ if (this.checkoutSessionClientSecret != null && this.checkoutSessionClientSecret !== '') {
296
+ this.initStripeWithCheckoutSession(this.stripeService.state.publishableKey, this.checkoutSessionClientSecret, {
297
+ stripeAccount: this.stripeService.state.stripeAccount,
298
+ });
299
+ return;
300
+ }
202
301
  this.initStripe(this.stripeService.state.publishableKey, {
203
302
  stripeAccount: this.stripeService.state.stripeAccount,
204
303
  });
@@ -213,30 +312,9 @@ const StripePaymentElement = class {
213
312
  async defaultFormSubmitAction(event, { stripe, elements }) {
214
313
  event.preventDefault();
215
314
  try {
216
- const { intentType } = this;
217
315
  // Get current page URL for return_url
218
316
  const returnUrl = window.location.href;
219
- const result = await (() => {
220
- if (intentType === 'payment') {
221
- return stripe.confirmPayment({
222
- elements,
223
- confirmParams: {
224
- return_url: returnUrl,
225
- },
226
- redirect: 'if_required',
227
- });
228
- }
229
- return stripe.confirmSetup({
230
- elements,
231
- confirmParams: {
232
- return_url: returnUrl,
233
- },
234
- redirect: 'if_required',
235
- });
236
- })();
237
- if (result.error) {
238
- throw new StripeAPIError(result.error);
239
- }
317
+ const result = await confirmPaymentOrSetup(stripe, elements, this.intentType, returnUrl);
240
318
  this.defaultFormSubmitResultHandler(result);
241
319
  }
242
320
  catch (e) {
@@ -252,38 +330,11 @@ const StripePaymentElement = class {
252
330
  * @param checkout - The Stripe Checkout instance
253
331
  */
254
332
  async checkoutSessionFormSubmitAction(event, checkout) {
255
- var _a;
256
333
  event.preventDefault();
257
334
  try {
258
- // Load actions from the checkout session
259
- const loadActionsResult = await checkout.loadActions();
260
- if (loadActionsResult.type === 'error') {
261
- // Create a StripeError-compatible object from the Checkout Session error
262
- const stripeError = {
263
- type: 'api_error',
264
- code: loadActionsResult.error.code || 'checkout_session_error',
265
- message: loadActionsResult.error.message,
266
- };
267
- throw new StripeAPIError(stripeError);
268
- }
269
- const { actions } = loadActionsResult;
270
335
  // Get current page URL for return_url
271
336
  const returnUrl = window.location.href;
272
- // Confirm the payment using checkout session actions
273
- const result = await actions.confirm({
274
- returnUrl,
275
- redirect: 'if_required',
276
- });
277
- if (result.type === 'error') {
278
- // Create a StripeError-compatible object from the confirm error
279
- const stripeError = {
280
- type: 'card_error',
281
- code: result.error.code || 'payment_failed',
282
- message: result.error.message,
283
- decline_code: result.error.code === 'paymentFailed' ? (_a = result.error.paymentFailed) === null || _a === void 0 ? void 0 : _a.declineCode : undefined,
284
- };
285
- throw new StripeAPIError(stripeError);
286
- }
337
+ const result = await confirmCheckoutSession(checkout, returnUrl);
287
338
  this.checkoutSessionConfirmResultHandler(result);
288
339
  }
289
340
  catch (e) {
@@ -294,10 +345,12 @@ const StripePaymentElement = class {
294
345
  }
295
346
  constructor(hostRef) {
296
347
  registerInstance(this, hostRef);
297
- this.stripeLoaded = createEvent(this, "stripeLoaded");
298
- this.formSubmit = createEvent(this, "formSubmit");
299
- this.defaultFormSubmitResult = createEvent(this, "defaultFormSubmitResult");
300
- this.checkoutSessionConfirmResult = createEvent(this, "checkoutSessionConfirmResult");
348
+ this.stripeLoaded = createEvent(this, "stripeLoaded", 7);
349
+ this.formSubmit = createEvent(this, "formSubmit", 7);
350
+ this.defaultFormSubmitResult = createEvent(this, "defaultFormSubmitResult", 7);
351
+ this.checkoutSessionConfirmResult = createEvent(this, "checkoutSessionConfirmResult", 7);
352
+ // Incremented on every initStripe call so that a superseded call stops after its awaits
353
+ this.initGeneration = 0;
301
354
  /**
302
355
  * Default submit handle type.
303
356
  * If you want to use `setupIntent`, should update this attribute.
@@ -339,11 +392,71 @@ const StripePaymentElement = class {
339
392
  // Dependency Injection via factory
340
393
  this.stripeService = serviceFactory.createStripeService();
341
394
  this.paymentElementManager = serviceFactory.createPaymentElementManager(this.stripeService);
342
- if (this.publishableKey) {
343
- this.initStripe(this.publishableKey, {
395
+ }
396
+ /**
397
+ * Props are not yet populated inside the constructor when the component is registered via
398
+ * the custom-elements build (`dist/components/*`), so initialization that depends on them
399
+ * must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
400
+ */
401
+ componentWillLoad() {
402
+ this.startStripe();
403
+ }
404
+ /**
405
+ * Mount the element once Stripe.js has loaded, unless a newer init call (of either mode) has superseded this one.
406
+ * @param generation - The value of `initGeneration` taken when the init call started
407
+ */
408
+ async mountWhenLoaded(generation) {
409
+ // A newer init call supersedes this one
410
+ if (generation !== this.initGeneration) {
411
+ return;
412
+ }
413
+ // If already successfully loaded, initialize elements immediately
414
+ if (this.stripeService.state.loadStripeStatus === 'success') {
415
+ await this.initElement();
416
+ if (generation !== this.initGeneration) {
417
+ return;
418
+ }
419
+ this.stripeLoadedEventHandler();
420
+ return;
421
+ }
422
+ // Otherwise, wait for successful load
423
+ const unsubscribe = this.stripeService.onChange('loadStripeStatus', async (newState) => {
424
+ if (generation !== this.initGeneration) {
425
+ unsubscribe();
426
+ return;
427
+ }
428
+ if (newState !== 'success') {
429
+ return;
430
+ }
431
+ await this.initElement();
432
+ if (generation !== this.initGeneration) {
433
+ unsubscribe();
434
+ return;
435
+ }
436
+ this.stripeLoadedEventHandler();
437
+ unsubscribe(); // Clean up listener after first success
438
+ });
439
+ }
440
+ hasCheckoutSessionClientSecret() {
441
+ return this.checkoutSessionClientSecret != null && this.checkoutSessionClientSecret !== '';
442
+ }
443
+ /**
444
+ * Start Stripe.js in the mode that matches the given props.
445
+ * Checkout Session mode when `checkoutSessionClientSecret` is set, PaymentIntent / SetupIntent mode otherwise.
446
+ */
447
+ startStripe() {
448
+ if (this.publishableKey == null || this.publishableKey === '') {
449
+ return;
450
+ }
451
+ if (this.checkoutSessionClientSecret != null && this.checkoutSessionClientSecret !== '') {
452
+ this.initStripeWithCheckoutSession(this.publishableKey, this.checkoutSessionClientSecret, {
344
453
  stripeAccount: this.stripeAccount,
345
454
  });
455
+ return;
346
456
  }
457
+ this.initStripe(this.publishableKey, {
458
+ stripeAccount: this.stripeAccount,
459
+ });
347
460
  }
348
461
  /**
349
462
  * Initialize Component using Stripe Element
@@ -353,57 +466,47 @@ const StripePaymentElement = class {
353
466
  await this.paymentElementManager.initialize(this.el);
354
467
  // Add form submit listener scoped to this component instance
355
468
  const formElement = this.el.querySelector('#stripe-payment-element');
356
- if (!formElement) {
469
+ if (formElement == null) {
357
470
  console.error('Form element #stripe-payment-element not found');
358
471
  return;
359
472
  }
360
473
  // Remove existing listener if present to prevent duplicates
361
- if (this._submitHandler) {
474
+ if (this._submitHandler != null) {
362
475
  formElement.removeEventListener('submit', this._submitHandler);
363
476
  }
364
477
  // Create and store the submit handler
365
478
  this._submitHandler = async (e) => {
366
479
  const stripe = this.stripeService.getStripe();
367
- const isCheckoutSession = this.stripeService.state.isCheckoutSession;
368
- if (!stripe) {
480
+ const isCheckoutSession = this.stripeService.state.isCheckoutSession === true;
481
+ if (stripe == null) {
369
482
  console.error('Stripe not properly initialized');
370
483
  return;
371
484
  }
372
- // Build submit event props based on mode
373
- const submitEventProps = {
485
+ // Build submit event props based on mode (shared with formSubmitEventHandler)
486
+ const result = buildSubmitEventProps({
374
487
  stripe,
375
- };
376
- if (isCheckoutSession) {
377
- // Checkout Session mode
378
- const checkout = this.stripeService.getCheckout();
379
- if (!checkout) {
380
- console.error('Checkout not properly initialized');
381
- return;
382
- }
383
- submitEventProps.checkout = checkout;
384
- submitEventProps.checkoutSessionClientSecret = this.checkoutSessionClientSecret;
385
- }
386
- else {
387
- // Payment Intent / Setup Intent mode
388
- const elements = this.stripeService.getElements();
389
- if (!elements) {
390
- console.error('Elements not properly initialized');
391
- return;
392
- }
393
- submitEventProps.elements = elements;
394
- submitEventProps.intentClientSecret = this.intentClientSecret;
488
+ isCheckoutSession,
489
+ checkout: this.stripeService.getCheckout(),
490
+ checkoutSessionClientSecret: this.checkoutSessionClientSecret,
491
+ elements: this.stripeService.getElements(),
492
+ intentClientSecret: this.intentClientSecret,
493
+ });
494
+ if ('error' in result) {
495
+ console.error(result.error);
496
+ return;
395
497
  }
498
+ const submitEventProps = result.props;
396
499
  this.progress = 'loading';
397
500
  try {
398
- if (this.handleSubmit) {
501
+ if (this.handleSubmit != null) {
399
502
  await this.handleSubmit(e, submitEventProps);
400
503
  }
401
504
  else if (this.shouldUseDefaultFormSubmitAction === true) {
402
- if (isCheckoutSession && submitEventProps.checkout) {
505
+ if (isCheckoutSession && submitEventProps.checkout != null) {
403
506
  // Use Checkout Session confirmation
404
507
  await this.checkoutSessionFormSubmitAction(e, submitEventProps.checkout);
405
508
  }
406
- else if (this.intentClientSecret) {
509
+ else if (this.intentClientSecret != null && this.intentClientSecret !== '') {
407
510
  // Use Payment Intent / Setup Intent confirmation
408
511
  await this.defaultFormSubmitAction(e, submitEventProps);
409
512
  }
@@ -415,7 +518,7 @@ const StripePaymentElement = class {
415
518
  e.preventDefault();
416
519
  }
417
520
  await this.formSubmitEventHandler();
418
- if (this.handleSubmit || this.shouldUseDefaultFormSubmitAction === true) {
521
+ if (this.handleSubmit != null || this.shouldUseDefaultFormSubmitAction === true) {
419
522
  this.progress = 'success';
420
523
  }
421
524
  }
@@ -433,9 +536,9 @@ const StripePaymentElement = class {
433
536
  disconnectedCallback() {
434
537
  this.paymentElementManager.unmount();
435
538
  // Remove event listener to prevent memory leaks
436
- if (this._submitHandler) {
539
+ if (this._submitHandler != null) {
437
540
  const formElement = this.el.querySelector('#stripe-payment-element');
438
- if (formElement) {
541
+ if (formElement != null) {
439
542
  formElement.removeEventListener('submit', this._submitHandler);
440
543
  }
441
544
  }
@@ -446,22 +549,35 @@ const StripePaymentElement = class {
446
549
  if (loadStripeStatus === 'failure') {
447
550
  return h("p", null, i18n.t('Failed to load Stripe'));
448
551
  }
449
- // Determine if button should be disabled
450
- // For Checkout Session mode: check if checkout is initialized (loadStripeStatus === 'success')
451
- // For Payment Intent mode: check if intentClientSecret is set
452
- const hasValidSecret = isCheckoutSession ? loadStripeStatus === 'success' : !!this.intentClientSecret;
453
- const disabled = this.progress === 'loading' || !hasValidSecret;
454
- return (h("div", { class: "stripe-payment-sheet-wrap" }, h("form", { id: "stripe-payment-element" }, h("div", { class: "stripe-heading" }, i18n.t(this.sheetTitle)), h("div", null, h("div", { class: "stripe-section-title" }, i18n.t('Payment information'))), h("div", { class: "payment-info visible" }, h("div", { id: "payment-element" })), h("div", { id: "payment-errors", class: "stripe-element-errors" }, errorMessage), h("div", { style: { marginTop: '32px' } }, h("button", { type: "submit", disabled: disabled }, this.progress === 'loading' ? i18n.t('Loading') : i18n.t(this.buttonLabel))))));
552
+ // Determine if button should be disabled (see isSubmitButtonDisabled helper for mode-specific rules)
553
+ const disabled = isSubmitButtonDisabled({
554
+ progress: this.progress,
555
+ isCheckoutSession: isCheckoutSession === true,
556
+ loadStripeStatus,
557
+ intentClientSecret: this.intentClientSecret,
558
+ });
559
+ return (
560
+ // NOTE: `stripe-payment-sheet-wrap` is a legacy CSS class kept for backward compatibility.
561
+ // It is a leftover from a former component name but is part of the public DOM contract,
562
+ // so external stylesheets may target it. Keep it in the rendered output and the .scss.
563
+ h("div", { class: "stripe-payment-sheet-wrap" }, h("form", { id: "stripe-payment-element" }, h("div", { class: "stripe-heading" }, i18n.t(this.sheetTitle)), h("div", null, h("div", { class: "stripe-section-title" }, i18n.t('Payment information'))), h("div", { class: "payment-info visible" }, h("div", { id: "payment-element" })), h("div", { id: "payment-errors", class: "stripe-element-errors" }, errorMessage), h("div", { style: { marginTop: '32px' } }, h("button", { type: "submit", disabled: disabled }, this.progress === 'loading' ? i18n.t('Loading') : i18n.t(this.buttonLabel))))));
455
564
  }
456
565
  get el() { return getElement(this); }
457
566
  static get watchers() { return {
458
- "publishableKey": ["updatePublishableKey"],
459
- "stripeAccount": ["updateStripeAccountId"],
460
- "intentClientSecret": ["updateIntentClientSecret"],
461
- "checkoutSessionClientSecret": ["updateCheckoutSessionClientSecret"]
567
+ "publishableKey": [{
568
+ "updatePublishableKey": 0
569
+ }],
570
+ "stripeAccount": [{
571
+ "updateStripeAccountId": 0
572
+ }],
573
+ "intentClientSecret": [{
574
+ "updateIntentClientSecret": 0
575
+ }],
576
+ "checkoutSessionClientSecret": [{
577
+ "updateCheckoutSessionClientSecret": 0
578
+ }]
462
579
  }; }
463
580
  };
464
- StripePaymentElement.style = stripePaymentElementCss;
581
+ StripePaymentElement.style = stripePaymentElementCss();
465
582
 
466
583
  export { StripePaymentElement as stripe_payment_element };
467
- //# sourceMappingURL=stripe-payment-element.entry.js.map