@whop/checkout 0.0.53 → 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/static/checkout/chunk-455B5F2C.mjs +1 -0
- package/dist/static/checkout/chunk-XAIUJETM.mjs +1 -0
- package/dist/static/checkout/index.cjs +1 -1
- package/dist/static/checkout/index.js +1 -1
- package/dist/static/checkout/index.mjs +1 -1
- package/dist/static/checkout/loader.cjs +1 -1
- package/dist/static/checkout/loader.js +1 -1
- package/dist/static/checkout/loader.mjs +1 -1
- package/dist/static/checkout/react/index.cjs +1 -1
- package/dist/static/checkout/react/index.d.mts +184 -2
- package/dist/static/checkout/react/index.d.ts +184 -2
- package/dist/static/checkout/react/index.js +1 -1
- package/dist/static/checkout/react/index.mjs +1 -1
- package/dist/static/checkout/{util-Dey2PU5T.d.mts → util-ijY_vXnC.d.mts} +156 -4
- package/dist/static/checkout/{util-Dey2PU5T.d.ts → util-ijY_vXnC.d.ts} +156 -4
- package/dist/static/checkout/util.cjs +1 -1
- package/dist/static/checkout/util.d.mts +1 -1
- package/dist/static/checkout/util.d.ts +1 -1
- package/dist/static/checkout/util.js +1 -1
- package/dist/static/checkout/util.mjs +1 -1
- package/package.json +2 -2
- package/dist/static/checkout/chunk-PRDLHOR7.mjs +0 -1
|
@@ -5,6 +5,7 @@ declare global {
|
|
|
5
5
|
listening: boolean;
|
|
6
6
|
frames: Map<HTMLIFrameElement, () => void>;
|
|
7
7
|
identifiedFrames: Map<string, HTMLIFrameElement>;
|
|
8
|
+
availableCurrencies: Map<string, WhopCheckoutCurrenciesAvailable>;
|
|
8
9
|
submit: (
|
|
9
10
|
identifier: string,
|
|
10
11
|
data?: WhopCheckoutSubmitDetails,
|
|
@@ -27,6 +28,14 @@ declare global {
|
|
|
27
28
|
address: WhopCheckoutAddress,
|
|
28
29
|
timeout?: number,
|
|
29
30
|
) => Promise<void>;
|
|
31
|
+
setDisplayCurrency: (
|
|
32
|
+
identifier: string,
|
|
33
|
+
currency: string,
|
|
34
|
+
timeout?: number,
|
|
35
|
+
) => Promise<void>;
|
|
36
|
+
getAvailableCurrencies: (
|
|
37
|
+
identifier: string,
|
|
38
|
+
) => WhopCheckoutCurrenciesAvailable | null;
|
|
30
39
|
};
|
|
31
40
|
Plaid?: Plaid;
|
|
32
41
|
}
|
|
@@ -208,6 +217,11 @@ declare global {
|
|
|
208
217
|
}
|
|
209
218
|
|
|
210
219
|
type WhopCheckoutState = "loading" | "ready" | "disabled";
|
|
220
|
+
type WhopExpressButtonMethod = "apple-pay" | "whop-pay";
|
|
221
|
+
type WhopExpressButtonRendered = "apple-pay" | "google-pay" | "whop-pay" | "none";
|
|
222
|
+
type WhopExpressMethodResolved = {
|
|
223
|
+
rendered: WhopExpressButtonRendered;
|
|
224
|
+
};
|
|
211
225
|
type WhopCheckoutPromoCode = {
|
|
212
226
|
amount: number;
|
|
213
227
|
code: string;
|
|
@@ -216,6 +230,16 @@ type WhopCheckoutPromoCode = {
|
|
|
216
230
|
intervals: number;
|
|
217
231
|
type: string;
|
|
218
232
|
};
|
|
233
|
+
type WhopCheckoutCurrenciesAvailable = {
|
|
234
|
+
base_currency: string;
|
|
235
|
+
optional_currency: string | null;
|
|
236
|
+
current_currency: string;
|
|
237
|
+
exchange_rate: number | null;
|
|
238
|
+
};
|
|
239
|
+
type WhopCheckoutCurrencyChanged = {
|
|
240
|
+
currency: string;
|
|
241
|
+
exchange_rate: number | null;
|
|
242
|
+
};
|
|
219
243
|
type EmbeddedCheckoutBaseEvent<T extends Record<string, unknown>> = {
|
|
220
244
|
__scope: "whop-embedded-checkout";
|
|
221
245
|
event_id: string;
|
|
@@ -318,15 +342,75 @@ type WhopCheckoutMessage = {
|
|
|
318
342
|
event: "identity-captured";
|
|
319
343
|
email?: string;
|
|
320
344
|
user_id?: string;
|
|
345
|
+
} | ({
|
|
346
|
+
event: "currencies-available";
|
|
347
|
+
} & WhopCheckoutCurrenciesAvailable) | ({
|
|
348
|
+
event: "currency-changed";
|
|
349
|
+
} & WhopCheckoutCurrencyChanged) | {
|
|
350
|
+
event: "set-display-currency-result";
|
|
351
|
+
ok: true;
|
|
352
|
+
currency: string;
|
|
353
|
+
event_id: string;
|
|
354
|
+
} | {
|
|
355
|
+
event: "set-display-currency-result";
|
|
356
|
+
ok: false;
|
|
357
|
+
error: string;
|
|
358
|
+
event_id: string;
|
|
359
|
+
} | ({
|
|
360
|
+
event: "express-method-resolved";
|
|
361
|
+
} & WhopExpressMethodResolved) | {
|
|
362
|
+
event: "express-loading";
|
|
363
|
+
loading: boolean;
|
|
364
|
+
} | {
|
|
365
|
+
event: "request-overlay";
|
|
366
|
+
channelId: string;
|
|
367
|
+
} | {
|
|
368
|
+
event: "request-requirement-overlay";
|
|
369
|
+
channelId: string;
|
|
370
|
+
/**
|
|
371
|
+
* Optional pre-built URL the source iframe wants opened, so its theme /
|
|
372
|
+
* accent color / other search params can flow through to the
|
|
373
|
+
* requirement iframe. The host validates same-origin + path before
|
|
374
|
+
* using it; an invalid or missing value falls back to a URL built by
|
|
375
|
+
* `getRequirementOverlayIframeUrl`. The source iframe is responsible
|
|
376
|
+
* for stripping any `secret` — the session is bridged via BroadcastChannel.
|
|
377
|
+
*/
|
|
378
|
+
iframeSrc?: string;
|
|
379
|
+
} | {
|
|
380
|
+
event: "close-overlay";
|
|
381
|
+
channelId?: string;
|
|
321
382
|
} | PaymentRequestMerchantValidationResult | PaymentRequestUpdateRequest | PaymentRequestCreateRequest | PaymentRequestEventResult | PlaidTokenRequest | PlaidReadyEvent;
|
|
322
383
|
declare function isWhopCheckoutMessage(event: MessageEvent<unknown>): event is MessageEvent<WhopCheckoutMessage>;
|
|
323
384
|
|
|
385
|
+
/**
|
|
386
|
+
* Structural subset of `createOverlayHost`'s return value (see overlay-host.ts)
|
|
387
|
+
* — declared inline to keep util.ts free of a circular import. When an
|
|
388
|
+
* `overlayHost` is supplied, `onWhopCheckoutMessage` intercepts the host-side
|
|
389
|
+
* overlay events centrally, the same way it already intercepts payment-request
|
|
390
|
+
* and plaid. This is what makes overlay handling un-driftable across mount
|
|
391
|
+
* paths: callers can't forget the events because they're handled here and
|
|
392
|
+
* type-excluded from the callback below.
|
|
393
|
+
*/
|
|
394
|
+
interface OverlayMessageHandler {
|
|
395
|
+
handleOverlayRequest(message: {
|
|
396
|
+
event: "request-overlay";
|
|
397
|
+
channelId: string;
|
|
398
|
+
} | {
|
|
399
|
+
event: "request-requirement-overlay";
|
|
400
|
+
channelId: string;
|
|
401
|
+
iframeSrc?: string;
|
|
402
|
+
}): void;
|
|
403
|
+
handleCloseOverlay(message: {
|
|
404
|
+
channelId?: string;
|
|
405
|
+
}): void;
|
|
406
|
+
}
|
|
324
407
|
declare function onWhopCheckoutMessage(iframe: HTMLIFrameElement, callback: (message: Exclude<WhopCheckoutMessage, Extract<WhopCheckoutMessage, {
|
|
325
|
-
event: "payment-request-create-request" | "payment-request-update-request" | "plaid-token-request" | "plaid-ready";
|
|
326
|
-
}>>) => void): () => void;
|
|
408
|
+
event: "payment-request-create-request" | "payment-request-update-request" | "plaid-token-request" | "plaid-ready" | "request-overlay" | "request-requirement-overlay";
|
|
409
|
+
}>>) => void, overlayHost?: OverlayMessageHandler): () => void;
|
|
327
410
|
declare function setEmail(frame: HTMLIFrameElement, email: string, timeout?: number): Promise<void>;
|
|
328
411
|
declare function getEmail(frame: HTMLIFrameElement, timeout?: number): Promise<string>;
|
|
329
412
|
declare function setAddress(frame: HTMLIFrameElement, address: WhopCheckoutAddress, timeout?: number): Promise<void>;
|
|
413
|
+
declare function setDisplayCurrency(frame: HTMLIFrameElement, currency: string, timeout?: number): Promise<void>;
|
|
330
414
|
declare function getAddress(frame: HTMLIFrameElement, timeout?: number): Promise<{
|
|
331
415
|
address: WhopCheckoutAddress;
|
|
332
416
|
isComplete: boolean;
|
|
@@ -346,7 +430,17 @@ interface WhopEmbeddedCheckoutStyleOptions {
|
|
|
346
430
|
}
|
|
347
431
|
interface WhopEmbeddedCheckoutPrefillOptions {
|
|
348
432
|
email?: string;
|
|
433
|
+
/**
|
|
434
|
+
* **Optional** - The buyer's billing address to seed the form with. The
|
|
435
|
+
* buyer can still edit it before paying.
|
|
436
|
+
*/
|
|
349
437
|
address?: Partial<WhopCheckoutAddress>;
|
|
438
|
+
/**
|
|
439
|
+
* **Optional** - The buyer's shipping address to seed the form with. Only
|
|
440
|
+
* relevant when the plan collects a shipping address. The buyer can still
|
|
441
|
+
* edit it before paying.
|
|
442
|
+
*/
|
|
443
|
+
shippingAddress?: Partial<WhopCheckoutAddress>;
|
|
350
444
|
}
|
|
351
445
|
interface WhopEmbeddedCheckoutThemeOptions {
|
|
352
446
|
accentColor?: string;
|
|
@@ -355,12 +449,70 @@ interface WhopEmbeddedCheckoutThemeOptions {
|
|
|
355
449
|
type WhopEmbeddedCheckoutEnvironment = "production" | "sandbox";
|
|
356
450
|
declare function isWhopEmbeddedCheckoutEnvironment(environment: unknown): environment is WhopEmbeddedCheckoutEnvironment;
|
|
357
451
|
declare function toWhopEmbeddedCheckoutEnvironment(environment: unknown): WhopEmbeddedCheckoutEnvironment;
|
|
358
|
-
declare function getEmbeddedCheckoutIframeUrl(planId?: string, theme?: "light" | "dark" | "system", sessionId?: string, origin?: string, hidePrice?: boolean, skipRedirect?: boolean, utm?: Record<string, string | string[]>, styles?: WhopEmbeddedCheckoutStyleOptions, prefill?: WhopEmbeddedCheckoutPrefillOptions, themeOptions?: WhopEmbeddedCheckoutThemeOptions, hideSubmitButton?: boolean, hideTermsAndConditions?: boolean, hideEmail?: boolean, disableEmail?: boolean, hideAddressForm?: boolean, affiliateCode?: string, setupFutureUsage?: "off_session", paymentRedirectUrl?: string, stateId?: string, promoCode?: string, environment?: WhopEmbeddedCheckoutEnvironment, wuid?: string): string;
|
|
452
|
+
declare function getEmbeddedCheckoutIframeUrl(planId?: string, theme?: "light" | "dark" | "system", sessionId?: string, origin?: string, hidePrice?: boolean, skipRedirect?: boolean, utm?: Record<string, string | string[]>, styles?: WhopEmbeddedCheckoutStyleOptions, prefill?: WhopEmbeddedCheckoutPrefillOptions, themeOptions?: WhopEmbeddedCheckoutThemeOptions, hideSubmitButton?: boolean, hideTermsAndConditions?: boolean, hideEmail?: boolean, disableEmail?: boolean, hideAddressForm?: boolean, affiliateCode?: string, setupFutureUsage?: "off_session", paymentRedirectUrl?: string, stateId?: string, promoCode?: string, environment?: WhopEmbeddedCheckoutEnvironment, wuid?: string, adaptivePricing?: boolean, collectPhoneNumbers?: boolean): string;
|
|
453
|
+
/**
|
|
454
|
+
* Builds the iframe URL for the express checkout button surface.
|
|
455
|
+
*
|
|
456
|
+
* Intentionally narrower than `getEmbeddedCheckoutIframeUrl` — the express
|
|
457
|
+
* button cannot render `hide-*`, `disable-*`, or `style-*` controls and
|
|
458
|
+
* doesn't accept a `data-whop-checkout-session` (sessions are minted
|
|
459
|
+
* server-side and kept on the iframe origin, never travelling through
|
|
460
|
+
* host JS).
|
|
461
|
+
*/
|
|
462
|
+
declare function getExpressButtonIframeUrl(opts: {
|
|
463
|
+
planId?: string;
|
|
464
|
+
checkoutConfigurationId?: string;
|
|
465
|
+
paymentRedirectUrl: string;
|
|
466
|
+
theme?: "light" | "dark" | "system";
|
|
467
|
+
origin?: string;
|
|
468
|
+
utm?: Record<string, string | string[]>;
|
|
469
|
+
prefill?: WhopEmbeddedCheckoutPrefillOptions;
|
|
470
|
+
themeOptions?: WhopEmbeddedCheckoutThemeOptions;
|
|
471
|
+
affiliateCode?: string;
|
|
472
|
+
stateId?: string;
|
|
473
|
+
promoCode?: string;
|
|
474
|
+
environment?: WhopEmbeddedCheckoutEnvironment;
|
|
475
|
+
wuid?: string;
|
|
476
|
+
adaptivePricing?: boolean;
|
|
477
|
+
methods?: readonly string[];
|
|
478
|
+
setupFutureUsage?: "off_session";
|
|
479
|
+
skipRedirect?: boolean;
|
|
480
|
+
}): string;
|
|
481
|
+
/**
|
|
482
|
+
* Builds the iframe URL for a delegated requirement overlay. The route is
|
|
483
|
+
* static — the only thing it needs is the BroadcastChannel id that the
|
|
484
|
+
* requirement iframe uses to talk to the parent embed that originated the
|
|
485
|
+
* request (the session itself is pushed across the channel, not the URL).
|
|
486
|
+
*/
|
|
487
|
+
declare function getRequirementOverlayIframeUrl(opts: {
|
|
488
|
+
channelId: string;
|
|
489
|
+
theme?: "light" | "dark" | "system";
|
|
490
|
+
origin?: string;
|
|
491
|
+
environment?: WhopEmbeddedCheckoutEnvironment;
|
|
492
|
+
}): string;
|
|
493
|
+
/**
|
|
494
|
+
* Builds the iframe URL for the overlay loader. Carries only the
|
|
495
|
+
* BroadcastChannel id, theme, and environment — the session id is
|
|
496
|
+
* negotiated cross-iframe (same-origin) and never travels through host
|
|
497
|
+
* JS or this URL.
|
|
498
|
+
*/
|
|
499
|
+
declare function getOverlayLoaderIframeUrl(opts: {
|
|
500
|
+
channelId: string;
|
|
501
|
+
theme?: "light" | "dark" | "system";
|
|
502
|
+
origin?: string;
|
|
503
|
+
environment?: WhopEmbeddedCheckoutEnvironment;
|
|
504
|
+
}): string;
|
|
359
505
|
declare const EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST: string[];
|
|
360
506
|
declare const EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING = "document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";
|
|
361
507
|
declare function firePixelIdentify(data: {
|
|
362
508
|
email?: string;
|
|
363
509
|
user_id?: string;
|
|
364
510
|
}): void;
|
|
511
|
+
declare function getUtmFromCurrentUrl(): Record<string, string | string[]>;
|
|
512
|
+
/**
|
|
513
|
+
* Inject the Whop pixel tracking SDK for a given plan / checkout config.
|
|
514
|
+
* No-ops if the SDK or its script tag is already present.
|
|
515
|
+
*/
|
|
516
|
+
declare function injectPixel(planIdOrCheckoutConfigId: string): void;
|
|
365
517
|
|
|
366
|
-
export { EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST as E, type WhopCheckoutSubmitDetails as W, type WhopCheckoutAddress as a, type
|
|
518
|
+
export { getOverlayLoaderIframeUrl as A, EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING as B, firePixelIdentify as C, getUtmFromCurrentUrl as D, EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST as E, injectPixel as F, type WhopCheckoutSubmitDetails as W, type WhopCheckoutAddress as a, type WhopCheckoutCurrenciesAvailable as b, type WhopCheckoutState as c, type WhopCheckoutPromoCode as d, type WhopCheckoutCurrencyChanged as e, type WhopEmbeddedCheckoutStyleOptions as f, type WhopEmbeddedCheckoutPrefillOptions as g, type WhopEmbeddedCheckoutEnvironment as h, type WhopExpressButtonMethod as i, type WhopExpressButtonRendered as j, isWhopCheckoutMessage as k, type WhopCheckoutMessage as l, getEmail as m, setAddress as n, onWhopCheckoutMessage as o, setDisplayCurrency as p, getAddress as q, submitCheckoutFrame as r, setEmail as s, parseSetupFutureUsage as t, type WhopEmbeddedCheckoutThemeOptions as u, isWhopEmbeddedCheckoutEnvironment as v, toWhopEmbeddedCheckoutEnvironment as w, getEmbeddedCheckoutIframeUrl as x, getExpressButtonIframeUrl as y, getRequirementOverlayIframeUrl as z };
|
|
@@ -5,6 +5,7 @@ declare global {
|
|
|
5
5
|
listening: boolean;
|
|
6
6
|
frames: Map<HTMLIFrameElement, () => void>;
|
|
7
7
|
identifiedFrames: Map<string, HTMLIFrameElement>;
|
|
8
|
+
availableCurrencies: Map<string, WhopCheckoutCurrenciesAvailable>;
|
|
8
9
|
submit: (
|
|
9
10
|
identifier: string,
|
|
10
11
|
data?: WhopCheckoutSubmitDetails,
|
|
@@ -27,6 +28,14 @@ declare global {
|
|
|
27
28
|
address: WhopCheckoutAddress,
|
|
28
29
|
timeout?: number,
|
|
29
30
|
) => Promise<void>;
|
|
31
|
+
setDisplayCurrency: (
|
|
32
|
+
identifier: string,
|
|
33
|
+
currency: string,
|
|
34
|
+
timeout?: number,
|
|
35
|
+
) => Promise<void>;
|
|
36
|
+
getAvailableCurrencies: (
|
|
37
|
+
identifier: string,
|
|
38
|
+
) => WhopCheckoutCurrenciesAvailable | null;
|
|
30
39
|
};
|
|
31
40
|
Plaid?: Plaid;
|
|
32
41
|
}
|
|
@@ -208,6 +217,11 @@ declare global {
|
|
|
208
217
|
}
|
|
209
218
|
|
|
210
219
|
type WhopCheckoutState = "loading" | "ready" | "disabled";
|
|
220
|
+
type WhopExpressButtonMethod = "apple-pay" | "whop-pay";
|
|
221
|
+
type WhopExpressButtonRendered = "apple-pay" | "google-pay" | "whop-pay" | "none";
|
|
222
|
+
type WhopExpressMethodResolved = {
|
|
223
|
+
rendered: WhopExpressButtonRendered;
|
|
224
|
+
};
|
|
211
225
|
type WhopCheckoutPromoCode = {
|
|
212
226
|
amount: number;
|
|
213
227
|
code: string;
|
|
@@ -216,6 +230,16 @@ type WhopCheckoutPromoCode = {
|
|
|
216
230
|
intervals: number;
|
|
217
231
|
type: string;
|
|
218
232
|
};
|
|
233
|
+
type WhopCheckoutCurrenciesAvailable = {
|
|
234
|
+
base_currency: string;
|
|
235
|
+
optional_currency: string | null;
|
|
236
|
+
current_currency: string;
|
|
237
|
+
exchange_rate: number | null;
|
|
238
|
+
};
|
|
239
|
+
type WhopCheckoutCurrencyChanged = {
|
|
240
|
+
currency: string;
|
|
241
|
+
exchange_rate: number | null;
|
|
242
|
+
};
|
|
219
243
|
type EmbeddedCheckoutBaseEvent<T extends Record<string, unknown>> = {
|
|
220
244
|
__scope: "whop-embedded-checkout";
|
|
221
245
|
event_id: string;
|
|
@@ -318,15 +342,75 @@ type WhopCheckoutMessage = {
|
|
|
318
342
|
event: "identity-captured";
|
|
319
343
|
email?: string;
|
|
320
344
|
user_id?: string;
|
|
345
|
+
} | ({
|
|
346
|
+
event: "currencies-available";
|
|
347
|
+
} & WhopCheckoutCurrenciesAvailable) | ({
|
|
348
|
+
event: "currency-changed";
|
|
349
|
+
} & WhopCheckoutCurrencyChanged) | {
|
|
350
|
+
event: "set-display-currency-result";
|
|
351
|
+
ok: true;
|
|
352
|
+
currency: string;
|
|
353
|
+
event_id: string;
|
|
354
|
+
} | {
|
|
355
|
+
event: "set-display-currency-result";
|
|
356
|
+
ok: false;
|
|
357
|
+
error: string;
|
|
358
|
+
event_id: string;
|
|
359
|
+
} | ({
|
|
360
|
+
event: "express-method-resolved";
|
|
361
|
+
} & WhopExpressMethodResolved) | {
|
|
362
|
+
event: "express-loading";
|
|
363
|
+
loading: boolean;
|
|
364
|
+
} | {
|
|
365
|
+
event: "request-overlay";
|
|
366
|
+
channelId: string;
|
|
367
|
+
} | {
|
|
368
|
+
event: "request-requirement-overlay";
|
|
369
|
+
channelId: string;
|
|
370
|
+
/**
|
|
371
|
+
* Optional pre-built URL the source iframe wants opened, so its theme /
|
|
372
|
+
* accent color / other search params can flow through to the
|
|
373
|
+
* requirement iframe. The host validates same-origin + path before
|
|
374
|
+
* using it; an invalid or missing value falls back to a URL built by
|
|
375
|
+
* `getRequirementOverlayIframeUrl`. The source iframe is responsible
|
|
376
|
+
* for stripping any `secret` — the session is bridged via BroadcastChannel.
|
|
377
|
+
*/
|
|
378
|
+
iframeSrc?: string;
|
|
379
|
+
} | {
|
|
380
|
+
event: "close-overlay";
|
|
381
|
+
channelId?: string;
|
|
321
382
|
} | PaymentRequestMerchantValidationResult | PaymentRequestUpdateRequest | PaymentRequestCreateRequest | PaymentRequestEventResult | PlaidTokenRequest | PlaidReadyEvent;
|
|
322
383
|
declare function isWhopCheckoutMessage(event: MessageEvent<unknown>): event is MessageEvent<WhopCheckoutMessage>;
|
|
323
384
|
|
|
385
|
+
/**
|
|
386
|
+
* Structural subset of `createOverlayHost`'s return value (see overlay-host.ts)
|
|
387
|
+
* — declared inline to keep util.ts free of a circular import. When an
|
|
388
|
+
* `overlayHost` is supplied, `onWhopCheckoutMessage` intercepts the host-side
|
|
389
|
+
* overlay events centrally, the same way it already intercepts payment-request
|
|
390
|
+
* and plaid. This is what makes overlay handling un-driftable across mount
|
|
391
|
+
* paths: callers can't forget the events because they're handled here and
|
|
392
|
+
* type-excluded from the callback below.
|
|
393
|
+
*/
|
|
394
|
+
interface OverlayMessageHandler {
|
|
395
|
+
handleOverlayRequest(message: {
|
|
396
|
+
event: "request-overlay";
|
|
397
|
+
channelId: string;
|
|
398
|
+
} | {
|
|
399
|
+
event: "request-requirement-overlay";
|
|
400
|
+
channelId: string;
|
|
401
|
+
iframeSrc?: string;
|
|
402
|
+
}): void;
|
|
403
|
+
handleCloseOverlay(message: {
|
|
404
|
+
channelId?: string;
|
|
405
|
+
}): void;
|
|
406
|
+
}
|
|
324
407
|
declare function onWhopCheckoutMessage(iframe: HTMLIFrameElement, callback: (message: Exclude<WhopCheckoutMessage, Extract<WhopCheckoutMessage, {
|
|
325
|
-
event: "payment-request-create-request" | "payment-request-update-request" | "plaid-token-request" | "plaid-ready";
|
|
326
|
-
}>>) => void): () => void;
|
|
408
|
+
event: "payment-request-create-request" | "payment-request-update-request" | "plaid-token-request" | "plaid-ready" | "request-overlay" | "request-requirement-overlay";
|
|
409
|
+
}>>) => void, overlayHost?: OverlayMessageHandler): () => void;
|
|
327
410
|
declare function setEmail(frame: HTMLIFrameElement, email: string, timeout?: number): Promise<void>;
|
|
328
411
|
declare function getEmail(frame: HTMLIFrameElement, timeout?: number): Promise<string>;
|
|
329
412
|
declare function setAddress(frame: HTMLIFrameElement, address: WhopCheckoutAddress, timeout?: number): Promise<void>;
|
|
413
|
+
declare function setDisplayCurrency(frame: HTMLIFrameElement, currency: string, timeout?: number): Promise<void>;
|
|
330
414
|
declare function getAddress(frame: HTMLIFrameElement, timeout?: number): Promise<{
|
|
331
415
|
address: WhopCheckoutAddress;
|
|
332
416
|
isComplete: boolean;
|
|
@@ -346,7 +430,17 @@ interface WhopEmbeddedCheckoutStyleOptions {
|
|
|
346
430
|
}
|
|
347
431
|
interface WhopEmbeddedCheckoutPrefillOptions {
|
|
348
432
|
email?: string;
|
|
433
|
+
/**
|
|
434
|
+
* **Optional** - The buyer's billing address to seed the form with. The
|
|
435
|
+
* buyer can still edit it before paying.
|
|
436
|
+
*/
|
|
349
437
|
address?: Partial<WhopCheckoutAddress>;
|
|
438
|
+
/**
|
|
439
|
+
* **Optional** - The buyer's shipping address to seed the form with. Only
|
|
440
|
+
* relevant when the plan collects a shipping address. The buyer can still
|
|
441
|
+
* edit it before paying.
|
|
442
|
+
*/
|
|
443
|
+
shippingAddress?: Partial<WhopCheckoutAddress>;
|
|
350
444
|
}
|
|
351
445
|
interface WhopEmbeddedCheckoutThemeOptions {
|
|
352
446
|
accentColor?: string;
|
|
@@ -355,12 +449,70 @@ interface WhopEmbeddedCheckoutThemeOptions {
|
|
|
355
449
|
type WhopEmbeddedCheckoutEnvironment = "production" | "sandbox";
|
|
356
450
|
declare function isWhopEmbeddedCheckoutEnvironment(environment: unknown): environment is WhopEmbeddedCheckoutEnvironment;
|
|
357
451
|
declare function toWhopEmbeddedCheckoutEnvironment(environment: unknown): WhopEmbeddedCheckoutEnvironment;
|
|
358
|
-
declare function getEmbeddedCheckoutIframeUrl(planId?: string, theme?: "light" | "dark" | "system", sessionId?: string, origin?: string, hidePrice?: boolean, skipRedirect?: boolean, utm?: Record<string, string | string[]>, styles?: WhopEmbeddedCheckoutStyleOptions, prefill?: WhopEmbeddedCheckoutPrefillOptions, themeOptions?: WhopEmbeddedCheckoutThemeOptions, hideSubmitButton?: boolean, hideTermsAndConditions?: boolean, hideEmail?: boolean, disableEmail?: boolean, hideAddressForm?: boolean, affiliateCode?: string, setupFutureUsage?: "off_session", paymentRedirectUrl?: string, stateId?: string, promoCode?: string, environment?: WhopEmbeddedCheckoutEnvironment, wuid?: string): string;
|
|
452
|
+
declare function getEmbeddedCheckoutIframeUrl(planId?: string, theme?: "light" | "dark" | "system", sessionId?: string, origin?: string, hidePrice?: boolean, skipRedirect?: boolean, utm?: Record<string, string | string[]>, styles?: WhopEmbeddedCheckoutStyleOptions, prefill?: WhopEmbeddedCheckoutPrefillOptions, themeOptions?: WhopEmbeddedCheckoutThemeOptions, hideSubmitButton?: boolean, hideTermsAndConditions?: boolean, hideEmail?: boolean, disableEmail?: boolean, hideAddressForm?: boolean, affiliateCode?: string, setupFutureUsage?: "off_session", paymentRedirectUrl?: string, stateId?: string, promoCode?: string, environment?: WhopEmbeddedCheckoutEnvironment, wuid?: string, adaptivePricing?: boolean, collectPhoneNumbers?: boolean): string;
|
|
453
|
+
/**
|
|
454
|
+
* Builds the iframe URL for the express checkout button surface.
|
|
455
|
+
*
|
|
456
|
+
* Intentionally narrower than `getEmbeddedCheckoutIframeUrl` — the express
|
|
457
|
+
* button cannot render `hide-*`, `disable-*`, or `style-*` controls and
|
|
458
|
+
* doesn't accept a `data-whop-checkout-session` (sessions are minted
|
|
459
|
+
* server-side and kept on the iframe origin, never travelling through
|
|
460
|
+
* host JS).
|
|
461
|
+
*/
|
|
462
|
+
declare function getExpressButtonIframeUrl(opts: {
|
|
463
|
+
planId?: string;
|
|
464
|
+
checkoutConfigurationId?: string;
|
|
465
|
+
paymentRedirectUrl: string;
|
|
466
|
+
theme?: "light" | "dark" | "system";
|
|
467
|
+
origin?: string;
|
|
468
|
+
utm?: Record<string, string | string[]>;
|
|
469
|
+
prefill?: WhopEmbeddedCheckoutPrefillOptions;
|
|
470
|
+
themeOptions?: WhopEmbeddedCheckoutThemeOptions;
|
|
471
|
+
affiliateCode?: string;
|
|
472
|
+
stateId?: string;
|
|
473
|
+
promoCode?: string;
|
|
474
|
+
environment?: WhopEmbeddedCheckoutEnvironment;
|
|
475
|
+
wuid?: string;
|
|
476
|
+
adaptivePricing?: boolean;
|
|
477
|
+
methods?: readonly string[];
|
|
478
|
+
setupFutureUsage?: "off_session";
|
|
479
|
+
skipRedirect?: boolean;
|
|
480
|
+
}): string;
|
|
481
|
+
/**
|
|
482
|
+
* Builds the iframe URL for a delegated requirement overlay. The route is
|
|
483
|
+
* static — the only thing it needs is the BroadcastChannel id that the
|
|
484
|
+
* requirement iframe uses to talk to the parent embed that originated the
|
|
485
|
+
* request (the session itself is pushed across the channel, not the URL).
|
|
486
|
+
*/
|
|
487
|
+
declare function getRequirementOverlayIframeUrl(opts: {
|
|
488
|
+
channelId: string;
|
|
489
|
+
theme?: "light" | "dark" | "system";
|
|
490
|
+
origin?: string;
|
|
491
|
+
environment?: WhopEmbeddedCheckoutEnvironment;
|
|
492
|
+
}): string;
|
|
493
|
+
/**
|
|
494
|
+
* Builds the iframe URL for the overlay loader. Carries only the
|
|
495
|
+
* BroadcastChannel id, theme, and environment — the session id is
|
|
496
|
+
* negotiated cross-iframe (same-origin) and never travels through host
|
|
497
|
+
* JS or this URL.
|
|
498
|
+
*/
|
|
499
|
+
declare function getOverlayLoaderIframeUrl(opts: {
|
|
500
|
+
channelId: string;
|
|
501
|
+
theme?: "light" | "dark" | "system";
|
|
502
|
+
origin?: string;
|
|
503
|
+
environment?: WhopEmbeddedCheckoutEnvironment;
|
|
504
|
+
}): string;
|
|
359
505
|
declare const EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST: string[];
|
|
360
506
|
declare const EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING = "document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";
|
|
361
507
|
declare function firePixelIdentify(data: {
|
|
362
508
|
email?: string;
|
|
363
509
|
user_id?: string;
|
|
364
510
|
}): void;
|
|
511
|
+
declare function getUtmFromCurrentUrl(): Record<string, string | string[]>;
|
|
512
|
+
/**
|
|
513
|
+
* Inject the Whop pixel tracking SDK for a given plan / checkout config.
|
|
514
|
+
* No-ops if the SDK or its script tag is already present.
|
|
515
|
+
*/
|
|
516
|
+
declare function injectPixel(planIdOrCheckoutConfigId: string): void;
|
|
365
517
|
|
|
366
|
-
export { EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST as E, type WhopCheckoutSubmitDetails as W, type WhopCheckoutAddress as a, type
|
|
518
|
+
export { getOverlayLoaderIframeUrl as A, EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING as B, firePixelIdentify as C, getUtmFromCurrentUrl as D, EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST as E, injectPixel as F, type WhopCheckoutSubmitDetails as W, type WhopCheckoutAddress as a, type WhopCheckoutCurrenciesAvailable as b, type WhopCheckoutState as c, type WhopCheckoutPromoCode as d, type WhopCheckoutCurrencyChanged as e, type WhopEmbeddedCheckoutStyleOptions as f, type WhopEmbeddedCheckoutPrefillOptions as g, type WhopEmbeddedCheckoutEnvironment as h, type WhopExpressButtonMethod as i, type WhopExpressButtonRendered as j, isWhopCheckoutMessage as k, type WhopCheckoutMessage as l, getEmail as m, setAddress as n, onWhopCheckoutMessage as o, setDisplayCurrency as p, getAddress as q, submitCheckoutFrame as r, setEmail as s, parseSetupFutureUsage as t, type WhopEmbeddedCheckoutThemeOptions as u, isWhopEmbeddedCheckoutEnvironment as v, toWhopEmbeddedCheckoutEnvironment as w, getEmbeddedCheckoutIframeUrl as x, getExpressButtonIframeUrl as y, getRequirementOverlayIframeUrl as z };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function n(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function u(e){n(i,o,a,u,s,"next",e)}function s(e){n(i,o,a,u,s,"throw",e)}u(undefined)})}}function a(e,t,r){t=d(t);return g(e,C()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function u(e,t,r){if(C()){u=Reflect.construct}else{u=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)_(a,r.prototype);return a}}return u.apply(null,arguments)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function c(e,t,r){if(t)s(e.prototype,t);if(r)s(e,r);return e}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function f(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)_(e,t)}function v(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function p(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function h(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var a=false;var i,u;try{for(r=r.call(e);!(o=(i=r.next()).done);o=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){a=true;u=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}return n}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function w(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{b(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function g(e,t){if(t&&(k(t)==="object"||typeof t==="function")){return t}return r(e)}function _(e,t){_=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return _(e,t)}function E(e,r){return t(e)||h(e,r)||P(e,r)||m()}function k(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function P(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function O(e){var t=typeof Map==="function"?new Map:undefined;O=function e(e){if(e===null||!p(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,d(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return _(r,e)};return O(e)}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}function S(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var R=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var D=function(e,t,r){return t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var M=function(e,t){for(var r in t)R(e,r,{get:t[r],enumerable:!0})},A=function(e,t,r,n){var o=true,a=false,i=undefined;if(t&&(typeof t==="undefined"?"undefined":k(t))=="object"||typeof t=="function")try{var u=function(){var o=c.value;!q.call(e,o)&&o!==r&&R(e,o,{get:function(){return t[o]},enumerable:!(n=j(t,o))||n.enumerable})};for(var s=W(t)[Symbol.iterator](),c;!(o=(c=s.next()).done);o=true)u()}catch(e){a=true;i=e}finally{try{if(!o&&s.return!=null){s.return()}}finally{if(a){throw i}}}return e};var U=function(e){return A(R({},"__esModule",{value:!0}),e)};var I=function(e,t,r){return D(e,(typeof t==="undefined"?"undefined":k(t))!="symbol"?t+"":t,r)};var L={};M(L,{EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:function(){return ew},EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:function(){return eb},firePixelIdentify:function(){return eg},getAddress:function(){return ed},getEmail:function(){return ec},getEmbeddedCheckoutIframeUrl:function(){return em},isWhopCheckoutMessage:function(){return K},isWhopEmbeddedCheckoutEnvironment:function(){return ep},onWhopCheckoutMessage:function(){return et},parseSetupFutureUsage:function(){return ev},setAddress:function(){return el},setEmail:function(){return es},submitCheckoutFrame:function(){return ef},toWhopEmbeddedCheckoutEnvironment:function(){return eh}});module.exports=U(L);var x=/*#__PURE__*/function(e){f(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);I(e,"type","WhopCheckoutError");return e}return t}(O(Error));var T=/*#__PURE__*/function(e){f(t,e);function t(e){i(this,t);var r;r=a(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);I(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(x);var F=/*#__PURE__*/function(e){f(t,e);function t(e){i(this,t);var r;r=a(this,t,[e!==null&&e!==void 0?e:"Aborted waiting for embed response"]);I(r,"name","WhopCheckoutRpcAbortedError");return r}return t}(x);var N=/*#__PURE__*/function(e){f(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);I(e,"name","WhopCheckoutSetEmailError");return e}return t}(x);var B=/*#__PURE__*/function(e){f(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);I(e,"name","WhopCheckoutSetAddressError");return e}return t}(x);var X=/*#__PURE__*/function(e){f(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);I(e,"name","WhopCheckoutGetAddressError");return e}return t}(x);var H=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error","promo-code-changed","payment-request-merchant-validation-result","payment-request-update-request","payment-request-create-request","payment-request-event-result","plaid-token-request","plaid-ready","identity-captured"];function K(e){return k(e.data)=="object"&&e.data!==null&&"event"in e.data&&H.includes(e.data.event)}function G(e,t){return K(e)&&e.data.event===t}var z=[];function J(e){return z[e]||(z[e]=(e+256).toString(16).slice(1))}function V(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":k(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,J(e[0])+J(e[1])+J(e[2])+J(e[3])+"-"+J(e[4])+J(e[5])+"-"+J(e[6])+J(e[7])+"-"+J(e[8])+J(e[9])+"-"+J(e[10])+J(e[11])+J(e[12])+J(e[13])+J(e[14])+J(e[15])}function $(e,t,r,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3,a=arguments.length>5?arguments[5]:void 0;var i;var u=new URL(e.src).origin,s=V();return(i=e.contentWindow)===null||i===void 0?void 0:i.postMessage(w(y({},t),{__scope:"whop-embedded-checkout",event_id:s}),u),new Promise(function(t,i){if(a===null||a===void 0?void 0:a.aborted){i(new Error("Aborted"));return}var u=function(){c&&clearTimeout(c),window.removeEventListener("message",d),a===null||a===void 0?void 0:a.removeEventListener("abort",l)},c=o!==null?setTimeout(function(){i(new T),u()},o):null,l=function(){i(new F),u()};a===null||a===void 0?void 0:a.addEventListener("abort",l,{once:!0});var d=function(o){if(o.source===e.contentWindow&&G(o,r)&&o.data.event===r&&o.data.event_id===s){u();try{t(n(o.data))}catch(e){i(e)}}};window.addEventListener("message",d)})}var Q=/*#__PURE__*/function(){function e(t,r,n,o){i(this,e);this.iframe=t;this.methodData=r;this.details=n;this.options=o;I(this,"id",V());I(this,"abortController")}c(e,[{key:"active",get:function t(){var t;return(t=e.activeRequests.get(this.iframe))!==null&&t!==void 0?t:!1}},{key:"updateMethodData",value:function e(e){this.methodData=e}},{key:"updateDetails",value:function e(e){this.details=e}},{key:"updateOptions",value:function e(e){this.options=e}},{key:"getResult",value:function e(){return o(function(){var e,t,r,n,a,i,u,s,c,l;return S(this,function(d){switch(d.label){case 0:e=this;t=new AbortController;this.abortController=t;r=new PaymentRequest(this.methodData,this.details,this.options);r.onmerchantvalidation=function(n){return o(function(){var e,o;return S(this,function(a){switch(a.label){case 0:e={event:"payment-request-merchant-validation-request",validationURL:n.validationURL,methodName:n.methodName,id:this.id};return[4,$(this.iframe,e,"payment-request-merchant-validation-result",function(e){return e},null,t.signal).catch(function(){return null})];case 1:o=a.sent();(o===null||o===void 0?void 0:o.ok)?n.complete(o.merchantSession):r.abort();return[2]}})}).call(e)},r.onshippingaddresschange=function(e){e.updateWith({})},r.onpaymentmethodchange=function(r){return o(function(){var e,n;return S(this,function(o){switch(o.label){case 0:e={event:"payment-request-payment-method-change-request",id:this.id,data:r.methodDetails};return[4,$(this.iframe,e,"payment-request-event-result",function(e){return e},null,t.signal).catch(function(){return null})];case 1:n=o.sent();(n===null||n===void 0?void 0:n.ok)?r.updateWith(n.details):r.updateWith({});return[2]}})}).call(e)};n=r;d.label=1;case 1:d.trys.push([1,,6,7]);s=new Promise(function(e,r){var n=function(){r(new Error("Aborted"))};t.signal.addEventListener("abort",n,{once:!0}),a=function(){t.signal.removeEventListener("abort",n)}});return[4,Promise.race([r.show().then(function(e){return n=null,e}),s])];case 2:c=d.sent(),l=this.methodData.find(function(e){return e.supportedMethods===c.methodName});if(!!l)return[3,4];return[4,c.complete("fail")];case 3:throw d.sent(),new Error("PaymentRequest failed to complete because of missing method data");case 4:return[4,c.complete("success")];case 5:return[2,(d.sent(),{method:c.methodName,response:{payerEmail:c.payerEmail,details:JSON.parse(JSON.stringify(c.details))},options:this.options,methodData:{applePayMerchantIdentifier:l===null||l===void 0?void 0:(i=l.data)===null||i===void 0?void 0:i.merchantIdentifier,requestShipping:l===null||l===void 0?void 0:(u=l.data)===null||u===void 0?void 0:u.requiredShippingContactFields}})];case 6:n===null||n===void 0?void 0:n.abort(),a===null||a===void 0?void 0:a(),this.abortController=void 0;return[7];case 7:return[2]}})}).call(this)}},{key:"abort",value:function e(){var e;(e=this.abortController)===null||e===void 0?void 0:e.abort()}}],[{key:"get",value:function t(t){var r;return(r=e.requests.get(t))!==null&&r!==void 0?r:null}},{key:"create",value:function t(t,r,n,o){var a=new e(t,r,n,o);return e.requests.set(t,a),a}},{key:"remove",value:function t(t){var r;(r=e.requests.get(t))===null||r===void 0?void 0:r.abort(),e.requests.delete(t),e.activeRequests.delete(t)}},{key:"setActive",value:function t(t,r){e.activeRequests.set(t,r)}}]);return e}();I(Q,"requests",new WeakMap),I(Q,"activeRequests",new WeakMap);var Y=Q;var Z=2,ee="https://cdn.plaid.com/link/v2/stable/link-initialize.js";function et(e,t){function r(r){if(r.source===e.contentWindow&&K(r)){switch(r.data.event){case"payment-request-create-request":{try{var n;var a=Y.create(e,r.data.method_data,r.data.details,r.data.options),i={__scope:"whop-embedded-checkout",event:"payment-request-create-result",event_id:r.data.event_id,ok:!0,id:a.id},u=new URL(e.src).origin;(n=e.contentWindow)===null||n===void 0?void 0:n.postMessage(i,u)}catch(t){var s;var c={__scope:"whop-embedded-checkout",event:"payment-request-create-result",event_id:r.data.event_id,ok:!1,error:v(t,Error)?t.message:"Unknown error"},l=new URL(e.src).origin;(s=e.contentWindow)===null||s===void 0?void 0:s.postMessage(c,l)}return}case"payment-request-update-request":{"active"in r.data&&typeof r.data.active=="boolean"&&Y.setActive(e,r.data.active);try{var d;var f=Y.get(e);if(!f)throw new Error("Payment request not found");"method_data"in r.data&&r.data.method_data&&f.updateMethodData(r.data.method_data),"details"in r.data&&r.data.details&&f.updateDetails(r.data.details),"options"in r.data&&r.data.options&&f.updateOptions(r.data.options);var p={__scope:"whop-embedded-checkout",event:"payment-request-update-result",event_id:r.data.event_id,ok:!0},h=new URL(e.src).origin;(d=e.contentWindow)===null||d===void 0?void 0:d.postMessage(p,h)}catch(t){var m;var y={__scope:"whop-embedded-checkout",event:"payment-request-update-result",event_id:r.data.event_id,ok:!1,error:v(t,Error)?t.message:"Unknown error"},b=new URL(e.src).origin;(m=e.contentWindow)===null||m===void 0?void 0:m.postMessage(y,b)}return}case"plaid-token-request":{var w=r.data;(function(){return o(function(){var t,r,n,o,a,i,u,s,c;return S(this,function(l){switch(l.label){case 0:l.trys.push([0,3,,4]);return[4,en()];case 1:r=l.sent();return[4,new Promise(function(e,t){var n=r.create({token:w.token,onSuccess:function(t){e(t),n.destroy()},onExit:function(e){var r;t(new Error((r=e===null||e===void 0?void 0:e.display_message)!==null&&r!==void 0?r:"Canceled by user")),n.destroy()}});n.open()})];case 2:n=l.sent(),o={__scope:"whop-embedded-checkout",event:"plaid-token-result",event_id:w.event_id,ok:!0,token:n},a=new URL(e.src).origin;(t=e.contentWindow)===null||t===void 0?void 0:t.postMessage(o,a);return[3,4];case 3:i=l.sent();s={__scope:"whop-embedded-checkout",event:"plaid-token-result",event_id:w.event_id,ok:!1,error:v(i,Error)?i.message:"Unknown error"},c=new URL(e.src).origin;(u=e.contentWindow)===null||u===void 0?void 0:u.postMessage(s,c);return[3,4];case 4:return[2]}})})()})();return}case"plaid-ready":{try{en().catch(function(){})}catch(e){}return}}t(r.data)}}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}var er=null;function en(){return o(function(){var e,t;return S(this,function(r){switch(r.label){case 0:ei();if(!window.Plaid)return[3,1];e=window.Plaid;return[3,6];case 1:if(!er)return[3,3];return[4,er];case 2:t=r.sent();return[3,5];case 3:er=eu();return[4,er];case 4:t=r.sent();r.label=5;case 5:e=t;r.label=6;case 6:return[2,e]}})})()}var eo="whop-checkout-plaid-link-style",ea="iframe[id^='plaid-link-iframe-'] { pointer-events: auto; }";function ei(){if(!document.getElementById(eo)){var e=document.createElement("style");e.id=eo,e.textContent=ea,document.head.appendChild(e)}}function eu(){return o(function(){var e;return S(this,function(t){e=document.createElement("script");return[2,(e.src=ee,e.async=!0,e.defer=!0,document.head.appendChild(e),new Promise(function(t,r){e.onload=function(){window.Plaid?t(window.Plaid):r(new Error("Plaid not available"))},e.onerror=function(){return r(new Error("Failed to load Plaid Link script"))},er=null}))]})})()}function es(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return S(this,function(n){return[2,$(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new N(e.error)},r)]})})()}function ec(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return S(this,function(r){return[2,$(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()}function el(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return S(this,function(n){return[2,$(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new B(e.error)},r)]})})()}function ed(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return S(this,function(r){return[2,$(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new X(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()}function ef(e,t){return o(function(){var t,r,n,o,a;return S(this,function(i){switch(i.label){case 0:r={__scope:"whop-embedded-checkout",event:"submit",event_id:V()},n=Y.get(e);if(!(n===null||n===void 0?void 0:n.active))return[3,2];return[4,n.getResult()];case 1:o=i.sent();r.payment_request_result=o;i.label=2;case 2:a=new URL(e.src).origin;(t=e.contentWindow)===null||t===void 0?void 0:t.postMessage(r,a);return[2]}})})()}function ev(e){if(e==="off_session")return"off_session"}function ep(e){return e==="production"||e==="sandbox"}function eh(e){return ep(e)?e:"production"}function em(e,t,r,n,o,a,i,u,s,c,l,d,f,v,p,h,m,y,b,w){var g=arguments.length>20&&arguments[20]!==void 0?arguments[20]:"production",_=arguments.length>21?arguments[21]:void 0;var k,P,O,C,S,R,j;var W=_||ey(),q=typeof r=="string"&&!r.startsWith("ch_XXXXX")?r:e,D=new URL("/embedded/checkout/".concat(q,"/"),n!==null&&n!==void 0?n:g==="sandbox"?"https://sandbox.whop.com/":"https://whop.com/");g==="sandbox"&&n&&console.warn("Ignoring environment in favor of provided origin"),D.searchParams.set("h",window.location.origin),D.searchParams.set("v",Z.toString());try{var M=window;for(;M.parent!==M;)M=M.parent;var A=M.location.hostname;M.location.protocol==="https:"&&A&&D.searchParams.set("t",A)}catch(e){}if(t&&D.searchParams.set("theme",t),r&&D.searchParams.set("session",r),o&&D.searchParams.set("hide_price","true"),a&&D.searchParams.set("skip_redirect","true"),l&&D.searchParams.set("hide_submit_button","true"),d&&D.searchParams.set("hide_tos","true"),f&&D.searchParams.set("email.hidden","1"),v&&D.searchParams.set("email.disabled","1"),p&&D.searchParams.set("address.hidden","1"),h&&D.searchParams.set("a",h),m&&D.searchParams.set("setup_future_usage",m),y&&D.searchParams.set("payment_redirect_url",y),b&&D.searchParams.set("state_id",b),w&&D.searchParams.set("promoCode",w),i){var U=true,I=false,L=undefined,x=true,T=false,F=undefined;try{for(var N=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),B;!(x=(B=N.next()).done);x=true){var X=E(B.value,2),H=X[0],K=X[1];if(H.startsWith("utm_"))if(Array.isArray(K))try{for(var G=K[Symbol.iterator](),z;!(U=(z=G.next()).done);U=true){var J=z.value;D.searchParams.append(H,J)}}catch(e){I=true;L=e}finally{try{if(!U&&G.return!=null){G.return()}}finally{if(I){throw L}}}else D.searchParams.set(H,K)}}catch(e){T=true;F=e}finally{try{if(!x&&N.return!=null){N.return()}}finally{if(T){throw F}}}}if(u){var V=true,$=false,Q=undefined,Y=true,ee=false,et=undefined;try{for(var er=Object.entries(u)[Symbol.iterator](),en;!(Y=(en=er.next()).done);Y=true){var eo=E(en.value,2),ea=eo[0],ei=eo[1];if(ei)try{for(var eu=Object.entries(ei)[Symbol.iterator](),es;!(V=(es=eu.next()).done);V=true){var ec=E(es.value,2),el=ec[0],ed=ec[1];D.searchParams.set("style.".concat(ea,".").concat(el),ed.toString())}}catch(e){$=true;Q=e}finally{try{if(!V&&eu.return!=null){eu.return()}}finally{if($){throw Q}}}}}catch(e){ee=true;et=e}finally{try{if(!Y&&er.return!=null){er.return()}}finally{if(ee){throw et}}}}var ef=true,ev=false,ep=undefined;if((s===null||s===void 0?void 0:s.email)&&D.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(k=s.address)===null||k===void 0?void 0:k.name)&&D.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(P=s.address)===null||P===void 0?void 0:P.line1)&&D.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(O=s.address)===null||O===void 0?void 0:O.line2)&&D.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(C=s.address)===null||C===void 0?void 0:C.city)&&D.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(S=s.address)===null||S===void 0?void 0:S.country)&&D.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(R=s.address)===null||R===void 0?void 0:R.state)&&D.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(j=s.address)===null||j===void 0?void 0:j.postalCode)&&D.searchParams.set("address.postal_code",s.address.postalCode),c)try{for(var eh=Object.entries(c)[Symbol.iterator](),em;!(ef=(em=eh.next()).done);ef=true){var eb=E(em.value,2),ew=eb[0],eg=eb[1];eg&&D.searchParams.set("theme.".concat(ew),typeof eg=="boolean"?"1":eg)}}catch(e){ev=true;ep=e}finally{try{if(!ef&&eh.return!=null){eh.return()}}finally{if(ev){throw ep}}}return W&&D.searchParams.set("wuid",W),D.toString()}function ey(){var e;if((typeof document==="undefined"?"undefined":k(document))>"u")return;var t=(e=document.cookie.match(/(?:^|;\s*)_wuid=([^;]*)/))===null||e===void 0?void 0:e[1];return(t===null||t===void 0?void 0:t.startsWith("wuid_"))?t:void 0}var eb=["allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"],ew="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";function eg(e){var t;if(!((t=window.whop)===null||t===void 0?void 0:t.track))return;var r={};e.email&&(r.email=e.email),e.user_id&&(r.user_id=e.user_id),window.whop.track("id",w(y({},r),{source:"embedded_checkout"}))}0&&(module.exports={EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,firePixelIdentify:firePixelIdentify,getAddress:getAddress,getEmail:getEmail,getEmbeddedCheckoutIframeUrl:getEmbeddedCheckoutIframeUrl,isWhopCheckoutMessage:isWhopCheckoutMessage,isWhopEmbeddedCheckoutEnvironment:isWhopEmbeddedCheckoutEnvironment,onWhopCheckoutMessage:onWhopCheckoutMessage,parseSetupFutureUsage:parseSetupFutureUsage,setAddress:setAddress,setEmail:setEmail,submitCheckoutFrame:submitCheckoutFrame,toWhopEmbeddedCheckoutEnvironment:toWhopEmbeddedCheckoutEnvironment});
|
|
1
|
+
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function n(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function u(e){n(i,o,a,u,s,"next",e)}function s(e){n(i,o,a,u,s,"throw",e)}u(undefined)})}}function a(e,t,r){t=d(t);return g(e,C()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function u(e,t,r){if(C()){u=Reflect.construct}else{u=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)_(a,r.prototype);return a}}return u.apply(null,arguments)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function c(e,t,r){if(t)s(e.prototype,t);if(r)s(e,r);return e}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function f(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)_(e,t)}function p(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function v(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function h(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var a=false;var i,u;try{for(r=r.call(e);!(o=(i=r.next()).done);o=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){a=true;u=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}return n}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function b(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{w(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function g(e,t){if(t&&(k(t)==="object"||typeof t==="function")){return t}return r(e)}function _(e,t){_=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return _(e,t)}function E(e,r){return t(e)||h(e,r)||P(e,r)||m()}function k(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function P(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function O(e){var t=typeof Map==="function"?new Map:undefined;O=function e(e){if(e===null||!v(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,d(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return _(r,e)};return O(e)}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}function U(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var R=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var W=function(e,t,r){return t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var j=function(e,t){for(var r in t)R(e,r,{get:t[r],enumerable:!0})},D=function(e,t,r,n){var o=true,a=false,i=undefined;if(t&&(typeof t==="undefined"?"undefined":k(t))=="object"||typeof t=="function")try{var u=function(){var o=c.value;!I.call(e,o)&&o!==r&&R(e,o,{get:function(){return t[o]},enumerable:!(n=S(t,o))||n.enumerable})};for(var s=q(t)[Symbol.iterator](),c;!(o=(c=s.next()).done);o=true)u()}catch(e){a=true;i=e}finally{try{if(!o&&s.return!=null){s.return()}}finally{if(a){throw i}}}return e};var A=function(e){return D(R({},"__esModule",{value:!0}),e)};var x=function(e,t,r){return W(e,(typeof t==="undefined"?"undefined":k(t))!="symbol"?t+"":t,r)};var M={};j(M,{EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:function(){return eC},EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:function(){return eO},firePixelIdentify:function(){return eU},getAddress:function(){return ep},getEmail:function(){return el},getEmbeddedCheckoutIframeUrl:function(){return eb},getExpressButtonIframeUrl:function(){return e_},getOverlayLoaderIframeUrl:function(){return ek},getRequirementOverlayIframeUrl:function(){return eE},getUtmFromCurrentUrl:function(){return eS},injectPixel:function(){return ej},isWhopCheckoutMessage:function(){return G},isWhopEmbeddedCheckoutEnvironment:function(){return em},onWhopCheckoutMessage:function(){return er},parseSetupFutureUsage:function(){return eh},setAddress:function(){return ed},setDisplayCurrency:function(){return ef},setEmail:function(){return ec},submitCheckoutFrame:function(){return ev},toWhopEmbeddedCheckoutEnvironment:function(){return ey}});module.exports=A(M);var L=/*#__PURE__*/function(e){f(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);x(e,"type","WhopCheckoutError");return e}return t}(O(Error));var F=/*#__PURE__*/function(e){f(t,e);function t(e){i(this,t);var r;r=a(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);x(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(L);var T=/*#__PURE__*/function(e){f(t,e);function t(e){i(this,t);var r;r=a(this,t,[e!==null&&e!==void 0?e:"Aborted waiting for embed response"]);x(r,"name","WhopCheckoutRpcAbortedError");return r}return t}(L);var B=/*#__PURE__*/function(e){f(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);x(e,"name","WhopCheckoutSetEmailError");return e}return t}(L);var N=/*#__PURE__*/function(e){f(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);x(e,"name","WhopCheckoutSetAddressError");return e}return t}(L);var X=/*#__PURE__*/function(e){f(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);x(e,"name","WhopCheckoutGetAddressError");return e}return t}(L);var H=/*#__PURE__*/function(e){f(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);x(e,"name","WhopCheckoutSetDisplayCurrencyError");return e}return t}(L);var K=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error","promo-code-changed","payment-request-merchant-validation-result","payment-request-update-request","payment-request-create-request","payment-request-event-result","plaid-token-request","plaid-ready","identity-captured","currencies-available","currency-changed","set-display-currency-result","express-method-resolved","express-loading","request-overlay","request-requirement-overlay","close-overlay"];function G(e){return k(e.data)=="object"&&e.data!==null&&"event"in e.data&&K.includes(e.data.event)}function z(e,t){return G(e)&&e.data.event===t}var J=[];function V(e){return J[e]||(J[e]=(e+256).toString(16).slice(1))}function $(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":k(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,V(e[0])+V(e[1])+V(e[2])+V(e[3])+"-"+V(e[4])+V(e[5])+"-"+V(e[6])+V(e[7])+"-"+V(e[8])+V(e[9])+"-"+V(e[10])+V(e[11])+V(e[12])+V(e[13])+V(e[14])+V(e[15])}function Q(e,t,r,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3,a=arguments.length>5?arguments[5]:void 0;var i;var u=new URL(e.src).origin,s=$();return(i=e.contentWindow)===null||i===void 0?void 0:i.postMessage(b(y({},t),{__scope:"whop-embedded-checkout",event_id:s}),u),new Promise(function(t,i){if(a===null||a===void 0?void 0:a.aborted){i(new Error("Aborted"));return}var u=function(){c&&clearTimeout(c),window.removeEventListener("message",d),a===null||a===void 0?void 0:a.removeEventListener("abort",l)},c=o!==null?setTimeout(function(){i(new F),u()},o):null,l=function(){i(new T),u()};a===null||a===void 0?void 0:a.addEventListener("abort",l,{once:!0});var d=function(o){if(o.source===e.contentWindow&&z(o,r)&&o.data.event===r&&o.data.event_id===s){u();try{t(n(o.data))}catch(e){i(e)}}};window.addEventListener("message",d)})}var Y=/*#__PURE__*/function(){function e(t,r,n,o){i(this,e);this.iframe=t;this.methodData=r;this.details=n;this.options=o;x(this,"id",$());x(this,"abortController")}c(e,[{key:"active",get:function t(){var t;return(t=e.activeRequests.get(this.iframe))!==null&&t!==void 0?t:!1}},{key:"updateMethodData",value:function e(e){this.methodData=e}},{key:"updateDetails",value:function e(e){this.details=e}},{key:"updateOptions",value:function e(e){this.options=e}},{key:"getResult",value:function e(){return o(function(){var e,t,r,n,a,i,u,s,c,l;return U(this,function(d){switch(d.label){case 0:e=this;t=new AbortController;this.abortController=t;r=new PaymentRequest(this.methodData,this.details,this.options);r.onmerchantvalidation=function(n){return o(function(){var e,o;return U(this,function(a){switch(a.label){case 0:e={event:"payment-request-merchant-validation-request",validationURL:n.validationURL,methodName:n.methodName,id:this.id};return[4,Q(this.iframe,e,"payment-request-merchant-validation-result",function(e){return e},null,t.signal).catch(function(){return null})];case 1:o=a.sent();(o===null||o===void 0?void 0:o.ok)?n.complete(o.merchantSession):r.abort();return[2]}})}).call(e)},r.onshippingaddresschange=function(e){e.updateWith({})},r.onpaymentmethodchange=function(r){return o(function(){var e,n;return U(this,function(o){switch(o.label){case 0:e={event:"payment-request-payment-method-change-request",id:this.id,data:r.methodDetails};return[4,Q(this.iframe,e,"payment-request-event-result",function(e){return e},null,t.signal).catch(function(){return null})];case 1:n=o.sent();(n===null||n===void 0?void 0:n.ok)?r.updateWith(n.details):r.updateWith({});return[2]}})}).call(e)};n=r;d.label=1;case 1:d.trys.push([1,,6,7]);s=new Promise(function(e,r){var n=function(){r(new Error("Aborted"))};t.signal.addEventListener("abort",n,{once:!0}),a=function(){t.signal.removeEventListener("abort",n)}});return[4,Promise.race([r.show().then(function(e){return n=null,e}),s])];case 2:c=d.sent(),l=this.methodData.find(function(e){return e.supportedMethods===c.methodName});if(!!l)return[3,4];return[4,c.complete("fail")];case 3:throw d.sent(),new Error("PaymentRequest failed to complete because of missing method data");case 4:return[4,c.complete("success")];case 5:return[2,(d.sent(),{method:c.methodName,response:{payerEmail:c.payerEmail,details:JSON.parse(JSON.stringify(c.details))},options:this.options,methodData:{applePayMerchantIdentifier:l===null||l===void 0?void 0:(i=l.data)===null||i===void 0?void 0:i.merchantIdentifier,requestShipping:l===null||l===void 0?void 0:(u=l.data)===null||u===void 0?void 0:u.requiredShippingContactFields}})];case 6:n===null||n===void 0?void 0:n.abort(),a===null||a===void 0?void 0:a(),this.abortController=void 0;return[7];case 7:return[2]}})}).call(this)}},{key:"abort",value:function e(){var e;(e=this.abortController)===null||e===void 0?void 0:e.abort()}}],[{key:"get",value:function t(t){var r;return(r=e.requests.get(t))!==null&&r!==void 0?r:null}},{key:"create",value:function t(t,r,n,o){var a=new e(t,r,n,o);return e.requests.set(t,a),a}},{key:"remove",value:function t(t){var r;(r=e.requests.get(t))===null||r===void 0?void 0:r.abort(),e.requests.delete(t),e.activeRequests.delete(t)}},{key:"setActive",value:function t(t,r){e.activeRequests.set(t,r)}}]);return e}();x(Y,"requests",new WeakMap),x(Y,"activeRequests",new WeakMap);var Z=Y;var ee=3,et="https://cdn.plaid.com/link/v2/stable/link-initialize.js";function er(e,t,r){function n(n){if(n.source===e.contentWindow&&G(n)){switch(n.data.event){case"request-overlay":case"request-requirement-overlay":{r===null||r===void 0?void 0:r.handleOverlayRequest(n.data);return}case"close-overlay":{if(r){r.handleCloseOverlay(n.data);return}break}case"payment-request-create-request":{try{var a;var i=Z.create(e,n.data.method_data,n.data.details,n.data.options),u={__scope:"whop-embedded-checkout",event:"payment-request-create-result",event_id:n.data.event_id,ok:!0,id:i.id},s=new URL(e.src).origin;(a=e.contentWindow)===null||a===void 0?void 0:a.postMessage(u,s)}catch(t){var c;var l={__scope:"whop-embedded-checkout",event:"payment-request-create-result",event_id:n.data.event_id,ok:!1,error:p(t,Error)?t.message:"Unknown error"},d=new URL(e.src).origin;(c=e.contentWindow)===null||c===void 0?void 0:c.postMessage(l,d)}return}case"payment-request-update-request":{"active"in n.data&&typeof n.data.active=="boolean"&&Z.setActive(e,n.data.active);try{var f;var v=Z.get(e);if(!v)throw new Error("Payment request not found");"method_data"in n.data&&n.data.method_data&&v.updateMethodData(n.data.method_data),"details"in n.data&&n.data.details&&v.updateDetails(n.data.details),"options"in n.data&&n.data.options&&v.updateOptions(n.data.options);var h={__scope:"whop-embedded-checkout",event:"payment-request-update-result",event_id:n.data.event_id,ok:!0},m=new URL(e.src).origin;(f=e.contentWindow)===null||f===void 0?void 0:f.postMessage(h,m)}catch(t){var y;var w={__scope:"whop-embedded-checkout",event:"payment-request-update-result",event_id:n.data.event_id,ok:!1,error:p(t,Error)?t.message:"Unknown error"},b=new URL(e.src).origin;(y=e.contentWindow)===null||y===void 0?void 0:y.postMessage(w,b)}return}case"plaid-token-request":{var g=n.data;(function(){return o(function(){var t,r,n,o,a,i,u,s,c;return U(this,function(l){switch(l.label){case 0:l.trys.push([0,3,,4]);return[4,eo()];case 1:r=l.sent();return[4,new Promise(function(e,t){var n=r.create({token:g.token,onSuccess:function(t){e(t),n.destroy()},onExit:function(e){var r;t(new Error((r=e===null||e===void 0?void 0:e.display_message)!==null&&r!==void 0?r:"Canceled by user")),n.destroy()}});n.open()})];case 2:n=l.sent(),o={__scope:"whop-embedded-checkout",event:"plaid-token-result",event_id:g.event_id,ok:!0,token:n},a=new URL(e.src).origin;(t=e.contentWindow)===null||t===void 0?void 0:t.postMessage(o,a);return[3,4];case 3:i=l.sent();s={__scope:"whop-embedded-checkout",event:"plaid-token-result",event_id:g.event_id,ok:!1,error:p(i,Error)?i.message:"Unknown error"},c=new URL(e.src).origin;(u=e.contentWindow)===null||u===void 0?void 0:u.postMessage(s,c);return[3,4];case 4:return[2]}})})()})();return}case"plaid-ready":{try{eo().catch(function(){})}catch(e){}return}}t(n.data)}}return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}}var en=null;function eo(){return o(function(){var e,t;return U(this,function(r){switch(r.label){case 0:eu();if(!window.Plaid)return[3,1];e=window.Plaid;return[3,6];case 1:if(!en)return[3,3];return[4,en];case 2:t=r.sent();return[3,5];case 3:en=es();return[4,en];case 4:t=r.sent();r.label=5;case 5:e=t;r.label=6;case 6:return[2,e]}})})()}var ea="whop-checkout-plaid-link-style",ei="iframe[id^='plaid-link-iframe-'] { pointer-events: auto; }";function eu(){if(!document.getElementById(ea)){var e=document.createElement("style");e.id=ea,e.textContent=ei,document.head.appendChild(e)}}function es(){return o(function(){var e;return U(this,function(t){e=document.createElement("script");return[2,(e.src=et,e.async=!0,e.defer=!0,document.head.appendChild(e),new Promise(function(t,r){e.onload=function(){window.Plaid?t(window.Plaid):r(new Error("Plaid not available"))},e.onerror=function(){return r(new Error("Failed to load Plaid Link script"))},en=null}))]})})()}function ec(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return U(this,function(n){return[2,Q(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new B(e.error)},r)]})})()}function el(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return U(this,function(r){return[2,Q(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()}function ed(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return U(this,function(n){return[2,Q(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new N(e.error)},r)]})})()}function ef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return U(this,function(n){return[2,Q(e,{event:"set-display-currency",currency:t},"set-display-currency-result",function(e){if(!e.ok)throw new H(e.error)},r)]})})()}function ep(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return U(this,function(r){return[2,Q(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new X(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()}function ev(e,t){return o(function(){var t,r,n,o,a;return U(this,function(i){switch(i.label){case 0:r={__scope:"whop-embedded-checkout",event:"submit",event_id:$()},n=Z.get(e);if(!(n===null||n===void 0?void 0:n.active))return[3,2];return[4,n.getResult()];case 1:o=i.sent();r.payment_request_result=o;i.label=2;case 2:a=new URL(e.src).origin;(t=e.contentWindow)===null||t===void 0?void 0:t.postMessage(r,a);return[2]}})})()}function eh(e){if(e==="off_session")return"off_session"}function em(e){return e==="production"||e==="sandbox"}function ey(e){return em(e)?e:"production"}function ew(e,t){var r,n,o;if(t.paymentRedirectUrl&&e.searchParams.set("payment_redirect_url",t.paymentRedirectUrl),t.skipRedirect&&e.searchParams.set("skip_redirect","true"),t.theme&&e.searchParams.set("theme",t.theme),t.affiliateCode&&e.searchParams.set("a",t.affiliateCode),t.setupFutureUsage&&e.searchParams.set("setup_future_usage",t.setupFutureUsage),t.stateId&&e.searchParams.set("state_id",t.stateId),t.promoCode&&e.searchParams.set("promoCode",t.promoCode),t.utm){var a=true,i=false,u=undefined,s=true,c=false,l=undefined;try{for(var d=Object.entries(t.utm).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),f;!(s=(f=d.next()).done);s=true){var p=E(f.value,2),v=p[0],h=p[1];if(v.startsWith("utm_"))if(Array.isArray(h))try{for(var m=h[Symbol.iterator](),y;!(a=(y=m.next()).done);a=true){var w=y.value;e.searchParams.append(v,w)}}catch(e){i=true;u=e}finally{try{if(!a&&m.return!=null){m.return()}}finally{if(i){throw u}}}else e.searchParams.set(v,h)}}catch(e){c=true;l=e}finally{try{if(!s&&d.return!=null){d.return()}}finally{if(c){throw l}}}}var b=true,g=false,_=undefined;if(((r=t.prefill)===null||r===void 0?void 0:r.email)&&e.searchParams.set("email",t.prefill.email),eg(e,(n=t.prefill)===null||n===void 0?void 0:n.address),eg(e,(o=t.prefill)===null||o===void 0?void 0:o.shippingAddress,"shipping."),t.themeOptions)try{for(var k=Object.entries(t.themeOptions)[Symbol.iterator](),P;!(b=(P=k.next()).done);b=true){var O=E(P.value,2),C=O[0],U=O[1];U&&e.searchParams.set("theme.".concat(C),typeof U=="boolean"?"1":U)}}catch(e){g=true;_=e}finally{try{if(!b&&k.return!=null){k.return()}}finally{if(g){throw _}}}t.resolvedWuid&&e.searchParams.set("wuid",t.resolvedWuid),t.adaptivePricing&&e.searchParams.set("adaptive_pricing","1")}function eb(e,t,r,n,o,a,i,u,s,c,l,d,f,p,v,h,m,y,w,b){var g=arguments.length>20&&arguments[20]!==void 0?arguments[20]:"production",_=arguments.length>21?arguments[21]:void 0,k=arguments.length>22?arguments[22]:void 0,P=arguments.length>23?arguments[23]:void 0;var O=_||eP(),C=typeof r=="string"&&!r.startsWith("ch_XXXXX")?r:e,U=new URL("/embedded/checkout/".concat(C,"/"),eW(n,g));if(g==="sandbox"&&n&&console.warn("Ignoring environment in favor of provided origin"),eD(U),ew(U,{theme:t,skipRedirect:a,affiliateCode:h,setupFutureUsage:m,paymentRedirectUrl:y,stateId:w,promoCode:b,utm:i,prefill:s,themeOptions:c,resolvedWuid:O,adaptivePricing:k}),r&&U.searchParams.set("session",r),o&&U.searchParams.set("hide_price","true"),l&&U.searchParams.set("hide_submit_button","true"),d&&U.searchParams.set("hide_tos","true"),f&&U.searchParams.set("email.hidden","1"),p&&U.searchParams.set("email.disabled","1"),v&&U.searchParams.set("address.hidden","1"),P!=null&&U.searchParams.set("collectPhoneNumbers",P?"1":"0"),u){var R=true,S=false,q=undefined,I=true,W=false,j=undefined;try{for(var D=Object.entries(u)[Symbol.iterator](),A;!(I=(A=D.next()).done);I=true){var x=E(A.value,2),M=x[0],L=x[1];if(L)try{for(var F=Object.entries(L)[Symbol.iterator](),T;!(R=(T=F.next()).done);R=true){var B=E(T.value,2),N=B[0],X=B[1];U.searchParams.set("style.".concat(M,".").concat(N),X.toString())}}catch(e){S=true;q=e}finally{try{if(!R&&F.return!=null){F.return()}}finally{if(S){throw q}}}}}catch(e){W=true;j=e}finally{try{if(!I&&D.return!=null){D.return()}}finally{if(W){throw j}}}}return U.toString()}function eg(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";t&&(t.name&&e.searchParams.set("".concat(r,"name"),t.name),t.line1&&e.searchParams.set("".concat(r,"address.line1"),t.line1),t.line2&&e.searchParams.set("".concat(r,"address.line2"),t.line2),t.city&&e.searchParams.set("".concat(r,"address.city"),t.city),t.country&&e.searchParams.set("".concat(r,"address.country"),t.country),t.state&&e.searchParams.set("".concat(r,"address.state"),t.state),t.postalCode&&e.searchParams.set("".concat(r,"address.postal_code"),t.postalCode))}function e_(e){var t=e.planId,r=e.checkoutConfigurationId,n=e.theme,o=e.origin,a=e.utm,i=e.prefill,u=e.themeOptions,s=e.affiliateCode,c=e.paymentRedirectUrl,l=e.stateId,d=e.promoCode,f=e.environment,p=f===void 0?"production":f,v=e.wuid,h=e.adaptivePricing,m=e.methods,y=e.setupFutureUsage,w=e.skipRedirect,b=v||eP(),g=r!==null&&r!==void 0?r:t,_=new URL("/embedded/checkout/".concat(g,"/express/"),eW(o,p));var E=true,k=false,P=undefined;if(r&&_.searchParams.set("session",r),p==="sandbox"&&o&&console.warn("Ignoring environment in favor of provided origin"),eD(_),ew(_,{theme:n,skipRedirect:w,affiliateCode:s,setupFutureUsage:y,paymentRedirectUrl:c,stateId:l,promoCode:d,utm:a,prefill:i,themeOptions:u,resolvedWuid:b,adaptivePricing:h}),m)try{for(var O=m[Symbol.iterator](),C;!(E=(C=O.next()).done);E=true){var U=C.value;_.searchParams.append("methods",U)}}catch(e){k=true;P=e}finally{try{if(!E&&O.return!=null){O.return()}}finally{if(k){throw P}}}return _.toString()}function eE(e){var t=e.channelId,r=e.theme,n=e.origin,o=e.environment,a=o===void 0?"production":o,i=new URL("/embedded/checkout/requirements/",eW(n,a));return i.searchParams.set("channel",t),eD(i),r&&i.searchParams.set("theme",r),i.toString()}function ek(e){var t=e.channelId,r=e.theme,n=e.origin,o=e.environment,a=o===void 0?"production":o,i=new URL("/embedded/checkout/overlay-loader/",eW(n,a));return i.searchParams.set("channel",t),eD(i),r&&i.searchParams.set("theme",r),i.toString()}function eP(){var e;if((typeof document==="undefined"?"undefined":k(document))>"u")return;var t=(e=document.cookie.match(/(?:^|;\s*)_wuid=([^;]*)/))===null||e===void 0?void 0:e[1];return(t===null||t===void 0?void 0:t.startsWith("wuid_"))?t:void 0}var eO=["allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"],eC="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";function eU(e){var t;if(!((t=window.whop)===null||t===void 0?void 0:t.track))return;var r={};e.email&&(r.email=e.email),e.user_id&&(r.user_id=e.user_id),window.whop.track("id",b(y({},r),{source:"embedded_checkout"}))}function eR(){var e=window;try{for(e.parent.location.href;e.location.origin==="null"&&e!==e.parent;)e=e.parent}catch(e){}return new URLSearchParams(e.location.search)}function eS(){var e=eR();return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var n=e.getAll(r);return n.length===1?t[r]=n[0]:n.length>1&&(t[r]=n),t},{})}var eq="__whopCheckoutInternalOriginOverride";function eI(){if((typeof window==="undefined"?"undefined":k(window))>"u")return;var e=window[eq];return typeof e=="string"&&e.length>0?e:void 0}function eW(e,t){if(e)return e;var r=eI();return r||(t==="sandbox"?"https://sandbox.whop.com/":"https://whop.com/")}function ej(e){if(window.whop||document.querySelector('script[src*="t.whop.tw/e/"]'))return;var t=document.createElement("script");t.async=!0,t.src="https://t.whop.tw/e/".concat(e,".js"),document.head.appendChild(t)}function eD(e){e.searchParams.set("h",window.location.origin),e.searchParams.set("v",ee.toString());try{var t=window;for(;t.parent!==t;)t=t.parent;var r=t.location.hostname;t.location.protocol==="https:"&&r&&e.searchParams.set("t",r)}catch(e){}}0&&(module.exports={EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,firePixelIdentify:firePixelIdentify,getAddress:getAddress,getEmail:getEmail,getEmbeddedCheckoutIframeUrl:getEmbeddedCheckoutIframeUrl,getExpressButtonIframeUrl:getExpressButtonIframeUrl,getOverlayLoaderIframeUrl:getOverlayLoaderIframeUrl,getRequirementOverlayIframeUrl:getRequirementOverlayIframeUrl,getUtmFromCurrentUrl:getUtmFromCurrentUrl,injectPixel:injectPixel,isWhopCheckoutMessage:isWhopCheckoutMessage,isWhopEmbeddedCheckoutEnvironment:isWhopEmbeddedCheckoutEnvironment,onWhopCheckoutMessage:onWhopCheckoutMessage,parseSetupFutureUsage:parseSetupFutureUsage,setAddress:setAddress,setDisplayCurrency:setDisplayCurrency,setEmail:setEmail,submitCheckoutFrame:submitCheckoutFrame,toWhopEmbeddedCheckoutEnvironment:toWhopEmbeddedCheckoutEnvironment});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { B as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, E as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, b as WhopCheckoutCurrenciesAvailable, e as WhopCheckoutCurrencyChanged, l as WhopCheckoutMessage, d as WhopCheckoutPromoCode, c as WhopCheckoutState, W as WhopCheckoutSubmitDetails, h as WhopEmbeddedCheckoutEnvironment, g as WhopEmbeddedCheckoutPrefillOptions, f as WhopEmbeddedCheckoutStyleOptions, u as WhopEmbeddedCheckoutThemeOptions, C as firePixelIdentify, q as getAddress, m as getEmail, x as getEmbeddedCheckoutIframeUrl, y as getExpressButtonIframeUrl, A as getOverlayLoaderIframeUrl, z as getRequirementOverlayIframeUrl, D as getUtmFromCurrentUrl, F as injectPixel, k as isWhopCheckoutMessage, v as isWhopEmbeddedCheckoutEnvironment, o as onWhopCheckoutMessage, t as parseSetupFutureUsage, n as setAddress, p as setDisplayCurrency, s as setEmail, r as submitCheckoutFrame, w as toWhopEmbeddedCheckoutEnvironment } from './util-ijY_vXnC.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { B as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, E as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, b as WhopCheckoutCurrenciesAvailable, e as WhopCheckoutCurrencyChanged, l as WhopCheckoutMessage, d as WhopCheckoutPromoCode, c as WhopCheckoutState, W as WhopCheckoutSubmitDetails, h as WhopEmbeddedCheckoutEnvironment, g as WhopEmbeddedCheckoutPrefillOptions, f as WhopEmbeddedCheckoutStyleOptions, u as WhopEmbeddedCheckoutThemeOptions, C as firePixelIdentify, q as getAddress, m as getEmail, x as getEmbeddedCheckoutIframeUrl, y as getExpressButtonIframeUrl, A as getOverlayLoaderIframeUrl, z as getRequirementOverlayIframeUrl, D as getUtmFromCurrentUrl, F as injectPixel, k as isWhopCheckoutMessage, v as isWhopEmbeddedCheckoutEnvironment, o as onWhopCheckoutMessage, t as parseSetupFutureUsage, n as setAddress, p as setDisplayCurrency, s as setEmail, r as submitCheckoutFrame, w as toWhopEmbeddedCheckoutEnvironment } from './util-ijY_vXnC.js';
|