stripe-pwa-elements 4.0.2 → 4.0.4

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 (72) hide show
  1. package/dist/cjs/{factory-tenFFIul.js → factory-Cm6zUD7R.js} +7 -1
  2. package/dist/cjs/{i18n-FhEOc8vz.js → i18n-lBbOeQt4.js} +6 -0
  3. package/dist/cjs/ion-icon_2.cjs.entry.js +5 -3
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/stripe-address-element.cjs.entry.js +2 -2
  6. package/dist/cjs/stripe-card-element.cjs.entry.js +13 -3
  7. package/dist/cjs/stripe-currency-selector.cjs.entry.js +2 -2
  8. package/dist/cjs/stripe-elements.cjs.js +1 -1
  9. package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +2 -2
  10. package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +2 -2
  11. package/dist/cjs/stripe-payment-element.cjs.entry.js +11 -3
  12. package/dist/cjs/{stripe-payment-element.helpers-DukP33RI.js → stripe-payment-element.helpers-lafmSRmb.js} +7 -8
  13. package/dist/cjs/stripe-payment-sheet.cjs.entry.js +516 -35
  14. package/dist/collection/components/stripe-address-element/stripe-address-element.js +2 -2
  15. package/dist/collection/components/stripe-card-element/stripe-card-element.js +11 -1
  16. package/dist/collection/components/stripe-modal/stripe-modal.css +4 -0
  17. package/dist/collection/components/stripe-modal/stripe-modal.js +3 -1
  18. package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +7 -8
  19. package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +12 -4
  20. package/dist/collection/components/stripe-payment-sheet/payment-sheet-state.js +21 -7
  21. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.checkout.js +94 -0
  22. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.helpers.js +193 -9
  23. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js +240 -21
  24. package/dist/collection/services/link-authentication-element-manager.js +5 -0
  25. package/dist/collection/utils/i18n.js +6 -0
  26. package/dist/components/factory.js +1 -1
  27. package/dist/components/i18n.js +1 -1
  28. package/dist/components/stripe-card-element2.js +1 -1
  29. package/dist/components/stripe-modal2.js +1 -1
  30. package/dist/components/stripe-payment-element.helpers.js +1 -1
  31. package/dist/components/stripe-payment-element.js +1 -1
  32. package/dist/components/stripe-payment-sheet.js +1 -1
  33. package/dist/esm/{factory-Cd6OGTWN.js → factory-BaGv8K_i.js} +7 -2
  34. package/dist/esm/{i18n-B6JoQetF.js → i18n-CL5n3bOb.js} +6 -0
  35. package/dist/esm/ion-icon_2.entry.js +5 -3
  36. package/dist/esm/loader.js +1 -1
  37. package/dist/esm/stripe-address-element.entry.js +2 -2
  38. package/dist/esm/stripe-card-element.entry.js +13 -3
  39. package/dist/esm/stripe-currency-selector.entry.js +2 -2
  40. package/dist/esm/stripe-elements.js +1 -1
  41. package/dist/esm/stripe-express-checkout-element.entry.js +2 -2
  42. package/dist/esm/stripe-link-authentication-element.entry.js +2 -2
  43. package/dist/esm/stripe-payment-element.entry.js +11 -3
  44. package/dist/esm/{stripe-payment-element.helpers-CipV87b8.js → stripe-payment-element.helpers-CklK5RlF.js} +7 -8
  45. package/dist/esm/stripe-payment-sheet.entry.js +516 -35
  46. package/dist/stripe-elements/{p-f892e375.entry.js → p-2e41699e.entry.js} +1 -1
  47. package/dist/stripe-elements/{p-6a9c8b7a.entry.js → p-3fc4583a.entry.js} +1 -1
  48. package/dist/stripe-elements/p-5d3d93ec.entry.js +1 -0
  49. package/dist/stripe-elements/p-7a8f783c.entry.js +1 -0
  50. package/dist/stripe-elements/{p-915b86ed.entry.js → p-7e826964.entry.js} +1 -1
  51. package/dist/stripe-elements/p-BoZLkOAy.js +1 -0
  52. package/dist/stripe-elements/p-CL5n3bOb.js +1 -0
  53. package/dist/stripe-elements/{p-C7MQk9FK.js → p-DlMEZwSe.js} +1 -1
  54. package/dist/stripe-elements/{p-5338bc5e.entry.js → p-b62c9dae.entry.js} +1 -1
  55. package/dist/stripe-elements/p-b69f6103.entry.js +1 -0
  56. package/dist/stripe-elements/{p-7fe4a287.entry.js → p-f5552c81.entry.js} +1 -1
  57. package/dist/stripe-elements/stripe-elements.esm.js +1 -1
  58. package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +1 -0
  59. package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +9 -2
  60. package/dist/types/components/stripe-payment-sheet/payment-sheet-state.d.ts +21 -4
  61. package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.checkout.d.ts +39 -0
  62. package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.d.ts +50 -5
  63. package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.helpers.d.ts +66 -8
  64. package/dist/types/components.d.ts +22 -9
  65. package/dist/types/services/interfaces.d.ts +2 -0
  66. package/package.json +4 -2
  67. package/readme.md +78 -27
  68. package/dist/stripe-elements/p-B6JoQetF.js +0 -1
  69. package/dist/stripe-elements/p-DFAhQS0n.js +0 -1
  70. package/dist/stripe-elements/p-b06a254f.entry.js +0 -1
  71. package/dist/stripe-elements/p-b91c4fa7.entry.js +0 -1
  72. package/dist/stripe-elements/p-e7372ca7.entry.js +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  var index = require('./index-Dkb0SxZc.js');
