ngx-stripe
Version:
Collect Payments with Stripe: The Angular Way
4,152 lines • 183 kB
JavaScript
import * as i3 from '@angular/common';
import { isPlatformBrowser, isPlatformServer, CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { Directive, InjectionToken, PLATFORM_ID, Injectable, Inject, EventEmitter, Input, Output, TemplateRef, Component, Optional, ContentChild, ViewChild, makeEnvironmentProviders, NgModule, inject } from '@angular/core';
import { filter, first, map, switchMap } from 'rxjs/operators';
import { BehaviorSubject, from } from 'rxjs';
class NgxStripeElementLoadingTemplateDirective {
templateRef;
constructor(templateRef) {
this.templateRef = templateRef;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxStripeElementLoadingTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.1", type: NgxStripeElementLoadingTemplateDirective, isStandalone: true, selector: "[ngxStripeLoadingTemplate]", ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxStripeElementLoadingTemplateDirective, decorators: [{
type: Directive,
args: [{
selector: '[ngxStripeLoadingTemplate]',
standalone: true
}]
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
const STRIPE_PUBLISHABLE_KEY = new InjectionToken('Stripe Publishable Key');
const STRIPE_OPTIONS = new InjectionToken('Stripe Options');
const NGX_STRIPE_VERSION = new InjectionToken('NGX_STRIPE_VERSION');
class StripeInstance {
version;
loader;
window;
key;
options;
stripe$ = new BehaviorSubject(undefined);
stripe = this.stripe$.asObservable().pipe(filter((stripe) => Boolean(stripe)));
constructor(version, loader, window, key, options) {
this.version = version;
this.loader = loader;
this.window = window;
this.key = key;
this.options = options;
this.loader
.asStream()
.pipe(filter((status) => status.loaded === true), first(), map(() => this.window.getNativeWindow().Stripe))
.subscribe((stripeInstance) => {
const stripe = this.options
? stripeInstance(this.key, this.options)
: stripeInstance(this.key);
stripe.registerAppInfo(this.getNgxStripeAppInfo(this.version));
this.stripe$.next(stripe);
});
}
getInstance() {
return this.stripe$.getValue();
}
elements(options) {
return this.stripe.pipe(map((stripe) => stripe.elements(options)), first());
}
redirectToCheckout(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.redirectToCheckout(options))), first());
}
confirmPayment(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmPayment(options))), first());
}
confirmAcssDebitPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmAcssDebitPayment(clientSecret, data, options))), first());
}
confirmUsBankAccountPayment(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmUsBankAccountPayment(clientSecret, data))), first());
}
confirmAlipayPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmAlipayPayment(clientSecret, data, options))), first());
}
confirmAuBecsDebitPayment(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmAuBecsDebitPayment(clientSecret, data))), first());
}
confirmBancontactPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmBancontactPayment(clientSecret, data, options))), first());
}
confirmBlikPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmBlikPayment(clientSecret, data, options))), first());
}
confirmBoletoPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmBoletoPayment(clientSecret, data, options))), first());
}
confirmCardPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmCardPayment(clientSecret, data, options))), first());
}
confirmCashappPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmCashappPayment(clientSecret, data, options))), first());
}
confirmCustomerBalancePayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmCustomerBalancePayment(clientSecret, data, options))), first());
}
confirmEpsPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmEpsPayment(clientSecret, data, options))), first());
}
confirmFpxPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmFpxPayment(clientSecret, data, options))), first());
}
confirmGiropayPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmGiropayPayment(clientSecret, data, options))), first());
}
confirmGrabPayPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmGrabPayPayment(clientSecret, data, options))), first());
}
confirmIdealPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmIdealPayment(clientSecret, data, options))), first());
}
confirmKlarnaPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmKlarnaPayment(clientSecret, data, options))), first());
}
confirmKonbiniPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmKonbiniPayment(clientSecret, data, options))), first());
}
confirmMobilepayPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmMobilepayPayment(clientSecret, data, options))), first());
}
confirmOxxoPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmOxxoPayment(clientSecret, data, options))), first());
}
confirmP24Payment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmP24Payment(clientSecret, data, options))), first());
}
confirmPayNowPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmPayNowPayment(clientSecret, data, options))), first());
}
confirmPayPalPayment(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmPayPalPayment(clientSecret, data))), first());
}
confirmPixPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmPixPayment(clientSecret, data, options))), first());
}
confirmPromptPayPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmPromptPayPayment(clientSecret, data, options))), first());
}
confirmSepaDebitPayment(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmSepaDebitPayment(clientSecret, data))), first());
}
confirmSofortPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmSofortPayment(clientSecret, data, options))), first());
}
confirmWechatPayPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmWechatPayPayment(clientSecret, data, options))), first());
}
handleCardAction(clientSecret) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.handleCardAction(clientSecret))), first());
}
handleNextAction(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.handleNextAction(options))), first());
}
verifyMicrodepositsForPayment(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.verifyMicrodepositsForPayment(clientSecret, data))), first());
}
createRadarSession() {
return this.stripe.pipe(switchMap((stripe) => from(stripe.createRadarSession())), first());
}
collectBankAccountForPayment(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.collectBankAccountForPayment(options))), first());
}
createPaymentMethod(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.createPaymentMethod(options))), first());
}
createConfirmationToken(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.createConfirmationToken(options))), first());
}
retrievePaymentIntent(clientSecret) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.retrievePaymentIntent(clientSecret))), first());
}
confirmSetup(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmSetup(options))), first());
}
confirmAcssDebitSetup(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmAcssDebitSetup(clientSecret, data, options))), first());
}
confirmUsBankAccountSetup(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmUsBankAccountSetup(clientSecret, data))), first());
}
confirmAuBecsDebitSetup(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmAuBecsDebitSetup(clientSecret, data))), first());
}
confirmBacsDebitSetup(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmBacsDebitSetup(clientSecret, data))), first());
}
confirmBancontactSetup(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmBancontactSetup(clientSecret, data))), first());
}
confirmCardSetup(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmCardSetup(clientSecret, data, options))), first());
}
confirmCashappSetup(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmCashappSetup(clientSecret, data, options))), first());
}
confirmIdealSetup(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmIdealSetup(clientSecret, data))), first());
}
confirmPayPalSetup(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmPayPalSetup(clientSecret, data))), first());
}
confirmSepaDebitSetup(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmSepaDebitSetup(clientSecret, data))), first());
}
confirmSofortSetup(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmSofortSetup(clientSecret, data, options))), first());
}
confirmAffirmPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmAffirmPayment(clientSecret, data, options))), first());
}
confirmAfterpayClearpayPayment(clientSecret, data, options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmAfterpayClearpayPayment(clientSecret, data, options))), first());
}
verifyMicrodepositsForSetup(clientSecret, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.verifyMicrodepositsForSetup(clientSecret, data))), first());
}
collectBankAccountForSetup(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.collectBankAccountForSetup(options))), first());
}
retrieveSetupIntent(clientSecret) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.retrieveSetupIntent(clientSecret))), first());
}
processOrder(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.processOrder(options))), first());
}
retrieveOrder(clientSecret) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.retrieveOrder(clientSecret))), first());
}
paymentRequest(options) {
const stripe = this.getInstance();
return stripe.paymentRequest(options);
}
createToken(tokenType, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.createToken(tokenType, data))), first());
}
createSource(a, b) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.createSource(a, b))), first());
}
retrieveSource(source) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.retrieveSource(source))), first());
}
verifyIdentity(clientSecret) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.verifyIdentity(clientSecret))), first());
}
collectFinancialConnectionsAccounts(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.collectFinancialConnectionsAccounts(options))), first());
}
collectBankAccountToken(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.collectBankAccountToken(options))), first());
}
createEphemeralKeyNonce(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.createEphemeralKeyNonce(options))), first());
}
initCheckout(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.initCheckout(options))), first());
}
initEmbeddedCheckout(options) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.initEmbeddedCheckout(options))), first());
}
/**
* @deprecated
*/
handleCardPayment(clientSecret, element, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.handleCardPayment(clientSecret, element, data))), first());
}
/**
* @deprecated
*/
confirmPaymentIntent(clientSecret, element, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmPaymentIntent(clientSecret, element, data))), first());
}
/**
* @deprecated
*/
handleCardSetup(clientSecret, element, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.handleCardSetup(clientSecret, element, data))), first());
}
/**
* @deprecated
*/
confirmSetupIntent(clientSecret, element, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.confirmSetupIntent(clientSecret, element, data))), first());
}
/**
* @deprecated
*/
handleFpxPayment(clientSecret, element, data) {
return this.stripe.pipe(switchMap((stripe) => from(stripe.handleFpxPayment(clientSecret, element, data))), first());
}
getNgxStripeAppInfo(version) {
return {
name: 'ngx-stripe',
url: 'https://ngx-stripe.dev',
partner_id: 'pp_partner_JR4l1rmvUoPP4V',
version
};
}
}
class WindowRef {
platformId;
constructor(platformId) {
this.platformId = platformId;
}
getNativeWindow() {
if (isPlatformBrowser(this.platformId)) {
return window;
}
return {};
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: WindowRef, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: WindowRef });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: WindowRef, decorators: [{
type: Injectable
}], ctorParameters: () => [{ type: undefined, decorators: [{
type: Inject,
args: [PLATFORM_ID]
}] }] });
class DocumentRef {
platformId;
constructor(platformId) {
this.platformId = platformId;
}
getNativeDocument() {
if (isPlatformBrowser(this.platformId)) {
return document;
}
return {};
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: DocumentRef, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: DocumentRef });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: DocumentRef, decorators: [{
type: Injectable
}], ctorParameters: () => [{ type: undefined, decorators: [{
type: Inject,
args: [PLATFORM_ID]
}] }] });
class LazyStripeAPILoader {
platformId;
window;
document;
status = new BehaviorSubject({
error: false,
loaded: false,
loading: false
});
constructor(platformId, window, document) {
this.platformId = platformId;
this.window = window;
this.document = document;
}
asStream() {
this.load();
return this.status.asObservable();
}
isReady() {
return this.status.getValue().loaded;
}
load() {
if (isPlatformServer(this.platformId)) {
return;
}
const status = this.status.getValue();
if (this.window.getNativeWindow().hasOwnProperty('Stripe')) {
this.status.next({
error: false,
loaded: true,
loading: false
});
}
else if (!status.loaded && !status.loading) {
this.status.next({
...status,
loading: true
});
const script = this.document.getNativeDocument().createElement('script');
script.type = 'text/javascript';
script.async = true;
script.defer = true;
script.src = 'https://js.stripe.com/v3/';
script.onload = () => {
this.status.next({
error: false,
loaded: true,
loading: false
});
};
script.onerror = () => {
this.status.next({
error: true,
loaded: false,
loading: false
});
};
this.document.getNativeDocument().body.appendChild(script);
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: LazyStripeAPILoader, deps: [{ token: PLATFORM_ID }, { token: WindowRef }, { token: DocumentRef }], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: LazyStripeAPILoader });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: LazyStripeAPILoader, decorators: [{
type: Injectable
}], ctorParameters: () => [{ type: undefined, decorators: [{
type: Inject,
args: [PLATFORM_ID]
}] }, { type: WindowRef }, { type: DocumentRef }] });
class StripeService {
version;
key;
options;
loader;
window;
stripe;
constructor(version, key, options, loader, window) {
this.version = version;
this.key = key;
this.options = options;
this.loader = loader;
this.window = window;
if (key) {
this.stripe = new StripeInstance(this.version, this.loader, this.window, key, options);
}
}
getStripeReference() {
return this.loader.asStream().pipe(filter((status) => status.loaded === true), map(() => this.window.getNativeWindow().Stripe));
}
getInstance() {
return this.stripe.getInstance();
}
setKey(key, options) {
return this.changeKey(key, options);
}
changeKey(key, options) {
this.stripe = new StripeInstance(this.version, this.loader, this.window, key, options);
return this.stripe;
}
elements(options) {
return this.stripe.elements(options);
}
redirectToCheckout(options) {
return this.stripe.redirectToCheckout(options);
}
confirmPayment(options) {
return this.stripe.confirmPayment(options);
}
confirmAcssDebitPayment(clientSecret, data, options) {
return this.stripe.confirmAcssDebitPayment(clientSecret, data, options);
}
confirmUsBankAccountPayment(clientSecret, data) {
return this.stripe.confirmUsBankAccountPayment(clientSecret, data);
}
confirmAlipayPayment(clientSecret, data, options) {
return this.stripe.confirmAlipayPayment(clientSecret, data, options);
}
confirmAuBecsDebitPayment(clientSecret, data) {
return this.stripe.confirmAuBecsDebitPayment(clientSecret, data);
}
confirmBancontactPayment(clientSecret, data, options) {
return this.stripe.confirmBancontactPayment(clientSecret, data, options);
}
confirmBlikPayment(clientSecret, data, options) {
return this.stripe.confirmBlikPayment(clientSecret, data, options);
}
confirmBoletoPayment(clientSecret, data, options) {
return this.stripe.confirmBoletoPayment(clientSecret, data, options);
}
confirmCardPayment(clientSecret, data, options) {
return this.stripe.confirmCardPayment(clientSecret, data, options);
}
confirmCashappPayment(clientSecret, data, options) {
return this.stripe.confirmCashappPayment(clientSecret, data, options);
}
confirmCustomerBalancePayment(clientSecret, data, options) {
return this.stripe.confirmCustomerBalancePayment(clientSecret, data, options);
}
confirmEpsPayment(clientSecret, data, options) {
return this.stripe.confirmEpsPayment(clientSecret, data, options);
}
confirmFpxPayment(clientSecret, data, options) {
return this.stripe.confirmFpxPayment(clientSecret, data, options);
}
confirmGiropayPayment(clientSecret, data, options) {
return this.stripe.confirmGiropayPayment(clientSecret, data, options);
}
confirmGrabPayPayment(clientSecret, data, options) {
return this.stripe.confirmGrabPayPayment(clientSecret, data, options);
}
confirmIdealPayment(clientSecret, data, options) {
return this.stripe.confirmIdealPayment(clientSecret, data, options);
}
confirmKlarnaPayment(clientSecret, data, options) {
return this.stripe.confirmKlarnaPayment(clientSecret, data, options);
}
confirmKonbiniPayment(clientSecret, data, options) {
return this.stripe.confirmKonbiniPayment(clientSecret, data, options);
}
confirmMobilepayPayment(clientSecret, data, options) {
return this.stripe.confirmMobilepayPayment(clientSecret, data, options);
}
confirmOxxoPayment(clientSecret, data, options) {
return this.stripe.confirmOxxoPayment(clientSecret, data, options);
}
confirmP24Payment(clientSecret, data, options) {
return this.stripe.confirmP24Payment(clientSecret, data, options);
}
confirmPayNowPayment(clientSecret, data, options) {
return this.stripe.confirmPayNowPayment(clientSecret, data, options);
}
confirmPayPalPayment(clientSecret, data) {
return this.stripe.confirmPayPalPayment(clientSecret, data);
}
confirmPixPayment(clientSecret, data, options) {
return this.stripe.confirmPixPayment(clientSecret, data, options);
}
confirmPromptPayPayment(clientSecret, data, options) {
return this.stripe.confirmPromptPayPayment(clientSecret, data, options);
}
confirmSepaDebitPayment(clientSecret, data) {
return this.stripe.confirmSepaDebitPayment(clientSecret, data);
}
confirmSofortPayment(clientSecret, data, options) {
return this.stripe.confirmSofortPayment(clientSecret, data, options);
}
confirmWechatPayPayment(clientSecret, data, options) {
return this.stripe.confirmWechatPayPayment(clientSecret, data, options);
}
handleCardAction(clientSecret) {
return this.stripe.handleCardAction(clientSecret);
}
handleNextAction(options) {
return this.stripe.handleNextAction(options);
}
verifyMicrodepositsForPayment(clientSecret, data) {
return this.stripe.verifyMicrodepositsForPayment(clientSecret, data);
}
createRadarSession() {
return this.stripe.createRadarSession();
}
collectBankAccountForPayment(options) {
return this.stripe.collectBankAccountForPayment(options);
}
createPaymentMethod(options) {
return this.stripe.createPaymentMethod(options);
}
createConfirmationToken(options) {
return this.stripe.createConfirmationToken(options);
}
retrievePaymentIntent(clientSecret) {
return this.stripe.retrievePaymentIntent(clientSecret);
}
confirmSetup(options) {
return this.stripe.confirmSetup(options);
}
confirmAcssDebitSetup(clientSecret, data, options) {
return this.stripe.confirmAcssDebitSetup(clientSecret, data, options);
}
confirmUsBankAccountSetup(clientSecret, data) {
return this.stripe.confirmUsBankAccountSetup(clientSecret, data);
}
confirmAuBecsDebitSetup(clientSecret, data) {
return this.stripe.confirmAuBecsDebitSetup(clientSecret, data);
}
confirmBacsDebitSetup(clientSecret, data) {
return this.stripe.confirmBacsDebitSetup(clientSecret, data);
}
confirmBancontactSetup(clientSecret, data) {
return this.stripe.confirmBancontactSetup(clientSecret, data);
}
confirmCardSetup(clientSecret, data, options) {
return this.stripe.confirmCardSetup(clientSecret, data, options);
}
confirmCashappSetup(clientSecret, data, options) {
return this.stripe.confirmCashappSetup(clientSecret, data, options);
}
confirmIdealSetup(clientSecret, data) {
return this.stripe.confirmIdealSetup(clientSecret, data);
}
confirmPayPalSetup(clientSecret, data) {
return this.stripe.confirmPayPalSetup(clientSecret, data);
}
confirmSepaDebitSetup(clientSecret, data) {
return this.stripe.confirmSepaDebitSetup(clientSecret, data);
}
confirmSofortSetup(clientSecret, data, options) {
return this.stripe.confirmSofortSetup(clientSecret, data, options);
}
confirmAffirmPayment(clientSecret, data, options) {
return this.stripe.confirmAffirmPayment(clientSecret, data, options);
}
confirmAfterpayClearpayPayment(clientSecret, data, options) {
return this.stripe.confirmAfterpayClearpayPayment(clientSecret, data, options);
}
verifyMicrodepositsForSetup(clientSecret, data) {
return this.stripe.verifyMicrodepositsForSetup(clientSecret, data);
}
collectBankAccountForSetup(options) {
return this.stripe.collectBankAccountForSetup(options);
}
retrieveSetupIntent(clientSecret) {
return this.stripe.retrieveSetupIntent(clientSecret);
}
processOrder(options) {
return this.stripe.processOrder(options);
}
retrieveOrder(clientSecret) {
return this.stripe.retrieveOrder(clientSecret);
}
paymentRequest(options) {
return this.stripe.paymentRequest(options);
}
createToken(tokenType, data) {
return this.stripe.createToken(tokenType, data);
}
createSource(a, b) {
return this.stripe.createSource(a, b);
}
retrieveSource(source) {
return this.stripe.retrieveSource(source);
}
verifyIdentity(clientSecret) {
return this.stripe.verifyIdentity(clientSecret);
}
collectFinancialConnectionsAccounts(options) {
return this.stripe.collectFinancialConnectionsAccounts(options);
}
collectBankAccountToken(options) {
return this.stripe.collectBankAccountToken(options);
}
createEphemeralKeyNonce(options) {
return this.stripe.createEphemeralKeyNonce(options);
}
initCheckout(options) {
return this.stripe.initCheckout(options);
}
initEmbeddedCheckout(options) {
return this.stripe.initEmbeddedCheckout(options);
}
/**
* @deprecated
*/
handleCardPayment(clientSecret, element, data) {
return this.stripe.handleCardPayment(clientSecret, element, data);
}
/**
* @deprecated
*/
confirmPaymentIntent(clientSecret, element, data) {
return this.stripe.confirmPaymentIntent(clientSecret, element, data);
}
/**
* @deprecated
*/
handleCardSetup(clientSecret, element, data) {
return this.stripe.handleCardSetup(clientSecret, element, data);
}
/**
* @deprecated
*/
confirmSetupIntent(clientSecret, element, data) {
return this.stripe.confirmSetupIntent(clientSecret, element, data);
}
/**
* @deprecated
*/
handleFpxPayment(clientSecret, element, data) {
return this.stripe.handleFpxPayment(clientSecret, element, data);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeService, deps: [{ token: NGX_STRIPE_VERSION }, { token: STRIPE_PUBLISHABLE_KEY }, { token: STRIPE_OPTIONS }, { token: LazyStripeAPILoader }, { token: WindowRef }], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeService });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeService, decorators: [{
type: Injectable
}], ctorParameters: () => [{ type: undefined, decorators: [{
type: Inject,
args: [NGX_STRIPE_VERSION]
}] }, { type: undefined, decorators: [{
type: Inject,
args: [STRIPE_PUBLISHABLE_KEY]
}] }, { type: undefined, decorators: [{
type: Inject,
args: [STRIPE_OPTIONS]
}] }, { type: LazyStripeAPILoader }, { type: WindowRef }] });
class StripeElementsService {
stripeService;
constructor(stripeService) {
this.stripeService = stripeService;
}
elements(stripe, options = {}) {
if (stripe) {
if (Object.keys(options).length > 0) {
return stripe.elements(options);
}
return stripe.elements();
}
else {
if (Object.keys(options).length > 0) {
return this.stripeService.elements(options);
}
return this.stripeService.elements();
}
}
paymentRequest(stripe, options) {
return stripe ? stripe.paymentRequest(options) : this.stripeService.paymentRequest(options);
}
mergeOptions(options, containerClass) {
if (!containerClass || (options && options.classes)) {
return options || {};
}
if (!options || !options.classes) {
return {
...(options || {}),
classes: {
base: containerClass,
complete: `${containerClass}--complete`,
empty: `${containerClass}--empty`,
focus: `${containerClass}--focus`,
invalid: `${containerClass}--invalid`,
webkitAutoFill: `${containerClass}--webkit-autoFill`
}
};
}
return options || {};
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeElementsService, deps: [{ token: StripeService }], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeElementsService });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeElementsService, decorators: [{
type: Injectable
}], ctorParameters: () => [{ type: StripeService }] });
class StripeElementsDirective {
stripeElementsService;
elementsOptions;
stripe;
elements = new EventEmitter();
_elements;
state = 'notready';
constructor(stripeElementsService) {
this.stripeElementsService = stripeElementsService;
}
async ngOnChanges(changes) {
this.state = 'starting';
const elementsOptions = this.elementsOptions;
const stripe = this.stripe;
if (!stripe) {
this.state = 'notready';
return;
}
if (changes.elementsOptions) {
if (this._elements) {
const payload = Object.keys(elementsOptions).reduce((acc, key) => {
if (elementsOptions[key] !== changes.elementsOptions.previousValue[key] &&
!['fonts', 'loader', 'clientSecret'].includes(key)) {
acc[key] = elementsOptions[key];
}
return acc;
}, {});
this._elements.update(payload);
}
else {
this._elements = await this.stripeElementsService.elements(stripe, elementsOptions).toPromise();
this.elements.emit(this._elements);
this.state = 'ready';
}
}
}
async ngOnInit() {
if (this.state === 'notready') {
this.state = 'starting';
this._elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.elements.emit(this._elements);
this.state = 'ready';
}
}
fetchUpdates() {
if (!this._elements)
return null;
return from(this._elements.fetchUpdates());
}
update(options) {
if (!this._elements)
return null;
return this._elements.update(options);
}
submit() {
if (!this._elements)
return null;
return from(this._elements.submit());
}
getElement(elementType) {
if (!this._elements)
return null;
switch (elementType) {
case 'address':
return this._elements.getElement('address');
case 'paymentMethodMessaging':
return this._elements.getElement('paymentMethodMessaging');
case 'affirmMessage':
return this._elements.getElement('affirmMessage');
case 'afterpayClearpayMessage':
return this._elements.getElement('afterpayClearpayMessage');
case 'auBankAccount':
return this._elements.getElement('auBankAccount');
case 'card':
return this._elements.getElement('card');
case 'cardNumber':
return this._elements.getElement('cardNumber');
case 'cardExpiry':
return this._elements.getElement('cardExpiry');
case 'cardCvc':
return this._elements.getElement('cardCvc');
case 'fpxBank':
return this._elements.getElement('fpxBank');
case 'epsBank':
return this._elements.getElement('epsBank');
case 'p24Bank':
return this._elements.getElement('p24Bank');
case 'iban':
return this._elements.getElement('iban');
case 'idealBank':
return this._elements.getElement('idealBank');
case 'linkAuthentication':
return this._elements.getElement('linkAuthentication');
case 'expressCheckout':
return this._elements.getElement('expressCheckout');
case 'payment':
return this._elements.getElement('payment');
case 'paymentRequestButton':
return this._elements.getElement('paymentRequestButton');
case 'shippingAddress':
return this._elements.getElement('shippingAddress');
default:
return this._elements.getElement(elementType);
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeElementsDirective, deps: [{ token: StripeElementsService }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.1", type: StripeElementsDirective, isStandalone: true, selector: "ngx-stripe-elements,[ngxStripeElements]", inputs: { elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { elements: "elements" }, usesOnChanges: true, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeElementsDirective, decorators: [{
type: Directive,
args: [{
selector: 'ngx-stripe-elements,[ngxStripeElements]',
standalone: true
}]
}], ctorParameters: () => [{ type: StripeElementsService }], propDecorators: { elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], elements: [{
type: Output
}] } });
class StripeAddressComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
loaderror = new EventEmitter();
loaderstart = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
return this.element.update(options);
}
getValue() {
const address = this.elements.getElement('address');
return address.getValue();
}
/**
* @deprecated
*/
getAddressElement() {
return this.element;
}
createElement(options) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('address', options);
this.element.on('change', (ev) => this.change.emit(ev));
this.element.on('blur', () => this.blur.emit());
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', () => this.ready.emit());
this.element.on('escape', () => this.escape.emit());
this.element.on('loaderror', () => this.loaderror.emit());
this.element.on('loaderstart', () => this.loaderstart.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeAddressComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeAddressComponent, isStandalone: true, selector: "ngx-stripe-address", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape", loaderror: "loaderror", loaderstart: "loaderstart" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeAddressComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-address',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}], loaderror: [{
type: Output
}], loaderstart: [{
type: Output
}] } });
class StripeAffirmMessageComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
ready = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getAffirmMessage() {
return this.element;
}
createElement(options) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('affirmMessage', options);
this.element.on('ready', () => this.ready.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeAffirmMessageComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeAffirmMessageComponent, isStandalone: true, selector: "ngx-stripe-affirm-message", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", ready: "ready" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeAffirmMessageComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-affirm-message',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], ready: [{
type: Output
}] } });
class StripeAfterpayClearpayMessageComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
ready = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getAfterpayClearpayMessage() {
return this.element;
}
createElement(options) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('afterpayClearpayMessage', options);
this.element.on('ready', () => this.ready.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeAfterpayClearpayMessageComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeAfterpayClearpayMessageComponent, isStandalone: true, selector: "ngx-stripe-afterpay-clearpay-message", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", ready: "ready" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeAfterpayClearpayMessageComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-afterpay-clearpay-message',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], ready: [{
type: Output
}] } });
class StripeCardComponent {
cdr;
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(cdr, stripeElementsService, elementsProvider) {
this.cdr = cdr;
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getCard() {
return this.element;
}
createElement(options = {}) {
this.state = 'ready';
this.cdr.detectChanges();
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('card', options);
this.element.on('change', (ev) => this.change.emit(ev));
this.element.on('blur', () => this.blur.emit());
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', () => this.ready.emit());
this.element.on('escape', () => this.escape.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeCardComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeCardComponent, isStandalone: true, selector: "ngx-stripe-card", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeCardComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-card',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripeCardGroupDirective {
stripeElementsService;
elementsOptions;
stripe;
elements = new EventEmitter();
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
_elements;
state = 'notready';
constructor(stripeElementsService) {
this.stripeElementsService = stripeElementsService;
}
async ngOnChanges(changes) {
this.state = 'starting';
const elementsOptions = this.elementsOptions;
const stripe = this.stripe;
if (changes.elementsOptions || changes.stripe || !this._elements) {
this._elements = await this.stripeElementsService.elements(stripe, elementsOptions).toPromise();
this.elements.emit(this._elements);
}
this.state = 'ready';
}
async ngOnInit() {
if (this.state === 'notready') {
this.state = 'starting';
this._elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.elements.emit(this._elements);
this.state = 'ready';
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeCardGroupDirective, deps: [{ token: StripeElementsService }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.1", type: StripeCardGroupDirective, isStandalone: true, selector: "ngx-stripe-card-group,[ngxStripeCardGroup]", inputs: { elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { elements: "elements", load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, usesOnChanges: true, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeCardGroupDirective, decorators: [{
type: Directive,
args: [{
selector: 'ngx-stripe-card-group,[ngxStripeCardGroup]',
standalone: true
}]
}], ctorParameters: () => [{ type: StripeElementsService }], propDecorators: { elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], elements: [{
type: Output
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripeCardNumberComponent {
stripeElementsService;
cardGroup;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
elements;
elementsSubscription;
constructor(stripeElementsService, cardGroup, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.cardGroup = cardGroup;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
if (changes.options || changes.containerClass) {
this.setupElement('options');
}
}
ngOnInit() {
if (this.cardGroup) {
this.elementsSubscription = this.cardGroup.elements.subscribe((elements) => {
this.elements = elements;
this.setupElement('elements');
});
}
else if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.setupElement('elements');
});
}
else {
throw new Error('StripeCardNumberComponent must have StripeCardGroupDirective or StripeElementsDirective parent');
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getCardNumber() {
return this.element;
}
setupElement(source) {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.element && source === 'options') {
this.update(options);
}
else if (this.elements && source === 'elements') {
this.element = this.elements.create('cardNumber', options);
this.element.on('change', (ev) => {
this.change.emit(ev);
this.cardGroup?.change.emit(ev);
});
this.element.on('blur', () => {
this.blur.emit();
this.cardGroup?.blur.emit();
});
this.element.on('focus', () => {
this.focus.emit();
this.cardGroup?.focus.emit();
});
this.element.on('ready', () => {
this.ready.emit();
this.cardGroup?.ready.emit();
});
this.element.on('escape', () => {
this.escape.emit();
this.cardGroup?.escape.emit();
});
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
this.cardGroup?.load.emit(this.element);
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeCardNumberComponent, deps: [{ token: StripeElementsService }, { token: StripeCardGroupDirective, optional: true }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeCardNumberComponent, isStandalone: true, selector: "ngx-stripe-card-number", inputs: { containerClass: "containerClass", options: "options" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (cardGroup && cardGroup.state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeCardNumberComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-card-number',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (cardGroup && cardGroup.state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeCardGroupDirective, decorators: [{
type: Optional
}] }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripeCardExpiryComponent {
stripeElementsService;
cardGroup;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
elements;
elementsSubscription;
constructor(stripeElementsService, cardGroup, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.cardGroup = cardGroup;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
if (changes.options || changes.containerClass) {
this.setupElement('options');
}
}
ngOnInit() {
if (this.cardGroup) {
this.elementsSubscription = this.cardGroup.elements.subscribe((elements) => {
this.elements = elements;
this.setupElement('elements');
});
}
else if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.setupElement('elements');
});
}
else {
throw new Error('StripeCardExpiryComponent must have StripeCardGroupDirective or StripeElementsDirective parent');
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getCardExpiry() {
return this.element;
}
setupElement(source) {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.element && source === 'options') {
this.update(options);
}
else if (this.elements && source === 'elements') {
this.element = this.elements.create('cardExpiry', options);
this.element.on('change', (ev) => {
this.change.emit(ev);
this.cardGroup?.change.emit(ev);
});
this.element.on('blur', () => {
this.blur.emit();
this.cardGroup?.blur.emit();
});
this.element.on('focus', () => {
this.focus.emit();
this.cardGroup?.focus.emit();
});
this.element.on('ready', () => {
this.ready.emit();
this.cardGroup?.ready.emit();
});
this.element.on('escape', () => {
this.escape.emit();
this.cardGroup?.escape.emit();
});
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
this.cardGroup?.load.emit(this.element);
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeCardExpiryComponent, deps: [{ token: StripeElementsService }, { token: StripeCardGroupDirective, optional: true }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeCardExpiryComponent, isStandalone: true, selector: "ngx-stripe-card-expiry", inputs: { containerClass: "containerClass", options: "options" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (cardGroup && cardGroup.state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeCardExpiryComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-card-expiry',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (cardGroup && cardGroup.state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeCardGroupDirective, decorators: [{
type: Optional
}] }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripeCardCvcComponent {
stripeElementsService;
cardGroup;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
elements;
elementsSubscription;
constructor(stripeElementsService, cardGroup, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.cardGroup = cardGroup;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
if (changes.options || changes.containerClass) {
this.setupElement('options');
}
}
ngOnInit() {
if (this.cardGroup) {
this.elementsSubscription = this.cardGroup.elements.subscribe((elements) => {
this.elements = elements;
this.setupElement('elements');
});
}
else if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.setupElement('elements');
});
}
else {
throw new Error('StripeCardCvcComponent must have StripeCardGroupDirective or StripeElementsDirective parent');
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getCardCvc() {
return this.element;
}
setupElement(source) {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.element && source === 'options') {
this.update(options);
}
else if (this.elements && source === 'elements') {
this.element = this.elements.create('cardCvc', options);
this.element.on('change', (ev) => {
this.change.emit(ev);
this.cardGroup?.change.emit(ev);
});
this.element.on('blur', () => {
this.blur.emit();
this.cardGroup?.blur.emit();
});
this.element.on('focus', () => {
this.focus.emit();
this.cardGroup?.focus.emit();
});
this.element.on('ready', () => {
this.ready.emit();
this.cardGroup?.ready.emit();
});
this.element.on('escape', () => {
this.escape.emit();
this.cardGroup?.escape.emit();
});
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
this.cardGroup?.load.emit(this.element);
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeCardCvcComponent, deps: [{ token: StripeElementsService }, { token: StripeCardGroupDirective, optional: true }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeCardCvcComponent, isStandalone: true, selector: "ngx-stripe-card-cvc", inputs: { containerClass: "containerClass", options: "options" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (cardGroup && cardGroup.state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeCardCvcComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-card-cvc',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (cardGroup && cardGroup.state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeCardGroupDirective, decorators: [{
type: Optional
}] }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripeEpsBankComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getEpsBankelement() {
return this.element;
}
createElement(options) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('epsBank', options);
this.element.on('change', (ev) => this.change.emit(ev));
this.element.on('blur', () => this.blur.emit());
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', () => this.ready.emit());
this.element.on('escape', () => this.escape.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeEpsBankComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeEpsBankComponent, isStandalone: true, selector: "ngx-stripe-eps-bank", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeEpsBankComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-eps-bank',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripeExpressCheckoutComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
blur = new EventEmitter();
cancel = new EventEmitter();
clicked = new EventEmitter();
confirm = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
loaderror = new EventEmitter();
shippingaddresschange = new EventEmitter();
shippingratechange = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
return this.element.update(options);
}
/**
* @deprecated
*/
getLinkAuthenticationElement() {
return this.element;
}
createElement(options) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('expressCheckout', options);
this.element.on('blur', () => this.blur.emit());
this.element.on('cancel', () => this.cancel.emit());
this.element.on('click', (ev) => this.clicked.emit(ev));
this.element.on('confirm', (ev) => this.confirm.emit(ev));
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', (ev) => this.ready.emit(ev));
this.element.on('escape', () => this.escape.emit());
this.element.on('loaderror', (err) => this.loaderror.emit(err));
this.element.on('shippingaddresschange', (ev) => this.shippingaddresschange.emit(ev));
this.element.on('shippingratechange', (ev) => this.shippingratechange.emit(ev));
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeExpressCheckoutComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeExpressCheckoutComponent, isStandalone: true, selector: "ngx-stripe-express-checkout", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", blur: "blur", cancel: "cancel", clicked: "clicked", confirm: "confirm", focus: "focus", ready: "ready", escape: "escape", loaderror: "loaderror", shippingaddresschange: "shippingaddresschange", shippingratechange: "shippingratechange" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeExpressCheckoutComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-express-checkout',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], cancel: [{
type: Output
}], clicked: [{
type: Output
}], confirm: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}], loaderror: [{
type: Output
}], shippingaddresschange: [{
type: Output
}], shippingratechange: [{
type: Output
}] } });
class StripeFpxBankComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getFpxBank() {
return this.element;
}
createElement(options = { accountHolderType: 'individual' }) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('fpxBank', options);
this.element.on('change', (ev) => this.change.emit(ev));
this.element.on('blur', () => this.blur.emit());
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', () => this.ready.emit());
this.element.on('escape', () => this.escape.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeFpxBankComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeFpxBankComponent, isStandalone: true, selector: "ngx-stripe-fpx-bank", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeFpxBankComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-fpx-bank',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripeIbanComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getIban() {
return this.element;
}
createElement(options = {}) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('iban', options);
this.element.on('change', (ev) => this.change.emit(ev));
this.element.on('blur', () => this.blur.emit());
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', () => this.ready.emit());
this.element.on('escape', () => this.escape.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIbanComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeIbanComponent, isStandalone: true, selector: "ngx-stripe-iban", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIbanComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-iban',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripeIdealBankComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getIdealBank() {
return this.element;
}
createElement(options = {}) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('idealBank', options);
this.element.on('change', (ev) => this.change.emit(ev));
this.element.on('blur', () => this.blur.emit());
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', () => this.ready.emit());
this.element.on('escape', () => this.escape.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIdealBankComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeIdealBankComponent, isStandalone: true, selector: "ngx-stripe-ideal-bank", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIdealBankComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-ideal-bank',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripeIssuingCardCvcDisplayComponent {
cdr;
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(cdr, stripeElementsService, elementsProvider) {
this.cdr = cdr;
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
createElement(options) {
this.state = 'ready';
this.cdr.detectChanges();
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('issuingCardCvcDisplay', options);
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIssuingCardCvcDisplayComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeIssuingCardCvcDisplayComponent, isStandalone: true, selector: "ngx-stripe-issuing-card-cvc-display", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIssuingCardCvcDisplayComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-issuing-card-cvc-display',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}] } });
class StripeIssuingCardExpiryDisplayComponent {
cdr;
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(cdr, stripeElementsService, elementsProvider) {
this.cdr = cdr;
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
createElement(options) {
this.state = 'ready';
this.cdr.detectChanges();
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('issuingCardExpiryDisplay', options);
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIssuingCardExpiryDisplayComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeIssuingCardExpiryDisplayComponent, isStandalone: true, selector: "ngx-stripe-issuing-card-expiry-display", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIssuingCardExpiryDisplayComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-issuing-card-expiry-display',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}] } });
class StripeIssuingCardNumberDisplayComponent {
cdr;
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(cdr, stripeElementsService, elementsProvider) {
this.cdr = cdr;
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
createElement(options) {
this.state = 'ready';
this.cdr.detectChanges();
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('issuingCardNumberDisplay', options);
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIssuingCardNumberDisplayComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeIssuingCardNumberDisplayComponent, isStandalone: true, selector: "ngx-stripe-issuing-card-number-display", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIssuingCardNumberDisplayComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-issuing-card-number-display',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}] } });
class StripeIssuingCardPinDisplayComponent {
cdr;
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(cdr, stripeElementsService, elementsProvider) {
this.cdr = cdr;
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
createElement(options) {
this.state = 'ready';
this.cdr.detectChanges();
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('issuingCardPinDisplay', options);
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIssuingCardPinDisplayComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeIssuingCardPinDisplayComponent, isStandalone: true, selector: "ngx-stripe-issuing-card-pin-display", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeIssuingCardPinDisplayComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-issuing-card-pin-display',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}] } });
class StripeLinkAuthenticationComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
loaderror = new EventEmitter();
loaderstart = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
/**
* @deprecated
*/
getLinkAuthenticationElement() {
return this.element;
}
createElement(options) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('linkAuthentication', options);
this.element.on('change', (ev) => this.change.emit(ev));
this.element.on('blur', () => this.blur.emit());
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', () => this.ready.emit());
this.element.on('escape', () => this.escape.emit());
this.element.on('loaderror', () => this.loaderror.emit());
this.element.on('loaderstart', () => this.loaderstart.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeLinkAuthenticationComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeLinkAuthenticationComponent, isStandalone: true, selector: "ngx-stripe-link-authentication", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape", loaderror: "loaderror", loaderstart: "loaderstart" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeLinkAuthenticationComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-link-authentication',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}], loaderror: [{
type: Output
}], loaderstart: [{
type: Output
}] } });
class StripeP24BankComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getP24Bankelement() {
return this.element;
}
createElement(options) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('p24Bank', options);
this.element.on('change', (ev) => this.change.emit(ev));
this.element.on('blur', () => this.blur.emit());
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', () => this.ready.emit());
this.element.on('escape', () => this.escape.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeP24BankComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeP24BankComponent, isStandalone: true, selector: "ngx-stripe-p24-bank", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeP24BankComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-p24-bank',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripeAuBankAccountComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getAuBankAccount() {
return this.element;
}
createElement(options = {}) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('auBankAccount', options);
this.element.on('change', (ev) => this.change.emit(ev));
this.element.on('blur', () => this.blur.emit());
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', () => this.ready.emit());
this.element.on('escape', () => this.escape.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeAuBankAccountComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripeAuBankAccountComponent, isStandalone: true, selector: "ngx-stripe-au-bank-account", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeAuBankAccountComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-au-bank-account',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}] } });
class StripePaymentElementComponent {
stripeElementsService;
elementsProvider;
stripeElementRef;
element;
elements;
containerClass;
options;
elementsOptions;
stripe;
appearance;
clientSecret;
doNotCreateUntilClientSecretIsSet = false;
load = new EventEmitter();
blur = new EventEmitter();
change = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
escape = new EventEmitter();
loaderror = new EventEmitter();
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider &&
(changes.elementsOptions || changes.stripe || changes.clientSecret || changes.appearance || !this.elements)) {
this.elements = await this.stripeElementsService
.elements(this.stripe, {
...(this.elementsOptions || {}),
...(this.appearance ? { appearance: this.appearance } : {}),
...(this.clientSecret ? { clientSecret: this.clientSecret } : {})
})
.toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService
.elements(this.stripe, {
...(this.elementsOptions || {}),
...(this.appearance ? { appearance: this.appearance } : {}),
...(this.clientSecret ? { clientSecret: this.clientSecret } : {})
})
.toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
return this.element.update(options);
}
collapse() {
return this.element.collapse();
}
fetchUpdates() {
return from(this.elements.fetchUpdates());
}
createElement(options = {}) {
if (this.element) {
this.element.unmount();
}
try {
this.element = this.elements.create('payment', options);
}
catch (err) {
this.elements = null;
throw err;
}
this.element.on('change', (ev) => this.change.emit(ev));
this.element.on('blur', (ev) => this.blur.emit(ev));
this.element.on('focus', (ev) => this.focus.emit(ev));
this.element.on('ready', (ev) => this.ready.emit(ev));
this.element.on('escape', (ev) => this.escape.emit(ev));
this.element.on('loaderror', (ev) => this.loaderror.emit(ev));
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripePaymentElementComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: StripePaymentElementComponent, isStandalone: true, selector: "ngx-stripe-payment", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe", appearance: "appearance", clientSecret: "clientSecret", doNotCreateUntilClientSecretIsSet: "doNotCreateUntilClientSecretIsSet" }, outputs: { load: "load", blur: "blur", change: "change", focus: "focus", ready: "ready", escape: "escape", loaderror: "loaderror" }, viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `<div class="field" #stripeElementRef></div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripePaymentElementComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-payment',
standalone: true,
template: `<div class="field" #stripeElementRef></div>`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], appearance: [{
type: Input
}], clientSecret: [{
type: Input
}], doNotCreateUntilClientSecretIsSet: [{
type: Input
}], load: [{
type: Output
}], blur: [{
type: Output
}], change: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], escape: [{
type: Output
}], loaderror: [{
type: Output
}] } });
class StripePaymentMethodMessagingComponent {
stripeElementsService;
elementsProvider;
loadingTemplate;
stripeElementRef;
element;
containerClass;
options;
elementsOptions;
stripe;
load = new EventEmitter();
ready = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
this.elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
updateElements = true;
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
this.state = 'ready';
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
update(options) {
this.element.update(options);
}
/**
* @deprecated
*/
getPaymentMethodMessaging() {
return this.element;
}
createElement(options) {
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('paymentMethodMessaging', options);
this.element.on('ready', () => this.ready.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit(this.element);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripePaymentMethodMessagingComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: StripePaymentMethodMessagingComponent, isStandalone: true, selector: "ngx-stripe-payment-method-messaging", inputs: { containerClass: "containerClass", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", ready: "ready" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: NgxStripeElementLoadingTemplateDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripePaymentMethodMessagingComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-payment-method-messaging',
standalone: true,
template: `
<div class="field" #stripeElementRef>
@if (state !== 'ready' && loadingTemplate) {
<ng-container [ngTemplateOutlet]="loadingTemplate" />
}
</div>
`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { loadingTemplate: [{
type: ContentChild,
args: [NgxStripeElementLoadingTemplateDirective, { read: TemplateRef }]
}], stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], ready: [{
type: Output
}] } });
class StripePaymentRequestButtonComponent {
stripeElementsService;
elementsProvider;
stripeElementRef;
element;
paymentRequest;
containerClass;
paymentOptions;
options;
elementsOptions;
stripe;
load = new EventEmitter();
change = new EventEmitter();
blur = new EventEmitter();
focus = new EventEmitter();
ready = new EventEmitter();
token = new EventEmitter();
paymentMethod = new EventEmitter();
source = new EventEmitter();
cancel = new EventEmitter();
shippingaddresschange = new EventEmitter();
shippingoptionchange = new EventEmitter();
notavailable = new EventEmitter();
elements;
state = 'notready';
elementsSubscription;
constructor(stripeElementsService, elementsProvider) {
this.stripeElementsService = stripeElementsService;
this.elementsProvider = elementsProvider;
}
async ngOnChanges(changes) {
this.state = 'starting';
let updateElements = false;
if (!this.elementsProvider && (changes.elementsOptions || changes.stripe || !this.elements)) {
const elements = await this.stripeElementsService.elements(this.stripe, this.elementsOptions).toPromise();
this.elements = elements;
updateElements = true;
}
if (changes.paymentOptions && this.paymentRequest) {
this.updateRequest(this.paymentOptions);
}
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (changes.options || changes.containerClass || !this.element || updateElements) {
if (this.element && !updateElements) {
this.update(options);
}
else if (this.elements && updateElements) {
this.createElement(options);
}
}
}
async ngOnInit() {
const options = this.stripeElementsService.mergeOptions(this.options, this.containerClass);
if (this.elementsProvider) {
this.elementsSubscription = this.elementsProvider.elements.subscribe((elements) => {
this.elements = elements;
this.createElement(options);
this.state = 'ready';
});
}
else if (this.state === 'notready') {
this.state = 'starting';
this.elements = await this.stripeElementsService.elements(this.stripe).toPromise();
this.createElement(options);
this.state = 'ready';
}
}
ngOnDestroy() {
if (this.element) {
this.element.destroy();
}
if (this.elementsSubscription) {
this.elementsSubscription.unsubscribe();
}
}
canMakePayment() {
return from(this.paymentRequest.canMakePayment());
}
update(options) {
this.element.update(options);
}
updateRequest(options) {
const { currency, total, displayItems, shippingOptions } = options;
this.paymentRequest.update({
currency,
total,
displayItems,
shippingOptions
});
}
show() {
this.paymentRequest.show();
}
abort() {
this.paymentRequest.abort();
}
isShowing() {
return this.paymentRequest.isShowing();
}
/**
* @deprecated
*/
getButton() {
return this.element;
}
async createElement(options = {}) {
this.paymentRequest = this.stripeElementsService.paymentRequest(this.stripe, this.paymentOptions);
this.paymentRequest.on('token', (ev) => this.token.emit(ev));
if (this.paymentMethod.observed)
this.paymentRequest.on('paymentmethod', (ev) => this.paymentMethod.emit(ev));
if (this.source.observed && !this.paymentMethod.observed)
this.paymentRequest.on('source', (ev) => this.source.emit(ev));
this.paymentRequest.on('cancel', () => this.cancel.emit());
this.paymentRequest.on('shippingaddresschange', (ev) => this.shippingaddresschange.emit(ev));
this.paymentRequest.on('shippingoptionchange', (ev) => this.shippingoptionchange.emit(ev));
if (this.element) {
this.element.unmount();
}
this.element = this.elements.create('paymentRequestButton', {
paymentRequest: this.paymentRequest,
...options
});
const result = await this.paymentRequest.canMakePayment();
if (result) {
this.element.on('click', (ev) => this.change.emit(ev));
this.element.on('blur', () => this.blur.emit());
this.element.on('focus', () => this.focus.emit());
this.element.on('ready', () => this.ready.emit());
this.element.mount(this.stripeElementRef.nativeElement);
this.load.emit({
paymentRequestButton: this.element,
paymentRequest: this.paymentRequest
});
}
else {
this.notavailable.emit();
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripePaymentRequestButtonComponent, deps: [{ token: StripeElementsService }, { token: StripeElementsDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: StripePaymentRequestButtonComponent, isStandalone: true, selector: "ngx-stripe-payment-request-button", inputs: { containerClass: "containerClass", paymentOptions: "paymentOptions", options: "options", elementsOptions: "elementsOptions", stripe: "stripe" }, outputs: { load: "load", change: "change", blur: "blur", focus: "focus", ready: "ready", token: "token", paymentMethod: "paymentMethod", source: "source", cancel: "cancel", shippingaddresschange: "shippingaddresschange", shippingoptionchange: "shippingoptionchange", notavailable: "notavailable" }, viewQueries: [{ propertyName: "stripeElementRef", first: true, predicate: ["stripeElementRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `<div class="field" #stripeElementRef></div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripePaymentRequestButtonComponent, decorators: [{
type: Component,
args: [{
selector: 'ngx-stripe-payment-request-button',
standalone: true,
template: `<div class="field" #stripeElementRef></div>`,
imports: [CommonModule]
}]
}], ctorParameters: () => [{ type: StripeElementsService }, { type: StripeElementsDirective, decorators: [{
type: Optional
}] }], propDecorators: { stripeElementRef: [{
type: ViewChild,
args: ['stripeElementRef']
}], containerClass: [{
type: Input
}], paymentOptions: [{
type: Input
}], options: [{
type: Input
}], elementsOptions: [{
type: Input
}], stripe: [{
type: Input
}], load: [{
type: Output
}], change: [{
type: Output
}], blur: [{
type: Output
}], focus: [{
type: Output
}], ready: [{
type: Output
}], token: [{
type: Output
}], paymentMethod: [{
type: Output
}], source: [{
type: Output
}], cancel: [{
type: Output
}], shippingaddresschange: [{
type: Output
}], shippingoptionchange: [{
type: Output
}], notavailable: [{
type: Output
}] } });
class StripeFactoryService {
version;
baseKey;
baseOptions;
loader;
window;
constructor(version, baseKey, baseOptions, loader, window) {
this.version = version;
this.baseKey = baseKey;
this.baseOptions = baseOptions;
this.loader = loader;
this.window = window;
}
create(key, options) {
if (!key && !this.baseKey) {
throw new Error('No key defined! Either you need to pass it as a parameter or define it when you call NgxStripeModule.forRoot()');
}
return new StripeInstance(this.version, this.loader, this.window, key || this.baseKey, options || this.baseOptions);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeFactoryService, deps: [{ token: NGX_STRIPE_VERSION }, { token: STRIPE_PUBLISHABLE_KEY }, { token: STRIPE_OPTIONS }, { token: LazyStripeAPILoader }, { token: WindowRef }], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeFactoryService });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: StripeFactoryService, decorators: [{
type: Injectable
}], ctorParameters: () => [{ type: undefined, decorators: [{
type: Inject,
args: [NGX_STRIPE_VERSION]
}] }, { type: undefined, decorators: [{
type: Inject,
args: [STRIPE_PUBLISHABLE_KEY]
}] }, { type: undefined, decorators: [{
type: Inject,
args: [STRIPE_OPTIONS]
}] }, { type: LazyStripeAPILoader }, { type: WindowRef }] });
const components = [
StripeAddressComponent,
StripeAffirmMessageComponent,
StripeAfterpayClearpayMessageComponent,
StripeCardComponent,
StripeCardNumberComponent,
StripeCardExpiryComponent,
StripeCardCvcComponent,
StripeEpsBankComponent,
StripeExpressCheckoutComponent,
StripeFpxBankComponent,
StripeIbanComponent,
StripeIdealBankComponent,
StripeIssuingCardCvcDisplayComponent,
StripeIssuingCardExpiryDisplayComponent,
StripeIssuingCardNumberDisplayComponent,
StripeIssuingCardPinDisplayComponent,
StripeLinkAuthenticationComponent,
StripeP24BankComponent,
StripeAuBankAccountComponent,
StripePaymentElementComponent,
StripePaymentMethodMessagingComponent,
StripePaymentRequestButtonComponent
];
const directives = [StripeCardGroupDirective, StripeElementsDirective, NgxStripeElementLoadingTemplateDirective];
const currentVersion = '19.0.0';
function _provideNgxStripe(publishableKey, options) {
return [
LazyStripeAPILoader,
StripeService,
StripeFactoryService,
StripeElementsService,
WindowRef,
DocumentRef,
{
provide: STRIPE_PUBLISHABLE_KEY,
useValue: publishableKey
},
{
provide: STRIPE_OPTIONS,
useValue: options
},
{
provide: NGX_STRIPE_VERSION,
useValue: currentVersion
}
];
}
/**
* Provides the global NgxStripe providers and initializes.
*
* @usageNotes
*
* ### Providing the Global NgxStripe
*
* ```ts
* bootstrapApplication(AppComponent, {
* providers: [provideNgxStripe(STRIPE_KEY)],
* });
* ```
*/
function provideNgxStripe(publishableKey, options) {
return makeEnvironmentProviders([..._provideNgxStripe(publishableKey, options)]);
}
class NgxStripeModule {
static forRoot(publishableKey, options) {
return {
ngModule: NgxStripeModule,
providers: [..._provideNgxStripe(publishableKey, options)]
};
}
/**
* @deprecated
*/
static forChild(publishableKey, options) {
return {
ngModule: NgxStripeModule,
providers: [..._provideNgxStripe(publishableKey, options)]
};
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxStripeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: NgxStripeModule, imports: [CommonModule, StripeAddressComponent,
StripeAffirmMessageComponent,
StripeAfterpayClearpayMessageComponent,
StripeCardComponent,
StripeCardNumberComponent,
StripeCardExpiryComponent,
StripeCardCvcComponent,
StripeEpsBankComponent,
StripeExpressCheckoutComponent,
StripeFpxBankComponent,
StripeIbanComponent,
StripeIdealBankComponent,
StripeIssuingCardCvcDisplayComponent,
StripeIssuingCardExpiryDisplayComponent,
StripeIssuingCardNumberDisplayComponent,
StripeIssuingCardPinDisplayComponent,
StripeLinkAuthenticationComponent,
StripeP24BankComponent,
StripeAuBankAccountComponent,
StripePaymentElementComponent,
StripePaymentMethodMessagingComponent,
StripePaymentRequestButtonComponent, StripeCardGroupDirective, StripeElementsDirective, NgxStripeElementLoadingTemplateDirective], exports: [StripeAddressComponent,
StripeAffirmMessageComponent,
StripeAfterpayClearpayMessageComponent,
StripeCardComponent,
StripeCardNumberComponent,
StripeCardExpiryComponent,
StripeCardCvcComponent,
StripeEpsBankComponent,
StripeExpressCheckoutComponent,
StripeFpxBankComponent,
StripeIbanComponent,
StripeIdealBankComponent,
StripeIssuingCardCvcDisplayComponent,
StripeIssuingCardExpiryDisplayComponent,
StripeIssuingCardNumberDisplayComponent,
StripeIssuingCardPinDisplayComponent,
StripeLinkAuthenticationComponent,
StripeP24BankComponent,
StripeAuBankAccountComponent,
StripePaymentElementComponent,
StripePaymentMethodMessagingComponent,
StripePaymentRequestButtonComponent, StripeCardGroupDirective, StripeElementsDirective, NgxStripeElementLoadingTemplateDirective] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxStripeModule, imports: [CommonModule, components] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxStripeModule, decorators: [{
type: NgModule,
args: [{
exports: [...components, ...directives],
imports: [CommonModule, ...components, ...directives]
}]
}] });
function injectStripe(publishableKey, options) {
if (publishableKey) {
const factory = inject(StripeFactoryService);
return factory.create(publishableKey, options);
}
else if (inject(STRIPE_PUBLISHABLE_KEY)) {
return inject(StripeService);
}
throw new Error('Publishable Key is required either global or pass as parameter');
}
/*
* Public API Surface of ngx-stripe
*/
/**
* Generated bundle index. Do not edit.
*/
export { DocumentRef, LazyStripeAPILoader, NGX_STRIPE_VERSION, NgxStripeElementLoadingTemplateDirective, NgxStripeModule, STRIPE_OPTIONS, STRIPE_PUBLISHABLE_KEY, StripeAddressComponent, StripeAffirmMessageComponent, StripeAfterpayClearpayMessageComponent, StripeAuBankAccountComponent, StripeCardComponent, StripeCardCvcComponent, StripeCardExpiryComponent, StripeCardGroupDirective, StripeCardNumberComponent, StripeElementsDirective, StripeElementsService, StripeEpsBankComponent, StripeExpressCheckoutComponent, StripeFactoryService, StripeFpxBankComponent, StripeIbanComponent, StripeIdealBankComponent, StripeInstance, StripeIssuingCardCvcDisplayComponent, StripeIssuingCardExpiryDisplayComponent, StripeIssuingCardNumberDisplayComponent, StripeIssuingCardPinDisplayComponent, StripeLinkAuthenticationComponent, StripeP24BankComponent, StripePaymentElementComponent, StripePaymentMethodMessagingComponent, StripePaymentRequestButtonComponent, StripeService, WindowRef, injectStripe, provideNgxStripe };
//# sourceMappingURL=ngx-stripe.mjs.map