@forgeroute/ui 0.5.19 → 0.5.20

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.
@@ -11065,9 +11065,32 @@ i0.ɵɵngDeclareClassMetadata({
11065
11065
  }]
11066
11066
  }
11067
11067
  });
11068
- const connectSdkImporter = { load: () => import("@stripe/connect-js") };
11068
+ const STRIPE_CONNECT_SCRIPT_URL = "https://connect-js.stripe.com/v1.0/connect.js";
11069
+ let connectScript = null;
11070
+ function loadConnectScript() {
11071
+ const existing = globalThis.StripeConnect;
11072
+ if (existing) return Promise.resolve(existing);
11073
+ connectScript ??= new Promise((resolve, reject) => {
11074
+ const fail = (message) => {
11075
+ connectScript = null;
11076
+ reject(new Error(message));
11077
+ };
11078
+ const script = document.createElement("script");
11079
+ script.src = STRIPE_CONNECT_SCRIPT_URL;
11080
+ script.async = true;
11081
+ script.onload = () => {
11082
+ const sdk = globalThis.StripeConnect;
11083
+ if (sdk) resolve(sdk);
11084
+ else fail("Stripe Connect.js did not load");
11085
+ };
11086
+ script.onerror = () => fail("Stripe Connect.js could not be loaded");
11087
+ document.head.appendChild(script);
11088
+ });
11089
+ return connectScript;
11090
+ }
11091
+ const connectSdkImporter = { load: () => loadConnectScript() };
11069
11092
  const defaultStripeConnectLoader = async (options) => {
11070
- const instance = (await connectSdkImporter.load()).loadConnectAndInitialize({
11093
+ const instance = (await connectSdkImporter.load()).init({
11071
11094
  publishableKey: options.publishableKey,
11072
11095
  fetchClientSecret: options.fetchClientSecret,
11073
11096
  ...options.appearance ? { appearance: options.appearance } : {}