4
4
  var index$1 = require('./index-CYbA1N_k.js');
5
- var i18n = require('./i18n-FhEOc8vz.js');
5
+ var i18n = require('./i18n-lBbOeQt4.js');
6
6
 
7
7
  const appendToMap = (map, propName, value) => {
8
8
  let refs = map.get(propName);
@@ -807,6 +807,7 @@ class LinkAuthenticationElementManager {
807
807
  this.store = createStore({
808
808
  errorMessage: '',
809
809
  email: undefined,
810
+ complete: undefined,
810
811
  });
811
812
  }
812
813
  /**
@@ -839,6 +840,9 @@ class LinkAuthenticationElementManager {
839
840
  if (this.linkAuthenticationElement != null) {
840
841
  this.unmount();
841
842
  }
843
+ // The values of a previous element do not apply to the new one
844
+ this.store.set('email', undefined);
845
+ this.store.set('complete', undefined);
842
846
  // Create link authentication element
843
847
  const linkAuthentication = elements.create('linkAuthentication', options);
844
848
  const linkAuthenticationElementDiv = await findElement(containerElement, '#link-authentication-element');
@@ -849,6 +853,7 @@ class LinkAuthenticationElementManager {
849
853
  // Unconditionally set email from event.value.email
850
854
  // This handles all cases: valid email, empty string, or undefined
851
855
  this.store.set('email', (_a = event.value) === null || _a === void 0 ? void 0 : _a.email);
856
+ this.store.set('complete', event.complete);
852
857
  });
853
858
  this.linkAuthenticationElement = linkAuthentication;
854
859
  return this.linkAuthenticationElement;
@@ -1197,4 +1202,5 @@ class ServiceFactory {
1197
1202
  */
1198
1203
  const serviceFactory = new ServiceFactory();
1199
1204
 
1205
+ exports.findElement = findElement;
1200
1206
  exports.serviceFactory = serviceFactory;
@@ -2794,6 +2794,9 @@ instance.use(Browser).init({
2794
2794
  'Payment information': '支払情報',
2795
2795
  'Billing address': '請求先住所',
2796
2796
  'Save': '保存',
2797
+ 'Please complete your billing address.': '請求先住所を入力してください。',
2798
+ 'Please enter your email address.': 'メールアドレスを入力してください。',
2799
+ 'Please enter a valid email address.': '有効なメールアドレスを入力してください。',
2797
2800
  },
2798
2801
  },
2799
2802
  'pt-BR': {
@@ -2811,6 +2814,9 @@ instance.use(Browser).init({
2811
2814
  'Country or region': 'País ou região',
2812
2815
  'Postal Code': 'Cep',
2813
2816
  'Close': 'Fechar',
2817
+ 'Please complete your billing address.': 'Preencha seu endereço de cobrança.',
2818
+ 'Please enter your email address.': 'Informe seu endereço de e-mail.',
2819
+ 'Please enter a valid email address.': 'Informe um endereço de e-mail válido.',
2814
2820
  },
2815
2821
  },
2816
2822
  },
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Dkb0SxZc.js');
4
- var i18n = require('./i18n-FhEOc8vz.js');
4
+ var i18n = require('./i18n-lBbOeQt4.js');
5
5
 
6
6
  let CACHED_MAP;
7
7
  const getIconMap = () => {
@@ -506,7 +506,7 @@ const getDeepActiveElement = (doc = document) => {
506
506
  return active;
507
507
  };
508
508
 
509
- const stripeModalCss = () => `: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}:host{box-sizing:border-box}:host *: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}:host button{cursor:pointer}:host{display:block}.modal-row{opacity:0;pointer-events:none;will-change:transform;visibility:hidden}.modal-row.open{opacity:1;pointer-events:auto;visibility:visible;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1ch;background:rgba(0, 0, 0, 0.3)}.modal-row .modal-child{transform:translateY(100%);transition:transform 420ms ease;position:relative}.modal-row .modal-child .modal-loading{display:none;position:absolute;top:160px;left:50%;transform:translateX(-50%);width:24px;height:24px}.modal-row .modal-child.loading .modal-loading{display:flex;justify-content:center;align-items:center}.modal-row .modal-child.loading .modal-loading svg{width:24px;height:24px}.modal-row .modal-child.loading .modal-content{visibility:hidden}.modal-row.open .modal-child{transform:translateY(0%)}.modal-child{padding:16px 8px 24px;background-color:#fff;width:100%}.modal-close-button-wrap{padding-left:8px}.modal-close-button-wrap .modal-close-button{display:block;width:32px;cursor:pointer;border-radius:4px}.modal-close-button-wrap .modal-close-button:focus-visible{outline:2px solid var(--color-label, #000);outline-offset:2px}.modal-close-button-wrap .modal-close-button ion-icon{width:32px;display:block;fill:var(--color-label)}.modal-child:focus{outline:none}.focus-guard{position:absolute;width:1px;height:1px;overflow:hidden}`;
509
+ const stripeModalCss = () => `: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}:host{box-sizing:border-box}:host *: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}:host button{cursor:pointer}:host{display:block}.modal-row{opacity:0;pointer-events:none;will-change:transform;visibility:hidden}.modal-row.open{opacity:1;pointer-events:auto;visibility:visible;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1ch;background:rgba(0, 0, 0, 0.3)}.modal-row .modal-child{transform:translateY(100%);transition:transform 420ms ease;position:relative}.modal-row .modal-child .modal-loading{display:none;position:absolute;top:160px;left:50%;transform:translateX(-50%);width:24px;height:24px}.modal-row .modal-child.loading .modal-loading{display:flex;justify-content:center;align-items:center}.modal-row .modal-child.loading .modal-loading svg{width:24px;height:24px}.modal-row .modal-child.loading .modal-content{visibility:hidden}.modal-row.open .modal-child{transform:translateY(0%)}.modal-child{padding:16px 8px 24px;background-color:#fff;width:100%;max-height:100vh;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain}.modal-close-button-wrap{padding-left:8px}.modal-close-button-wrap .modal-close-button{display:block;width:32px;cursor:pointer;border-radius:4px}.modal-close-button-wrap .modal-close-button:focus-visible{outline:2px solid var(--color-label, #000);outline-offset:2px}.modal-close-button-wrap .modal-close-button ion-icon{width:32px;display:block;fill:var(--color-label)}.modal-child:focus{outline:none}.focus-guard{position:absolute;width:1px;height:1px;overflow:hidden}`;
510
510
 
511
511
  const StripeModal = class {
512
512
  constructor(hostRef) {
@@ -694,6 +694,8 @@ const StripeModal = class {
694
694
  return;
695
695
  }
696
696
  const modalChild = this.el.shadowRoot.querySelector('.modal-child');
697
+ // The panel stays in the DOM while closed and keeps its scroll position; start each opening at the top (title, close button)
698
+ modalChild.scrollTop = 0;
697
699
  modalChild.classList.add('loading');
698
700
  modalChild.style.willChange = 'transform';
699
701
  modalChild.addEventListener('transitionend', () => {
@@ -708,7 +710,7 @@ const StripeModal = class {
708
710
  render() {
709
711
  const { renderedOpen, showCloseButton } = this;
710
712
  const guardTabIndex = renderedOpen ? 0 : -1;
711
- return (index.h(index.Host, { key: '684539aa83388bec518e73bbd8aa19e73cfde07d', role: renderedOpen ? 'dialog' : undefined, "aria-modal": renderedOpen ? 'true' : undefined, onKeyDown: this.handleKeyDown, onFocusin: this.handleFocusIn }, index.h("div", { key: 'db6f1088c1ef7e35aefba06faaf3e9c2dcaa3419', class: `modal-row${renderedOpen ? ' open' : ''}`, onClick: () => this.closeModal() }, index.h("div", { key: '89c783c793261566b77ba962da730a973e8cbd8d', class: "modal-child", tabindex: "-1", ref: el => (this.dialogElement = el), onClick: e => e.stopPropagation() }, index.h("div", { key: '0e329b32c25509134f5a25adb266b03dd0bd71d8', class: "focus-guard", tabindex: guardTabIndex, onFocus: this.handleStartGuardFocus }), showCloseButton ? (index.h("div", { class: "modal-close-button-wrap" }, index.h("button", { type: "button", class: "modal-close-button", "aria-label": i18n.i18n.t('Close'), ref: el => (this.closeButtonElement = el), onClick: () => this.closeModal() }, index.h("ion-icon", { name: "close", size: "large", "aria-hidden": "true" })))) : null, index.h("div", { key: 'f2b5dcbc72ba3178dd920ceecd4fd339f69598d7', class: "modal-loading" }, index.h("svg", { key: '1f7afb6cc48be8fc84f9b69678f2c8ca1e2b145e', version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2400 2400" }, index.h("g", { key: 'ed40edfeabe02bf198b194eb04777e1f4a6b203e', "stroke-width": "200", "stroke-linecap": "round", stroke: "currentColor", fill: "none", id: "spinner" }, index.h("line", { key: '03c9170ee9e566227fddcc9037a92c48ed954b89', x1: "1200", y1: "600", x2: "1200", y2: "100" }), index.h("line", { key: '302aec0abf20ee8afe66245ecbc9d5e2adbade82', opacity: "0.5", x1: "1200", y1: "2300", x2: "1200", y2: "1800" }), index.h("line", { key: 'd3bea8de4d689a5c5c423a72dd23a0fbc64c29dd', opacity: "0.917", x1: "900", y1: "680.4", x2: "650", y2: "247.4" }), index.h("line", { key: '543e33091e87bf85c3a0e4d4881babdffbe4b825', opacity: "0.417", x1: "1750", y1: "2152.6", x2: "1500", y2: "1719.6" }), index.h("line", { key: '5c2e0a3722955a8ee17b57f3061097f18681ba7e', opacity: "0.833", x1: "680.4", y1: "900", x2: "247.4", y2: "650" }), index.h("line", { key: '1100d48a500bfca6075243cf69be9e6f575bdae6', opacity: "0.333", x1: "2152.6", y1: "1750", x2: "1719.6", y2: "1500" }), index.h("line", { key: '6c3f7c309a5ed15c6ffce11925efe09dbc8e6f3b', opacity: "0.75", x1: "600", y1: "1200", x2: "100", y2: "1200" }), index.h("line", { key: '7708c31b141f3a151e8dc78c89b20442f34ce1e2', opacity: "0.25", x1: "2300", y1: "1200", x2: "1800", y2: "1200" }), index.h("line", { key: 'd419fc4006e8063f9bbc35b4cb2a9a88010c623a', opacity: "0.667", x1: "680.4", y1: "1500", x2: "247.4", y2: "1750" }), index.h("line", { key: '78ccaf11a6e7c3183d210b787ce9374bd7c4aff4', opacity: "0.167", x1: "2152.6", y1: "650", x2: "1719.6", y2: "900" }), index.h("line", { key: 'acb1444de9fcd9aa1a3182d759d3b8aeb0906284', opacity: "0.583", x1: "900", y1: "1719.6", x2: "650", y2: "2152.6" }), index.h("line", { key: '6adef9d6a54f302c8da7c84cae32851723ce25cc', opacity: "0.083", x1: "1750", y1: "247.4", x2: "1500", y2: "680.4" }), index.h("animateTransform", { key: '7acf982514091f6c3ec9bd4ddfc660f3286ddd4e', attributeName: "transform", attributeType: "XML", type: "rotate", keyTimes: "0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667", values: "0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199", dur: "0.83333s", begin: "0s", repeatCount: "indefinite", calcMode: "discrete" })))), index.h("div", { key: '120bebc59c0fc013cb2bfbaf8957ad3731e1ddf4', class: "modal-content", ref: el => (this.contentElement = el) }, index.h("slot", { key: '0f371823f8fddd61e2b0ce24a59477103d979875' })), index.h("div", { key: 'fa8436f70871d59055dab2cf0fcfe5d4577328c1', class: "focus-guard", tabindex: guardTabIndex, onFocus: this.handleEndGuardFocus })))));
713
+ return (index.h(index.Host, { key: '55e0d63b18df165313ea3dd8b8f17aa0e0d0a253', role: renderedOpen ? 'dialog' : undefined, "aria-modal": renderedOpen ? 'true' : undefined, onKeyDown: this.handleKeyDown, onFocusin: this.handleFocusIn }, index.h("div", { key: 'adb0b493c0ae525f275025c03e1b8f02b04de1af', class: `modal-row${renderedOpen ? ' open' : ''}`, onClick: () => this.closeModal() }, index.h("div", { key: '478bdad2ad481bfc2d8ffcf552788292fa93daed', class: "modal-child", tabindex: "-1", ref: el => (this.dialogElement = el), onClick: e => e.stopPropagation() }, index.h("div", { key: '8cc68ecefa37ec1db65f6c910d1da40f9144e722', class: "focus-guard", tabindex: guardTabIndex, onFocus: this.handleStartGuardFocus }), showCloseButton ? (index.h("div", { class: "modal-close-button-wrap" }, index.h("button", { type: "button", class: "modal-close-button", "aria-label": i18n.i18n.t('Close'), ref: el => (this.closeButtonElement = el), onClick: () => this.closeModal() }, index.h("ion-icon", { name: "close", size: "large", "aria-hidden": "true" })))) : null, index.h("div", { key: '26271a75906a72e9944599f98da007bfebc2e348', class: "modal-loading" }, index.h("svg", { key: 'bc6b1267e2f3b6b1dd7209db55be717fddf9acd4', version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2400 2400" }, index.h("g", { key: '00ed54798ac376ed71f87a088fad2519cb1262dc', "stroke-width": "200", "stroke-linecap": "round", stroke: "currentColor", fill: "none", id: "spinner" }, index.h("line", { key: '98242d65eb9470430bd5cc656cbb479232782746', x1: "1200", y1: "600", x2: "1200", y2: "100" }), index.h("line", { key: '2e2f0538a6d048465ef5f8a3d5ed1932f6c59270', opacity: "0.5", x1: "1200", y1: "2300", x2: "1200", y2: "1800" }), index.h("line", { key: '11f850b0e7dc0d259f35f56aab17068d4d25ca95', opacity: "0.917", x1: "900", y1: "680.4", x2: "650", y2: "247.4" }), index.h("line", { key: '14c3226b5d2741902f428a208966adf016c1bb7e', opacity: "0.417", x1: "1750", y1: "2152.6", x2: "1500", y2: "1719.6" }), index.h("line", { key: 'd41da322484b62c1db1df72b9bd1bcc0dbb85a2c', opacity: "0.833", x1: "680.4", y1: "900", x2: "247.4", y2: "650" }), index.h("line", { key: '246dcdd4a011775dc8fea8a05cfcfc429d5bd03c', opacity: "0.333", x1: "2152.6", y1: "1750", x2: "1719.6", y2: "1500" }), index.h("line", { key: 'f0a2d217a33a8caa6995a30d840002cb8c076e8d', opacity: "0.75", x1: "600", y1: "1200", x2: "100", y2: "1200" }), index.h("line", { key: '7552fb2c04f85c54b8bcc2235a32690e4489177f', opacity: "0.25", x1: "2300", y1: "1200", x2: "1800", y2: "1200" }), index.h("line", { key: '7b5a62164a0ef759b057f9100c7c5af834c9f6b7', opacity: "0.667", x1: "680.4", y1: "1500", x2: "247.4", y2: "1750" }), index.h("line", { key: 'd36af9d23059da4ca91147084e47ba94e19f5ada', opacity: "0.167", x1: "2152.6", y1: "650", x2: "1719.6", y2: "900" }), index.h("line", { key: 'f8eed2a97d817b68e0b29f5b5037d34d46a79a46', opacity: "0.583", x1: "900", y1: "1719.6", x2: "650", y2: "2152.6" }), index.h("line", { key: '1641d577b703e213157bc553966e434a40ba7158', opacity: "0.083", x1: "1750", y1: "247.4", x2: "1500", y2: "680.4" }), index.h("animateTransform", { key: '60fb2d30c248db1b4195d6015dc96225a15e4010', attributeName: "transform", attributeType: "XML", type: "rotate", keyTimes: "0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667", values: "0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199", dur: "0.83333s", begin: "0s", repeatCount: "indefinite", calcMode: "discrete" })))), index.h("div", { key: '27d3b71da43e5935dff3eff2e1bc507a24261b70', class: "modal-content", ref: el => (this.contentElement = el) }, index.h("slot", { key: '641408238d3969b830d1f3e9398be6f05bc1f65b' })), index.h("div", { key: 'c6178542b98a99d6a50b74270adc273671d5cc19', class: "focus-guard", tabindex: guardTabIndex, onFocus: this.handleEndGuardFocus })))));
712
714
  }
713
715
  get el() { return index.getElement(this); }
714
716
  static get watchers() { return {
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
6
6
  const defineCustomElements = async (win, options) => {
7
7
  if (typeof window === 'undefined') return undefined;
8
8
  await appGlobals.globalScripts();
9
- return index.bootstrapLazy([["stripe-card-element-modal.cjs",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-payment-sheet.cjs",[[0,"stripe-payment-sheet",{"publishableKey":[1,"publishable-key"],"intentClientSecret":[1,"intent-client-secret"],"stripeAccount":[1,"stripe-account"],"open":[1540],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"applicationName":[1,"application-name"],"options":[16],"sheet":[32],"visible":[32],"errorMessage":[32],"present":[64]},null,{"publishableKey":[{"handleSecretChange":0}],"intentClientSecret":[{"handleSecretChange":0}],"stripeAccount":[{"handleSecretChange":0}],"open":[{"handleOpenChange":0}]}]]],["stripe-address-element.cjs",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector.cjs",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element.cjs",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element.cjs",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element.cjs",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["stripe-payment-request-button.cjs",[[260,"stripe-payment-request-button",{"paymentMethodEventHandler":[16],"shippingOptionEventHandler":[16],"shippingAddressEventHandler":[16],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"stripeDidLoaded":[1040],"loadStripeStatus":[32],"stripe":[32],"paymentRequestOption":[32],"isAvailable":[64],"setPaymentMethodEventHandler":[64],"setPaymentRequestShippingOptionEventHandler":[64],"setPaymentRequestShippingAddressEventHandler":[64],"setPaymentRequestOption":[64],"initStripe":[64]}]]],["stripe-card-element.cjs",[[0,"stripe-card-element",{"intentType":[1,"intent-type"],"zip":[4],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"showPaymentRequestButton":[4,"show-payment-request-button"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"zipCode":[32],"paymentRequestOption":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"setPaymentRequestOption":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["ion-icon_2.cjs",[[257,"stripe-modal",{"showCloseButton":[4,"show-close-button"],"open":[1028],"renderedOpen":[32],"toggleModal":[64],"openModal":[64],"closeModal":[64]},null,{"open":[{"onOpenChange":0}]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]},null,{"name":[{"loadIcon":0}],"src":[{"loadIcon":0}],"icon":[{"loadIcon":0}],"ios":[{"loadIcon":0}],"md":[{"loadIcon":0}]}]]]], options);
9
+ return index.bootstrapLazy([["stripe-card-element-modal.cjs",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-payment-sheet.cjs",[[0,"stripe-payment-sheet",{"publishableKey":[1,"publishable-key"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"stripeAccount":[1,"stripe-account"],"open":[1540],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"applicationName":[1,"application-name"],"options":[16],"sheet":[32],"visible":[32],"errorMessage":[32],"collection":[32],"present":[64]},null,{"publishableKey":[{"handleSecretChange":0}],"intentClientSecret":[{"handleSecretChange":0}],"checkoutSessionClientSecret":[{"handleSecretChange":0}],"stripeAccount":[{"handleSecretChange":0}],"open":[{"handleOpenChange":0}]}]]],["stripe-address-element.cjs",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector.cjs",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element.cjs",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element.cjs",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element.cjs",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["stripe-payment-request-button.cjs",[[260,"stripe-payment-request-button",{"paymentMethodEventHandler":[16],"shippingOptionEventHandler":[16],"shippingAddressEventHandler":[16],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"stripeDidLoaded":[1040],"loadStripeStatus":[32],"stripe":[32],"paymentRequestOption":[32],"isAvailable":[64],"setPaymentMethodEventHandler":[64],"setPaymentRequestShippingOptionEventHandler":[64],"setPaymentRequestShippingAddressEventHandler":[64],"setPaymentRequestOption":[64],"initStripe":[64]}]]],["stripe-card-element.cjs",[[0,"stripe-card-element",{"intentType":[1,"intent-type"],"zip":[4],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"showPaymentRequestButton":[4,"show-payment-request-button"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"zipCode":[32],"paymentRequestOption":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"setPaymentRequestOption":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}]}]]],["ion-icon_2.cjs",[[257,"stripe-modal",{"showCloseButton":[4,"show-close-button"],"open":[1028],"renderedOpen":[32],"toggleModal":[64],"openModal":[64],"closeModal":[64]},null,{"open":[{"onOpenChange":0}]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]},null,{"name":[{"loadIcon":0}],"src":[{"loadIcon":0}],"icon":[{"loadIcon":0}],"ios":[{"loadIcon":0}],"md":[{"loadIcon":0}]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Dkb0SxZc.js');
4
- var i18n = require('./i18n-FhEOc8vz.js');
5
- var factory = require('./factory-tenFFIul.js');
4
+ var i18n = require('./i18n-lBbOeQt4.js');
5
+ var factory = require('./factory-Cm6zUD7R.js');
6
6
  require('./index-CYbA1N_k.js');
7
7
 
8
8
  const stripeAddressElementCss = () => `: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 #address-element{margin-top:16px}.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.address{margin-bottom:16px}.stripe-payment-sheet-wrap .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}.stripe-payment-sheet-wrap .submit-button-wrapper{margin-top:32px}.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)}`;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Dkb0SxZc.js');
4
- var i18n = require('./i18n-FhEOc8vz.js');
5
- var factory = require('./factory-tenFFIul.js');
4
+ var i18n = require('./i18n-lBbOeQt4.js');
5
+ var factory = require('./factory-Cm6zUD7R.js');
6
6
  var error = require('./error-FFC4kSs5.js');
7
7
  require('./index-CYbA1N_k.js');
8
8
 
@@ -175,6 +175,12 @@ const StripeCardElement = class {
175
175
  stripeAccount,
176
176
  });
177
177
  }
178
+ updateIntentClientSecret() {
179
+ // Card Elements are not bound to the client secret, so a new secret starts a fresh payment
180
+ if (this.progress === 'success') {
181
+ this.progress = '';
182
+ }
183
+ }
178
184
  /**
179
185
  * @param option
180
186
  * @private
@@ -418,7 +424,8 @@ const StripeCardElement = class {
418
424
  if (loadStripeStatus === 'failure') {
419
425
  return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
420
426
  }
421
- const disabled = this.progress === 'loading';
427
+ // A succeeded intent cannot be confirmed again, so the form must not accept a second submit
428
+ const disabled = this.progress === 'loading' || this.progress === 'success';
422
429
  return (
423
430
  // NOTE: `stripe-payment-sheet-wrap` is a legacy class name (leftover from a former
424
431
  // component name). External consumers may target it in their own CSS, so it is a
@@ -434,6 +441,9 @@ const StripeCardElement = class {
434
441
  }],
435
442
  "stripeAccount": [{
436
443
  "updateStripeAccountId": 0
444
+ }],
445
+ "intentClientSecret": [{
446
+ "updateIntentClientSecret": 0
437
447
  }]
438
448
  }; }
439
449
  };
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Dkb0SxZc.js');
4
- var i18n = require('./i18n-FhEOc8vz.js');
5
- var factory = require('./factory-tenFFIul.js');
4
+ var i18n = require('./i18n-lBbOeQt4.js');
5
+ var factory = require('./factory-Cm6zUD7R.js');
6
6
  require('./index-CYbA1N_k.js');
7
7
 
8
8
  const stripeCurrencySelectorCss = () => `: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}:host{box-sizing:border-box}:host *: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}:host button{cursor:pointer}:host{display:block;width:100%}.stripe-currency-selector-wrap{width:100%;padding:0;margin:0}.stripe-currency-selector-wrap #currency-selector{width:100%;min-height:40px}.stripe-currency-selector-wrap #currency-selector-errors{margin-top:8px}`;
@@ -46,7 +46,7 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
46
46
 
47
47
  patchBrowser().then(async (options) => {
48
48
  await appGlobals.globalScripts();
49
- return index.bootstrapLazy([["stripe-card-element-modal.cjs",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-payment-sheet.cjs",[[0,"stripe-payment-sheet",{"publishableKey":[1,"publishable-key"],"intentClientSecret":[1,"intent-client-secret"],"stripeAccount":[1,"stripe-account"],"open":[1540],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"applicationName":[1,"application-name"],"options":[16],"sheet":[32],"visible":[32],"errorMessage":[32],"present":[64]},null,{"publishableKey":[{"handleSecretChange":0}],"intentClientSecret":[{"handleSecretChange":0}],"stripeAccount":[{"handleSecretChange":0}],"open":[{"handleOpenChange":0}]}]]],["stripe-address-element.cjs",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector.cjs",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element.cjs",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element.cjs",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element.cjs",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["stripe-payment-request-button.cjs",[[260,"stripe-payment-request-button",{"paymentMethodEventHandler":[16],"shippingOptionEventHandler":[16],"shippingAddressEventHandler":[16],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"stripeDidLoaded":[1040],"loadStripeStatus":[32],"stripe":[32],"paymentRequestOption":[32],"isAvailable":[64],"setPaymentMethodEventHandler":[64],"setPaymentRequestShippingOptionEventHandler":[64],"setPaymentRequestShippingAddressEventHandler":[64],"setPaymentRequestOption":[64],"initStripe":[64]}]]],["stripe-card-element.cjs",[[0,"stripe-card-element",{"intentType":[1,"intent-type"],"zip":[4],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"showPaymentRequestButton":[4,"show-payment-request-button"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"zipCode":[32],"paymentRequestOption":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"setPaymentRequestOption":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["ion-icon_2.cjs",[[257,"stripe-modal",{"showCloseButton":[4,"show-close-button"],"open":[1028],"renderedOpen":[32],"toggleModal":[64],"openModal":[64],"closeModal":[64]},null,{"open":[{"onOpenChange":0}]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]},null,{"name":[{"loadIcon":0}],"src":[{"loadIcon":0}],"icon":[{"loadIcon":0}],"ios":[{"loadIcon":0}],"md":[{"loadIcon":0}]}]]]], options);
49
+ return index.bootstrapLazy([["stripe-card-element-modal.cjs",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-payment-sheet.cjs",[[0,"stripe-payment-sheet",{"publishableKey":[1,"publishable-key"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"stripeAccount":[1,"stripe-account"],"open":[1540],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"applicationName":[1,"application-name"],"options":[16],"sheet":[32],"visible":[32],"errorMessage":[32],"collection":[32],"present":[64]},null,{"publishableKey":[{"handleSecretChange":0}],"intentClientSecret":[{"handleSecretChange":0}],"checkoutSessionClientSecret":[{"handleSecretChange":0}],"stripeAccount":[{"handleSecretChange":0}],"open":[{"handleOpenChange":0}]}]]],["stripe-address-element.cjs",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector.cjs",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element.cjs",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element.cjs",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element.cjs",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["stripe-payment-request-button.cjs",[[260,"stripe-payment-request-button",{"paymentMethodEventHandler":[16],"shippingOptionEventHandler":[16],"shippingAddressEventHandler":[16],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"stripeDidLoaded":[1040],"loadStripeStatus":[32],"stripe":[32],"paymentRequestOption":[32],"isAvailable":[64],"setPaymentMethodEventHandler":[64],"setPaymentRequestShippingOptionEventHandler":[64],"setPaymentRequestShippingAddressEventHandler":[64],"setPaymentRequestOption":[64],"initStripe":[64]}]]],["stripe-card-element.cjs",[[0,"stripe-card-element",{"intentType":[1,"intent-type"],"zip":[4],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"showPaymentRequestButton":[4,"show-payment-request-button"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"zipCode":[32],"paymentRequestOption":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"setPaymentRequestOption":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}]}]]],["ion-icon_2.cjs",[[257,"stripe-modal",{"showCloseButton":[4,"show-close-button"],"open":[1028],"renderedOpen":[32],"toggleModal":[64],"openModal":[64],"closeModal":[64]},null,{"open":[{"onOpenChange":0}]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]},null,{"name":[{"loadIcon":0}],"src":[{"loadIcon":0}],"icon":[{"loadIcon":0}],"ios":[{"loadIcon":0}],"md":[{"loadIcon":0}]}]]]], options);
50
50
  });
51
51
 
52
52
  exports.setNonce = index.setNonce;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Dkb0SxZc.js');
4
- var i18n = require('./i18n-FhEOc8vz.js');
5
- var factory = require('./factory-tenFFIul.js');
4
+ var i18n = require('./i18n-lBbOeQt4.js');
5
+ var factory = require('./factory-Cm6zUD7R.js');
6
6
  var error = require('./error-FFC4kSs5.js');
7
7
  require('./index-CYbA1N_k.js');
8
8
 
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Dkb0SxZc.js');
4
- var i18n = require('./i18n-FhEOc8vz.js');
5
- var factory = require('./factory-tenFFIul.js');
4
+ var i18n = require('./i18n-lBbOeQt4.js');
5
+ var factory = require('./factory-Cm6zUD7R.js');
6
6
  require('./index-CYbA1N_k.js');
7
7
 
8
8
  const stripeLinkAuthenticationElementCss = () => `: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-link-authentication-wrap{box-sizing:border-box}.stripe-link-authentication-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-link-authentication-wrap button{cursor:pointer}.stripe-link-authentication-wrap{display:block;width:100%;background:#fff;padding:16px}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement{padding:8px 16px;min-height:64px;border-radius:6px;display:flex;justify-content:center;align-items:center}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement>.__PrivateStripeElement{width:100%}.stripe-link-authentication-wrap .stripe-link-authentication-container .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}`;
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Dkb0SxZc.js');
4
- var i18n = require('./i18n-FhEOc8vz.js');
5
- var factory = require('./factory-tenFFIul.js');
6
- var stripePaymentElement_helpers = require('./stripe-payment-element.helpers-DukP33RI.js');
4
+ var i18n = require('./i18n-lBbOeQt4.js');
5
+ var factory = require('./factory-Cm6zUD7R.js');
6
+ var stripePaymentElement_helpers = require('./stripe-payment-element.helpers-lafmSRmb.js');
7
7
  require('./index-CYbA1N_k.js');
8
8
  require('./error-FFC4kSs5.js');
9
9
 
@@ -128,6 +128,10 @@ const StripePaymentElement = class {
128
128
  return;
129
129
  }
130
130
  await this.initStripe(publishableKey, { stripeAccount });
131
+ // A new secret starts a fresh payment, so re-enable the submit button after a previous success
132
+ if (this.progress === 'success') {
133
+ this.progress = '';
134
+ }
131
135
  }
132
136
  async updateCheckoutSessionClientSecret(newValue) {
133
137
  // Re-initialize with checkout session when client secret changes
@@ -135,6 +139,10 @@ const StripePaymentElement = class {
135
139
  await this.initStripeWithCheckoutSession(this.publishableKey, newValue, {
136
140
  stripeAccount: this.stripeAccount,
137
141
  });
142
+ // A new secret starts a fresh payment, so re-enable the submit button after a previous success
143
+ if (this.progress === 'success') {
144
+ this.progress = '';
145
+ }
138
146
  }
139
147
  }
140
148
  stripeLoadedEventHandler() {
@@ -6,13 +6,15 @@ var error = require('./error-FFC4kSs5.js');
6
6
  * Determine whether the submit button should be disabled.
7
7
  * For Checkout Session mode: the checkout is ready once Stripe finished loading.
8
8
  * For Payment Intent / Setup Intent mode: an intent client secret must be present.
9
+ * The button stays disabled after a successful payment as well: the intent or
10
+ * checkout is already confirmed and cannot be submitted again.
9
11
  * @param params progress / loading state and the current mode information
10
12
  * @returns true when the submit button should be disabled
11
13
  */
12
14
  const isSubmitButtonDisabled = (params) => {
13
15
  const { progress, isCheckoutSession, loadStripeStatus, intentClientSecret } = params;
14
16
  const hasValidSecret = isCheckoutSession ? loadStripeStatus === 'success' : intentClientSecret != null && intentClientSecret !== '';
15
- return progress === 'loading' || !hasValidSecret;
17
+ return progress === 'loading' || progress === 'success' || !hasValidSecret;
16
18
  };
17
19
  /**
18
20
  * Run the default Stripe confirmation flow for Payment Intent / Setup Intent mode.
@@ -21,25 +23,22 @@ const isSubmitButtonDisabled = (params) => {
21
23
  * @param elements the Stripe Elements instance bound to the payment element
22
24
  * @param intentType the configured intent type
23
25
  * @param returnUrl the URL Stripe should redirect back to when required
26
+ * @param extraConfirmParams optional params merged into `confirmParams` (for example `payment_method_data.billing_details`)
24
27
  * @returns the confirmation result
25
28
  * @throws StripeAPIError when Stripe returns an error
26
29
  */
27
- const confirmPaymentOrSetup = async (stripe, elements, intentType, returnUrl) => {
30
+ const confirmPaymentOrSetup = async (stripe, elements, intentType, returnUrl, extraConfirmParams) => {
28
31
  const result = await (() => {
29
32
  if (intentType === 'payment') {
30
33
  return stripe.confirmPayment({
31
34
  elements,
32
- confirmParams: {
33
- return_url: returnUrl,
34
- },
35
+ confirmParams: Object.assign({ return_url: returnUrl }, extraConfirmParams),
35
36
  redirect: 'if_required',
36
37
  });
37
38
  }
38
39
  return stripe.confirmSetup({
39
40
  elements,
40
- confirmParams: {
41
- return_url: returnUrl,
42
- },
41
+ confirmParams: Object.assign({ return_url: returnUrl }, extraConfirmParams),
43
42
  redirect: 'if_required',
44
43
  });
45
44
  })();