@forgeroute/ui 0.5.26 → 0.5.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/forgeroute-ui-card-list-item.mjs +72 -35
- package/fesm2022/forgeroute-ui-card-list-item.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-checkbox.mjs +2 -2
- package/fesm2022/forgeroute-ui-checkbox.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-color-input.mjs +2 -2
- package/fesm2022/forgeroute-ui-color-input.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-combobox.mjs +2 -2
- package/fesm2022/forgeroute-ui-combobox.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-contact-picker.mjs +4 -4
- package/fesm2022/forgeroute-ui-contact-picker.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-conversations.mjs +2 -0
- package/fesm2022/forgeroute-ui-conversations.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-data-table-core.mjs +2 -2
- package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-date-input.mjs +2 -2
- package/fesm2022/forgeroute-ui-date-input.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-datetime-input.mjs +2 -2
- package/fesm2022/forgeroute-ui-datetime-input.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-detail-card.mjs +20 -4
- package/fesm2022/forgeroute-ui-detail-card.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-dropdown.mjs +16 -2
- package/fesm2022/forgeroute-ui-dropdown.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-file-input.mjs +7 -5
- package/fesm2022/forgeroute-ui-file-input.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-icon-picker.mjs +2 -2
- package/fesm2022/forgeroute-ui-icon-picker.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-media.mjs +67 -2
- package/fesm2022/forgeroute-ui-media.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-messaging.mjs +3 -0
- package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-multi-select.mjs +2 -2
- package/fesm2022/forgeroute-ui-multi-select.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-notes.mjs +1 -0
- package/fesm2022/forgeroute-ui-notes.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-option-card.mjs +1 -0
- package/fesm2022/forgeroute-ui-option-card.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-payments.mjs +3 -0
- package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-pdf.mjs +1 -0
- package/fesm2022/forgeroute-ui-pdf.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-quickbooks.mjs +1 -0
- package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-radio-matrix.mjs +2 -2
- package/fesm2022/forgeroute-ui-radio-matrix.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-radio.mjs +2 -2
- package/fesm2022/forgeroute-ui-radio.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-select.mjs +2 -2
- package/fesm2022/forgeroute-ui-select.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-setup.mjs +1 -0
- package/fesm2022/forgeroute-ui-setup.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-square.mjs +1 -0
- package/fesm2022/forgeroute-ui-square.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-star-rating.mjs +2 -2
- package/fesm2022/forgeroute-ui-star-rating.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-stripe.mjs +1 -0
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-swatch-picker.mjs +2 -2
- package/fesm2022/forgeroute-ui-swatch-picker.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-table-toolbar.mjs +17 -5
- package/fesm2022/forgeroute-ui-table-toolbar.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-text-input.mjs +2 -2
- package/fesm2022/forgeroute-ui-text-input.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-textarea-input.mjs +23 -36
- package/fesm2022/forgeroute-ui-textarea-input.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-time-input.mjs +2 -2
- package/fesm2022/forgeroute-ui-time-input.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui-card-list-item.d.ts +21 -11
- package/types/forgeroute-ui-detail-card.d.ts +7 -0
- package/types/forgeroute-ui-dropdown.d.ts +2 -0
- package/types/forgeroute-ui-media.d.ts +28 -0
- package/types/forgeroute-ui-quickbooks.d.ts +1 -1
- package/types/forgeroute-ui-square.d.ts +4 -4
- package/types/forgeroute-ui-stripe.d.ts +4 -4
- package/types/forgeroute-ui-textarea-input.d.ts +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgeroute-ui-stripe.mjs","names":[],"sources":["../../../projects/forgeroute-ui/stripe/src/stripe-loader/stripe-loader.ts","../../../projects/forgeroute-ui/stripe/src/errors/stripe-errors.ts","../../../projects/forgeroute-ui/stripe/src/stripe-payment/stripe-outcomes.ts","../../../projects/forgeroute-ui/stripe/src/stripe-payment/stripe-actions.ts","../../../projects/forgeroute-ui/stripe/src/stripe-payment/stripe-appearance.ts","../../../projects/forgeroute-ui/stripe/src/stripe-payment/stripe-payment.component.ts","../../../projects/forgeroute-ui/stripe/src/microdeposit-verify/microdeposit-verify.models.ts","../../../projects/forgeroute-ui/stripe/src/microdeposit-verify/microdeposit-verify.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-connect/stripe-connect.flow.ts","../../../projects/forgeroute-ui/stripe/src/stripe-connect/stripe-connect.component.ts","../../../projects/forgeroute-ui/stripe/src/payment-stripe-method/payment-stripe-method.models.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-reader.models.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-reader.flow.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-reader-status.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-reader-payment.component.ts","../../../projects/forgeroute-ui/stripe/src/payment-stripe-method/payment-stripe-body.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-reader-banner.component.ts","../../../projects/forgeroute-ui/stripe/src/payment-stripe-method/payment-stripe-method.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-readers.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader-shop/stripe-connect-embed.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader-shop/stripe-reader-shop.models.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader-shop/stripe-reader-shop.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader-shop/stripe-reader-order-panel.component.ts"],"sourcesContent":["import { InjectionToken, type Provider } from '@angular/core';\nimport type { StripeLike, StripeLoadOptions } from './stripe-types';\n\n/**\n * Loads Stripe.js: `loader(publishableKey, options)` resolves the `Stripe` object (or `null` when it could not be created).\n * It is called exactly like `loadStripe(key, options)` from `@stripe/stripe-js`: the second argument is `undefined` unless a Connect\n * account / locale / other option is set.\n */\nexport type StripeLoaderFn = (publishableKey: string, options?: StripeLoadOptions) => Promise<StripeLike | null>;\n\n/** The dynamic import of the Stripe SDK, behind an object so a spec can replace it (internal: not part of the public API). */\nexport const sdkImporter: { load: () => Promise<{ loadStripe: (key: string, options?: never) => Promise<unknown> }> } = {\n load: () => import('@stripe/stripe-js') as unknown as Promise<{ loadStripe: (key: string, options?: never) => Promise<unknown> }>,\n};\n\n/**\n * The default loader. `@stripe/stripe-js` is imported lazily (a dynamic import), so the Stripe SDK is only downloaded when a\n * payment form is actually shown, and it is an optional peer dependency of the library.\n */\nexport const defaultStripeLoader: StripeLoaderFn = async (publishableKey, options) => {\n const sdk = await sdkImporter.load();\n const stripe = options === undefined ? await sdk.loadStripe(publishableKey) : await sdk.loadStripe(publishableKey, options as never);\n return stripe as unknown as StripeLike | null;\n};\n\n/** How Stripe.js is loaded. Provide your own to fake Stripe in tests or to load it differently. Defaults to `defaultStripeLoader`. */\nexport const STRIPE_LOADER = new InjectionToken<StripeLoaderFn>('STRIPE_LOADER', { providedIn: 'root', factory: () => defaultStripeLoader });\n\n/** App-wide defaults for every `ui-stripe-payment`, set once with `provideStripePayment`. A value on the component always wins. */\nexport interface StripePaymentDefaults {\n /** The publishable key (`pk_...`), used when the component has no `publishableKey` of its own. */\n publishableKey?: string;\n /** Stripe.js locale (`'en'`, `'es'`, ...): passed to `loadStripe` as `{ locale }`. */\n locale?: string;\n}\n\nexport const STRIPE_PAYMENT_DEFAULTS = new InjectionToken<StripePaymentDefaults>('STRIPE_PAYMENT_DEFAULTS', { providedIn: 'root', factory: () => ({}) });\n\nexport interface ProvideStripePaymentOptions extends StripePaymentDefaults {\n /** Replaces how Stripe.js is loaded (tests, a self-hosted loader). */\n loader?: StripeLoaderFn;\n}\n\n/**\n * Global defaults for the Stripe components:\n *\n * providers: [provideStripePayment({ publishableKey: environment.stripePublishableKey, locale: 'en' })]\n */\nexport function provideStripePayment(options: ProvideStripePaymentOptions = {}): Provider[] {\n const { loader, ...defaults } = options;\n const providers: Provider[] = [{ provide: STRIPE_PAYMENT_DEFAULTS, useValue: defaults }];\n if (loader) providers.push({ provide: STRIPE_LOADER, useValue: loader });\n return providers;\n}\n\n/** `loadStripe`'s second argument for a Connect account / locale / extra options; `undefined` when there is nothing to pass (like the apps do today). */\nexport function buildLoadOptions(stripeAccount: string | null | undefined, locale: string | null | undefined, extra?: StripeLoadOptions | null): StripeLoadOptions | undefined {\n const options: StripeLoadOptions = { ...(extra ?? {}) };\n if (locale) options.locale = locale;\n if (stripeAccount) options.stripeAccount = stripeAccount;\n return Object.keys(options).length ? options : undefined;\n}\n","import type { StripeErrorLike } from '../stripe-loader/stripe-types';\nimport { UiLabelKey, uiText } from '@forgeroute/ui/core';\n\n/**\n * Plain-language text for the Stripe decline / error codes (https://docs.stripe.com/declines/codes). One table for every app; an app can replace single entries\n * with the `errorMessages` input of `ui-stripe-payment` (or the `overrides` option of `getStripeErrorMessage`).\n */\nexport const STRIPE_ERROR_MESSAGES: Readonly<Record<string, string>> = {\n // Card issue codes\n stolen_card: 'This card has been reported as stolen. Please use a different payment method.',\n lost_card: 'This card has been reported as lost. Please use a different payment method.',\n card_declined: 'Your card was declined. Please contact your bank or use a different card.',\n generic_decline: 'Your card was declined. Please contact your bank or try a different card.',\n insufficient_funds: 'Your card has insufficient funds. Please use a different card or add funds to your account.',\n do_not_honor: 'Your bank has declined this transaction. Please contact your bank or use a different card.',\n card_not_supported: 'This card does not support this type of purchase. Please use a different card.',\n currency_not_supported: 'This card does not support the requested currency. Please use a different card.',\n duplicate_transaction: 'A duplicate transaction was detected. Please wait a few minutes before trying again.',\n expired_card: 'Your card has expired. Please use a different card.',\n incorrect_cvc: 'The security code (CVC) is incorrect. Please check and try again.',\n incorrect_number: 'The card number is incorrect. Please check and try again.',\n invalid_cvc: 'The security code (CVC) is invalid. Please check and try again.',\n invalid_expiry_month: 'The expiration month is invalid. Please check and try again.',\n invalid_expiry_year: 'The expiration year is invalid. Please check and try again.',\n invalid_number: 'The card number is invalid. Please check and try again.',\n processing_error: 'An error occurred while processing your card. Please try again.',\n incorrect_zip: 'The ZIP/postal code is incorrect. Please check and try again.',\n card_velocity_exceeded: 'You have exceeded the balance or credit limit on your card. Please contact your bank.',\n withdrawal_count_limit_exceeded: 'You have exceeded the allowed number of transactions. Please try again later or use a different card.',\n // Authentication codes\n authentication_required: 'This card requires authentication. Please try again and complete the verification step.',\n // Fraud codes\n fraudulent: 'This transaction has been flagged by your bank. Please contact your bank or use a different card.',\n merchant_blacklist: 'This card cannot be used for this transaction. Please use a different card.',\n pickup_card: 'This card cannot be used. Please contact your bank or use a different card.',\n restricted_card: 'This card has restrictions that prevent this transaction. Please contact your bank or use a different card.',\n security_violation: 'This card has been flagged for a security violation. Please contact your bank.',\n // Account codes\n issuer_not_available: 'Your card issuer could not be reached. Please try again later.',\n new_account_information_available: 'Your card details have changed. Please update your card information and try again.',\n try_again_later: 'Your card issuer is temporarily unable to process this transaction. Please try again later.',\n reenter_transaction: 'The transaction could not be processed. Please try again.',\n // Limit codes\n approve_with_id: 'The payment cannot be authorized. Please contact your bank.',\n call_issuer: 'Your bank has declined this transaction. Please call your bank for more information.',\n do_not_try_again: 'Your bank has permanently declined this card. Please use a different payment method.',\n no_action_taken: 'Your bank could not process this transaction. Please contact your bank.',\n not_permitted: 'This transaction is not permitted on this card. Please contact your bank or use a different card.',\n revocation_of_all_authorizations: 'All authorizations have been revoked for this card. Please contact your bank.',\n revocation_of_authorization: 'The authorization for this card has been revoked. Please contact your bank.',\n stop_payment_order: 'Your bank has stopped this payment. Please contact your bank.',\n // Test mode\n testmode_decline: 'This is a test decline. No real charge was attempted.',\n // ACH\n bank_account_declined: 'Your bank account could not be used. Please try a different account.',\n debit_not_authorized: 'The debit was not authorized. Please contact your bank.',\n // Payment / setup intent state errors\n payment_intent_unexpected_state: 'This payment has already been processed. Please refresh the page and try again.',\n payment_intent_authentication_failure: 'Payment authentication failed. Please try again.',\n payment_intent_incompatible_payment_method: 'This payment method is not compatible. Please use a different payment method.',\n payment_intent_payment_attempt_failed: 'The payment attempt failed. Please try again or use a different payment method.',\n payment_method_unactivated: 'This payment method is not activated. Please use a different payment method.',\n payment_method_unexpected_state: 'There was an issue with your payment method. Please try again.',\n setup_intent_unexpected_state: 'This payment setup has already been completed. Please refresh the page.',\n amount_too_small: 'The payment amount is too small to process. Please contact the business.',\n amount_too_large: 'The payment amount exceeds the maximum allowed. Please contact the business.',\n balance_insufficient: 'Insufficient balance to complete this payment. Please use a different payment method.',\n resource_missing: 'The payment session has expired. Please refresh the page and try again.',\n};\n\n/** Text for the Stripe error types that are about Stripe or the connection, never about the customer's input (Stripe's own text there is technical). */\nexport const STRIPE_TECHNICAL_ERROR_MESSAGES: Readonly<Record<string, string>> = {\n api_connection_error: 'We could not reach the payment service. Please check your connection and try again.',\n rate_limit_error: 'Too many requests. Please wait a moment and try again.',\n api_error: 'Something went wrong while processing the payment. Please try again.',\n authentication_error: 'Something went wrong while processing the payment. Please try again.',\n invalid_request_error: 'Something went wrong while processing the payment. Please try again.',\n};\n\nexport const STRIPE_DEFAULT_ERROR_MESSAGE = 'Payment failed. Please try again.';\nexport const STRIPE_ALREADY_PROCESSED_MESSAGE = 'This payment has already been processed. Please refresh the page and try again.';\nexport const STRIPE_SESSION_EXPIRED_MESSAGE = 'Your payment session has expired. Please refresh the page and try again.';\n\n/** The English table with every text looked up in the app's active language (an unknown code keeps its English text). */\nfunction localizedTable(english: Readonly<Record<string, string>>, prefix: string): Record<string, string> {\n return Object.fromEntries(Object.keys(english).map(code => [code, uiText(`${prefix}${code}` as UiLabelKey)]));\n}\n\nexport type StripeErrorDisplay = 'friendly' | 'table' | 'stripe';\n\nexport interface StripeErrorMessageOptions {\n /**\n * `'friendly'` (default): the table above first, then Stripe's own text for card / validation errors (customer-facing) and plain text for technical errors.\n * `'table'`: the table, then Stripe's own `message` for EVERYTHING else, technical errors included (what the cremo payment flows show today).\n * `'stripe'`: Stripe's own `message` untouched (what the apps that show `error.message` do), the fallback when there is none.\n */\n display?: StripeErrorDisplay;\n /** Text for single codes; wins over the table. */\n overrides?: Readonly<Record<string, string>> | null;\n /** Shown when there is nothing better. */\n fallback?: string;\n}\n\n/**\n * The text to show the customer for a Stripe.js error.\n * Friendly mode order: decline_code, code, the two technical Stripe messages (\"already succeeded\" / \"previously confirmed\", \"expired\"),\n * technical error types, Stripe's own message, the fallback. Table mode is the same without the technical error types.\n */\nexport function getStripeErrorMessage(error: StripeErrorLike | null | undefined, options: StripeErrorMessageOptions = {}): string {\n const fallback = options.fallback ?? uiText('stripeErrors.defaultMessage');\n if (!error) return fallback;\n if (options.display === 'stripe') return error.message || fallback;\n const table = { ...localizedTable(STRIPE_ERROR_MESSAGES, 'stripeErrors.'), ...(options.overrides ?? {}) };\n if (error.decline_code && table[error.decline_code]) return table[error.decline_code];\n if (error.code && table[error.code]) return table[error.code];\n const message = error.message;\n if (message) {\n if (message.includes('already succeeded') || message.includes('previously confirmed')) return options.overrides?.['payment_intent_unexpected_state'] ?? uiText('stripeErrors.alreadyProcessed');\n if (message.includes('expired')) return uiText('stripeErrors.sessionExpired');\n }\n const technical = options.display === 'table' || !error.type || !(error.type in STRIPE_TECHNICAL_ERROR_MESSAGES) ? undefined : uiText(`stripeErrors.technical.${error.type}` as UiLabelKey);\n if (technical) return technical;\n return message || fallback;\n}\n","import { getStripeErrorMessage, type StripeErrorMessageOptions } from '../errors/stripe-errors';\nimport type { StripeConfirmationTokenLike, StripeErrorLike, StripeIntentLike } from '../stripe-loader/stripe-types';\nimport { UiLabelKey, uiText } from '@forgeroute/ui/core';\n\nexport type StripeIntentKind = 'setup' | 'payment';\n\n/**\n * What happened, in one word:\n * - `succeeded`: the intent succeeded (card charged / method saved).\n * - `processing`: the payment was accepted and is settling (a bank debit takes days).\n * - `requires_verification`: a bank account was entered by number; Stripe sent micro-deposits and the customer has to verify them (see `verification`).\n * - `requires_action`: the intent still needs the customer to do something else (3D Secure, a redirect-less next action).\n * - `requires_capture`: the payment is authorized and waits for the host to capture it (`captureMethod: 'manual'`).\n * - `requires_payment_method`: Stripe sends the intent back for a new payment method (the payment failed).\n * - `canceled` / `unknown`: any other status.\n */\nexport type StripeOutcome = 'succeeded' | 'processing' | 'requires_verification' | 'requires_action' | 'requires_capture' | 'requires_payment_method' | 'canceled' | 'unknown';\n\n/** What the customer has to do to verify a bank account (`next_action.verify_with_microdeposits`). */\nexport interface StripeVerification {\n /** `'amounts'` (two deposits), `'descriptor_code'` (one deposit with a code) or `null` when Stripe did not say. */\n type: 'amounts' | 'descriptor_code' | null;\n /** When the deposits should have arrived: Unix seconds as Stripe sends it, and the same instant as an ISO string. `null` when unknown. */\n arrivalDate: number | null;\n arrivalDateIso: string | null;\n /** Stripe's own page where the customer can verify (https), or `null`. */\n hostedVerificationUrl: string | null;\n}\n\n/** The normalised result of a confirmation (or of `handleReturn`). */\nexport interface StripeConfirmedEvent {\n kind: StripeIntentKind;\n /** Stripe's own `status` of the intent. */\n status: string;\n outcome: StripeOutcome;\n /** The intent exactly as Stripe.js returned it. */\n intent: StripeIntentLike;\n setupIntent?: StripeIntentLike;\n paymentIntent?: StripeIntentLike;\n intentId: string;\n /** The payment method of the intent as an id (`pm_...`), whether Stripe sent it as a string or an object; `null` when there is none. */\n paymentMethodId: string | null;\n /** Set when `outcome` is `requires_verification`. */\n verification: StripeVerification | null;\n /** The 3D Secure step (`stripe.handleCardAction`) ran before this result (`autoHandleCardAction` / `handleNextAction`). Hosts use it for their post-3DS wording. */\n actionHandled: boolean;\n}\n\n/** The funding of a card as Stripe reports it in a ConfirmationToken's `payment_method_preview.card.funding`. */\nexport type StripeCardFunding = 'credit' | 'debit' | 'prepaid' | 'unknown';\n\n/**\n * A ConfirmationToken made from the typed form (`createConfirmationToken()` / `collectConfirmationToken`), with what Stripe shows about the payment method BEFORE any\n * intent exists. `funding` is only for display and for hosts that estimate a fee; a backend that charges by it must read the funding itself from the token id\n * (`stripe.confirmationTokens.retrieve`), never trust the browser.\n */\nexport interface StripeConfirmationTokenEvent {\n /** `ctoken_...`: send it to your backend with the request that creates the intent. */\n id: string;\n /** The preview's payment method type (`'card'`, `'us_bank_account'`, `'link'`, ...), `null` when Stripe sent none. */\n paymentMethodType: string | null;\n /** The card's funding; `null` when the payment method is not a card, `'unknown'` when Stripe did not say. */\n funding: StripeCardFunding | null;\n brand: string | null;\n last4: string | null;\n country: string | null;\n /** `'apple_pay'` / `'google_pay'` / ... when a wallet card was used. */\n wallet: string | null;\n}\n\n/** The normalised {@link StripeConfirmationTokenEvent} of a ConfirmationToken. */\nexport function confirmationTokenEventOf(token: StripeConfirmationTokenLike): StripeConfirmationTokenEvent {\n const preview = token.payment_method_preview;\n const card = preview?.card ?? null;\n const funding = card ? (card.funding === 'credit' || card.funding === 'debit' || card.funding === 'prepaid' ? card.funding : 'unknown') : null;\n return {\n id: token.id,\n paymentMethodType: preview?.type ?? null,\n funding,\n brand: card?.brand ?? null,\n last4: card?.last4 ?? null,\n country: card?.country ?? null,\n wallet: card?.wallet?.type ?? null,\n };\n}\n\n/** Why a flow stopped. */\nexport type StripeFailureStage = 'load' | 'submit' | 'intent' | 'confirm' | 'action' | 'result' | 'verify' | 'return';\n\n/** A failure: `message` is what to show the customer; `stripeMessage` is Stripe's own text. */\nexport interface StripeFailure {\n code: string;\n message: string;\n stripeMessage: string;\n declineCode?: string;\n type?: string;\n stage: StripeFailureStage;\n /** The Stripe error as returned, when there was one. */\n error?: StripeErrorLike;\n /** True when the failure happened in or after the 3D Secure step. */\n actionHandled?: boolean;\n /** Stripe's status of the intent when the failure is about the intent's status (`requires_payment_method`, `canceled`, ...). */\n status?: string;\n}\n\n/** The payment method type the Payment Element currently shows (`'card'`, `'us_bank_account'`, ...) and its completeness. */\nexport interface StripeElementChange {\n complete: boolean;\n empty: boolean;\n /** The selected payment method type, `null` when Stripe did not send one. */\n type: string | null;\n /** Stripe's own validation message for the form, when it shows one. */\n errorMessage: string | null;\n}\n\nexport const MSG_NOT_INITIALIZED = 'Payment system not initialized';\nexport const MSG_INTENT_FAILED = 'Failed to create payment intent';\nexport const MSG_NOT_COMPLETED = 'Payment was not completed';\nexport const MSG_REQUIRES_PAYMENT_METHOD = 'Payment failed. Please try a different payment method.';\nexport const MSG_NO_PAYMENT_METHOD = 'No payment method was returned';\nexport const MSG_AUTH_FAILED = 'Payment authentication failed';\nexport const MSG_AUTH_NOT_COMPLETED = 'Payment authentication was not completed';\nexport const MSG_KEY_MISSING = 'The payment form is not set up yet';\nexport const MSG_LOAD_FAILED = 'Failed to load the payment service';\nexport const MSG_TOKEN_FAILED = 'The card details could not be checked. Please try again.';\n\nexport function paymentMethodIdOf(intent: StripeIntentLike | null | undefined): string | null {\n const pm = intent?.payment_method;\n if (!pm) return null;\n return typeof pm === 'string' ? pm : pm.id || null;\n}\n\n/** The micro-deposit verification of an intent whose `next_action` is `verify_with_microdeposits`, else `null`. */\nexport function verificationOf(intent: StripeIntentLike | null | undefined): StripeVerification | null {\n const action = intent?.next_action;\n if (action?.type !== 'verify_with_microdeposits') return null;\n const details = action.verify_with_microdeposits ?? {};\n const arrival = typeof details.arrival_date === 'number' ? details.arrival_date : null;\n const type = details.microdeposit_type === 'amounts' || details.microdeposit_type === 'descriptor_code' ? details.microdeposit_type : null;\n const url = typeof details.hosted_verification_url === 'string' && details.hosted_verification_url ? details.hosted_verification_url : null;\n return { type, arrivalDate: arrival, arrivalDateIso: arrival === null ? null : new Date(arrival * 1000).toISOString(), hostedVerificationUrl: url };\n}\n\n/** Stripe's intent `status` (and `next_action`) as one `StripeOutcome`. */\nexport function outcomeOf(intent: StripeIntentLike): StripeOutcome {\n switch (intent.status) {\n case 'succeeded': return 'succeeded';\n case 'processing': return 'processing';\n case 'requires_capture': return 'requires_capture';\n case 'requires_action': return intent.next_action?.type === 'verify_with_microdeposits' ? 'requires_verification' : 'requires_action';\n case 'requires_payment_method': return 'requires_payment_method';\n case 'canceled': return 'canceled';\n default: return 'unknown';\n }\n}\n\nexport function normalizeIntent(kind: StripeIntentKind, intent: StripeIntentLike): StripeConfirmedEvent {\n const outcome = outcomeOf(intent);\n return {\n kind,\n status: intent.status,\n outcome,\n intent,\n ...(kind === 'setup' ? { setupIntent: intent } : { paymentIntent: intent }),\n intentId: intent.id,\n paymentMethodId: paymentMethodIdOf(intent),\n verification: outcome === 'requires_verification' ? verificationOf(intent) : null,\n actionHandled: false,\n };\n}\n\n/** A failure from a Stripe error, with the text to show chosen by `display` (see `getStripeErrorMessage`). */\nexport function failureFromError(error: StripeErrorLike | null | undefined, stage: StripeFailureStage, options: StripeErrorMessageOptions = {}): StripeFailure {\n return {\n code: error?.code || error?.type || 'unknown_error',\n message: getStripeErrorMessage(error, options),\n stripeMessage: error?.message ?? '',\n ...(error?.decline_code ? { declineCode: error.decline_code } : {}),\n ...(error?.type ? { type: error.type } : {}),\n stage,\n ...(error ? { error } : {}),\n };\n}\n\n/** A failure that is not a Stripe error (our own text). */\nconst KNOWN_MESSAGE_KEYS: Readonly<Record<string, UiLabelKey>> = {\n 'Payment system not initialized': 'stripePayment.msg.notInitialized',\n 'Failed to create payment intent': 'stripePayment.msg.intentFailed',\n 'Payment was not completed': 'stripePayment.msg.notCompleted',\n 'Payment failed. Please try a different payment method.': 'stripePayment.msg.requiresPaymentMethod',\n 'No payment method was returned': 'stripePayment.msg.noPaymentMethod',\n 'Payment authentication failed': 'stripePayment.msg.authFailed',\n 'Payment authentication was not completed': 'stripePayment.msg.authNotCompleted',\n 'The payment form is not set up yet': 'stripePayment.msg.keyMissing',\n 'Failed to load the payment service': 'stripePayment.msg.loadFailed',\n 'Verification failed': 'stripePayment.msg.verifyFailed',\n 'Verification failed. Please check the code and try again.': 'stripePayment.msg.verifyThrown',\n 'We could not check the status of this payment. Please contact support before trying again.': 'stripePayment.msg.returnFailed',\n 'Payment method setup was incomplete. Please try again.': 'stripePayment.msg.setupIncomplete',\n 'Payment authentication failed. Please try a different payment method.': 'stripePayment.msg.authFailedTryOther',\n 'Card payments are not available right now.': 'stripePayment.msg.cardsUnavailable',\n 'Failed to initialize payment. Please try again.': 'stripePayment.msg.initFailed',\n 'Could not calculate the fees. Please try again.': 'stripePayment.msg.feesFailed',\n // STRIPE_DEFAULT_ERROR_MESSAGE: what a createIntent callback that throws without any message reports.\n 'Payment failed. Please try again.': 'stripeErrors.defaultMessage',\n 'The card details could not be checked. Please try again.': 'stripePayment.msg.tokenFailed',\n};\n\n/** Our own fixed messages (\"Payment system not initialized\" ...) in the app's active language; any other text (Stripe's, a host's) is returned as it is. */\nexport function localizeStripeMessage(message: string): string {\n const key = KNOWN_MESSAGE_KEYS[message];\n return key ? uiText(key) : message;\n}\n\nexport function failure(code: string, message: string, stage: StripeFailureStage, stripeMessage = ''): StripeFailure {\n return { code, message: localizeStripeMessage(message), stripeMessage, stage };\n}\n\n/** An error thrown by a host callback or a request: its own `error.error.message` (HTTP body), `message`, else the fallback. */\nexport function messageOfThrown(err: unknown, fallback: string): string {\n const e = err as { error?: { message?: unknown }; message?: unknown } | null | undefined;\n if (typeof e?.error?.message === 'string' && e.error.message) return e.error.message;\n if (typeof e?.message === 'string' && e.message) return e.message;\n return fallback;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { STRIPE_LOADER, STRIPE_PAYMENT_DEFAULTS, buildLoadOptions } from '../stripe-loader/stripe-loader';\nimport type { StripeLike, StripeLoadOptions } from '../stripe-loader/stripe-types';\nimport {\n failure, failureFromError, messageOfThrown, normalizeIntent, MSG_KEY_MISSING, MSG_LOAD_FAILED,\n type StripeConfirmedEvent, type StripeFailure, type StripeIntentKind, type StripeOutcome,\n} from './stripe-outcomes';\nimport type { StripeConfirmResult, StripeIntentLike } from '../stripe-loader/stripe-types';\n\n/** The Stripe object with `confirmUsBankAccountSetup`, for an app that keeps its own routing-number form (contractor). Use it as the type argument of `StripePaymentService.load`. */\nexport interface StripeLikeWithBankSetup extends StripeLike {\n confirmUsBankAccountSetup(clientSecret: string, data?: Record<string, unknown>): Promise<StripeConfirmResult<StripeIntentLike>>;\n}\n\n/** What `stripe.verifyMicrodepositsFor*` takes: the two deposit amounts in cents, or the 6-character code of the one deposit. */\nexport type MicrodepositVerifyData = { amounts: number[] } | { descriptor_code: string };\n\nexport interface StripeMicrodepositResult {\n /** The intent is verified (`processing` or `succeeded`). */\n ok: boolean;\n outcome: StripeOutcome | null;\n intent: StripeIntentLike | null;\n /** Set when `ok` is false. `message` is Stripe's own text (customer-facing for a wrong amount / code) or ours. */\n failure: StripeFailure | null;\n}\n\n/** What Stripe appends to the return URL after a redirect (`payment_intent_client_secret` / `setup_intent_client_secret`, `redirect_status`). */\nexport interface StripeReturnParams {\n kind: StripeIntentKind;\n clientSecret: string;\n redirectStatus: string | null;\n}\n\n/** Reads the intent Stripe returned the customer with from a query string (`location.search`); `null` when there is none. */\nexport function readStripeReturnParams(search: string): StripeReturnParams | null {\n const params = new URLSearchParams(search.startsWith('?') ? search.slice(1) : search);\n const payment = params.get('payment_intent_client_secret');\n const setup = params.get('setup_intent_client_secret');\n const kind: StripeIntentKind | null = payment ? 'payment' : setup ? 'setup' : null;\n if (!kind) return null;\n return { kind, clientSecret: (payment ?? setup) as string, redirectStatus: params.get('redirect_status') };\n}\n\nexport const MSG_VERIFY_FAILED = 'Verification failed';\nexport const MSG_VERIFY_THROWN = 'Verification failed. Please check the code and try again.';\nexport const MSG_RETURN_FAILED = 'We could not check the status of this payment. Please contact support before trying again.';\n\n/**\n * Verifies a bank account with micro-deposits through Stripe.js (`verifyMicrodepositsForPayment` / `verifyMicrodepositsForSetup`), the way the public\n * \"verify your bank\" pages do it with the intent's client secret. The result is `ok` once the intent is `processing` or `succeeded`.\n */\nexport async function verifyMicrodeposits(stripe: StripeLike, flow: StripeIntentKind, clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult> {\n const call = flow === 'payment' ? stripe.verifyMicrodepositsForPayment : stripe.verifyMicrodepositsForSetup;\n if (typeof call !== 'function') return { ok: false, outcome: null, intent: null, failure: failure('unsupported', MSG_VERIFY_FAILED, 'verify') };\n try {\n const result = await call.call(stripe, clientSecret, data as Record<string, unknown>);\n if (result.error) return { ok: false, outcome: null, intent: null, failure: failureFromError(result.error, 'verify', { display: 'stripe', fallback: MSG_VERIFY_FAILED }) };\n const intent = (flow === 'payment' ? result.paymentIntent : result.setupIntent) ?? null;\n const event = intent ? normalizeIntent(flow, intent) : null;\n if (event && (event.outcome === 'processing' || event.outcome === 'succeeded')) return { ok: true, outcome: event.outcome, intent, failure: null };\n return { ok: false, outcome: event?.outcome ?? null, intent, failure: failure('verification_incomplete', MSG_VERIFY_FAILED, 'verify') };\n } catch (err) {\n return { ok: false, outcome: null, intent: null, failure: failure('verification_failed', messageOfThrown(err, MSG_VERIFY_THROWN), 'verify', messageOfThrown(err, '')) };\n }\n}\n\nexport interface StripeReturnResult {\n event: StripeConfirmedEvent | null;\n failure: StripeFailure | null;\n}\n\n/** Retrieves the intent after Stripe redirected the customer back (`retrievePaymentIntent` / `retrieveSetupIntent`) and normalises it. */\nexport async function retrieveIntent(stripe: StripeLike, kind: StripeIntentKind, clientSecret: string): Promise<StripeReturnResult> {\n const call = kind === 'payment' ? stripe.retrievePaymentIntent : stripe.retrieveSetupIntent;\n if (typeof call !== 'function') return { event: null, failure: failure('unsupported', MSG_RETURN_FAILED, 'return') };\n try {\n const result = await call.call(stripe, clientSecret);\n if (result.error) return { event: null, failure: failureFromError(result.error, 'return') };\n const intent = kind === 'payment' ? result.paymentIntent : result.setupIntent;\n if (!intent) return { event: null, failure: failure('no_intent', MSG_RETURN_FAILED, 'return') };\n return { event: normalizeIntent(kind, intent), failure: null };\n } catch (err) {\n return { event: null, failure: failure('return_failed', MSG_RETURN_FAILED, 'return', messageOfThrown(err, '')) };\n }\n}\n\nexport interface StripeConnection {\n publishableKey?: string | null;\n /** A Stripe Connect account id. */\n stripeAccount?: string | null;\n locale?: string | null;\n /** Further `loadStripe` options. */\n options?: StripeLoadOptions | null;\n}\n\nexport interface HandleReturnOptions extends StripeConnection {\n /** The client secret from the return URL. Default: read from `search`. */\n clientSecret?: string;\n /** Which kind of intent `clientSecret` belongs to (default: from the URL parameter name, else `'payment'`). */\n kind?: StripeIntentKind;\n /** The query string to read the return parameters from. Default: `window.location.search`. */\n search?: string;\n}\n\n/**\n * Stripe.js without a component: loads Stripe like `ui-stripe-payment` does, verifies micro-deposits and checks the intent after a redirect.\n * For pages that only verify a bank account (the \"verify your bank\" link) or only land on the `returnUrl`.\n */\n@Injectable({ providedIn: 'root' })\nexport class StripePaymentService {\n private readonly loader = inject(STRIPE_LOADER);\n private readonly defaults = inject(STRIPE_PAYMENT_DEFAULTS);\n\n /** Loads Stripe.js (`loadStripe(key, options)`). Pass a type for methods the library does not use: `load<StripeLikeWithBankSetup>(...)` (contractor's `confirmUsBankAccountSetup`). Throws when the key is missing or Stripe could not be created. */\n async load<T extends StripeLike = StripeLike>(connection: StripeConnection = {}): Promise<T> {\n const key = connection.publishableKey || this.defaults.publishableKey;\n if (!key) throw new Error(MSG_KEY_MISSING);\n const stripe = await this.loader(key, buildLoadOptions(connection.stripeAccount, connection.locale ?? this.defaults.locale, connection.options));\n if (!stripe) throw new Error(MSG_LOAD_FAILED);\n return stripe as T;\n }\n\n async verifyMicrodepositsForPayment(clientSecret: string, data: MicrodepositVerifyData, connection: StripeConnection = {}): Promise<StripeMicrodepositResult> {\n return this.verify('payment', clientSecret, data, connection);\n }\n\n async verifyMicrodepositsForSetup(clientSecret: string, data: MicrodepositVerifyData, connection: StripeConnection = {}): Promise<StripeMicrodepositResult> {\n return this.verify('setup', clientSecret, data, connection);\n }\n\n /** The intent the customer returned with, normalised. `{ event: null, failure: null }` when the URL carries no intent. */\n async handleReturn(options: HandleReturnOptions = {}): Promise<StripeReturnResult> {\n const fromUrl = options.clientSecret ? null : readStripeReturnParams(options.search ?? (typeof window === 'undefined' ? '' : window.location.search));\n const clientSecret = options.clientSecret ?? fromUrl?.clientSecret;\n if (!clientSecret) return { event: null, failure: null };\n const kind = options.kind ?? fromUrl?.kind ?? 'payment';\n let stripe: StripeLike;\n try { stripe = await this.load(options); } catch (err) { return { event: null, failure: failure('load_error', messageOfThrown(err, MSG_LOAD_FAILED), 'load', messageOfThrown(err, '')) }; }\n return retrieveIntent(stripe, kind, clientSecret);\n }\n\n private async verify(flow: StripeIntentKind, clientSecret: string, data: MicrodepositVerifyData, connection: StripeConnection): Promise<StripeMicrodepositResult> {\n let stripe: StripeLike;\n try { stripe = await this.load(connection); } catch (err) { return { ok: false, outcome: null, intent: null, failure: failure('load_error', messageOfThrown(err, MSG_LOAD_FAILED), 'load', messageOfThrown(err, '')) }; }\n return verifyMicrodeposits(stripe, flow, clientSecret, data);\n }\n}\n","import { isDarkPage } from '@forgeroute/ui/utils';\n\n/**\n * The Payment Element `appearance` for the page's own look: Stripe's variables read from CSS custom properties at runtime, so one set of\n * tokens styles the page and the payment form, in light and dark.\n *\n * :root { --ui-stripe-color-primary: #0d9488; --ui-stripe-border-radius: 8px; }\n *\n * Variables read (all optional; a missing one is left out so Stripe's default stays): `--ui-stripe-color-primary`, `--ui-stripe-color-background`,\n * `--ui-stripe-color-text`, `--ui-stripe-color-danger`, `--ui-stripe-font-family`, `--ui-stripe-border-radius`, `--ui-stripe-font-size-base`.\n * The theme is `night` when the page is dark (`data-theme=\"dark\"`, or the system is dark and `data-theme` is not `light`), else `stripe`.\n */\nexport interface StripeAppearance {\n theme?: 'stripe' | 'night' | 'flat';\n variables?: Record<string, string>;\n rules?: Record<string, Record<string, string>>;\n labels?: 'above' | 'floating';\n disableAnimations?: boolean;\n}\n\nconst TOKENS: readonly (readonly [string, string])[] = [\n ['--ui-stripe-color-primary', 'colorPrimary'],\n ['--ui-stripe-color-background', 'colorBackground'],\n ['--ui-stripe-color-text', 'colorText'],\n ['--ui-stripe-color-danger', 'colorDanger'],\n ['--ui-stripe-font-family', 'fontFamily'],\n ['--ui-stripe-border-radius', 'borderRadius'],\n ['--ui-stripe-font-size-base', 'fontSizeBase'],\n];\n\n// `isDarkPage` lives in the main entry (shared with the Square entry); it stays exported from here so existing imports keep working.\nexport { isDarkPage };\n\n/** Builds the appearance from the tokens in effect on `element` (default: the document root). */\nexport function readStripeAppearance(doc: Document, element: Element = doc.documentElement): StripeAppearance {\n const view = doc.defaultView;\n const variables: Record<string, string> = {};\n if (view) {\n const style = view.getComputedStyle(element);\n for (const [token, variable] of TOKENS) {\n const value = style.getPropertyValue(token).trim();\n if (value) variables[variable] = value;\n }\n }\n return { theme: isDarkPage(doc) ? 'night' : 'stripe', ...(Object.keys(variables).length ? { variables } : {}) };\n}\n\n/**\n * The app's theme tokens for {@link stripeAppearanceFromTheme}. Every field is optional: a missing one is left out so the processor's default stays.\n * Colours are any CSS colour string; `radius` / `fontSize` are CSS lengths (`'8px'`, `'16px'`).\n */\nexport interface StripeThemeTokens {\n /** Focus ring / selected tab / links. */\n primary?: string;\n background?: string;\n text?: string;\n /** Secondary text (placeholders, labels' helper text). */\n textMuted?: string;\n danger?: string;\n /** The border of inputs and tabs. */\n border?: string;\n fontFamily?: string;\n radius?: string;\n fontSize?: string;\n /** The page is dark: the `night` base theme instead of `stripe`. Default false. */\n dark?: boolean;\n /** `'floating'` labels inside the input; default `'above'` (labels above the input read better at 320px and for screen magnifiers). */\n labels?: 'above' | 'floating';\n}\n\n/**\n * Neutral appearance helper for apps: turns the app's own theme tokens into a Payment Element `appearance` object (pass it to `[appearance]`), so the payment form matches the page in light and dark\n * without the app knowing the processor's variable names. Pure (no DOM): call it with the values you already have (a design-token object, a signal, `getComputedStyle` results).\n * Colours go to the base variables; input and tab borders and the label colour are set through rules so the 3:1 non-text contrast of the page's border token carries over.\n */\nexport function stripeAppearanceFromTheme(tokens: StripeThemeTokens): StripeAppearance {\n const variables: Record<string, string> = {};\n const set = (name: string, value: string | undefined): void => { if (value && value.trim()) variables[name] = value.trim(); };\n set('colorPrimary', tokens.primary);\n set('colorBackground', tokens.background);\n set('colorText', tokens.text);\n set('colorTextSecondary', tokens.textMuted);\n set('colorDanger', tokens.danger);\n set('fontFamily', tokens.fontFamily);\n set('borderRadius', tokens.radius);\n set('fontSizeBase', tokens.fontSize);\n const rules: Record<string, Record<string, string>> = {};\n const rule = (selector: string, props: Record<string, string | undefined>): void => {\n const filled = Object.fromEntries(Object.entries(props).filter(([, v]) => !!v && v.trim())) as Record<string, string>;\n if (Object.keys(filled).length) rules[selector] = filled;\n };\n const border = tokens.border?.trim();\n if (border) { // a blank (whitespace only) border token adds no rule (it would otherwise become the invalid \"1px solid\")\n rule('.Input', { border: `1px solid ${border}` });\n rule('.Tab', { border: `1px solid ${border}` });\n }\n if (tokens.text) rule('.Label', { color: tokens.text });\n return {\n theme: tokens.dark ? 'night' : 'stripe',\n labels: tokens.labels ?? 'above',\n ...(Object.keys(variables).length ? { variables } : {}),\n ...(Object.keys(rules).length ? { rules } : {}),\n };\n}\n","import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, PLATFORM_ID, afterNextRender, computed, effect, inject, input, output, signal, untracked, viewChild, ViewEncapsulation } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent, uiText } from '@forgeroute/ui/core';\nimport { PAYMENT_READINESS_EVERY_MS, PAYMENT_READINESS_TIMEOUT_MS, PAYMENT_REQUEST_TIMEOUT_MS, PAYMENT_STATUS_CHECK_TIMEOUT_MS, PAYMENT_STATUS_FAIL_GRACE_MS, PAYMENT_STATUS_HARD_MAX_MS, PAYMENT_AUTH_TIMEOUT_MS, PAYMENT_STATUS_POLL_MAX_MS, PAYMENT_STATUS_POLL_MS, PaymentAttemptStatusComponent, attemptLabelKey, createPaymentProtection, wasQueuedOffline, warnQueuedPayment, isAttemptFailedReplay, type CheckPaymentStatusFn, type PaymentAttempt, type PaymentAttemptOutcome, type PaymentAttemptResult, type PaymentReadiness, type PaymentReadinessResult, type ReadinessCheckFn } from '@forgeroute/ui/payments';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { STRIPE_LOADER, STRIPE_PAYMENT_DEFAULTS, buildLoadOptions } from '../stripe-loader/stripe-loader';\nimport type { StripeElementsLike, StripeLike, StripeLoadOptions, StripePaymentElementLike } from '../stripe-loader/stripe-types';\nimport type { StripeErrorDisplay, StripeErrorMessageOptions } from '../errors/stripe-errors';\nimport { STRIPE_DEFAULT_ERROR_MESSAGE } from '../errors/stripe-errors';\nimport { MSG_TOKEN_FAILED, confirmationTokenEventOf, MSG_AUTH_FAILED, MSG_AUTH_NOT_COMPLETED, MSG_KEY_MISSING, MSG_INTENT_FAILED, MSG_LOAD_FAILED, MSG_NOT_COMPLETED, MSG_NOT_INITIALIZED, MSG_NO_PAYMENT_METHOD, MSG_REQUIRES_PAYMENT_METHOD, failure, failureFromError, messageOfThrown, normalizeIntent, type StripeConfirmationTokenEvent, type StripeConfirmedEvent, type StripeElementChange, type StripeFailure, type StripeFailureStage, type StripeIntentKind, localizeStripeMessage } from './stripe-outcomes';\nimport { readStripeReturnParams, retrieveIntent, verifyMicrodeposits, type MicrodepositVerifyData, type StripeMicrodepositResult, type StripeReturnResult } from './stripe-actions';\nimport { readStripeAppearance, type StripeAppearance } from './stripe-appearance';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/** The texts of the screen-reader status region. */\nexport interface StripeA11yMessages {\n loading: string;\n savingMethod: string;\n processingPayment: string;\n methodSaved: string;\n paymentReceived: string;\n paymentProcessing: string;\n paymentAuthorized: string;\n verificationNeeded: string;\n /** Setup mode: no payment is involved; the bank account is not saved until the payer verifies the deposits. */\n verificationNeededSetup: string;\n actionRequired: string;\n}\n\n/** The screen-reader messages of the payment form; read on every access, so they follow the app's active language. */\nexport const STRIPE_A11Y_MESSAGES: Readonly<StripeA11yMessages> = {\n get loading() { return uiText('stripePayment.a11y.loading'); },\n get savingMethod() { return uiText('stripePayment.a11y.savingMethod'); },\n get processingPayment() { return uiText('stripePayment.a11y.processingPayment'); },\n get methodSaved() { return uiText('stripePayment.a11y.methodSaved'); },\n get paymentReceived() { return uiText('stripePayment.a11y.paymentReceived'); },\n get paymentProcessing() { return uiText('stripePayment.a11y.paymentProcessing'); },\n get paymentAuthorized() { return uiText('stripePayment.a11y.paymentAuthorized'); },\n get verificationNeeded() { return uiText('stripePayment.a11y.verificationNeeded'); },\n get verificationNeededSetup() { return uiText('stripePayment.a11y.verificationNeededSetup'); },\n get actionRequired() { return uiText('stripePayment.a11y.actionRequired'); },\n};\n\n/** The exact text shown while the bank-account tab is selected. */\nexport const STRIPE_ACH_NOTICE = 'Signing in to your bank account lets you pay right away. Entering your routing and account numbers instead requires verification with two small deposits, which typically take a couple of days to arrive in your account.';\n\n/**\n * \"Deferred intent\" Elements: the form is shown first, the PaymentIntent / SetupIntent is created on the host's backend when the customer submits.\n * Maps to `stripe.elements({ mode, amount, currency, setup_future_usage, payment_method_types, ... })`.\n */\nexport interface StripeDeferredIntent {\n /** Default: the component's `mode`. */\n mode?: 'payment' | 'setup' | 'subscription';\n /** Smallest currency unit (cents). Changing it later calls `elements.update({ amount })` (no re-init). */\n amount?: number;\n currency: string;\n setupFutureUsage?: 'on_session' | 'off_session';\n captureMethod?: 'automatic' | 'automatic_async' | 'manual';\n onBehalfOf?: string;\n}\n\n/** Called on submit in deferred mode: create the intent on your backend and resolve its client secret (or `{ clientSecret }`). */\nexport type StripeCreateIntentFn = (context: { mode: StripeIntentKind; confirmationToken?: StripeConfirmationTokenEvent | null; attemptKey?: string; payableRef?: string | null }) => Promise<string | { clientSecret: string }>;\n\nexport interface StripeBillingDetails {\n name?: string;\n email?: string;\n phone?: string;\n address?: Record<string, string | null | undefined>;\n}\n\n/**\n * The live Stripe.js objects of a form, handed to the host by `(stripeReady)`: the host's own code can call `stripe.confirmPayment({ elements, ... })`,\n * `elements.submit()`, `elements.update()`, `elements.fetchUpdates()` and `paymentElement.update()` with its own arguments.\n */\nexport interface StripeReadyEvent {\n stripe: StripeLike;\n elements: StripeElementsLike;\n paymentElement: StripePaymentElementLike;\n}\n\n/** What ONE protected confirm learned (its own object, passed down: nothing here lives on the component, so a late answer of an older attempt never leaks into the next). */\ninterface ConfirmTrace {\n /** Failures are held back until the attempt is classified: an UNKNOWN outcome must never be shown or emitted as \"failed\". */\n held: boolean;\n failure: StripeFailure | null;\n thrown: boolean;\n outcome: string | null;\n}\n\n/** Stripe error types and codes that say \"Stripe may or may not have processed this\": never a definitive decline. */\nconst AMBIGUOUS_STRIPE_TYPES = new Set(['api_connection_error', 'api_error', 'rate_limit_error', 'idempotency_error']);\n// `setup_intent_unexpected_state`: a re-confirm of a SetupIntent that already succeeded / is processing. Proves nothing about the NEW attempt: the host's status check decides, never a definitive failure that moves the epoch.\nconst AMBIGUOUS_STRIPE_CODES = new Set(['payment_intent_unexpected_state', 'setup_intent_unexpected_state', 'idempotency_error', 'idempotency_key_in_use', 'lock_timeout']);\n\n/** Shown when a setup ends without a SetupIntent / is cancelled (the English source text of `stripePayment.msg.setupIncomplete`). */\nconst MSG_SETUP_INCOMPLETE = 'Payment method setup was incomplete. Please try again.';\n\n/** The failure code of an instant-only form whose intent came back needing micro-deposit verification. */\nexport const INSTANT_ONLY_CODE = 'instant_only_unsupported';\n\nlet nextId = 0;\nconst jsonEqual = (a: unknown, b: unknown): boolean => JSON.stringify(a) === JSON.stringify(b);\n\n/**\n * Stripe Payment Element: saves a payment method (`mode=\"setup\"`, a SetupIntent) or takes a payment (`mode=\"payment\"`, a PaymentIntent).\n *\n * The host app creates the intent on its backend and passes the `clientSecret` (or, for a deferred intent, `[deferred]` + `[createIntent]`).\n * Stripe.js is loaded lazily through `@stripe/stripe-js` (an optional peer dependency); nothing of Stripe is in the library's static imports.\n *\n * <ui-stripe-payment mode=\"setup\" [publishableKey]=\"key\" [clientSecret]=\"secret()\" submitLabel=\"Save card\"\n * (confirmed)=\"onSaved($event)\" (failed)=\"onFailed($event)\" />\n *\n * Every Stripe.js call and option reproduces what the CRM apps do today; see docs/stripe.md (\"Parity with the existing app implementations\").\n */\n@Component({\n selector: 'ui-stripe-payment',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [AlertComponent, ButtonComponent, PaymentAttemptStatusComponent, SkeletonComponent],\n host: { '[attr.aria-busy]': '!mountOnly() && (loading() || submitting()) ? \"true\" : null' },\n template: `\n <div class=\"sp\">\n @if (!mountOnly() || a11yMessages()) {\n <div class=\"sp-sr\" role=\"status\" aria-live=\"polite\" data-testid=\"stripe-status\">{{ statusText() }}</div>\n }\n @if (!mountOnly() && protectionOn()) {\n <ui-payment-attempt-status [attempt]=\"attempt\" [readiness]=\"readiness\" [kind]=\"mode()\" [allowStartOver]=\"allowStartOver()\" [showPaid]=\"showPaid()\" (retryLoad)=\"reload()\" />\n }\n @if (!mountOnly() && (loading() || pending())) {\n <div class=\"sp-skeleton\" data-testid=\"stripe-skeleton\" aria-hidden=\"true\">\n <ui-skeleton [height]=\"44\" [mb]=\"10\" />\n <ui-skeleton [height]=\"44\" [mb]=\"10\" />\n <ui-skeleton [height]=\"44\" width=\"60%\" />\n </div>\n }\n @if (!mountOnly() && loadErrorText(); as text) {\n <div class=\"sp-block\" data-testid=\"stripe-load-error\"><ui-alert variant=\"danger\">{{ text }}</ui-alert></div>\n }\n @if (!mountOnly() && required()) {\n <div class=\"sp-label\" data-testid=\"stripe-required-label\">{{ label() }}<span class=\"sp-required\" aria-hidden=\"true\">*</span></div>\n }\n <div #mount class=\"sp-mount\" [attr.id]=\"mountId() || null\" [class]=\"mountClass()\" [class.sp-mount--hidden]=\"mountHidden()\" [attr.aria-hidden]=\"mountHidden() ? 'true' : null\" [attr.inert]=\"mountHidden() ? '' : null\"\n [attr.role]=\"mountOnly() ? null : 'group'\" [attr.aria-label]=\"mountOnly() ? null : label()\" data-testid=\"stripe-mount\"></div>\n @if (!mountOnly() && achNoticeVisible()) {\n <div class=\"sp-block\" [attr.data-testid]=\"achNoticeTestId()\"><ui-alert variant=\"info\">{{ achNoticeText() }}</ui-alert></div>\n }\n @if (!mountOnly() && errorText(); as text) {\n <div #errorBox class=\"sp-block sp-error\" [id]=\"errorId\" tabindex=\"-1\" data-testid=\"stripe-error\"><ui-alert variant=\"danger\">{{ text }}</ui-alert></div>\n }\n @if (!mountOnly()) {\n <!-- stays in the DOM so the reason is announced when it appears; the reason is text in a warning alert, never colour alone -->\n <div class=\"sp-blocked\" role=\"status\" aria-live=\"polite\" data-testid=\"stripe-blocked-status\">\n @if (blocked()) { <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"stripe-blocked\">{{ blockedText() }}</ui-alert> }\n </div>\n }\n @if (!mountOnly() && showSubmit()) {\n <div class=\"sp-actions\">\n <ui-button variant=\"primary\" type=\"button\" [loading]=\"submitting()\" [disabled]=\"submitDisabled()\" [ariaDescribedBy]=\"errorText() ? errorId : undefined\"\n data-testid=\"stripe-submit\" (click)=\"confirm()\">{{ effectiveSubmitLabel() }}</ui-button>\n </div>\n }\n </div>\n `,\n styles: [`\n ui-stripe-payment { display: block; min-width: 0; }\n ui-stripe-payment .sp-sr {\n position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;\n clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;\n }\n .sp-block { margin-top: 12px; }\n .sp-blocked:not(:empty) { margin-top: 12px; }\n /* The error block is focused (programmatically) after a blocked submit: no ring on the container itself, the alert inside carries the message. scroll-margin keeps it clear of a sticky header. */\n .sp-error { outline: none; scroll-margin-top: 16px; scroll-margin-bottom: 80px; }\n .sp-label { font-size: 0.875rem; font-weight: 500; color: #1e293b; margin-bottom: 6px; }\n .sp-required { color: #dc2626; margin-left: 2px; }\n .sp-actions { margin-top: 16px; display: flex; justify-content: flex-end; }\n ui-stripe-payment .sp { position: relative; }\n /* While loading the form is kept laid out (so Stripe can measure it and open Apple Pay / Link / the bank login) but invisible and untouchable. */\n .sp-mount--hidden { position: absolute; top: 0; left: 0; right: 0; opacity: 0; pointer-events: none; }\n /* Phones: the button fills the row. ui-button's host is inline-flex and its inner button is content-sized, so the inner .btn is stretched (ui-button has no host width hook). */\n @media (max-width: 480px) {\n .sp-actions { display: block; }\n .sp-actions ui-button { display: flex; }\n ui-stripe-payment .sp-actions .btn { width: 100%; }\n }\n `],\n})\nexport class StripePaymentComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly loader = inject(STRIPE_LOADER);\n private readonly defaults = inject(STRIPE_PAYMENT_DEFAULTS);\n private readonly doc = inject(DOCUMENT);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n // ── Inputs ─────────────────────────────────────────────────────────────\n /**\n * Mount-only mode: the component only mounts the Payment Element. No submit button, skeleton, status text (unless `a11yMessages` is set), bank notice or error\n * alert; it never submits, confirms or updates by itself; load failures go to `(loadError)` only. The host keeps its own confirm code and calls Stripe.js with the\n * objects from `(stripeReady)`. `mountId` / `mountClass` still apply, and `(ready)`, `(elementChange)`, `(paymentMethodTypeChange)` still emit.\n */\n readonly mountOnly = input(false);\n /** `'setup'` saves a payment method (`confirmSetup`), `'payment'` takes a payment (`confirmPayment`). */\n readonly mode = input<StripeIntentKind>('payment');\n /** The publishable key (`pk_...`). Falls back to `provideStripePayment({ publishableKey })`. */\n readonly publishableKey = input<string | null>(null);\n /** The client secret of the SetupIntent / PaymentIntent your backend created. Changing it re-creates the form. */\n readonly clientSecret = input<string | null>(null);\n /** Deferred intent: show the form first, create the intent on submit with `createIntent`. Used instead of `clientSecret`. */\n readonly deferred = input<StripeDeferredIntent | null>(null);\n /** Creates the intent on submit (deferred mode) and resolves its client secret. */\n readonly createIntent = input<StripeCreateIntentFn | null>(null);\n /** A Stripe Connect account id (`acct_...`): `loadStripe(key, { stripeAccount })`. */\n readonly stripeAccount = input<string | null>(null);\n /** Stripe.js locale. */\n readonly locale = input<string | null>(null);\n /** Further `loadStripe` options. */\n readonly stripeOptions = input<StripeLoadOptions | null>(null);\n /** Payment method types for a DEFERRED intent (`elements({ payment_method_types })`). With a client secret the intent decides, nothing is passed. */\n readonly paymentMethodTypes = input<string[] | null>(null);\n /** Extra `stripe.elements()` options, merged last. */\n readonly elementsOptions = input<Record<string, unknown> | null>(null);\n\n // Payment Element options (`elements.create('payment', ...)`): only the ones that are set are passed.\n /** `'tabs'` (default), `'accordion'`, an object, or `null` to pass no layout. */\n readonly layout = input<string | Record<string, unknown> | null>('tabs');\n readonly paymentMethodOrder = input<string[] | null>(null);\n /** `{ applePay: 'never', googlePay: 'never' }` hides the wallets. */\n readonly wallets = input<Record<string, string> | null>(null);\n /** `{ billingDetails: { email: 'never', phone: 'never', address: 'auto' } }` etc. */\n readonly fields = input<Record<string, unknown> | null>(null);\n /** Pre-filled values: `{ billingDetails: { name, email, address: { country: 'US' } } }`. A later change updates the element in place. */\n readonly defaultValues = input<Record<string, unknown> | null>(null);\n readonly business = input<{ name: string } | null>(null);\n readonly terms = input<Record<string, string> | null>(null);\n /** Extra Payment Element options, merged last (readOnly, fields, ...). */\n readonly paymentElementOptions = input<Record<string, unknown> | null>(null);\n /** The Elements appearance. */\n readonly appearance = input<StripeAppearance | null>(null);\n /** Derive the appearance from the `--ui-stripe-*` CSS tokens (light / dark) when no `appearance` is set. */\n readonly appearanceFromTokens = input(false);\n\n /**\n * INSTANT-ONLY bank accounts (a subscription / recurring billing setup that must not wait days for micro-deposits). Default false = unchanged.\n * When true the component never OFFERS manual bank entry: for a CLIENT-SECRET intent the form shows whatever the intent allows, so your backend must create the PaymentIntent / SetupIntent with\n * `payment_method_options.us_bank_account.verification_method = 'instant'` (that is what removes the routing / account number entry in the Payment Element); for a DEFERRED intent the component passes\n * `paymentMethodOptions: { us_bank_account: { verification_method: 'instant' } }` to `stripe.elements()` itself (your `elementsOptions` still win). The bank notice then says \"sign in to your bank\" only.\n * Defensive check: if a SetupIntent / PaymentIntent nevertheless comes back needing micro-deposit verification, nothing is reported as confirmed, no verification UI or status is shown, and the payer reads\n * `stripePayment.msg.instantOnlyUnavailable` (\"use a card or a bank that supports bank login\"); `(failed)` carries the code `instant_only_unsupported` and the protected attempt FAILS (new key, nothing was charged or saved).\n */\n readonly instantOnly = input(false);\n /**\n * Keep Stripe Link and the wallets OFF (default false = unchanged, so no existing form changes). When true: `wallets` is forced to `{ applePay: 'never', googlePay: 'never', link: 'never' }`\n * (merged OVER your `wallets` input) and a DEFERRED intent without your own `paymentMethodTypes` is created with `payment_method_types: ['card', 'us_bank_account']`; a `link` entry in your own\n * `paymentMethodTypes` is dropped. With a client secret the intent decides the types: create it with `payment_method_types: ['card', 'us_bank_account']` on your backend.\n */\n readonly linkOff = input(false);\n /** Show the paid state of the attempt status (default true). A form whose host shows its own success notice sets it off while that notice is up. */\n readonly showPaid = input(true);\n\n // Confirmation\n /** Where Stripe sends the customer back after a redirect. Unset = the current page (`window.location.href`); `null` = pass no `return_url`. */\n readonly returnUrl = input<string | null | undefined>(undefined);\n /** Billing details sent on confirm (`confirmParams.payment_method_data.billing_details`), needed for fields hidden with `'never'`. */\n readonly billingDetails = input<StripeBillingDetails | null>(null);\n /** Extra `confirmParams`, merged last. */\n readonly confirmParams = input<Record<string, unknown> | null>(null);\n /** `'if_required'` (default) keeps the customer on the page unless the method needs a redirect. */\n readonly redirect = input<'if_required' | 'always'>('if_required');\n /** Call `elements.submit()` before confirming. Unset = automatic: yes for a deferred intent (Stripe requires it), no with a client secret. */\n readonly submitBeforeConfirm = input<boolean | null>(null);\n /** After a payment comes back `requires_action` (not a bank verification), run `stripe.handleCardAction` (3D Secure) before reporting. */\n readonly autoHandleCardAction = input(false);\n /**\n * Opt-in (default off, nothing changes): when `confirm()` runs for a CARD, create a ConfirmationToken from the Elements (`stripe.createConfirmationToken({ elements })`, after\n * `elements.submit()`) before the intent is created. The token is emitted as `(confirmationToken)` and handed to `createIntent({ mode, confirmationToken })`, so the host's backend\n * can read the card funding (credit / debit / prepaid) from Stripe BEFORE it creates the intent. A token that cannot be made never stops the payment (the `createIntent`\n * context then has no token). Only made for a DEFERRED intent (`[deferred]`, no `clientSecret`: Stripe requires deferred Elements for `createConfirmationToken`); never for a bank account, Link or a wallet tab, nor for `confirm({ useExistingIntent: true })`.\n */\n readonly collectConfirmationToken = input(false);\n\n // ── Duplicate-payment protection and readiness gate (opt-in: with `duplicateProtection` off, nothing below changes any existing behaviour) ──\n /**\n * Turns on the duplicate-charge protection (docs: \"Duplicate-payment protection\") and the readiness gate (\"Readiness gate\"): the synchronous in-flight lock for the button, Enter and `confirm()`,\n * the attempt key, the UNKNOWN outcome (timeout, offline mid-flight) with the host's `checkStatus`, offline refusal, the paid lock and the readiness reasons. Default OFF: `confirm()` behaves\n * exactly as it always did and `createIntent` receives the same context.\n */\n readonly duplicateProtection = input(false);\n /**\n * The amount of the attempt in MAJOR units (the base amount the payer typed): it goes into the attempt marker, the derived key and the host's records. Default: the deferred amount / 100. A caller whose deferred\n * amount includes fees (the Stripe payment-panel plugin) passes the base amount here, so a payment recorded after an unknown outcome is the base amount, not the fee-inclusive charge.\n */\n readonly attemptAmount = input<number | null>(null);\n /**\n * The method of the attempt as the HOST names it (marker, derived key, `succeeded` outcome / tombstone). Default: the Stripe payment method type (`'card'`, `'us_bank_account'`). The payment-panel plugin passes the\n * panel's own method (`'CARD'`, `'ACH'`), so an attempt adopted by a reload or another tab is recorded with the method the panel knows, not with a Stripe type.\n */\n readonly attemptMethod = input<string | null>(null);\n /**\n * The payable this is for (an invoice, a balance, a payment link). While an attempt is undecided its opaque marker (key, amount, method) is stored under it in `localStorage`, so a RELOAD or a\n * SECOND TAB of the same payable starts locked (unknown) with the same attempt key. Without it the protection covers this page instance only. Nothing else is stored.\n */\n readonly payableRef = input<string | null>(null);\n /**\n * Opt-in for `mode=\"setup\"` (a SetupIntent: saves a card WITHOUT charging it): with `duplicateProtection` AND `protectSetup` the same protection runs for the save, driven by the same inputs\n * (`payableRef`, `attemptKey`, `checkStatus`, `paid`, `readinessCheck`, the timeouts): synchronous lock, attempt key (also in `createIntent({ mode: 'setup', attemptKey, payableRef })` of a\n * deferred setup), UNKNOWN state with `checkStatus` polling, offline refusal, readiness gate and the reload / second-tab lock. The texts say \"payment method\" instead of \"payment\". Default OFF: a\n * setup form ignores `duplicateProtection` exactly as before. Ignored in `mode=\"payment\"`.\n */\n readonly protectSetup = input(false);\n /**\n * Only for `mode=\"setup\"` with `protectSetup` (default true = unchanged). With the default, a saved card leaves a 24-hour \"paid\" lock under the `payableRef` (every form of the payable mounted later the same day starts locked with\n * \"A payment method was just saved for this\"; only `resetPaid()` or a new `payableRef` unlocks it). `false`: the success is still reported (`(confirmed)`, `(outcome)` `succeeded`) but leaves NO lock and no 24-hour record,\n * the epoch moves (the next save derives a NEW attempt key, `..._e1`) and the form can be used again (a \"replace the card\" screen opened later the same day). A save in flight or unknown still blocks a second submit.\n * A host `attemptKey` is used as it is: with it the host must supply a new key for the next save itself. Ignored in `mode=\"payment\"`.\n */\n readonly lockAfterSuccess = input(true);\n /** A key the host supplies; empty = generated per payment attempt session. It reaches `createIntent({ attemptKey })`. */\n readonly attemptKey = input<string | null>(null);\n /** The host's status check by attempt key: resolves an UNKNOWN outcome. */\n readonly checkStatus = input<CheckPaymentStatusFn | null>(null);\n /** The payable is paid (host re-render, back navigation): every confirm is refused for good. */\n readonly paid = input(false);\n /** The host reports an ambiguous result of ITS charge call: \"Checking your payment...\" while true. */\n readonly hostPending = input(false);\n readonly statusPollMs = input(PAYMENT_STATUS_POLL_MS);\n readonly statusPollMaxMs = input(PAYMENT_STATUS_POLL_MAX_MS);\n /** A status check slower than this counts as unknown (ms). */\n readonly statusCheckTimeoutMs = input(PAYMENT_STATUS_CHECK_TIMEOUT_MS);\n /** While the attempt's own request is unsettled, a status answer `failed` is ignored for this long (ms). */\n readonly statusFailGraceMs = input(PAYMENT_STATUS_FAIL_GRACE_MS);\n /** While the attempt's own request is NEVER settled (a hung request), a status answer `failed` / `not_found` is ignored for this long after the attempt became unknown (ms, default 180000): the original request may still land. */\n readonly statusHardMaxMs = input(PAYMENT_STATUS_HARD_MAX_MS);\n /** Offer \"Start over\" after the status polling window (a new attempt with a NEW key). Turn it on ONLY when your backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key: that rule is what makes it safe. */\n readonly allowStartOver = input(false);\n /** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a payment because of the browser's offline flag (default false). */\n readonly offlineOverride = input(false);\n /** The request timeout is replaced by this while a 3-D Secure challenge or the bank window is open (ms). */\n readonly authTimeoutMs = input(PAYMENT_AUTH_TIMEOUT_MS);\n /** How long ONE `confirm()` (intent creation + Stripe confirmation) may take before the outcome counts as unknown (ms). */\n readonly confirmTimeoutMs = input(PAYMENT_REQUEST_TIMEOUT_MS);\n /** The host's readiness endpoint (`GET /api/payments/ready`): `{ ready, reasons[] }`. */\n readonly readinessCheck = input<ReadinessCheckFn | null>(null);\n readonly readinessTimeoutMs = input(PAYMENT_READINESS_TIMEOUT_MS);\n readonly readinessEveryMs = input(PAYMENT_READINESS_EVERY_MS);\n\n // Presentation\n readonly submitLabel = input('');\n /** Show the built-in submit button; turn off to use your own and call `confirm()`. */\n readonly showSubmit = input(true);\n readonly disabled = input(false);\n /**\n * Library source 2026-11-21 (additive; unset = nothing changes). While `true` no payment can be started: the built-in submit button is disabled, `confirm()` returns `null` without touching Stripe, and\n * `blockedReason` is shown in a `role=\"status\"` message (text, never colour alone). Unlike `disabled` the form itself stays editable and an attempt that is already running is not touched. Not shown in `mountOnly` mode.\n */\n readonly blocked = input(false);\n /** Why it is blocked (shown while `blocked`). Empty = the default text of the label `paymentBlocked.default`. */\n readonly blockedReason = input('');\n /** The host is still creating the intent: show the loading skeleton. */\n readonly pending = input(false);\n /** Accessible name of the payment form (also its visible heading when `required` is set). */\n readonly labelInput = input<string | null>(null, { alias: 'label' });\n readonly label = computed(() => this.labelInput() ?? this.labels.t('stripeStripePayment.label'));\n /** The payment details are required (a required wizard step): a visible heading with a red asterisk is shown above the form. Not shown in `mountOnly` mode. */\n readonly required = input(false);\n /** The `id` of the element container (an app's e2e selector such as `#payment-element`). */\n readonly mountId = input('');\n /** Extra CSS classes on the element container. */\n readonly mountClass = input('');\n /** Show the bank-account notice while that tab is selected. */\n readonly showAchNotice = input(true);\n readonly achNoticeInput = input<string | null>(null, { alias: 'achNotice' });\n readonly achNotice = computed(() => this.achNoticeInput() ?? this.labels.t('stripePayment.achNotice'));\n /** The `data-testid` of the notice (an app's existing e2e selector, e.g. `ach-setup-notice`). */\n readonly achNoticeTestId = input('stripe-ach-notice');\n /** The payment method type the host shows before Stripe reports one (cremo: `'card'`); `paymentMethodTypeChange` fires only when the reported type differs from it (or from the last report). */\n readonly initialPaymentMethodType = input('card');\n /** Show failures in the built-in alert. Turn off when the host shows `(failed)` itself. */\n readonly showErrors = input(true);\n /** `'friendly'` (default), `'table'` (table text, else Stripe's own message: the cremo payment flows) or `'stripe'` (Stripe's own message). See `getStripeErrorMessage`. */\n readonly errorDisplay = input<StripeErrorDisplay>('friendly');\n /** Different error display for single steps (e.g. `{ submit: 'stripe', action: 'stripe' }`: raw Stripe text for the validation and 3DS steps, `errorDisplay` for the rest). */\n readonly errorDisplayByStage = input<Partial<Record<StripeFailureStage, StripeErrorDisplay>> | null>(null);\n /** The text when Stripe sends an error with no message (default: \"Payment failed. Please try again.\"). */\n readonly errorFallback = input('');\n /** The same per step (Settings: `{ submit: 'Failed to submit payment information', confirm: 'Failed to confirm payment method' }`); wins over `errorFallback`. */\n readonly errorFallbackByStage = input<Partial<Record<StripeFailureStage, string>> | null>(null);\n /** Replacement texts by code: Stripe error codes AND the library's own failure codes (`not_initialized`, `no_payment_method`, `requires_payment_method`, `not_completed`, `authentication_failed`, ...). `{status}` in a text becomes Stripe's status of the intent (\"Unexpected payment status: {status}\"). */\n readonly errorMessages = input<Record<string, string> | null>(null);\n readonly loadErrorMessageInput = input<string | null>(null, { alias: 'loadErrorMessage' });\n readonly loadErrorMessage = computed(() => this.loadErrorMessageInput() ?? this.labels.t('stripeStripePayment.loadErrorMessage'));\n /** Texts of the screen-reader status region (translate them); missing keys keep the English defaults. */\n readonly a11yMessages = input<Partial<StripeA11yMessages> | null>(null);\n\n // ── Outputs ────────────────────────────────────────────────────────────\n /**\n * The live Stripe.js objects, emitted once each time the Elements are created: right after `elements.create('payment')` and `mount()` succeeded, before `(ready)`\n * (the moment the old inline code had `this.stripe` / `this.elements` / `this.paymentElement` assigned). `null` is emitted when they go away (the form is re-created for new\n * inputs, or `destroyElements()`): drop your references. Destroying the component itself emits nothing (the host owns that moment).\n */\n readonly stripeReady = output<StripeReadyEvent | null>();\n /** The Payment Element finished loading. */\n readonly ready = output<void>();\n /** The customer picked another payment method type (`'card'`, `'us_bank_account'`, ...). */\n readonly paymentMethodTypeChange = output<string>();\n /** Every change of the form: completeness and the selected type. */\n readonly elementChange = output<StripeElementChange>();\n /** A ConfirmationToken of the typed card was created (`collectConfirmationToken` during `confirm()`, or `createConfirmationToken()`). Only emitted for a card. */\n readonly confirmationToken = output<StripeConfirmationTokenEvent>();\n /**\n * The intent was confirmed (succeeded, processing, needs bank verification, or needs a further action). NOT always a success: a host must check `event.outcome === 'succeeded'` (or `'processing'`) before it treats the\n * payment / saved method as done. With the protection on, a setup that `requires_action` or `requires_verification` is still emitted here but the attempt is UNKNOWN (locked, the status check decides): see `(outcome)`.\n */\n readonly confirmed = output<StripeConfirmedEvent>();\n /** A step failed (validation, intent creation, confirmation). `message` is ready to show. */\n readonly failed = output<StripeFailure>();\n /** Stripe.js or the Payment Element could not be loaded. */\n readonly loadError = output<StripeFailure>();\n /** A confirm started / ended (the synchronous lock; only with `duplicateProtection`). */\n readonly inFlightChange = output<boolean>();\n /** Unified outcome of a payment attempt: `succeeded`, `failed`, `unknown`, `refused` (with `reason`), `pending` (only with `duplicateProtection`). */\n readonly outcome = output<PaymentAttemptOutcome>();\n /** The attempt key in effect (only with `duplicateProtection`). */\n readonly attemptKeyChange = output<string>();\n /** The readiness gate changed (only with `duplicateProtection`). */\n readonly readinessChange = output<PaymentReadinessResult>();\n\n // ── State ──────────────────────────────────────────────────────────────\n readonly loading = signal(false);\n readonly isReady = signal(false);\n readonly submitting = signal(false);\n readonly complete = signal(false);\n /** The selected payment method type, `null` until Stripe reports one. */\n readonly selectedType = signal<string | null>(null);\n readonly errorText = signal('');\n readonly loadErrorText = signal('');\n private readonly announcement = signal('');\n\n protected readonly errorId = `ui-stripe-error-${nextId++}`;\n private readonly mountRef = viewChild<ElementRef<HTMLElement>>('mount');\n private readonly errorBox = viewChild<ElementRef<HTMLElement>>('errorBox');\n\n protected readonly mountHidden = computed(() => !this.mountOnly() && (this.loading() || this.pending() || !!this.loadErrorText()));\n protected readonly achNoticeVisible = computed(() => this.showAchNotice() && this.selectedType() === 'us_bank_account');\n /** The bank notice text: the instant-only wording never mentions the two small deposits (they are not offered). */\n protected readonly achNoticeText = computed(() => this.achNoticeInput() ?? this.labels.t(this.instantOnly() ? 'stripePayment.achNoticeInstant' : 'stripePayment.achNotice'));\n protected readonly effectiveSubmitLabel = computed(() => this.submitLabel() || (this.mode() === 'setup' ? this.labels.t('stripePayment.saveMethod') : this.labels.t('stripePayment.pay')));\n protected readonly blockedText = computed(() => this.blockedReason().trim() || this.labels.t('paymentBlocked.default'));\n protected readonly submitDisabled = computed(() => this.disabled() || this.blocked() || this.loading() || this.pending() || !this.isReady() || !!this.loadErrorText()\n || (this.protectionOn() && (this.attempt.unknown() || this.attempt.paidLocked() || !this.readiness.ready())));\n private readonly messages = computed((): StripeA11yMessages => {\n const given = Object.fromEntries(Object.entries(this.a11yMessages() ?? {}).filter(([, text]) => typeof text === 'string')) as Partial<StripeA11yMessages>;\n return { ...STRIPE_A11Y_MESSAGES, ...given };\n });\n protected readonly statusText = computed(() => {\n if (this.loading()) return this.messages().loading;\n if (this.submitting()) return this.mode() === 'setup' ? this.messages().savingMethod : this.messages().processingPayment;\n return this.announcement();\n });\n\n /** How `loadStripe` is called: key + options. Re-creates everything when it changes. */\n private readonly connection = computed(() => {\n const key = this.publishableKey() || this.defaults.publishableKey || '';\n return { key, options: buildLoadOptions(this.stripeAccount(), this.locale() ?? this.defaults.locale, this.stripeOptions()) };\n }, { equal: jsonEqual });\n\n /** The `stripe.elements()` options without the deferred amount (that one is updated in place); `null` while there is no intent to show. */\n private readonly elementsConfig = computed((): Record<string, unknown> | null => {\n const secret = this.clientSecret();\n const deferred = this.deferred();\n let options: Record<string, unknown>;\n if (secret) {\n options = { clientSecret: secret };\n } else if (deferred) {\n options = {\n mode: deferred.mode ?? this.mode(),\n currency: deferred.currency,\n ...(deferred.setupFutureUsage ? { setup_future_usage: deferred.setupFutureUsage } : {}),\n ...(deferred.captureMethod ? { capture_method: deferred.captureMethod } : {}),\n ...(deferred.onBehalfOf ? { on_behalf_of: deferred.onBehalfOf } : {}),\n ...(this.deferredTypes() ? { payment_method_types: this.deferredTypes() } : {}),\n ...(this.instantOnly() ? { paymentMethodOptions: { us_bank_account: { verification_method: 'instant' } } } : {}),\n };\n } else {\n return null;\n }\n const appearance = this.appearance();\n if (appearance) options['appearance'] = appearance;\n return { ...options, ...(this.elementsOptions() ?? {}) };\n }, { equal: jsonEqual });\n\n /** The `payment_method_types` of a deferred intent: the host's list (Link removed with `linkOff`), else `['card', 'us_bank_account']` with `linkOff`, else none (Stripe decides). */\n private readonly deferredTypes = computed((): string[] | null => {\n const own = this.paymentMethodTypes();\n if (!this.linkOff()) return own;\n return own ? own.filter(type => type !== 'link') : ['card', 'us_bank_account'];\n });\n\n /** The Payment Element options that need a new element when they change (default values and read-only are updated in place). */\n private readonly elementConfig = computed(() => {\n const options: Record<string, unknown> = {};\n const layout = this.layout();\n if (layout) options['layout'] = layout;\n if (this.paymentMethodOrder()) options['paymentMethodOrder'] = this.paymentMethodOrder();\n const wallets = this.linkOff() ? { ...(this.wallets() ?? {}), applePay: 'never', googlePay: 'never', link: 'never' } : this.wallets();\n if (wallets) options['wallets'] = wallets;\n if (this.fields()) options['fields'] = this.fields();\n if (this.business()) options['business'] = this.business();\n if (this.terms()) options['terms'] = this.terms();\n return { ...options, ...(this.paymentElementOptions() ?? {}) };\n }, { equal: jsonEqual });\n\n private stripe: StripeLike | null = null;\n private stripeSignature = '';\n private elements: StripeElementsLike | null = null;\n private element: StripePaymentElementLike | null = null;\n private generation = 0;\n private lastType: string | null = null;\n private lastAmount: number | undefined;\n private lastFailure: StripeFailure | null = null;\n private destroyed = false;\n /** Counts the confirms: only the NEWEST one may clear `submitting` (a late, older confirm must not unlock the newer one's screen). */\n private confirmSeq = 0;\n /** What the element was last given, so a change made while it loaded is applied once it is ready. */\n private appliedDefaultValues = '';\n private appliedDisabled = false;\n\n /** The protection applies to PAYMENTS; `mode=\"setup\"` (saving a card, nothing is charged) ignores `duplicateProtection` unless the host ALSO sets `protectSetup`. */\n protected readonly protectionOn = computed(() => this.duplicateProtection() && (this.mode() === 'payment' || this.protectSetup()));\n /** The duplicate-payment protection (the attempt: lock, key, unknown state). Only active with `duplicateProtection` in payment mode, or in setup mode with `protectSetup` too; with the protection off it does nothing. */\n readonly attempt: PaymentAttempt;\n /** The readiness gate (same condition as {@link attempt}). */\n readonly readiness: PaymentReadiness;\n /** Bumped by \"Retry loading\": the init effect runs again. */\n private readonly retryTick = signal(0);\n\n constructor() {\n const protection = createPaymentProtection(this, {\n amount: () => { const own = this.attemptAmount(); if (own != null) return own; const minor = this.deferred()?.amount; return minor == null ? null : minor / 100; }, // the deferred amount is in minor units (cents); attempts, markers and derived keys speak major units like every other form\n method: () => this.attemptMethod() ?? this.selectedType() ?? 'card',\n sdk: () => (this.loadErrorText() ? 'blocked' : this.loading() ? 'loading' : 'ok'),\n enabled: () => this.protectionOn(),\n lockAfterSuccess: () => this.mode() === 'payment' || this.lockAfterSuccess(),\n // A protected SETUP that was announced as processing (\"not saved yet\") and is later settled by the status check: the stale text must not contradict the attempt status's \"saved\" text.\n onOutcome: o => { if (this.mode() === 'setup' && o.kind === 'succeeded' && o.reason === 'status_check') this.announcement.set(''); this.outcome.emit(o); },\n onInFlightChange: v => this.inFlightChange.emit(v),\n onKeyChange: k => { if (this.protectionOn()) this.attemptKeyChange.emit(k); },\n onReadinessChange: r => { if (this.protectionOn()) this.readinessChange.emit(r); },\n });\n this.attempt = protection.attempt;\n this.readiness = protection.readiness;\n effect(() => {\n const mount = this.mountRef();\n const connection = this.connection();\n const elements = this.elementsConfig();\n const element = this.elementConfig();\n this.retryTick();\n if (!mount) return;\n untracked(() => { void this.init(mount.nativeElement, connection, elements, element); });\n });\n // The deferred amount changes without a new form (a fee shown for the other payment method): elements.update({ amount }).\n effect(() => {\n const amount = this.deferred()?.amount;\n untracked(() => {\n if (!this.mountOnly() && amount !== undefined && this.lastAmount !== undefined && amount !== this.lastAmount && this.elements?.update) this.elements.update({ amount });\n this.lastAmount = amount;\n });\n });\n effect(() => {\n const defaultValues = this.defaultValues();\n untracked(() => this.applyDefaultValues(defaultValues));\n });\n effect(() => {\n const disabled = this.disabled();\n untracked(() => this.applyDisabled(disabled));\n });\n inject(DestroyRef).onDestroy(() => { this.destroyed = true; this.generation++; this.disposeElements(); this.stripe = null; });\n }\n\n // ── Public methods ─────────────────────────────────────────────────────\n\n /**\n * Submits the form: `elements.submit()` (when required), the deferred intent, then `confirmSetup` / `confirmPayment`.\n * Resolves the normalised result (also emitted as `confirmed`), or `null` after a failure (emitted as `failed`) or when nothing was started\n * (already submitting, or disabled). Never rejects: anything Stripe.js throws becomes a `failed` event.\n *\n * `useExistingIntent`: the intent already exists (a retry after a failed attempt, or one created earlier): no `elements.submit()`, no `createIntent`,\n * and `confirmPayment` / `confirmSetup` is called WITHOUT a client secret, exactly like cremo's intake retry. Pass `clientSecret` (the one you stored) to send it.\n */\n async confirm(options: { useExistingIntent?: boolean; clientSecret?: string } = {}): Promise<StripeConfirmedEvent | null> {\n if (this.disabled() || this.blocked()) return null;\n if (this.protectionOn()) return this.confirmProtected(options); // the attempt's synchronous lock is the guard (an older, hung confirm must not block a new attempt the status check unlocked)\n if (this.submitting()) return null;\n return this.confirmCore(options, null);\n }\n\n /**\n * `confirm()` under the duplicate-payment protection: the gate (paid / unknown / not ready / offline: nothing is sent), then ONE attempt under the synchronous lock, raced against\n * `confirmTimeoutMs`. A timeout, going offline, a thrown error, a connection error or an abandoned 3-D Secure challenge make the outcome UNKNOWN (locked, status check by key); only\n * a definitive Stripe refusal unlocks with a new key. Never retries by itself.\n */\n private async confirmProtected(options: { useExistingIntent?: boolean; clientSecret?: string }): Promise<StripeConfirmedEvent | null> {\n if (!this.readiness.passSync()) {\n const reason = this.readiness.reasons()[0] ?? 'checking';\n this.outcome.emit({ kind: 'refused', attemptKey: this.attempt.key(), reason });\n this.fail(failure(reason, this.labels.t(attemptLabelKey(this.readiness.labelKeyFor(reason), this.mode())), 'submit'));\n return null;\n }\n if (this.attempt.paidLocked() || this.attempt.unknown()) { this.attempt.begin(); return null; } // refuses and reports `refused`\n const run = await this.attempt.run<StripeConfirmedEvent | null>(async key => {\n // Everything this attempt learns lives in ITS OWN trace and key (arguments, never instance fields), so a late answer of an older attempt can never leak into the next one.\n const trace: ConfirmTrace = { held: true, failure: null, thrown: false, outcome: null };\n try {\n const event = await this.confirmCore(options, key, trace, this.attempt.pinnedRef());\n trace.held = false;\n return this.classifyConfirm(event, trace, this.attempt.isLive(key));\n } finally { trace.held = false; }\n }, { timeoutMs: this.confirmTimeoutMs() });\n return 'refused' in run && run.refused ? null : (run.value ?? null);\n }\n\n /** What the result of the core confirm means for the attempt (see {@link confirmProtected}). */\n private classifyConfirm(event: StripeConfirmedEvent | null, trace: ConfirmTrace, live: boolean): PaymentAttemptResult<StripeConfirmedEvent | null> {\n // A LATE answer of an older attempt decides nothing on screen: the payer sees failures and announcements only of the attempt that is still current. `run()` applies the returned result with the same rule.\n const show = (f: StripeFailure): void => { if (live) this.publishFailure(f); };\n const say = (key: 'paymentAttempt.authRequired' | 'paymentAttempt.authAbandoned'): void => { if (live) this.announcement.set(this.labels.t(key)); };\n if (event) {\n // A SetupIntent has no card-action step of its own here (`confirmSetup` runs 3-D Secure itself): a setup that still \"requires action\" proves nothing, so the status check decides (never an endless \"pending\").\n if (event.outcome === 'requires_action' && event.kind === 'setup') return { kind: 'unknown', value: event, reason: 'setup_action' };\n if (event.outcome === 'requires_action') { say('paymentAttempt.authRequired'); return { kind: 'pending', value: event, reason: 'auth_required' }; }\n // A bank payment that waits for the payer to verify micro-deposits has NOT started and nothing is charged: unknown-until-verified (locked, the status check decides, the intent is never cancelled), never paid.\n if (event.outcome === 'requires_verification') return { kind: 'unknown', value: event, reason: 'microdeposits' };\n // A SetupIntent that is still `processing` (a bank debit, ACH) can fail later: not saved yet, so unknown (locked, the status check / the backend decides), never a success. A PaymentIntent that is processing stays a success.\n if (event.outcome === 'processing' && event.kind === 'setup') return { kind: 'unknown', value: event, reason: 'setup_processing' };\n return { kind: 'success', value: event };\n }\n const f = trace.failure;\n if (!f) return { kind: 'unknown', reason: 'no_result' }; // neither an event nor a failure: nothing can be said, so the status check decides\n if (f.code === INSTANT_ONLY_CODE) { show(f); return { kind: 'failure', reason: f.code }; } // instant-only form, the intent still wanted micro-deposits: nothing was charged or saved, a NEW intent is needed\n if (f.code === 'attempt_failed_use_new_key') { show(f); return { kind: 'failure', reason: f.code }; } // a replay of a FAILED attempt: nothing was charged, the next click derives a NEW key\n if (f.stage === 'submit' || f.stage === 'intent') { show(f); return { kind: 'released', reason: f.code }; } // nothing was charged: unlock, the key is kept\n if (f.stage === 'action') {\n // After the challenge Stripe put the intent back to \"needs a payment method\" (the bank refused the authentication): nothing was charged, a definitive failure. Anything else (an abandoned\n // challenge, an error without an intent, a thrown error) proves nothing and stays unknown: the backend cancels the PaymentIntent of an abandoned challenge and answers `failed`.\n const errorIntent = (f.error as { payment_intent?: { status?: string } } | undefined)?.payment_intent;\n const refusedByBank = f.code === 'authentication_failed' || (f.code === 'payment_intent_authentication_failure' && errorIntent?.status === 'requires_payment_method');\n if (refusedByBank && !trace.thrown) { show(f); return { kind: 'failure', reason: f.code }; }\n say('paymentAttempt.authAbandoned');\n return { kind: 'unknown', reason: 'auth_abandoned' };\n }\n if (trace.thrown || (f.type !== undefined && AMBIGUOUS_STRIPE_TYPES.has(f.type)) || AMBIGUOUS_STRIPE_CODES.has(f.code)) return { kind: 'unknown', reason: 'error' };\n // The result stage: Stripe gave an intent in a state that proves the payment did NOT go through (needs a new payment method, cancelled) or one that proves nothing (no intent at all, an\n // unexpected status, a setup that came back without a payment method id: the intent may have succeeded): only the former is a definitive failure.\n if (f.stage === 'result' && f.code !== 'requires_payment_method' && trace.outcome !== 'canceled') return { kind: 'unknown', reason: 'unexpected_status' };\n show(f); // a definitive refusal by Stripe: the payer sees it, the key is renewed\n return { kind: 'failure', reason: f.code };\n }\n\n /** \"Retry loading\" of a blocked Stripe.js / Payment Element: builds the form again. */\n protected reload(): void { this.retryTick.update(n => n + 1); }\n\n /** The host reports that ITS charge call timed out or is ambiguous (only with `duplicateProtection`). */\n markUnknown(): void { this.attempt.markUnknown('host'); }\n /** The host reports that the payment succeeded (locks the form for this payable). */\n markSucceeded(): void { this.attempt.succeed('host'); }\n /** The host reports a DEFINITIVE failure (declined): unlock with a NEW key. */\n markFailed(): void { this.attempt.fail('host'); }\n /** The host did not use the payment and nothing reached Stripe: unlock, the attempt key is KEPT. */\n markNotCharged(): void { this.attempt.markNotCharged(); }\n /** The host starts a deliberate SECOND payment of this payable (an explicit \"pay again\" flow): forgets the paid state this form saw, removes the succeeded record and moves the epoch so the next attempt has a NEW key. Does nothing against the host's own `paid` input. */\n resetPaid(): void { this.attempt.resetPaid(); }\n\n private async confirmCore(options: { useExistingIntent?: boolean; clientSecret?: string }, attemptKey: string | null, trace?: ConfirmTrace, payableRef: string | null = null): Promise<StripeConfirmedEvent | null> {\n const stripe = this.stripe;\n const elements = this.elements;\n if (!stripe || !elements) { this.fail(failure('not_initialized', MSG_NOT_INITIALIZED, 'submit'), trace); return null; }\n const mine = ++this.confirmSeq;\n this.submitting.set(true);\n this.errorText.set('');\n this.announcement.set('');\n let stage: StripeFailureStage = 'submit';\n try {\n const mode = this.mode();\n const existing = options.useExistingIntent === true;\n const deferred = !existing && !this.clientSecret() && !!this.deferred();\n // Stripe only allows createConfirmationToken on a deferred-intent Elements group (no client secret): with a client secret the token is never attempted.\n const wantToken = deferred && this.collectConfirmationToken() && (this.selectedType() ?? 'card') === 'card';\n if (!existing && ((this.submitBeforeConfirm() ?? deferred) || wantToken)) {\n const { error } = await elements.submit();\n if (error) { this.fail(failureFromError(error, 'submit', this.errorOptions('submit')), trace); return null; }\n }\n let token: StripeConfirmationTokenEvent | null = null;\n if (wantToken) {\n const made = await this.makeConfirmationToken(stripe, elements);\n if ('id' in made && made.paymentMethodType === 'card') { token = made; this.confirmationToken.emit(made); }\n }\n let secret: string | undefined = existing ? options.clientSecret : undefined;\n if (deferred) {\n stage = 'intent';\n const create = this.createIntent();\n if (!create) { this.fail(failure('no_intent_factory', MSG_INTENT_FAILED, 'intent'), trace); return null; }\n try {\n const context = token ? { mode, confirmationToken: token } : { mode };\n const created = await create(attemptKey ? { ...context, attemptKey, payableRef } : context);\n if (wasQueuedOffline(created)) { warnQueuedPayment(); this.fail(failure('not_sent', this.labels.t(attemptLabelKey('paymentAttempt.queuedOffline', this.protectionOn() ? mode : 'payment')), 'intent'), trace); return null; } // the offline layer QUEUED the request instead of sending it: no intent exists, and the queued request may still replay\n secret = typeof created === 'string' ? created : created?.clientSecret;\n } catch (err) {\n // The payments service says this attempt FAILED before (`attempt_failed_use_new_key`): not a retryable intent error but a definitive failure that moves the epoch.\n this.fail(failure(isAttemptFailedReplay(err) ? 'attempt_failed_use_new_key' : 'intent_creation_failed', messageOfThrown(err, STRIPE_DEFAULT_ERROR_MESSAGE), 'intent', messageOfThrown(err, '')), trace);\n return null;\n }\n if (!secret) { this.fail(failure('intent_creation_failed', MSG_INTENT_FAILED, 'intent'), trace); return null; }\n }\n stage = 'confirm';\n const confirmParams = this.buildConfirmParams();\n const params: Record<string, unknown> = {\n elements,\n ...(secret ? { clientSecret: secret } : {}),\n ...(confirmParams ? { confirmParams } : {}),\n redirect: this.redirect(),\n };\n const result = mode === 'setup' ? await stripe.confirmSetup(params) : await stripe.confirmPayment(params);\n if (result.error) { this.fail(failureFromError(result.error, 'confirm', this.errorOptions('confirm')), trace); return null; }\n const intent = mode === 'setup' ? result.setupIntent : result.paymentIntent;\n if (!intent) {\n this.fail(failure('not_completed', mode === 'setup' ? MSG_SETUP_INCOMPLETE : MSG_NOT_COMPLETED, 'result'), trace);\n return null;\n }\n let event = normalizeIntent(mode, intent);\n // A setup without a payment method id: unprotected hosts get `no_payment_method` exactly as before. Protected, a setup that Stripe says is `requires_payment_method` / `canceled` is a DEFINITIVE failure (finish() reports it), only the rest (an intent that may have succeeded) is unknown.\n if (mode === 'setup' && !event.paymentMethodId && !(trace && (event.outcome === 'requires_payment_method' || event.outcome === 'canceled'))) { this.fail(failure('no_payment_method', MSG_NO_PAYMENT_METHOD, 'result'), trace); return null; }\n if (mode === 'payment' && event.outcome === 'requires_action' && this.autoHandleCardAction()) {\n stage = 'action';\n if (trace) this.attempt.markPending('auth_required'); // a challenge is open: the request timeout is replaced by authTimeoutMs\n const handled = await this.runCardAction(stripe, intent.client_secret, trace);\n if (!handled) return null;\n event = handled;\n }\n return this.finish(event, false, trace);\n } catch (err) {\n if (trace) trace.thrown = true;\n this.fail(this.thrownFailure(err, stage), trace);\n return null;\n } finally {\n if (mine === this.confirmSeq) this.submitting.set(false);\n }\n }\n\n /**\n * Creates a ConfirmationToken from the typed form (`elements.submit()`, then `stripe.createConfirmationToken({ elements })`) so a host can learn the card's funding before it\n * creates any intent (a fee that depends on credit / debit). Resolves the token event (also emitted as `(confirmationToken)` when it is a card), or the failure (returned only,\n * not emitted, and nothing is shown: Stripe's own form already marks an incomplete field). `null` when nothing was started (already submitting, or disabled).\n */\n async createConfirmationToken(): Promise<StripeConfirmationTokenEvent | StripeFailure | null> {\n if (this.submitting() || this.disabled()) return null;\n const stripe = this.stripe;\n const elements = this.elements;\n if (!stripe || !elements) return failure('not_initialized', MSG_NOT_INITIALIZED, 'submit');\n try {\n const { error } = await elements.submit();\n if (error) return failureFromError(error, 'submit', this.errorOptions('submit'));\n } catch (err) {\n return this.thrownFailure(err, 'submit');\n }\n const made = await this.makeConfirmationToken(stripe, elements);\n if ('id' in made && made.paymentMethodType === 'card') this.confirmationToken.emit(made);\n return made;\n }\n\n /** `stripe.createConfirmationToken({ elements })` (with the billing details as `params` when given); the event, or the failure. Never throws. */\n private async makeConfirmationToken(stripe: StripeLike, elements: StripeElementsLike): Promise<StripeConfirmationTokenEvent | StripeFailure> {\n if (!stripe.createConfirmationToken) return failure('confirmation_token_unavailable', MSG_TOKEN_FAILED, 'confirm');\n const billing = this.billingDetails();\n try {\n const { confirmationToken, error } = await stripe.createConfirmationToken({ elements, ...(billing ? { params: { payment_method_data: { billing_details: billing } } } : {}) });\n if (error) return failureFromError(error, 'confirm', this.errorOptions('confirm'));\n return confirmationToken ? confirmationTokenEventOf(confirmationToken) : failure('confirmation_token_unavailable', MSG_TOKEN_FAILED, 'confirm');\n } catch (err) {\n return this.thrownFailure(err, 'confirm');\n }\n }\n\n /**\n * Runs `stripe.handleCardAction(clientSecret)` (3D Secure) for a payment that came back `requires_action`, and reports the result like `confirm()`.\n * Use it when `autoHandleCardAction` is off and the host handles `outcome: 'requires_action'` itself.\n */\n async handleNextAction(clientSecret: string): Promise<StripeConfirmedEvent | null> {\n if (this.submitting()) return null;\n const stripe = this.stripe;\n if (!stripe) { this.fail(failure('not_initialized', MSG_NOT_INITIALIZED, 'action')); return null; }\n // With the protection on, the host's `confirm()` answered `requires_action` and the attempt is waiting for THIS challenge: its result decides the attempt (success locks, a refusal by the bank\n // unlocks with a new key, an abandoned challenge is unknown), exactly like the automatic challenge of `confirm()`.\n const guarded = this.protectionOn() && this.attempt.inFlight();\n const trace: ConfirmTrace | undefined = guarded ? { held: true, failure: null, thrown: false, outcome: null } : undefined;\n if (guarded) this.attempt.markPending('auth_required');\n this.submitting.set(true);\n this.errorText.set('');\n let event: StripeConfirmedEvent | null = null;\n try {\n const handled = await this.runCardAction(stripe, clientSecret, trace);\n event = handled ? this.finish(handled, false, trace) : null;\n return event;\n } catch (err) {\n if (trace) trace.thrown = true;\n this.fail(this.thrownFailure(err, 'action'), trace);\n return null;\n } finally {\n this.submitting.set(false);\n if (trace) { trace.held = false; this.attempt.apply(this.classifyConfirm(event, trace, true)); }\n }\n }\n\n /**\n * `elements.fetchUpdates()`: after your backend changed the amount of the intent this form was created with (cremo intake: fees differ per payment method),\n * so the form shows the new amount. Resolves `null` when it worked, else the failure (returned only, not emitted: the host decides, cremo ignores it).\n */\n async fetchUpdates(): Promise<StripeFailure | null> {\n const elements = this.elements;\n if (!elements?.fetchUpdates) return failure('not_initialized', MSG_NOT_INITIALIZED, 'submit');\n try {\n const { error } = await elements.fetchUpdates();\n return error ? failureFromError(error, 'confirm', this.errorOptions('confirm')) : null;\n } catch (err) {\n return this.thrownFailure(err, 'confirm');\n }\n }\n\n /** `elements.update(options)`: change the deferred amount, appearance or locale without re-creating the form. */\n updateElements(options: Record<string, unknown>): void { this.elements?.update?.(options); }\n\n /** `paymentElement.update(options)`. */\n updatePaymentElement(options: Record<string, unknown>): void { this.element?.update?.(options); }\n\n /** Removes the Payment Element (host teardown on cancel). The component re-creates it when its inputs change. */\n destroyElements(): void { this.disposeElements(); this.isReady.set(false); }\n\n /** Verify a bank account with the two micro-deposit amounts / the descriptor code of a PaymentIntent (the public \"verify your bank\" page). */\n async verifyMicrodepositsForPayment(clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult> {\n return this.verifyWith('payment', clientSecret, data);\n }\n\n /** Same for a SetupIntent. */\n async verifyMicrodepositsForSetup(clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult> {\n return this.verifyWith('setup', clientSecret, data);\n }\n\n /**\n * After Stripe redirected the customer back to `returnUrl`: retrieves the intent (client secret from the URL by default) and reports it like `confirm()`\n * (`confirmed` for succeeded / processing / needs verification / needs action, `failed` otherwise). `{ event: null, failure: null }` when the URL has no intent.\n * With the duplicate protection on (payment, or setup with `protectSetup`) the result also settles the attempt (see `settleReturn`). A `(confirmed)` event is NOT always a success (`requires_action`, `requires_verification`):\n * a host must check `event.outcome === 'succeeded'` (or `processing`) before it treats the intent as paid / saved.\n * BEHAVIOUR WITH THE PROTECTION ON (also for `mode=\"payment\"`: a host that opts in with `duplicateProtection` and calls this method gets it; without the protection nothing changes): the attempt is settled by the intent that came back, so a\n * `succeeded` / `requires_capture` (and, for a payment, `processing`) intent is a success (`succeeded`, reason `return`), `requires_payment_method` / `canceled` a definitive failure (new key, reason `return`), a bank verification or a further\n * action unknown, a SETUP that is still `processing` unknown (`setup_processing`: a bank debit can still fail) and an intent that could not be read unknown (`error`). Calling it again after a success (a reload of the return page) settles and reports nothing a second time.\n * THE LIBRARY DOES NOT ASK THE BACKEND on this path: a return with `requires_payment_method` / `canceled` fails the attempt at once, so the host's backend must still cancel the SetupIntent / PaymentIntent itself (a SetupIntent that carries an error is\n * still confirmable by a late browser request, which could save a card after the form said \"not saved\").\n */\n async handleReturn(options: { clientSecret?: string; kind?: StripeIntentKind; search?: string } = {}): Promise<StripeReturnResult> {\n const fromUrl = options.clientSecret ? null : readStripeReturnParams(options.search ?? this.doc.defaultView?.location.search ?? '');\n const clientSecret = options.clientSecret ?? fromUrl?.clientSecret;\n if (!clientSecret) return { event: null, failure: null };\n const kind = options.kind ?? fromUrl?.kind ?? this.mode();\n let stripe: StripeLike;\n try { stripe = await this.ensureStripe(); } catch (err) {\n const f = failure('load_error', messageOfThrown(err, MSG_LOAD_FAILED), 'load', messageOfThrown(err, ''));\n this.fail(f);\n this.settleReturn(null);\n return { event: null, failure: f };\n }\n const result = await retrieveIntent(stripe, kind, clientSecret);\n if (result.failure) { this.fail(result.failure); this.settleReturn(null); return result; }\n if (result.event && !this.finish(result.event, true)) { this.settleReturn(result.event); return { event: null, failure: this.lastFailure }; }\n this.settleReturn(result.event);\n return result;\n }\n\n /**\n * With the protection on, the intent a redirect brought back also decides the attempt (so a redirect flow does not stay unknown until the host calls `markSucceeded()`): succeeded / processing / requires_capture = success,\n * `requires_payment_method` / `canceled` = a definitive failure (new key), a bank verification or a further action = unknown (the status check decides), an intent that could not be read = unknown. Nothing without the protection.\n */\n private settleReturn(event: StripeConfirmedEvent | null): void {\n if (!this.protectionOn()) return;\n if (!event) { this.attempt.markUnknown('error'); return; }\n switch (event.outcome) {\n case 'processing':\n // A SetupIntent that is still processing (a bank debit) can fail later: unknown until the status check says it was saved. A processing payment counts as paid, as before.\n if (event.kind === 'setup') this.attempt.markUnknown('setup_processing'); else this.attempt.succeed('return');\n break;\n case 'succeeded': case 'requires_capture': this.attempt.succeed('return'); break;\n case 'requires_payment_method': case 'canceled': this.attempt.fail('return'); break;\n case 'requires_verification': if (this.instantOnly()) this.attempt.fail('instant_only'); else this.attempt.markUnknown('microdeposits'); break;\n default: this.attempt.markUnknown('return_action');\n }\n }\n\n // ── Internals ──────────────────────────────────────────────────────────\n\n private errorOptions(stage: StripeFailureStage): StripeErrorMessageOptions {\n return {\n display: this.errorDisplayByStage()?.[stage] ?? this.errorDisplay(),\n overrides: this.errorMessages(),\n ...(this.errorFallbackByStage()?.[stage] || this.errorFallback() ? { fallback: this.errorFallbackByStage()?.[stage] || this.errorFallback() } : {}),\n };\n }\n\n /** Something Stripe.js threw (an IntegrationError, a network failure) as a failure, with the text chosen like any Stripe error. */\n private thrownFailure(err: unknown, stage: StripeFailureStage): StripeFailure {\n const e = err as { code?: unknown; type?: unknown; decline_code?: unknown; message?: unknown } | null | undefined;\n const error = {\n ...(typeof e?.code === 'string' ? { code: e.code } : {}),\n ...(typeof e?.type === 'string' ? { type: e.type } : {}),\n ...(typeof e?.decline_code === 'string' ? { decline_code: e.decline_code } : {}),\n ...(typeof e?.message === 'string' && e.message ? { message: e.message } : {}),\n };\n const code = stage === 'submit' ? 'submit_failed' : stage === 'action' ? 'action_failed' : 'confirm_failed';\n const { error: _raw, ...failed } = failureFromError(error, stage, this.errorOptions(stage));\n return { ...failed, code: error.code ?? code, ...(stage === 'action' ? { actionHandled: true } : {}) };\n }\n\n private buildConfirmParams(): Record<string, unknown> | null {\n const params: Record<string, unknown> = {};\n const returnUrl = this.returnUrl();\n if (returnUrl !== null) params['return_url'] = returnUrl ?? this.doc.defaultView?.location.href ?? '';\n const billing = this.billingDetails();\n if (billing) params['payment_method_data'] = { billing_details: billing };\n Object.assign(params, this.confirmParams() ?? {});\n return Object.keys(params).length ? params : null;\n }\n\n private fail(f: StripeFailure, trace?: ConfirmTrace): void {\n const override = this.errorMessages()?.[f.code];\n if (override) f = { ...f, message: override.split('{status}').join(f.status ?? '') };\n this.lastFailure = f;\n if (trace) { trace.failure = f; if (trace.held) return; } // a protected confirm decides afterwards whether this is a failure the payer sees (see `classifyConfirm`)\n this.publishFailure(f);\n }\n\n /** Shows and emits a failure (what `fail()` always did). */\n private publishFailure(f: StripeFailure): void {\n if (this.destroyed) return;\n if (this.showErrors()) { this.errorText.set(f.message); this.revealError(f); }\n this.announcement.set('');\n this.failed.emit(f);\n }\n\n /**\n * A blocked submit (incomplete / invalid Element, a refused intent, a declined confirm) must not look like \"nothing happened\": once the alert is rendered it is scrolled into view\n * (instant under `prefers-reduced-motion`, smooth otherwise) and focused, and its `role=\"alert\"` makes a screen reader read the message. Not for load / return failures (nothing was submitted),\n * and never in `mountOnly` (no alert is drawn).\n */\n private revealError(f: StripeFailure): void {\n if (this.mountOnly() || !this.isBrowser || f.stage === 'load' || f.stage === 'return') return;\n afterNextRender(() => {\n const box = this.errorBox()?.nativeElement;\n if (!box) return;\n const reduce = this.doc.defaultView?.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false;\n box.scrollIntoView?.({ block: 'center', behavior: reduce ? 'auto' : 'smooth' });\n box.focus({ preventScroll: true });\n }, { injector: this.injector });\n }\n\n private finish(event: StripeConfirmedEvent, fromReturn = false, trace?: ConfirmTrace): StripeConfirmedEvent | null {\n if (trace) trace.outcome = event.outcome;\n const acted = { ...(event.actionHandled ? { actionHandled: true } : {}), status: event.status };\n // Setup wording (\"Your payment method was not saved\") only for a protected setup: an unprotected form keeps its texts. A host `errorMessages` entry by code still wins (see `fail`).\n const setupProtected = event.kind === 'setup' && this.protectionOn();\n if (event.outcome === 'requires_verification' && this.instantOnly()) {\n // Defensive: an instant-only form never offers micro-deposits, so an intent that wants them is NOT a confirmation: no verification UI, no `(confirmed)`, the payer is told to use a card or a bank with bank login.\n this.fail({ ...failure(INSTANT_ONLY_CODE, this.labels.t('stripePayment.msg.instantOnlyUnavailable'), fromReturn ? 'return' : 'result'), ...acted }, trace);\n return null;\n }\n if (event.outcome === 'requires_payment_method') {\n this.fail({ ...failure('requires_payment_method', setupProtected ? this.labels.t('paymentSetup.requiresPaymentMethod') : MSG_REQUIRES_PAYMENT_METHOD, fromReturn ? 'return' : 'result'), ...acted }, trace);\n return null;\n }\n if (event.outcome === 'unknown' && fromReturn && this.protectionOn()) {\n // A protected return with an intent in a state that proves nothing makes the ATTEMPT unknown (`return_action`, see `settleReturn`): no failure text may be shown or emitted next to the \"Checking...\" status. The caller still gets the failure in the result.\n this.lastFailure = failure('not_completed', setupProtected ? MSG_SETUP_INCOMPLETE : MSG_NOT_COMPLETED, 'return');\n return null;\n }\n if (event.outcome === 'canceled' || event.outcome === 'unknown') {\n this.fail({ ...failure('not_completed', setupProtected ? MSG_SETUP_INCOMPLETE : MSG_NOT_COMPLETED, fromReturn ? 'return' : 'result'), ...acted }, trace);\n return null;\n }\n if (this.destroyed) return event;\n // A protected setup that still \"requires action\" or \"requires verification\" is an UNKNOWN attempt (`setup_action` / `microdeposits`): the attempt status region says so (and its live region announces it), so this region does not announce it a second time\n // (nor a payment: \"Further action is required to complete the payment\") next to it.\n this.announcement.set(setupProtected && (event.outcome === 'requires_action' || event.outcome === 'requires_verification') ? '' : this.announce(event, setupProtected));\n this.confirmed.emit(event);\n return event;\n }\n\n private announce(event: StripeConfirmedEvent, setupProtected = false): string {\n const m = this.messages();\n switch (event.outcome) {\n case 'succeeded': return event.kind === 'setup' ? m.methodSaved : m.paymentReceived;\n case 'processing': return setupProtected ? this.labels.t('paymentSetup.processing') : m.paymentProcessing; // a protected setup is not a payment: it is NOT saved yet (the attempt is unknown until it is confirmed)\n case 'requires_capture': return m.paymentAuthorized;\n case 'requires_verification': return event.kind === 'setup' ? m.verificationNeededSetup : m.verificationNeeded;\n default: return m.actionRequired;\n }\n }\n\n private async runCardAction(stripe: StripeLike, clientSecret: string | null | undefined, trace?: ConfirmTrace): Promise<StripeConfirmedEvent | null> {\n const acted = { actionHandled: true };\n if (!stripe.handleCardAction || !clientSecret) { this.fail({ ...failure('action_unavailable', MSG_AUTH_NOT_COMPLETED, 'action'), ...acted }, trace); return null; }\n const { error, paymentIntent } = await stripe.handleCardAction(clientSecret);\n if (error) { this.fail({ ...failureFromError(error, 'action', { ...this.errorOptions('action'), fallback: MSG_AUTH_FAILED }), ...acted }, trace); return null; }\n if (!paymentIntent) { this.fail({ ...failure('action_incomplete', MSG_AUTH_NOT_COMPLETED, 'action'), ...acted }, trace); return null; }\n const event = { ...normalizeIntent('payment', paymentIntent), ...acted };\n if (event.outcome === 'requires_payment_method') {\n this.fail({ ...failure('authentication_failed', 'Payment authentication failed. Please try a different payment method.', 'action'), ...acted, status: event.status }, trace);\n return null;\n }\n return event;\n }\n\n private async ensureStripe(): Promise<StripeLike> {\n if (this.stripe) return this.stripe;\n const { key, options } = this.connection();\n if (!key) throw new Error(MSG_KEY_MISSING);\n const stripe = await this.loader(key, options);\n if (!stripe) throw new Error(MSG_LOAD_FAILED);\n return stripe;\n }\n\n private async verifyWith(flow: StripeIntentKind, clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult> {\n let stripe: StripeLike;\n try { stripe = await this.ensureStripe(); } catch (err) {\n return { ok: false, outcome: null, intent: null, failure: failure('load_error', messageOfThrown(err, MSG_LOAD_FAILED), 'load', messageOfThrown(err, '')) };\n }\n return verifyMicrodeposits(stripe, flow, clientSecret, data);\n }\n\n private disposeElements(): void {\n const element = this.element;\n this.element = null;\n this.elements = null;\n this.lastType = null;\n this.selectedType.set(null);\n this.complete.set(false);\n if (element) {\n try { element.destroy(); } catch { /* already gone */ }\n if (!this.destroyed) this.stripeReady.emit(null);\n }\n }\n\n private loadFailed(message: string, stripeMessage: string): void {\n this.loading.set(false);\n this.isReady.set(false);\n this.loadErrorText.set(this.loadErrorMessage());\n this.loadError.emit(failure('load_error', message, 'load', stripeMessage));\n }\n\n private async init(\n container: HTMLElement,\n connection: { key: string; options: StripeLoadOptions | undefined },\n elementsConfig: Record<string, unknown> | null,\n elementConfig: Record<string, unknown>,\n ): Promise<void> {\n const generation = ++this.generation;\n this.disposeElements();\n this.isReady.set(false);\n this.errorText.set('');\n this.loadErrorText.set('');\n this.announcement.set('');\n if (!this.isBrowser || !elementsConfig) { this.loading.set(false); return; }\n if (!connection.key) { this.loadFailed(localizeStripeMessage(MSG_KEY_MISSING), ''); return; }\n this.loading.set(true);\n try {\n const signature = JSON.stringify(connection);\n if (!this.stripe || this.stripeSignature !== signature) {\n this.stripe = null;\n const stripe = await this.loader(connection.key, connection.options);\n if (generation !== this.generation) return;\n if (!stripe) { this.loadFailed(localizeStripeMessage(MSG_LOAD_FAILED), ''); return; }\n this.stripe = stripe;\n this.stripeSignature = signature;\n }\n const options: Record<string, unknown> = { ...elementsConfig };\n const deferred = this.deferred();\n if (!options['clientSecret'] && deferred?.amount !== undefined && options['amount'] === undefined) options['amount'] = deferred.amount;\n this.lastAmount = deferred?.amount;\n if (this.appearanceFromTokens() && !options['appearance']) options['appearance'] = readStripeAppearance(this.doc, this.host.nativeElement);\n const elements = this.stripe.elements(options);\n const elementOptions: Record<string, unknown> = { ...elementConfig };\n const defaultValues = this.defaultValues();\n if (defaultValues) elementOptions['defaultValues'] = defaultValues;\n if (this.disabled() && !this.mountOnly()) elementOptions['readOnly'] = true;\n this.appliedDefaultValues = JSON.stringify(defaultValues ?? null);\n this.appliedDisabled = this.disabled();\n const element = elements.create('payment', elementOptions);\n this.elements = elements;\n this.element = element;\n element.on('change', (event) => { if (generation === this.generation) this.onChange(event); });\n element.on('ready', () => {\n if (generation !== this.generation) return;\n this.loading.set(false);\n this.isReady.set(true);\n // Changes made while the element loaded (a customer name typed, the form disabled) are applied now.\n if (!this.mountOnly()) {\n this.applyDefaultValues(this.defaultValues());\n this.applyDisabled(this.disabled());\n }\n this.ready.emit();\n });\n element.on('loaderror', (event) => {\n if (generation !== this.generation) return;\n const message = event?.error?.message || localizeStripeMessage(MSG_LOAD_FAILED);\n this.loadFailed(message, event?.error?.message ?? '');\n });\n element.mount(container);\n this.stripeReady.emit({ stripe: this.stripe, elements, paymentElement: element });\n } catch (err) {\n if (generation !== this.generation) return;\n this.loadFailed(localizeStripeMessage(messageOfThrown(err, MSG_LOAD_FAILED)), messageOfThrown(err, ''));\n }\n }\n\n private applyDefaultValues(defaultValues: Record<string, unknown> | null): void {\n const signature = JSON.stringify(defaultValues ?? null);\n if (this.mountOnly() || !this.element?.update || !this.isReady() || signature === this.appliedDefaultValues) return;\n this.appliedDefaultValues = signature;\n this.element.update({ defaultValues: defaultValues ?? {} });\n }\n\n private applyDisabled(disabled: boolean): void {\n if (this.mountOnly() || !this.element?.update || !this.isReady() || disabled === this.appliedDisabled) return;\n this.appliedDisabled = disabled;\n this.element.update({ readOnly: disabled });\n }\n\n private onChange(event: { complete?: boolean; empty?: boolean; value?: { type?: string }; error?: { message?: string } } | null | undefined): void {\n const type = event?.value?.type ?? null;\n const complete = !!event?.complete;\n this.complete.set(complete);\n if (type) this.selectedType.set(type);\n this.elementChange.emit({ complete, empty: !!event?.empty, type, errorMessage: event?.error?.message ?? null });\n if (type && type !== (this.lastType ?? this.initialPaymentMethodType())) this.paymentMethodTypeChange.emit(type);\n if (type) this.lastType = type;\n }\n}\n","import { UiLabelKey, safeLocale, uiLocale, uiText } from '@forgeroute/ui/core';\n/** How a bank account added with micro-deposits is verified: two deposit amounts, the code of one deposit, or the bank is still confirming it. */\nexport type MicrodepositType = 'amounts' | 'descriptor_code' | 'processing';\n\n/** The text of the pending-verification card, in one place for the component and its tests. */\n/** The text of the pending-verification card; read on every access, so it follows the app's active language. */\nexport const MICRODEPOSIT_COPY = {\n get title() { return uiText('stripeMicrodepositVerify.title'); },\n get processingTitle() { return uiText('stripeMicrodepositVerify.processingTitle'); },\n get processing() { return uiText('stripeMicrodepositVerify.processing'); },\n get cannotPay() { return uiText('stripeMicrodepositVerify.cannotPay'); },\n get readOnly() { return uiText('stripeMicrodepositVerify.readOnly'); },\n get keepsActive() { return uiText('stripeMicrodepositVerify.keepsActive'); },\n get cancelTitle() { return uiText('stripeMicrodepositVerify.cancelTitle'); },\n get verifyLabel() { return uiText('stripeMicrodepositVerify.verifyLabel'); },\n get cancelBase() { return uiText('stripeMicrodepositVerify.cancelBase'); },\n get cancelKeepsActive() { return uiText('stripeMicrodepositVerify.cancelKeepsActive'); },\n get cancelNoOther() { return uiText('stripeMicrodepositVerify.cancelNoOther'); },\n get tooManyAttempts() { return uiText('stripeMicrodepositVerify.tooManyAttempts'); },\n get codeRequired() { return uiText('stripeMicrodepositVerify.codeRequired'); },\n};\n\n/** \"June 5, 2026\" in UTC: the arrival date is a calendar day. Empty for no / an invalid date. */\nexport function microdepositArrivalText(iso: string | null | undefined): string {\n if (!iso) return '';\n const date = new Date(iso);\n return Number.isNaN(date.getTime()) ? '' : date.toLocaleDateString(safeLocale(uiLocale()), { month: 'long', day: 'numeric', year: 'numeric', timeZone: 'UTC' });\n}\n\n/** Amounts: two whole numbers of cents from 1 to 99 (Stripe's micro-deposits are 1 to 99 cents). Empty text = nothing to say yet. */\nexport function depositAmountError(value: unknown): string {\n if (value === '' || value === null || value === undefined) return '';\n const n = Number(value);\n if (!Number.isInteger(n)) return uiText('stripeMicrodepositVerify.wholeCents');\n if (n < 1 || n > 99) return uiText('stripeMicrodepositVerify.centsRange');\n return '';\n}\n\n/** The code as sent to Stripe: trimmed, upper case. */\nexport const normalizeDescriptorCode = (value: string | null | undefined): string => (value ?? '').trim().toUpperCase();\n\n/** The descriptor code: 6 letters or numbers; with `requireSmPrefix` (Stripe's codes look like SMXXXX) it must start with \"SM\". Empty = nothing to say yet. */\nexport function descriptorCodeError(value: string | null | undefined, requireSmPrefix = false): string {\n const code = normalizeDescriptorCode(value);\n if (!code) return '';\n if (!/^[A-Z0-9]{6}$/.test(code)) return uiText('stripeMicrodepositVerify.code6');\n if (requireSmPrefix && !/^SM[A-Z0-9]{4}$/.test(code)) return uiText('stripeMicrodepositVerify.codeSm');\n return '';\n}\n\n/** Only an https link is offered as Stripe's hosted verification page. */\nexport function safeHostedUrl(url: string | null | undefined): string | null {\n return /^https:\\/\\//.test(url ?? '') ? (url as string) : null;\n}\n\n/** What `(verify)` emits: the two amounts in cents, or the code. */\nexport type MicrodepositVerifyEvent = { amounts: [number, number] } | { descriptorCode: string };\n\n/** Who started a pending verification, from the point of view of the user looking at it (a partner page): this user, the partner, or somebody else. */\nexport type MicrodepositStartedBy = 'you' | 'partner' | 'other' | '';\n\nexport interface MicrodepositStepsContext {\n type: Exclude<MicrodepositType, 'processing'>;\n /** ISO timestamp of the day the deposits should arrive. */\n arrivalDate?: string | null;\n /** Set when the user looks at ANOTHER party's account (a crematory looking at a partner): \"{partner}'s account\", \"Ask {partner} for ...\". */\n partnerName?: string;\n /** The user cannot finish it (no form on the card). */\n readOnly?: boolean;\n /** Read-only: who started it. */\n startedBy?: MicrodepositStartedBy;\n /** Read-only: replaces ONLY the middle sentence (\"An administrator of your organization can finish the verification.\" by default). */\n readOnlyText?: string;\n}\n\nconst arrivalClause = (iso: string | null | undefined): string => {\n const text = microdepositArrivalText(iso);\n return text ? uiText('stripeMicrodepositVerify.byDate', { date: text }) : '';\n};\n\n/**\n * The explanation under the bank account: the deposits clause, then what to do (or, with no form, who can finish it), then\n * \"Until then this account can't be used to pay invoices.\" The exact strings of the cremo Settings / Partners cards.\n */\nexport function microdepositStepsText(ctx: MicrodepositStepsContext): string {\n const t = (key: string, params?: Record<string, string | number>) => uiText(`stripeMicrodepositVerify.${key}` as UiLabelKey, params);\n const partner = ctx.partnerName ?? '';\n const holder = partner ? t('holderPartner', { partner }) : t('holderYours');\n const clause = arrivalClause(ctx.arrivalDate);\n const deposits = ctx.type === 'descriptor_code' ? t('depositsDescriptor', { holder, clause }) : t('depositsAmounts', { holder, clause });\n if (ctx.readOnly) {\n const who = ctx.readOnlyText\n ?? (ctx.startedBy === 'partner' ? t('startedByPartner', { partner })\n : ctx.startedBy === 'other' ? t('startedByOther')\n : partner ? t('partnerOrSetup', { partner })\n : MICRODEPOSIT_COPY.readOnly);\n return `${deposits}${who} ${MICRODEPOSIT_COPY.cannotPay}`;\n }\n const enter = ctx.type === 'descriptor_code'\n ? (partner ? t('enterCodePartner', { partner }) : t('enterCodeOwn'))\n : (partner ? t('enterAmountsPartner', { partner }) : t('enterAmountsOwn'));\n return `${deposits}${enter}${MICRODEPOSIT_COPY.cannotPay}`;\n}\n\n/** While the bank is still confirming the account. */\nexport function microdepositProcessingText(partnerName = ''): string {\n return partnerName ? uiText('stripeMicrodepositVerify.processingPartner', { partner: partnerName }) : MICRODEPOSIT_COPY.processing;\n}\n\n/** The note under the steps when a payment method is already saved. */\nexport function microdepositKeepsActiveText(partnerName = ''): string {\n return partnerName ? uiText('stripeMicrodepositVerify.keepsActivePartner', { partner: partnerName }) : MICRODEPOSIT_COPY.keepsActive;\n}\n\n/** The message of the cancel confirm: the saved method stays active only when one is saved. */\nexport function microdepositCancelMessage(options: { partnerName?: string; hasSavedMethod?: boolean } = {}): string {\n const partner = options.partnerName ?? '';\n if (partner) return `${MICRODEPOSIT_COPY.cancelBase} ${options.hasSavedMethod ? uiText('stripeMicrodepositVerify.cancelKeepsActivePartner', { partner }) : uiText('stripeMicrodepositVerify.cancelNoOtherPartner', { partner })}`;\n return MICRODEPOSIT_COPY.cancelBase + (options.hasSavedMethod ? MICRODEPOSIT_COPY.cancelKeepsActive : MICRODEPOSIT_COPY.cancelNoOther);\n}\n","import { ChangeDetectionStrategy, Component, computed, effect, inject, input, output, signal, untracked, viewChild } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { BadgeComponent } from '@forgeroute/ui/badge';\nimport { ButtonComponent, ModalComponent } from '@forgeroute/ui/core';\nimport { FormRowComponent } from '@forgeroute/ui/form-row';\nimport { FormSectionComponent } from '@forgeroute/ui/form-section';\nimport { TextComponent } from '@forgeroute/ui/text';\nimport { TextInputComponent } from '@forgeroute/ui/text-input';\nimport { StripePaymentService, type StripeMicrodepositResult } from '../stripe-payment/stripe-actions';\nimport type { StripeIntentKind } from '../stripe-payment/stripe-outcomes';\nimport {\n MICRODEPOSIT_COPY, depositAmountError, descriptorCodeError, microdepositStepsText, normalizeDescriptorCode, safeHostedUrl,\n type MicrodepositType, type MicrodepositVerifyEvent,\n} from './microdeposit-verify.models';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { localizeStripeMessage } from '../stripe-payment/stripe-outcomes';\n\nlet nextId = 0;\n\n/**\n * \"Bank account waiting for verification\": explains the steps in plain words, takes the two deposit amounts (or the 6-character code),\n * links to Stripe's own verification page, and lets the user cancel. Read-only users see the card but no form and no buttons.\n *\n * Two ways to verify, same screen:\n * - Host verifies (default): `(verify)` emits `{ amounts: [a, b] }` or `{ descriptorCode }`; the host calls its backend and shows\n * `[verifying]` / `[errorText]` (your API owns the rules and the attempts).\n * - Stripe.js verifies (public \"verify your bank\" page): pass `[clientSecret]` (+ `[publishableKey]`, `[stripeAccount]`, `[flow]`); the component calls\n * `verifyMicrodepositsForPayment/Setup` itself, counts failed attempts (`[maxAttempts]`) and emits `(verified)`.\n *\n * <ui-microdeposit-verify type=\"amounts\" bankName=\"Chase\" last4=\"6789\" arrivalDate=\"2026-06-05T00:00:00Z\"\n * [verifying]=\"busy()\" [errorText]=\"error()\" (verify)=\"verify($event)\" (cancelVerification)=\"cancel()\" />\n */\n@Component({\n selector: 'ui-microdeposit-verify',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, AlertComponent, BadgeComponent, ButtonComponent, FormRowComponent, FormSectionComponent, ModalComponent, TextComponent, TextInputComponent],\n template: `\n <div data-testid=\"bank-pending-card\">\n <ui-form-section [label]=\"heading()\">\n <ui-alert variant=\"info\" data-testid=\"bank-pending-alert\">\n <div data-testid=\"bank-pending-summary\">\n @if (bankLine(); as line) { <strong data-testid=\"bank-pending-bank\">{{ line }}</strong> }\n <ui-badge [label]=\"labels.t('stripeMicrodepositVerify.pending')\" variant=\"yellow\" data-testid=\"bank-pending-badge\" />\n </div>\n @if (paymentNotStarted()) {\n <ui-text size=\"sm\" data-testid=\"bank-pending-not-started\" [text]=\"labels.t('stripeMicrodepositVerify.paymentNotStarted')\" />\n }\n @if (stepsText().trim()) {\n <ui-text size=\"sm\" [text]=\"stepsText()\" data-testid=\"bank-pending-steps\" />\n } @else if (isProcessing()) {\n <ui-text size=\"sm\" [text]=\"copy.processing\" data-testid=\"bank-pending-steps\" />\n } @else {\n <ui-text size=\"sm\" data-testid=\"bank-pending-steps\" [text]=\"defaultSteps()\" />\n }\n @if (hasSavedMethod()) {\n <ui-text size=\"sm\" tone=\"muted\" [text]=\"keepsActiveText() || copy.keepsActive\" data-testid=\"bank-pending-keeps-active\" />\n }\n <!-- The hosted page is the processor's own UI: only with the explicit showHostedLink input (own-UI policy), and never to a read-only user (finishing it saves the payment method, a write) -->\n @if (!formHidden() && showHostedLink() && !hideHostedLink() && safeUrl(); as url) {\n <div><ui-button variant=\"link\" size=\"sm\" [href]=\"url\" target=\"_blank\" data-testid=\"bank-hosted-link\">{{ labels.t('stripeMicrodepositVerify.openStripeSVerificationPage') }}</ui-button></div>\n }\n </ui-alert>\n\n @if (!formHidden() && !isProcessing()) {\n @if (type() === 'descriptor_code') {\n <ui-text-input #codeField [label]=\"labels.t('stripeMicrodepositVerify.verificationCode')\" [hint]=\"hintText() || labels.t('stripeMicrodepositVerify.6LettersOrNumbersFrom')\" [maxlength]=\"6\" [required]=\"true\" [showErrors]=\"touched()\"\n [error]=\"touched() ? codeError() : ''\" [ariaInvalid]=\"!!shownError()\" [ariaDescribedBy]=\"shownError() ? errorId : ''\" data-testid=\"bank-code-input\" [ngModel]=\"code()\" (ngModelChange)=\"code.set($event)\" />\n } @else {\n <ui-form-row data-testid=\"bank-amounts-row\">\n <ui-text-input #firstField [label]=\"labels.t('stripeMicrodepositVerify.firstDepositCents')\" type=\"number\" [min]=\"1\" [max]=\"99\" [maxDecimals]=\"0\" [required]=\"true\" [showErrors]=\"touched()\"\n [ariaInvalid]=\"!!shownError()\" [ariaDescribedBy]=\"describedBy()\" [error]=\"touched() ? amountError(first()) : ''\" data-testid=\"bank-amount-first\" [ngModel]=\"first()\" (ngModelChange)=\"first.set($event)\" />\n <ui-text-input #secondField [label]=\"labels.t('stripeMicrodepositVerify.secondDepositCents')\" type=\"number\" [min]=\"1\" [max]=\"99\" [maxDecimals]=\"0\" [required]=\"true\" [showErrors]=\"touched()\"\n [ariaInvalid]=\"!!shownError()\" [ariaDescribedBy]=\"describedBy()\" [error]=\"touched() ? amountError(second()) : ''\" data-testid=\"bank-amount-second\" [ngModel]=\"second()\" (ngModelChange)=\"second.set($event)\" />\n </ui-form-row>\n <ui-text size=\"sm\" tone=\"muted\" [id]=\"amountsHintId\" data-testid=\"bank-amounts-hint\" [text]=\"hintText() || labels.t('stripeMicrodepositVerify.amountsHint')\" />\n }\n @if (shownError(); as text) {\n <ui-alert variant=\"danger\" [id]=\"errorId\" data-testid=\"bank-verify-error\">{{ text }}</ui-alert>\n }\n @if (attemptsText(); as text) {\n <ui-text size=\"sm\" tone=\"muted\" role=\"status\" data-testid=\"bank-attempts-remaining\" [text]=\"text\" />\n }\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"bank-verify-button\" [loading]=\"busy()\" [disabled]=\"busy() || cancelling()\" (click)=\"verify()\">{{ verifyLabel() || copy.verifyLabel }}</ui-button>\n }\n\n @if (!formHidden() && allowCancel()) {\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"bank-cancel-button\" [disabled]=\"busy() || cancelling()\" (click)=\"showCancelConfirm.set(true)\">{{ cancelLabel() || copy.cancelTitle }}</ui-button>\n }\n </ui-form-section>\n\n <ui-modal [open]=\"showCancelConfirm()\" [title]=\"cancelLabel() || copy.cancelTitle\" maxWidth=\"460px\" (close)=\"showCancelConfirm.set(false)\">\n <ui-text size=\"sm\" data-testid=\"bank-cancel-message\" [text]=\"cancelMessage()\" />\n <ui-button modal-footer-left variant=\"secondary\" size=\"sm\" data-testid=\"bank-cancel-keep\" (click)=\"showCancelConfirm.set(false)\">{{ labels.t('stripeMicrodepositVerify.keepWaiting') }}</ui-button>\n <ui-button modal-footer-right variant=\"danger\" size=\"sm\" data-testid=\"bank-cancel-confirm\" [loading]=\"cancelling()\" (click)=\"confirmCancel()\">{{ cancelLabel() || copy.cancelTitle }}</ui-button>\n </ui-modal>\n </div>\n `,\n})\nexport class MicrodepositVerifyComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly service = inject(StripePaymentService);\n\n /** `'amounts'` (two deposits), `'descriptor_code'` (one deposit with a code) or `'processing'` (the bank is still confirming; nothing to enter). */\n readonly type = input<MicrodepositType>('amounts');\n readonly bankName = input('');\n readonly last4 = input('');\n /** The day the deposits should have arrived (ISO timestamp); empty when unknown. See `StripeVerification.arrivalDateIso`. */\n readonly arrivalDate = input<string | null>(null);\n /** Stripe's own verification page; only an https link is shown. */\n readonly hostedVerificationUrl = input<string | null>(null);\n /** Read-only users see the card with `readOnlyText` but no form, link or buttons. */\n readonly readOnly = input(false);\n /** Show the card as plain status: no form, link or buttons, and the steps text is yours (`stepsText`). For a page where someone else finishes the verification. */\n readonly statusOnly = input(false);\n /** Replaces the card heading (default: \"Bank account waiting for verification\" / \"Bank account being confirmed\"). */\n readonly title = input('');\n /** Replaces the whole steps text (the sentences about the deposits and what to enter). Use it for wording the library cannot know (a partner's name, who started it). */\n readonly stepsText = input('');\n /** Read-only / status-only: replaces ONLY the middle sentence of the steps text (the deposits clause before it and \"Until then this account can't be used ...\" after it stay). */\n readonly readOnlyText = input<string>(MICRODEPOSIT_COPY.readOnly);\n /**\n * Show the processor's hosted verification page link (only an https `hostedVerificationUrl`, never to a read-only / status-only card). Default FALSE (own-UI policy: the payer verifies on this card, not on the\n * processor's page). Set it true only for a page that deliberately offers the hosted page.\n */\n readonly showHostedLink = input(false);\n /** Hide the hosted-page link even when `showHostedLink` is on (kept for hosts that already pass it). */\n readonly hideHostedLink = input(false);\n /** Host mode: how many verification attempts the payer has left (from your API). Shown as \"N attempts remaining\" under the button; `null` (default) shows nothing. In Stripe.js mode the component counts by itself (`maxAttempts`). */\n readonly attemptsRemaining = input<number | null>(null);\n /** Replaces the built-in \"N attempts remaining\" sentence (you translate it). Empty = the library text in the app's language. */\n readonly attemptsRemainingText = input('');\n /** Replaces the hint under the code field / the deposit amounts (default: \"6 letters or numbers (SM plus 4) from the deposit description\" / \"Amounts are between 1 and 99 cents ...\"). */\n readonly hint = input('');\n readonly cancelLabel = input('');\n readonly verifyLabel = input('');\n /** Replaces \"Your current payment method stays active until the new bank account is verified.\" */\n readonly keepsActiveText = input('');\n /** Replaces the cancel confirm's message. */\n readonly cancelMessageText = input('');\n /** A payment method is already saved (it stays active until the new bank account is verified). */\n readonly hasSavedMethod = input(false);\n /** Host mode: the host's verify request is running. */\n readonly verifying = input(false);\n /** Host mode: the host's cancel request is running. */\n readonly cancelling = input(false);\n /** Host mode: the verification failed; shown above the button. */\n readonly errorText = input('');\n /** Offer \"Cancel verification\" (with its confirm). */\n readonly allowCancel = input(true);\n /** Descriptor codes must look like Stripe's (`SMXXXX`). */\n readonly requireSmPrefix = input(false);\n\n // Stripe.js mode (set `clientSecret`)\n readonly clientSecret = input<string | null>(null);\n readonly publishableKey = input<string | null>(null);\n readonly stripeAccount = input<string | null>(null);\n /** Which kind of intent `clientSecret` belongs to. */\n readonly flow = input<StripeIntentKind>('payment');\n /** Stripe.js mode: stop sending after this many failed attempts (0 = no limit here). */\n readonly maxAttempts = input(0);\n\n /** Host mode: the amounts / code to verify. */\n readonly verify$ = output<MicrodepositVerifyEvent>({ alias: 'verify' });\n /** The user confirmed cancelling the verification. */\n readonly cancelVerification = output<void>();\n /** Stripe.js mode: the bank account is verified. */\n readonly verified = output<StripeMicrodepositResult>();\n /** Stripe.js mode: a verification attempt failed (the text is already shown). */\n readonly verifyFailed = output<StripeMicrodepositResult>();\n\n readonly copy = MICRODEPOSIT_COPY;\n protected readonly hintText = computed(() => this.hint().trim());\n protected readonly errorId = `ui-mdv-error-${nextId}`;\n protected readonly amountsHintId = `ui-mdv-hint-${nextId++}`;\n /** The error alert (when shown) and the amounts hint describe each deposit field. */\n protected readonly describedBy = computed(() => [this.shownError() ? this.errorId : '', this.amountsHintId].filter(Boolean).join(' '));\n private readonly codeField = viewChild<TextInputComponent>('codeField');\n private readonly firstField = viewChild<TextInputComponent>('firstField');\n private readonly secondField = viewChild<TextInputComponent>('secondField');\n readonly first = signal<string | number>('');\n readonly second = signal<string | number>('');\n readonly code = signal('');\n readonly touched = signal(false);\n readonly showCancelConfirm = signal(false);\n private readonly stripeBusy = signal(false);\n private readonly stripeError = signal('');\n private failedAttempts = 0;\n\n readonly formHidden = computed(() => this.readOnly() || this.statusOnly());\n /**\n * A PAYMENT waits for this verification (Stripe.js mode with a payment intent): the card says plainly that the payment has NOT started and nothing is charged until the deposits are verified.\n * A host that words the whole card itself (`stepsText`) owns that sentence too.\n */\n readonly paymentNotStarted = computed(() => !!this.clientSecret() && this.flow() === 'payment' && !this.stepsText().trim());\n readonly heading = computed(() => this.title() || (this.isProcessing() ? this.copy.processingTitle : this.copy.title));\n /** \"Chase ····6789\"; nothing when neither the bank nor the last 4 digits are known. */\n readonly bankLine = computed(() => {\n const bank = this.bankName().trim();\n const last4 = this.last4().trim();\n if (!bank && !last4) return '';\n return `${bank || this.labels.t('stripeMicrodepositVerify.bankFallback')}${last4 ? ` ····${last4}` : ''}`;\n });\n readonly busy = computed(() => this.verifying() || this.stripeBusy());\n readonly shownError = computed(() => this.stripeError() || this.errorText());\n /** Host mode: \"N attempts remaining\" (the host's `attemptsRemaining`, or its own `attemptsRemainingText`). Empty when the host says nothing. */\n readonly attemptsText = computed(() => {\n const own = this.attemptsRemainingText().trim();\n if (own) return own;\n const left = this.attemptsRemaining();\n if (left === null || !Number.isFinite(left) || left < 0) return '';\n return this.labels.t(left === 1 ? 'stripeMicrodepositVerify.attemptsLeft_one' : 'stripeMicrodepositVerify.attemptsLeft_other', { count: left });\n });\n readonly isProcessing = computed(() => this.type() === 'processing');\n readonly safeUrl = computed(() => safeHostedUrl(this.hostedVerificationUrl()));\n /** The built-in steps text: deposits clause + what to do, or with no form the `readOnlyText` sentence, + \"Until then this account can't be used to pay invoices.\" */\n readonly defaultSteps = computed(() => microdepositStepsText({\n type: this.type() === 'descriptor_code' ? 'descriptor_code' : 'amounts',\n arrivalDate: this.arrivalDate(),\n readOnly: this.formHidden(),\n readOnlyText: this.readOnlyText(),\n }));\n readonly amountError = depositAmountError;\n readonly codeError = computed(() => (this.code().trim() ? descriptorCodeError(this.code(), this.requireSmPrefix()) : this.copy.codeRequired));\n readonly hasInvalid = computed(() => this.type() === 'descriptor_code'\n ? !!this.codeError()\n : !!depositAmountError(this.first()) || !!depositAmountError(this.second()) || this.first() === '' || this.second() === '' || this.first() === null || this.second() === null);\n /** The cancel confirm tells the truth: the saved method stays active only when one is saved. */\n readonly cancelMessage = computed(() => this.cancelMessageText() || this.copy.cancelBase + (this.hasSavedMethod() ? this.copy.cancelKeepsActive : this.copy.cancelNoOther));\n\n constructor() {\n // Resumes cleanly: a new intent (another `clientSecret`) or another kind of verification starts from an empty card (no typed digits, no old error, a fresh attempt count).\n effect(() => {\n this.clientSecret(); this.type();\n untracked(() => { this.first.set(''); this.second.set(''); this.code.set(''); this.touched.set(false); this.stripeError.set(''); this.failedAttempts = 0; });\n });\n // A host error (the `errorText` input) after a verify: the focus goes back to the first field so the payer corrects it without hunting for it.\n effect(() => {\n const text = this.errorText();\n untracked(() => { if (text && this.touched()) this.focusFirstField(); });\n });\n }\n\n /** Puts the focus on the first deposit field / the code field (the first INVALID one when a local rule failed). */\n private focusFirstField(invalidOnly = false): void {\n if (this.type() === 'descriptor_code') { this.codeField()?.focus(); return; }\n const firstBad = !!depositAmountError(this.first()) || this.first() === '' || this.first() === null;\n const secondBad = !!depositAmountError(this.second()) || this.second() === '' || this.second() === null;\n if (invalidOnly && !firstBad && secondBad) this.secondField()?.focus(); else this.firstField()?.focus();\n }\n\n async verify(): Promise<void> {\n if (this.busy()) return;\n this.touched.set(true);\n if (this.hasInvalid()) { this.focusFirstField(true); return; }\n const secret = this.clientSecret();\n if (!secret) {\n this.verify$.emit(this.type() === 'descriptor_code'\n ? { descriptorCode: normalizeDescriptorCode(this.code()) }\n : { amounts: [Number(this.first()), Number(this.second())] });\n return;\n }\n const max = this.maxAttempts();\n if (max > 0 && this.failedAttempts >= max) { this.stripeError.set(this.copy.tooManyAttempts); this.focusFirstField(); return; }\n this.stripeBusy.set(true);\n this.stripeError.set('');\n const data = this.type() === 'descriptor_code'\n ? { descriptor_code: normalizeDescriptorCode(this.code()) }\n : { amounts: [Number(this.first()), Number(this.second())] };\n const connection = { publishableKey: this.publishableKey(), stripeAccount: this.stripeAccount() };\n const result = this.flow() === 'setup'\n ? await this.service.verifyMicrodepositsForSetup(secret, data, connection)\n : await this.service.verifyMicrodepositsForPayment(secret, data, connection);\n this.stripeBusy.set(false);\n if (result.ok) { this.verified.emit(result); return; }\n this.failedAttempts++;\n const message = result.failure?.message ?? localizeStripeMessage('Verification failed');\n const remaining = max - this.failedAttempts;\n this.stripeError.set(max > 0 && remaining > 0 ? this.labels.t(remaining === 1 ? 'stripeMicrodepositVerify.attemptsRemaining_one' : 'stripeMicrodepositVerify.attemptsRemaining_other', { message, count: remaining }) : message);\n this.verifyFailed.emit(result);\n this.focusFirstField();\n }\n\n confirmCancel(): void {\n if (this.cancelling()) return;\n this.showCancelConfirm.set(false);\n this.cancelVerification.emit();\n }\n}\n","import type { DestroyRef, WritableSignal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { Observable } from 'rxjs';\n\n/** What the account-status call answers (the shape of cremo's `GET /organizations/connect/status`). `isComplete` = Stripe accepts charges and payouts. */\nexport interface StripeConnectStatus {\n isComplete: boolean;\n detailsSubmitted?: boolean;\n /** The address of Stripe's onboarding page for an unfinished account. */\n onboardingUrl?: string;\n}\n\n/** What the create-account call answers (cremo's `POST /organizations/connect/create`): the new (or resumed) account and the address of Stripe's onboarding page. */\nexport interface StripeConnectAccount { accountId: string; onboardingUrl: string }\n\n/**\n * What happened after the user pressed a button or the page asked for the state. The flow never shows toasts itself (each app has its own): the host words\n * each outcome, and decides what follows a finished account (for example switching payment collection on).\n *\n * - `complete`: Stripe accepts the account. `source: 'check'` = after \"Check Status\"; `'resume'` = \"Complete Setup\" found it already complete; `'return'` =\n * the state was read again when the user came back to this tab (`refreshOnReturn`).\n * - `verifying`: the details were submitted and Stripe is reviewing them.\n * - `incomplete`: \"Check Status\" found an unfinished onboarding (`onboardingUrl` present).\n * - `link-unavailable`: the answer had no https Stripe address; nothing was opened.\n * - `failed`: a call failed (`action` says which); `error` is what it threw.\n */\nexport type StripeConnectOutcome =\n | { kind: 'complete'; source: 'check' | 'resume' | 'return' }\n | { kind: 'verifying'; source: 'check' | 'resume' | 'return' }\n | { kind: 'incomplete' }\n | { kind: 'link-unavailable' }\n | { kind: 'failed'; action: 'start' | 'check' | 'resume'; error: unknown };\n\n/** The state the flow reads and writes: signals owned by the host (or by the card's two-way models). */\nexport interface StripeConnectState {\n accountId: WritableSignal<string | null>;\n complete: WritableSignal<boolean>;\n detailsSubmitted: WritableSignal<boolean>;\n loading: WritableSignal<boolean>;\n}\n\nexport interface StripeConnectFlowOptions {\n /** Read at call time, so a host can swap the call. Null = no call yet (`start()` does nothing). */\n createAccount: () => (() => Observable<StripeConnectAccount>) | null;\n getStatus: () => (() => Observable<StripeConnectStatus>) | null;\n state: StripeConnectState;\n /** Where outcomes go. */\n emit: (outcome: StripeConnectOutcome) => void;\n /** The buttons and methods do nothing while this says true (a read-only user). */\n disabled?: () => boolean;\n /** How THIS tab is sent to Stripe when the browser refused the new tab (default `window.location.href = url`). */\n navigate?: (url: string) => void;\n destroyRef: DestroyRef;\n}\n\n/** Only an https address on stripe.com or a real subdomain (never `evilstripe.com` / `connect.stripe.com.evil.com`, `http:`, `javascript:`). */\nexport function isStripeUrl(url: string | undefined): url is string {\n if (!url) return false;\n try {\n const u = new URL(url);\n return u.protocol === 'https:' && (u.hostname === 'stripe.com' || u.hostname.endsWith('.stripe.com'));\n } catch { return false; }\n}\n\n/**\n * The Stripe Connect flow of cremo Settings > Payment & Billing, as a plain class: create the account, \"Check Status\", \"Complete Setup\", and the \"back from Stripe\" read.\n * `ui-stripe-connect` runs it behind its card; a host that has to start the flow from code before any view exists (Settings: the first change-detection pass with\n * `?connect=return`) creates its own instance over the same state signals. Stripe's page always opens in a NEW tab opened inside the click (a tab opened after the\n * request is blocked by popup blockers); only an https Stripe address is opened; a failed call closes the empty tab.\n */\nexport class StripeConnectFlow {\n /** A Stripe tab was opened: the card reads the state again when the user comes back (`refreshOnReturn`). */\n tabOpened = false;\n\n constructor(private readonly o: StripeConnectFlowOptions) {}\n\n private get blocked(): boolean { return this.o.state.loading() || !!this.o.disabled?.(); }\n\n /** Creates (or resumes) the account and opens Stripe's onboarding page in a new tab. */\n start(): void {\n const create = this.o.createAccount();\n if (!create || this.blocked) return;\n this.o.state.loading.set(true);\n const tab = this.openBlankTab();\n create().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({\n next: result => {\n this.o.state.accountId.set(result.accountId);\n this.o.state.loading.set(false);\n this.openStripe(tab, result.onboardingUrl);\n },\n error: error => {\n this.closeTab(tab);\n this.o.state.loading.set(false);\n this.o.emit({ kind: 'failed', action: 'start', error });\n },\n });\n }\n\n /** \"Check Status\": reads the state; a finished or submitted account updates the card, an unfinished one is reported. */\n check(): void {\n const status = this.o.getStatus();\n if (!status || this.blocked) return;\n this.o.state.loading.set(true);\n status().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({\n next: s => {\n this.o.state.complete.set(s.isComplete);\n this.o.state.detailsSubmitted.set(s.detailsSubmitted ?? false);\n this.o.state.loading.set(false);\n if (s.isComplete) this.o.emit({ kind: 'complete', source: 'check' });\n else if (s.detailsSubmitted) this.o.emit({ kind: 'verifying', source: 'check' });\n else if (s.onboardingUrl) this.o.emit({ kind: 'incomplete' });\n },\n error: error => { this.o.state.loading.set(false); this.o.emit({ kind: 'failed', action: 'check', error }); },\n });\n }\n\n /** \"Complete Setup\": reads the state and opens the onboarding address of an unfinished account in a new tab (a finished or submitted one just updates the card). */\n resume(): void {\n const status = this.o.getStatus();\n if (!status || this.blocked) return;\n this.o.state.loading.set(true);\n const tab = this.openBlankTab();\n status().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({\n next: s => {\n this.o.state.loading.set(false);\n if (s.isComplete) {\n this.closeTab(tab);\n this.o.state.complete.set(true);\n this.o.emit({ kind: 'complete', source: 'resume' });\n } else if (s.detailsSubmitted) {\n this.closeTab(tab);\n this.o.state.detailsSubmitted.set(true);\n this.o.emit({ kind: 'verifying', source: 'resume' });\n } else {\n this.openStripe(tab, s.onboardingUrl);\n }\n },\n error: error => { this.closeTab(tab); this.o.state.loading.set(false); this.o.emit({ kind: 'failed', action: 'resume', error }); },\n });\n }\n\n /** The state read when the user came back to this tab: silent unless something finished or was submitted. */\n readStatusOnReturn(): void {\n const status = this.o.getStatus();\n if (!status) return;\n status().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({\n next: s => {\n this.o.state.complete.set(s.isComplete);\n this.o.state.detailsSubmitted.set(s.detailsSubmitted ?? false);\n if (s.isComplete) this.o.emit({ kind: 'complete', source: 'return' });\n else if (s.detailsSubmitted) this.o.emit({ kind: 'verifying', source: 'return' });\n },\n error: () => { /* the user can press Check Status; a failed background read says nothing */ },\n });\n }\n\n private openStripe(tab: Window | null, url: string | undefined): void {\n if (isStripeUrl(url) && tab) {\n tab.location.href = url;\n this.tabOpened = true;\n } else if (isStripeUrl(url)) {\n this.navigateCurrentTab(url);\n } else {\n // not an https Stripe address: never navigate to it, close the empty tab and say so\n this.closeTab(tab);\n this.o.emit({ kind: 'link-unavailable' });\n }\n }\n\n /** The empty tab, opened inside the click and cut from this page (`opener`); null when the browser refused. */\n openBlankTab(): Window | null {\n const tab = window.open('about:blank', '_blank');\n if (tab) { try { tab.opener = null; } catch { /* cannot be changed: harmless */ } }\n return tab;\n }\n\n /** The browser refused the new tab: Stripe opens in this one. */\n private navigateCurrentTab(url: string): void {\n if (this.o.navigate) this.o.navigate(url);\n else window.location.href = url;\n }\n\n private closeTab(tab: Window | null): void {\n try { tab?.close(); } catch { /* already closed */ }\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, ViewEncapsulation, afterNextRender, computed, effect, inject, input, model, output } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { Observable } from 'rxjs';\nimport { StripeConnectFlow } from './stripe-connect.flow';\nimport type { StripeConnectAccount, StripeConnectOutcome, StripeConnectStatus } from './stripe-connect.flow';\nexport type { StripeConnectAccount, StripeConnectOutcome, StripeConnectStatus } from './stripe-connect.flow';\nexport { StripeConnectFlow, isStripeUrl } from './stripe-connect.flow';\nimport { BadgeComponent } from '@forgeroute/ui/badge';\nimport { ButtonComponent, uiText } from '@forgeroute/ui/core';\nimport { DetailCardComponent } from '@forgeroute/ui/detail-card';\nimport { StackComponent } from '@forgeroute/ui/stack';\nimport { TextComponent } from '@forgeroute/ui/text';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/**\n * The default wording of an outcome (the texts cremo Settings has always used), for apps that just want a toast: `{ variant, message }`, or null when\n * nothing should be said. `completeText` replaces the sentence of a finished account when the host has more to say about what follows.\n */\nexport function stripeConnectNotice(outcome: StripeConnectOutcome): { variant: 'success' | 'info' | 'error'; message: string } | null {\n switch (outcome.kind) {\n case 'complete':\n return { variant: 'success', message: uiText(outcome.source === 'resume' ? 'stripeStripeConnect.noticeCompleteResume' : 'stripeStripeConnect.noticeComplete') };\n case 'verifying':\n return { variant: 'success', message: uiText('stripeStripeConnect.noticeVerifying') };\n case 'incomplete':\n return { variant: 'error', message: uiText('stripeStripeConnect.noticeIncomplete') };\n case 'link-unavailable':\n return { variant: 'error', message: uiText('stripeStripeConnect.noticeLinkUnavailable') };\n case 'failed':\n return { variant: 'error', message: uiText(outcome.action === 'start' ? 'stripeStripeConnect.failedStart' : outcome.action === 'check' ? 'stripeStripeConnect.failedCheck' : 'stripeStripeConnect.failedLink') };\n }\n}\n\n/**\n * \"Stripe Connect Account\": the card where a business connects the Stripe account it collects payments into (cremo Settings > Payment & Billing, built here\n * once so every app and the setup wizard show and run the SAME flow). The host owns the data (its two calls and the three state values); the component owns\n * the screen and the flow:\n *\n * - no account yet (`accountId` empty): nothing is shown (the host has its own entry point and calls `start()`), or with `showWhenNoAccount` a card with\n * \"Set Up Payment Account\";;\n * - account, not complete, nothing submitted: warning \"Account setup incomplete\" with \"Complete Setup\" (asks the status for the onboarding address and opens it);\n * - details submitted, not complete: info \"Stripe is verifying your account\" with \"Check Status\";\n * - complete: success \"Account setup complete\" with the account id and \"View Stripe Dashboard\".\n *\n * Stripe's onboarding page always opens in a NEW tab: the empty tab is opened inside the click (a tab opened after the request is blocked by popup\n * blockers) and receives the address when it arrives; with the tab refused the address opens in the current tab. Only an https Stripe address is ever opened,\n * never one an answer made up (`javascript:`, `data:`). A failed call closes the empty tab.\n *\n * <ui-stripe-connect [(accountId)]=\"accountId\" [(complete)]=\"complete\" [(detailsSubmitted)]=\"submitted\"\n * [createAccount]=\"createAccount\" [getStatus]=\"getStatus\" [showWhenNoAccount]=\"true\" (outcome)=\"onOutcome($event)\" />\n *\n * where `createAccount = () => http.post<StripeConnectAccount>('/connect/create', {})` and `getStatus = () => http.get<StripeConnectStatus>('/connect/status')`.\n */\n@Component({\n selector: 'ui-stripe-connect',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, BadgeComponent, ButtonComponent, DetailCardComponent, StackComponent, TextComponent],\n template: `\n <!-- Persistent live region: present before the state changes, so every new state is announced (and \"Loading\" while a request runs). -->\n <div class=\"sc-sr\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" data-testid=\"connect-live\">{{ liveText() }}</div>\n @if (visible()) {\n @if (bare()) {\n <ng-container *ngTemplateOutlet=\"body\" />\n } @else {\n <ui-detail-card [collapsible]=\"false\" [title]=\"title()\" [headingLevel]=\"3\" data-testid=\"connect-account-card\">\n <ng-container *ngTemplateOutlet=\"body\" />\n </ui-detail-card>\n }\n }\n\n <ng-template #body>\n @if (!accountId()) {\n <ui-stack gap=\"sm\" class=\"sc-state\" tabindex=\"-1\" data-testid=\"connect-status-none\" [attr.aria-busy]=\"loading() ? 'true' : null\">\n <strong class=\"sc-title\">{{ startTitle() }}</strong>\n <ui-text size=\"sm\" [text]=\"startText()\" />\n <ui-stack direction=\"horizontal\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"connect-start-button\" [disabled]=\"disabled()\" (click)=\"start()\">@if (loading()) {<span aria-hidden=\"true\">{{ labels.t('common.loadingellipsis') }}</span><span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabBusy', { label: startLabel() }) }}</span>} @else { {{ startLabel() }}<span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span>}</ui-button>\n </ui-stack>\n </ui-stack>\n } @else if (complete()) {\n <ui-stack gap=\"sm\" class=\"sc-state\" tabindex=\"-1\" data-testid=\"connect-status-complete\">\n <strong class=\"sc-title\">{{ labels.t('stripeStripeConnect.accountSetupComplete') }}</strong>\n <ui-text size=\"sm\" tone=\"muted\" [text]=\"labels.t('stripeConnect.accountId', { id: accountId() ?? '' })\" />\n <ui-stack direction=\"horizontal\">\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"connect-dashboard-button\" (click)=\"openDashboard()\">{{ labels.t('stripeStripeConnect.viewStripeDashboard') }}<span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span></ui-button>\n </ui-stack>\n </ui-stack>\n } @else if (detailsSubmitted()) {\n <ui-stack gap=\"sm\" class=\"sc-state\" tabindex=\"-1\" data-testid=\"connect-status-verifying\" [attr.aria-busy]=\"loading() ? 'true' : null\">\n <strong class=\"sc-title\">{{ labels.t('stripeStripeConnect.stripeIsVerifyingYourAccount') }}</strong>\n <ui-text size=\"sm\" [text]=\"labels.t('stripeStripeConnect.yourSetupHasBeenSubmitted')\" />\n <ui-stack direction=\"horizontal\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"connect-check-status-button\" [disabled]=\"disabled()\" (click)=\"check()\">@if (loading()) {<span aria-hidden=\"true\">{{ labels.t('stripeStripeConnect.checking') }}</span><span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.checkStatusBusy') }}</span>} @else { {{ labels.t('stripeStripeConnect.checkStatus') }} }</ui-button>\n </ui-stack>\n </ui-stack>\n } @else {\n <ui-stack gap=\"sm\" class=\"sc-state\" tabindex=\"-1\" data-testid=\"connect-status-incomplete\" [attr.aria-busy]=\"loading() ? 'true' : null\">\n <span class=\"sc-badge\"><ui-badge [label]=\"labels.t('stripeStripeConnect.accountSetupIncomplete')\" variant=\"red\" data-testid=\"connect-incomplete-badge\" /></span>\n <ui-text size=\"sm\" [text]=\"labels.t('stripeStripeConnect.completeYourStripeAccountSetup')\" />\n <ui-stack direction=\"horizontal\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"connect-complete-setup-button\" [disabled]=\"disabled()\" (click)=\"resume()\">@if (loading()) {<span aria-hidden=\"true\">{{ labels.t('common.loadingellipsis') }}</span><span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.completeSetupOpensInA') }}</span>} @else { {{ labels.t('stripeStripeConnect.completeSetup') }}<span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span>}</ui-button>\n </ui-stack>\n </ui-stack>\n }\n </ng-template>\n `,\n styles: [`ui-stripe-connect { display: block; min-width: 0; } ui-stripe-connect .sc-badge { display: flex; } ui-stripe-connect .sc-title { font-size: 0.9375rem; font-weight: 600; color: #1e293b; } ui-stripe-connect .sc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }`],\n encapsulation: ViewEncapsulation.None,\n})\nexport class StripeConnectComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The call that creates the organization's Stripe account (or resumes it) and answers its id and the onboarding address. Needed for `start()`. */\n readonly createAccount = input<(() => Observable<StripeConnectAccount>) | null>(null);\n /** The call that reads the account's state. Needed for `check()`, `resume()` and `refreshOnReturn`. */\n readonly getStatus = input<(() => Observable<StripeConnectStatus>) | null>(null);\n\n /** The Stripe account's id (null / empty = no account yet). Two-way: the component sets it when `start()` created the account. */\n readonly accountId = model<string | null>(null);\n /** Stripe accepts the account (charges and payouts on). Two-way: set by `check()` / `resume()`. */\n readonly complete = model(false);\n /** The details were submitted and Stripe is reviewing them. Two-way: set by `check()` / `resume()`. */\n readonly detailsSubmitted = model(false);\n\n readonly titleInput = input<string | null>(null, { alias: 'title' });\n\n readonly title = computed(() => this.titleInput() ?? this.labels.t('stripeStripeConnect.title'));\n /** No card around the content: the text and the button sit directly in the host's own card (the setup wizard's step card). `title` is not shown then. */\n readonly bare = input(false);\n /** Shows the card (with \"Set Up Payment Account\") while there is no account yet. Default false: hosts with their own entry point show nothing and call `start()`. */\n readonly showWhenNoAccount = input(false);\n readonly startTitleInput = input<string | null>(null, { alias: 'startTitle' });\n readonly startTitle = computed(() => this.startTitleInput() ?? this.labels.t('stripeStripeConnect.startTitle'));\n readonly startTextInput = input<string | null>(null, { alias: 'startText' });\n readonly startText = computed(() => this.startTextInput() ?? this.labels.t('stripeStripeConnect.startText'));\n readonly startLabelInput = input<string | null>(null, { alias: 'startLabel' });\n readonly startLabel = computed(() => this.startLabelInput() ?? this.labels.t('stripeStripeConnect.startLabel'));\n /** The buttons cannot be pressed (a read-only user). */\n readonly disabled = input(false);\n /** After a Stripe tab was opened, the state is read again when this tab becomes visible again (the user came back): `(outcome)` then reports `complete` / `verifying` with source `return`. */\n readonly refreshOnReturn = input(false);\n /** The page \"View Stripe Dashboard\" opens. */\n readonly dashboardUrl = input('https://dashboard.stripe.com');\n\n /** What happened (see {@link StripeConnectOutcome}); the host words it. */\n readonly outcome = output<StripeConnectOutcome>();\n\n /** A request is running: the buttons show \"Loading...\" / \"Checking...\" and cannot be pressed again. Two-way, so a host that shows the state elsewhere can read it. */\n readonly loading = model(false);\n /** How the current tab is sent to Stripe when the browser refused the new tab (default: `window.location.href = url`); a host can route it through its own method. */\n readonly navigateTab = input<((url: string) => void) | null>(null);\n protected readonly visible = computed(() => !!this.accountId() || this.showWhenNoAccount());\n /** Which screen the card shows. */\n protected readonly state = computed((): 'none' | 'complete' | 'verifying' | 'incomplete' =>\n !this.accountId() ? 'none' : this.complete() ? 'complete' : this.detailsSubmitted() ? 'verifying' : 'incomplete');\n /** What the persistent status region says: the current state, plus \"Loading.\" while a request runs. Empty while nothing is shown. */\n protected readonly liveText = computed(() => {\n if (!this.visible()) return '';\n const text = this.labels.t(({ none: 'stripeStripeConnect.liveNone', incomplete: 'stripeStripeConnect.liveIncomplete', verifying: 'stripeStripeConnect.liveVerifying', complete: 'stripeStripeConnect.liveComplete' } as const)[this.state()]);\n return this.loading() ? this.labels.t('stripeStripeConnect.liveLoading', { text }) : text;\n });\n /** The user pressed a button that started a request: when the screen then changes, focus moves to the new screen (the pressed button is gone). */\n private acted = false;\n private lastState = this.state();\n private readonly flow = new StripeConnectFlow({\n createAccount: () => this.createAccount(),\n getStatus: () => this.getStatus(),\n state: { accountId: this.accountId, complete: this.complete, detailsSubmitted: this.detailsSubmitted, loading: this.loading },\n emit: outcome => this.outcome.emit(outcome),\n disabled: () => this.disabled(),\n navigate: url => this.navigateCurrentTab(url),\n destroyRef: this.destroyRef,\n });\n\n constructor() {\n effect(() => {\n const state = this.state();\n if (this.loading()) return;\n const changed = state !== this.lastState;\n this.lastState = state;\n const focusIt = changed && this.acted && this.visible();\n this.acted = false;\n if (focusIt) afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('.sc-state')?.focus(), { injector: this.injector });\n });\n if (typeof document !== 'undefined') {\n const onVisible = () => {\n if (document.visibilityState !== 'visible' || !this.flow.tabOpened || !this.refreshOnReturn() || this.loading()) return;\n this.flow.tabOpened = false;\n this.flow.readStatusOnReturn();\n };\n document.addEventListener('visibilitychange', onVisible);\n this.destroyRef.onDestroy(() => document.removeEventListener('visibilitychange', onVisible));\n }\n }\n\n /** Creates (or resumes) the account and opens Stripe's onboarding page in a new tab. */\n start(): void { const run = this.canRun(this.createAccount()); this.flow.start(); this.acted ||= run; }\n\n /** \"Check Status\": reads the state; a finished or submitted account updates the card, an unfinished one is reported. */\n check(): void { const run = this.canRun(this.getStatus()); this.flow.check(); this.acted ||= run; }\n\n /** \"Complete Setup\": reads the state and opens the onboarding address of an unfinished account in a new tab. */\n resume(): void { const run = this.canRun(this.getStatus()); this.flow.resume(); this.acted ||= run; }\n\n /** The flow will really send a request (the host gave the call, nothing is running, the card is not read-only). */\n private canRun(call: unknown): boolean { return !!call && !this.loading() && !this.disabled(); }\n\n /** Opens the Stripe dashboard in a new tab. */\n openDashboard(): void {\n window.open(this.dashboardUrl(), '_blank', 'noopener,noreferrer');\n }\n\n /** The browser refused the new tab: Stripe opens in this one (through the host's `navigateTab` when it gave one). */\n protected navigateCurrentTab(url: string): void {\n const navigate = this.navigateTab();\n if (navigate) navigate(url);\n else window.location.href = url;\n }\n}\n","import type { PaymentAllocation } from '@forgeroute/ui/payments';\nimport { uiText } from '@forgeroute/ui/core';\nimport type { StripeCardFunding } from '../stripe-payment/stripe-outcomes';\n\n/**\n * Library source 2026-11-21: what `ui-payment-stripe-method (readerLeftPending)` reports. The plugin's body went away (`destroyed`) or its reader screen was removed (`unmounted`: the reader was switched off / the method changed) while a reader\n * payment was open (starting, waiting, declined, retrying, recovering or cancelling). The reader payment MAY STILL EXIST at the processor, so `readerBusyChange` is NOT sent as `false` for it: the host keeps its pay actions blocked\n * (and reads the server's own hold). A reopened body finds the payment again by its attempt key and reports `readerBusyChange` true / false normally.\n */\nexport interface StripeReaderLeftPending {\n reason: 'destroyed' | 'unmounted';\n /** The attempt key of the open reader payment, when known. */\n paymentAttemptKey?: string;\n}\n\n/** What the host's `createIntent` receives: the entered payment and how it is applied to charges. */\nexport interface StripeIntentContext extends PaymentAllocation {\n /** The amount the payer owes (before processing fees), in major units (12.5 = $12.50). */\n amount: number;\n /** The method value that was selected (`'CARD'` / `'ACH'`). */\n paymentMethod: string;\n /** Stripe's name of it: `'card'` or `'us_bank_account'`. */\n paymentMethodType: 'card' | 'us_bank_account';\n receivedDate: string;\n notes: string | null;\n /** Only with `[fundingPreview]=\"true\"` on the plugin and a card: the ConfirmationToken (`ctoken_...`) created from the typed card, so the backend can read the card funding from Stripe before it creates the intent. */\n confirmationTokenId?: string | null;\n /** Only with `[fundingPreview]=\"true\"` and a card: Stripe's funding of the typed card (display only; a backend that charges by it reads it from the token). */\n funding?: StripeCardFunding | null;\n /**\n * Only with `[duplicateProtection]=\"true\"` on the plugin: the key of this PAYMENT ATTEMPT (stable across retries after a timeout / offline loss, a reload and a second tab; renewed only after\n * a definitive failure or success). Send it to your backend, which creates the PaymentIntent with it as Stripe's `Idempotency-Key` and answers `checkStatus(attemptKey)` with it.\n */\n attemptKey?: string;\n /** Only with `[duplicateProtection]=\"true\"`: the payable of this attempt (`payableRef` at the click): the backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key. */\n payableRef?: string | null;\n}\n\n/** What the host's `createIntent` answers. Fees are optional; when given they are shown as rows under the form. */\nexport interface StripeIntentInfo {\n clientSecret: string;\n paymentIntentId: string;\n stripeFee?: number;\n platformFee?: number;\n totalAmount?: number;\n /** Connect account of a direct charge (passed back to `finalize` / `cancel`). `[stripeAccount]` of the plugin must already be this account: Stripe.js is loaded for it before the form shows. */\n stripeAccountId?: string | null;\n /** Shown after \"Processing fee\" / \"Platform fee\", e.g. `'2.9% + $0.30'`. */\n stripeFeeLabel?: string;\n platformFeeLabel?: string;\n}\n\n/** The fees of a payment, shown before the payer pays (the host's `estimateFees`) or after the intent exists. */\nexport interface StripeFees {\n stripeFee?: number;\n platformFee?: number;\n /** What the payer is charged (amount + fees). The Payment Element is created with this amount, so it MUST equal the intent's amount. */\n totalAmount?: number;\n stripeFeeLabel?: string;\n platformFeeLabel?: string;\n}\n\nexport interface StripeFeeContext {\n amount: number;\n paymentMethod: string;\n paymentMethodType: 'card' | 'us_bank_account';\n /**\n * Only with `[fundingPreview]=\"true\"` on the plugin: the funding of the typed card once the card form is complete (`'credit'`, `'debit'`, `'prepaid'`, `'unknown'`), `null` while it is\n * not known (no card yet, a bank account). A credit-only fee schedule answers the credit fee while it is `null` or `'credit'` and no platform fee for `'debit'` / ACH.\n */\n funding?: StripeCardFunding | null;\n /** Only with `[fundingPreview]=\"true\"` once the card is complete: the ConfirmationToken of the typed card, for a backend-side funding lookup in `estimateFees`. */\n confirmationTokenId?: string | null;\n}\n\nexport const STRIPE_PAYMENT_METHODS = [\n { value: 'CARD', label: 'Card' },\n { value: 'ACH', label: 'ACH / Bank Transfer' },\n] as const;\n\n/** The name of a method in the app's active language. */\nexport const stripeMethodLabel = (value: string, english: string): string =>\n value === 'CARD' ? uiText('stripePaymentMethod.methodCard') : value === 'ACH' ? uiText('stripePaymentMethod.methodAch') : english;\n\nexport const stripeMethodType = (method: string): 'card' | 'us_bank_account' => (method === 'ACH' ? 'us_bank_account' : 'card');\n\n/** The texts of the Stripe payment method; read on every access, so they follow the app's active language. */\nexport const STRIPE_METHOD_TEXTS = {\n get amountNeeded() { return uiText('stripePaymentMethod.amountNeeded'); },\n get notCompleted() { return uiText('stripePaymentMethod.notCompleted'); },\n get achTitle() { return uiText('stripePaymentMethod.achTitle'); },\n achMessage: (amount: string) => uiText('stripePaymentMethod.achMessage', { amount }),\n verificationMessage: (amount: string) => uiText('stripePaymentMethod.verificationMessage', { amount }),\n get receiptNote() { return uiText('stripePaymentMethod.receiptNote'); },\n};\n","import type { HostResult, PaymentAllocation } from '@forgeroute/ui/payments';\nimport type { UiLabelKey } from '@forgeroute/ui/core';\nimport type { StripeFees } from '../payment-stripe-method/payment-stripe-method.models';\n\n/**\n * Card-reader (Stripe Terminal smart reader) types of the library. They mirror the answers of the payments service (`GET /v1/terminal/readiness`,\n * `GET /v1/terminal/readers/:id/ready`, the `terminal` object of a card-present payment, `cardSave`; see forgeroute-payments `docs/API.md` section 16.3 and\n * `host-kit/contract/terminal-readiness.json`). The BROWSER never calls the service: every call below is a function the HOST supplies (it calls its own backend,\n * which calls the service), exactly like `ui-stripe-connect`.\n */\n\n/**\n * The ONE state of the reader setup, chosen by the service with this fixed precedence (first match wins). `checking` = the read was slow or failed (nothing is guessed). `unknown` is the OLD name of `checking`: it is still\n * ACCEPTED in an answer a host passes in (and read as `checking`), but the library never produces it: {@link normalizeReadiness} returns `checking`, no screen shows the word and no event carries it.\n */\nexport type StripeReaderReadinessState = 'merchant_not_ready' | 'no_reader' | 'unsupported_only' | 'reader_ready' | 'reader_busy' | 'reader_offline' | 'checking' | 'unknown';\n\n/** The precedence of the service, first match wins (documentation and tests; the service already sends the winning state). */\nexport const STRIPE_READER_STATE_PRECEDENCE: readonly Exclude<StripeReaderReadinessState, 'checking' | 'unknown'>[] = [\n 'merchant_not_ready', 'no_reader', 'unsupported_only', 'reader_ready', 'reader_busy', 'reader_offline',\n];\n\nexport type StripeReaderDeviceStatus = 'online' | 'offline' | 'registering';\n\n/** A reader as the service answers it (register / list / get / rename). */\nexport interface StripeReader {\n id: string;\n label?: string | null;\n status: StripeReaderDeviceStatus | string;\n locationId?: string | null;\n deviceType?: string | null;\n serialNumber?: string | null;\n pairingCode?: string | null;\n action?: 'idle' | 'in_progress' | 'failed' | null;\n actionIntentId?: string | null;\n /** One of the supported smart readers (S700, S710, WisePOS E). Anything else cannot take a payment. */\n supported: boolean;\n /** Human model name, e.g. `Stripe Reader S700`. */\n model?: string | null;\n /** A payment of this merchant waits on the reader, or the processor says it works on an action. */\n busy: boolean;\n /** Only names a payment of THIS merchant. */\n busyPaymentId?: string | null;\n}\n\n/** `GET /v1/terminal/readiness`. */\nexport interface StripeReaderReadiness {\n state: StripeReaderReadinessState;\n readers: StripeReader[];\n /** The single ready reader, else the most recently used ready reader, else null (the user picks). */\n defaultReaderId: string | null;\n checkedAt?: string;\n /** The processor read was slow or failed: nothing was guessed. */\n stale?: boolean;\n /**\n * Why the answer is what it is. With `merchant_not_ready`: `reconnect_required` (offers \"Reconnect payments\"), `sandbox`, `service_disabled` or `processor_unsupported` (see {@link StripeReaderBannerReason}: the banner words these\n * with no button), anything else = payments are not set up yet (\"Set up payments\"). With `no_reader` / `unsupported_only`: the same three no-button reasons, otherwise the usual \"get a reader\" message.\n */\n reason?: StripeReaderBannerReason | string;\n merchantStatus?: string;\n /** Why the processor read failed (`stale`): see {@link StripeReaderTerminal.degradedReason}. */\n degradedReason?: StripeReaderDegradedReason | string;\n}\n\n/** `GET /v1/terminal/readers/:id/ready` (the optional check right before a payment). */\nexport interface StripeReaderReady {\n ready: boolean;\n reason: 'ok' | 'offline' | 'busy' | 'unsupported' | 'merchant_not_ready' | 'reconnect_required' | 'unknown' | string;\n reader?: StripeReader | null;\n checkedAt?: string;\n stale?: boolean;\n degradedReason?: StripeReaderDegradedReason | string;\n}\n\n/**\n * Why the service could not read the processor (`terminal.degradedReason`): `processor_unreachable` / `processor_timeout` are transient (try again), `reconnect_required` (the processor refused our credentials) and\n * `processor_refused` (it refused the read) will NOT fix themselves: the payment account needs attention.\n */\nexport type StripeReaderDegradedReason = 'processor_unreachable' | 'processor_timeout' | 'reconnect_required' | 'processor_refused';\n\n/**\n * `checking` = the processor could not be read in time (the stored payment is answered); `stale` is the same thing named after the `stale` flag. `unknown` is the OLD name: still ACCEPTED in the service's answer (read as\n * `checking`), never produced by the library; the screen words all three as \"still checking\" and never shows the word.\n */\nexport type StripeReaderTerminalState = 'waiting' | 'declined' | 'failed' | 'succeeded' | 'canceled' | 'checking' | 'stale' | 'unknown';\n\n/** True for a terminal state that means \"the processor could not be read\": `checking`, `stale` and the old `unknown`. */\nexport function isTerminalChecking(state: StripeReaderTerminalState | string | null | undefined): boolean {\n return state === 'checking' || state === 'stale' || state === 'unknown';\n}\n\n/**\n * The reasons a host may put in `StripeReaderReadiness.reason` for the \"no usable reader\" banner. Each maps to its own plain message with NO action button:\n * - `sandbox`: the company is a sandbox account (\"Card readers are not available in a sandbox account.\"); apps map `merchant_not_ready` + this reason.\n * - `service_disabled`: the payments service is switched off (\"Card readers are turned off for this account.\").\n * - `processor_unsupported`: the company's processor can never use readers, e.g. Square or QuickBooks (\"Card readers are not available with this payment processor.\").\n * Any other reason (including `reconnect_required`) or none keeps the usual messages and buttons. The table is `STRIPE_READER_BANNER_REASONS`.\n */\nexport type StripeReaderBannerReason = 'sandbox' | 'service_disabled' | 'processor_unsupported';\n\n/** Reason -> label key of the no-button banner message. Exported for documentation and tests. */\nexport const STRIPE_READER_BANNER_REASONS: Readonly<Record<StripeReaderBannerReason, UiLabelKey>> = {\n sandbox: 'stripeReaderBanner.sandbox',\n service_disabled: 'stripeReaderBanner.serviceDisabled',\n processor_unsupported: 'stripeReaderBanner.processorUnsupported',\n};\n\n/** The no-button label key for a readiness reason, or null when the reason has no special wording. */\nexport function readerBannerReasonKey(reason: string | null | undefined): UiLabelKey | null {\n return reason && Object.prototype.hasOwnProperty.call(STRIPE_READER_BANNER_REASONS, reason) ? STRIPE_READER_BANNER_REASONS[reason as StripeReaderBannerReason] : null;\n}\n\n/** The `terminal` object of a card-present payment (also carried by a 409 `payment_in_flight`). */\nexport interface StripeReaderTerminal {\n readerId: string;\n state: StripeReaderTerminalState;\n declineCode?: string;\n message?: string;\n /** `false` with the state `waiting` = the reader dropped its connection while the payment waits. */\n readerOnline?: boolean;\n /** `unknown` + `stale`: the processor could not be read in time; the stored payment is answered. */\n stale?: boolean;\n checkedAt?: string;\n /** With `stale`: why the processor could not be read (transient or needs attention). */\n degradedReason?: StripeReaderDegradedReason | string;\n /** From the 3rd consecutive stale read: how many stale reads in a row. */\n staleReads?: number;\n /** From the 3rd consecutive stale read: ISO time of the first stale read of the run (\"we cannot reach the processor since 10:42\"). */\n staleSince?: string;\n}\n\n/** Whether the card was kept for later (`savePaymentMethod`). Never claim \"saved\" unless `saved` is true. */\nexport interface StripeReaderCardSave {\n requested: boolean;\n saved: boolean;\n /** `no_generated_card`: the issuer / network gave no reusable card; the payment still succeeded. */\n reason?: string;\n}\n\n/** What a card reader payment looks like (the service's payment view plus `terminal` / `cardSave`). Only the fields the library reads are typed. */\nexport interface StripeReaderPayment {\n id: string;\n status?: string;\n amountCents?: number;\n baseCents?: number;\n feeCents?: number;\n platformFeeCents?: number;\n brand?: string | null;\n last4?: string | null;\n attemptKey?: string;\n terminal?: StripeReaderTerminal | null;\n cardSave?: StripeReaderCardSave | null;\n /** `POST .../retry`: a second retry while the reader already waits is a replay. */\n replayed?: boolean;\n [key: string]: unknown;\n}\n\n/** The consent the STAFF records at the counter before a card is kept (`consent` of `POST /v1/terminal/payments`; the service adds `channel: \"terminal\"`). */\nexport interface StripeReaderConsent {\n textVersion: string;\n /** ISO time the staff ticked the box. */\n acceptedAt: string;\n recordedBy: string;\n}\n\n/** Host settings that turn on \"keep the card for future payments\" for a reader payment. */\nexport interface StripeReaderSaveCard {\n /** The customer the card is kept for (`customerRef` of the service). */\n customerRef: string;\n /** Version of the consent wording (the host stores the text it shows under this version). */\n textVersion: string;\n /** Who is at the counter (the staff member's id or e-mail). */\n recordedBy: string;\n /**\n * The exact sentence the staff attests by ticking the box (default: \"The customer agreed to keep this payment method on file for later payments.\"). `textVersion` MUST name this exact text (the host\n * stores the text it shows under that version).\n */\n consentText?: string;\n /** The payer pays the processing fees: \"Later charges will include processing fees.\" is added to the consent sentence (the same sentence as the contractor staff collect panel). */\n customerPaysFees?: boolean;\n}\n\n/** What `startPayment` receives (the host maps it to `POST /v1/terminal/payments`). The amount is in major units. */\nexport interface StripeReaderStartContext {\n readerId: string;\n /** The amount the customer owes before fees, major units (12.5 = $12.50). */\n amount: number;\n /** Stable per click and REUSED when the answer is lost; send it as the service's `attemptKey`. */\n attemptKey: string;\n payableRef: string | null;\n /** Always `'CARD_PRESENT'`. */\n paymentMethod: 'CARD_PRESENT';\n /**\n * The TOTAL in cents the payer saw (`Math.round(quote.totalAmount * 100)` of the CARD_PRESENT quote). Send it as the service's `expectedAmountCents`: a changed quote is refused with 409 `quote_changed` before the\n * reader is touched. Absent when the screen showed no quote.\n */\n expectedAmountCents?: number;\n savePaymentMethod?: boolean;\n customerRef?: string;\n consent?: StripeReaderConsent;\n /** Set only by the payment-panel integration: what the panel's other fields say. */\n receivedDate?: string;\n notes?: string | null;\n allocation?: PaymentAllocation;\n}\n\n/** What `estimateFees` receives for a reader payment. The quote is the CARD_PRESENT one and differs from the online card quote. */\nexport interface StripeReaderFeeContext { amount: number; paymentMethod: 'CARD_PRESENT'; paymentMethodType: 'card_present' }\n\n/** `getPayment`: which payment to read. `paymentId` is known after the start answered; before that only the attempt key is. */\nexport interface StripeReaderPaymentRef { paymentId: string | null; attemptKey: string }\n\nexport type StripeReaderGetReadinessFn = () => HostResult<StripeReaderReadiness>;\nexport type StripeReaderStartFn = (ctx: StripeReaderStartContext) => HostResult<StripeReaderPayment>;\n/** Reads one payment with its `terminal` object. Answer `null` (or reject with 404) when no payment exists for the attempt key. */\nexport type StripeReaderGetPaymentFn = (ref: StripeReaderPaymentRef) => HostResult<StripeReaderPayment | null>;\nexport type StripeReaderRetryFn = (paymentId: string) => HostResult<StripeReaderPayment>;\nexport type StripeReaderCancelFn = (paymentId: string) => HostResult<unknown>;\nexport type StripeReaderFeesFn = (ctx: StripeReaderFeeContext) => HostResult<StripeFees>;\n\n/** The one bundle of host callbacks that turns card-reader mode on in `ui-payment-stripe-method` (`[reader]`). */\nexport interface StripeReaderConfig {\n getReadiness: StripeReaderGetReadinessFn;\n startPayment: StripeReaderStartFn;\n getPayment: StripeReaderGetPaymentFn;\n retryPayment: StripeReaderRetryFn;\n cancelPayment: StripeReaderCancelFn;\n /** The CARD_PRESENT fee quote. REQUIRED: a reader payment shows the breakdown (and sends `expectedAmountCents`) before the tap. */\n estimateFees: StripeReaderFeesFn;\n /** The address of the receipt of a paid payment (host-built; only https or in-app `/paths` are linked). */\n receiptUrl?: (payment: StripeReaderPayment) => string | null | undefined;\n /** Turns on the \"Save this card for future payments\" choice. */\n saveCard?: StripeReaderSaveCard | null;\n /**\n * How often (ms) the waiting payment's status is read while the payer taps (default 2000). Clamped to {@link STRIPE_READER_POLL_MIN_MS}..{@link STRIPE_READER_POLL_MAX_MS}. The `[readerPollMs]` input of\n * `ui-payment-stripe-method`, when set, wins over this value.\n */\n pollMs?: number;\n}\n\n/** The fastest and the slowest status poll of a waiting reader payment (ms): a faster one would hammer the host's backend, a slower one would leave the payer staring at a stale screen. */\nexport const STRIPE_READER_POLL_MIN_MS = 500;\nexport const STRIPE_READER_POLL_MAX_MS = 30_000;\nconst STRIPE_READER_POLL_DEFAULT_MS = 2000;\n\n/** A poll cadence the library will actually use: not a finite number > 0 = the default (2000 ms); otherwise rounded and clamped to 500..30 000 ms. */\nexport function clampReaderPollMs(value: number | null | undefined): number {\n if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) return STRIPE_READER_POLL_DEFAULT_MS;\n return Math.min(STRIPE_READER_POLL_MAX_MS, Math.max(STRIPE_READER_POLL_MIN_MS, Math.round(value)));\n}\n\n/** A refusal of `startPayment` / `retryPayment` the library words itself. */\nexport interface StripeReaderRefusal {\n code: string;\n /** The service's own text, shown only for a code the library has no wording for. */\n message: string;\n paymentId: string | null;\n terminal: StripeReaderTerminal | null;\n /** `quote_changed`: the new total / fees in cents, as the service answered them. */\n amountCents?: number | null;\n feeCents?: number | null;\n platformFeeCents?: number | null;\n}\n\n/** Reads the flat `code`, status, `paymentId` and `terminal` of a failed host call (the error itself or its `error` body). */\nexport function readerErrorInfo(error: unknown): StripeReaderRefusal & { status: number | null } {\n type Body = { code?: unknown; message?: unknown; paymentId?: unknown; terminal?: unknown; amountCents?: unknown; feeCents?: unknown; platformFeeCents?: unknown };\n const e = error as (Body & { status?: unknown; response?: { status?: unknown } | null; error?: Body | null }) | null | undefined;\n const pick = <T>(guard: (v: unknown) => v is T, ...values: unknown[]): T | null => { for (const v of values) if (guard(v)) return v; return null; };\n const isString = (v: unknown): v is string => typeof v === 'string' && v.length > 0;\n const isCents = (v: unknown): v is number => typeof v === 'number' && Number.isFinite(v) && v >= 0;\n const isObject = (v: unknown): v is StripeReaderTerminal => !!v && typeof v === 'object' && typeof (v as { state?: unknown }).state === 'string';\n const status = typeof e?.status === 'number' ? e.status : typeof e?.response?.status === 'number' ? e.response.status : null;\n const body = (e?.error && typeof e.error === 'object' ? e.error : null) as Body | null;\n // the quote_changed amounts are present only when the service sent them (a refusal without them has no such keys)\n const cents = (key: 'amountCents' | 'feeCents' | 'platformFeeCents'): Partial<Record<typeof key, number>> => { const v = pick(isCents, e?.[key], body?.[key]); return v === null ? {} : ({ [key]: v } as Partial<Record<typeof key, number>>); };\n return {\n code: (pick(isString, e?.code, body?.code) ?? '').toLowerCase(),\n message: pick(isString, body?.message, e?.message) ?? '',\n paymentId: pick(isString, e?.paymentId, body?.paymentId),\n terminal: pick(isObject, e?.terminal, body?.terminal),\n ...cents('amountCents'), ...cents('feeCents'), ...cents('platformFeeCents'),\n status,\n };\n}\n\n/** A refusal without the HTTP status (the refusal the screen keeps is the same shape whatever the transport said). */\nexport function toRefusal(info: StripeReaderRefusal & { status?: number | null }): StripeReaderRefusal {\n const { status: _status, ...rest } = info;\n void _status;\n return rest;\n}\n\n/** What a payment was STARTED for (before fees, major units): `baseCents`, else the total minus the fees, else the total; `null` when the service gave no amount. Never 0 for a missing amount. */\nexport function paymentBaseAmount(payment: StripeReaderPayment | null | undefined): number | null {\n if (!payment) return null;\n if (typeof payment.baseCents === 'number' && payment.baseCents > 0) return payment.baseCents / 100;\n if (typeof payment.amountCents === 'number' && payment.amountCents > 0) {\n const fees = (typeof payment.feeCents === 'number' ? payment.feeCents : 0) + (typeof payment.platformFeeCents === 'number' ? payment.platformFeeCents : 0);\n return Math.max(0, payment.amountCents - fees) / 100 || payment.amountCents / 100;\n }\n return null;\n}\n\n/** How the screen words a terminal the service could not read (`checking` / `stale`). */\nexport type StripeReaderDegraded = { kind: 'transient' } | { kind: 'since'; since: string } | { kind: 'attention' };\n\n/**\n * `null` when the terminal was read normally. Otherwise: `attention` for a reason that will not fix itself (`reconnect_required`, `processor_refused`: \"the payment account needs attention\"), `since` from the 3rd\n * consecutive stale read (\"cannot reach the processor since 10:42\") and `transient` for the rest (`processor_unreachable`, `processor_timeout`, none given). Never a resubmit in any of them.\n */\nexport function readerDegraded(terminal: Pick<StripeReaderTerminal, 'state' | 'stale' | 'degradedReason' | 'staleReads' | 'staleSince'> | null | undefined, locale?: string): StripeReaderDegraded | null {\n if (!terminal || !(isTerminalChecking(terminal.state) || terminal.stale === true)) return null;\n if (terminal.degradedReason === 'reconnect_required' || terminal.degradedReason === 'processor_refused') return { kind: 'attention' };\n if (typeof terminal.staleReads === 'number' && terminal.staleReads >= 3 && terminal.staleSince) {\n const at = new Date(terminal.staleSince);\n if (!Number.isNaN(at.getTime())) {\n try { return { kind: 'since', since: new Intl.DateTimeFormat(locale, { hour: 'numeric', minute: '2-digit' }).format(at) }; } catch { /* fall through to transient */ }\n }\n }\n return { kind: 'transient' };\n}\n\n/** The TOTAL a payment charged (major units), from the service's `amountCents`; `null` when absent. */\nexport function paymentChargedAmount(payment: StripeReaderPayment | null | undefined): number | null {\n return payment && typeof payment.amountCents === 'number' && payment.amountCents > 0 ? payment.amountCents / 100 : null;\n}\n\n/** The label key of the wording of a reader refusal code, or null for a code the library does not know (the service's message is shown). */\nexport function readerRefusalLabelKey(code: string): UiLabelKey | null {\n switch (code) {\n case 'reader_busy': return 'stripeReader.refusal.reader_busy';\n case 'reader_offline': return 'stripeReader.refusal.reader_offline';\n case 'reader_not_supported': return 'stripeReader.refusal.reader_not_supported';\n case 'reader_unreachable': return 'stripeReader.refusal.reader_unreachable';\n case 'terminal_not_retryable': return 'stripeReader.refusal.terminal_not_retryable';\n case 'payment_in_flight': return 'stripeReader.refusal.payment_in_flight';\n case 'merchant_not_ready': return 'stripeReader.refusal.merchant_not_ready';\n case 'reconnect_required': return 'stripeReader.refusal.reconnect_required';\n case 'consent_required': return 'stripeReader.refusal.consent_required';\n case 'terminal_save_needs_direct': return 'stripeReader.refusal.terminal_save_needs_direct';\n case 'not_supported_by_processor': return 'stripeReader.refusal.not_supported_by_processor';\n case 'exceeds_amount_due': return 'stripeReader.refusal.exceeds_amount_due';\n case 'duplicate_suspected': return 'stripeReader.refusal.duplicate_suspected';\n case 'quote_changed': return 'stripeReader.refusal.quote_changed';\n case 'attempt_failed_use_new_key': return 'stripeReader.refusal.attempt_failed_use_new_key';\n case 'payment_being_sent': return 'stripeReader.refusal.payment_being_sent';\n // raised by the library itself (the attempt machine refused the click, a start / retry could not be settled, or the service answered 429)\n case 'paid': return 'stripeReader.refusal.paid';\n case 'offline': return 'stripeReader.refusal.offline';\n case 'outcome_checking':\n case 'outcome_unknown': return 'stripeReader.refusal.outcome_checking'; // `outcome_unknown` = the old code, still worded; the library raises `outcome_checking`\n case 'queued_offline': return 'stripeReader.refusal.queued_offline';\n case 'start_not_received': return 'stripeReader.refusal.start_not_received';\n case 'retry_unreachable': return 'stripeReader.refusal.retry_unreachable';\n case 'rate_limited': return 'stripeReader.refusal.rate_limited';\n default: return null;\n }\n}\n\n/** Codes that prove NOTHING was created or charged: the attempt is released (key kept) and the payer may start again. */\nexport const STRIPE_READER_NOT_CREATED_CODES: readonly string[] = [\n 'reader_busy', 'reader_offline', 'reader_not_supported', 'merchant_not_ready', 'reconnect_required', 'consent_required', 'terminal_save_needs_direct', 'not_supported_by_processor', 'exceeds_amount_due', 'quote_changed',\n];\n\n/** The supported smart readers (the service refuses anything else with 400 `reader_not_supported`). */\nexport const STRIPE_READER_MODELS: readonly { deviceType: string; model: string }[] = [\n { deviceType: 'stripe_s700', model: 'Stripe Reader S700' },\n { deviceType: 'stripe_s710', model: 'Stripe Reader S710' },\n { deviceType: 'bbpos_wisepos_e', model: 'BBPOS WisePOS E' },\n];\n\nconst KNOWN_STATES: readonly StripeReaderReadinessState[] = ['merchant_not_ready', 'no_reader', 'unsupported_only', 'reader_ready', 'reader_busy', 'reader_offline', 'checking', 'unknown'];\n\n/** A defensive copy of an answer: an unrecognised state (or the old `unknown`) becomes `checking`, a missing list `[]` (nothing is ever guessed ready). The result's state is never `unknown`. */\nexport function normalizeReadiness(raw: unknown): StripeReaderReadiness {\n const r = raw as Partial<StripeReaderReadiness> | null | undefined;\n const readers = Array.isArray(r?.readers) ? r!.readers!.filter(x => !!x && typeof x.id === 'string') : [];\n let state = KNOWN_STATES.includes(r?.state as StripeReaderReadinessState) ? (r!.state as StripeReaderReadinessState) : 'checking';\n if (state === 'unknown') state = 'checking';\n // `reader_ready` with no reader that is supported, online and free can take no payment: nothing is guessed ready.\n if (state === 'reader_ready' && !readers.some(isReaderFree)) state = 'checking';\n return {\n state, readers, defaultReaderId: typeof r?.defaultReaderId === 'string' ? r.defaultReaderId : null,\n ...(r?.checkedAt ? { checkedAt: r.checkedAt } : {}), ...(r?.stale ? { stale: true } : {}), ...(r?.reason ? { reason: r.reason } : {}), ...(r?.merchantStatus ? { merchantStatus: r.merchantStatus } : {}),\n ...(r?.degradedReason ? { degradedReason: r.degradedReason } : {}),\n };\n}\n\n/**\n * \"10:42 AM\" of a moment, in the user's language (explicit locale, the user's own time zone). `''` for a missing / unreadable value. Library source 2026-11-21 (used by `ui-stripe-reader-banner`: \"last confirmed at ...\").\n */\nexport function formatReaderTime(value: Date | string | number | null | undefined, locale?: string): string {\n if (value == null || value === '') return '';\n const at = value instanceof Date ? value : new Date(value);\n if (Number.isNaN(at.getTime())) return '';\n try { return new Intl.DateTimeFormat(locale, { hour: 'numeric', minute: '2-digit' }).format(at); } catch { return ''; }\n}\n\n/** The name a reader is shown under: its label, else its model, else its id. */\nexport function readerDisplayName(reader: Pick<StripeReader, 'id' | 'label' | 'model' | 'deviceType'> | null | undefined): string {\n if (!reader) return '';\n return reader.label?.trim() || reader.model?.trim() || STRIPE_READER_MODELS.find(m => m.deviceType === reader.deviceType)?.model || reader.id;\n}\n\n/** Can this reader take a payment right now (supported, online, free)? */\nexport function isReaderFree(reader: StripeReader): boolean { return reader.supported && reader.status === 'online' && !reader.busy; }\n\n/** Only an https address or an in-app `/path` is ever linked or opened (never `javascript:`, `data:`, `//host`). */\nexport function isSafeReceiptUrl(url: string | null | undefined): url is string {\n if (!url || /[\\u0000-\\u001f\\\\]/.test(url)) return false;\n if (url.startsWith('/') && !url.startsWith('//')) return true;\n try { return new URL(url).protocol === 'https:'; } catch { return false; }\n}\n\n/** `m:ss` of an elapsed time in ms (never negative). */\nexport function formatElapsed(ms: number): string {\n const total = Math.max(0, Math.floor((Number.isFinite(ms) ? ms : 0) / 1000));\n const m = Math.floor(total / 60);\n const s = total % 60;\n return `${m}:${s < 10 ? '0' : ''}${s}`;\n}\n\n/** A Stripe location a reader is registered to. */\nexport interface StripeReaderLocation {\n id: string;\n displayName: string;\n address?: { line1?: string; city?: string; state?: string; postalCode?: string; country?: string } | null;\n}\n\n/** What `registerReader` receives. The registration code is typed once by the user and never kept: it is cleared from the form BEFORE the call and never echoed back. */\nexport interface StripeReaderRegisterContext { registrationCode: string; label: string; locationId: string }\n\n/** What `createLocation` receives (the host maps it to `POST /v1/terminal/locations`). */\nexport interface StripeReaderCreateLocationContext {\n displayName: string;\n address: { line1: string; city: string; state: string; postalCode: string; country: string };\n}\n\nexport type StripeReaderRegisterFn = (ctx: StripeReaderRegisterContext) => HostResult<StripeReader>;\nexport type StripeReaderRenameFn = (readerId: string, label: string) => HostResult<StripeReader>;\nexport type StripeReaderRemoveFn = (readerId: string) => HostResult<unknown>;\nexport type StripeReaderListLocationsFn = () => HostResult<readonly StripeReaderLocation[]>;\nexport type StripeReaderCreateLocationFn = (ctx: StripeReaderCreateLocationContext) => HostResult<StripeReaderLocation>;\n","import { computed, signal } from '@angular/core';\nimport { PAYMENT_REQUEST_TIMEOUT_MS, callHost, wasQueuedOffline, type HostResult } from '@forgeroute/ui/payments';\nimport {\n STRIPE_READER_NOT_CREATED_CODES, isTerminalChecking, paymentBaseAmount, readerErrorInfo, toRefusal,\n type StripeReaderCancelFn, type StripeReaderCardSave, type StripeReaderConsent, type StripeReaderGetPaymentFn, type StripeReaderPayment, type StripeReaderRefusal, type StripeReaderRetryFn,\n type StripeReaderStartContext, type StripeReaderStartFn, type StripeReaderTerminal,\n} from './stripe-reader.models';\n\n/**\n * Where a card reader payment is. One value, always:\n * - `idle`: nothing started (or an earlier payment ended: canceled / failed / refused);\n * - `starting`: the click was accepted and the payment is on its way to the service (the answer is not here yet);\n * - `recovering`: the answer of `starting` was lost (timeout, connection): the attempt key is looked up until the payment is found (or, after the grace period, the service still has none: then `recoveryExpired` is set and\n * the payer is asked to check again; only a second \"none\" answer, asked by the payer, releases the attempt). NEVER a second start;\n * - `waiting`: the reader waits for the customer to tap, insert or swipe;\n * - `declined`: the card was declined; the payment stays open (retry the SAME payment or cancel it);\n * - `stopped`: the reader stopped waiting without a decline; the payment stays open (retry or cancel);\n * - `retrying`: the same payment is being sent to the reader again;\n * - `cancelling`: a cancel is running (the payment is canceled ONLY when the service confirms);\n * - `succeeded`, `canceled`, `failed`: final.\n */\nexport type StripeReaderPhase = 'idle' | 'starting' | 'recovering' | 'waiting' | 'declined' | 'stopped' | 'retrying' | 'cancelling' | 'succeeded' | 'canceled' | 'failed';\n\n/** What the flow needs of the payment-attempt machine (`PaymentAttempt` of `@forgeroute/ui/payments` fits it; specs use a fake). */\nexport interface StripeReaderAttemptPort {\n begin(): { ok: true; key: string } | { ok: false; reason: 'locked' | 'paid' | 'unknown' | 'offline' };\n /** The key of the attempt in effect. */\n key(): string;\n /** The payment succeeded: locks the payable as paid. */\n succeed(reason?: string): void;\n /** A DEFINITIVE end without money (canceled, failed): unlocks with a NEW key. */\n fail(reason?: string): void;\n /** Nothing was created at the service: unlock, KEEP the key. */\n markNotCharged(): void;\n /** The answer of the start was lost: lock (key kept) until the payment is found. */\n markUnknown(reason: string): void;\n}\n\nexport type StripeReaderFlowEvent =\n | { kind: 'started'; payment: StripeReaderPayment; attemptKey: string }\n | { kind: 'declined'; payment: StripeReaderPayment }\n | { kind: 'succeeded'; payment: StripeReaderPayment; attemptKey: string }\n | { kind: 'canceled'; payment: StripeReaderPayment | null }\n | { kind: 'failed'; payment: StripeReaderPayment | null }\n | { kind: 'refused'; refusal: StripeReaderRefusal }\n | { kind: 'connection-lost' }\n | { kind: 'connection-restored' };\n\nexport interface StripeReaderFlowOptions {\n attempt: StripeReaderAttemptPort;\n /** The calls are read at call time (a host may swap them); null = not provided (the action does nothing). */\n start: () => StripeReaderStartFn | null;\n getPayment: () => StripeReaderGetPaymentFn | null;\n retry: () => StripeReaderRetryFn | null;\n cancel: () => StripeReaderCancelFn | null;\n /** How often the open payment is read (default 2000 ms). */\n pollMs?: () => number;\n /** A poll slower than this counts as a lost connection (default 8000 ms). */\n pollTimeoutMs?: () => number;\n /** One start / retry / cancel call slower than this is treated as unreachable: a start becomes a lost answer (looked up by its attempt key, never re-sent), a retry / cancel leaves the payment as it was (default 60 000 ms). */\n requestTimeoutMs?: () => number;\n /** After a lost start answer (or an adopted attempt), \"no payment for this attempt key\" is believed only after this long, MEASURED FROM THE MOMENT RECOVERY STARTS (default 360 000 ms: the service may take up to 5 minutes to create the payment\n * of a request whose answer the browser gave up on, API.md 16.3, plus 1 minute of margin). */\n lostAnswerGraceMs?: () => number;\n now?: () => number;\n onEvent?: (event: StripeReaderFlowEvent) => void;\n}\n\n/** What the screen passes to `start()`. */\nexport interface StripeReaderStartInput {\n readerId: string;\n /** Major units. */\n amount: number;\n payableRef: string | null;\n /** The total in cents the payer saw (the CARD_PRESENT quote); sent as `expectedAmountCents`. */\n expectedAmountCents?: number;\n save?: { customerRef: string; consent: StripeReaderConsent } | null;\n extras?: Pick<StripeReaderStartContext, 'receivedDate' | 'notes' | 'allocation'>;\n}\n\nexport const STRIPE_READER_POLL_MS = 2000;\nexport const STRIPE_READER_POLL_TIMEOUT_MS = 8000;\n/** The service's create window (5 minutes) plus a minute of margin: \"no payment for this key\" earlier than this may only mean the payment is not created yet. */\nexport const STRIPE_READER_LOST_ANSWER_GRACE_MS = 6 * 60_000;\n/** A start / retry / cancel call that has not answered by then is unreachable (the library's request timeout). */\nexport const STRIPE_READER_REQUEST_TIMEOUT_MS = PAYMENT_REQUEST_TIMEOUT_MS;\n\n/** The service's definitive refusals of a start that prove nothing was created and that are NOT worded as \"not charged\" retries: the existing payment is shown. */\nconst DEFINITIVE_START_CODES: readonly string[] = ['duplicate_suspected'];\n\nconst OPEN: readonly StripeReaderPhase[] = ['starting', 'recovering', 'waiting', 'declined', 'stopped', 'retrying', 'cancelling'];\nconst FINAL: readonly StripeReaderPhase[] = ['succeeded', 'canceled', 'failed'];\n\n/**\n * The card reader payment flow as a plain class (no view): readiness is the screen's job, this starts ONE payment on a reader, follows it by polling the service through the host's calls, and lets the payer retry\n * (the SAME payment, never a new charge) or cancel it. `ui-stripe-reader-payment` runs it; specs drive it with fake calls and a fake clock.\n *\n * Money rules it enforces:\n * - ONE payment at a time: `start()` is synchronous up to the attempt's `begin()` (a double click / second tab is refused) and every state in {@link OPEN} refuses another start;\n * - the attempt key is the one the attempt machine pinned at the click and is REUSED when the answer is lost (the service answers the same attempt key with the same payment, one intent, one reader action);\n * - a lost answer is never \"failed\": it is `recovering` (polling by attempt key) until the payment shows up, or the grace period has passed with the service still saying \"no payment for this key\";\n * - a cancel never claims success unless the service confirmed it (`reader_unreachable` leaves the payment open and says so);\n * - a poll that fails (connection lost) never changes the payment's state: it is reported and polling continues; the state shown on reconnect is the service's truth;\n * - the service's `terminal.state` `unknown` / `stale` is \"still checking\" (never an error, never a resubmit).\n */\nexport class StripeReaderFlow {\n readonly phase = signal<StripeReaderPhase>('idle');\n readonly payment = signal<StripeReaderPayment | null>(null);\n readonly terminal = computed((): StripeReaderTerminal | null => this.payment()?.terminal ?? null);\n /** The service could not read the processor (`terminal.state` `unknown` or `stale`): \"still checking\". */\n readonly checking = signal(false);\n /** The browser could not reach the host while a payment is open: the reader may still take the payment. */\n readonly connectionLost = signal(false);\n /** `recovering` only: the grace period is over and the service still has no payment for the attempt key. Polling stops; the payer is asked to \"Check again\" (`recheck()`), and only another \"none\" releases the attempt. */\n readonly recoveryExpired = signal(false);\n /** `recheck()` is running. */\n readonly rechecking = signal(false);\n /** The reader dropped its connection while the payment waits (`terminal.readerOnline === false`). */\n readonly readerOffline = signal(false);\n /** The last refusal of a start / retry (worded by the screen); cleared by the next start. */\n readonly refusal = signal<StripeReaderRefusal | null>(null);\n /** A cancel could not be confirmed (the reader or the processor was unreachable): the payment is STILL open. */\n readonly cancelUnreachable = signal(false);\n readonly cardSave = signal<StripeReaderCardSave | null>(null);\n readonly elapsedMs = signal(0);\n /** What the last start (or the adopted payment) is for, before fees (major units); `null` until known. */\n readonly baseAmount = computed((): number | null => paymentBaseAmount(this.payment()) ?? this.startInput()?.amount ?? null);\n /** The input of the last start (a signal, so the screen follows it). */\n readonly startInput = signal<StripeReaderStartInput | null>(null);\n /** The attempt key of the payment being started / followed. */\n readonly attemptKey = signal<string | null>(null);\n /** No other payment may be started and the payer must not leave. */\n readonly locked = computed(() => OPEN.includes(this.phase()));\n /** A payment exists at the service and is not decided (cancel is possible). */\n readonly cancellable = computed(() => ['waiting', 'declined', 'stopped'].includes(this.phase()) && !!this.payment()?.id);\n readonly retryable = computed(() => ['declined', 'stopped'].includes(this.phase()) && !!this.payment()?.id);\n\n private disposed = false;\n private pollTimer: ReturnType<typeof setTimeout> | null = null;\n private tickTimer: ReturnType<typeof setInterval> | null = null;\n private pollGen = 0;\n private polling = false;\n private startedAt = 0;\n /** When recovery began (a lost start answer, or an adopted attempt): the grace is counted from here, never from the click. */\n private recoverStartedAt = 0;\n private explicitCheck = false;\n /** The payment id the service named in a 409 `request_in_progress` (the same attempt key is being created): used to read the payment while the answer of the start is lost. Never used to cancel. */\n private adoptedPaymentId: string | null = null;\n private cancelRun: Promise<boolean> | null = null;\n /** The phase to go back to when a retry or a cancel did not change anything. */\n private before: StripeReaderPhase = 'waiting';\n\n constructor(private readonly o: StripeReaderFlowOptions) {}\n\n private now(): number { return this.o.now ? this.o.now() : Date.now(); }\n private emit(event: StripeReaderFlowEvent): void { if (!this.disposed) this.o.onEvent?.(event); }\n\n /** Starts ONE payment on a reader. Synchronous up to the attempt's `begin()`: a second click in the same tick is refused. */\n async start(input: StripeReaderStartInput): Promise<void> {\n if (this.disposed || this.locked() || this.phase() === 'succeeded') return;\n const start = this.o.start();\n if (!start) return;\n const begun = this.o.attempt.begin();\n if (!begun.ok) {\n if (begun.reason !== 'locked') this.refuse({ code: begun.reason === 'unknown' ? 'outcome_checking' : begun.reason, message: '', paymentId: null, terminal: null });\n return;\n }\n this.phase.set('starting');\n this.startInput.set(input);\n this.attemptKey.set(begun.key);\n this.startedAt = this.now();\n this.elapsedMs.set(0);\n this.refusal.set(null);\n this.cancelUnreachable.set(false);\n this.connectionLost.set(false);\n this.checking.set(false);\n this.recoveryExpired.set(false);\n this.cardSave.set(null);\n this.payment.set(null);\n this.adoptedPaymentId = null;\n this.startTick();\n const ctx: StripeReaderStartContext = {\n readerId: input.readerId, amount: input.amount, attemptKey: begun.key, payableRef: input.payableRef, paymentMethod: 'CARD_PRESENT',\n ...(input.expectedAmountCents !== undefined && Number.isFinite(input.expectedAmountCents) && input.expectedAmountCents >= 1 ? { expectedAmountCents: Math.round(input.expectedAmountCents) } : {}),\n ...(input.save ? { savePaymentMethod: true, customerRef: input.save.customerRef, consent: input.save.consent } : {}),\n ...(input.extras ?? {}),\n };\n let answer: StripeReaderPayment | null | undefined;\n try { answer = await this.call(() => start(ctx)); } catch (error) { this.onStartError(error); return; }\n if (this.disposed) return;\n if (wasQueuedOffline(answer)) {\n // The offline layer queued the request (a synthetic 202): nothing reached the service. Payments are never queued.\n this.o.attempt.markNotCharged();\n this.endNotCreated({ code: 'queued_offline', message: '', paymentId: null, terminal: null });\n return;\n }\n if (!answer || typeof answer.id !== 'string' || !answer.id) { this.lostAnswer(); return; }\n this.emit({ kind: 'started', payment: answer, attemptKey: begun.key });\n this.apply(answer);\n this.schedulePoll();\n }\n\n private onStartError(error: unknown): void {\n if (this.disposed) return;\n const info = readerErrorInfo(error);\n // The key can never complete (a failed payment superseded by a newer one, returned by the bank...): a DEFINITIVE end of this key, the attempt starts again with a NEW key. Never a lost answer.\n if (info.code === 'attempt_failed_use_new_key') {\n this.o.attempt.fail('replay');\n this.endNotCreated(toRefusal(info));\n return;\n }\n // The same attempt key is being created right now (`request_in_progress`, whatever the status): the payment may exist, so NEVER a second start and never idle. It is looked up by its attempt key (and by the payment id when the service names it).\n if (info.code === 'request_in_progress') {\n if (info.paymentId) this.adoptedPaymentId = info.paymentId;\n this.lostAnswer();\n return;\n }\n // Another payment of this reference holds the reader: when it IS a card reader payment (`terminal` is answered) it is followed, so staff can cancel / retry / watch the open payment instead of being stuck.\n if (info.code === 'payment_in_flight' && info.paymentId && info.terminal) {\n // The marker is KEPT (unknown) while the open payment is followed: a reload or a second tab must not find a free screen while a payment waits on the reader. It ends with the followed payment (succeeded / canceled / failed).\n this.o.attempt.markUnknown('payment_in_flight');\n this.follow({ id: info.paymentId, status: 'CREATED', terminal: info.terminal }, toRefusal(info));\n return;\n }\n // The reader holds another payment, or this reference has an open payment of another attempt (or a suspected duplicate): nothing was created by THIS click.\n if (info.code === 'payment_in_flight' || DEFINITIVE_START_CODES.includes(info.code) || STRIPE_READER_NOT_CREATED_CODES.includes(info.code)) {\n this.o.attempt.markNotCharged();\n this.endNotCreated(toRefusal(info));\n return;\n }\n // 429 (a risk block or a rate limit): the service creates NOTHING (API.md), so it is a definitive \"not created\". The same attempt key is idempotent at the service, so the payer may simply try again.\n if (info.status === 429) {\n this.o.attempt.markNotCharged();\n this.endNotCreated({ ...toRefusal(info), code: 'rate_limited' });\n return;\n }\n // A definitive refusal of the request itself (a 4xx the service answered, no code we know): nothing was created either. 408 (gateway timeout), 409 and 425 (too early) can follow a request the service already took: those are a lost answer.\n if (info.status !== null && info.status >= 400 && info.status < 500 && info.status !== 408 && info.status !== 409 && info.status !== 425) {\n this.o.attempt.markNotCharged();\n this.endNotCreated(toRefusal(info));\n return;\n }\n // Timeout, connection, 5xx, 408/409/425 without a known code: the payment may exist.\n this.lostAnswer();\n }\n\n /** Follows an open reader payment of another attempt (the service said so with `payment_in_flight` + `terminal`): the screen shows it like its own, with its refusal text above. */\n private follow(payment: StripeReaderPayment, refusal: StripeReaderRefusal): void {\n this.stopTick();\n this.startTick();\n this.payment.set(payment);\n this.phase.set('waiting');\n this.apply(payment);\n this.refuse(refusal);\n if (!FINAL.includes(this.phase())) this.schedulePoll();\n }\n\n /**\n * A reload or a second tab found an UNDECIDED attempt of this payable (the attempt machine is `unknown`): the payment may be waiting on a reader right now. The attempt key is looked up (never a new start)\n * until the payment shows up (then it is followed like any other) or, after the grace period, the service still has none.\n */\n adopt(): void {\n if (this.disposed || this.locked() || FINAL.includes(this.phase())) return;\n this.attemptKey.set(this.o.attempt.key());\n this.adoptedPaymentId = null;\n this.startedAt = this.now();\n this.recoverStartedAt = this.now();\n this.recoveryExpired.set(false);\n this.elapsedMs.set(0);\n this.refusal.set(null);\n this.startTick();\n this.phase.set('recovering');\n this.schedulePoll();\n }\n\n private endNotCreated(refusal: StripeReaderRefusal): void {\n this.recoveryExpired.set(false);\n this.stopTick();\n this.stopPolling();\n this.phase.set('idle');\n this.refuse(refusal);\n }\n\n private refuse(refusal: StripeReaderRefusal): void {\n this.refusal.set(refusal);\n this.emit({ kind: 'refused', refusal });\n }\n\n /** The answer of the start is lost: lock with the key kept and look the attempt key up until the payment shows up. */\n private lostAnswer(): void {\n this.o.attempt.markUnknown('timeout');\n this.recoverStartedAt = this.now();\n this.recoveryExpired.set(false);\n this.phase.set('recovering');\n this.schedulePoll();\n }\n\n // ── Polling ──────────────────────────────────────────────────────────────\n\n /** Reads the payment now (also after the browser says it is back online). */\n pollNow(): void {\n if (this.disposed || !this.shouldPoll()) return;\n this.stopPolling();\n void this.pollOnce(this.pollGen);\n }\n\n /** The browser reports offline / online. Offline only marks the loss; the next successful poll restores. */\n markConnection(online: boolean): void {\n if (this.disposed || !this.shouldPoll()) return;\n if (!online) this.setConnectionLost(true);\n else this.pollNow();\n }\n\n private shouldPoll(): boolean { return ['recovering', 'waiting', 'declined', 'stopped', 'retrying'].includes(this.phase()); }\n\n private schedulePoll(): void {\n this.stopPolling();\n if (this.disposed || !this.shouldPoll() || this.recoveryExpired()) return;\n const gen = this.pollGen;\n const every = Math.max(1, this.o.pollMs?.() ?? STRIPE_READER_POLL_MS);\n this.pollTimer = setTimeout(() => { this.pollTimer = null; void this.pollOnce(gen); }, every);\n }\n\n private stopPolling(): void {\n this.pollGen++;\n if (this.pollTimer) { clearTimeout(this.pollTimer); this.pollTimer = null; }\n }\n\n private async pollOnce(gen: number): Promise<void> {\n const read = this.o.getPayment();\n if (!read || this.polling || gen !== this.pollGen || !this.shouldPoll()) { if (gen === this.pollGen) this.schedulePoll(); return; }\n this.polling = true;\n const phaseAtStart = this.phase();\n const explicit = this.explicitCheck;\n let answer: StripeReaderPayment | null | 'failed' = 'failed';\n let notFound = false;\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<'timeout'>(resolve => { timer = setTimeout(() => resolve('timeout'), this.o.pollTimeoutMs?.() ?? STRIPE_READER_POLL_TIMEOUT_MS); });\n const result = await Promise.race([callHost(() => read({ paymentId: this.payment()?.id ?? this.adoptedPaymentId, attemptKey: this.attemptKey() ?? this.o.attempt.key() })), timeout]);\n if (result === 'timeout') answer = 'failed';\n else if (result && typeof result === 'object' && typeof result.id === 'string') answer = result;\n else { answer = null; notFound = true; }\n } catch (error) {\n const info = readerErrorInfo(error);\n if (info.status === 404 && !this.payment() && !this.adoptedPaymentId) { answer = null; notFound = true; } else answer = 'failed';\n } finally { if (timer) clearTimeout(timer); this.polling = false; }\n if (this.disposed || gen !== this.pollGen) return;\n if (answer === 'failed') {\n this.setConnectionLost(true);\n } else if (answer) {\n this.setConnectionLost(false);\n if (phaseAtStart === 'recovering' && this.phase() === 'recovering') this.emit({ kind: 'started', payment: answer, attemptKey: this.attemptKey() ?? '' });\n this.apply(answer);\n } else if (notFound) {\n this.setConnectionLost(false);\n if (this.phase() === 'recovering' && this.now() - this.recoverStartedAt >= Math.max(0, this.o.lostAnswerGraceMs?.() ?? STRIPE_READER_LOST_ANSWER_GRACE_MS)) {\n if (explicit && this.recoveryExpired()) {\n // The payer asked again AFTER the grace (longer than the service needs to create a payment) and the service still has none for this key: nothing was created. The marker is released (key kept: the service answers the same key with the same payment).\n this.o.attempt.markNotCharged();\n this.endNotCreated({ code: 'start_not_received', message: '', paymentId: null, terminal: null });\n return;\n }\n // The grace is over and the service still says \"none\": never claim \"nothing was charged\" on this alone. Polling stops, the marker stays, the payer is asked to check again.\n this.recoveryExpired.set(true);\n this.stopPolling();\n return;\n }\n }\n this.schedulePoll();\n }\n\n /**\n * \"Check again\" of an unconfirmed payment (`recoveryExpired`): reads the attempt key once more. Found: followed like any payment. Still none (the grace is over): the attempt is released and the payer may start again (the same key is\n * idempotent at the service). A failed read changes nothing (connection lost) and the payer can check again.\n */\n async recheck(): Promise<void> {\n if (this.disposed || this.phase() !== 'recovering' || !this.recoveryExpired() || this.polling || this.rechecking()) return;\n this.explicitCheck = true;\n this.rechecking.set(true);\n this.stopPolling();\n try { await this.pollOnce(this.pollGen); } finally { this.explicitCheck = false; this.rechecking.set(false); }\n }\n\n private setConnectionLost(lost: boolean): void {\n if (this.connectionLost() === lost) return;\n this.connectionLost.set(lost);\n this.emit({ kind: lost ? 'connection-lost' : 'connection-restored' });\n }\n\n // ── Applying what the service says ──────────────────────────────────────\n\n /** Applies a payment answer (a start / read / retry answer). Only an OPEN phase follows it: a late answer after a final state changes nothing. */\n private apply(payment: StripeReaderPayment): void {\n if (this.disposed || FINAL.includes(this.phase())) return;\n this.payment.set(payment);\n if (payment.cardSave) this.cardSave.set(payment.cardSave);\n const status = String(payment.status ?? '').toUpperCase();\n const t = payment.terminal ?? null;\n if (status === 'SUCCEEDED' || t?.state === 'succeeded') { this.settle('succeeded'); return; }\n if (status === 'CANCELED' || t?.state === 'canceled') { this.settle('canceled'); return; }\n if (status === 'FAILED') { this.settle('failed'); return; }\n this.recoveryExpired.set(false);\n this.checking.set(!!t && (isTerminalChecking(t.state) || t.stale === true));\n this.readerOffline.set(!!t && t.readerOnline === false);\n // While a cancel or a retry runs, a poll answer never moves the phase (a decline read meanwhile would show \"Try again\" while the retry request is still in flight); a final state (succeeded / canceled / failed) still settles above.\n const busyOp = this.phase() === 'cancelling' || this.phase() === 'retrying';\n if (t?.state === 'declined') { if (!busyOp) { const was = this.phase(); this.phase.set('declined'); if (was !== 'declined') this.emit({ kind: 'declined', payment }); } return; }\n if (t?.state === 'failed') { if (!busyOp) this.phase.set('stopped'); return; }\n // waiting, unknown (still checking) or no terminal object: the reader waits\n if (!busyOp) this.phase.set('waiting');\n }\n\n private settle(phase: 'succeeded' | 'canceled' | 'failed'): void {\n const payment = this.payment();\n this.stopPolling();\n this.stopTick();\n this.checking.set(false);\n this.connectionLost.set(false);\n this.readerOffline.set(false);\n this.cancelUnreachable.set(false);\n this.recoveryExpired.set(false);\n this.phase.set(phase);\n if (phase === 'succeeded') {\n const key = this.attemptKey() ?? this.o.attempt.key();\n this.o.attempt.succeed('reader');\n if (payment) this.emit({ kind: 'succeeded', payment, attemptKey: key });\n } else {\n this.o.attempt.fail(phase);\n this.emit({ kind: phase, payment });\n }\n }\n\n // ── Retry and cancel ────────────────────────────────────────────────────\n\n /** After a decline (or a stop): sends the SAME payment to the reader again. Never creates a payment. */\n async retry(): Promise<void> {\n const retry = this.o.retry();\n const id = this.payment()?.id;\n if (this.disposed || !retry || !id || !this.retryable()) return;\n this.before = this.phase();\n this.phase.set('retrying');\n this.refusal.set(null);\n this.stopPolling();\n try {\n const answer = await this.call(() => retry(id));\n if (this.disposed) return;\n if (answer && typeof answer.id === 'string') { this.phase.set(this.before); this.apply(answer); } else { this.phase.set(this.before); }\n this.schedulePoll();\n } catch (error) {\n if (this.disposed) return;\n const info = readerErrorInfo(error);\n this.phase.set(this.before);\n // The payment is not open any more (a tap or a cancel happened meanwhile): read it, show its real state.\n if (info.code === 'terminal_not_retryable') { this.refuse(toRefusal(info)); this.pollNow(); return; }\n this.refuse(toRefusal(info.code ? info : { ...info, code: 'retry_unreachable' }));\n this.schedulePoll();\n }\n }\n\n /**\n * Cancels the payment at the service. Resolves true only when the service confirmed the cancel (or already reports the payment canceled). While it runs the payment is `cancelling`; when the\n * service cannot reach the reader or the processor (503 `reader_unreachable`, a lost connection) the payment STAYS open, `cancelUnreachable` is set and the payer may cancel again.\n */\n cancel(): Promise<boolean> {\n if (this.cancelRun) return this.cancelRun;\n const cancel = this.o.cancel();\n const id = this.payment()?.id;\n if (this.disposed || !cancel || !id || !(this.cancellable() || (this.phase() === 'cancelling'))) return Promise.resolve(this.phase() === 'canceled');\n this.cancelRun = this.runCancel(cancel, id).finally(() => { this.cancelRun = null; });\n return this.cancelRun;\n }\n\n private async runCancel(cancel: StripeReaderCancelFn, id: string): Promise<boolean> {\n this.before = this.phase() === 'cancelling' ? this.before : this.phase();\n this.phase.set('cancelling');\n this.cancelUnreachable.set(false);\n this.refusal.set(null);\n this.stopPolling();\n try {\n await this.call(() => cancel(id));\n if (this.disposed) return false;\n this.settle('canceled');\n return true;\n } catch (error) {\n if (this.disposed) return false;\n const info = readerErrorInfo(error);\n this.phase.set(this.before);\n if (info.code === 'payment_being_sent') {\n // The payment is still being sent to the reader: nothing could be canceled yet. Say so (\"wait a moment, then cancel again\"); the poll keeps following it. The service's instruction is `replay_attempt_key`, but a\n // second start is never sent from here: the payment is already known, and the poll (by attempt key) shows its real state. The id of the payment being cancelled is the one already known (a different id in the body is ignored).\n this.refuse(toRefusal(info));\n this.schedulePoll();\n return false;\n }\n if (info.status === 409 && info.code !== 'reader_unreachable') {\n // A tap that already happened (or races the cancel) is recorded as the payment: read the truth now.\n this.pollNow();\n return false;\n }\n this.cancelUnreachable.set(true);\n this.schedulePoll();\n return false;\n }\n }\n\n /** Runs one host call raced against the request timeout: a call that never answers cannot lock the flow forever. A late answer after the timeout is ignored (the next poll reads the truth). */\n private async call<T>(thunk: () => HostResult<T>): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<never>((_, reject) => {\n timer = setTimeout(() => reject(Object.assign(new Error('request timeout'), { status: null, code: '' })), Math.max(1, this.o.requestTimeoutMs?.() ?? STRIPE_READER_REQUEST_TIMEOUT_MS));\n });\n return await Promise.race([callHost(thunk), timeout]);\n } finally { if (timer) clearTimeout(timer); }\n }\n\n /** From `canceled` / `failed`: back to a fresh start (a NEW key, the attempt machine already renewed it). */\n reset(): void {\n if (this.disposed || !(['canceled', 'failed'] as StripeReaderPhase[]).includes(this.phase())) return;\n this.phase.set('idle');\n this.payment.set(null);\n this.refusal.set(null);\n this.cardSave.set(null);\n this.attemptKey.set(null);\n this.elapsedMs.set(0);\n }\n\n /** The input of the last start (the screen re-sends it after \"Start again\"). */\n lastStartInput(): StripeReaderStartInput | null { return this.startInput(); }\n\n // ── Elapsed time ────────────────────────────────────────────────────────\n\n private startTick(): void {\n this.stopTick();\n this.tickTimer = setInterval(() => this.elapsedMs.set(Math.max(0, this.now() - this.startedAt)), 1000);\n }\n\n private stopTick(): void {\n if (this.tickTimer) { clearInterval(this.tickTimer); this.tickTimer = null; }\n }\n\n /** The screen is gone: timers stop. Nothing is cancelled here (the screen decides; a payment that is open stays open at the service and is found again by its attempt key). */\n dispose(): void {\n this.disposed = true;\n this.stopPolling();\n this.stopTick();\n }\n}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject, input, output } from '@angular/core';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent, UiLabelsService, type UiLabelKey } from '@forgeroute/ui/core';\nimport { LiveRegionComponent } from '@forgeroute/ui/live-region';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { readerDegraded, readerDisplayName, type StripeReaderReadiness, type StripeReaderReadinessState } from './stripe-reader.models';\n\n/**\n * The state the banner shows: the service's single readiness state, `loading` while a first read runs, `checking` when there is no usable answer (the read failed, was slow, or the service could not tell), and `attention` when the service says the payment account\n * needs attention. The component NEVER produces a state named `unknown` (the type keeps the member only because the readiness INPUT may carry it).\n */\nexport type StripeReaderBannerState = StripeReaderReadinessState | 'loading' | 'checking' | 'attention';\n\n/**\n * The ONE card-reader banner. It is rendered from the service's single readiness `state` (never from several flags), so a payment screen can never show two reader messages at once:\n *\n * - `merchant_not_ready`: payments are not set up (action: open payment setup); with the reason `reconnect_required` the payment account must be reconnected (\"Reconnect payments\", the same `openSetup` output: the host opens the place where the account is set up / reconnected);\n * - `no_reader` / `unsupported_only`: \"No card reader set up\" with the ONE action \"Get a card reader\" / \"How to get a card reader\" (the host opens its order flow or an info card);\n * - `reader_busy`: \"A payment is waiting on <reader>\" (+ \"Cancel that payment\" when the payment is this screen's own);\n * - `reader_offline`: \"Card reader not connected\" + \"Connect Your Reader\" + \"Check again\";\n * - `checking`: there is no usable answer (the check failed, was too slow, or the service could not tell; nothing is guessed): \"Checking the card reader\" + \"Check again\"; when the service says WHY and it will not fix itself (`degradedReason` `reconnect_required` / `processor_refused`) the state is `attention`: the payment account needs attention (+ \"Reconnect payments\"). There is no state named `unknown`;\n * - `reader_ready`: no banner (a polite announcement only).\n *\n * The component has no HTTP: the host reads the readiness (see `ui-stripe-reader-payment` / `ui-stripe-readers`) and passes it in; the buttons are outputs.\n *\n * <ui-stripe-reader-status [readiness]=\"readiness()\" [loading]=\"loading()\" (connectReader)=\"openPairing()\" (getReader)=\"openOrder()\" (recheck)=\"reload()\" />\n */\n@Component({\n selector: 'ui-stripe-reader-status',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [AlertComponent, ButtonComponent, LiveRegionComponent, SkeletonComponent],\n template: `\n <ui-live-region data-testid=\"reader-status-live\" [message]=\"liveText()\" />\n @switch (state()) {\n @case ('loading') {\n <div class=\"srs-loading\" data-testid=\"reader-status-loading\" [attr.aria-busy]=\"'true'\">\n <ui-skeleton [height]=\"44\" [ariaLabel]=\"labels.t('stripeReader.status.loading')\" />\n </div>\n }\n @case ('reader_ready') { }\n @default {\n <ui-alert [variant]=\"variant()\" [title]=\"title()\" [quiet]=\"true\" class=\"srs-alert\" data-testid=\"reader-status\" [attr.data-state]=\"state()\">\n <p class=\"srs-text\" data-testid=\"reader-status-text\">{{ text() }}</p>\n <div class=\"srs-actions\">\n @if (state() === 'no_reader' || state() === 'unsupported_only') {\n <!-- no reader yet: the ONLY action is how to get one -->\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-status-get\" (click)=\"getReader.emit()\">{{ labels.t(hardwareShopAvailable() ? 'stripeReader.status.get' : 'stripeReader.status.getInfo') }}</ui-button>\n }\n @if (state() === 'merchant_not_ready' || attention()) {\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-status-setup\" (click)=\"openSetup.emit()\">{{ labels.t(reconnect() || attention() ? 'stripeReader.status.reconnect' : 'stripeReader.status.setup') }}</ui-button>\n }\n @if (state() === 'reader_offline' && !hideConnect()) {\n <!-- a reader exists but is not connected: connecting it again is one click -->\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-status-connect\" (click)=\"connectReader.emit()\">{{ labels.t('stripeReader.status.connectYours') }}</ui-button>\n }\n @if (state() === 'reader_offline' || state() === 'checking' || state() === 'attention') {\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-status-recheck\" (click)=\"recheck.emit()\">{{ labels.t('stripeReader.status.recheck') }}</ui-button>\n }\n @if (state() === 'reader_busy') {\n @if (ownBusyPaymentId()) {\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-status-cancel\" [loading]=\"cancelling()\" [disabled]=\"cancelling()\" (click)=\"cancelBusy.emit(ownBusyPaymentId()!)\">{{ labels.t('stripeReader.status.cancelBusy') }}</ui-button>\n }\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-status-recheck\" (click)=\"recheck.emit()\">{{ labels.t('stripeReader.status.recheck') }}</ui-button>\n }\n @if (showManual()) {\n <ui-button variant=\"ghost\" size=\"sm\" data-testid=\"reader-status-manual\" (click)=\"manual.emit()\">{{ labels.t('stripeReader.status.manual') }}</ui-button>\n }\n </div>\n </ui-alert>\n }\n }\n `,\n styles: [`\n ui-stripe-reader-status { display: block; min-width: 0; }\n ui-stripe-reader-status .srs-text { margin: 0 0 8px; }\n ui-stripe-reader-status .srs-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n `],\n})\nexport class StripeReaderStatusComponent {\n protected readonly labels = inject(UiLabelsService);\n\n /** The service's last readiness answer (`null` = none yet or the read failed). */\n readonly readiness = input<StripeReaderReadiness | null>(null);\n /** A read is running and there is no answer to show yet: a skeleton. */\n readonly loading = input(false);\n /** The id of a payment THIS screen started and that holds the reader: the banner then offers \"Cancel that payment\". */\n readonly ownBusyPaymentId = input<string | null>(null);\n /** That cancel is running. */\n readonly cancelling = input(false);\n /** Adds \"Take a manual payment instead\" (a payment screen that has a manual path). */\n readonly showManual = input(false);\n /** Hides \"Connect Your Reader\" (the pairing screen itself shows the banner). */\n readonly hideConnect = input(false);\n /**\n * Library source 2026-11-21 (additive). `true` (default): \"Get a card reader\" opens the host's order flow. `false`: the account cannot order readers in the app, the button reads \"How to get a card reader\" and the host\n * opens an info card instead (the same `getReader` output).\n */\n readonly hardwareShopAvailable = input(true);\n\n /** \"Connect Your Reader\" (`reader_offline`): the host opens its pairing panel (`ui-stripe-readers`). */\n readonly connectReader = output<void>();\n /** \"Get a card reader\": the host opens its order flow. */\n readonly getReader = output<void>();\n /** \"Check again\". */\n readonly recheck = output<void>();\n /** \"Set up payments\": the host opens payment setup. */\n readonly openSetup = output<void>();\n /** \"Cancel that payment\" (the payment id). */\n readonly cancelBusy = output<string>();\n /** \"Take a manual payment instead\". */\n readonly manual = output<void>();\n\n /** Which banner: no answer and loading = `loading`; no answer and not loading = `checking`; a service `checking` (old name `unknown`) = `attention` (reason that will not fix itself) or `checking`; else the service's state. Never `unknown`. */\n readonly state = computed((): StripeReaderBannerState => {\n const r = this.readiness();\n if (!r) return this.loading() ? 'loading' : 'checking';\n if (r.state === 'checking' || r.state === 'unknown') return readerDegraded({ state: 'checking', stale: true, degradedReason: r.degradedReason })?.kind === 'attention' ? 'attention' : 'checking'; // `unknown` = the old name, accepted\n return r.state;\n });\n\n protected readonly variant = computed(() => (this.state() === 'no_reader' || this.state() === 'unsupported_only' || this.state() === 'reader_busy' ? 'info' : 'warning'));\n\n private readonly busyName = computed(() => {\n const r = this.readiness();\n const reader = r?.readers.find(x => x.busy) ?? r?.readers.find(x => x.id === r.defaultReaderId) ?? null;\n return reader ? readerDisplayName(reader) : this.labels.t('stripeReader.theReader');\n });\n\n /** `merchant_not_ready` because the payment account must be reconnected (the service's `reason`). Any other merchant status (onboarding, disconnected...) is \"not set up\". */\n protected readonly reconnect = computed(() => this.state() === 'merchant_not_ready' && this.readiness()?.reason === 'reconnect_required');\n /** The service could not read the processor for a reason that will not fix itself (`reconnect_required`, `processor_refused`): the account needs attention. Transient reasons (and none) stay \"checking, check again\". */\n protected readonly attention = computed(() => this.state() === 'attention');\n /** The label group of the banner: the state, or a more exact one for a reconnect / attention case. */\n private readonly textKey = computed(() => (this.reconnect() ? 'reconnect_required' : this.attention() ? 'stale_attention' : this.state()));\n\n protected readonly title = computed(() => this.labels.t(`stripeReader.status.${this.textKey()}.title` as UiLabelKey));\n protected readonly text = computed(() => this.labels.t(`stripeReader.status.${this.textKey()}.text` as UiLabelKey, { reader: this.busyName() }));\n\n /** What the polite region says: the banner's title (a change of state is announced), \"ready\" for a ready reader, nothing while loading. */\n protected readonly liveText = computed(() => {\n const state = this.state();\n if (state === 'loading') return '';\n if (state === 'reader_ready') {\n const r = this.readiness();\n const reader = r?.readers.find(x => x.id === r.defaultReaderId) ?? r?.readers.find(x => x.supported && x.status === 'online' && !x.busy);\n return this.labels.t('stripeReader.status.reader_ready.live', { reader: reader ? readerDisplayName(reader) : this.labels.t('stripeReader.theReader') });\n }\n return `${this.title()}. ${this.text()}`;\n });\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, ViewEncapsulation, afterNextRender, computed, effect, inject, input, isDevMode, output, signal, untracked } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent, UiLabelsService, type UiLabelKey } from '@forgeroute/ui/core';\nimport { CheckboxComponent } from '@forgeroute/ui/checkbox';\nimport { IconComponent } from '@forgeroute/ui/icon';\nimport { LiveRegionComponent } from '@forgeroute/ui/live-region';\nimport { SelectComponent } from '@forgeroute/ui/select';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { PAYMENT_ATTEMPT_STORAGE, PaymentAttempt, builtInReadinessReasons, callHost, type PaymentAllocation } from '@forgeroute/ui/payments';\nimport { formatCurrency } from '@forgeroute/ui/utils';\nimport type { StripeFees } from '../payment-stripe-method/payment-stripe-method.models';\nimport { STRIPE_READER_LOST_ANSWER_GRACE_MS, STRIPE_READER_REQUEST_TIMEOUT_MS, StripeReaderFlow, type StripeReaderFlowEvent } from './stripe-reader.flow';\nimport { StripeReaderStatusComponent } from './stripe-reader-status.component';\nimport {\n clampReaderPollMs, formatElapsed, isReaderFree, isSafeReceiptUrl, normalizeReadiness, paymentChargedAmount, readerDegraded, readerDisplayName, readerErrorInfo, readerRefusalLabelKey,\n type StripeReaderCancelFn, type StripeReaderFeesFn, type StripeReaderGetPaymentFn, type StripeReaderGetReadinessFn, type StripeReaderPayment, type StripeReaderReadiness,\n type StripeReaderReadinessState, type StripeReaderRetryFn, type StripeReaderSaveCard, type StripeReaderStartFn,\n} from './stripe-reader.models';\n\n/** The readiness states the panel's top banner speaks for: no usable card reader, or a reader that is not connected (\"Your card reader is not connected.\" + \"Connect Your Reader\"). */\nconst STRIPE_READER_NO_READER_STATES: readonly StripeReaderReadinessState[] = ['no_reader', 'unsupported_only', 'merchant_not_ready', 'reader_offline'];\n\n/** What `(succeeded)` reports. */\nexport interface StripeReaderSucceededEvent {\n payment: StripeReaderPayment;\n attemptKey: string;\n /** The amount the payment was STARTED with (major units, before fees). */\n amount: number;\n readerId: string;\n}\n\n/** What `(outcome)` reports, for a host that wants to word a toast or log (the component never toasts). */\nexport type StripeReaderOutcome =\n | { kind: 'started'; payment: StripeReaderPayment }\n | { kind: 'declined'; payment: StripeReaderPayment }\n | { kind: 'canceled' }\n | { kind: 'failed' }\n | { kind: 'refused'; code: string }\n | { kind: 'connection-lost' }\n | { kind: 'connection-restored' }\n /** The panel was closed while the answer of the start was still on its way / lost: the payment is looked up again when the screen opens. The host may word it (\"We are still confirming your payment\"). */\n | { kind: 'left-pending' };\n\n/**\n * Takes a card payment on a Stripe smart reader (S700, S710, WisePOS E): the card reader flow of the payment screen. The HOST owns the calls (it calls its own backend, which calls the\n * payments service; the browser never talks to the service), the component owns the screen and the flow ({@link StripeReaderFlow}):\n *\n * 1. it reads the readiness (ONE state, see `ui-stripe-reader-status`) now and every `readinessEveryMs`, and shows the ONE banner when the reader cannot be used;\n * 2. with `reader_ready` it shows the reader, the amount and the card-reader FEE quote (`estimateFees`, method CARD_PRESENT: cleared at once when the amount changes, \"Send to the reader\"\n * stays off until the quote for the current amount is here), the optional \"Save this card\" consent and \"Send to the reader\";\n * 3. while a payment waits: \"Waiting for the customer to tap, insert or swipe their card on <reader>\", the amount, the fees, the elapsed time and ONLY \"Cancel payment\";\n * 4. a decline shows \"Card declined\" with \"Try again\" (the SAME payment) / \"Cancel payment\" / \"Take a manual payment instead\"; a success shows the receipt link and whether the card was saved.\n *\n * Nothing else can start a payment while one is open (every start button is off, a double click and a second tab are refused by the attempt machine), the attempt key is stable per click and\n * REUSED when the answer is lost, and a lost connection never changes the state shown: the payment is read again by its attempt key when the connection is back. Offline / slow connections\n * block \"Send to the reader\" before it starts (payments are never queued). A manual payment is always one click away (`(manual)`).\n *\n * <ui-stripe-reader-payment [amount]=\"amount()\" payableRef=\"unit:42\" [getReadiness]=\"readiness\" [startPayment]=\"start\" [getPayment]=\"read\" [retryPayment]=\"retry\" [cancelPayment]=\"cancel\"\n * [estimateFees]=\"fees\" (manual)=\"useManual()\" (connectReader)=\"openPairing()\" (getReader)=\"openOrder()\" (succeeded)=\"onPaid($event)\" />\n */\n@Component({\n selector: 'ui-stripe-reader-payment',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [FormsModule, NgTemplateOutlet, AlertComponent, ButtonComponent, CheckboxComponent, IconComponent, LiveRegionComponent, SelectComponent, SkeletonComponent, StripeReaderStatusComponent],\n template: `\n <ui-live-region data-testid=\"reader-live\" [message]=\"announcement()\" />\n @if (blockReason(); as reason) {\n @if (showBlocked()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-blocked\" [attr.data-reason]=\"reason\">{{ blockText() }}</ui-alert>\n }\n } @else if (showReadiness()) {\n <ui-stripe-reader-status [readiness]=\"shownReadiness()\" [loading]=\"readinessLoading() && !readiness()\" [ownBusyPaymentId]=\"busyOwnPaymentId()\" [cancelling]=\"cancellingBusy()\"\n [hideConnect]=\"false\"\n (connectReader)=\"connectReader.emit()\" (getReader)=\"getReader.emit()\" (recheck)=\"loadReadiness()\" (openSetup)=\"openSetup.emit()\" (cancelBusy)=\"cancelBusy($event)\" />\n }\n\n @if (active()) {\n @if (closeBlocked() && flow.locked()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-close-blocked\">{{ labels.t('stripeReader.closeBlocked') }}</ui-alert>\n }\n\n @switch (flow.phase()) {\n @case ('starting') {\n <section class=\"srp-box srp-focus\" data-testid=\"reader-starting\" tabindex=\"-1\" [attr.aria-busy]=\"'true'\">\n <ui-skeleton [height]=\"44\" [ariaLabel]=\"labels.t('stripeReader.starting')\" />\n <p class=\"srp-text\">{{ labels.t('stripeReader.startingText') }}</p>\n @if (waitAmount(); as shown) { <p class=\"srp-text\" data-testid=\"reader-wait-amount\">{{ shown }}</p> }\n <p class=\"srp-elapsed\" data-testid=\"reader-leave-hint\">{{ labels.t('stripeReader.leaveHint') }}</p>\n </section>\n }\n @case ('succeeded') {\n <ui-alert variant=\"success\" [title]=\"labels.t('stripeReader.done.title')\" data-testid=\"reader-succeeded\" tabindex=\"-1\" class=\"srp-focus\">\n <p class=\"srp-text\" data-testid=\"reader-succeeded-text\">{{ succeededText() }}</p>\n @if (cardLine(); as card) { <p class=\"srp-text\" data-testid=\"reader-succeeded-card\">{{ card }}</p> }\n @if (cardSaveText(); as note) { <p class=\"srp-text\" data-testid=\"reader-card-save\" [attr.data-saved]=\"flow.cardSave()?.saved ? 'true' : 'false'\">{{ note }}</p> }\n @if (receiptHref(); as href) {\n <p class=\"srp-text\"><a [href]=\"href\" target=\"_blank\" rel=\"noopener noreferrer\" data-testid=\"reader-receipt\">{{ labels.t('stripeReader.receipt') }}<span class=\"srp-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span></a></p>\n }\n </ui-alert>\n @if (feeRows().length) { <ng-container [ngTemplateOutlet]=\"feeTable\" /> }\n }\n @case ('canceled') {\n <ui-alert variant=\"info\" [title]=\"labels.t('stripeReader.canceled.title')\" data-testid=\"reader-canceled\" tabindex=\"-1\" class=\"srp-focus\">\n <p class=\"srp-text\">{{ labels.t('stripeReader.canceled.text') }}</p>\n <div class=\"srp-actions\">\n @if (manualAvailable()) { <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-take-manual\" (click)=\"manual.emit()\">{{ labels.t('stripeReader.takeManual') }}</ui-button> }\n <ui-button [variant]=\"manualAvailable() ? 'secondary' : 'primary'\" size=\"sm\" data-testid=\"reader-start-again\" (click)=\"startAgain()\">{{ labels.t('stripeReader.startAgain') }}</ui-button>\n </div>\n </ui-alert>\n }\n @case ('failed') {\n <ui-alert variant=\"danger\" [title]=\"labels.t('stripeReader.failed.title')\" data-testid=\"reader-failed\" tabindex=\"-1\" class=\"srp-focus\">\n <p class=\"srp-text\">{{ labels.t('stripeReader.failed.text') }}</p>\n <div class=\"srp-actions\">\n @if (manualAvailable()) { <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-take-manual\" (click)=\"manual.emit()\">{{ labels.t('stripeReader.takeManual') }}</ui-button> }\n <ui-button [variant]=\"manualAvailable() ? 'secondary' : 'primary'\" size=\"sm\" data-testid=\"reader-start-again\" (click)=\"startAgain()\">{{ labels.t('stripeReader.startAgain') }}</ui-button>\n </div>\n </ui-alert>\n }\n @case ('idle') {\n <section class=\"srp-box\" data-testid=\"reader-ready-section\">\n @switch (idleNotice()) {\n @case ('paid') {\n <ui-alert variant=\"info\" [quiet]=\"true\" data-testid=\"reader-paid\">{{ labels.t('stripeReader.refusal.paid') }}</ui-alert>\n }\n @case ('pending-other') {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-pending-other\">{{ labels.t('stripeReader.refusal.outcome_checking') }}</ui-alert>\n }\n @case ('cancel-timeout') {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-cancel-busy-timeout\">{{ labels.t('stripeReader.cancelBusy.timeout') }}\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-cancel-busy-recheck\" (click)=\"dismissCancelTimeout()\">{{ labels.t('stripeReader.status.recheck') }}</ui-button>\n </ui-alert>\n }\n @case ('quote-changed') {\n @if (flow.refusal(); as refusal) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-refusal\" [attr.data-code]=\"refusal.code\">{{ refusalText() }}</ui-alert>\n }\n <div class=\"srp-actions\" role=\"group\" data-testid=\"reader-quote-changed\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-confirm-total\" [disabled]=\"quoting()\" (click)=\"confirmNewTotal()\">{{ labels.t('stripeReader.confirmTotal', { amount: confirmTotalText() }) }}</ui-button>\n </div>\n }\n @case ('refusal') {\n @if (flow.refusal(); as refusal) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-refusal\" [attr.data-code]=\"refusal.code\">{{ refusalText() }}\n @if (existingPaymentHref(); as href) {\n <a [href]=\"href\" target=\"_blank\" rel=\"noopener noreferrer\" data-testid=\"reader-existing-payment\">{{ labels.t('stripeReader.refusal.viewExisting') }}<span class=\"srp-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span></a>\n }\n </ui-alert>\n }\n }\n }\n @if (ready() && !blockReason()) {\n @if (freeReaders().length > 1) {\n <ui-select [label]=\"labels.t('stripeReader.selectReader')\" [options]=\"readerOptions()\" [ngModel]=\"readerId()\" (ngModelChange)=\"selectedReaderId.set($event ?? '')\" data-testid=\"reader-select\" />\n } @else {\n <p class=\"srp-text\" data-testid=\"reader-name\">{{ labels.t('stripeReader.readerLine', { reader: readerName() }) }}</p>\n }\n @if (amount() == null) {\n <p class=\"srp-text\" data-testid=\"reader-amount-needed\">{{ labels.t('stripePaymentMethod.amountNeeded') }}</p>\n }\n @if (feesMissing()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-fees-unavailable\">{{ labels.t('stripeReader.fees.unavailable') }}</ui-alert>\n } @else if (quoteFailed()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-fees-failed\">{{ labels.t('stripeReader.fees.failed') }}\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-fees-retry\" (click)=\"retryQuote()\">{{ labels.t('common.tryAgain') }}</ui-button>\n </ui-alert>\n } @else if (quoting()) {\n <p class=\"srp-text\" data-testid=\"reader-fees-loading\" role=\"status\">{{ labels.t('stripeReader.fees.loading') }}</p>\n }\n @if (feeRows().length) { <ng-container [ngTemplateOutlet]=\"feeTable\" /> }\n @if (saveCard() && !saveUnavailable()) {\n <ui-checkbox [label]=\"labels.t('stripeReader.saveCard.label')\" [hint]=\"consentText()\" [checked]=\"saveChecked()\" (checkedChange)=\"onSaveChange($event)\" testId=\"reader-save-card\" />\n }\n <div class=\"srp-actions\">\n <ui-button variant=\"primary\" data-testid=\"reader-start\" [disabled]=\"!canStart()\" (click)=\"start()\">{{ startLabel() }}</ui-button>\n </div>\n }\n @if (manualAvailable()) {\n <div class=\"srp-actions\">\n <ui-button variant=\"link\" data-testid=\"reader-manual\" (click)=\"manual.emit()\">{{ labels.t('stripeReader.manualInstead') }}</ui-button>\n </div>\n }\n </section>\n }\n @default {\n <!-- Focus lands on this box when it appears; it has NO role and NO accessible name on purpose: the polite live region announces the title and the text, a labelled group would read them a second time. -->\n <section class=\"srp-wait\" data-testid=\"reader-waiting\" [attr.data-phase]=\"flow.phase()\" tabindex=\"-1\">\n <div class=\"srp-wait-head\">\n <span class=\"srp-pulse\" aria-hidden=\"true\" data-testid=\"reader-indicator\"><ui-icon name=\"card\" [size]=\"22\" [interactive]=\"false\" /></span>\n <h3 class=\"srp-title\" data-testid=\"reader-wait-title\">{{ waitTitle() }}</h3>\n </div>\n <p class=\"srp-text\" data-testid=\"reader-wait-text\">{{ waitText() }}</p>\n @if (waitAmount(); as shown) { <p class=\"srp-text\" data-testid=\"reader-wait-amount\">{{ shown }}</p> }\n @if (flow.phase() === 'recovering') { <p class=\"srp-elapsed\" data-testid=\"reader-leave-hint\">{{ labels.t('stripeReader.leaveHint') }}</p> }\n\n @if (flow.connectionLost()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-connection-lost\">{{ labels.t('stripeReader.connectionLost') }}</ui-alert>\n }\n @if (flow.readerOffline() && !flow.connectionLost()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-disconnected\">{{ labels.t('stripeReader.readerDisconnected') }}</ui-alert>\n }\n @if (flow.checking() && !flow.connectionLost()) {\n <ui-alert [variant]=\"degraded()?.kind === 'transient' ? 'info' : 'warning'\" [quiet]=\"true\" data-testid=\"reader-still-checking\" [attr.data-kind]=\"degraded()?.kind ?? 'transient'\">{{ checkingText() }}</ui-alert>\n }\n @if (flow.cancelUnreachable()) {\n <ui-alert variant=\"danger\" [quiet]=\"true\" data-testid=\"reader-cancel-unreachable\">{{ labels.t('stripeReader.cancelUnreachable') }}</ui-alert>\n }\n @if (flow.refusal(); as refusal) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-refusal\" [attr.data-code]=\"refusal.code\">{{ refusalText() }}</ui-alert>\n }\n @if (feeRows().length) { <ng-container [ngTemplateOutlet]=\"feeTable\" /> }\n <p class=\"srp-elapsed\" data-testid=\"reader-elapsed\">{{ labels.t('stripeReader.elapsed', { time: elapsedText() }) }}</p>\n <div class=\"srp-actions\">\n @if (flow.phase() === 'recovering' && flow.recoveryExpired()) {\n <ui-button variant=\"primary\" data-testid=\"reader-recheck\" [loading]=\"flow.rechecking()\" [disabled]=\"flow.rechecking()\" (click)=\"recheck()\">{{ labels.t('stripeReader.status.recheck') }}</ui-button>\n }\n @if (flow.retryable()) {\n <ui-button variant=\"primary\" data-testid=\"reader-retry\" (click)=\"retry()\">{{ labels.t('common.tryAgain') }}</ui-button>\n }\n @if (flow.cancellable() || flow.phase() === 'cancelling') {\n <ui-button [variant]=\"flow.retryable() ? 'secondary' : 'danger'\" data-testid=\"reader-cancel\" [loading]=\"flow.phase() === 'cancelling'\" [disabled]=\"flow.phase() === 'cancelling'\" (click)=\"cancelPayment()\">{{ labels.t('stripeReader.cancel') }}</ui-button>\n }\n @if (flow.retryable() && manualAvailable()) {\n <ui-button variant=\"ghost\" data-testid=\"reader-use-manual\" (click)=\"switchToManual()\">{{ labels.t('stripeReader.takeManual') }}</ui-button>\n }\n </div>\n </section>\n }\n }\n }\n\n <ng-template #feeTable>\n <dl class=\"srp-fees\" data-testid=\"reader-fees\" [attr.aria-label]=\"labels.t('stripePaymentStripeMethod.paymentTotal')\">\n @for (row of feeRows(); track row.key) {\n <div class=\"srp-fee\" [attr.data-testid]=\"'reader-fee-' + row.key\"><dt>{{ row.label }}</dt><dd>{{ row.value }}</dd></div>\n }\n </dl>\n </ng-template>\n `,\n styles: [`\n ui-stripe-reader-payment { display: block; min-width: 0; }\n ui-stripe-reader-payment .srp-box, ui-stripe-reader-payment .srp-wait { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; min-width: 0; }\n ui-stripe-reader-payment .srp-wait { padding: 16px; border: 2px solid var(--ui-psp-border, #cbd5e1); border-radius: 12px; background: var(--ui-psp-sunken, #f8fafc); }\n ui-stripe-reader-payment .srp-wait[data-phase='declined'], ui-stripe-reader-payment .srp-wait[data-phase='stopped'] { border-color: var(--ui-psp-danger, #b91c1c); }\n ui-stripe-reader-payment .srp-wait:focus { outline: none; }\n ui-stripe-reader-payment .srp-wait-head { display: flex; align-items: center; gap: 12px; }\n ui-stripe-reader-payment .srp-title { margin: 0; font-size: 1.0625rem; font-weight: 700; color: var(--ui-psp-text, #1e293b); }\n ui-stripe-reader-payment .srp-text, ui-stripe-reader-payment .srp-elapsed { margin: 0; font-size: 0.9375rem; color: var(--ui-psp-text, #1e293b); }\n ui-stripe-reader-payment .srp-elapsed { font-size: 0.8125rem; color: var(--ui-psp-muted, #475569); font-variant-numeric: tabular-nums; }\n ui-stripe-reader-payment .srp-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n ui-stripe-reader-payment .srp-focus:focus { outline: none; }\n ui-stripe-reader-payment .srp-pulse { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ui-psp-text, #1e293b); border: 2px solid currentColor; animation: srp-pulse 1.6s ease-in-out infinite; }\n ui-stripe-reader-payment .srp-fees { margin: 0; padding: 12px 14px; border: 1px solid var(--ui-psp-border, #e2e8f0); border-radius: 10px; font-size: 0.8125rem; }\n ui-stripe-reader-payment .srp-fee { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--ui-psp-muted, #475569); }\n ui-stripe-reader-payment .srp-fee dt, ui-stripe-reader-payment .srp-fee dd { margin: 0; }\n ui-stripe-reader-payment .srp-fee:last-child { font-weight: 700; color: var(--ui-psp-text, #1e293b); }\n ui-stripe-reader-payment .srp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }\n @keyframes srp-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.94); } }\n @media (prefers-reduced-motion: reduce) { ui-stripe-reader-payment .srp-pulse { animation: none; } }\n @media (forced-colors: active) { ui-stripe-reader-payment .srp-wait, ui-stripe-reader-payment .srp-fees { border-color: CanvasText; } }\n `],\n})\nexport class StripeReaderPaymentComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly storage = inject(PAYMENT_ATTEMPT_STORAGE);\n\n // ── Inputs: what is paid ─────────────────────────────────────────────────\n /** The amount the customer owes before fees, major units. `null` = nothing to take yet. */\n readonly amount = input<number | null>(null);\n readonly currency = input('USD');\n /** The payable (an invoice, a balance): the attempt marker is stored under it, so a reload or a second tab finds an open payment instead of starting another. */\n readonly payableRef = input<string | null>(null);\n /** A key the host supplies; empty = derived from the payable / generated by the attempt machine. */\n readonly attemptKey = input<string | null>(null);\n /** The payable is paid (host re-render): no payment can start. */\n readonly paid = input(false);\n /** Extra fields the host's backend wants with the start (the payment panel passes its date, note and allocation). */\n readonly startExtras = input<{ receivedDate?: string; notes?: string | null; allocation?: PaymentAllocation } | null>(null);\n\n // ── Inputs: the host's calls (see docs/card-readers.md) ─────────────────\n readonly getReadiness = input<StripeReaderGetReadinessFn | null>(null);\n readonly startPayment = input<StripeReaderStartFn | null>(null);\n readonly getPayment = input<StripeReaderGetPaymentFn | null>(null);\n readonly retryPayment = input<StripeReaderRetryFn | null>(null);\n readonly cancelPaymentFn = input<StripeReaderCancelFn | null>(null, { alias: 'cancelPayment' });\n /** The CARD_PRESENT fee quote. REQUIRED: a reader payment always shows the card reader fee breakdown before the tap, so without it \"Send to the reader\" stays off and says the fees are not available. */\n readonly estimateFees = input<StripeReaderFeesFn | null>(null);\n readonly receiptUrl = input<((payment: StripeReaderPayment) => string | null | undefined) | null>(null);\n /** Turns on \"Save this card for future payments\" (the consent the staff records at the counter). */\n readonly saveCard = input<StripeReaderSaveCard | null>(null);\n /** The id of an open reader payment THIS user owns (from the host's records): with it the \"reader busy\" banner offers \"Cancel that payment\". */\n readonly ownPaymentId = input<string | null>(null);\n\n // ── Inputs: behaviour ───────────────────────────────────────────────────\n /** `true` = the full reader screen; `false` = only the banner (the payment screen is in manual mode but still tells that a reader could be used). */\n readonly active = input(true);\n /** A manual payment path exists: \"Enter the card manually instead\" / \"Take a manual payment instead\" show and the offline text says a manual payment can still be recorded. */\n readonly manualAvailable = input(true);\n /** The buttons that start something do nothing (a read-only user). Cancel stays possible. */\n readonly disabled = input(false);\n /**\n * Library 2026-11-21 (additive; NOT set by the payment panel's Stripe body, so nothing in the library uses it): `true` draws NO \"checking\" placeholder while there is no usable answer (a usable answer, or a payment, is still drawn here).\n * It is for a host that shows its own checking text elsewhere. NOTE: `ui-stripe-reader-banner` (the payment panel's top banner) shows NOTHING while the read is pending, failed or `checking`, so with `hideChecking` nobody speaks for that state.\n * Default `false`: the screen shows its own checking state with \"Check again\" (also inside the payment panel).\n */\n readonly hideChecking = input(false);\n /**\n * Library 2026-11-21 (additive): the payment panel's top banner (`ctx.readerBanner`) is ALWAYS on screen and shows the \"get a card reader\" message when the organization has NO usable reader. With this input this screen draws no readiness banner for\n * those states (`no_reader`, `unsupported_only`, `merchant_not_ready`, and `reader_offline`: \"not connected\" + \"Connect Your Reader\") so the message never shows twice, and keeps everything else: its own \"checking\", busy (with \"Cancel that payment\"), connection notices, the reader choice, fees, \"Send to the reader\" and the\n * payment boxes. A standalone host that keeps `ui-stripe-reader-banner` above its tab bar passes it too. Default `false`.\n */\n readonly hideBanner = input(false);\n /** Asked right before \"Send to the reader\" starts anything; `false` = do not start (the payment panel validates its own fields here and shows their messages). */\n readonly beforeStart = input<(() => boolean) | null>(null);\n readonly readinessEveryMs = input(15_000);\n readonly readinessTimeoutMs = input(4000);\n /** How often the waiting payment's status is read (ms; default 2000). Clamped to 500..30 000 ms. */\n readonly pollMs = input(2000);\n readonly pollTimeoutMs = input(8000);\n /** After a lost start answer (or an adopted attempt) the service's \"no payment for this attempt key\" is believed only after this long, counted from the moment recovery starts. Default 6 minutes: the service's 5-minute create window plus a minute (ms). */\n readonly lostAnswerGraceMs = input(STRIPE_READER_LOST_ANSWER_GRACE_MS);\n /** A start / retry / cancel call slower than this is unreachable (ms): a start is looked up by its attempt key, a retry / cancel leaves the payment as it was. */\n readonly requestTimeoutMs = input(STRIPE_READER_REQUEST_TIMEOUT_MS);\n /** A quote slower than this: \"Try again\" is offered and Send stays off (ms). */\n readonly feeTimeoutMs = input(10_000);\n /** Managed environments where `navigator.onLine === false` is a false negative: the browser's offline flag does not block (default false). */\n readonly offlineOverride = input(false);\n\n // ── Outputs ─────────────────────────────────────────────────────────────\n /** The user wants to enter the card manually (the host switches its method). Emitted only when nothing is waiting on the reader. */\n readonly manual = output<void>();\n /** \"Connect Your Reader\": the host opens its pairing panel. */\n readonly connectReader = output<void>();\n /** \"Get a card reader\": the host opens its order flow. */\n readonly getReader = output<void>();\n /** \"Set up payments\": the host opens payment setup. */\n readonly openSetup = output<void>();\n /** The payment succeeded. */\n readonly succeeded = output<StripeReaderSucceededEvent>();\n /** Everything else that happened, for the host to word. */\n readonly outcome = output<StripeReaderOutcome>();\n /** A readiness read finished: its state (`null` = no answer / the read failed). The payment panel's FIRST answer decides whether the reader is the default. */\n readonly readinessChange = output<StripeReaderReadinessState | null>();\n /** A payment is open on the reader (starting, waiting, declined, cancelling...): the host locks everything else. */\n readonly busyChange = output<boolean>();\n\n // ── State ───────────────────────────────────────────────────────────────\n readonly readiness = signal<StripeReaderReadiness | null>(null);\n protected readonly readinessLoading = signal(false);\n readonly selectedReaderId = signal('');\n readonly saveChecked = signal(false);\n /** The card cannot be kept on this account (`terminal_save_needs_direct`): the choice is hidden, the payment can still be taken. */\n protected readonly saveUnavailable = signal(false);\n /** `quote_changed`: the total shown is not the total any more; Send stays off until the payer confirms the new one. */\n protected readonly quoteChanged = signal<{ total: number | null } | null>(null);\n readonly closeBlocked = signal(false);\n protected readonly cancellingBusy = signal(false);\n /** The \"Cancel that payment\" call did not answer in time: the payment may still be open (a notice with \"Check again\" shows instead of the banner). */\n protected readonly cancelTimedOut = signal(false);\n protected readonly quote = signal<StripeFees | null>(null);\n /** The amount the quote was asked for (a quote is shown only while it matches the amount on screen). */\n private readonly quotedFor = signal<number | null>(null);\n protected readonly quoting = signal(false);\n protected readonly quoteFailed = signal(false);\n private readonly quoteTick = signal(0);\n private quoteRun = 0;\n /** What the held quote was asked for: a phase change alone (a refusal, a canceled payment) keeps a held quote of the same amount; the service still checks the total (`quote_changed`). */\n private heldEstimate: unknown = null;\n private heldAmount: number | null | undefined = undefined;\n private heldTick = -1;\n private readonly builtIns = signal<string[]>([]);\n\n readonly attempt = new PaymentAttempt({\n destroyRef: this.destroyRef,\n payableRef: () => this.payableRef(),\n amount: () => this.amount(),\n method: () => 'CARD_PRESENT',\n attemptKey: () => this.attemptKey(),\n checkStatus: () => null,\n paid: () => this.paid(),\n offlineMidFlight: false,\n offlineOverride: () => this.offlineOverride(),\n storage: this.storage,\n });\n\n readonly flow = new StripeReaderFlow({\n attempt: this.attempt,\n start: () => this.startPayment(),\n getPayment: () => this.getPayment(),\n retry: () => this.retryPayment(),\n cancel: () => this.cancelPaymentFn(),\n pollMs: () => clampReaderPollMs(this.pollMs()),\n pollTimeoutMs: () => this.pollTimeoutMs(),\n lostAnswerGraceMs: () => this.lostAnswerGraceMs(),\n requestTimeoutMs: () => this.requestTimeoutMs(),\n onEvent: event => this.onFlowEvent(event),\n });\n\n /** The user pressed a button that changes the screen: when the phase changes, focus moves to the new box (the pressed button is gone). */\n private acted = false;\n private lastPhase = this.flow.phase();\n private destroyed = false;\n private readRun = 0;\n private readTimer: ReturnType<typeof setTimeout> | null = null;\n\n protected readonly ready = computed(() => this.readiness()?.state === 'reader_ready');\n protected readonly freeReaders = computed(() => (this.readiness()?.readers ?? []).filter(isReaderFree));\n protected readonly readerId = computed(() => {\n const free = this.freeReaders();\n const chosen = this.selectedReaderId();\n if (chosen && free.some(r => r.id === chosen)) return chosen;\n const def = this.readiness()?.defaultReaderId;\n if (def && free.some(r => r.id === def)) return def;\n return free[0]?.id ?? '';\n });\n protected readonly readerOptions = computed(() => this.freeReaders().map(r => ({ value: r.id, label: r.model && r.label ? `${readerDisplayName(r)} (${r.model})` : readerDisplayName(r) })));\n /** The name of the reader the payment is (or would be) on. */\n protected readonly readerName = computed(() => {\n const id = this.flow.terminal()?.readerId ?? this.readerId();\n const readers = this.readiness()?.readers ?? [];\n return readerDisplayName(readers.find(r => r.id === id) ?? null) || this.labels.t('stripeReader.theReader');\n });\n /** Why a reader payment cannot be started before it starts: offline, a slow connection, a browser that cannot pay safely. Empty = none. */\n protected readonly blockReason = computed((): '' | 'offline' | 'slow_connection' | 'unsupported_browser' => {\n if (this.attempt.blockedOffline()) return 'offline';\n const reasons = this.builtIns();\n if (reasons.includes('slow_connection')) return 'slow_connection';\n if (reasons.includes('unsupported_browser')) return 'unsupported_browser';\n return '';\n });\n protected readonly blockText = computed(() => {\n switch (this.blockReason()) {\n case 'offline': return this.labels.t(this.manualAvailable() ? 'stripeReader.offline.withManual' : 'stripeReader.offline.noManual');\n case 'slow_connection': return this.labels.t('paymentReadiness.slow_connection');\n case 'unsupported_browser': return this.labels.t('paymentReadiness.unsupported_browser');\n default: return '';\n }\n });\n /** No fee quote call: a reader payment must always show the CARD_PRESENT breakdown before the tap, so nothing can be sent. */\n protected readonly feesMissing = computed(() => !this.estimateFees());\n /**\n * The ONE message block of the idle screen, by precedence: already paid > an earlier payment still being confirmed > a cancel that timed out > the total changed > a refusal of the last start. The readiness banner and\n * the \"blocked\" notice show only when none of these does (and never in the canceled / failed boxes).\n */\n protected readonly idleNotice = computed((): 'paid' | 'pending-other' | 'cancel-timeout' | 'quote-changed' | 'refusal' | null => {\n if (!this.active() || this.flow.phase() !== 'idle') return null;\n if (this.attempt.paidLocked()) return 'paid';\n if (this.foreignPending()) return 'pending-other';\n if (this.cancelTimedOut()) return 'cancel-timeout';\n if (this.quoteChanged()) return 'quote-changed';\n if (this.flow.refusal()) return 'refusal';\n return null;\n });\n protected readonly showBlocked = computed(() => this.active() && this.flow.phase() === 'idle' && !this.idleNotice());\n /**\n * Library source 2026-11-21: this screen is showing a card reader message of its own right now (the readiness banner, a connection notice, one of the idle notices, or a payment box), so a second reader banner elsewhere\n * on the page must step aside. `false` when it shows nothing about the reader (a ready reader and an idle screen). Mirrors the template exactly (with `hideBanner` the no-reader states are not drawn here, so they do not count).\n */\n readonly ownsReaderMessage = computed(() => {\n if (this.flow.phase() !== 'idle' || this.flow.locked()) return true;\n if (this.idleNotice()) return true;\n if (this.blockReason()) return this.showBlocked();\n return this.showReadiness() && this.shownReadiness()?.state !== 'reader_ready';\n });\n /**\n * The readiness the banner is drawn from: a usable answer only. No answer (loading, failed, slow) and a service `checking` (old name `unknown`) that does not need the account's attention are NOT shown as a state of their own (there is no \"unknown\" banner): `null`, and the status component's \"Checking the card reader\" placeholder speaks (unless the host set `hideChecking`; the top banner never speaks for that state).\n */\n protected readonly shownReadiness = computed((): StripeReaderReadiness | null => {\n const r = this.readiness();\n if (!r) return null;\n if ((r.state === 'checking' || r.state === 'unknown') && readerDegraded({ state: 'checking', stale: true, degradedReason: r.degradedReason })?.kind !== 'attention') return null;\n return r;\n });\n protected readonly showReadiness = computed(() => {\n if (this.flow.locked() || this.flow.phase() === 'succeeded') return false;\n if (!this.shownReadiness() && this.hideChecking()) return false; // no usable answer: the panel's top banner speaks, nothing of our own\n if (this.hideBanner() && STRIPE_READER_NO_READER_STATES.includes(this.shownReadiness()?.state as StripeReaderReadinessState)) return false; // the top banner speaks for these states (get a reader / connect your reader)\n return this.active() ? this.flow.phase() === 'idle' && !this.idleNotice() : true;\n });\n /** The own payment that holds a reader, when the host knows it. */\n protected readonly busyOwnPaymentId = computed(() => {\n const id = this.ownPaymentId();\n return id && (this.readiness()?.readers ?? []).some(r => r.busyPaymentId === id) ? id : null;\n });\n private readonly amountValid = computed(() => { const a = this.amount(); return a != null && Number.isFinite(a) && a > 0; });\n /** The quote of the amount on screen (a quote for another amount is never shown). */\n protected readonly currentQuote = computed(() => (this.quotedFor() === this.amount() ? this.quote() : null));\n protected readonly feeRows = computed(() => {\n const fees = this.currentQuote();\n const amount = this.flow.locked() || this.flow.phase() === 'succeeded' ? (this.flow.baseAmount() ?? this.amount()) : this.amount();\n if (!fees || amount == null || (fees.stripeFee === undefined && fees.platformFee === undefined && fees.totalAmount === undefined)) return [];\n const money = (n: number) => formatCurrency(n, { currency: this.currency() });\n const rows: { key: string; label: string; value: string }[] = [{ key: 'amount', label: this.labels.t('stripePaymentMethod.paymentAmount'), value: money(amount) }];\n if (fees.stripeFee !== undefined) rows.push({ key: 'processing', label: `${this.labels.t('stripePaymentMethod.processingFee')}${fees.stripeFeeLabel ? ` (${fees.stripeFeeLabel})` : ''}`, value: money(fees.stripeFee) });\n if (fees.platformFee !== undefined) rows.push({ key: 'platform', label: `${this.labels.t('stripePaymentMethod.platformFee')}${fees.platformFeeLabel ? ` (${fees.platformFeeLabel})` : ''}`, value: money(fees.platformFee) });\n if (fees.totalAmount !== undefined) rows.push({ key: 'total', label: this.labels.t('stripePaymentStripeMethod.totalCharged'), value: money(fees.totalAmount) });\n return rows;\n });\n /** Everything that must be true before \"Send to the reader\" works. */\n readonly canStart = computed(() =>\n this.active() && this.ready() && !this.blockReason() && !!this.readerId() && this.amountValid() && !this.disabled() && !this.paid() && !this.flow.locked()\n && this.flow.phase() !== 'succeeded' && !this.attempt.locked() && !this.quoting() && !this.quoteFailed() && !this.feesMissing() && !!this.currentQuote() && !this.quoteChanged());\n protected readonly startLabel = computed(() => (this.amount() != null && this.amountValid()\n ? this.labels.t('stripeReader.start', { amount: formatCurrency(this.currentQuote()?.totalAmount ?? this.amount(), { currency: this.currency() }) })\n : this.labels.t('stripeReader.startNoAmount')));\n /** The sentence the staff attests by ticking the box (the host's `consentText`, else the library default) plus the fee clause when the payer pays fees. `saveCard.textVersion` must name exactly this text. */\n protected readonly consentText = computed(() => {\n const cfg = this.saveCard();\n const base = cfg?.consentText || this.labels.t('stripeReader.saveCard.consent');\n return cfg?.customerPaysFees ? `${base} ${this.labels.t('stripeReader.saveCard.consentFees')}` : base;\n });\n /** A reload / second tab found an undecided attempt of ANOTHER method (a manual card): it is never followed as a reader payment, only worded. */\n protected readonly foreignPending = computed(() => this.attempt.unknown() && !this.flow.locked() && this.flow.phase() === 'idle' && this.attempt.pinnedMethod() !== 'CARD_PRESENT');\n protected readonly degraded = computed(() => readerDegraded(this.flow.terminal()));\n protected readonly checkingText = computed(() => {\n const d = this.degraded();\n if (d?.kind === 'attention') return this.labels.t('stripeReader.degraded.attention');\n if (d?.kind === 'since') return this.labels.t('stripeReader.degraded.since', { time: d.since });\n return this.labels.t('stripeReader.stillChecking');\n });\n /** What was actually charged (the service's `amountCents`), else the quote total of the open payment; `null` when neither is known. */\n private readonly chargedTotal = computed((): number | null => paymentChargedAmount(this.flow.payment()) ?? (this.flow.locked() || this.flow.phase() === 'succeeded' ? this.currentQuote()?.totalAmount ?? null : null));\n /** The amount line of the waiting screen: the total when known, else the base amount (fees may be added). Always present once an amount is known, quote or not (also after a reload that adopted the payment). */\n protected readonly waitAmount = computed(() => {\n const money = (n: number) => formatCurrency(n, { currency: this.currency() });\n const total = this.chargedTotal();\n if (total != null) return this.labels.t('stripeReader.wait.amount', { amount: money(total) });\n const base = this.flow.baseAmount();\n return base != null ? this.labels.t('stripeReader.wait.amountBase', { amount: money(base) }) : '';\n });\n protected readonly confirmTotalText = computed(() => { const total = this.currentQuote()?.totalAmount ?? this.quoteChanged()?.total ?? null; return total == null ? '' : formatCurrency(total, { currency: this.currency() }); });\n protected readonly existingPaymentHref = computed(() => {\n const refusal = this.flow.refusal();\n if (refusal?.code !== 'duplicate_suspected' || !refusal.paymentId) return null;\n const url = this.receiptUrl()?.({ id: refusal.paymentId });\n return isSafeReceiptUrl(url) ? url : null;\n });\n protected readonly elapsedText = computed(() => formatElapsed(this.flow.elapsedMs()));\n protected readonly waitTitle = computed(() => this.labels.t(`stripeReader.wait.${this.waitKey()}.title` as UiLabelKey));\n protected readonly waitText = computed(() => {\n const t = this.flow.terminal();\n if (this.waitKey() === 'declined' && t?.message) return t.message;\n return this.labels.t(`stripeReader.wait.${this.waitKey()}.text` as UiLabelKey, { reader: this.readerName() });\n });\n private readonly waitKey = computed((): 'waiting' | 'declined' | 'stopped' | 'retrying' | 'cancelling' | 'recovering' | 'unconfirmed' => {\n const p = this.flow.phase();\n if (p === 'recovering' && this.flow.recoveryExpired()) return 'unconfirmed';\n return p === 'declined' || p === 'stopped' || p === 'retrying' || p === 'cancelling' || p === 'recovering' ? p : 'waiting';\n });\n protected readonly refusalText = computed(() => {\n const refusal = this.flow.refusal();\n if (!refusal) return '';\n if (refusal.code === 'quote_changed') {\n return typeof refusal.amountCents === 'number'\n ? this.labels.t('stripeReader.refusal.quote_changed', { amount: formatCurrency(refusal.amountCents / 100, { currency: this.currency() }) })\n : this.labels.t('stripeReader.refusal.quote_changedNoAmount');\n }\n const key = readerRefusalLabelKey(refusal.code);\n return key ? this.labels.t(key) : refusal.message || this.labels.t('stripeReader.refusal.generic');\n });\n protected readonly succeededText = computed(() => {\n // What was actually charged (the service's own total), else the quote the payer saw, else the base amount; never a made-up 0.\n const amount = this.chargedTotal() ?? this.flow.baseAmount() ?? this.amount();\n return amount == null\n ? this.labels.t('stripeReader.done.textNoAmount', { reader: this.readerName() })\n : this.labels.t('stripeReader.done.text', { amount: formatCurrency(amount, { currency: this.currency() }), reader: this.readerName() });\n });\n protected readonly cardLine = computed(() => {\n const p = this.flow.payment();\n return p?.last4 ? this.labels.t('stripeReader.done.card', { brand: p.brand ? String(p.brand).replace(/^./, c => c.toUpperCase()) : this.labels.t('stripeReader.done.cardWord'), last4: p.last4 }) : '';\n });\n /** What happened to the \"save this card\" choice: never \"saved\" unless the service says so. */\n protected readonly cardSaveText = computed(() => {\n const save = this.flow.cardSave();\n if (save?.saved) return this.labels.t('stripeReader.cardSaved');\n // Saving was asked for (the service says so, or this screen asked and the service did not answer `cardSave`): never claimed as saved, always \"not confirmed\".\n if (save?.requested || (!save && !!this.flow.startInput()?.save)) return this.labels.t('stripeReader.cardNotSaved');\n return '';\n });\n protected readonly receiptHref = computed(() => {\n const payment = this.flow.payment();\n const url = payment ? this.receiptUrl()?.(payment) : null;\n return isSafeReceiptUrl(url) ? url : null;\n });\n /** What the polite region says: one text, the most important thing first, changing with every state. */\n protected readonly announcement = computed(() => {\n const phase = this.flow.phase();\n if (!this.active()) return ''; // manual mode: the reader is only a banner, the manual form speaks for the page\n if (this.blockReason() && !this.flow.locked() && phase !== 'succeeded') return this.blockText();\n if (this.closeBlocked() && this.flow.locked()) return this.labels.t('stripeReader.closeBlocked');\n if (phase === 'idle') return this.foreignPending() ? this.labels.t('stripeReader.refusal.outcome_checking') : '';\n if (phase === 'starting') return this.labels.t('stripeReader.startingText');\n if (phase === 'succeeded') return ''; // the success alert is the announcement (a second one here would say it twice, and with another amount)\n if (phase === 'canceled') return `${this.labels.t('stripeReader.canceled.title')}. ${this.labels.t('stripeReader.canceled.text')}`;\n if (phase === 'failed') return `${this.labels.t('stripeReader.failed.title')}. ${this.labels.t('stripeReader.failed.text')}`;\n if (this.flow.cancelUnreachable()) return this.labels.t('stripeReader.cancelUnreachable');\n if (this.flow.connectionLost()) return this.labels.t('stripeReader.connectionLost');\n if (this.flow.readerOffline()) return this.labels.t('stripeReader.readerDisconnected');\n if (this.flow.checking()) return this.checkingText();\n return `${this.waitTitle()}. ${this.waitText()}`;\n });\n\n constructor() {\n this.refreshBuiltIns();\n if (typeof window !== 'undefined') {\n const refresh = (): void => this.refreshBuiltIns();\n window.addEventListener('online', refresh);\n window.addEventListener('offline', refresh);\n this.destroyRef.onDestroy(() => { window.removeEventListener('online', refresh); window.removeEventListener('offline', refresh); });\n }\n this.destroyRef.onDestroy(() => { this.destroyed = true; this.flow.dispose(); if (this.readTimer) clearTimeout(this.readTimer); this.quoteRun++; });\n // The readiness is read as soon as the host gave the call, then every `readinessEveryMs` (and again after a payment ends).\n effect(() => { const read = this.getReadiness(); untracked(() => { if (read) void this.loadReadiness(); }); });\n effect(() => { const locked = this.flow.locked(); untracked(() => { this.busyChange.emit(locked); if (!locked) this.closeBlocked.set(false); }); });\n effect(() => {\n const phase = this.flow.phase();\n untracked(() => {\n const changed = phase !== this.lastPhase;\n this.lastPhase = phase;\n if (changed && this.acted && phase !== 'idle') { this.acted = false; afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('[data-testid=\"reader-starting\"], [data-testid=\"reader-waiting\"], [data-testid=\"reader-succeeded\"], [data-testid=\"reader-canceled\"], [data-testid=\"reader-failed\"]')?.focus(), { injector: this.injector }); }\n });\n });\n effect(() => { const phase = this.flow.phase(); untracked(() => { if (phase === 'canceled' || phase === 'failed' || phase === 'succeeded') void this.loadReadiness(); }); });\n // A reload / a second tab found an open attempt of this payable: look its payment up (never start another). The marker is per PAYABLE, not per method: only a card READER attempt is followed on the terminal\n // channel; a manual card attempt is worded (\"still confirming an earlier payment\") and keeps Send off, but is never polled as a reader payment.\n effect(() => {\n const unknown = this.attempt.unknown();\n const method = this.attempt.pinnedMethod();\n untracked(() => { if (unknown && method === 'CARD_PRESENT' && !this.flow.locked() && this.flow.phase() === 'idle') this.flow.adopt(); });\n });\n // `quote_changed`: the total shown is stale. The quote is asked again at once and Send stays off until the payer confirms the new total. `terminal_save_needs_direct`: keeping the card is impossible on this account.\n effect(() => {\n const refusal = this.flow.refusal();\n untracked(() => {\n if (refusal?.code === 'quote_changed') { this.quoteChanged.set({ total: typeof refusal.amountCents === 'number' ? refusal.amountCents / 100 : null }); this.quoteTick.update(n => n + 1); }\n if (refusal?.code === 'terminal_save_needs_direct') { this.saveUnavailable.set(true); this.saveChecked.set(false); }\n });\n });\n // The consent belongs to ONE start: after a canceled / failed payment the box is cleared (the staff attest again; the timestamp is taken at every start).\n effect(() => { const phase = this.flow.phase(); untracked(() => { if (phase === 'canceled' || phase === 'failed') this.saveChecked.set(false); }); });\n // Another amount is another quote: the \"confirm the new total\" step is over.\n effect(() => { this.amount(); untracked(() => this.quoteChanged.set(null)); });\n // Without a payable reference the reload / second-tab protection cannot work (the marker is stored under it).\n effect(() => { const ref = this.payableRef(); untracked(() => { if (isDevMode() && ref == null) console.warn('[ui-stripe-reader-payment] payableRef is not set: a reload or a second tab cannot find an open reader payment, so the duplicate protection only covers this page instance.'); }); });\n effect(() => { const estimate = this.estimateFees(); untracked(() => { if (isDevMode() && !estimate) console.warn('[ui-stripe-reader-payment] estimateFees is not set: a reader payment must show the card reader fee breakdown before the tap.'); }); });\n // The browser's own offline / online events while a payment is open.\n effect(() => { const offline = this.attempt.offline(); untracked(() => { if (this.flow.locked()) this.flow.markConnection(!offline); }); });\n // The fee quote: cleared AT ONCE when the amount changes (a quote for another amount is never shown), asked again after a short pause, and Send stays off until the quote of the current amount arrives.\n effect(onCleanup => {\n const estimate = this.estimateFees();\n const amount = this.amount();\n const tick = this.quoteTick();\n const phase = this.flow.phase();\n const active = this.active();\n if (phase !== 'idle' && phase !== 'canceled' && phase !== 'failed') return; // while a payment is open (or done) the quote on screen belongs to it\n if (!active) { this.heldTick = -1; untracked(() => { this.quote.set(null); this.quotedFor.set(null); this.quoteFailed.set(false); this.quoting.set(false); }); return; } // the reader is only a banner (manual mode): no card-present quote is asked\n // Only the phase moved (a refusal or a canceled payment brought the screen back): the quote held for this very amount is still the one to show. Anything else (another amount, another call, \"Try again\", a changed total) asks again.\n const unchanged = estimate === this.heldEstimate && amount === this.heldAmount && tick === this.heldTick;\n if (unchanged && untracked(() => !!this.quote() && this.quotedFor() === amount)) return;\n this.heldEstimate = estimate; this.heldAmount = amount; this.heldTick = tick;\n const run = ++this.quoteRun;\n untracked(() => { this.quote.set(null); this.quotedFor.set(null); this.quoteFailed.set(false); this.quoting.set(false); });\n if (!estimate || amount == null || !Number.isFinite(amount) || amount <= 0) return;\n untracked(() => this.quoting.set(true));\n let hung: ReturnType<typeof setTimeout> | null = null;\n const timer = setTimeout(async () => {\n hung = setTimeout(() => { if (run === this.quoteRun) { this.quoting.set(false); this.quoteFailed.set(true); } }, Math.max(1, this.feeTimeoutMs()));\n let fees: StripeFees | null = null;\n try { fees = (await callHost(() => estimate({ amount, paymentMethod: 'CARD_PRESENT', paymentMethodType: 'card_present' }))) ?? null; } catch { fees = null; }\n if (hung) { clearTimeout(hung); hung = null; }\n if (this.destroyed || run !== this.quoteRun) return;\n this.quoting.set(false);\n if (fees) { this.quote.set(fees); this.quotedFor.set(amount); this.quoteFailed.set(false); } else { this.quote.set(null); this.quotedFor.set(null); this.quoteFailed.set(true); }\n }, 300);\n onCleanup(() => { clearTimeout(timer); if (hung) clearTimeout(hung); });\n });\n }\n\n private refreshBuiltIns(): void { this.builtIns.set(builtInReadinessReasons(this.offlineOverride())); }\n\n // ── Readiness ───────────────────────────────────────────────────────────\n\n /** Reads the readiness now (\"Check again\"). A slow (over `readinessTimeoutMs`) or failed read leaves NO answer: the banner says it could not be checked and nothing is started. */\n async loadReadiness(): Promise<void> {\n const read = this.getReadiness();\n if (!read || this.destroyed) return;\n if (this.readTimer) { clearTimeout(this.readTimer); this.readTimer = null; }\n const run = ++this.readRun;\n this.readinessLoading.set(true);\n let result: StripeReaderReadiness | null = null;\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<'timeout'>(resolve => { timer = setTimeout(() => resolve('timeout'), this.readinessTimeoutMs()); });\n const raw = await Promise.race([callHost(() => read()), timeout]);\n result = raw === 'timeout' ? null : normalizeReadiness(raw);\n } catch { result = null; } finally { if (timer) clearTimeout(timer); }\n if (this.destroyed || run !== this.readRun) return;\n this.readinessLoading.set(false);\n this.readiness.set(result);\n this.readinessChange.emit(result?.state ?? null);\n this.scheduleReadiness();\n }\n\n private scheduleReadiness(): void {\n if (this.destroyed) return;\n if (this.readTimer) clearTimeout(this.readTimer);\n this.readTimer = setTimeout(() => { this.readTimer = null; if (this.flow.locked()) this.scheduleReadiness(); else void this.loadReadiness(); }, Math.max(1, this.readinessEveryMs()));\n }\n\n // ── Actions ─────────────────────────────────────────────────────────────\n\n /** \"Send to the reader\". Synchronous up to the attempt lock: a double click sends ONE payment. */\n start(): void {\n this.refreshBuiltIns();\n if (!this.canStart()) return;\n const before = this.beforeStart();\n if (before && !before()) return;\n const amount = this.amount() as number;\n const cfg = this.saveCard();\n // The consent time is taken at THIS start (never a timestamp from an earlier, canceled or declined payment).\n const save = cfg && this.saveChecked() && !this.saveUnavailable()\n ? { customerRef: cfg.customerRef, consent: { textVersion: cfg.textVersion, acceptedAt: new Date().toISOString(), recordedBy: cfg.recordedBy } }\n : null;\n const total = this.currentQuote()?.totalAmount;\n this.closeBlocked.set(false);\n void this.flow.start({\n readerId: this.readerId(), amount, payableRef: this.payableRef(), save, extras: this.startExtras() ?? undefined,\n ...(total !== undefined && Number.isFinite(total) ? { expectedAmountCents: Math.round(total * 100) } : {}),\n });\n this.acted = true;\n }\n\n protected onSaveChange(checked: boolean): void { this.saveChecked.set(checked); }\n\n /** \"Confirm the new total\": the payer saw the new total, Send is available again. */\n protected confirmNewTotal(): void { this.quoteChanged.set(null); }\n\n protected retry(): void { this.acted = true; void this.flow.retry(); }\n\n /** \"Check again\" of an unconfirmed payment: reads the attempt key once more (found: followed; still none after the grace: released, \"Start again\"). */\n protected recheck(): void { void this.flow.recheck(); }\n\n protected dismissCancelTimeout(): void { this.cancelTimedOut.set(false); void this.loadReadiness(); }\n\n protected cancelPayment(): void { this.acted = true; void this.flow.cancel(); }\n\n protected startAgain(): void { this.flow.reset(); }\n\n protected retryQuote(): void { this.quoteTick.update(n => n + 1); }\n\n /** \"Take a manual payment instead\" while a payment is open: the payment is canceled FIRST; the host is told only when the service confirmed it. */\n protected async switchToManual(): Promise<void> {\n if (await this.cancelAndWait()) this.manual.emit();\n }\n\n /** Cancels an open reader payment and resolves true when nothing is open any more (nothing was waiting, or the service confirmed the cancel). False = the payment is STILL open. */\n async cancelAndWait(): Promise<boolean> {\n if (!this.flow.locked()) return true;\n if (this.flow.phase() === 'starting' || this.flow.phase() === 'recovering' || this.flow.phase() === 'retrying') return false;\n return this.flow.cancel();\n }\n\n /** Is a reader payment open (starting, waiting, declined, cancelling...)? */\n isLocked(): boolean { return this.flow.locked(); }\n\n /** The panel wants to close: allowed (true) only when nothing is open. Otherwise the warning shows and focus goes to \"Cancel payment\". */\n requestClose(): boolean {\n if (!this.flow.locked()) return true;\n // Nothing is waiting on the reader yet (the answer of the start is on its way or lost): there is nothing to cancel. The panel may close; the attempt marker is kept, so reopening it\n // finds the payment by its attempt key (\"Checking the payment\" with the same hint) and NEVER starts another.\n const phase = this.flow.phase();\n if (phase === 'starting' || phase === 'recovering') { this.outcome.emit({ kind: 'left-pending' }); return true; }\n this.closeBlocked.set(true);\n afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('[data-testid=\"reader-cancel\"] button, [data-testid=\"reader-waiting\"]')?.focus(), { injector: this.injector });\n return false;\n }\n\n /** Fire-and-forget cancel of an open payment (the host closed the panel anyway). Never claims the payment is canceled. */\n cancelBestEffort(): void {\n const cancel = this.cancelPaymentFn();\n const id = this.flow.payment()?.id;\n if (!cancel || !id || !this.flow.cancellable()) return;\n callHost(() => cancel(id)).catch(() => { /* the service keeps the payment open and the reconciler settles it */ });\n }\n\n /** \"Cancel that payment\" of the busy banner: cancels the user's own payment that holds the reader, then reads the readiness again. */\n protected async cancelBusy(id: string): Promise<void> {\n const cancel = this.cancelPaymentFn();\n if (!cancel || this.cancellingBusy()) return;\n this.cancellingBusy.set(true);\n this.cancelTimedOut.set(false);\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n // Raced against the request timeout: a call that never answers cannot leave \"Cancel that payment\" busy forever. A timed-out cancel may have gone through: the readiness is read again at once.\n const timeout = new Promise<never>((_, reject) => { timer = setTimeout(() => reject(Object.assign(new Error('request timeout'), { status: null, code: 'request_timeout' })), Math.max(1, this.requestTimeoutMs())); });\n await Promise.race([callHost(() => cancel(id)), timeout]);\n } catch (error) {\n const code = readerErrorInfo(error).code;\n if (code === 'request_timeout') this.cancelTimedOut.set(!this.destroyed);\n this.outcome.emit({ kind: 'refused', code: code || 'reader_unreachable' });\n } finally { if (timer) clearTimeout(timer); }\n if (this.destroyed) return;\n this.cancellingBusy.set(false);\n void this.loadReadiness();\n }\n\n private onFlowEvent(event: StripeReaderFlowEvent): void {\n switch (event.kind) {\n case 'started': this.outcome.emit({ kind: 'started', payment: event.payment }); break;\n case 'declined': this.outcome.emit({ kind: 'declined', payment: event.payment }); break;\n case 'succeeded':\n // The amount of THIS payment: the service's base amount (also after a reload that adopted it), else what this screen started with; never a made-up 0.\n this.succeeded.emit({ payment: event.payment, attemptKey: event.attemptKey, amount: this.flow.baseAmount() ?? this.amount() ?? paymentChargedAmount(event.payment) ?? 0, readerId: event.payment.terminal?.readerId ?? this.flow.lastStartInput()?.readerId ?? '' });\n break;\n case 'canceled': this.outcome.emit({ kind: 'canceled' }); break;\n case 'failed': this.outcome.emit({ kind: 'failed' }); break;\n case 'refused': this.outcome.emit({ kind: 'refused', code: event.refusal.code }); break;\n case 'connection-lost': this.outcome.emit({ kind: 'connection-lost' }); break;\n case 'connection-restored': this.outcome.emit({ kind: 'connection-restored' }); break;\n }\n }\n}\n","import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, ViewEncapsulation, afterNextRender, computed, effect, inject, input, signal, untracked, viewChild } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { HintComponent } from '@forgeroute/ui/hint';\nimport { KpiCardComponent } from '@forgeroute/ui/kpi-card';\nimport { RadioGroupComponent } from '@forgeroute/ui/radio';\nimport { callHost, isFinalPaymentRefusal, paymentErrorLabelKey, refusalLabelKey, wasQueuedOffline, warnQueuedPayment, type PaymentAttemptControls, type PaymentAttemptOutcome, type PaymentMethodContext } from '@forgeroute/ui/payments';\nimport { formatCurrency } from '@forgeroute/ui/utils';\nimport { StripePaymentComponent, type StripeBillingDetails, type StripeDeferredIntent } from '../stripe-payment/stripe-payment.component';\nimport type { StripeCardFunding, StripeConfirmationTokenEvent, StripeConfirmedEvent, StripeElementChange, StripeFailure } from '../stripe-payment/stripe-outcomes';\nimport type { StripePaymentMethodComponent } from './payment-stripe-method.component';\nimport { STRIPE_METHOD_TEXTS, stripeMethodType, type StripeFees, type StripeIntentInfo } from './payment-stripe-method.models';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { StripeReaderPaymentComponent, type StripeReaderSucceededEvent } from '../stripe-reader/stripe-reader-payment.component';\nimport { paymentBaseAmount, type StripeReaderReadinessState } from '../stripe-reader/stripe-reader.models';\nimport { STRIPE_READER_POLL_MS } from '../stripe-reader/stripe-reader.flow';\n\nconst WALLETS = { applePay: 'never', googlePay: 'never' };\nconst FIELDS = { billingDetails: { address: { country: 'auto', postalCode: 'auto' } } };\n\n/** The body `ui-payment-stripe-method` hands to the panel: the Payment Element, the fee rows and the whole Stripe flow, talking to the panel through `ctx`. */\n@Component({\n selector: 'ui-payment-stripe-body',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [FormsModule, AlertComponent, ButtonComponent, HintComponent, KpiCardComponent, RadioGroupComponent, StripePaymentComponent, StripeReaderPaymentComponent],\n template: `\n <div class=\"psm\">\n @if (confirmation(); as notice) {\n <ui-alert [variant]=\"notice.verification ? 'warning' : 'success'\" [title]=\"notice.title\" tabindex=\"-1\" class=\"psm-notice\" data-testid=\"stripe-method-confirmation\">\n <p>{{ notice.message }}</p>\n @if (!notice.verification) {\n <p>{{ receiptNote() }}</p>\n }\n </ui-alert>\n } @else {\n <!-- the region stays in the DOM (only its content toggles) so a screen reader announces the reason when it appears -->\n <div role=\"status\" aria-live=\"polite\" class=\"psm-blocked\" data-testid=\"stripe-method-blocked-status\">\n @if (blockedMessage(); as reason) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"stripe-method-blocked\">{{ reason }}</ui-alert>\n }\n </div>\n @if (readerEnabled()) {\n @if (!readerPaid()) {\n <!-- a refused switch re-creates the group (new epoch) so the radio shows the mode that is really in effect -->\n @for (epoch of [modeEpoch()]; track epoch) {\n <ui-radio-group class=\"psm-mode\" [label]=\"labels.t('stripeReader.mode.label')\" [options]=\"modeOptions()\" orientation=\"horizontal\" [ngModel]=\"modeShown()\" (ngModelChange)=\"chooseMode($event)\"\n [disabled]=\"modeLocked()\" data-testid=\"stripe-reader-mode\" />\n }\n @if (modeBlocked()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" class=\"psm-mode-blocked\" data-testid=\"stripe-reader-mode-blocked\">{{ labels.t(modeBlockedWhy() === 'manual-pending' ? 'stripeReader.mode.blockedManual' : 'stripeReader.mode.blocked') }}</ui-alert>\n }\n }\n <ui-stripe-reader-payment [active]=\"mode() === 'reader'\" [amount]=\"ctx().amount\" [currency]=\"ctx().currency\" [payableRef]=\"config().payableRef()\" [paid]=\"config().paid()\"\n [startExtras]=\"readerExtras()\" [getReadiness]=\"reader()!.getReadiness\" [startPayment]=\"reader()!.startPayment\" [getPayment]=\"reader()!.getPayment\" [retryPayment]=\"reader()!.retryPayment\"\n [cancelPayment]=\"reader()!.cancelPayment\" [estimateFees]=\"reader()!.estimateFees\" [receiptUrl]=\"reader()!.receiptUrl ?? null\" [saveCard]=\"reader()!.saveCard ?? null\"\n [offlineOverride]=\"config().offlineOverride()\" [beforeStart]=\"beforeReaderStart\" [manualAvailable]=\"true\" [disabled]=\"isBlocked()\" [hideBanner]=\"!!ctx().readerBanner\" [pollMs]=\"readerPollMs()\"\n (manual)=\"onReaderManual()\" (connectReader)=\"config().readerConnect.emit()\" (getReader)=\"config().readerOrder.emit()\" (openSetup)=\"config().readerSetup.emit()\"\n (succeeded)=\"onReaderPaid($event)\" (readinessChange)=\"onReaderReadiness($event)\" (busyChange)=\"onReaderBusy($event)\" />\n }\n @if (showManual()) {\n @if (ctx().amount == null) {\n <ui-hint data-testid=\"stripe-method-amount-needed\">{{ texts.amountNeeded }}</ui-hint>\n }\n @if (estimateError()) {\n <div class=\"psm-error\">\n <ui-alert variant=\"warning\" data-testid=\"stripe-method-estimate-error\">{{ estimateError() }}\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"stripe-method-estimate-retry\" (click)=\"retryEstimate()\">{{ labels.t('common.tryAgain') }}</ui-button>\n </ui-alert>\n </div>\n }\n @if (lastAmount() != null) {\n <ui-stripe-payment #payment mode=\"payment\" [publishableKey]=\"config().publishableKey()\" [stripeAccount]=\"config().stripeAccount()\" [deferred]=\"deferred()\"\n [createIntent]=\"createIntentFn\" [paymentMethodTypes]=\"[methodType()]\" [showSubmit]=\"false\" [showErrors]=\"false\" [autoHandleCardAction]=\"true\" [collectConfirmationToken]=\"config().fundingPreview()\"\n [duplicateProtection]=\"config().duplicateProtection()\" [attemptAmount]=\"ctx().amount\" [attemptMethod]=\"ctx().method\" [payableRef]=\"config().payableRef()\" [attemptKey]=\"config().attemptKey()\" [checkStatus]=\"config().checkStatus()\" [paid]=\"config().paid()\" [hostPending]=\"config().hostPending()\"\n [statusPollMs]=\"config().statusPollMs()\" [statusPollMaxMs]=\"config().statusPollMaxMs()\" [statusCheckTimeoutMs]=\"config().statusCheckTimeoutMs()\" [statusFailGraceMs]=\"config().statusFailGraceMs()\" [authTimeoutMs]=\"config().authTimeoutMs()\" [allowStartOver]=\"config().allowStartOver()\" [offlineOverride]=\"config().offlineOverride()\" [confirmTimeoutMs]=\"config().confirmTimeoutMs()\"\n [readinessCheck]=\"config().readinessCheck()\" [readinessTimeoutMs]=\"config().readinessTimeoutMs()\" [readinessEveryMs]=\"config().readinessEveryMs()\" (outcome)=\"onAttemptOutcome($event)\"\n [wallets]=\"wallets\" [fields]=\"fields\" [defaultValues]=\"defaultValues()\" [appearance]=\"$any(config().appearance())\" [appearanceFromTokens]=\"true\" [label]=\"labels.t('stripePaymentStripeMethod.paymentDetails')\"\n (ready)=\"onReady()\" (elementChange)=\"onElementChange($event)\" (failed)=\"onFailed($event)\" (loadError)=\"onFailed($event)\" />\n @if (totalCard(); as card) {\n <ui-kpi-card class=\"psm-total\" data-testid=\"stripe-method-total\" [label]=\"labels.t('stripePaymentStripeMethod.totalCharged')\" [value]=\"card.value\" [subtitle]=\"card.subtitle\" icon=\"dollar\" color=\"blue\" valueColor=\"blue\" />\n }\n @if (feeRows().length) {\n <dl class=\"psm-fees\" data-testid=\"stripe-method-fees\" [attr.aria-label]=\"labels.t('stripePaymentStripeMethod.paymentTotal')\">\n @for (row of feeRows(); track row.key) {\n <div class=\"psm-fee\" [attr.data-testid]=\"'stripe-fee-' + row.key\"><dt>{{ row.label }}</dt><dd>{{ row.value }}</dd></div>\n }\n </dl>\n }\n @if (error()) { <div class=\"psm-error\"><ui-alert variant=\"danger\" data-testid=\"stripe-method-error\">{{ error() }}</ui-alert></div> }\n }\n }\n }\n </div>\n `,\n styles: [`\n ui-payment-stripe-body { display: block; min-width: 0; }\n ui-payment-stripe-body .psm-error { margin-top: 12px; }\n ui-payment-stripe-body .psm-mode { display: block; margin-bottom: 12px; }\n ui-payment-stripe-body .psm-mode-blocked { display: block; margin-bottom: 12px; }\n ui-payment-stripe-body .psm-blocked { display: block; margin-bottom: 12px; }\n ui-payment-stripe-body .psm-blocked:empty { display: none; }\n ui-payment-stripe-body .psm-total { display: block; margin-top: 16px; }\n ui-payment-stripe-body .psm-fees { margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--ui-psp-border, #e2e8f0); border-radius: 10px; font-size: 0.8125rem; }\n ui-payment-stripe-body .psm-fee { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--ui-psp-muted, #475569); }\n ui-payment-stripe-body .psm-fee dt, ui-payment-stripe-body .psm-fee dd { margin: 0; }\n ui-payment-stripe-body .psm-notice:focus { outline: none; }\n ui-payment-stripe-body .psm-notice p { margin: 0 0 6px; }\n `],\n})\nexport class PaymentStripeBodyComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly injector = inject(Injector);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly ctx = input.required<PaymentMethodContext>();\n readonly config = input.required<StripePaymentMethodComponent>();\n private readonly payment = viewChild(StripePaymentComponent);\n private readonly readerView = viewChild(StripeReaderPaymentComponent);\n\n // ── Card reader mode (opt-in: only with `[reader]` on the plugin and the method Card) ──\n protected readonly reader = computed(() => this.config().reader());\n protected readonly readerEnabled = computed(() => !!this.reader() && this.ctx().method === 'CARD');\n /** The last readiness state the reader screen reported (`null` = no answer / failed). */\n readonly readerState = signal<StripeReaderReadinessState | null>(null);\n /** This screen's reader read answered at least once for the selected method (a failed read counts): the next CHANGE of state asks the panel's top banner to read again. */\n private readerAnswered = false;\n /** The payer's choice. `null` until the FIRST readiness answer: then the reader when it is ready (and `readerFirst`), else manual. Never changes by itself after that (a card being typed must not be swapped away). */\n readonly choice = signal<'reader' | 'manual' | null>(null);\n /** What the choice control shows (it follows `mode()` and is moved first when the payer picks, so a refused switch can put it back). */\n protected readonly modeShown = signal<string>('manual');\n /** The reader payment that was taken (the success box and \"Done\" show). */\n readonly readerPaid = signal<StripeReaderSucceededEvent | null>(null);\n private readerBusy = false;\n /** The attempt key of the open reader payment (read while its screen exists; the screen is already gone when the body or the reader is removed). */\n private readerAttemptKey: string | undefined;\n readonly mode = computed((): 'reader' | 'manual' => (this.readerEnabled() ? (this.choice() ?? 'manual') : 'manual'));\n /** The Payment Element shows (manual card): no reader, or manual chosen after the first readiness answer. */\n protected readonly showManual = computed(() => !this.readerEnabled() || (this.choice() === 'manual'));\n protected readonly readerActive = computed(() => this.readerEnabled() && this.mode() === 'reader');\n protected readonly modeOptions = computed(() => [\n { value: 'reader', label: this.labels.t('stripeReader.mode.reader'), testId: 'stripe-reader-mode-reader' },\n { value: 'manual', label: this.labels.t('stripeReader.mode.manual'), testId: 'stripe-reader-mode-manual' },\n ]);\n /** The choice cannot move while the manual form pays or its outcome is unknown. It IS available before the first readiness answer (nothing is selected then): choosing manual at once cancels nothing, and the default never flips it back. */\n protected readonly modeLocked = computed(() => this.processing() || this.done() || this.switching() || this.isBlocked());\n /** The poll cadence of the waiting reader payment: the `[readerPollMs]` input, else `reader.pollMs`, else the library default; clamped by the reader screen to 500..30 000 ms. */\n protected readonly readerPollMs = computed(() => this.config().readerPollMs() ?? this.reader()?.pollMs ?? STRIPE_READER_POLL_MS);\n /** Blocked by the plugin's own `[blocked]` or by the panel's (`ctx.blocked`). */\n protected readonly isBlocked = computed(() => this.config().blocked() || !!this.ctx().blocked);\n /** The message of the plugin's own `[blocked]`; empty when not blocked or when the panel shows it already (never twice), and not after the payment was taken. */\n protected readonly blockedMessage = computed(() => (this.config().blocked() && !this.ctx().blocked && !this.done() && !this.readerPaid() && !this.confirmation()\n ? (this.config().blockedReason().trim() || this.labels.t('paymentBlocked.default')) : ''));\n /** A switch to manual is waiting for the reader payment's cancel to be confirmed. */\n private readonly switching = signal(false);\n /** The switch was refused (a payment is open): the text says why. */\n protected readonly modeBlocked = signal(false);\n /** Why the switch was refused: a card READER payment is still open (going to manual), or a MANUAL card payment is still being confirmed (going to the reader). The text says which one is true. */\n protected readonly modeBlockedWhy = signal<'reader-open' | 'manual-pending'>('reader-open');\n protected readonly modeEpoch = signal(0);\n protected readonly readerExtras = computed(() => { const c = this.ctx(); return { receivedDate: c.receivedDate, notes: c.note || null, allocation: c.allocation }; });\n /** Called by the reader's Send button: the panel's fields must be valid (and show their messages). */\n protected readonly beforeReaderStart = (): boolean => this.ctx().validate();\n\n protected readonly texts = STRIPE_METHOD_TEXTS;\n protected readonly wallets = WALLETS;\n protected readonly fields = FIELDS;\n\n readonly complete = signal(false);\n readonly processing = signal(false);\n /** What the attempt was STARTED with (pinned at the click). */\n private payAmount: number | null = null;\n /** The attempt's outcome is unknown right now (kept here, not read from the form: the form is already gone when the panel closes). */\n private attemptUnknown = false;\n private payMethod: string | null = null;\n /** What the payment that was RECORDED was made with (a late answer of an older attempt is recorded with its own amount and method). */\n private doneAmount: number | null = null;\n /** The amount and the panel's method of every attempt of this panel, by attempt key: a late answer of an OLDER attempt is recorded with its own (the form's outcome carries the Stripe type, not the panel's method). */\n private readonly attempts = new Map<string, { amount: number; method: string }>();\n private doneMethod: string | null = null;\n /** The payment was accepted (the panel was told, or the notice is up): Pay stays off even if the host keeps the panel open. */\n readonly done = signal(false);\n readonly error = signal('');\n /** The service gave an answer a retry cannot change (see `isFinalPaymentRefusal`), for THIS method, payable and amount: the text stays and Pay stays off until one of them changes (then the refusal and its text are cleared for good; it comes back only if the service answers it again). */\n readonly finalRefusal = signal<{ method: string; ref: string | null; amount: number } | null>(null);\n /** Fees from the host's estimate (before the payer pays); they decide the amount of the Payment Element. */\n readonly estimate = signal<StripeFees | null>(null);\n private readonly estimating = signal(false);\n protected readonly estimateError = signal('');\n private readonly estimateTick = signal(0);\n /** Fees the host answered when it created the intent. */\n private readonly intentFees = signal<StripeFees | null>(null);\n /** The notice after an accepted bank payment. `verification`: the payment has NOT started (a warning, no title because the message opens with \"Bank verification required\", no receipt note). */\n protected readonly confirmation = signal<{ title: string; message: string; verification?: boolean } | null>(null);\n /** The last valid amount: the Payment Element stays mounted (and keeps the typed card data) while the amount is briefly empty or invalid. */\n protected readonly lastAmount = signal<number | null>(null);\n private intent: StripeIntentInfo | null = null;\n private estimateRun = 0;\n /**\n * `fundingPreview`: the funding of the complete typed card; `null` while the card is incomplete / not a card. Only the FUNDING is reactive (a primitive, so setting the same value\n * again notifies nobody): the estimate effect runs once per funding change, not once per token. The id of the token that produced it is kept in `previewTokenId`.\n */\n private readonly previewFunding = signal<StripeCardFunding | null>(null);\n /** The id of the latest ConfirmationToken of the complete typed card (read when the estimate is asked); not reactive on purpose. */\n private previewTokenId: string | null = null;\n private previewRun = 0;\n /** `fundingPreview` only: a complete card changed and its token (and so its funding and the fee rows / total) is not known yet: Pay stays off, the rows on screen belong to the previous card. */\n private readonly previewPending = signal(false);\n private previewTimer: ReturnType<typeof setTimeout> | null = null;\n /** An estimate answer was dropped because a payment was being confirmed: ask again when that ends (else Pay would be free for the base amount). */\n private estimateStale = false;\n\n private readonly amountValue = computed(() => this.ctx().amount);\n private readonly methodValue = computed(() => this.ctx().method);\n protected readonly methodType = computed(() => stripeMethodType(this.ctx().method));\n private readonly total = computed(() => this.estimate()?.totalAmount ?? this.lastAmount() ?? 0);\n protected readonly receiptNote = computed(() => this.config().receiptNote());\n protected readonly deferred = computed((): StripeDeferredIntent => ({ mode: 'payment', amount: Math.round(this.total() * 100), currency: this.ctx().currency.toLowerCase() }));\n protected readonly defaultValues = computed(() => {\n const b: StripeBillingDetails | null = this.config().billingDetails();\n return b ? { billingDetails: b } : null;\n });\n protected readonly feeRows = computed(() => {\n const fees = this.intentFees() ?? this.estimate();\n const amount = this.lastAmount();\n if (!fees || amount == null || (fees.stripeFee === undefined && fees.platformFee === undefined)) return [];\n const money = (n: number) => formatCurrency(n, { currency: this.ctx().currency });\n const rows: { key: string; label: string; value: string }[] = [{ key: 'amount', label: this.labels.t('stripePaymentMethod.paymentAmount'), value: money(amount) }];\n if (fees.stripeFee !== undefined) rows.push({ key: 'processing', label: `${this.labels.t('stripePaymentMethod.processingFee')}${fees.stripeFeeLabel ? ` (${fees.stripeFeeLabel})` : ''}`, value: money(fees.stripeFee) });\n if (fees.platformFee !== undefined) rows.push({ key: 'platform', label: `${this.labels.t('stripePaymentMethod.platformFee')}${fees.platformFeeLabel ? ` (${fees.platformFeeLabel})` : ''}`, value: money(fees.platformFee) });\n return rows;\n });\n /** The headline figure: what the payer is charged, once fees are known. */\n protected readonly totalCard = computed(() => {\n const fees = this.intentFees() ?? this.estimate();\n if (!fees || this.lastAmount() == null || fees.totalAmount === undefined) return null;\n return { value: formatCurrency(fees.totalAmount, { currency: this.ctx().currency }), subtitle: this.labels.t('stripePaymentMethod.amountPlusFees') };\n });\n\n /** Bound as `[createIntent]` of ui-stripe-payment: called on Pay with the deferred form. */\n protected readonly createIntentFn = async (context?: { mode: 'payment' | 'setup'; confirmationToken?: StripeConfirmationTokenEvent | null; attemptKey?: string; payableRef?: string | null }): Promise<string> => {\n const create = this.config().createIntent();\n const ctx = this.ctx();\n if (!create || ctx.amount == null) throw new Error(this.labels.t('stripePayment.msg.cardsUnavailable'));\n this.cancelIntent(true); // a previous attempt that failed leaves an intent behind: cancel it even though a payment is \"processing\" now\n // The amount and method of THIS attempt are the PINNED ones (the click that started it), never what the amount field says by the time the intent is created.\n const attempt = this.payment()?.attempt;\n const amount: number = attempt?.pinnedAmount() ?? ctx.amount;\n const method: string = attempt?.pinnedMethod() ?? ctx.method;\n if (context?.attemptKey) { this.attempts.set(context.attemptKey, { amount, method }); this.config().rememberAttempt(context.attemptKey, 'manual', amount); } // the plugin keeps it for a later \"Check again\" of the panel\n let info: StripeIntentInfo | null | undefined;\n try { info = await callHost(() => create({\n amount, paymentMethod: method, paymentMethodType: this.methodType(), receivedDate: ctx.receivedDate, notes: ctx.note || null, ...ctx.allocation,\n ...(context?.confirmationToken ? { confirmationTokenId: context.confirmationToken.id, funding: context.confirmationToken.funding } : {}),\n ...(context?.attemptKey ? { attemptKey: context.attemptKey } : {}),\n ...(context?.attemptKey && context.payableRef !== undefined ? { payableRef: context.payableRef } : {}),\n })); } catch (err) {\n // The reference / payment-link codes are worded in OUR (translated) words; a final one keeps the text and turns Pay off instead of looping. The error keeps its code (the form still tells a failed-attempt replay).\n const labelKey = paymentErrorLabelKey(err);\n // Only the CURRENT attempt can raise it: a late answer of a superseded attempt says nothing about the current method, payable and amount.\n if (isFinalPaymentRefusal(err) && (!context?.attemptKey || attempt?.isLive(context.attemptKey))) this.finalRefusal.set({ method: ctx.method, ref: this.config().payableRef(), amount });\n if (labelKey) throw Object.assign(new Error(this.labels.t(labelKey)), { status: (err as { status?: unknown }).status, code: (err as { code?: unknown; error?: { code?: unknown } }).code ?? (err as { error?: { code?: unknown } }).error?.code });\n throw err;\n }\n if (wasQueuedOffline(info)) { warnQueuedPayment(); throw new Error(this.labels.t('paymentAttempt.queuedOffline')); } // the offline layer QUEUED the request (a synthetic 202): no intent exists, the payer may try again\n if (!info?.clientSecret) throw new Error(this.labels.t('stripePayment.msg.initFailed'));\n this.intent = info;\n this.intentFees.set({ stripeFee: info.stripeFee, platformFee: info.platformFee, totalAmount: info.totalAmount, stripeFeeLabel: info.stripeFeeLabel, platformFeeLabel: info.platformFeeLabel });\n return info.clientSecret;\n };\n\n constructor() {\n effect(() => { const amount = this.amountValue(); if (amount != null) untracked(() => this.lastAmount.set(amount)); });\n // A final refusal belongs to the method, payable and amount it was raised for: when one of them changes the refusal and its text are cleared (and stay cleared unless the service answers it again).\n effect(() => {\n const scope = this.finalRefusal();\n if (!scope) return;\n const ctx = this.ctx();\n if (ctx.method !== scope.method || ctx.amount !== scope.amount || this.config().payableRef() !== scope.ref) untracked(() => { this.finalRefusal.set(null); this.error.set(''); });\n });\n // The panel's footer button for this method.\n effect(() => {\n const ctx = this.ctx();\n const processing = this.processing();\n const notice = this.confirmation();\n const complete = this.complete();\n const estimating = this.estimating();\n const done = this.done();\n const estimateFailed = !!this.estimateError();\n const previewPending = this.previewPending();\n const finalRefusal = !!this.finalRefusal();\n const readerActive = this.readerActive();\n const readerPaid = this.readerPaid();\n const blocked = this.isBlocked();\n const protectedOff = !!this.payment()?.duplicateProtection() && (this.payment()!.attempt.unknown() || this.payment()!.attempt.paidLocked() || !this.payment()!.readiness.ready());\n const label = notice ? this.labels.t('common.done') : ctx.amount != null ? `${this.labels.t('stripePayment.pay')} ${formatCurrency(this.total(), { currency: ctx.currency })}` : this.labels.t('stripePayment.pay');\n // Card reader mode: the reader screen has its own buttons (Send / Cancel); after a reader payment only \"Done\" shows.\n if (readerPaid) { untracked(() => ctx.setPrimary({ label: this.labels.t('common.done'), disabled: done, onClick: () => this.finish() })); return; }\n if (readerActive) { untracked(() => ctx.setPrimary(null)); return; }\n untracked(() => ctx.setPrimary({\n label, loading: processing && !notice,\n disabled: notice ? done : !complete || processing || estimating || previewPending || estimateFailed || ctx.amount == null || done || protectedOff || finalRefusal || blocked,\n onClick: () => (notice ? this.finish() : void this.pay()),\n }));\n });\n // Estimated fees, debounced; they change the amount the Payment Element is created with.\n effect((onCleanup) => {\n const estimate = this.config().estimateFees();\n const amount = this.amountValue();\n const method = this.methodValue();\n const funding = this.previewFunding();\n const readerActive = this.readerActive();\n // Before the FIRST readiness answer nothing is mounted and nothing is estimated (the ONLINE quote would be asked for a payer who may pay on the reader).\n const modePending = this.readerEnabled() && this.choice() === null;\n this.estimateTick();\n const run = ++this.estimateRun; // any change makes an answer that is still on its way stale\n untracked(() => { this.estimate.set(null); this.intentFees.set(null); this.estimateError.set(''); });\n if (!estimate || amount == null || readerActive || modePending) { untracked(() => this.estimating.set(false)); return; }\n untracked(() => this.estimating.set(true));\n let hung: ReturnType<typeof setTimeout> | null = null;\n const failure = this.labels.t('stripePayment.msg.feesFailed');\n const timer = setTimeout(async () => {\n // A hung estimate must not block the user forever: after the timeout \"Try again\" is offered, and Pay stays off (the form\n // would be created for the wrong amount). A late answer still recovers.\n hung = setTimeout(() => {\n if (run !== this.estimateRun) return;\n this.estimating.set(false);\n this.estimateError.set(failure);\n }, Math.max(1, this.config().estimateTimeoutMs()));\n let fees: StripeFees | null = null;\n try {\n fees = (await callHost(() => estimate({\n amount, paymentMethod: method, paymentMethodType: stripeMethodType(method),\n ...(this.config().fundingPreview() ? { funding, confirmationTokenId: funding === null ? null : this.previewTokenId } : {}),\n }))) ?? null;\n } catch { fees = null; }\n if (hung) { clearTimeout(hung); hung = null; }\n if (run !== this.estimateRun) return;\n this.estimating.set(false);\n if (this.processing()) { this.estimateStale = true; return; } // a payment is being confirmed: the form must not change under it; asked again when it ends\n if (fees) { this.estimate.set(fees); this.estimateError.set(''); }\n else { this.estimate.set(null); this.estimateError.set(this.config().feesRequired() ? failure : ''); }\n }, 300);\n onCleanup(() => { clearTimeout(timer); if (hung) clearTimeout(hung); });\n });\n effect(() => {\n if (this.processing()) return;\n untracked(() => {\n if (!this.estimateStale) return;\n this.estimateStale = false;\n // After a success (or while the notice shows) the fees on screen belong to the payment that was taken: keep them.\n if (!this.done() && !this.confirmation()) this.estimateTick.update(n => n + 1);\n });\n });\n // A new form is built for another method: it is not complete until Stripe says so.\n effect(() => { this.methodValue(); untracked(() => { this.complete.set(false); this.error.set(''); this.cancelPreview(); this.choice.set(null); this.readerState.set(null); this.readerAnswered = false; }); });\n // The panel tells us when it is closing or the method changes before this body is removed: an unfinished intent is cancelled,\n // and an accepted payment whose notice is still up is reported as recorded (finalize already ran).\n effect(() => { const ctx = this.ctx(); untracked(() => ctx.onCancel(() => {\n // The panel clears the close guard when it runs this hook: the guard is registered again, or a panel that stays open (a reset) would let the payment be abandoned.\n this.registerCloseGuard(ctx);\n if (this.readerPaid()) { this.finish(); return; }\n const view = this.readerView();\n if (view?.isLocked()) { view.cancelBestEffort(); return; }\n if (this.confirmation()) this.finish(); else this.cancelIntent();\n })); });\n // The panel asks before it closes: a payment that waits on a card reader must be canceled first.\n effect(() => { const ctx = this.ctx(); untracked(() => this.registerCloseGuard(ctx)); });\n // Round 5: the panel's top reader banner (`ctx.readerBanner`) never steps aside; this screen draws no reader banner of its own then (`hideBanner` above), so exactly ONE banner per state. Without a panel banner the reader screen shows its own.\n // Switching between the reader and the manual card clears every manual fee / funding preview at once and asks again when manual comes back.\n // Before the first readiness answer nothing is selected (no mode is \"in effect\" yet, and the reader may still become the default); the payer may pick either at once.\n effect(() => { const mode = this.mode(); const pending = this.readerEnabled() && this.choice() === null; untracked(() => { this.modeShown.set(pending ? '' : mode); if (mode === 'reader') this.cancelPreview(); }); });\n inject(DestroyRef).onDestroy(() => { this.estimateRun++; this.cancelPreview(); this.cancelIntent(); });\n // The body is going away (method changed, panel closed): a reader payment that was open MAY STILL EXIST at the processor, so the host is NOT told it is idle: it hears `readerLeftPending` (once, only if it had been told \"busy\").\n inject(DestroyRef).onDestroy(() => this.leaveReaderPending('destroyed'));\n // The reader screen is removed while a payment is open on it (the reader was switched off, or the method left Card): the payment may still exist, the same rule applies, and the panel is told so it can unlock its own fields without reporting idle.\n effect(() => { const enabled = this.readerEnabled(); untracked(() => { if (!enabled && this.readerBusy) this.leaveReaderPending('unmounted'); }); });\n // The host resolves an undecided attempt through the plugin component (markSucceeded / markFailed / markNotCharged / markUnknown), without a status check.\n const controls: PaymentAttemptControls = {\n markUnknown: () => this.payment()?.markUnknown(),\n markSucceeded: () => this.payment()?.markSucceeded(),\n markFailed: () => this.payment()?.markFailed(),\n resetPaid: () => { this.payment()?.resetPaid(); this.readerView()?.attempt.resetPaid(); this.readerPaid.set(null); this.done.set(false); this.confirmation.set(null); this.error.set(''); this.ctx().setExclusive(false); },\n markNotCharged: () => { this.payment()?.markNotCharged(); this.processing.set(false); this.ctx().setBusy(false); this.ctx().flowOver?.(); },\n };\n // The controls are handed to the plugin that is bound NOW and taken back from that same one when the binding changes or the body is destroyed. (Reading `this.config()` in a destroy callback threw NG0950 when the body\n // was destroyed before its required config input was ever bound, which aborted the rest of the view's cleanups.)\n effect(onCleanup => {\n const config = this.config();\n untracked(() => config.attachControls(controls));\n onCleanup(() => config.detachControls(controls));\n });\n }\n\n // ── Card reader handlers ──\n\n private registerCloseGuard(ctx: PaymentMethodContext): void {\n ctx.setCloseGuard?.(() => {\n const view = this.readerView();\n const wasOpen = !!view?.isLocked();\n const allowed = view?.requestClose() ?? true;\n // The panel may close while the start answer is still on its way (starting / recovering): the payment is not canceled, so the host hears which attempt is left open.\n if (allowed && wasOpen) ctx.report('reader-left-pending', { ...(this.readerAttemptKey ? { attemptKey: this.readerAttemptKey } : {}) });\n return allowed;\n });\n }\n\n /** A reader payment that MAY STILL EXIST is let go of: never reported idle. The host hears `readerLeftPending` (and a panel hears `ctx.leavePending`). Once per busy period. */\n private leaveReaderPending(reason: 'destroyed' | 'unmounted'): void {\n if (!this.readerBusy) return;\n this.readerBusy = false;\n const paymentAttemptKey = this.readerAttemptKey;\n try { this.config().readerLeftPending.emit({ reason, ...(paymentAttemptKey ? { paymentAttemptKey } : {}) }); } catch { /* the plugin is already gone */ }\n if (reason === 'unmounted') { try { this.ctx().leavePending?.({ reason: 'unmounted', ...(paymentAttemptKey ? { paymentAttemptKey } : {}) }); } catch { /* the panel is already gone */ } }\n }\n\n /** The reader screen read the readiness. The FIRST answer decides the default: the reader when it is ready, else manual. */\n protected onReaderReadiness(state: StripeReaderReadinessState | null): void {\n const previous = this.readerState();\n const answeredBefore = this.readerAnswered;\n this.readerAnswered = true;\n this.readerState.set(state);\n // Round 5: the panel's top banner is the only reader banner on screen, so when this screen's own (15-second) read sees the reader's state CHANGE (ready -> offline, busy -> ready...) the top banner reads again: it never keeps saying \"connected\" for a reader that went away.\n if (answeredBefore && state !== null && previous !== state && this.ctx().readerBanner) { try { this.ctx().refreshReaderBanner?.(); } catch { /* the panel is already gone */ } }\n if (this.choice() === null) this.choice.set(state === 'reader_ready' && this.config().readerFirst() ? 'reader' : 'manual');\n }\n\n /** A reader payment is open: everything else is locked (fields, method, the manual form). */\n protected onReaderBusy(locked: boolean): void {\n if (locked === this.readerBusy) return;\n this.readerBusy = locked;\n if (locked) {\n try { this.readerAttemptKey = this.readerView()?.attempt.key() || undefined; } catch { this.readerAttemptKey = undefined; }\n this.config().rememberAttempt(this.readerAttemptKey, 'reader', this.ctx().amount ?? undefined); // the plugin keeps it for a later \"Check again\" of the panel\n }\n this.config().readerBusyChange.emit(locked);\n if (!locked) this.modeBlocked.set(false);\n // A reader payment is open (started here, or found again after a reload / in a second tab): its screen is the one to show, never the manual form behind it.\n else if (this.choice() !== 'reader') this.choice.set('reader');\n this.ctx().setBusy(locked);\n if (!locked) this.ctx().flowOver?.(); // the reader screen's flow ended (found nothing, found it canceled / paid, the user's cancel was confirmed): the panel's hold for it is over\n }\n\n /**\n * The payer picks reader or manual. Leaving the reader while a payment waits first cancels it THROUGH THE HOST; only when the service confirmed it does the manual form open. The control is NOT moved before\n * the answer (it is disabled while the cancel runs); a refused switch says why and re-creates the control so it shows the mode that is really in effect.\n */\n protected async chooseMode(next: string | null): Promise<void> {\n const target = next === 'reader' ? 'reader' : 'manual';\n if (this.switching() || (target === this.mode() && this.choice() !== null)) return;\n this.modeBlocked.set(false);\n if (target === 'manual') {\n const view = this.readerView();\n if (view?.isLocked()) {\n this.switching.set(true);\n let canceled = false;\n try { canceled = await view.cancelAndWait(); } finally { this.switching.set(false); }\n if (!canceled) { this.refuseSwitch('reader-open'); return; }\n this.ctx().flowOver?.(); // the service confirmed the cancel: nothing is open on the reader any more\n }\n } else if (this.processing() || this.attemptUnknown) { this.refuseSwitch('manual-pending'); return; }\n this.choice.set(target);\n }\n\n private refuseSwitch(why: 'reader-open' | 'manual-pending'): void {\n this.modeBlockedWhy.set(why);\n this.modeBlocked.set(true);\n this.modeEpoch.update(n => n + 1);\n this.modeShown.set(this.mode());\n afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('[data-testid=\"stripe-reader-mode\"] input:checked')?.focus(), { injector: this.injector });\n }\n\n /** The reader screen asked for the manual form (its payment is already canceled or never started). */\n protected onReaderManual(): void { this.choice.set('manual'); this.ctx().flowOver?.(); }\n\n /** The reader took the payment: reported like any live payment; \"Done\" completes the panel (the success box with the receipt and the saved-card result stays until then). */\n protected onReaderPaid(event: StripeReaderSucceededEvent): void {\n if (this.done() || this.readerPaid()) return;\n const ctx = this.ctx();\n // The amount of the reader payment itself; never reported as 0 while any amount is known: the event's, else the payment's own base amount (what the service says), else what the panel says now, else the last amount it said.\n const amount = event.amount > 0 ? event.amount : (paymentBaseAmount(event.payment) ?? ctx.amount ?? this.lastAmount() ?? event.amount);\n this.readerPaid.set(event);\n this.doneAmount = amount;\n this.doneMethod = ctx.method;\n ctx.report('paid', { result: { type: 'stripe', paymentMethod: ctx.method, amount } });\n ctx.setExclusive(true);\n ctx.setBusy(false);\n if (this.readerBusy) { this.readerBusy = false; this.config().readerBusyChange.emit(false); }\n }\n\n /** Every change of the Payment Element: completeness for Pay, and (only with `fundingPreview`) the card funding preview. */\n protected onElementChange(change: StripeElementChange): void {\n this.complete.set(change.complete);\n if (!this.config().fundingPreview() || !this.config().estimateFees() || this.methodType() !== 'card') return;\n this.stopPreviewTimer();\n const run = ++this.previewRun;\n if (!change.complete) { this.previewTokenId = null; this.previewFunding.set(null); this.previewPending.set(false); return; } // the card was edited: its funding is unknown again\n this.previewPending.set(true);\n this.previewTimer = setTimeout(() => void this.runPreview(run), 400);\n }\n\n private async runPreview(run: number): Promise<void> {\n this.previewTimer = null;\n const payment = this.payment();\n if (!payment || this.processing() || this.done() || run !== this.previewRun) { if (run === this.previewRun) this.previewPending.set(false); return; }\n const made = await payment.createConfirmationToken();\n if (run !== this.previewRun) return; // a newer change owns the pending flag\n if (!made || !('id' in made) || made.paymentMethodType !== 'card') {\n // No token for THIS card: its funding is unknown (never the previous card's): the estimate is asked again with funding null, then Pay is released.\n this.previewTokenId = null;\n this.previewFunding.set(null);\n this.previewPending.set(false);\n return;\n }\n // A new token for a card of the same funding must not ask for the estimate again (Pay would flicker and the effect would loop on its own answers).\n this.previewTokenId = made.id;\n this.previewFunding.set(made.funding);\n this.previewPending.set(false);\n }\n\n private stopPreviewTimer(): void { if (this.previewTimer) { clearTimeout(this.previewTimer); this.previewTimer = null; } }\n\n private cancelPreview(): void { this.stopPreviewTimer(); this.previewRun++; this.previewTokenId = null; this.previewFunding.set(null); this.previewPending.set(false); }\n\n protected retryEstimate(): void { this.estimateTick.update(n => n + 1); }\n\n protected onReady(): void {\n this.complete.set(false);\n this.ctx().announce(this.labels.t('stripePaymentMethod.announceReady'));\n }\n\n protected onFailed(failure: StripeFailure): void {\n this.error.set(failure.message); // shown in a role=alert ui-alert: that is the announcement\n this.processing.set(false);\n this.ctx().report('failed', { message: failure.message });\n }\n\n /** The inner form's attempt resolved OUTSIDE the click (only with `duplicateProtection`): unknown -> reported and kept locked; a status check that says paid completes the payment. */\n protected onAttemptOutcome(outcome: PaymentAttemptOutcome): void {\n const ctx = this.ctx();\n const duplicate = outcome.kind === 'unknown' && outcome.reason === 'duplicate_suspected';\n if (outcome.kind === 'unknown' && !duplicate) this.attemptUnknown = true; // a suspected duplicate is a report about ANOTHER (second) payment: this attempt's lock and intent are not touched\n else if (outcome.kind === 'succeeded' || outcome.kind === 'failed') this.attemptUnknown = false;\n if (duplicate) {\n const message = this.labels.t('paymentAttempt.duplicate');\n this.error.set(message);\n ctx.report('duplicate_suspected', { message, attemptKey: outcome.attemptKey });\n ctx.announce(message);\n } else if (outcome.kind === 'unknown') {\n this.payAmount = this.payment()?.attempt.pinnedAmount() ?? this.payAmount; // the amount and method of the attempt that is UNKNOWN (an adopted one included), never a stale earlier one\n this.payMethod = this.payment()?.attempt.pinnedMethod() ?? this.payMethod;\n if (outcome.reason === 'microdeposits') return; // the verification notice (afterConfirm: report `verification`) is the message; the intent is kept (attemptUnknown) and the status check decides\n const message = this.labels.t(outcome.reason === 'offline' ? 'paymentAttempt.offlineInFlight' : outcome.reason === 'auth_abandoned' ? 'paymentAttempt.authAbandoned' : outcome.reason === 'timeout' ? 'paymentAttempt.timeout' : this.payment()?.attempt.awaitingVerification() ? 'paymentAttempt.awaitingVerification' : 'paymentAttempt.checking'); // a reload / another tab that adopted a bank verification wait says so too\n ctx.report('unknown', { message });\n ctx.announce(message);\n } else if (outcome.kind === 'refused') {\n const refusedReason = outcome.reason ?? '';\n // worded through the readiness gate (payment_in_flight + awaitingVerification, awaiting_verification); `unknown` while a bank verification wait is on is the verification text, never \"Checking your payment...\"\n const refusedKey = refusedReason === 'unknown' && this.payment()?.attempt.awaitingVerification() ? 'paymentAttempt.awaitingVerification' : (this.payment()?.readiness.labelKeyFor(refusedReason) ?? refusalLabelKey(refusedReason));\n ctx.report('refused', { message: this.labels.t(refusedKey) });\n } else if (outcome.kind === 'succeeded' && outcome.reason === 'other_tab') {\n // Another tab / page load paid this payable: this form only shows the paid lock. Nothing is recorded here (no `paid`, no `complete`): no money moved through THIS form and the amount typed here is not what was paid.\n // A host that wants to reconcile reads the paid attempt's key, amount and method from the report (and from the form's own `(outcome)`).\n ctx.report('paid_elsewhere', { message: this.labels.t('paymentAttempt.paid'), attemptKey: outcome.attemptKey, ...(outcome.method !== undefined ? { paid: { amount: outcome.amount ?? null, method: outcome.method } } : {}) });\n } else if (outcome.kind === 'succeeded' && !this.done() && (outcome.reason === 'status_check' || outcome.reason === 'host' || !this.processing() || this.isOlderAttempt(outcome.attemptKey))) {\n // A status check or the host settled it, or the confirmation answered LATE (after a timeout, when `pay()` has already returned, or while a NEWER attempt runs): the payment is recorded exactly once here,\n // with the amount and method of THAT attempt (the outcome carries them for a late answer).\n void this.completeAfterCheck(ctx, this.isOlderAttempt(outcome.attemptKey), outcome);\n } else if (outcome.kind === 'failed' && (outcome.reason === 'status_check' || outcome.reason === 'host')) {\n const message = this.labels.t('paymentAttempt.failedAfterCheck');\n this.error.set(message);\n ctx.report('failed', { message });\n this.cancelIntent(true);\n ctx.setBusy(false);\n }\n }\n\n /** Is `key` an attempt OLDER than the one running now (its answer came late, after the host unlocked it and a newer attempt began)? */\n private isOlderAttempt(key: string): boolean {\n const attempt = this.payment()?.attempt;\n return !!attempt && attempt.inFlight() && attempt.key() !== key;\n }\n\n /**\n * A status check found the payment paid after an unknown outcome: the host records it exactly as after a normal confirmation. For an OLDER attempt (its answer came while a newer one runs) the intent\n * and `finalize` belong to the NEWER attempt and are left alone: the host's webhook reconciles the older payment, which it knows by its attempt key.\n */\n private async completeAfterCheck(ctx: PaymentMethodContext, older = false, outcome?: PaymentAttemptOutcome): Promise<void> {\n if (this.done()) return;\n this.done.set(true); // synchronously, BEFORE any await: a second outcome (status check and host report at once) can never report `paid` twice\n const info = older ? null : this.intent;\n if (!older) this.intent = null;\n let finalizeFailed = false;\n const finalize = this.config().finalize();\n if (finalize && info) { try { await callHost(() => finalize(info)); } catch { finalizeFailed = true; } }\n const known = outcome ? this.attempts.get(outcome.attemptKey) : undefined;\n const result = { type: 'stripe' as const, paymentMethod: known?.method ?? this.payMethod ?? ctx.method, amount: known?.amount ?? outcome?.amount ?? this.payAmount ?? ctx.amount ?? this.lastAmount() ?? 0 };\n this.doneAmount = result.amount;\n this.doneMethod = result.paymentMethod;\n ctx.report(finalizeFailed ? 'finalize-failed' : 'paid', { result });\n ctx.setBusy(false);\n ctx.complete(result);\n }\n\n /** Pays: validates the panel, confirms the Payment Element (creating the intent), then records it through the host. */\n async pay(): Promise<void> {\n const ctx = this.ctx();\n const payment = this.payment();\n if (this.processing() || this.estimating() || this.done() || !payment || this.isBlocked()) return;\n if (!ctx.validate() || ctx.amount == null) return;\n this.payAmount = ctx.amount; // PINNED: what is recorded later is what this click asked for, whatever the amount field says by then\n this.payMethod = ctx.method;\n const attemptAmount: number = ctx.amount; // captured for THIS attempt: a late answer must not read the fields a newer click overwrote\n const attemptMethod: string = ctx.method;\n this.error.set('');\n this.processing.set(true);\n ctx.setBusy(true);\n ctx.announce(this.labels.t('stripePaymentMethod.announceProcessing'));\n let finished = false;\n try {\n const event = await payment.confirm();\n if (event) finished = await this.afterConfirm(event, ctx, attemptAmount, attemptMethod);\n } finally {\n this.processing.set(false);\n // An UNKNOWN outcome keeps the panel busy: the status check, the host or a late answer settles it (onAttemptOutcome frees the panel).\n if (!finished && !payment.attempt.unknown()) ctx.setBusy(false);\n }\n }\n\n private async afterConfirm(event: StripeConfirmedEvent, ctx: PaymentMethodContext, amount: number, method: string): Promise<boolean> {\n if (this.done()) return true; // already recorded by a status check while the confirmation was still pending\n const money = formatCurrency(amount, { currency: ctx.currency });\n if (event.outcome !== 'succeeded' && event.outcome !== 'processing' && event.outcome !== 'requires_verification') {\n this.error.set(this.texts.notCompleted);\n return false;\n }\n // Paid or accepted: the intent is the host's now, a close must not cancel it.\n const info = this.intent;\n this.intent = null;\n let finalizeFailed = false;\n const finalize = this.config().finalize();\n if (finalize && info) {\n try { await callHost(() => finalize(info)); } catch { finalizeFailed = true; } // Stripe took the payment: the host's webhook reconciles\n }\n const result = { type: 'stripe' as const, paymentMethod: method, amount };\n this.doneAmount = amount;\n this.doneMethod = method;\n if (event.outcome === 'succeeded') {\n ctx.report(finalizeFailed ? 'finalize-failed' : 'paid', { result });\n this.done.set(true);\n ctx.complete(result);\n return true;\n }\n const verification = event.outcome === 'requires_verification';\n ctx.report(finalizeFailed ? 'finalize-failed' : verification ? 'verification' : 'processing', { result });\n this.confirmation.set(verification\n ? { title: '', message: this.texts.verificationMessage(money), verification: true }\n : { title: this.texts.achTitle, message: this.texts.achMessage(money) });\n ctx.setExclusive(true);\n ctx.setBusy(false);\n afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('.psm-notice')?.focus(), { injector: this.injector });\n return true;\n }\n\n /** \"Done\" on the ACH / verification notice, or closing the panel while the notice is up: the accepted payment is reported as recorded (once). */\n private finish(): void {\n const ctx = this.ctx();\n if (this.done()) return;\n this.done.set(true);\n ctx.complete({ type: 'stripe', paymentMethod: this.doneMethod ?? ctx.method, amount: this.doneAmount || ctx.amount || this.lastAmount() || 0 });\n }\n\n /**\n * Cancels the abandoned intent (close, another method, a retry). Unless `force`, it is left alone while a payment is being confirmed:\n * a retry (`createIntentFn`) runs inside `pay()`, so it forces the cancel of the PREVIOUS attempt's intent.\n */\n private cancelIntent(force = false): void {\n const info = this.intent;\n if (!info || (this.processing() && !force)) return;\n if (this.attemptUnknown) return; // the confirmation may still be running at Stripe: cancelling its intent could cancel a payment that is about to succeed\n this.intent = null;\n const cancel = this.config().cancel();\n if (cancel) callHost(() => cancel(info)).catch(() => { /* best effort */ });\n }\n}\n","import { ChangeDetectionStrategy, Component, DestroyRef, ViewEncapsulation, computed, effect, inject, input, output, signal, untracked } from '@angular/core';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent, UiLabelsService } from '@forgeroute/ui/core';\nimport { builtInReadinessReasons, callHost, type PaymentReaderBannerConfig, type PaymentReaderState } from '@forgeroute/ui/payments';\nimport { normalizeReadiness, readerBannerReasonKey, type StripeReaderGetReadinessFn, type StripeReaderReadiness } from './stripe-reader.models';\n\n/**\n * Gives a host without `ui-payment-stripe-method` in its panel the `[readerBanner]` config of `ui-payment-side-panel` (merchant not ready, collection off, no payable version: no plugin is rendered, but the banner must show).\n * With the plugin rendered a plain `{ getReadiness }` object is enough (the plugin supplies the component).\n *\n * readonly banner = computed(() => stripeReaderBannerConfig({ getReadiness: this.readiness, refreshKey: this.readersVersion() }));\n */\nexport function stripeReaderBannerConfig(config: Omit<PaymentReaderBannerConfig, 'component'>): PaymentReaderBannerConfig {\n return { ...config, component: StripeReaderBannerComponent };\n}\n\n/**\n * The service states the banner shows: the organization has NO usable card reader (`no_reader`, `unsupported_only`, `merchant_not_ready`) or HAS one that is not connected (`reader_offline`).\n * Busy, ready, checking and a failed read show nothing (busy means in use, never \"not connected\").\n */\nexport const STRIPE_READER_BANNER_STATES: readonly StripeReaderReadiness['state'][] = ['no_reader', 'unsupported_only', 'merchant_not_ready', 'reader_offline'];\n\n/** The banner states in which a reader exists but is not connected: \"Your card reader is not connected.\" with the one action \"Connect Your Reader\". */\nexport const STRIPE_READER_NOT_CONNECTED_STATES: readonly StripeReaderReadiness['state'][] = ['reader_offline'];\n\n/**\n * The card reader banner: a SMALL `ui-alert` (info, one line, ONE action) for a STAFF place where a customer payment can be taken. Two situations show it:\n * - NO reader (`no_reader`, `unsupported_only`): \"Get a card reader to take in-person card payments.\" with ONLY \"Get a card reader\" (`order`; \"How to get a card reader\" when `hardwareShopAvailable` is false);\n * - a reader that is NOT CONNECTED (`reader_offline`): \"Your card reader is not connected.\" with ONLY \"Connect Your Reader\" (`connect`);\n * - `merchant_not_ready`: payments must be set up first (`setup`).\n * It renders NOTHING in every other state (reader ready, busy = in use, still checking, a failed read, an offline browser): those belong to the reader screen the payment plugin shows when Card is chosen. `ui-payment-side-panel [readerBanner]` renders it as the first element of the panel. Never use it in a payer-facing component.\n *\n * <ui-stripe-reader-banner [getReadiness]=\"readiness\" [refreshKey]=\"readersVersion()\" [hardwareShopAvailable]=\"canOrder()\" (connect)=\"openPairing()\" (order)=\"openOrder()\" (setup)=\"openSetup()\" />\n *\n * A readiness `reason` of `sandbox`, `service_disabled` or `processor_unsupported` (in any state the banner shows) gives its own plain message and NO button (see `STRIPE_READER_BANNER_REASONS`: \"Card readers are not available in a sandbox account.\", \"Card readers are turned off for this account.\", \"Card readers are not available with this payment processor.\"; Spanish in the dictionary); the banner still appears only in its listed states (no_reader, unsupported_only, merchant_not_ready, reader_offline).\n * `hardwareShopAvailable` false: \"How to get a card reader\", the same `order` output; `merchant_not_ready` says payments must be\n * set up first and offers \"Set up payments\" (\"Reconnect payments\" when the account must be reconnected; `setup`). The container is always in the DOM (it mounts when the panel opens, the host never gates anything on the read); the alert appears when the answer\n * arrives. The readiness is read FRESH on every start and every `refreshKey` change (and `refresh()`), never cached or polled; a failed or slow read (over `readinessTimeoutMs`) or an offline browser shows nothing and asks nothing more. No HTTP: the host's `getReadiness` calls its own backend.\n */\n@Component({\n selector: 'ui-stripe-reader-banner',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n // the host is `hidden` (display: none) while the banner shows nothing, so a flex / gap parent (the payment panel) leaves no empty gap\n host: { '[hidden]': '!shown()' },\n imports: [AlertComponent, ButtonComponent],\n template: `\n <div class=\"srb\" data-testid=\"reader-banner\" [attr.data-state]=\"shownState()\">\n @if (shown(); as r) {\n <ui-alert variant=\"info\" [quiet]=\"true\" data-testid=\"reader-banner-message\">\n <span class=\"srb-line\">{{ message() }}</span>\n @if (!reasonKey()) {\n <!-- a sandbox / service-off / unsupported-processor reason has no action: only the message -->\n <span class=\"srb-actions\">\n @if (r.state === 'merchant_not_ready') {\n <ui-button variant=\"link\" size=\"sm\" data-testid=\"reader-banner-setup\" (click)=\"setup.emit()\">{{ labels.t(r.reason === 'reconnect_required' ? 'stripeReader.status.reconnect' : 'stripeReader.status.setup') }}</ui-button>\n } @else if (notConnected()) {\n <!-- a reader exists but is not connected: the ONLY action is to connect it -->\n <ui-button variant=\"link\" size=\"sm\" data-testid=\"reader-banner-connect\" (click)=\"connect.emit()\">{{ labels.t('stripeReader.status.connectYours') }}</ui-button>\n } @else {\n <!-- no reader yet: the ONLY action is how to get one -->\n <ui-button variant=\"link\" size=\"sm\" data-testid=\"reader-banner-get\" (click)=\"order.emit()\">{{ labels.t(hardwareShopAvailable() ? 'stripeReader.status.get' : 'stripeReader.status.getInfo') }}</ui-button>\n }\n </span>\n }\n </ui-alert>\n }\n </div>\n `,\n styles: [`\n ui-stripe-reader-banner { display: block; min-width: 0; }\n ui-stripe-reader-banner[hidden] { display: none; }\n ui-stripe-reader-banner .srb-line { margin-right: 8px; }\n ui-stripe-reader-banner .srb-actions { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }\n `],\n})\nexport class StripeReaderBannerComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly destroyRef = inject(DestroyRef);\n\n /** The host's readiness call (`GET /v1/terminal/readiness`, through its own backend). Called FRESH every time. */\n readonly getReadiness = input<StripeReaderGetReadinessFn | null>(null);\n /** Any value that changes when the host knows the readers changed (a reader was connected, an order was placed): every change reads the readiness again. */\n readonly refreshKey = input<unknown>(null);\n /** `true` (default): \"Get a card reader\" opens the host's order flow. `false`: \"How to get a card reader\" and the host opens an info card. Same `order` output. */\n readonly hardwareShopAvailable = input(true);\n /** Kept for backward compatibility: there is no connected line any more, so it changes nothing. */\n readonly hideReady = input(false);\n /** A read slower than this shows nothing (ms). */\n readonly readinessTimeoutMs = input(4000);\n /** Managed environments where `navigator.onLine === false` is a false negative: do not treat the browser's offline flag as offline (default false). */\n readonly offlineOverride = input(false);\n /** `true` while the banner is kept but not shown (the panel hides it after a payment was taken): it asks the host nothing; shown again it reads once only if a read was asked for meanwhile. */\n readonly paused = input(false);\n\n /** \"Connect Your Reader\" (a reader that is not connected): the host opens its pairing screen. */\n readonly connect = output<void>();\n /** \"Get a card reader\" / \"How to get a card reader\": the host opens its order flow or an info card. */\n readonly order = output<void>();\n /** \"Set up payments\" / \"Reconnect payments\": the host opens payment setup. */\n readonly setup = output<void>();\n /** The banner's readiness state whenever it changes (`{ state, stale, at, ready }`; `state` is `checking` when the last read failed; never `unknown`). `ui-payment-side-panel` re-emits it as `(readerState)`. */\n readonly stateChange = output<PaymentReaderState>();\n\n private readonly confirmed = signal<{ readiness: StripeReaderReadiness; at: Date } | null>(null);\n private readonly failed = signal(false);\n private readonly offline = signal(false);\n private run = 0;\n private destroyed = false;\n private readWhenShown = false;\n\n /** The answer on screen: only a CONFIRMED, latest answer in which the organization has no usable reader. */\n protected readonly shown = computed((): StripeReaderReadiness | null => {\n const c = this.confirmed();\n return c && !this.failed() && !this.offline() && STRIPE_READER_BANNER_STATES.includes(c.readiness.state) ? c.readiness : null;\n });\n readonly shownState = computed(() => this.shown()?.state ?? 'none');\n /** A reader exists but is not connected (`reader_offline`). */\n protected readonly notConnected = computed(() => STRIPE_READER_NOT_CONNECTED_STATES.includes(this.shown()?.state as StripeReaderReadiness['state']));\n /** The label key of a reason with its own no-button wording (`sandbox`, `service_disabled`, `processor_unsupported`), else null. Never for a not-connected reader (its message is about the reader). */\n protected readonly reasonKey = computed(() => (this.notConnected() ? null : readerBannerReasonKey(this.shown()?.reason)));\n protected readonly message = computed(() => this.labels.t(this.reasonKey() ?? (this.notConnected() ? 'stripeReader.banner.notConnected' : this.shown()?.state === 'merchant_not_ready' ? 'stripeReaderBanner.setupFirst' : 'stripeReaderBanner.getReader')));\n\n constructor() {\n this.destroyRef.onDestroy(() => { this.destroyed = true; });\n const syncOffline = (): void => { this.offline.set(builtInReadinessReasons(this.offlineOverride()).includes('offline')); };\n if (typeof window !== 'undefined') {\n const update = (): void => { syncOffline(); untracked(() => { if (!this.offline()) void this.refresh(); }); };\n window.addEventListener('online', update);\n window.addEventListener('offline', update);\n this.destroyRef.onDestroy(() => { window.removeEventListener('online', update); window.removeEventListener('offline', update); });\n }\n effect(() => {\n const read = this.getReadiness();\n this.refreshKey();\n this.offlineOverride();\n untracked(() => { syncOffline(); if (read) void this.refresh(); });\n });\n effect(() => {\n const paused = this.paused();\n untracked(() => { if (!paused && this.readWhenShown) { this.readWhenShown = false; void this.refresh(); } });\n });\n effect(() => {\n const c = this.confirmed();\n const failed = this.failed();\n const next: PaymentReaderState | null = c && !failed ? { state: c.readiness.state, stale: false, at: c.at, ready: c.readiness.state === 'reader_ready' } : failed ? { state: 'checking', stale: true, at: null, ready: false } : null;\n untracked(() => { if (next) this.stateChange.emit(next); });\n });\n }\n\n /** Reads the readiness NOW. Never cached. A failed, slow or `checking` answer shows nothing; offline asks nothing. */\n async refresh(): Promise<void> {\n const read = this.getReadiness();\n if (!read || this.destroyed || this.offline()) return;\n if (untracked(() => this.paused())) { this.readWhenShown = true; return; }\n const run = ++this.run;\n let result: StripeReaderReadiness | null = null;\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<'timeout'>(resolve => { timer = setTimeout(() => resolve('timeout'), Math.max(1, this.readinessTimeoutMs())); });\n const raw = await Promise.race([callHost(() => read()), timeout]);\n result = raw === 'timeout' ? null : normalizeReadiness(raw);\n } catch { result = null; } finally { if (timer) clearTimeout(timer); }\n if (this.destroyed || run !== this.run) return;\n if (result && result.state !== 'checking') {\n const at = result.checkedAt ? new Date(result.checkedAt) : new Date();\n this.confirmed.set({ readiness: result, at: Number.isNaN(at.getTime()) ? new Date() : at });\n this.failed.set(false);\n } else {\n this.failed.set(true);\n }\n }\n}\n","import { ChangeDetectionStrategy, Component, TemplateRef, forwardRef, input, output, viewChild, computed, signal } from '@angular/core';\nimport { callHost, PAYMENT_METHOD_PLUGIN, PAYMENT_READINESS_EVERY_MS, PAYMENT_READINESS_TIMEOUT_MS, PAYMENT_REQUEST_TIMEOUT_MS, PAYMENT_STATUS_CHECK_TIMEOUT_MS, PAYMENT_STATUS_FAIL_GRACE_MS, PAYMENT_AUTH_TIMEOUT_MS, PAYMENT_STATUS_POLL_MAX_MS, PAYMENT_STATUS_POLL_MS, PaymentMethodPlugin, type CheckPaymentStatusFn, type PaymentAttemptControls, type HostResult, type PaymentMethodBodyContext, type PaymentPendingCheckInfo, type PaymentPendingCheckResult, type PaymentPluginMethod, type ReadinessCheckFn } from '@forgeroute/ui/payments';\nimport type { StripeBillingDetails } from '../stripe-payment/stripe-payment.component';\nimport type { StripeReaderConfig, StripeReaderPayment } from '../stripe-reader/stripe-reader.models';\nimport { PaymentStripeBodyComponent } from './payment-stripe-body.component';\nimport { StripeReaderBannerComponent } from '../stripe-reader/stripe-reader-banner.component';\nimport { STRIPE_READER_LOST_ANSWER_GRACE_MS } from '../stripe-reader/stripe-reader.flow';\nimport { paymentBaseAmount, readerErrorInfo } from '../stripe-reader/stripe-reader.models';\nimport { STRIPE_METHOD_TEXTS, STRIPE_PAYMENT_METHODS, type StripeReaderLeftPending, type StripeFeeContext, type StripeFees, type StripeIntentContext, type StripeIntentInfo, stripeMethodLabel } from './payment-stripe-method.models';\n\n/**\n * Adds LIVE Card and ACH (Stripe) to `ui-payment-side-panel`. Put it inside the panel only for customers who use Stripe: its presence replaces the\n * record-only Card / ACH (last 4 digits) with the Payment Element; remove it and the panel is record-only again.\n *\n * <ui-payment-side-panel ...>\n * @if (stripeEnabled()) {\n * <ui-payment-stripe-method [publishableKey]=\"key\" [createIntent]=\"createIntent\" [finalize]=\"finalize\" [cancel]=\"cancel\" />\n * }\n * </ui-payment-side-panel>\n *\n * The host owns the HTTP: `createIntent(ctx)` (POST create-payment-intent) answers `{ clientSecret, paymentIntentId, fees... }`, `finalize(info)` (POST\n * process-payment) runs after Stripe took the payment, `cancel(info)` cancels an abandoned intent. Outcomes arrive as the panel's `outcome` events with\n * kind `'plugin'` and codes `paid`, `processing`, `verification`, `finalize-failed` and `failed`.\n */\n@Component({\n selector: 'ui-payment-stripe-method',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [PaymentStripeBodyComponent],\n providers: [{ provide: PAYMENT_METHOD_PLUGIN, useExisting: forwardRef(() => StripePaymentMethodComponent) }],\n host: { style: 'display: none' },\n template: `<ng-template #body let-ctx><ui-payment-stripe-body [ctx]=\"ctx\" [config]=\"self\" /></ng-template>`,\n})\nexport class StripePaymentMethodComponent extends PaymentMethodPlugin {\n protected readonly self = this;\n /** Creates the PaymentIntent on the host's backend (called when the payer presses Pay). */\n readonly createIntent = input<((ctx: StripeIntentContext) => HostResult<StripeIntentInfo>) | null>(null);\n /** Records the payment after Stripe accepted it (succeeded, processing or needs bank verification). A failure here is reported, the payment still counts as taken. */\n readonly finalize = input<((info: StripeIntentInfo) => HostResult<unknown>) | null>(null);\n /** Cancels an intent that was created but not paid (panel closed, another method, a retry). */\n readonly cancel = input<((info: StripeIntentInfo) => HostResult<unknown>) | null>(null);\n /** Optional fee preview before paying; its `totalAmount` becomes the amount of the Payment Element (it must equal the intent's amount). */\n readonly estimateFees = input<((ctx: StripeFeeContext) => HostResult<StripeFees>) | null>(null);\n readonly publishableKey = input<string | null>(null);\n /** Connect account for direct charges; Stripe.js is loaded for it. */\n readonly stripeAccount = input<string | null>(null);\n readonly billingDetails = input<StripeBillingDetails | null>(null);\n readonly appearance = input<Record<string, unknown> | null>(null);\n /** The methods this plugin takes over (default: Card and ACH / Bank Transfer). Pass `[{ value: 'CARD', label: 'Card' }]` for cards only. */\n readonly methodListInput = input<readonly PaymentPluginMethod[] | null>(null, { alias: 'methodList' });\n readonly methodList = computed((): readonly PaymentPluginMethod[] => this.methodListInput() ?? STRIPE_PAYMENT_METHODS.map(m => ({ ...m, label: stripeMethodLabel(m.value, m.label) })));\n /** How long a fee estimate may take before Pay is released and \"Try again\" is offered (ms). */\n readonly estimateTimeoutMs = input(10000);\n /** The payer covers fees, so the intent amount is payment + fees: a rejected or empty estimate keeps Pay off (with \"Try again\") instead of falling back to the base amount, which Stripe would reject as a mismatch. */\n readonly feesRequired = input(false);\n /**\n * Opt-in (default off: the estimate and the intent request are exactly as before). For a fee schedule that depends on the card's funding (a platform fee on credit cards only):\n * once the typed card is complete a ConfirmationToken is made from the Payment Element, its funding is passed to `estimateFees` (`ctx.funding`, `ctx.confirmationTokenId`) so\n * the fee rows and the total update (credit vs debit vs bank account), and `createIntent` gets `confirmationTokenId` + `funding` for the backend's own lookup. Needs `[estimateFees]`.\n */\n readonly fundingPreview = input(false);\n // ── Duplicate-payment protection and readiness gate (opt-in: with `duplicateProtection` off the plugin behaves exactly as before) ──\n /** Turns on the duplicate-charge protection and the readiness gate of the Payment Element (docs: \"Duplicate-payment protection\", \"Readiness gate\"). Default off. */\n readonly duplicateProtection = input(false);\n /**\n * The payable this is for (an invoice, a balance, a payment link). While an attempt is undecided its opaque marker (key, amount, method) is stored under it in `localStorage`, so a RELOAD or a\n * SECOND TAB of the same payable starts locked (unknown) with the same attempt key. Without it the protection covers this page instance only. Nothing else is stored.\n */\n readonly payableRef = input<string | null>(null);\n /** A key the host supplies; empty = generated per payment attempt session (it arrives in `createIntent(ctx).attemptKey`). */\n readonly attemptKey = input<string | null>(null);\n /** The host's status check by attempt key: resolves an UNKNOWN outcome (timeout, offline mid-flight, abandoned 3-D Secure challenge). */\n readonly checkStatus = input<CheckPaymentStatusFn | null>(null);\n /** The payable is paid (host re-render, back navigation): Pay stays locked for good. */\n readonly paid = input(false);\n /** The host reports an ambiguous result of ITS charge call: \"Checking your payment...\" while true. */\n readonly hostPending = input(false);\n readonly statusPollMs = input(PAYMENT_STATUS_POLL_MS);\n readonly statusPollMaxMs = input(PAYMENT_STATUS_POLL_MAX_MS);\n /** A status check slower than this counts as unknown (ms). */\n readonly statusCheckTimeoutMs = input(PAYMENT_STATUS_CHECK_TIMEOUT_MS);\n /** While the attempt's own request is unsettled, a status answer `failed` is ignored for this long (ms). */\n readonly statusFailGraceMs = input(PAYMENT_STATUS_FAIL_GRACE_MS);\n /** Offer \"Start over\" after the status polling window (a new attempt with a NEW key). Turn it on ONLY when your backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key: that rule is what makes it safe. */\n readonly allowStartOver = input(false);\n /** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a payment because of the browser's offline flag (default false). */\n readonly offlineOverride = input(false);\n /** The request timeout is replaced by this while a 3-D Secure challenge or the bank window is open (ms). */\n readonly authTimeoutMs = input(PAYMENT_AUTH_TIMEOUT_MS);\n /** How long ONE confirmation (intent creation + Stripe confirmation) may take before the outcome counts as unknown (ms). */\n readonly confirmTimeoutMs = input(PAYMENT_REQUEST_TIMEOUT_MS);\n /** The host's readiness endpoint (`GET /api/payments/ready`): `{ ready, reasons[] }`. */\n readonly readinessCheck = input<ReadinessCheckFn | null>(null);\n readonly readinessTimeoutMs = input(PAYMENT_READINESS_TIMEOUT_MS);\n readonly readinessEveryMs = input(PAYMENT_READINESS_EVERY_MS);\n // ── Card reader mode (opt-in: with no `[reader]` nothing changes) ──\n /**\n * The card-reader calls. With it, the method Card gets a choice \"Card reader | Enter card manually\" above the form and the READER is the default as soon as the first readiness answer says `reader_ready`\n * (`[readerFirst]`); otherwise manual stays the default and one reader banner explains why. The payer can always switch to the manual card; switching away while a reader payment waits first cancels it through\n * `reader.cancelPayment`. See docs/card-readers.md.\n */\n readonly reader = input<StripeReaderConfig | null>(null);\n /** The reader is the default when it is ready (default true). `false` keeps manual as the default and only offers the choice. */\n readonly readerFirst = input(true);\n /** \"Connect Your Reader\" (banner, a reader that is not connected): the host opens its pairing panel (`ui-stripe-readers`). */\n readonly readerConnect = output<void>();\n /** \"Get a card reader\": the host opens its order flow. */\n readonly readerOrder = output<void>();\n /** \"Set up payments\": the host opens payment setup. */\n readonly readerSetup = output<void>();\n /**\n * Library source 2026-11-21: how often (ms) the waiting reader payment's status is read (default 2000; clamped to 500..30 000). Wins over `reader.pollMs`. Unset (`null`) = `reader.pollMs`, else 2000.\n */\n readonly readerPollMs = input<number | null>(null);\n /**\n * Library source 2026-11-21: `true` while a reader payment is open (starting, waiting for the tap, declined and retryable, retrying, cancelling or recovering a lost answer), `false` when it is idle or\n * finished. Emitted only when the value changes (nothing at start), so a host can block its other pay actions and keep the panel locked meanwhile (see also `ui-payment-side-panel`'s `(busyChange)`).\n * It is NEVER sent as `false` for a reader payment that may still exist at the processor: when the body is destroyed or the reader screen is removed while one is open, `readerLeftPending` is emitted instead.\n */\n readonly readerBusyChange = output<boolean>();\n /**\n * Library source 2026-11-21: the body went away (panel closed, method changed, plugin removed) or the reader screen was removed (reader switched off) while a reader payment was open. No `readerBusyChange(false)` is sent for it (the payment may\n * still exist): the host keeps its other pay actions blocked and reads the server's own hold. Inside `ui-payment-side-panel` bind the panel's `(leftPending)` instead (it also covers manual confirmations, terminal payments and record requests).\n */\n readonly readerLeftPending = output<StripeReaderLeftPending>();\n // ── Blocked (opt-in: unset = nothing changes) ──\n /**\n * Library source 2026-11-21: while `true` the Pay button of this method is disabled and `pay()` does nothing, the reader's \"Send to the reader\" starts nothing (a reader payment that is already open keeps its \"Try again\" and Cancel) and the Reader | Manual\n * choice cannot be switched; `blockedReason` is shown as a `role=\"status\"` message. A payment that is already running is not cancelled and keeps its Cancel. Inside `ui-payment-side-panel` use the\n * panel's own `[blocked]` instead (it also blocks the method select and shows the message once); this input is for a plugin used on its own.\n */\n readonly blocked = input(false);\n /** Why it is blocked (shown while `blocked`). Empty = the default text of the label `paymentBlocked.default`. */\n readonly blockedReason = input('');\n readonly receiptNoteInput = input<string | null>(null, { alias: 'receiptNote' });\n readonly receiptNote = computed((): string => this.receiptNoteInput() ?? STRIPE_METHOD_TEXTS.receiptNote);\n\n private readonly body = viewChild<TemplateRef<PaymentMethodBodyContext>>('body');\n\n // ── The host resolves an undecided attempt itself (without a status check): the body registers its controls here ──\n private readonly controls = signal<PaymentAttemptControls | null>(null);\n /** @internal The body registers itself. */\n attachControls(controls: PaymentAttemptControls): void { this.controls.set(controls); }\n /** @internal The body leaves. */\n detachControls(controls: PaymentAttemptControls): void { if (this.controls() === controls) this.controls.set(null); }\n /** The host's charge of this payment is ambiguous (its call timed out): the plugin shows \"Checking your payment...\" and stays locked (see `checkStatus`). */\n markUnknown(): void { this.controls()?.markUnknown(); }\n /** The host's charge succeeded: the plugin records it (paid + complete) and locks the payable. */\n markSucceeded(): void { this.controls()?.markSucceeded(); }\n /** The host's charge was DEFINITIVELY refused: the plugin unlocks with a NEW attempt key. */\n markFailed(): void { this.controls()?.markFailed(); }\n /** NOTHING was sent to the processor: the plugin unlocks and the attempt key is KEPT (the backend must still answer the state of an attempt it already holds for that key). */\n markNotCharged(): void { this.controls()?.markNotCharged(); }\n /** The host starts a deliberate SECOND payment of this payable (an explicit \"pay again\" flow): forgets the paid state this form saw, removes the succeeded record and moves the epoch so the next attempt has a NEW key. Does nothing against the host's own `paid` input. */\n resetPaid(): void { this.controls()?.resetPaid(); }\n\n\n /** The attempt this plugin last started (a reader payment or a manual card confirmation), kept here because the body is gone when the panel closes: what the panel's \"Check again\" reads. */\n private remembered: { key: string; kind: 'reader' | 'manual'; amount?: number } | null = null;\n /** @internal The body names the attempt it just started. */\n rememberAttempt(key: string | undefined, kind: 'reader' | 'manual', amount?: number): void { if (key) this.remembered = { key, kind, ...(amount !== undefined ? { amount } : {}) }; }\n\n /**\n * Library round 4 (2026-11-21): the truth of the payment the panel is holding, read by ATTEMPT KEY. A reader payment is read with `reader.getPayment`, a manual card / bank confirmation with `checkStatus`.\n * `over` only when the answer proves nothing is open (a canceled / failed payment; \"never seen\" only once the hold is older than the processing window, because a slow original request may still be on its way);\n * `succeeded` when it was paid; `open` while it runs; `checking` when it cannot be told (no key, no host call, a failed read).\n */\n override async checkPending(info: PaymentPendingCheckInfo): Promise<PaymentPendingCheckResult> {\n const key = info.paymentAttemptKey ?? this.remembered?.key;\n if (!key) return { state: 'checking' };\n const known = this.remembered && this.remembered.key === key ? this.remembered : null;\n const kind = known?.kind ?? (this.reader() ? 'reader' : 'manual');\n if (kind === 'reader') {\n const reader = this.reader();\n if (!reader) return { state: 'checking' };\n let payment: StripeReaderPayment | null = null;\n try { payment = (await callHost(() => reader.getPayment({ paymentId: null, attemptKey: key }))) ?? null; } catch (error) {\n if (readerErrorInfo(error).status !== 404) return { state: 'checking' };\n payment = null;\n }\n if (!payment || typeof payment !== 'object' || typeof payment.id !== 'string') return { state: info.ageMs >= STRIPE_READER_LOST_ANSWER_GRACE_MS ? 'over' : 'checking' };\n const status = String(payment.status ?? '').toUpperCase();\n const terminal = payment.terminal?.state;\n if (status === 'SUCCEEDED' || terminal === 'succeeded') {\n const amount = paymentBaseAmount(payment) ?? known?.amount;\n return { state: 'succeeded', result: { type: 'stripe', paymentMethod: info.method, ...(amount !== undefined && amount !== null ? { amount } : {}) } };\n }\n if (status === 'CANCELED' || status === 'FAILED' || terminal === 'canceled') return { state: 'over' };\n return { state: 'open' };\n }\n const check = this.checkStatus();\n if (!check) return { state: 'checking' };\n let answer: string;\n try { answer = String(await callHost(() => check(key))); } catch { return { state: 'checking' }; }\n switch (answer) {\n case 'succeeded': return { state: 'succeeded', result: { type: 'stripe', paymentMethod: info.method, ...(known?.amount !== undefined ? { amount: known.amount } : {}) } };\n case 'failed': return { state: 'over' };\n case 'not_found': return { state: info.ageMs >= this.confirmTimeoutMs() + this.statusFailGraceMs() ? 'over' : 'checking' };\n case 'in_flight':\n case 'awaiting_verification': return { state: 'open' };\n default: return { state: 'checking' };\n }\n }\n\n readonly methods = this.methodList;\n readonly template = this.body;\n /** The card reader banner the panel's `[readerBanner]` renders (library source 2026-11-21): rendering this plugin in the panel is all a host needs to do for it. */\n override readonly readerBannerComponent = StripeReaderBannerComponent;\n}\n","import { ChangeDetectionStrategy, Component, DestroyRef, ViewEncapsulation, computed, effect, inject, input, output, signal, untracked, viewChildren } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { BadgeComponent } from '@forgeroute/ui/badge';\nimport { ButtonComponent, ModalComponent, UiFieldValidity, UiLabelsService, type UiLabelKey } from '@forgeroute/ui/core';\nimport { FormRowComponent } from '@forgeroute/ui/form-row';\nimport { FormSectionComponent } from '@forgeroute/ui/form-section';\nimport { LiveRegionComponent } from '@forgeroute/ui/live-region';\nimport { SelectComponent } from '@forgeroute/ui/select';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { TextInputComponent } from '@forgeroute/ui/text-input';\nimport { callHost, type HostResult } from '@forgeroute/ui/payments';\nimport { STRIPE_READER_REQUEST_TIMEOUT_MS } from './stripe-reader.flow';\nimport { StripeReaderStatusComponent } from './stripe-reader-status.component';\nimport {\n STRIPE_READER_MODELS, normalizeReadiness, readerDisplayName, readerErrorInfo,\n type StripeReader, type StripeReaderCreateLocationFn, type StripeReaderGetReadinessFn, type StripeReaderListLocationsFn, type StripeReaderLocation, type StripeReaderReadiness,\n type StripeReaderRegisterFn, type StripeReaderRemoveFn, type StripeReaderRenameFn,\n} from './stripe-reader.models';\n\n/** What `(outcome)` reports. */\nexport type StripeReadersOutcome =\n | { kind: 'registered'; reader: StripeReader }\n | { kind: 'renamed'; reader: StripeReader }\n | { kind: 'removed'; readerId: string }\n | { kind: 'location-created'; location: StripeReaderLocation }\n | { kind: 'failed'; action: 'load' | 'register' | 'rename' | 'remove' | 'location'; code: string; message: string };\n\n/** `RegisterReaderDto.registrationCode` of the payments service (forgeroute-payments `terminal.dto.ts`). */\nconst CODE_PATTERN = /^[A-Za-z0-9-]{3,100}$/;\n\ntype Busy = '' | 'load' | 'register' | 'rename' | 'remove' | 'location';\n\n/**\n * Staff screen to connect and manage card readers (put it inside the host's own side panel). Everything is a host call (the browser never talks to the payments service):\n *\n * - the banner is the SAME single readiness state as the payment screen (`ui-stripe-reader-status`, without \"Connect a reader\": you are already here);\n * - \"Connect a reader\": the registration code the reader shows (Stripe Reader S700 / S710: Settings, generate a pairing code; BBPOS WisePOS E: press 0-7-1-3-9 on the home screen), a name and a\n * location. The code is typed once, cleared from the form BEFORE the call and never shown, stored or logged again, success or failure;\n * - the list shows each reader with its model and a status badge (Online / Offline / Registering, Busy, Not supported) and lets staff rename or remove it (removing asks for confirmation; a reader that\n * holds a payment is refused with `reader_busy`: cancel the payment first);\n * - \"Get a card reader\" is an output: the host opens its order flow.\n *\n * <ui-stripe-readers [getReadiness]=\"readiness\" [registerReader]=\"register\" [renameReader]=\"rename\" [removeReader]=\"remove\" [listLocations]=\"locations\" [createLocation]=\"createLocation\"\n * (getReader)=\"openOrder()\" (changed)=\"refreshPayments()\" />\n */\n@Component({\n selector: 'ui-stripe-readers',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [FormsModule, AlertComponent, BadgeComponent, ButtonComponent, FormRowComponent, FormSectionComponent, LiveRegionComponent, ModalComponent, SelectComponent, SkeletonComponent, StripeReaderStatusComponent, TextInputComponent],\n template: `\n <ui-live-region data-testid=\"readers-live\" [message]=\"announcement()\" />\n <div class=\"srs-readers\">\n <ui-stripe-reader-status [readiness]=\"readiness()\" [loading]=\"busy() === 'load' && !readiness()\" [hideConnect]=\"true\" (getReader)=\"getReader.emit()\" (recheck)=\"load()\" (openSetup)=\"openSetup.emit()\" />\n\n @if (error(); as err) {\n <ui-alert variant=\"danger\" [quiet]=\"true\" data-testid=\"readers-error\" [attr.data-action]=\"err.action\">{{ err.text }}</ui-alert>\n }\n\n <section class=\"srs-section\" [attr.aria-labelledby]=\"ids + '-list-title'\">\n <h3 class=\"srs-h\" [id]=\"ids + '-list-title'\">{{ labels.t('stripeReaders.list.title') }}</h3>\n @if (busy() === 'load' && !readiness()) {\n <ui-skeleton [height]=\"44\" [ariaLabel]=\"labels.t('stripeReader.status.loading')\" />\n } @else if (readers().length === 0) {\n <p class=\"srs-muted\" data-testid=\"readers-empty\">{{ labels.t('stripeReaders.list.empty') }}</p>\n } @else {\n <ul class=\"srs-list\" data-testid=\"readers-list\">\n @for (reader of readers(); track reader.id) {\n <li class=\"srs-item\" data-testid=\"reader-item\" [attr.data-reader-id]=\"reader.id\">\n @if (renamingId() === reader.id) {\n <ui-text-input class=\"srs-rename\" [label]=\"labels.t('stripeReaders.rename.label')\" [required]=\"true\" [maxlength]=\"100\" [ngModel]=\"renameValue()\" (ngModelChange)=\"renameValue.set($event ?? '')\"\n [showErrors]=\"renameTouched()\" inputTestId=\"reader-rename-input\" />\n <div class=\"srs-actions\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-rename-save\" [loading]=\"busy() === 'rename'\" [disabled]=\"busy() !== ''\" (click)=\"saveRename(reader)\">{{ labels.t('common.save') }}</ui-button>\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-rename-cancel\" [disabled]=\"busy() === 'rename'\" (click)=\"renamingId.set('')\">{{ labels.t('common.cancel') }}</ui-button>\n </div>\n } @else {\n <div class=\"srs-item-main\">\n <strong class=\"srs-name\" data-testid=\"reader-name\">{{ name(reader) }}</strong>\n <span class=\"srs-muted\" data-testid=\"reader-model\">{{ model(reader) }}</span>\n </div>\n <div class=\"srs-badges\">\n <ui-badge [label]=\"statusLabel(reader)\" [variant]=\"statusVariant(reader)\" data-testid=\"reader-device-status\" />\n @if (reader.busy) { <ui-badge [label]=\"labels.t('stripeReaders.badge.busy')\" variant=\"amber\" data-testid=\"reader-busy\" /> }\n @if (!reader.supported) { <ui-badge [label]=\"labels.t('stripeReaders.badge.unsupported')\" variant=\"red\" data-testid=\"reader-unsupported\" /> }\n </div>\n <div class=\"srs-actions\">\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-rename\" [ariaLabel]=\"labels.t('stripeReaders.rename.for', { name: name(reader) })\" [disabled]=\"busy() !== ''\" (click)=\"startRename(reader)\">{{ labels.t('stripeReaders.rename.action') }}</ui-button>\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-remove\" [ariaLabel]=\"labels.t('stripeReaders.remove.for', { name: name(reader) })\" [ariaDescribedBy]=\"reader.busy ? ids + '-busy-' + reader.id : ''\"\n [disabled]=\"busy() !== '' || !!reader.busy\" (click)=\"askRemove(reader)\">{{ labels.t('stripeReaders.remove.action') }}</ui-button>\n </div>\n @if (reader.busy) {\n <p class=\"srs-muted srs-busy-hint\" [id]=\"ids + '-busy-' + reader.id\" data-testid=\"reader-remove-busy-hint\">{{ labels.t('stripeReaders.remove.busy') }}</p>\n }\n }\n </li>\n }\n </ul>\n }\n </section>\n\n <section class=\"srs-section\" [attr.aria-labelledby]=\"ids + '-add-title'\" data-testid=\"readers-add\">\n <h3 class=\"srs-h\" [id]=\"ids + '-add-title'\">{{ labels.t('stripeReaders.add.title') }}</h3>\n <ul class=\"srs-how\" data-testid=\"readers-how\">\n <li>{{ labels.t('stripeReaders.add.howS700') }}</li>\n <li>{{ labels.t('stripeReaders.add.howWisepos') }}</li>\n </ul>\n <p class=\"srs-muted\" data-testid=\"readers-supported\">{{ labels.t('stripeReaders.add.supported', { models: supportedModels }) }}</p>\n <ui-form-section>\n <ui-text-input [label]=\"labels.t('stripeReaders.code.label')\" [hint]=\"labels.t('stripeReaders.code.hint')\" [required]=\"true\" [maxlength]=\"100\" autocomplete=\"off\"\n [error]=\"touched() ? codeError() : ''\" [ngModel]=\"code()\" (ngModelChange)=\"code.set($event ?? '')\" [showErrors]=\"touched()\" [disabled]=\"busy() === 'register'\" inputTestId=\"reader-code\" />\n <ui-text-input [label]=\"labels.t('stripeReaders.name.label')\" [hint]=\"labels.t('stripeReaders.name.hint')\" [required]=\"true\" [maxlength]=\"100\"\n [ngModel]=\"label()\" (ngModelChange)=\"label.set($event ?? '')\" [showErrors]=\"touched()\" [disabled]=\"busy() === 'register'\" inputTestId=\"reader-label\" />\n @if (locations().length || !createLocation()) {\n <ui-select [label]=\"labels.t('stripeReaders.location.label')\" [placeholder]=\"labels.t('stripeReaders.location.placeholder')\" [required]=\"true\" [options]=\"locationOptions()\"\n [ngModel]=\"locationId()\" (ngModelChange)=\"locationId.set($event ?? '')\" [showErrors]=\"touched()\" [disabled]=\"busy() === 'register'\" data-testid=\"reader-location\" />\n }\n @if (createLocation()) {\n @if (!showNewLocation() && locations().length) {\n <div class=\"srs-actions\"><ui-button variant=\"link\" data-testid=\"reader-new-location\" (click)=\"showNewLocation.set(true)\">{{ labels.t('stripeReaders.location.new') }}</ui-button></div>\n }\n @if (showNewLocation() || !locations().length) {\n <div class=\"srs-new-location\" role=\"group\" [attr.aria-label]=\"labels.t('stripeReaders.location.new')\" data-testid=\"reader-location-form\">\n <ui-text-input [label]=\"labels.t('stripeReaders.location.name')\" [required]=\"true\" [maxlength]=\"200\" [ngModel]=\"locName()\" (ngModelChange)=\"locName.set($event ?? '')\" [showErrors]=\"locTouched()\" inputTestId=\"reader-loc-name\" />\n <ui-text-input [label]=\"labels.t('stripeReaders.location.line1')\" [required]=\"true\" [maxlength]=\"200\" autocomplete=\"street-address\" [ngModel]=\"locLine1()\" (ngModelChange)=\"locLine1.set($event ?? '')\" [showErrors]=\"locTouched()\" inputTestId=\"reader-loc-line1\" />\n <ui-form-row [cols]=\"3\">\n <ui-text-input [label]=\"labels.t('stripeReaders.location.city')\" [required]=\"true\" [maxlength]=\"100\" [ngModel]=\"locCity()\" (ngModelChange)=\"locCity.set($event ?? '')\" [showErrors]=\"locTouched()\" inputTestId=\"reader-loc-city\" />\n <ui-text-input [label]=\"labels.t('stripeReaders.location.state')\" [required]=\"true\" [maxlength]=\"100\" [ngModel]=\"locState()\" (ngModelChange)=\"locState.set($event ?? '')\" [showErrors]=\"locTouched()\" inputTestId=\"reader-loc-state\" />\n <ui-text-input [label]=\"labels.t('stripeReaders.location.postal')\" [required]=\"true\" [maxlength]=\"20\" autocomplete=\"postal-code\" [ngModel]=\"locPostal()\" (ngModelChange)=\"locPostal.set($event ?? '')\" [showErrors]=\"locTouched()\" inputTestId=\"reader-loc-postal\" />\n </ui-form-row>\n <div class=\"srs-actions\">\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-loc-create\" [loading]=\"busy() === 'location'\" [disabled]=\"busy() !== ''\" (click)=\"createNewLocation()\">{{ labels.t('stripeReaders.location.create') }}</ui-button>\n @if (locations().length) { <ui-button variant=\"ghost\" size=\"sm\" data-testid=\"reader-loc-cancel\" [disabled]=\"busy() === 'location'\" (click)=\"showNewLocation.set(false)\">{{ labels.t('common.cancel') }}</ui-button> }\n </div>\n </div>\n }\n }\n </ui-form-section>\n <div class=\"srs-actions\">\n <ui-button variant=\"primary\" data-testid=\"reader-register\" [loading]=\"busy() === 'register'\" [disabled]=\"busy() !== '' || (touched() && hasInvalid())\" (click)=\"register()\">{{ busy() === 'register' ? labels.t('stripeReaders.add.connecting') : labels.t('stripeReaders.add.connect') }}</ui-button>\n </div>\n </section>\n </div>\n\n <ui-modal [open]=\"!!removing()\" [title]=\"labels.t('stripeReaders.remove.title')\" maxWidth=\"440px\" [describedBy]=\"ids + '-remove-text'\" [busy]=\"busy() === 'remove'\" (close)=\"cancelRemove()\" dialogTestId=\"reader-remove-dialog\">\n <p class=\"srs-text\" [id]=\"ids + '-remove-text'\" data-testid=\"reader-remove-text\">{{ removeText() }}</p>\n @if (removeError()) { <ui-alert variant=\"danger\" [quiet]=\"true\" data-testid=\"reader-remove-error\">{{ removeError() }}</ui-alert> }\n <ui-button modal-footer-left variant=\"secondary\" size=\"sm\" data-testid=\"reader-remove-cancel\" [disabled]=\"busy() === 'remove'\" (click)=\"cancelRemove()\">{{ labels.t('common.cancel') }}</ui-button>\n <ui-button modal-footer-right variant=\"danger\" size=\"sm\" data-testid=\"reader-remove-confirm\" [loading]=\"busy() === 'remove'\" [disabled]=\"busy() === 'remove'\" (click)=\"confirmRemove()\">{{ labels.t('stripeReaders.remove.confirm') }}</ui-button>\n </ui-modal>\n `,\n styles: [`\n ui-stripe-readers { display: block; min-width: 0; }\n ui-stripe-readers .srs-readers { display: flex; flex-direction: column; gap: 16px; }\n ui-stripe-readers .srs-section { display: flex; flex-direction: column; gap: 10px; }\n ui-stripe-readers .srs-h { margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--ui-psp-text, #1e293b); }\n ui-stripe-readers .srs-muted { margin: 0; font-size: 0.8125rem; color: var(--ui-psp-muted, #475569); }\n ui-stripe-readers .srs-text { margin: 0 0 12px; font-size: 0.9375rem; }\n ui-stripe-readers .srs-list, ui-stripe-readers .srs-how { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }\n ui-stripe-readers .srs-how { list-style: disc; padding-left: 18px; font-size: 0.875rem; color: var(--ui-psp-text, #1e293b); }\n ui-stripe-readers .srs-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; border: 1px solid var(--ui-psp-border, #e2e8f0); border-radius: 10px; }\n ui-stripe-readers .srs-item-main { display: flex; flex-direction: column; flex: 1 1 160px; min-width: 0; }\n ui-stripe-readers .srs-name { overflow-wrap: anywhere; }\n ui-stripe-readers .srs-badges, ui-stripe-readers .srs-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n ui-stripe-readers .srs-busy-hint { flex: 1 1 100%; }\n ui-stripe-readers .srs-rename { flex: 1 1 200px; min-width: 0; }\n ui-stripe-readers .srs-new-location { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px dashed var(--ui-psp-border, #cbd5e1); border-radius: 10px; }\n @media (forced-colors: active) { ui-stripe-readers .srs-item, ui-stripe-readers .srs-new-location { border-color: CanvasText; } }\n `],\n})\nexport class StripeReadersComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly destroyRef = inject(DestroyRef);\n private static seq = 0;\n /** Unique per instance: two screens on one page never share an id. */\n protected readonly ids = `srd-${++StripeReadersComponent.seq}`;\n\n /** Reads `GET /v1/terminal/readiness` through the host: the readers and the ONE state. */\n readonly getReadiness = input<StripeReaderGetReadinessFn | null>(null);\n /** Registers a reader (`POST /v1/terminal/readers`). */\n readonly registerReader = input<StripeReaderRegisterFn | null>(null);\n readonly renameReader = input<StripeReaderRenameFn | null>(null);\n /** Deletes a reader. Refused with 409 `reader_busy` while a payment waits on it. */\n readonly removeReader = input<StripeReaderRemoveFn | null>(null);\n /** The locations a reader can be registered to (`GET /v1/terminal/locations`). */\n readonly listLocations = input<StripeReaderListLocationsFn | null>(null);\n /** Creates a location (`POST /v1/terminal/locations`); without it only existing locations can be chosen. */\n readonly createLocation = input<StripeReaderCreateLocationFn | null>(null);\n /** The label the new reader's name starts with (empty by default). */\n readonly defaultLabel = input('');\n /** The value the address country is created with. */\n readonly country = input('US');\n /** A host call (read, register, rename, remove, create location) slower than this is unreachable (ms): the screen says so, becomes usable again and reads the list again (the call may have gone through). */\n readonly requestTimeoutMs = input(STRIPE_READER_REQUEST_TIMEOUT_MS);\n\n /** \"Get a card reader\": the host opens its order flow. */\n readonly getReader = output<void>();\n /** \"Set up payments\". */\n readonly openSetup = output<void>();\n /** A reader was added, renamed or removed (the host refreshes whatever shows readers). */\n readonly changed = output<void>();\n readonly outcome = output<StripeReadersOutcome>();\n\n protected readonly readiness = signal<StripeReaderReadiness | null>(null);\n protected readonly readers = computed(() => this.readiness()?.readers ?? []);\n protected readonly locations = signal<readonly StripeReaderLocation[]>([]);\n protected readonly busy = signal<Busy>('');\n protected readonly error = signal<{ action: string; text: string } | null>(null);\n protected readonly announcement = signal('');\n protected readonly supportedModels = STRIPE_READER_MODELS.map(m => m.model).join(', ');\n\n // the form: the registration code lives here only until the click\n protected readonly code = signal('');\n protected readonly label = signal('');\n protected readonly locationId = signal('');\n protected readonly touched = signal(false);\n protected readonly showNewLocation = signal(false);\n protected readonly locName = signal('');\n protected readonly locLine1 = signal('');\n protected readonly locCity = signal('');\n protected readonly locState = signal('');\n protected readonly locPostal = signal('');\n protected readonly locTouched = signal(false);\n protected readonly renamingId = signal('');\n protected readonly renameValue = signal('');\n protected readonly renameTouched = signal(false);\n protected readonly removing = signal<StripeReader | null>(null);\n protected readonly removeError = signal('');\n\n private readonly fields = viewChildren(UiFieldValidity);\n /** The same rule as the service (`registrationCode`: 3 to 100 letters, digits or hyphens): an invalid code is never sent. Empty is the built-in \"required\" message. */\n protected readonly codeError = computed(() => (this.code().trim() && !CODE_PATTERN.test(this.code().trim()) ? this.labels.t('stripeReaders.code.invalid') : ''));\n protected readonly hasInvalid = computed(() => this.fields().some(f => f.invalid()) || !this.code().trim() || !!this.codeError() || !this.label().trim() || !this.locationId());\n protected readonly locationOptions = computed(() => this.locations().map(l => ({ value: l.id, label: l.displayName })));\n protected readonly removeText = computed(() => this.labels.t('stripeReaders.remove.text', { name: this.removing() ? readerDisplayName(this.removing()) : '' }));\n private destroyed = false;\n private loadRun = 0;\n\n /** Runs one host call raced against the request timeout (a call that never answers cannot leave the screen busy forever); a timeout rejects with `code: 'request_timeout'`. */\n private async call<T>(thunk: () => HostResult<T>): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<never>((_, reject) => { timer = setTimeout(() => reject(Object.assign(new Error('request timeout'), { status: null, code: 'request_timeout' })), Math.max(1, this.requestTimeoutMs())); });\n return await Promise.race([callHost(thunk), timeout]);\n } finally { if (timer) clearTimeout(timer); }\n }\n\n constructor() {\n effect(() => { const start = this.defaultLabel(); untracked(() => { if (!this.label()) this.label.set(start); }); });\n this.destroyRef.onDestroy(() => { this.destroyed = true; this.code.set(''); });\n effect(() => { const read = this.getReadiness(); untracked(() => { if (read) void this.load(); }); });\n effect(() => { const list = this.listLocations(); untracked(() => { if (list) void this.loadLocations(list); }); });\n }\n\n protected name(reader: StripeReader): string { return readerDisplayName(reader); }\n protected model(reader: StripeReader): string { return reader.model || STRIPE_READER_MODELS.find(m => m.deviceType === reader.deviceType)?.model || reader.deviceType || ''; }\n protected statusLabel(reader: StripeReader): string {\n return this.labels.t(reader.status === 'online' ? 'stripeReaders.status.online' : reader.status === 'registering' ? 'stripeReaders.status.registering' : 'stripeReaders.status.offline');\n }\n protected statusVariant(reader: StripeReader): 'green' | 'slate' | 'sky' { return reader.status === 'online' ? 'green' : reader.status === 'registering' ? 'sky' : 'slate'; }\n\n /** Reads the readiness (the list and the banner). A failed or slow read leaves the list as it was and says so. */\n async load(quiet = false): Promise<void> {\n const read = this.getReadiness();\n if (!read || this.destroyed) return;\n const run = ++this.loadRun;\n if (this.busy() === '' && !quiet) this.busy.set('load');\n try {\n const raw = await this.call(() => read());\n if (this.destroyed || run !== this.loadRun) return;\n this.readiness.set(normalizeReadiness(raw));\n if (this.error()?.action === 'load') this.error.set(null);\n } catch (err) {\n if (this.destroyed || run !== this.loadRun) return;\n if (!quiet) this.fail('load', err);\n } finally { if (!this.destroyed && run === this.loadRun && this.busy() === 'load') this.busy.set(''); }\n }\n\n private async loadLocations(list: StripeReaderListLocationsFn): Promise<void> {\n try {\n const result = await this.call(() => list());\n if (this.destroyed) return;\n const locations = Array.isArray(result) ? [...result] : [];\n this.locations.set(locations);\n if (!this.locationId() && locations.length === 1) this.locationId.set(locations[0].id);\n } catch (err) { if (!this.destroyed) this.fail('location', err); }\n }\n\n private fail(action: 'load' | 'register' | 'rename' | 'remove' | 'location', err: unknown): string {\n const info = readerErrorInfo(err);\n // Only the codes that mean something on this screen are worded here; the payment refusals (\"Nothing was charged\") do not belong to it.\n const key: UiLabelKey | null = info.code === 'request_timeout' ? 'stripeReaders.failed.timeout'\n : action === 'remove' && info.code === 'reader_busy' ? 'stripeReaders.remove.busy'\n : info.code === 'reader_not_supported' ? 'stripeReaders.failed.notSupported'\n : info.code === 'merchant_not_ready' || info.code === 'reconnect_required' ? 'stripeReader.status.merchant_not_ready.text'\n : null;\n // A registration failure is ALWAYS the fixed text: the service's message may repeat what was typed (the registration code), and it must not be shown, announced or emitted. Other actions show the service's text.\n const text = key ? this.labels.t(key) : action !== 'load' && action !== 'register' && info.message ? info.message : this.labels.t(`stripeReaders.failed.${action}` as UiLabelKey);\n this.error.set({ action, text });\n this.outcome.emit({ kind: 'failed', action, code: action === 'register' ? info.code.replace(/[^a-z0-9_]/g, '').slice(0, 64) : info.code, message: text });\n this.announcement.set(text);\n return text;\n }\n\n /** \"Connect reader\". The code is read, then cleared from the form BEFORE the call: it is never shown or kept again, whatever the answer. */\n async register(): Promise<void> {\n const call = this.registerReader();\n if (!call || this.busy() !== '') return;\n this.touched.set(true);\n if (this.hasInvalid()) return;\n const ctx = { registrationCode: this.code().trim(), label: this.label().trim(), locationId: this.locationId() };\n this.code.set('');\n this.busy.set('register');\n this.error.set(null);\n try {\n const reader = await this.call(() => call(ctx));\n if (this.destroyed) return;\n this.label.set(this.defaultLabel());\n this.touched.set(false);\n this.announcement.set(this.labels.t('stripeReaders.add.done', { name: readerDisplayName(reader ?? { id: '', label: ctx.label }) }));\n if (reader) this.outcome.emit({ kind: 'registered', reader });\n this.changed.emit();\n this.busy.set('');\n await this.load();\n } catch (err) {\n if (this.destroyed) return;\n this.touched.set(false); // the code is gone: the field does not shout \"required\" before the user types the next one\n const info = readerErrorInfo(err);\n this.fail('register', err);\n this.busy.set('');\n // The answer may have been lost AFTER the reader was registered (timeout, connection, 5xx): read the list again (quietly, the error above stays) so a registered reader shows up instead of being registered twice.\n if (info.status === null || info.status === 0 || info.status >= 500 || info.status === 408) { void this.load(true); }\n }\n }\n\n protected startRename(reader: StripeReader): void {\n this.renamingId.set(reader.id);\n this.renameValue.set(reader.label ?? '');\n this.renameTouched.set(false);\n }\n\n protected async saveRename(reader: StripeReader): Promise<void> {\n const call = this.renameReader();\n const value = this.renameValue().trim();\n if (!call || this.busy() !== '') return;\n if (!value) { this.renameTouched.set(true); return; }\n this.busy.set('rename');\n this.error.set(null);\n try {\n const updated = await this.call(() => call(reader.id, value));\n if (this.destroyed) return;\n this.renamingId.set('');\n this.announcement.set(this.labels.t('stripeReaders.rename.done', { name: value }));\n if (updated) this.outcome.emit({ kind: 'renamed', reader: updated });\n this.changed.emit();\n this.busy.set('');\n await this.load();\n } catch (err) {\n if (this.destroyed) return;\n this.fail('rename', err);\n this.busy.set('');\n // A rename that timed out may have gone through: read the list again (quietly, the message above stays).\n if (readerErrorInfo(err).code === 'request_timeout') void this.load(true);\n }\n }\n\n protected askRemove(reader: StripeReader): void { this.removeError.set(''); this.removing.set(reader); }\n\n protected cancelRemove(): void { if (this.busy() === 'remove') return; this.removing.set(null); this.removeError.set(''); }\n\n protected async confirmRemove(): Promise<void> {\n const call = this.removeReader();\n const reader = this.removing();\n if (!call || !reader || this.busy() !== '') return;\n this.busy.set('remove');\n this.removeError.set('');\n try {\n await this.call(() => call(reader.id));\n if (this.destroyed) return;\n this.removing.set(null);\n this.announcement.set(this.labels.t('stripeReaders.remove.done', { name: readerDisplayName(reader) }));\n this.outcome.emit({ kind: 'removed', readerId: reader.id });\n this.changed.emit();\n this.busy.set('');\n await this.load();\n } catch (err) {\n if (this.destroyed) return;\n // a reader that holds a payment is refused (reader_busy): the dialog stays open and says why\n this.removeError.set(this.fail('remove', err));\n this.busy.set('');\n // A remove that timed out may have gone through: read the list again; a reader that is gone closes the dialog and counts as removed.\n if (readerErrorInfo(err).code === 'request_timeout') {\n await this.load(true);\n if (!this.destroyed && this.removing()?.id === reader.id && !this.readers().some(r => r.id === reader.id)) {\n this.removing.set(null);\n this.removeError.set('');\n this.error.set(null);\n this.announcement.set(this.labels.t('stripeReaders.remove.done', { name: readerDisplayName(reader) }));\n this.outcome.emit({ kind: 'removed', readerId: reader.id });\n this.changed.emit();\n }\n }\n }\n }\n\n protected async createNewLocation(): Promise<void> {\n const call = this.createLocation();\n if (!call || this.busy() !== '') return;\n this.locTouched.set(true);\n const name = this.locName().trim(); const line1 = this.locLine1().trim(); const city = this.locCity().trim(); const state = this.locState().trim(); const postal = this.locPostal().trim();\n if (!name || !line1 || !city || !state || !postal) return;\n this.busy.set('location');\n this.error.set(null);\n try {\n const location = await this.call(() => call({ displayName: name, address: { line1, city, state, postalCode: postal, country: this.country() } }));\n if (this.destroyed) return;\n this.locations.update(list => [...list, location]);\n this.locationId.set(location.id);\n this.showNewLocation.set(false);\n this.locTouched.set(false);\n for (const s of [this.locName, this.locLine1, this.locCity, this.locState, this.locPostal]) s.set('');\n this.outcome.emit({ kind: 'location-created', location });\n this.announcement.set(this.labels.t('stripeReaders.location.created', { name: location.displayName }));\n } catch (err) {\n if (this.destroyed) return;\n this.fail('location', err);\n // A location that timed out may have been created: read the list of locations again so it shows up instead of being created twice.\n if (readerErrorInfo(err).code === 'request_timeout') { const list = this.listLocations(); if (list) void this.loadLocations(list); }\n } finally { if (!this.destroyed) this.busy.set(''); }\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Stripe Connect embedded components of the card reader ordering flow (D-R6). The library holds NO `@stripe/connect-js` types or code of its own: the types below are the minimal shape it uses, and the SDK is Stripe's\n * script (`https://connect-js.stripe.com/v1.0/connect.js`) that the default loader adds to the page lazily, so an app that never orders readers never downloads it, and no app needs the `@stripe/connect-js` package.\n *\n * Content-Security-Policy: Connect.js loads from `https://connect-js.stripe.com` and the embedded component runs in frames of `https://js.stripe.com` (and `https://connect-js.stripe.com`): the host app must allow them\n * (`script-src`, `frame-src`, `connect-src` as its policy requires). See docs/card-readers.md.\n */\n\n/** The Connect embedded components this library mounts (the names of the account session's `components`). */\nexport type StripeConnectEmbedName = 'terminal_hardware_shop' | 'terminal_hardware_orders';\n\n/** The element a Connect component creates (a web component). Only the setters the library calls are typed; every one is optional (a missing one is skipped). */\nexport interface StripeConnectEmbedElement extends HTMLElement {\n /** The customer finished the checkout (an order was placed). */\n setOnCheckoutFinished?(handler: (event?: unknown) => void): void;\n /** The component failed to load. */\n setOnLoadError?(handler: (event?: unknown) => void): void;\n /** The component started loading. */\n setOnLoaderStart?(handler: (event?: unknown) => void): void;\n}\n\n/** What `loadConnectAndInitialize` returns, as far as the library uses it. */\nexport interface StripeConnectInstanceLike {\n create(component: StripeConnectEmbedName): StripeConnectEmbedElement;\n logout?(): void | Promise<void>;\n}\n\n/** What the loader is given. `fetchClientSecret` is called by Connect.js whenever it needs a (new) account session secret; the library never keeps what it returns. */\nexport interface StripeConnectInitOptions {\n publishableKey: string;\n fetchClientSecret: () => Promise<string>;\n appearance?: Record<string, unknown> | null;\n}\n\n/** Loads and initialises Connect.js: resolves the instance (or `null` when it could not be created). Replaceable (tests, a self-hosted loader). */\nexport type StripeConnectLoaderFn = (options: StripeConnectInitOptions) => Promise<StripeConnectInstanceLike | null>;\n\ninterface ConnectSdkLike {\n init(options: { publishableKey: string; fetchClientSecret: () => Promise<string>; appearance?: Record<string, unknown> }): {\n create(tag: string): unknown;\n logout?(): void | Promise<void>;\n };\n}\n\n/** Stripe's own script for Connect.js (the documented no-npm route). It defines `window.StripeConnect.init`. Allowed by the CSP described above. */\nexport const STRIPE_CONNECT_SCRIPT_URL = 'https://connect-js.stripe.com/v1.0/connect.js';\n\nlet connectScript: Promise<ConnectSdkLike> | null = null;\n\nfunction loadConnectScript(): Promise<ConnectSdkLike> {\n const existing = (globalThis as { StripeConnect?: ConnectSdkLike }).StripeConnect;\n if (existing) return Promise.resolve(existing);\n connectScript ??= new Promise<ConnectSdkLike>((resolve, reject) => {\n const fail = (message: string) => { connectScript = null; reject(new Error(message)); };\n const script = document.createElement('script');\n script.src = STRIPE_CONNECT_SCRIPT_URL;\n script.async = true;\n script.onload = () => {\n const sdk = (globalThis as { StripeConnect?: ConnectSdkLike }).StripeConnect;\n if (sdk) resolve(sdk); else fail('Stripe Connect.js did not load');\n };\n script.onerror = () => fail('Stripe Connect.js could not be loaded');\n document.head.appendChild(script);\n });\n return connectScript;\n}\n\n/**\n * Loads Connect.js (internal: not part of the public API; replaceable in a spec). It is Stripe's own script added to the page the first time a shop is mounted, NOT an npm package: the library and the apps\n * need no `@stripe/connect-js` dependency and no bundler ever resolves it.\n */\nexport const connectSdkImporter: { load: () => Promise<ConnectSdkLike> } = {\n load: () => loadConnectScript(),\n};\n\n/** The default loader: loads Connect.js lazily and maps the component name to Connect.js's tag (`terminal_hardware_shop` -> `terminal-hardware-shop`; verify against Stripe's current Connect.js docs). */\nexport const defaultStripeConnectLoader: StripeConnectLoaderFn = async options => {\n const sdk = await connectSdkImporter.load();\n const instance = sdk.init({\n publishableKey: options.publishableKey,\n fetchClientSecret: options.fetchClientSecret,\n ...(options.appearance ? { appearance: options.appearance } : {}),\n });\n return {\n create: component => instance.create(component.replace(/_/g, '-')) as StripeConnectEmbedElement,\n logout: () => instance.logout?.(),\n };\n};\n\n/** How Connect.js is loaded. Provide your own to fake it in tests or to load it differently. Defaults to {@link defaultStripeConnectLoader}. */\nexport const STRIPE_CONNECT_LOADER = new InjectionToken<StripeConnectLoaderFn>('STRIPE_CONNECT_LOADER', { providedIn: 'root', factory: () => defaultStripeConnectLoader });\n","import type { HostResult } from '@forgeroute/ui/payments';\nimport { readerErrorInfo } from '../stripe-reader/stripe-reader.models';\n\n/**\n * Ordering card readers inside the app (D-R6): the host's backend calls the payments service (`POST /v1/terminal/hardware/account-session` `{ merchantId }` -> `{ clientSecret, expiresAt, components }`) and hands the\n * browser the short-lived Connect account session secret; the BROWSER NEVER talks to the payments service. The components below embed Stripe's Connect components `terminal_hardware_shop` / `terminal_hardware_orders`.\n */\n\n/** What the host's `getAccountSession` answers. The secret goes to Connect.js and is never rendered, logged, stored or kept after use. */\nexport interface StripeReaderAccountSession {\n clientSecret: string;\n /** ISO time the session ends; a session that is already over is never handed to Connect.js (the host is asked for a new one). */\n expiresAt?: string;\n}\n\nexport type StripeReaderAccountSessionFn = () => HostResult<StripeReaderAccountSession>;\n\n/** Why the shop cannot be shown (the service's `hardware_shop_unavailable` `reason`, or `not_enabled_for_app` when the host says the capability flag `terminalHardwareShop` is off). */\nexport type StripeReaderShopUnavailableReason = 'platform_not_enabled' | 'account_not_eligible' | 'processor_refused' | 'not_enabled_for_app' | 'other';\n\n/** Where the embedded component is. `placed`: the checkout finished (an order was placed). */\nexport type StripeReaderEmbedState = 'loading' | 'ready' | 'unavailable' | 'error' | 'offline' | 'placed';\n\nconst REASONS: readonly string[] = ['platform_not_enabled', 'account_not_eligible', 'processor_refused', 'not_enabled_for_app'];\n\n/** Reads a failed `getAccountSession`: `unavailable` (with the reason) when the service said so (`hardware_shop_unavailable`, or the account is not ready to take payments), else a plain error (Retry is offered). */\nexport function readerShopFailure(error: unknown): { kind: 'unavailable'; reason: StripeReaderShopUnavailableReason } | { kind: 'error' } {\n const info = readerErrorInfo(error);\n const e = error as { reason?: unknown; error?: { reason?: unknown } | null } | null | undefined;\n const raw = typeof e?.reason === 'string' ? e.reason : typeof e?.error?.reason === 'string' ? e.error.reason : '';\n if (info.code === 'hardware_shop_unavailable') {\n // The service's reason `app_not_enabled` (API.md 16.3c: this app is not allowed to order readers) is the library's `not_enabled_for_app`.\n if (raw === 'app_not_enabled') return { kind: 'unavailable', reason: 'not_enabled_for_app' };\n return { kind: 'unavailable', reason: REASONS.includes(raw) ? (raw as StripeReaderShopUnavailableReason) : 'other' };\n }\n if (info.code === 'merchant_not_ready' || info.code === 'reconnect_required' || info.code === 'not_supported_by_processor') return { kind: 'unavailable', reason: 'account_not_eligible' };\n return { kind: 'error' };\n}\n","import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, ViewEncapsulation, computed, effect, inject, input, isDevMode, output, signal, untracked, viewChild } from '@angular/core';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent, UiLabelsService } from '@forgeroute/ui/core';\nimport { LiveRegionComponent } from '@forgeroute/ui/live-region';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { callHost } from '@forgeroute/ui/payments';\nimport { STRIPE_READER_MODELS, isSafeReceiptUrl, readerErrorInfo } from '../stripe-reader/stripe-reader.models';\nimport { STRIPE_CONNECT_LOADER, type StripeConnectEmbedElement, type StripeConnectEmbedName, type StripeConnectInstanceLike } from './stripe-connect-embed';\nimport { readerShopFailure, type StripeReaderAccountSessionFn, type StripeReaderEmbedState, type StripeReaderShopUnavailableReason } from './stripe-reader-shop.models';\n\n/** The template both embed components share (they only differ in which Connect component they mount). */\nconst EMBED_TEMPLATE = `\n <ui-live-region data-testid=\"shop-live\" [message]=\"announcement()\" />\n @switch (state()) {\n @case ('loading') {\n <div class=\"srh-loading\" data-testid=\"shop-loading\" [attr.aria-busy]=\"'true'\">\n <ui-skeleton [height]=\"240\" [ariaLabel]=\"loadingText()\" />\n </div>\n }\n @case ('offline') {\n <ui-alert variant=\"warning\" [title]=\"labels.t('stripeReaderShop.offline.title')\" data-testid=\"shop-offline\">\n <p class=\"srh-text\">{{ labels.t('stripeReaderShop.offline.text') }}</p>\n </ui-alert>\n }\n @case ('error') {\n <ui-alert variant=\"danger\" [title]=\"labels.t('stripeReaderShop.error.title')\" data-testid=\"shop-error\">\n <p class=\"srh-text\">{{ labels.t('stripeReaderShop.error.text') }}</p>\n <div class=\"srh-actions\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"shop-retry\" (click)=\"retry()\">{{ labels.t('common.tryAgain') }}</ui-button>\n </div>\n </ui-alert>\n }\n @case ('unavailable') {\n <section class=\"srh-card\" data-testid=\"shop-unavailable\" [attr.data-reason]=\"unavailableReason()\" role=\"group\" [attr.aria-labelledby]=\"ids + '-unavailable'\">\n <h3 class=\"srh-title\" [id]=\"ids + '-unavailable'\">{{ labels.t('stripeReaderShop.unavailable.title') }}</h3>\n <p class=\"srh-text\" data-testid=\"shop-unavailable-reason\">{{ unavailableText() }}</p>\n <p class=\"srh-text\">{{ labels.t('stripeReaderShop.unavailable.models') }}</p>\n <ul class=\"srh-models\" data-testid=\"shop-models\">\n @for (model of models; track model.deviceType) {\n <li>{{ model.model }}: {{ labels.t(model.key) }}</li>\n }\n </ul>\n <p class=\"srh-text\" data-testid=\"shop-how\">{{ labels.t('stripeReaderShop.unavailable.how') }}</p>\n <div class=\"srh-actions\">\n @if (helpHref(); as href) {\n <a [href]=\"href\" target=\"_blank\" rel=\"noopener noreferrer\" data-testid=\"shop-help\">{{ labels.t('stripeReaderShop.help.link') }}<span class=\"srh-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span></a>\n }\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"shop-connect\" (click)=\"connectReader.emit()\">{{ labels.t('stripeReader.status.connect') }}</ui-button>\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"shop-close\" (click)=\"closed.emit()\">{{ labels.t('common.close') }}</ui-button>\n </div>\n </section>\n }\n @case ('placed') {\n <ui-alert variant=\"success\" [title]=\"labels.t('stripeReaderShop.placed.title')\" data-testid=\"shop-placed\">\n <p class=\"srh-text\" data-testid=\"shop-placed-text\">{{ labels.t('stripeReaderShop.placed.text') }}</p>\n <div class=\"srh-actions\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"shop-connect\" (click)=\"connectReader.emit()\">{{ labels.t('stripeReader.status.connect') }}</ui-button>\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"shop-close\" (click)=\"closed.emit()\">{{ labels.t('common.close') }}</ui-button>\n </div>\n </ui-alert>\n }\n }\n <div #embed class=\"srh-embed\" data-testid=\"shop-embed\" [hidden]=\"state() !== 'ready'\"></div>\n`;\n\nconst EMBED_STYLES = `\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) { display: block; min-width: 0; }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--ui-psp-border, #cbd5e1); border-radius: 12px; background: var(--ui-psp-sunken, #f8fafc); }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-title { margin: 0; font-size: 1.0625rem; font-weight: 700; color: var(--ui-psp-text, #1e293b); }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-text { margin: 0 0 8px; font-size: 0.9375rem; color: var(--ui-psp-text, #1e293b); }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-card .srh-text { margin: 0; }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-models { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; color: var(--ui-psp-text, #1e293b); }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-embed { min-height: 240px; }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-embed[hidden] { display: none; }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }\n @media (forced-colors: active) { :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-card { border-color: CanvasText; } }\n`;\n\nconst MODEL_KEYS = {\n stripe_s700: 'stripeReaderShop.model.s700',\n stripe_s710: 'stripeReaderShop.model.s710',\n bbpos_wisepos_e: 'stripeReaderShop.model.wisepos',\n} as const;\n\n/**\n * Shared behaviour of the two embed components (an abstract directive, not a component of its own): it asks the host for an account session when it mounts, hands the secret to Connect.js (and asks the host again\n * when Connect.js needs a fresh one), mounts the embedded component and words every state. The secret is passed on and forgotten: never rendered, logged, stored in a signal or kept after use.\n */\n@Directive()\nexport abstract class StripeReaderEmbedBase {\n protected readonly labels = inject(UiLabelsService);\n private readonly loader = inject(STRIPE_CONNECT_LOADER);\n private readonly destroyRef = inject(DestroyRef);\n private readonly container = viewChild<ElementRef<HTMLElement>>('embed');\n private static seq = 0;\n protected readonly ids = `srh-${++StripeReaderEmbedBase.seq}`;\n protected readonly models = STRIPE_READER_MODELS.map(m => ({ ...m, key: MODEL_KEYS[m.deviceType as keyof typeof MODEL_KEYS] }));\n\n /** The publishable key (`pk_...`) of the platform: not a secret. */\n readonly publishableKey = input<string | null>(null);\n /** The host's call to ITS backend, which calls the payments service (`POST /v1/terminal/hardware/account-session`). Called when the component mounts and whenever Connect.js asks for a refreshed secret. */\n readonly getAccountSession = input<StripeReaderAccountSessionFn | null>(null);\n /** The merchant capability flag `terminalHardwareShop`: `false` shows the \"how to order\" card at once (nothing is requested). */\n readonly enabled = input(true);\n /** An address that explains how to order a reader (only https or in-app `/paths` are linked). */\n readonly orderHelpUrl = input<string | null>(null);\n /** Connect.js appearance (variables / overlays), passed through. */\n readonly appearance = input<Record<string, unknown> | null>(null);\n /** Managed environments where `navigator.onLine === false` is a false negative (default false). */\n readonly offlineOverride = input(false);\n /** An account session call slower than this is an error with \"Try again\" (ms). */\n readonly requestTimeoutMs = input(20_000);\n\n /** The checkout finished (an order was placed). */\n readonly checkoutFinished = output<void>();\n /** The user closed the shop (the host closes its panel). */\n readonly closed = output<void>();\n /** \"Connect a reader\": the host opens its pairing panel (`ui-stripe-readers`). */\n readonly connectReader = output<void>();\n\n readonly state = signal<StripeReaderEmbedState>('loading');\n /** The embedded component reported that it started its own loading (`setOnLoaderStart`); \"ready\" is announced only then (an element without that setter is announced when it is mounted: nothing better is known). */\n private readonly loaded = signal(false);\n /** Only whether a session call exists is a reason to mount: a host that passes a NEW function on every change detection pass must not remount the shop in a loop. The latest function is read (untracked) when it is called. */\n private readonly hasSession = computed(() => !!this.getAccountSession());\n readonly unavailableReason = signal<StripeReaderShopUnavailableReason>('not_enabled_for_app');\n private readonly retryTick = signal(0);\n private runId = 0;\n private instance: StripeConnectInstanceLike | null = null;\n private element: StripeConnectEmbedElement | null = null;\n /** The secret of the first session of THIS mount, handed to Connect.js once and then dropped (never a signal, never rendered; a newer mount has its own holder). */\n private secretHolder: { secret: string | null } | null = null;\n private destroyed = false;\n\n /** The Connect component this one mounts. */\n protected abstract component(): StripeConnectEmbedName;\n\n protected readonly loadingText = computed(() => this.labels.t(this.component() === 'terminal_hardware_orders' ? 'stripeReaderShop.orders.loading' : 'stripeReaderShop.loading'));\n protected readonly unavailableText = computed(() => this.labels.t(`stripeReaderShop.unavailable.${this.unavailableReason()}` as 'stripeReaderShop.unavailable.other'));\n protected readonly helpHref = computed(() => { const url = this.orderHelpUrl(); return isSafeReceiptUrl(url) ? url : null; });\n protected readonly announcement = computed(() => {\n switch (this.state()) {\n case 'loading': return '';\n case 'ready': return this.loaded() ? this.labels.t('stripeReaderShop.live.ready') : '';\n case 'offline': return this.labels.t('stripeReaderShop.offline.title');\n case 'error': return this.labels.t('stripeReaderShop.error.title');\n case 'unavailable': return `${this.labels.t('stripeReaderShop.unavailable.title')}. ${this.unavailableText()}`;\n case 'placed': return this.labels.t('stripeReaderShop.placed.text');\n }\n });\n\n constructor() {\n if (typeof window !== 'undefined') {\n const online = (): void => { if (this.state() === 'offline') this.retry(); };\n window.addEventListener('online', online);\n this.destroyRef.onDestroy(() => window.removeEventListener('online', online));\n }\n this.destroyRef.onDestroy(() => { this.destroyed = true; this.runId++; this.teardown(); });\n effect(() => {\n // Remount only for: enabled, the key, the mounted component, a retry, and whether a session call exists. The call itself and the appearance are read when needed (latest value, untracked).\n this.enabled(); this.publishableKey(); this.hasSession(); this.component(); this.retryTick();\n const box = this.container();\n untracked(() => { if (box) void this.mount(box.nativeElement); });\n });\n }\n\n /** \"Try again\". */\n retry(): void { this.retryTick.update(n => n + 1); }\n\n private offlineNow(): boolean { return !this.offlineOverride() && typeof navigator !== 'undefined' && navigator.onLine === false; }\n\n private async mount(box: HTMLElement): Promise<void> {\n this.teardown();\n const run = ++this.runId;\n if (!this.enabled()) { this.unavailable('not_enabled_for_app'); return; }\n const key = this.publishableKey();\n const get = untracked(() => this.getAccountSession());\n if (!key || !get) {\n this.state.set('loading');\n if (isDevMode()) console.warn('[ui-stripe-reader-shop] publishableKey and getAccountSession are required: the shop cannot load without them.');\n return;\n }\n if (this.offlineNow()) { this.state.set('offline'); return; } // nothing is requested while offline\n this.state.set('loading');\n this.loaded.set(false);\n let first: string;\n try { first = await this.fetchSecret(); } catch (error) { if (run === this.runId) this.onFailure(error); return; }\n if (run !== this.runId) return; // replaced meanwhile: this secret is dropped (a newer run has its own holder)\n const holder = { secret: first as string | null };\n this.secretHolder = holder;\n let instance: StripeConnectInstanceLike | null = null;\n try {\n instance = await this.loader({\n publishableKey: key,\n appearance: untracked(() => this.appearance()),\n fetchClientSecret: async () => {\n // The first call gets the session asked for at mount (once); every later call (Connect.js needs a fresh secret) asks the host again.\n const initial = holder.secret;\n holder.secret = null;\n if (initial) return initial;\n try { return await this.fetchSecret(); } catch (error) {\n // A failed refresh while the shop is in use (the host said 429, the connection dropped, the session expired) is only REJECTED to Connect.js, which shows its own error: the embed (and a checkout in progress) is kept.\n // Only a refusal that will not recover (`hardware_shop_unavailable`) removes it and shows the \"unavailable\" card.\n if (run === this.runId && readerErrorInfo(error).code === 'hardware_shop_unavailable') this.onFailure(error);\n throw new Error('account session unavailable');\n }\n },\n });\n } catch { instance = null; }\n if (run !== this.runId) { holder.secret = null; try { void instance?.logout?.(); } catch { /* nothing to log out */ } return; }\n if (!instance) { holder.secret = null; this.state.set('error'); return; }\n let element: StripeConnectEmbedElement;\n try { element = instance.create(this.component()); } catch { holder.secret = null; this.state.set('error'); return; }\n this.instance = instance;\n this.element = element;\n element.setOnLoadError?.(() => { if (run === this.runId && this.state() !== 'unavailable') this.state.set('error'); });\n element.setOnCheckoutFinished?.(() => { if (run === this.runId) this.onCheckoutFinished(); });\n if (element.setOnLoaderStart) element.setOnLoaderStart(() => { if (run === this.runId) this.loaded.set(true); }); else this.loaded.set(true);\n box.appendChild(element);\n this.state.set('ready');\n }\n\n /** Asks the host for an account session within the request timeout; returns ONLY the secret (a session that is already over, or one without a secret, is refused). */\n private async fetchSecret(): Promise<string> {\n const get = untracked(() => this.getAccountSession());\n if (!get) throw new Error('account session: no call supplied');\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<never>((_, reject) => { timer = setTimeout(() => reject(new Error('account session timeout')), Math.max(1, this.requestTimeoutMs())); });\n const session = await Promise.race([callHost(get), timeout]);\n const secret = typeof session?.clientSecret === 'string' ? session.clientSecret : '';\n if (!secret) throw new Error('account session without a secret');\n if (session.expiresAt) { const ends = Date.parse(session.expiresAt); if (!Number.isNaN(ends) && ends <= Date.now()) throw new Error('account session expired'); }\n return secret;\n } finally { if (timer) clearTimeout(timer); }\n }\n\n private onFailure(error: unknown): void {\n this.teardown();\n const failure = readerShopFailure(error);\n if (failure.kind === 'unavailable') this.unavailable(failure.reason); else this.state.set('error');\n }\n\n private unavailable(reason: StripeReaderShopUnavailableReason): void {\n this.unavailableReason.set(reason);\n this.state.set('unavailable');\n }\n\n private onCheckoutFinished(): void {\n this.checkoutFinished.emit();\n if (this.component() === 'terminal_hardware_shop' && !this.destroyed) { this.teardown(); this.state.set('placed'); }\n }\n\n /** Removes the embedded component and forgets the session (the secret is never kept). */\n private teardown(): void {\n if (this.secretHolder) this.secretHolder.secret = null;\n this.secretHolder = null;\n const element = this.element;\n const instance = this.instance;\n this.element = null;\n this.instance = null;\n try { element?.remove(); } catch { /* already gone */ }\n try { void instance?.logout?.(); } catch { /* nothing to log out */ }\n }\n}\n\n/**\n * The card reader SHOP of the app: Stripe's Connect embedded component `terminal_hardware_shop` (or, with `mode=\"orders\"`, `terminal_hardware_orders`, the order history). The host supplies the account session\n * (`getAccountSession` calls its OWN backend, which calls the payments service; the browser never talks to the service) and the publishable key. States: loading skeleton, ready, unavailable (a \"how to order\" card with\n * the supported models, the user is never blocked), error with Try again, offline (nothing is requested) and placed (\"Your order was placed. When the reader arrives, choose Connect a reader and enter the code the\n * device shows\", output `connectReader`). Put it in the host's side panel, or use `ui-stripe-reader-order-panel`.\n *\n * <ui-stripe-reader-shop [publishableKey]=\"pk\" [getAccountSession]=\"session\" [enabled]=\"merchant.terminalHardwareShop\" orderHelpUrl=\"https://example.com/readers\"\n * (checkoutFinished)=\"refresh()\" (connectReader)=\"openPairing()\" (closed)=\"close()\" />\n */\n@Component({\n selector: 'ui-stripe-reader-shop',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [AlertComponent, ButtonComponent, LiveRegionComponent, SkeletonComponent],\n template: EMBED_TEMPLATE,\n styles: [EMBED_STYLES],\n})\nexport class StripeReaderShopComponent extends StripeReaderEmbedBase {\n /** `shop` (default) mounts `terminal_hardware_shop`; `orders` mounts `terminal_hardware_orders` (the order history). */\n readonly mode = input<'shop' | 'orders'>('shop');\n protected override component(): StripeConnectEmbedName { return this.mode() === 'orders' ? 'terminal_hardware_orders' : 'terminal_hardware_shop'; }\n}\n\n/** The order history of the card readers: Stripe's Connect embedded component `terminal_hardware_orders`, with the same loader, states and host contract as `ui-stripe-reader-shop`. */\n@Component({\n selector: 'ui-stripe-reader-orders',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [AlertComponent, ButtonComponent, LiveRegionComponent, SkeletonComponent],\n template: EMBED_TEMPLATE,\n styles: [EMBED_STYLES],\n})\nexport class StripeReaderOrdersComponent extends StripeReaderEmbedBase {\n protected override component(): StripeConnectEmbedName { return 'terminal_hardware_orders'; }\n}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject, input, output } from '@angular/core';\nimport { SidePanelComponent, UiLabelsService } from '@forgeroute/ui/core';\nimport { StripeReaderShopComponent } from './stripe-reader-shop.component';\nimport type { StripeReaderAccountSessionFn } from './stripe-reader-shop.models';\n\n/**\n * The ready-made side panel for ordering card readers: a `ui-side-panel` (\"Get a card reader\" / \"Card reader orders\") that mounts `ui-stripe-reader-shop` only while it is open (nothing is requested while it is\n * closed, and the account session secret is dropped as soon as it closes). The host opens it from the `getReader` / `readerOrder` outputs and opens its pairing panel from `(connectReader)`.\n *\n * @defer (when orderOpen()) {\n * <ui-stripe-reader-order-panel [open]=\"orderOpen()\" [publishableKey]=\"pk\" [getAccountSession]=\"session\" [enabled]=\"merchant.terminalHardwareShop\"\n * (closed)=\"orderOpen.set(false)\" (checkoutFinished)=\"refreshReaders()\" (connectReader)=\"orderOpen.set(false); pairingOpen.set(true)\" />\n * }\n */\n@Component({\n selector: 'ui-stripe-reader-order-panel',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [SidePanelComponent, StripeReaderShopComponent],\n template: `\n <ui-side-panel [open]=\"open()\" [title]=\"title()\" [cancelLabel]=\"labels.t('common.close')\" [wide]=\"true\" cancelTestId=\"reader-order-panel-close\" (closed)=\"closed.emit()\">\n @if (open()) {\n <ui-stripe-reader-shop [mode]=\"mode()\" [publishableKey]=\"publishableKey()\" [getAccountSession]=\"getAccountSession()\" [enabled]=\"enabled()\" [orderHelpUrl]=\"orderHelpUrl()\"\n [appearance]=\"appearance()\" [offlineOverride]=\"offlineOverride()\" [requestTimeoutMs]=\"requestTimeoutMs()\"\n (checkoutFinished)=\"checkoutFinished.emit()\" (connectReader)=\"connectReader.emit()\" (closed)=\"closed.emit()\" />\n }\n </ui-side-panel>\n `,\n})\nexport class StripeReaderOrderPanelComponent {\n protected readonly labels = inject(UiLabelsService);\n\n readonly open = input(false);\n /** `shop` (default): order a reader; `orders`: the order history. */\n readonly mode = input<'shop' | 'orders'>('shop');\n readonly publishableKey = input<string | null>(null);\n readonly getAccountSession = input<StripeReaderAccountSessionFn | null>(null);\n readonly enabled = input(true);\n readonly orderHelpUrl = input<string | null>(null);\n readonly appearance = input<Record<string, unknown> | null>(null);\n readonly offlineOverride = input(false);\n readonly requestTimeoutMs = input(20_000);\n\n readonly closed = output<void>();\n readonly checkoutFinished = output<void>();\n readonly connectReader = output<void>();\n\n protected readonly title = computed(() => this.labels.t(this.mode() === 'orders' ? 'stripeReaderShop.orders.title' : 'stripeReaderShop.title'));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAa,cAA2G,EACtH,YAAY,OAAO,qBACpB;AAMD,MAAa,sBAAsC,OAAO,gBAAgB,YAAW;CACnF,MAAM,MAAM,MAAM,YAAY,KAAI;CAElC,OADe,YAAY,SAAY,MAAM,IAAI,WAAW,cAAc,IAAI,MAAM,IAAI,WAAW,gBAAgB,OAAgB;AAErI;AAGA,MAAa,gBAAgB,IAAI,eAA+B,iBAAiB;CAAE,YAAY;CAAQ,eAAe;AAAmB,CAAE;AAU3I,MAAa,0BAA0B,IAAI,eAAsC,2BAA2B;CAAE,YAAY;CAAQ,gBAAgB,CAAA;AAAG,CAAE;AAYvJ,SAAgB,qBAAqB,UAAuC,CAAA,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;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA;IAAA,QAAA;IAAA,kBAAA;IAAA,eAAA;GAAA;GAAA,UAAA;GAAA,UAVhC;;;;;;;;;GAQT,UAAA;GAAA,cAAA,CAAA;IAAA,MAAA;IAAA,MATS;IAAkB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,UAAA,cAAA;GAAA,GAAA;IAAA,MAAA;IAAA,MAAE;IAAyB,UAAA;IAAA,QAAA,CAAA,MAAA;GAAA,CAAA;GAAA,iBAAA,GAAA,wBAAA;GAAA,eAAA,GAAA,kBAAA;EAAA,CAAA;CAAA;;AAW5C,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA+B,YAAA,CAAA;EAhB3C,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,YAAY;GACZ,iBAAiB,wBAAwB;GACzC,eAAe,kBAAkB;GACjC,SAAS,CAAC,oBAAoB,yBAAyB;GACvD,UAAU;;;;;;;;;EASX,CAAA"}
|
|
1
|
+
{"version":3,"file":"forgeroute-ui-stripe.mjs","names":[],"sources":["../../../projects/forgeroute-ui/stripe/src/stripe-loader/stripe-loader.ts","../../../projects/forgeroute-ui/stripe/src/errors/stripe-errors.ts","../../../projects/forgeroute-ui/stripe/src/stripe-payment/stripe-outcomes.ts","../../../projects/forgeroute-ui/stripe/src/stripe-payment/stripe-actions.ts","../../../projects/forgeroute-ui/stripe/src/stripe-payment/stripe-appearance.ts","../../../projects/forgeroute-ui/stripe/src/stripe-payment/stripe-payment.component.ts","../../../projects/forgeroute-ui/stripe/src/microdeposit-verify/microdeposit-verify.models.ts","../../../projects/forgeroute-ui/stripe/src/microdeposit-verify/microdeposit-verify.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-connect/stripe-connect.flow.ts","../../../projects/forgeroute-ui/stripe/src/stripe-connect/stripe-connect.component.ts","../../../projects/forgeroute-ui/stripe/src/payment-stripe-method/payment-stripe-method.models.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-reader.models.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-reader.flow.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-reader-status.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-reader-payment.component.ts","../../../projects/forgeroute-ui/stripe/src/payment-stripe-method/payment-stripe-body.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-reader-banner.component.ts","../../../projects/forgeroute-ui/stripe/src/payment-stripe-method/payment-stripe-method.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader/stripe-readers.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader-shop/stripe-connect-embed.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader-shop/stripe-reader-shop.models.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader-shop/stripe-reader-shop.component.ts","../../../projects/forgeroute-ui/stripe/src/stripe-reader-shop/stripe-reader-order-panel.component.ts"],"sourcesContent":["import { InjectionToken, type Provider } from '@angular/core';\nimport type { StripeLike, StripeLoadOptions } from './stripe-types';\n\n/**\n * Loads Stripe.js: `loader(publishableKey, options)` resolves the `Stripe` object (or `null` when it could not be created).\n * It is called exactly like `loadStripe(key, options)` from `@stripe/stripe-js`: the second argument is `undefined` unless a Connect\n * account / locale / other option is set.\n */\nexport type StripeLoaderFn = (publishableKey: string, options?: StripeLoadOptions) => Promise<StripeLike | null>;\n\n/** The dynamic import of the Stripe SDK, behind an object so a spec can replace it (internal: not part of the public API). */\nexport const sdkImporter: { load: () => Promise<{ loadStripe: (key: string, options?: never) => Promise<unknown> }> } = {\n load: () => import('@stripe/stripe-js') as unknown as Promise<{ loadStripe: (key: string, options?: never) => Promise<unknown> }>,\n};\n\n/**\n * The default loader. `@stripe/stripe-js` is imported lazily (a dynamic import), so the Stripe SDK is only downloaded when a\n * payment form is actually shown, and it is an optional peer dependency of the library.\n */\nexport const defaultStripeLoader: StripeLoaderFn = async (publishableKey, options) => {\n const sdk = await sdkImporter.load();\n const stripe = options === undefined ? await sdk.loadStripe(publishableKey) : await sdk.loadStripe(publishableKey, options as never);\n return stripe as unknown as StripeLike | null;\n};\n\n/** How Stripe.js is loaded. Provide your own to fake Stripe in tests or to load it differently. Defaults to `defaultStripeLoader`. */\nexport const STRIPE_LOADER = new InjectionToken<StripeLoaderFn>('STRIPE_LOADER', { providedIn: 'root', factory: () => defaultStripeLoader });\n\n/** App-wide defaults for every `ui-stripe-payment`, set once with `provideStripePayment`. A value on the component always wins. */\nexport interface StripePaymentDefaults {\n /** The publishable key (`pk_...`), used when the component has no `publishableKey` of its own. */\n publishableKey?: string;\n /** Stripe.js locale (`'en'`, `'es'`, ...): passed to `loadStripe` as `{ locale }`. */\n locale?: string;\n}\n\nexport const STRIPE_PAYMENT_DEFAULTS = new InjectionToken<StripePaymentDefaults>('STRIPE_PAYMENT_DEFAULTS', { providedIn: 'root', factory: () => ({}) });\n\nexport interface ProvideStripePaymentOptions extends StripePaymentDefaults {\n /** Replaces how Stripe.js is loaded (tests, a self-hosted loader). */\n loader?: StripeLoaderFn;\n}\n\n/**\n * Global defaults for the Stripe components:\n *\n * providers: [provideStripePayment({ publishableKey: environment.stripePublishableKey, locale: 'en' })]\n */\nexport function provideStripePayment(options: ProvideStripePaymentOptions = {}): Provider[] {\n const { loader, ...defaults } = options;\n const providers: Provider[] = [{ provide: STRIPE_PAYMENT_DEFAULTS, useValue: defaults }];\n if (loader) providers.push({ provide: STRIPE_LOADER, useValue: loader });\n return providers;\n}\n\n/** `loadStripe`'s second argument for a Connect account / locale / extra options; `undefined` when there is nothing to pass (like the apps do today). */\nexport function buildLoadOptions(stripeAccount: string | null | undefined, locale: string | null | undefined, extra?: StripeLoadOptions | null): StripeLoadOptions | undefined {\n const options: StripeLoadOptions = { ...(extra ?? {}) };\n if (locale) options.locale = locale;\n if (stripeAccount) options.stripeAccount = stripeAccount;\n return Object.keys(options).length ? options : undefined;\n}\n","import type { StripeErrorLike } from '../stripe-loader/stripe-types';\nimport { UiLabelKey, uiText } from '@forgeroute/ui/core';\n\n/**\n * Plain-language text for the Stripe decline / error codes (https://docs.stripe.com/declines/codes). One table for every app; an app can replace single entries\n * with the `errorMessages` input of `ui-stripe-payment` (or the `overrides` option of `getStripeErrorMessage`).\n */\nexport const STRIPE_ERROR_MESSAGES: Readonly<Record<string, string>> = {\n // Card issue codes\n stolen_card: 'This card has been reported as stolen. Please use a different payment method.',\n lost_card: 'This card has been reported as lost. Please use a different payment method.',\n card_declined: 'Your card was declined. Please contact your bank or use a different card.',\n generic_decline: 'Your card was declined. Please contact your bank or try a different card.',\n insufficient_funds: 'Your card has insufficient funds. Please use a different card or add funds to your account.',\n do_not_honor: 'Your bank has declined this transaction. Please contact your bank or use a different card.',\n card_not_supported: 'This card does not support this type of purchase. Please use a different card.',\n currency_not_supported: 'This card does not support the requested currency. Please use a different card.',\n duplicate_transaction: 'A duplicate transaction was detected. Please wait a few minutes before trying again.',\n expired_card: 'Your card has expired. Please use a different card.',\n incorrect_cvc: 'The security code (CVC) is incorrect. Please check and try again.',\n incorrect_number: 'The card number is incorrect. Please check and try again.',\n invalid_cvc: 'The security code (CVC) is invalid. Please check and try again.',\n invalid_expiry_month: 'The expiration month is invalid. Please check and try again.',\n invalid_expiry_year: 'The expiration year is invalid. Please check and try again.',\n invalid_number: 'The card number is invalid. Please check and try again.',\n processing_error: 'An error occurred while processing your card. Please try again.',\n incorrect_zip: 'The ZIP/postal code is incorrect. Please check and try again.',\n card_velocity_exceeded: 'You have exceeded the balance or credit limit on your card. Please contact your bank.',\n withdrawal_count_limit_exceeded: 'You have exceeded the allowed number of transactions. Please try again later or use a different card.',\n // Authentication codes\n authentication_required: 'This card requires authentication. Please try again and complete the verification step.',\n // Fraud codes\n fraudulent: 'This transaction has been flagged by your bank. Please contact your bank or use a different card.',\n merchant_blacklist: 'This card cannot be used for this transaction. Please use a different card.',\n pickup_card: 'This card cannot be used. Please contact your bank or use a different card.',\n restricted_card: 'This card has restrictions that prevent this transaction. Please contact your bank or use a different card.',\n security_violation: 'This card has been flagged for a security violation. Please contact your bank.',\n // Account codes\n issuer_not_available: 'Your card issuer could not be reached. Please try again later.',\n new_account_information_available: 'Your card details have changed. Please update your card information and try again.',\n try_again_later: 'Your card issuer is temporarily unable to process this transaction. Please try again later.',\n reenter_transaction: 'The transaction could not be processed. Please try again.',\n // Limit codes\n approve_with_id: 'The payment cannot be authorized. Please contact your bank.',\n call_issuer: 'Your bank has declined this transaction. Please call your bank for more information.',\n do_not_try_again: 'Your bank has permanently declined this card. Please use a different payment method.',\n no_action_taken: 'Your bank could not process this transaction. Please contact your bank.',\n not_permitted: 'This transaction is not permitted on this card. Please contact your bank or use a different card.',\n revocation_of_all_authorizations: 'All authorizations have been revoked for this card. Please contact your bank.',\n revocation_of_authorization: 'The authorization for this card has been revoked. Please contact your bank.',\n stop_payment_order: 'Your bank has stopped this payment. Please contact your bank.',\n // Test mode\n testmode_decline: 'This is a test decline. No real charge was attempted.',\n // ACH\n bank_account_declined: 'Your bank account could not be used. Please try a different account.',\n debit_not_authorized: 'The debit was not authorized. Please contact your bank.',\n // Payment / setup intent state errors\n payment_intent_unexpected_state: 'This payment has already been processed. Please refresh the page and try again.',\n payment_intent_authentication_failure: 'Payment authentication failed. Please try again.',\n payment_intent_incompatible_payment_method: 'This payment method is not compatible. Please use a different payment method.',\n payment_intent_payment_attempt_failed: 'The payment attempt failed. Please try again or use a different payment method.',\n payment_method_unactivated: 'This payment method is not activated. Please use a different payment method.',\n payment_method_unexpected_state: 'There was an issue with your payment method. Please try again.',\n setup_intent_unexpected_state: 'This payment setup has already been completed. Please refresh the page.',\n amount_too_small: 'The payment amount is too small to process. Please contact the business.',\n amount_too_large: 'The payment amount exceeds the maximum allowed. Please contact the business.',\n balance_insufficient: 'Insufficient balance to complete this payment. Please use a different payment method.',\n resource_missing: 'The payment session has expired. Please refresh the page and try again.',\n};\n\n/** Text for the Stripe error types that are about Stripe or the connection, never about the customer's input (Stripe's own text there is technical). */\nexport const STRIPE_TECHNICAL_ERROR_MESSAGES: Readonly<Record<string, string>> = {\n api_connection_error: 'We could not reach the payment service. Please check your connection and try again.',\n rate_limit_error: 'Too many requests. Please wait a moment and try again.',\n api_error: 'Something went wrong while processing the payment. Please try again.',\n authentication_error: 'Something went wrong while processing the payment. Please try again.',\n invalid_request_error: 'Something went wrong while processing the payment. Please try again.',\n};\n\nexport const STRIPE_DEFAULT_ERROR_MESSAGE = 'Payment failed. Please try again.';\nexport const STRIPE_ALREADY_PROCESSED_MESSAGE = 'This payment has already been processed. Please refresh the page and try again.';\nexport const STRIPE_SESSION_EXPIRED_MESSAGE = 'Your payment session has expired. Please refresh the page and try again.';\n\n/** The English table with every text looked up in the app's active language (an unknown code keeps its English text). */\nfunction localizedTable(english: Readonly<Record<string, string>>, prefix: string): Record<string, string> {\n return Object.fromEntries(Object.keys(english).map(code => [code, uiText(`${prefix}${code}` as UiLabelKey)]));\n}\n\nexport type StripeErrorDisplay = 'friendly' | 'table' | 'stripe';\n\nexport interface StripeErrorMessageOptions {\n /**\n * `'friendly'` (default): the table above first, then Stripe's own text for card / validation errors (customer-facing) and plain text for technical errors.\n * `'table'`: the table, then Stripe's own `message` for EVERYTHING else, technical errors included (what the cremo payment flows show today).\n * `'stripe'`: Stripe's own `message` untouched (what the apps that show `error.message` do), the fallback when there is none.\n */\n display?: StripeErrorDisplay;\n /** Text for single codes; wins over the table. */\n overrides?: Readonly<Record<string, string>> | null;\n /** Shown when there is nothing better. */\n fallback?: string;\n}\n\n/**\n * The text to show the customer for a Stripe.js error.\n * Friendly mode order: decline_code, code, the two technical Stripe messages (\"already succeeded\" / \"previously confirmed\", \"expired\"),\n * technical error types, Stripe's own message, the fallback. Table mode is the same without the technical error types.\n */\nexport function getStripeErrorMessage(error: StripeErrorLike | null | undefined, options: StripeErrorMessageOptions = {}): string {\n const fallback = options.fallback ?? uiText('stripeErrors.defaultMessage');\n if (!error) return fallback;\n if (options.display === 'stripe') return error.message || fallback;\n const table = { ...localizedTable(STRIPE_ERROR_MESSAGES, 'stripeErrors.'), ...(options.overrides ?? {}) };\n if (error.decline_code && table[error.decline_code]) return table[error.decline_code];\n if (error.code && table[error.code]) return table[error.code];\n const message = error.message;\n if (message) {\n if (message.includes('already succeeded') || message.includes('previously confirmed')) return options.overrides?.['payment_intent_unexpected_state'] ?? uiText('stripeErrors.alreadyProcessed');\n if (message.includes('expired')) return uiText('stripeErrors.sessionExpired');\n }\n const technical = options.display === 'table' || !error.type || !(error.type in STRIPE_TECHNICAL_ERROR_MESSAGES) ? undefined : uiText(`stripeErrors.technical.${error.type}` as UiLabelKey);\n if (technical) return technical;\n return message || fallback;\n}\n","import { getStripeErrorMessage, type StripeErrorMessageOptions } from '../errors/stripe-errors';\nimport type { StripeConfirmationTokenLike, StripeErrorLike, StripeIntentLike } from '../stripe-loader/stripe-types';\nimport { UiLabelKey, uiText } from '@forgeroute/ui/core';\n\nexport type StripeIntentKind = 'setup' | 'payment';\n\n/**\n * What happened, in one word:\n * - `succeeded`: the intent succeeded (card charged / method saved).\n * - `processing`: the payment was accepted and is settling (a bank debit takes days).\n * - `requires_verification`: a bank account was entered by number; Stripe sent micro-deposits and the customer has to verify them (see `verification`).\n * - `requires_action`: the intent still needs the customer to do something else (3D Secure, a redirect-less next action).\n * - `requires_capture`: the payment is authorized and waits for the host to capture it (`captureMethod: 'manual'`).\n * - `requires_payment_method`: Stripe sends the intent back for a new payment method (the payment failed).\n * - `canceled` / `unknown`: any other status.\n */\nexport type StripeOutcome = 'succeeded' | 'processing' | 'requires_verification' | 'requires_action' | 'requires_capture' | 'requires_payment_method' | 'canceled' | 'unknown';\n\n/** What the customer has to do to verify a bank account (`next_action.verify_with_microdeposits`). */\nexport interface StripeVerification {\n /** `'amounts'` (two deposits), `'descriptor_code'` (one deposit with a code) or `null` when Stripe did not say. */\n type: 'amounts' | 'descriptor_code' | null;\n /** When the deposits should have arrived: Unix seconds as Stripe sends it, and the same instant as an ISO string. `null` when unknown. */\n arrivalDate: number | null;\n arrivalDateIso: string | null;\n /** Stripe's own page where the customer can verify (https), or `null`. */\n hostedVerificationUrl: string | null;\n}\n\n/** The normalised result of a confirmation (or of `handleReturn`). */\nexport interface StripeConfirmedEvent {\n kind: StripeIntentKind;\n /** Stripe's own `status` of the intent. */\n status: string;\n outcome: StripeOutcome;\n /** The intent exactly as Stripe.js returned it. */\n intent: StripeIntentLike;\n setupIntent?: StripeIntentLike;\n paymentIntent?: StripeIntentLike;\n intentId: string;\n /** The payment method of the intent as an id (`pm_...`), whether Stripe sent it as a string or an object; `null` when there is none. */\n paymentMethodId: string | null;\n /** Set when `outcome` is `requires_verification`. */\n verification: StripeVerification | null;\n /** The 3D Secure step (`stripe.handleCardAction`) ran before this result (`autoHandleCardAction` / `handleNextAction`). Hosts use it for their post-3DS wording. */\n actionHandled: boolean;\n}\n\n/** The funding of a card as Stripe reports it in a ConfirmationToken's `payment_method_preview.card.funding`. */\nexport type StripeCardFunding = 'credit' | 'debit' | 'prepaid' | 'unknown';\n\n/**\n * A ConfirmationToken made from the typed form (`createConfirmationToken()` / `collectConfirmationToken`), with what Stripe shows about the payment method BEFORE any\n * intent exists. `funding` is only for display and for hosts that estimate a fee; a backend that charges by it must read the funding itself from the token id\n * (`stripe.confirmationTokens.retrieve`), never trust the browser.\n */\nexport interface StripeConfirmationTokenEvent {\n /** `ctoken_...`: send it to your backend with the request that creates the intent. */\n id: string;\n /** The preview's payment method type (`'card'`, `'us_bank_account'`, `'link'`, ...), `null` when Stripe sent none. */\n paymentMethodType: string | null;\n /** The card's funding; `null` when the payment method is not a card, `'unknown'` when Stripe did not say. */\n funding: StripeCardFunding | null;\n brand: string | null;\n last4: string | null;\n country: string | null;\n /** `'apple_pay'` / `'google_pay'` / ... when a wallet card was used. */\n wallet: string | null;\n}\n\n/** The normalised {@link StripeConfirmationTokenEvent} of a ConfirmationToken. */\nexport function confirmationTokenEventOf(token: StripeConfirmationTokenLike): StripeConfirmationTokenEvent {\n const preview = token.payment_method_preview;\n const card = preview?.card ?? null;\n const funding = card ? (card.funding === 'credit' || card.funding === 'debit' || card.funding === 'prepaid' ? card.funding : 'unknown') : null;\n return {\n id: token.id,\n paymentMethodType: preview?.type ?? null,\n funding,\n brand: card?.brand ?? null,\n last4: card?.last4 ?? null,\n country: card?.country ?? null,\n wallet: card?.wallet?.type ?? null,\n };\n}\n\n/** Why a flow stopped. */\nexport type StripeFailureStage = 'load' | 'submit' | 'intent' | 'confirm' | 'action' | 'result' | 'verify' | 'return';\n\n/** A failure: `message` is what to show the customer; `stripeMessage` is Stripe's own text. */\nexport interface StripeFailure {\n code: string;\n message: string;\n stripeMessage: string;\n declineCode?: string;\n type?: string;\n stage: StripeFailureStage;\n /** The Stripe error as returned, when there was one. */\n error?: StripeErrorLike;\n /** True when the failure happened in or after the 3D Secure step. */\n actionHandled?: boolean;\n /** Stripe's status of the intent when the failure is about the intent's status (`requires_payment_method`, `canceled`, ...). */\n status?: string;\n}\n\n/** The payment method type the Payment Element currently shows (`'card'`, `'us_bank_account'`, ...) and its completeness. */\nexport interface StripeElementChange {\n complete: boolean;\n empty: boolean;\n /** The selected payment method type, `null` when Stripe did not send one. */\n type: string | null;\n /** Stripe's own validation message for the form, when it shows one. */\n errorMessage: string | null;\n}\n\nexport const MSG_NOT_INITIALIZED = 'Payment system not initialized';\nexport const MSG_INTENT_FAILED = 'Failed to create payment intent';\nexport const MSG_NOT_COMPLETED = 'Payment was not completed';\nexport const MSG_REQUIRES_PAYMENT_METHOD = 'Payment failed. Please try a different payment method.';\nexport const MSG_NO_PAYMENT_METHOD = 'No payment method was returned';\nexport const MSG_AUTH_FAILED = 'Payment authentication failed';\nexport const MSG_AUTH_NOT_COMPLETED = 'Payment authentication was not completed';\nexport const MSG_KEY_MISSING = 'The payment form is not set up yet';\nexport const MSG_LOAD_FAILED = 'Failed to load the payment service';\nexport const MSG_TOKEN_FAILED = 'The card details could not be checked. Please try again.';\n\nexport function paymentMethodIdOf(intent: StripeIntentLike | null | undefined): string | null {\n const pm = intent?.payment_method;\n if (!pm) return null;\n return typeof pm === 'string' ? pm : pm.id || null;\n}\n\n/** The micro-deposit verification of an intent whose `next_action` is `verify_with_microdeposits`, else `null`. */\nexport function verificationOf(intent: StripeIntentLike | null | undefined): StripeVerification | null {\n const action = intent?.next_action;\n if (action?.type !== 'verify_with_microdeposits') return null;\n const details = action.verify_with_microdeposits ?? {};\n const arrival = typeof details.arrival_date === 'number' ? details.arrival_date : null;\n const type = details.microdeposit_type === 'amounts' || details.microdeposit_type === 'descriptor_code' ? details.microdeposit_type : null;\n const url = typeof details.hosted_verification_url === 'string' && details.hosted_verification_url ? details.hosted_verification_url : null;\n return { type, arrivalDate: arrival, arrivalDateIso: arrival === null ? null : new Date(arrival * 1000).toISOString(), hostedVerificationUrl: url };\n}\n\n/** Stripe's intent `status` (and `next_action`) as one `StripeOutcome`. */\nexport function outcomeOf(intent: StripeIntentLike): StripeOutcome {\n switch (intent.status) {\n case 'succeeded': return 'succeeded';\n case 'processing': return 'processing';\n case 'requires_capture': return 'requires_capture';\n case 'requires_action': return intent.next_action?.type === 'verify_with_microdeposits' ? 'requires_verification' : 'requires_action';\n case 'requires_payment_method': return 'requires_payment_method';\n case 'canceled': return 'canceled';\n default: return 'unknown';\n }\n}\n\nexport function normalizeIntent(kind: StripeIntentKind, intent: StripeIntentLike): StripeConfirmedEvent {\n const outcome = outcomeOf(intent);\n return {\n kind,\n status: intent.status,\n outcome,\n intent,\n ...(kind === 'setup' ? { setupIntent: intent } : { paymentIntent: intent }),\n intentId: intent.id,\n paymentMethodId: paymentMethodIdOf(intent),\n verification: outcome === 'requires_verification' ? verificationOf(intent) : null,\n actionHandled: false,\n };\n}\n\n/** A failure from a Stripe error, with the text to show chosen by `display` (see `getStripeErrorMessage`). */\nexport function failureFromError(error: StripeErrorLike | null | undefined, stage: StripeFailureStage, options: StripeErrorMessageOptions = {}): StripeFailure {\n return {\n code: error?.code || error?.type || 'unknown_error',\n message: getStripeErrorMessage(error, options),\n stripeMessage: error?.message ?? '',\n ...(error?.decline_code ? { declineCode: error.decline_code } : {}),\n ...(error?.type ? { type: error.type } : {}),\n stage,\n ...(error ? { error } : {}),\n };\n}\n\n/** A failure that is not a Stripe error (our own text). */\nconst KNOWN_MESSAGE_KEYS: Readonly<Record<string, UiLabelKey>> = {\n 'Payment system not initialized': 'stripePayment.msg.notInitialized',\n 'Failed to create payment intent': 'stripePayment.msg.intentFailed',\n 'Payment was not completed': 'stripePayment.msg.notCompleted',\n 'Payment failed. Please try a different payment method.': 'stripePayment.msg.requiresPaymentMethod',\n 'No payment method was returned': 'stripePayment.msg.noPaymentMethod',\n 'Payment authentication failed': 'stripePayment.msg.authFailed',\n 'Payment authentication was not completed': 'stripePayment.msg.authNotCompleted',\n 'The payment form is not set up yet': 'stripePayment.msg.keyMissing',\n 'Failed to load the payment service': 'stripePayment.msg.loadFailed',\n 'Verification failed': 'stripePayment.msg.verifyFailed',\n 'Verification failed. Please check the code and try again.': 'stripePayment.msg.verifyThrown',\n 'We could not check the status of this payment. Please contact support before trying again.': 'stripePayment.msg.returnFailed',\n 'Payment method setup was incomplete. Please try again.': 'stripePayment.msg.setupIncomplete',\n 'Payment authentication failed. Please try a different payment method.': 'stripePayment.msg.authFailedTryOther',\n 'Card payments are not available right now.': 'stripePayment.msg.cardsUnavailable',\n 'Failed to initialize payment. Please try again.': 'stripePayment.msg.initFailed',\n 'Could not calculate the fees. Please try again.': 'stripePayment.msg.feesFailed',\n // STRIPE_DEFAULT_ERROR_MESSAGE: what a createIntent callback that throws without any message reports.\n 'Payment failed. Please try again.': 'stripeErrors.defaultMessage',\n 'The card details could not be checked. Please try again.': 'stripePayment.msg.tokenFailed',\n};\n\n/** Our own fixed messages (\"Payment system not initialized\" ...) in the app's active language; any other text (Stripe's, a host's) is returned as it is. */\nexport function localizeStripeMessage(message: string): string {\n const key = KNOWN_MESSAGE_KEYS[message];\n return key ? uiText(key) : message;\n}\n\nexport function failure(code: string, message: string, stage: StripeFailureStage, stripeMessage = ''): StripeFailure {\n return { code, message: localizeStripeMessage(message), stripeMessage, stage };\n}\n\n/** An error thrown by a host callback or a request: its own `error.error.message` (HTTP body), `message`, else the fallback. */\nexport function messageOfThrown(err: unknown, fallback: string): string {\n const e = err as { error?: { message?: unknown }; message?: unknown } | null | undefined;\n if (typeof e?.error?.message === 'string' && e.error.message) return e.error.message;\n if (typeof e?.message === 'string' && e.message) return e.message;\n return fallback;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { STRIPE_LOADER, STRIPE_PAYMENT_DEFAULTS, buildLoadOptions } from '../stripe-loader/stripe-loader';\nimport type { StripeLike, StripeLoadOptions } from '../stripe-loader/stripe-types';\nimport {\n failure, failureFromError, messageOfThrown, normalizeIntent, MSG_KEY_MISSING, MSG_LOAD_FAILED,\n type StripeConfirmedEvent, type StripeFailure, type StripeIntentKind, type StripeOutcome,\n} from './stripe-outcomes';\nimport type { StripeConfirmResult, StripeIntentLike } from '../stripe-loader/stripe-types';\n\n/** The Stripe object with `confirmUsBankAccountSetup`, for an app that keeps its own routing-number form (contractor). Use it as the type argument of `StripePaymentService.load`. */\nexport interface StripeLikeWithBankSetup extends StripeLike {\n confirmUsBankAccountSetup(clientSecret: string, data?: Record<string, unknown>): Promise<StripeConfirmResult<StripeIntentLike>>;\n}\n\n/** What `stripe.verifyMicrodepositsFor*` takes: the two deposit amounts in cents, or the 6-character code of the one deposit. */\nexport type MicrodepositVerifyData = { amounts: number[] } | { descriptor_code: string };\n\nexport interface StripeMicrodepositResult {\n /** The intent is verified (`processing` or `succeeded`). */\n ok: boolean;\n outcome: StripeOutcome | null;\n intent: StripeIntentLike | null;\n /** Set when `ok` is false. `message` is Stripe's own text (customer-facing for a wrong amount / code) or ours. */\n failure: StripeFailure | null;\n}\n\n/** What Stripe appends to the return URL after a redirect (`payment_intent_client_secret` / `setup_intent_client_secret`, `redirect_status`). */\nexport interface StripeReturnParams {\n kind: StripeIntentKind;\n clientSecret: string;\n redirectStatus: string | null;\n}\n\n/** Reads the intent Stripe returned the customer with from a query string (`location.search`); `null` when there is none. */\nexport function readStripeReturnParams(search: string): StripeReturnParams | null {\n const params = new URLSearchParams(search.startsWith('?') ? search.slice(1) : search);\n const payment = params.get('payment_intent_client_secret');\n const setup = params.get('setup_intent_client_secret');\n const kind: StripeIntentKind | null = payment ? 'payment' : setup ? 'setup' : null;\n if (!kind) return null;\n return { kind, clientSecret: (payment ?? setup) as string, redirectStatus: params.get('redirect_status') };\n}\n\nexport const MSG_VERIFY_FAILED = 'Verification failed';\nexport const MSG_VERIFY_THROWN = 'Verification failed. Please check the code and try again.';\nexport const MSG_RETURN_FAILED = 'We could not check the status of this payment. Please contact support before trying again.';\n\n/**\n * Verifies a bank account with micro-deposits through Stripe.js (`verifyMicrodepositsForPayment` / `verifyMicrodepositsForSetup`), the way the public\n * \"verify your bank\" pages do it with the intent's client secret. The result is `ok` once the intent is `processing` or `succeeded`.\n */\nexport async function verifyMicrodeposits(stripe: StripeLike, flow: StripeIntentKind, clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult> {\n const call = flow === 'payment' ? stripe.verifyMicrodepositsForPayment : stripe.verifyMicrodepositsForSetup;\n if (typeof call !== 'function') return { ok: false, outcome: null, intent: null, failure: failure('unsupported', MSG_VERIFY_FAILED, 'verify') };\n try {\n const result = await call.call(stripe, clientSecret, data as Record<string, unknown>);\n if (result.error) return { ok: false, outcome: null, intent: null, failure: failureFromError(result.error, 'verify', { display: 'stripe', fallback: MSG_VERIFY_FAILED }) };\n const intent = (flow === 'payment' ? result.paymentIntent : result.setupIntent) ?? null;\n const event = intent ? normalizeIntent(flow, intent) : null;\n if (event && (event.outcome === 'processing' || event.outcome === 'succeeded')) return { ok: true, outcome: event.outcome, intent, failure: null };\n return { ok: false, outcome: event?.outcome ?? null, intent, failure: failure('verification_incomplete', MSG_VERIFY_FAILED, 'verify') };\n } catch (err) {\n return { ok: false, outcome: null, intent: null, failure: failure('verification_failed', messageOfThrown(err, MSG_VERIFY_THROWN), 'verify', messageOfThrown(err, '')) };\n }\n}\n\nexport interface StripeReturnResult {\n event: StripeConfirmedEvent | null;\n failure: StripeFailure | null;\n}\n\n/** Retrieves the intent after Stripe redirected the customer back (`retrievePaymentIntent` / `retrieveSetupIntent`) and normalises it. */\nexport async function retrieveIntent(stripe: StripeLike, kind: StripeIntentKind, clientSecret: string): Promise<StripeReturnResult> {\n const call = kind === 'payment' ? stripe.retrievePaymentIntent : stripe.retrieveSetupIntent;\n if (typeof call !== 'function') return { event: null, failure: failure('unsupported', MSG_RETURN_FAILED, 'return') };\n try {\n const result = await call.call(stripe, clientSecret);\n if (result.error) return { event: null, failure: failureFromError(result.error, 'return') };\n const intent = kind === 'payment' ? result.paymentIntent : result.setupIntent;\n if (!intent) return { event: null, failure: failure('no_intent', MSG_RETURN_FAILED, 'return') };\n return { event: normalizeIntent(kind, intent), failure: null };\n } catch (err) {\n return { event: null, failure: failure('return_failed', MSG_RETURN_FAILED, 'return', messageOfThrown(err, '')) };\n }\n}\n\nexport interface StripeConnection {\n publishableKey?: string | null;\n /** A Stripe Connect account id. */\n stripeAccount?: string | null;\n locale?: string | null;\n /** Further `loadStripe` options. */\n options?: StripeLoadOptions | null;\n}\n\nexport interface HandleReturnOptions extends StripeConnection {\n /** The client secret from the return URL. Default: read from `search`. */\n clientSecret?: string;\n /** Which kind of intent `clientSecret` belongs to (default: from the URL parameter name, else `'payment'`). */\n kind?: StripeIntentKind;\n /** The query string to read the return parameters from. Default: `window.location.search`. */\n search?: string;\n}\n\n/**\n * Stripe.js without a component: loads Stripe like `ui-stripe-payment` does, verifies micro-deposits and checks the intent after a redirect.\n * For pages that only verify a bank account (the \"verify your bank\" link) or only land on the `returnUrl`.\n */\n@Injectable({ providedIn: 'root' })\nexport class StripePaymentService {\n private readonly loader = inject(STRIPE_LOADER);\n private readonly defaults = inject(STRIPE_PAYMENT_DEFAULTS);\n\n /** Loads Stripe.js (`loadStripe(key, options)`). Pass a type for methods the library does not use: `load<StripeLikeWithBankSetup>(...)` (contractor's `confirmUsBankAccountSetup`). Throws when the key is missing or Stripe could not be created. */\n async load<T extends StripeLike = StripeLike>(connection: StripeConnection = {}): Promise<T> {\n const key = connection.publishableKey || this.defaults.publishableKey;\n if (!key) throw new Error(MSG_KEY_MISSING);\n const stripe = await this.loader(key, buildLoadOptions(connection.stripeAccount, connection.locale ?? this.defaults.locale, connection.options));\n if (!stripe) throw new Error(MSG_LOAD_FAILED);\n return stripe as T;\n }\n\n async verifyMicrodepositsForPayment(clientSecret: string, data: MicrodepositVerifyData, connection: StripeConnection = {}): Promise<StripeMicrodepositResult> {\n return this.verify('payment', clientSecret, data, connection);\n }\n\n async verifyMicrodepositsForSetup(clientSecret: string, data: MicrodepositVerifyData, connection: StripeConnection = {}): Promise<StripeMicrodepositResult> {\n return this.verify('setup', clientSecret, data, connection);\n }\n\n /** The intent the customer returned with, normalised. `{ event: null, failure: null }` when the URL carries no intent. */\n async handleReturn(options: HandleReturnOptions = {}): Promise<StripeReturnResult> {\n const fromUrl = options.clientSecret ? null : readStripeReturnParams(options.search ?? (typeof window === 'undefined' ? '' : window.location.search));\n const clientSecret = options.clientSecret ?? fromUrl?.clientSecret;\n if (!clientSecret) return { event: null, failure: null };\n const kind = options.kind ?? fromUrl?.kind ?? 'payment';\n let stripe: StripeLike;\n try { stripe = await this.load(options); } catch (err) { return { event: null, failure: failure('load_error', messageOfThrown(err, MSG_LOAD_FAILED), 'load', messageOfThrown(err, '')) }; }\n return retrieveIntent(stripe, kind, clientSecret);\n }\n\n private async verify(flow: StripeIntentKind, clientSecret: string, data: MicrodepositVerifyData, connection: StripeConnection): Promise<StripeMicrodepositResult> {\n let stripe: StripeLike;\n try { stripe = await this.load(connection); } catch (err) { return { ok: false, outcome: null, intent: null, failure: failure('load_error', messageOfThrown(err, MSG_LOAD_FAILED), 'load', messageOfThrown(err, '')) }; }\n return verifyMicrodeposits(stripe, flow, clientSecret, data);\n }\n}\n","import { isDarkPage } from '@forgeroute/ui/utils';\n\n/**\n * The Payment Element `appearance` for the page's own look: Stripe's variables read from CSS custom properties at runtime, so one set of\n * tokens styles the page and the payment form, in light and dark.\n *\n * :root { --ui-stripe-color-primary: #0d9488; --ui-stripe-border-radius: 8px; }\n *\n * Variables read (all optional; a missing one is left out so Stripe's default stays): `--ui-stripe-color-primary`, `--ui-stripe-color-background`,\n * `--ui-stripe-color-text`, `--ui-stripe-color-danger`, `--ui-stripe-font-family`, `--ui-stripe-border-radius`, `--ui-stripe-font-size-base`.\n * The theme is `night` when the page is dark (`data-theme=\"dark\"`, or the system is dark and `data-theme` is not `light`), else `stripe`.\n */\nexport interface StripeAppearance {\n theme?: 'stripe' | 'night' | 'flat';\n variables?: Record<string, string>;\n rules?: Record<string, Record<string, string>>;\n labels?: 'above' | 'floating';\n disableAnimations?: boolean;\n}\n\nconst TOKENS: readonly (readonly [string, string])[] = [\n ['--ui-stripe-color-primary', 'colorPrimary'],\n ['--ui-stripe-color-background', 'colorBackground'],\n ['--ui-stripe-color-text', 'colorText'],\n ['--ui-stripe-color-danger', 'colorDanger'],\n ['--ui-stripe-font-family', 'fontFamily'],\n ['--ui-stripe-border-radius', 'borderRadius'],\n ['--ui-stripe-font-size-base', 'fontSizeBase'],\n];\n\n// `isDarkPage` lives in the main entry (shared with the Square entry); it stays exported from here so existing imports keep working.\nexport { isDarkPage };\n\n/** Builds the appearance from the tokens in effect on `element` (default: the document root). */\nexport function readStripeAppearance(doc: Document, element: Element = doc.documentElement): StripeAppearance {\n const view = doc.defaultView;\n const variables: Record<string, string> = {};\n if (view) {\n const style = view.getComputedStyle(element);\n for (const [token, variable] of TOKENS) {\n const value = style.getPropertyValue(token).trim();\n if (value) variables[variable] = value;\n }\n }\n return { theme: isDarkPage(doc) ? 'night' : 'stripe', ...(Object.keys(variables).length ? { variables } : {}) };\n}\n\n/**\n * The app's theme tokens for {@link stripeAppearanceFromTheme}. Every field is optional: a missing one is left out so the processor's default stays.\n * Colours are any CSS colour string; `radius` / `fontSize` are CSS lengths (`'8px'`, `'16px'`).\n */\nexport interface StripeThemeTokens {\n /** Focus ring / selected tab / links. */\n primary?: string;\n background?: string;\n text?: string;\n /** Secondary text (placeholders, labels' helper text). */\n textMuted?: string;\n danger?: string;\n /** The border of inputs and tabs. */\n border?: string;\n fontFamily?: string;\n radius?: string;\n fontSize?: string;\n /** The page is dark: the `night` base theme instead of `stripe`. Default false. */\n dark?: boolean;\n /** `'floating'` labels inside the input; default `'above'` (labels above the input read better at 320px and for screen magnifiers). */\n labels?: 'above' | 'floating';\n}\n\n/**\n * Neutral appearance helper for apps: turns the app's own theme tokens into a Payment Element `appearance` object (pass it to `[appearance]`), so the payment form matches the page in light and dark\n * without the app knowing the processor's variable names. Pure (no DOM): call it with the values you already have (a design-token object, a signal, `getComputedStyle` results).\n * Colours go to the base variables; input and tab borders and the label colour are set through rules so the 3:1 non-text contrast of the page's border token carries over.\n */\nexport function stripeAppearanceFromTheme(tokens: StripeThemeTokens): StripeAppearance {\n const variables: Record<string, string> = {};\n const set = (name: string, value: string | undefined): void => { if (value && value.trim()) variables[name] = value.trim(); };\n set('colorPrimary', tokens.primary);\n set('colorBackground', tokens.background);\n set('colorText', tokens.text);\n set('colorTextSecondary', tokens.textMuted);\n set('colorDanger', tokens.danger);\n set('fontFamily', tokens.fontFamily);\n set('borderRadius', tokens.radius);\n set('fontSizeBase', tokens.fontSize);\n const rules: Record<string, Record<string, string>> = {};\n const rule = (selector: string, props: Record<string, string | undefined>): void => {\n const filled = Object.fromEntries(Object.entries(props).filter(([, v]) => !!v && v.trim())) as Record<string, string>;\n if (Object.keys(filled).length) rules[selector] = filled;\n };\n const border = tokens.border?.trim();\n if (border) { // a blank (whitespace only) border token adds no rule (it would otherwise become the invalid \"1px solid\")\n rule('.Input', { border: `1px solid ${border}` });\n rule('.Tab', { border: `1px solid ${border}` });\n }\n if (tokens.text) rule('.Label', { color: tokens.text });\n return {\n theme: tokens.dark ? 'night' : 'stripe',\n labels: tokens.labels ?? 'above',\n ...(Object.keys(variables).length ? { variables } : {}),\n ...(Object.keys(rules).length ? { rules } : {}),\n };\n}\n","import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, PLATFORM_ID, afterNextRender, computed, effect, inject, input, output, signal, untracked, viewChild, ViewEncapsulation } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent, uiText } from '@forgeroute/ui/core';\nimport { PAYMENT_READINESS_EVERY_MS, PAYMENT_READINESS_TIMEOUT_MS, PAYMENT_REQUEST_TIMEOUT_MS, PAYMENT_STATUS_CHECK_TIMEOUT_MS, PAYMENT_STATUS_FAIL_GRACE_MS, PAYMENT_STATUS_HARD_MAX_MS, PAYMENT_AUTH_TIMEOUT_MS, PAYMENT_STATUS_POLL_MAX_MS, PAYMENT_STATUS_POLL_MS, PaymentAttemptStatusComponent, attemptLabelKey, createPaymentProtection, wasQueuedOffline, warnQueuedPayment, isAttemptFailedReplay, type CheckPaymentStatusFn, type PaymentAttempt, type PaymentAttemptOutcome, type PaymentAttemptResult, type PaymentReadiness, type PaymentReadinessResult, type ReadinessCheckFn } from '@forgeroute/ui/payments';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { STRIPE_LOADER, STRIPE_PAYMENT_DEFAULTS, buildLoadOptions } from '../stripe-loader/stripe-loader';\nimport type { StripeElementsLike, StripeLike, StripeLoadOptions, StripePaymentElementLike } from '../stripe-loader/stripe-types';\nimport type { StripeErrorDisplay, StripeErrorMessageOptions } from '../errors/stripe-errors';\nimport { STRIPE_DEFAULT_ERROR_MESSAGE } from '../errors/stripe-errors';\nimport { MSG_TOKEN_FAILED, confirmationTokenEventOf, MSG_AUTH_FAILED, MSG_AUTH_NOT_COMPLETED, MSG_KEY_MISSING, MSG_INTENT_FAILED, MSG_LOAD_FAILED, MSG_NOT_COMPLETED, MSG_NOT_INITIALIZED, MSG_NO_PAYMENT_METHOD, MSG_REQUIRES_PAYMENT_METHOD, failure, failureFromError, messageOfThrown, normalizeIntent, type StripeConfirmationTokenEvent, type StripeConfirmedEvent, type StripeElementChange, type StripeFailure, type StripeFailureStage, type StripeIntentKind, localizeStripeMessage } from './stripe-outcomes';\nimport { readStripeReturnParams, retrieveIntent, verifyMicrodeposits, type MicrodepositVerifyData, type StripeMicrodepositResult, type StripeReturnResult } from './stripe-actions';\nimport { readStripeAppearance, type StripeAppearance } from './stripe-appearance';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/** The texts of the screen-reader status region. */\nexport interface StripeA11yMessages {\n loading: string;\n savingMethod: string;\n processingPayment: string;\n methodSaved: string;\n paymentReceived: string;\n paymentProcessing: string;\n paymentAuthorized: string;\n verificationNeeded: string;\n /** Setup mode: no payment is involved; the bank account is not saved until the payer verifies the deposits. */\n verificationNeededSetup: string;\n actionRequired: string;\n}\n\n/** The screen-reader messages of the payment form; read on every access, so they follow the app's active language. */\nexport const STRIPE_A11Y_MESSAGES: Readonly<StripeA11yMessages> = {\n get loading() { return uiText('stripePayment.a11y.loading'); },\n get savingMethod() { return uiText('stripePayment.a11y.savingMethod'); },\n get processingPayment() { return uiText('stripePayment.a11y.processingPayment'); },\n get methodSaved() { return uiText('stripePayment.a11y.methodSaved'); },\n get paymentReceived() { return uiText('stripePayment.a11y.paymentReceived'); },\n get paymentProcessing() { return uiText('stripePayment.a11y.paymentProcessing'); },\n get paymentAuthorized() { return uiText('stripePayment.a11y.paymentAuthorized'); },\n get verificationNeeded() { return uiText('stripePayment.a11y.verificationNeeded'); },\n get verificationNeededSetup() { return uiText('stripePayment.a11y.verificationNeededSetup'); },\n get actionRequired() { return uiText('stripePayment.a11y.actionRequired'); },\n};\n\n/** The exact text shown while the bank-account tab is selected. */\nexport const STRIPE_ACH_NOTICE = 'Signing in to your bank account lets you pay right away. Entering your routing and account numbers instead requires verification with two small deposits, which typically take a couple of days to arrive in your account.';\n\n/**\n * \"Deferred intent\" Elements: the form is shown first, the PaymentIntent / SetupIntent is created on the host's backend when the customer submits.\n * Maps to `stripe.elements({ mode, amount, currency, setup_future_usage, payment_method_types, ... })`.\n */\nexport interface StripeDeferredIntent {\n /** Default: the component's `mode`. */\n mode?: 'payment' | 'setup' | 'subscription';\n /** Smallest currency unit (cents). Changing it later calls `elements.update({ amount })` (no re-init). */\n amount?: number;\n currency: string;\n setupFutureUsage?: 'on_session' | 'off_session';\n captureMethod?: 'automatic' | 'automatic_async' | 'manual';\n onBehalfOf?: string;\n}\n\n/** Called on submit in deferred mode: create the intent on your backend and resolve its client secret (or `{ clientSecret }`). */\nexport type StripeCreateIntentFn = (context: { mode: StripeIntentKind; confirmationToken?: StripeConfirmationTokenEvent | null; attemptKey?: string; payableRef?: string | null }) => Promise<string | { clientSecret: string }>;\n\nexport interface StripeBillingDetails {\n name?: string;\n email?: string;\n phone?: string;\n address?: Record<string, string | null | undefined>;\n}\n\n/**\n * The live Stripe.js objects of a form, handed to the host by `(stripeReady)`: the host's own code can call `stripe.confirmPayment({ elements, ... })`,\n * `elements.submit()`, `elements.update()`, `elements.fetchUpdates()` and `paymentElement.update()` with its own arguments.\n */\nexport interface StripeReadyEvent {\n stripe: StripeLike;\n elements: StripeElementsLike;\n paymentElement: StripePaymentElementLike;\n}\n\n/** What ONE protected confirm learned (its own object, passed down: nothing here lives on the component, so a late answer of an older attempt never leaks into the next). */\ninterface ConfirmTrace {\n /** Failures are held back until the attempt is classified: an UNKNOWN outcome must never be shown or emitted as \"failed\". */\n held: boolean;\n failure: StripeFailure | null;\n thrown: boolean;\n outcome: string | null;\n}\n\n/** Stripe error types and codes that say \"Stripe may or may not have processed this\": never a definitive decline. */\nconst AMBIGUOUS_STRIPE_TYPES = new Set(['api_connection_error', 'api_error', 'rate_limit_error', 'idempotency_error']);\n// `setup_intent_unexpected_state`: a re-confirm of a SetupIntent that already succeeded / is processing. Proves nothing about the NEW attempt: the host's status check decides, never a definitive failure that moves the epoch.\nconst AMBIGUOUS_STRIPE_CODES = new Set(['payment_intent_unexpected_state', 'setup_intent_unexpected_state', 'idempotency_error', 'idempotency_key_in_use', 'lock_timeout']);\n\n/** Shown when a setup ends without a SetupIntent / is cancelled (the English source text of `stripePayment.msg.setupIncomplete`). */\nconst MSG_SETUP_INCOMPLETE = 'Payment method setup was incomplete. Please try again.';\n\n/** The failure code of an instant-only form whose intent came back needing micro-deposit verification. */\nexport const INSTANT_ONLY_CODE = 'instant_only_unsupported';\n\nlet nextId = 0;\nconst jsonEqual = (a: unknown, b: unknown): boolean => JSON.stringify(a) === JSON.stringify(b);\n\n/**\n * Stripe Payment Element: saves a payment method (`mode=\"setup\"`, a SetupIntent) or takes a payment (`mode=\"payment\"`, a PaymentIntent).\n *\n * The host app creates the intent on its backend and passes the `clientSecret` (or, for a deferred intent, `[deferred]` + `[createIntent]`).\n * Stripe.js is loaded lazily through `@stripe/stripe-js` (an optional peer dependency); nothing of Stripe is in the library's static imports.\n *\n * <ui-stripe-payment mode=\"setup\" [publishableKey]=\"key\" [clientSecret]=\"secret()\" submitLabel=\"Save card\"\n * (confirmed)=\"onSaved($event)\" (failed)=\"onFailed($event)\" />\n *\n * Every Stripe.js call and option reproduces what the CRM apps do today; see docs/stripe.md (\"Parity with the existing app implementations\").\n */\n@Component({\n selector: 'ui-stripe-payment',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [AlertComponent, ButtonComponent, PaymentAttemptStatusComponent, SkeletonComponent],\n host: { '[attr.aria-busy]': '!mountOnly() && (loading() || submitting()) ? \"true\" : null' },\n template: `\n <div class=\"sp\">\n @if (!mountOnly() || a11yMessages()) {\n <div class=\"sp-sr\" role=\"status\" aria-live=\"polite\" data-testid=\"stripe-status\">{{ statusText() }}</div>\n }\n @if (!mountOnly() && protectionOn()) {\n <ui-payment-attempt-status [attempt]=\"attempt\" [readiness]=\"readiness\" [kind]=\"mode()\" [allowStartOver]=\"allowStartOver()\" [showPaid]=\"showPaid()\" (retryLoad)=\"reload()\" />\n }\n @if (!mountOnly() && (loading() || pending())) {\n <div class=\"sp-skeleton\" data-testid=\"stripe-skeleton\" aria-hidden=\"true\">\n <ui-skeleton [height]=\"44\" [mb]=\"10\" />\n <ui-skeleton [height]=\"44\" [mb]=\"10\" />\n <ui-skeleton [height]=\"44\" width=\"60%\" />\n </div>\n }\n @if (!mountOnly() && loadErrorText(); as text) {\n <div class=\"sp-block\" data-testid=\"stripe-load-error\"><ui-alert variant=\"danger\">{{ text }}</ui-alert></div>\n }\n @if (!mountOnly() && required()) {\n <div class=\"sp-label\" data-testid=\"stripe-required-label\">{{ label() }}<span class=\"sp-required\" aria-hidden=\"true\">*</span></div>\n }\n <div #mount class=\"sp-mount\" [attr.id]=\"mountId() || null\" [class]=\"mountClass()\" [class.sp-mount--hidden]=\"mountHidden()\" [attr.aria-hidden]=\"mountHidden() ? 'true' : null\" [attr.inert]=\"mountHidden() ? '' : null\"\n [attr.role]=\"mountOnly() ? null : 'group'\" [attr.aria-label]=\"mountOnly() ? null : label()\" data-testid=\"stripe-mount\"></div>\n @if (!mountOnly() && achNoticeVisible()) {\n <div class=\"sp-block\" [attr.data-testid]=\"achNoticeTestId()\"><ui-alert variant=\"info\">{{ achNoticeText() }}</ui-alert></div>\n }\n @if (!mountOnly() && errorText(); as text) {\n <div #errorBox class=\"sp-block sp-error\" [id]=\"errorId\" tabindex=\"-1\" data-testid=\"stripe-error\"><ui-alert variant=\"danger\">{{ text }}</ui-alert></div>\n }\n @if (!mountOnly()) {\n <!-- stays in the DOM so the reason is announced when it appears; the reason is text in a warning alert, never colour alone -->\n <div class=\"sp-blocked\" role=\"status\" aria-live=\"polite\" data-testid=\"stripe-blocked-status\">\n @if (blocked()) { <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"stripe-blocked\">{{ blockedText() }}</ui-alert> }\n </div>\n }\n @if (!mountOnly() && showSubmit()) {\n <div class=\"sp-actions\">\n <ui-button variant=\"primary\" type=\"button\" [loading]=\"submitting()\" [disabled]=\"submitDisabled()\" [ariaDescribedBy]=\"errorText() ? errorId : undefined\"\n data-testid=\"stripe-submit\" (click)=\"confirm()\">{{ effectiveSubmitLabel() }}</ui-button>\n </div>\n }\n </div>\n `,\n styles: [`\n ui-stripe-payment { display: block; min-width: 0; }\n ui-stripe-payment .sp-sr {\n position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;\n clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;\n }\n .sp-block { margin-top: 12px; }\n .sp-blocked:not(:empty) { margin-top: 12px; }\n /* The error block is focused (programmatically) after a blocked submit: no ring on the container itself, the alert inside carries the message. scroll-margin keeps it clear of a sticky header. */\n .sp-error { outline: none; scroll-margin-top: 16px; scroll-margin-bottom: 80px; }\n .sp-label { font-size: 0.875rem; font-weight: 500; color: #1e293b; margin-bottom: 6px; }\n .sp-required { color: #dc2626; margin-left: 2px; }\n .sp-actions { margin-top: 16px; display: flex; justify-content: flex-end; }\n ui-stripe-payment .sp { position: relative; }\n /* While loading the form is kept laid out (so Stripe can measure it and open Apple Pay / Link / the bank login) but invisible and untouchable. */\n .sp-mount--hidden { position: absolute; top: 0; left: 0; right: 0; opacity: 0; pointer-events: none; }\n /* Phones: the button fills the row. ui-button's host is inline-flex and its inner button is content-sized, so the inner .btn is stretched (ui-button has no host width hook). */\n @media (max-width: 480px) {\n .sp-actions { display: block; }\n .sp-actions ui-button { display: flex; }\n ui-stripe-payment .sp-actions .btn { width: 100%; }\n }\n `],\n})\nexport class StripePaymentComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly loader = inject(STRIPE_LOADER);\n private readonly defaults = inject(STRIPE_PAYMENT_DEFAULTS);\n private readonly doc = inject(DOCUMENT);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n // ── Inputs ─────────────────────────────────────────────────────────────\n /**\n * Mount-only mode: the component only mounts the Payment Element. No submit button, skeleton, status text (unless `a11yMessages` is set), bank notice or error\n * alert; it never submits, confirms or updates by itself; load failures go to `(loadError)` only. The host keeps its own confirm code and calls Stripe.js with the\n * objects from `(stripeReady)`. `mountId` / `mountClass` still apply, and `(ready)`, `(elementChange)`, `(paymentMethodTypeChange)` still emit.\n */\n readonly mountOnly = input(false);\n /** `'setup'` saves a payment method (`confirmSetup`), `'payment'` takes a payment (`confirmPayment`). */\n readonly mode = input<StripeIntentKind>('payment');\n /** The publishable key (`pk_...`). Falls back to `provideStripePayment({ publishableKey })`. */\n readonly publishableKey = input<string | null>(null);\n /** The client secret of the SetupIntent / PaymentIntent your backend created. Changing it re-creates the form. */\n readonly clientSecret = input<string | null>(null);\n /** Deferred intent: show the form first, create the intent on submit with `createIntent`. Used instead of `clientSecret`. */\n readonly deferred = input<StripeDeferredIntent | null>(null);\n /** Creates the intent on submit (deferred mode) and resolves its client secret. */\n readonly createIntent = input<StripeCreateIntentFn | null>(null);\n /** A Stripe Connect account id (`acct_...`): `loadStripe(key, { stripeAccount })`. */\n readonly stripeAccount = input<string | null>(null);\n /** Stripe.js locale. */\n readonly locale = input<string | null>(null);\n /** Further `loadStripe` options. */\n readonly stripeOptions = input<StripeLoadOptions | null>(null);\n /** Payment method types for a DEFERRED intent (`elements({ payment_method_types })`). With a client secret the intent decides, nothing is passed. */\n readonly paymentMethodTypes = input<string[] | null>(null);\n /** Extra `stripe.elements()` options, merged last. */\n readonly elementsOptions = input<Record<string, unknown> | null>(null);\n\n // Payment Element options (`elements.create('payment', ...)`): only the ones that are set are passed.\n /** `'tabs'` (default), `'accordion'`, an object, or `null` to pass no layout. */\n readonly layout = input<string | Record<string, unknown> | null>('tabs');\n readonly paymentMethodOrder = input<string[] | null>(null);\n /** `{ applePay: 'never', googlePay: 'never' }` hides the wallets. */\n readonly wallets = input<Record<string, string> | null>(null);\n /** `{ billingDetails: { email: 'never', phone: 'never', address: 'auto' } }` etc. */\n readonly fields = input<Record<string, unknown> | null>(null);\n /** Pre-filled values: `{ billingDetails: { name, email, address: { country: 'US' } } }`. A later change updates the element in place. */\n readonly defaultValues = input<Record<string, unknown> | null>(null);\n readonly business = input<{ name: string } | null>(null);\n readonly terms = input<Record<string, string> | null>(null);\n /** Extra Payment Element options, merged last (readOnly, fields, ...). */\n readonly paymentElementOptions = input<Record<string, unknown> | null>(null);\n /** The Elements appearance. */\n readonly appearance = input<StripeAppearance | null>(null);\n /** Derive the appearance from the `--ui-stripe-*` CSS tokens (light / dark) when no `appearance` is set. */\n readonly appearanceFromTokens = input(false);\n\n /**\n * INSTANT-ONLY bank accounts (a subscription / recurring billing setup that must not wait days for micro-deposits). Default false = unchanged.\n * When true the component never OFFERS manual bank entry: for a CLIENT-SECRET intent the form shows whatever the intent allows, so your backend must create the PaymentIntent / SetupIntent with\n * `payment_method_options.us_bank_account.verification_method = 'instant'` (that is what removes the routing / account number entry in the Payment Element); for a DEFERRED intent the component passes\n * `paymentMethodOptions: { us_bank_account: { verification_method: 'instant' } }` to `stripe.elements()` itself (your `elementsOptions` still win). The bank notice then says \"sign in to your bank\" only.\n * Defensive check: if a SetupIntent / PaymentIntent nevertheless comes back needing micro-deposit verification, nothing is reported as confirmed, no verification UI or status is shown, and the payer reads\n * `stripePayment.msg.instantOnlyUnavailable` (\"use a card or a bank that supports bank login\"); `(failed)` carries the code `instant_only_unsupported` and the protected attempt FAILS (new key, nothing was charged or saved).\n */\n readonly instantOnly = input(false);\n /**\n * Keep Stripe Link and the wallets OFF (default false = unchanged, so no existing form changes). When true: `wallets` is forced to `{ applePay: 'never', googlePay: 'never', link: 'never' }`\n * (merged OVER your `wallets` input) and a DEFERRED intent without your own `paymentMethodTypes` is created with `payment_method_types: ['card', 'us_bank_account']`; a `link` entry in your own\n * `paymentMethodTypes` is dropped. With a client secret the intent decides the types: create it with `payment_method_types: ['card', 'us_bank_account']` on your backend.\n */\n readonly linkOff = input(false);\n /** Show the paid state of the attempt status (default true). A form whose host shows its own success notice sets it off while that notice is up. */\n readonly showPaid = input(true);\n\n // Confirmation\n /** Where Stripe sends the customer back after a redirect. Unset = the current page (`window.location.href`); `null` = pass no `return_url`. */\n readonly returnUrl = input<string | null | undefined>(undefined);\n /** Billing details sent on confirm (`confirmParams.payment_method_data.billing_details`), needed for fields hidden with `'never'`. */\n readonly billingDetails = input<StripeBillingDetails | null>(null);\n /** Extra `confirmParams`, merged last. */\n readonly confirmParams = input<Record<string, unknown> | null>(null);\n /** `'if_required'` (default) keeps the customer on the page unless the method needs a redirect. */\n readonly redirect = input<'if_required' | 'always'>('if_required');\n /** Call `elements.submit()` before confirming. Unset = automatic: yes for a deferred intent (Stripe requires it), no with a client secret. */\n readonly submitBeforeConfirm = input<boolean | null>(null);\n /** After a payment comes back `requires_action` (not a bank verification), run `stripe.handleCardAction` (3D Secure) before reporting. */\n readonly autoHandleCardAction = input(false);\n /**\n * Opt-in (default off, nothing changes): when `confirm()` runs for a CARD, create a ConfirmationToken from the Elements (`stripe.createConfirmationToken({ elements })`, after\n * `elements.submit()`) before the intent is created. The token is emitted as `(confirmationToken)` and handed to `createIntent({ mode, confirmationToken })`, so the host's backend\n * can read the card funding (credit / debit / prepaid) from Stripe BEFORE it creates the intent. A token that cannot be made never stops the payment (the `createIntent`\n * context then has no token). Only made for a DEFERRED intent (`[deferred]`, no `clientSecret`: Stripe requires deferred Elements for `createConfirmationToken`); never for a bank account, Link or a wallet tab, nor for `confirm({ useExistingIntent: true })`.\n */\n readonly collectConfirmationToken = input(false);\n\n // ── Duplicate-payment protection and readiness gate (opt-in: with `duplicateProtection` off, nothing below changes any existing behaviour) ──\n /**\n * Turns on the duplicate-charge protection (docs: \"Duplicate-payment protection\") and the readiness gate (\"Readiness gate\"): the synchronous in-flight lock for the button, Enter and `confirm()`,\n * the attempt key, the UNKNOWN outcome (timeout, offline mid-flight) with the host's `checkStatus`, offline refusal, the paid lock and the readiness reasons. Default OFF: `confirm()` behaves\n * exactly as it always did and `createIntent` receives the same context.\n */\n readonly duplicateProtection = input(false);\n /**\n * The amount of the attempt in MAJOR units (the base amount the payer typed): it goes into the attempt marker, the derived key and the host's records. Default: the deferred amount / 100. A caller whose deferred\n * amount includes fees (the Stripe payment-panel plugin) passes the base amount here, so a payment recorded after an unknown outcome is the base amount, not the fee-inclusive charge.\n */\n readonly attemptAmount = input<number | null>(null);\n /**\n * The method of the attempt as the HOST names it (marker, derived key, `succeeded` outcome / tombstone). Default: the Stripe payment method type (`'card'`, `'us_bank_account'`). The payment-panel plugin passes the\n * panel's own method (`'CARD'`, `'ACH'`), so an attempt adopted by a reload or another tab is recorded with the method the panel knows, not with a Stripe type.\n */\n readonly attemptMethod = input<string | null>(null);\n /**\n * The payable this is for (an invoice, a balance, a payment link). While an attempt is undecided its opaque marker (key, amount, method) is stored under it in `localStorage`, so a RELOAD or a\n * SECOND TAB of the same payable starts locked (unknown) with the same attempt key. Without it the protection covers this page instance only. Nothing else is stored.\n */\n readonly payableRef = input<string | null>(null);\n /**\n * Opt-in for `mode=\"setup\"` (a SetupIntent: saves a card WITHOUT charging it): with `duplicateProtection` AND `protectSetup` the same protection runs for the save, driven by the same inputs\n * (`payableRef`, `attemptKey`, `checkStatus`, `paid`, `readinessCheck`, the timeouts): synchronous lock, attempt key (also in `createIntent({ mode: 'setup', attemptKey, payableRef })` of a\n * deferred setup), UNKNOWN state with `checkStatus` polling, offline refusal, readiness gate and the reload / second-tab lock. The texts say \"payment method\" instead of \"payment\". Default OFF: a\n * setup form ignores `duplicateProtection` exactly as before. Ignored in `mode=\"payment\"`.\n */\n readonly protectSetup = input(false);\n /**\n * Only for `mode=\"setup\"` with `protectSetup` (default true = unchanged). With the default, a saved card leaves a 24-hour \"paid\" lock under the `payableRef` (every form of the payable mounted later the same day starts locked with\n * \"A payment method was just saved for this\"; only `resetPaid()` or a new `payableRef` unlocks it). `false`: the success is still reported (`(confirmed)`, `(outcome)` `succeeded`) but leaves NO lock and no 24-hour record,\n * the epoch moves (the next save derives a NEW attempt key, `..._e1`) and the form can be used again (a \"replace the card\" screen opened later the same day). A save in flight or unknown still blocks a second submit.\n * A host `attemptKey` is used as it is: with it the host must supply a new key for the next save itself. Ignored in `mode=\"payment\"`.\n */\n readonly lockAfterSuccess = input(true);\n /** A key the host supplies; empty = generated per payment attempt session. It reaches `createIntent({ attemptKey })`. */\n readonly attemptKey = input<string | null>(null);\n /** The host's status check by attempt key: resolves an UNKNOWN outcome. */\n readonly checkStatus = input<CheckPaymentStatusFn | null>(null);\n /** The payable is paid (host re-render, back navigation): every confirm is refused for good. */\n readonly paid = input(false);\n /** The host reports an ambiguous result of ITS charge call: \"Checking your payment...\" while true. */\n readonly hostPending = input(false);\n readonly statusPollMs = input(PAYMENT_STATUS_POLL_MS);\n readonly statusPollMaxMs = input(PAYMENT_STATUS_POLL_MAX_MS);\n /** A status check slower than this counts as unknown (ms). */\n readonly statusCheckTimeoutMs = input(PAYMENT_STATUS_CHECK_TIMEOUT_MS);\n /** While the attempt's own request is unsettled, a status answer `failed` is ignored for this long (ms). */\n readonly statusFailGraceMs = input(PAYMENT_STATUS_FAIL_GRACE_MS);\n /** While the attempt's own request is NEVER settled (a hung request), a status answer `failed` / `not_found` is ignored for this long after the attempt became unknown (ms, default 180000): the original request may still land. */\n readonly statusHardMaxMs = input(PAYMENT_STATUS_HARD_MAX_MS);\n /** Offer \"Start over\" after the status polling window (a new attempt with a NEW key). Turn it on ONLY when your backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key: that rule is what makes it safe. */\n readonly allowStartOver = input(false);\n /** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a payment because of the browser's offline flag (default false). */\n readonly offlineOverride = input(false);\n /** The request timeout is replaced by this while a 3-D Secure challenge or the bank window is open (ms). */\n readonly authTimeoutMs = input(PAYMENT_AUTH_TIMEOUT_MS);\n /** How long ONE `confirm()` (intent creation + Stripe confirmation) may take before the outcome counts as unknown (ms). */\n readonly confirmTimeoutMs = input(PAYMENT_REQUEST_TIMEOUT_MS);\n /** The host's readiness endpoint (`GET /api/payments/ready`): `{ ready, reasons[] }`. */\n readonly readinessCheck = input<ReadinessCheckFn | null>(null);\n readonly readinessTimeoutMs = input(PAYMENT_READINESS_TIMEOUT_MS);\n readonly readinessEveryMs = input(PAYMENT_READINESS_EVERY_MS);\n\n // Presentation\n readonly submitLabel = input('');\n /** Show the built-in submit button; turn off to use your own and call `confirm()`. */\n readonly showSubmit = input(true);\n readonly disabled = input(false);\n /**\n * Library source 2026-11-21 (additive; unset = nothing changes). While `true` no payment can be started: the built-in submit button is disabled, `confirm()` returns `null` without touching Stripe, and\n * `blockedReason` is shown in a `role=\"status\"` message (text, never colour alone). Unlike `disabled` the form itself stays editable and an attempt that is already running is not touched. Not shown in `mountOnly` mode.\n */\n readonly blocked = input(false);\n /** Why it is blocked (shown while `blocked`). Empty = the default text of the label `paymentBlocked.default`. */\n readonly blockedReason = input('');\n /** The host is still creating the intent: show the loading skeleton. */\n readonly pending = input(false);\n /** Accessible name of the payment form (also its visible heading when `required` is set). */\n readonly labelInput = input<string | null>(null, { alias: 'label' });\n readonly label = computed(() => this.labelInput() ?? this.labels.t('stripeStripePayment.label'));\n /** The payment details are required (a required wizard step): a visible heading with a red asterisk is shown above the form. Not shown in `mountOnly` mode. */\n readonly required = input(false);\n /** The `id` of the element container (an app's e2e selector such as `#payment-element`). */\n readonly mountId = input('');\n /** Extra CSS classes on the element container. */\n readonly mountClass = input('');\n /** Show the bank-account notice while that tab is selected. */\n readonly showAchNotice = input(true);\n readonly achNoticeInput = input<string | null>(null, { alias: 'achNotice' });\n readonly achNotice = computed(() => this.achNoticeInput() ?? this.labels.t('stripePayment.achNotice'));\n /** The `data-testid` of the notice (an app's existing e2e selector, e.g. `ach-setup-notice`). */\n readonly achNoticeTestId = input('stripe-ach-notice');\n /** The payment method type the host shows before Stripe reports one (cremo: `'card'`); `paymentMethodTypeChange` fires only when the reported type differs from it (or from the last report). */\n readonly initialPaymentMethodType = input('card');\n /** Show failures in the built-in alert. Turn off when the host shows `(failed)` itself. */\n readonly showErrors = input(true);\n /** `'friendly'` (default), `'table'` (table text, else Stripe's own message: the cremo payment flows) or `'stripe'` (Stripe's own message). See `getStripeErrorMessage`. */\n readonly errorDisplay = input<StripeErrorDisplay>('friendly');\n /** Different error display for single steps (e.g. `{ submit: 'stripe', action: 'stripe' }`: raw Stripe text for the validation and 3DS steps, `errorDisplay` for the rest). */\n readonly errorDisplayByStage = input<Partial<Record<StripeFailureStage, StripeErrorDisplay>> | null>(null);\n /** The text when Stripe sends an error with no message (default: \"Payment failed. Please try again.\"). */\n readonly errorFallback = input('');\n /** The same per step (Settings: `{ submit: 'Failed to submit payment information', confirm: 'Failed to confirm payment method' }`); wins over `errorFallback`. */\n readonly errorFallbackByStage = input<Partial<Record<StripeFailureStage, string>> | null>(null);\n /** Replacement texts by code: Stripe error codes AND the library's own failure codes (`not_initialized`, `no_payment_method`, `requires_payment_method`, `not_completed`, `authentication_failed`, ...). `{status}` in a text becomes Stripe's status of the intent (\"Unexpected payment status: {status}\"). */\n readonly errorMessages = input<Record<string, string> | null>(null);\n readonly loadErrorMessageInput = input<string | null>(null, { alias: 'loadErrorMessage' });\n readonly loadErrorMessage = computed(() => this.loadErrorMessageInput() ?? this.labels.t('stripeStripePayment.loadErrorMessage'));\n /** Texts of the screen-reader status region (translate them); missing keys keep the English defaults. */\n readonly a11yMessages = input<Partial<StripeA11yMessages> | null>(null);\n\n // ── Outputs ────────────────────────────────────────────────────────────\n /**\n * The live Stripe.js objects, emitted once each time the Elements are created: right after `elements.create('payment')` and `mount()` succeeded, before `(ready)`\n * (the moment the old inline code had `this.stripe` / `this.elements` / `this.paymentElement` assigned). `null` is emitted when they go away (the form is re-created for new\n * inputs, or `destroyElements()`): drop your references. Destroying the component itself emits nothing (the host owns that moment).\n */\n readonly stripeReady = output<StripeReadyEvent | null>();\n /** The Payment Element finished loading. */\n readonly ready = output<void>();\n /** The customer picked another payment method type (`'card'`, `'us_bank_account'`, ...). */\n readonly paymentMethodTypeChange = output<string>();\n /** Every change of the form: completeness and the selected type. */\n readonly elementChange = output<StripeElementChange>();\n /** A ConfirmationToken of the typed card was created (`collectConfirmationToken` during `confirm()`, or `createConfirmationToken()`). Only emitted for a card. */\n readonly confirmationToken = output<StripeConfirmationTokenEvent>();\n /**\n * The intent was confirmed (succeeded, processing, needs bank verification, or needs a further action). NOT always a success: a host must check `event.outcome === 'succeeded'` (or `'processing'`) before it treats the\n * payment / saved method as done. With the protection on, a setup that `requires_action` or `requires_verification` is still emitted here but the attempt is UNKNOWN (locked, the status check decides): see `(outcome)`.\n */\n readonly confirmed = output<StripeConfirmedEvent>();\n /** A step failed (validation, intent creation, confirmation). `message` is ready to show. */\n readonly failed = output<StripeFailure>();\n /** Stripe.js or the Payment Element could not be loaded. */\n readonly loadError = output<StripeFailure>();\n /** A confirm started / ended (the synchronous lock; only with `duplicateProtection`). */\n readonly inFlightChange = output<boolean>();\n /** Unified outcome of a payment attempt: `succeeded`, `failed`, `unknown`, `refused` (with `reason`), `pending` (only with `duplicateProtection`). */\n readonly outcome = output<PaymentAttemptOutcome>();\n /** The attempt key in effect (only with `duplicateProtection`). */\n readonly attemptKeyChange = output<string>();\n /** The readiness gate changed (only with `duplicateProtection`). */\n readonly readinessChange = output<PaymentReadinessResult>();\n\n // ── State ──────────────────────────────────────────────────────────────\n readonly loading = signal(false);\n readonly isReady = signal(false);\n readonly submitting = signal(false);\n readonly complete = signal(false);\n /** The selected payment method type, `null` until Stripe reports one. */\n readonly selectedType = signal<string | null>(null);\n readonly errorText = signal('');\n readonly loadErrorText = signal('');\n private readonly announcement = signal('');\n\n protected readonly errorId = `ui-stripe-error-${nextId++}`;\n private readonly mountRef = viewChild<ElementRef<HTMLElement>>('mount');\n private readonly errorBox = viewChild<ElementRef<HTMLElement>>('errorBox');\n\n protected readonly mountHidden = computed(() => !this.mountOnly() && (this.loading() || this.pending() || !!this.loadErrorText()));\n protected readonly achNoticeVisible = computed(() => this.showAchNotice() && this.selectedType() === 'us_bank_account');\n /** The bank notice text: the instant-only wording never mentions the two small deposits (they are not offered). */\n protected readonly achNoticeText = computed(() => this.achNoticeInput() ?? this.labels.t(this.instantOnly() ? 'stripePayment.achNoticeInstant' : 'stripePayment.achNotice'));\n protected readonly effectiveSubmitLabel = computed(() => this.submitLabel() || (this.mode() === 'setup' ? this.labels.t('stripePayment.saveMethod') : this.labels.t('stripePayment.pay')));\n protected readonly blockedText = computed(() => this.blockedReason().trim() || this.labels.t('paymentBlocked.default'));\n protected readonly submitDisabled = computed(() => this.disabled() || this.blocked() || this.loading() || this.pending() || !this.isReady() || !!this.loadErrorText()\n || (this.protectionOn() && (this.attempt.unknown() || this.attempt.paidLocked() || !this.readiness.ready())));\n private readonly messages = computed((): StripeA11yMessages => {\n const given = Object.fromEntries(Object.entries(this.a11yMessages() ?? {}).filter(([, text]) => typeof text === 'string')) as Partial<StripeA11yMessages>;\n return { ...STRIPE_A11Y_MESSAGES, ...given };\n });\n protected readonly statusText = computed(() => {\n if (this.loading()) return this.messages().loading;\n if (this.submitting()) return this.mode() === 'setup' ? this.messages().savingMethod : this.messages().processingPayment;\n return this.announcement();\n });\n\n /** How `loadStripe` is called: key + options. Re-creates everything when it changes. */\n private readonly connection = computed(() => {\n const key = this.publishableKey() || this.defaults.publishableKey || '';\n return { key, options: buildLoadOptions(this.stripeAccount(), this.locale() ?? this.defaults.locale, this.stripeOptions()) };\n }, { equal: jsonEqual });\n\n /** The `stripe.elements()` options without the deferred amount (that one is updated in place); `null` while there is no intent to show. */\n private readonly elementsConfig = computed((): Record<string, unknown> | null => {\n const secret = this.clientSecret();\n const deferred = this.deferred();\n let options: Record<string, unknown>;\n if (secret) {\n options = { clientSecret: secret };\n } else if (deferred) {\n options = {\n mode: deferred.mode ?? this.mode(),\n currency: deferred.currency,\n ...(deferred.setupFutureUsage ? { setup_future_usage: deferred.setupFutureUsage } : {}),\n ...(deferred.captureMethod ? { capture_method: deferred.captureMethod } : {}),\n ...(deferred.onBehalfOf ? { on_behalf_of: deferred.onBehalfOf } : {}),\n ...(this.deferredTypes() ? { payment_method_types: this.deferredTypes() } : {}),\n ...(this.instantOnly() ? { paymentMethodOptions: { us_bank_account: { verification_method: 'instant' } } } : {}),\n };\n } else {\n return null;\n }\n const appearance = this.appearance();\n if (appearance) options['appearance'] = appearance;\n return { ...options, ...(this.elementsOptions() ?? {}) };\n }, { equal: jsonEqual });\n\n /** The `payment_method_types` of a deferred intent: the host's list (Link removed with `linkOff`), else `['card', 'us_bank_account']` with `linkOff`, else none (Stripe decides). */\n private readonly deferredTypes = computed((): string[] | null => {\n const own = this.paymentMethodTypes();\n if (!this.linkOff()) return own;\n return own ? own.filter(type => type !== 'link') : ['card', 'us_bank_account'];\n });\n\n /** The Payment Element options that need a new element when they change (default values and read-only are updated in place). */\n private readonly elementConfig = computed(() => {\n const options: Record<string, unknown> = {};\n const layout = this.layout();\n if (layout) options['layout'] = layout;\n if (this.paymentMethodOrder()) options['paymentMethodOrder'] = this.paymentMethodOrder();\n const wallets = this.linkOff() ? { ...(this.wallets() ?? {}), applePay: 'never', googlePay: 'never', link: 'never' } : this.wallets();\n if (wallets) options['wallets'] = wallets;\n if (this.fields()) options['fields'] = this.fields();\n if (this.business()) options['business'] = this.business();\n if (this.terms()) options['terms'] = this.terms();\n return { ...options, ...(this.paymentElementOptions() ?? {}) };\n }, { equal: jsonEqual });\n\n private stripe: StripeLike | null = null;\n private stripeSignature = '';\n private elements: StripeElementsLike | null = null;\n private element: StripePaymentElementLike | null = null;\n private generation = 0;\n private lastType: string | null = null;\n private lastAmount: number | undefined;\n private lastFailure: StripeFailure | null = null;\n private destroyed = false;\n /** Counts the confirms: only the NEWEST one may clear `submitting` (a late, older confirm must not unlock the newer one's screen). */\n private confirmSeq = 0;\n /** What the element was last given, so a change made while it loaded is applied once it is ready. */\n private appliedDefaultValues = '';\n private appliedDisabled = false;\n\n /** The protection applies to PAYMENTS; `mode=\"setup\"` (saving a card, nothing is charged) ignores `duplicateProtection` unless the host ALSO sets `protectSetup`. */\n protected readonly protectionOn = computed(() => this.duplicateProtection() && (this.mode() === 'payment' || this.protectSetup()));\n /** The duplicate-payment protection (the attempt: lock, key, unknown state). Only active with `duplicateProtection` in payment mode, or in setup mode with `protectSetup` too; with the protection off it does nothing. */\n readonly attempt: PaymentAttempt;\n /** The readiness gate (same condition as {@link attempt}). */\n readonly readiness: PaymentReadiness;\n /** Bumped by \"Retry loading\": the init effect runs again. */\n private readonly retryTick = signal(0);\n\n constructor() {\n const protection = createPaymentProtection(this, {\n amount: () => { const own = this.attemptAmount(); if (own != null) return own; const minor = this.deferred()?.amount; return minor == null ? null : minor / 100; }, // the deferred amount is in minor units (cents); attempts, markers and derived keys speak major units like every other form\n method: () => this.attemptMethod() ?? this.selectedType() ?? 'card',\n sdk: () => (this.loadErrorText() ? 'blocked' : this.loading() ? 'loading' : 'ok'),\n enabled: () => this.protectionOn(),\n lockAfterSuccess: () => this.mode() === 'payment' || this.lockAfterSuccess(),\n // A protected SETUP that was announced as processing (\"not saved yet\") and is later settled by the status check: the stale text must not contradict the attempt status's \"saved\" text.\n onOutcome: o => { if (this.mode() === 'setup' && o.kind === 'succeeded' && o.reason === 'status_check') this.announcement.set(''); this.outcome.emit(o); },\n onInFlightChange: v => this.inFlightChange.emit(v),\n onKeyChange: k => { if (this.protectionOn()) this.attemptKeyChange.emit(k); },\n onReadinessChange: r => { if (this.protectionOn()) this.readinessChange.emit(r); },\n });\n this.attempt = protection.attempt;\n this.readiness = protection.readiness;\n effect(() => {\n const mount = this.mountRef();\n const connection = this.connection();\n const elements = this.elementsConfig();\n const element = this.elementConfig();\n this.retryTick();\n if (!mount) return;\n untracked(() => { void this.init(mount.nativeElement, connection, elements, element); });\n });\n // The deferred amount changes without a new form (a fee shown for the other payment method): elements.update({ amount }).\n effect(() => {\n const amount = this.deferred()?.amount;\n untracked(() => {\n if (!this.mountOnly() && amount !== undefined && this.lastAmount !== undefined && amount !== this.lastAmount && this.elements?.update) this.elements.update({ amount });\n this.lastAmount = amount;\n });\n });\n effect(() => {\n const defaultValues = this.defaultValues();\n untracked(() => this.applyDefaultValues(defaultValues));\n });\n effect(() => {\n const disabled = this.disabled();\n untracked(() => this.applyDisabled(disabled));\n });\n inject(DestroyRef).onDestroy(() => { this.destroyed = true; this.generation++; this.disposeElements(); this.stripe = null; });\n }\n\n // ── Public methods ─────────────────────────────────────────────────────\n\n /**\n * Submits the form: `elements.submit()` (when required), the deferred intent, then `confirmSetup` / `confirmPayment`.\n * Resolves the normalised result (also emitted as `confirmed`), or `null` after a failure (emitted as `failed`) or when nothing was started\n * (already submitting, or disabled). Never rejects: anything Stripe.js throws becomes a `failed` event.\n *\n * `useExistingIntent`: the intent already exists (a retry after a failed attempt, or one created earlier): no `elements.submit()`, no `createIntent`,\n * and `confirmPayment` / `confirmSetup` is called WITHOUT a client secret, exactly like cremo's intake retry. Pass `clientSecret` (the one you stored) to send it.\n */\n async confirm(options: { useExistingIntent?: boolean; clientSecret?: string } = {}): Promise<StripeConfirmedEvent | null> {\n if (this.disabled() || this.blocked()) return null;\n if (this.protectionOn()) return this.confirmProtected(options); // the attempt's synchronous lock is the guard (an older, hung confirm must not block a new attempt the status check unlocked)\n if (this.submitting()) return null;\n return this.confirmCore(options, null);\n }\n\n /**\n * `confirm()` under the duplicate-payment protection: the gate (paid / unknown / not ready / offline: nothing is sent), then ONE attempt under the synchronous lock, raced against\n * `confirmTimeoutMs`. A timeout, going offline, a thrown error, a connection error or an abandoned 3-D Secure challenge make the outcome UNKNOWN (locked, status check by key); only\n * a definitive Stripe refusal unlocks with a new key. Never retries by itself.\n */\n private async confirmProtected(options: { useExistingIntent?: boolean; clientSecret?: string }): Promise<StripeConfirmedEvent | null> {\n if (!this.readiness.passSync()) {\n const reason = this.readiness.reasons()[0] ?? 'checking';\n this.outcome.emit({ kind: 'refused', attemptKey: this.attempt.key(), reason });\n this.fail(failure(reason, this.labels.t(attemptLabelKey(this.readiness.labelKeyFor(reason), this.mode())), 'submit'));\n return null;\n }\n if (this.attempt.paidLocked() || this.attempt.unknown()) { this.attempt.begin(); return null; } // refuses and reports `refused`\n const run = await this.attempt.run<StripeConfirmedEvent | null>(async key => {\n // Everything this attempt learns lives in ITS OWN trace and key (arguments, never instance fields), so a late answer of an older attempt can never leak into the next one.\n const trace: ConfirmTrace = { held: true, failure: null, thrown: false, outcome: null };\n try {\n const event = await this.confirmCore(options, key, trace, this.attempt.pinnedRef());\n trace.held = false;\n return this.classifyConfirm(event, trace, this.attempt.isLive(key));\n } finally { trace.held = false; }\n }, { timeoutMs: this.confirmTimeoutMs() });\n return 'refused' in run && run.refused ? null : (run.value ?? null);\n }\n\n /** What the result of the core confirm means for the attempt (see {@link confirmProtected}). */\n private classifyConfirm(event: StripeConfirmedEvent | null, trace: ConfirmTrace, live: boolean): PaymentAttemptResult<StripeConfirmedEvent | null> {\n // A LATE answer of an older attempt decides nothing on screen: the payer sees failures and announcements only of the attempt that is still current. `run()` applies the returned result with the same rule.\n const show = (f: StripeFailure): void => { if (live) this.publishFailure(f); };\n const say = (key: 'paymentAttempt.authRequired' | 'paymentAttempt.authAbandoned'): void => { if (live) this.announcement.set(this.labels.t(key)); };\n if (event) {\n // A SetupIntent has no card-action step of its own here (`confirmSetup` runs 3-D Secure itself): a setup that still \"requires action\" proves nothing, so the status check decides (never an endless \"pending\").\n if (event.outcome === 'requires_action' && event.kind === 'setup') return { kind: 'unknown', value: event, reason: 'setup_action' };\n if (event.outcome === 'requires_action') { say('paymentAttempt.authRequired'); return { kind: 'pending', value: event, reason: 'auth_required' }; }\n // A bank payment that waits for the payer to verify micro-deposits has NOT started and nothing is charged: unknown-until-verified (locked, the status check decides, the intent is never cancelled), never paid.\n if (event.outcome === 'requires_verification') return { kind: 'unknown', value: event, reason: 'microdeposits' };\n // A SetupIntent that is still `processing` (a bank debit, ACH) can fail later: not saved yet, so unknown (locked, the status check / the backend decides), never a success. A PaymentIntent that is processing stays a success.\n if (event.outcome === 'processing' && event.kind === 'setup') return { kind: 'unknown', value: event, reason: 'setup_processing' };\n return { kind: 'success', value: event };\n }\n const f = trace.failure;\n if (!f) return { kind: 'unknown', reason: 'no_result' }; // neither an event nor a failure: nothing can be said, so the status check decides\n if (f.code === INSTANT_ONLY_CODE) { show(f); return { kind: 'failure', reason: f.code }; } // instant-only form, the intent still wanted micro-deposits: nothing was charged or saved, a NEW intent is needed\n if (f.code === 'attempt_failed_use_new_key') { show(f); return { kind: 'failure', reason: f.code }; } // a replay of a FAILED attempt: nothing was charged, the next click derives a NEW key\n if (f.stage === 'submit' || f.stage === 'intent') { show(f); return { kind: 'released', reason: f.code }; } // nothing was charged: unlock, the key is kept\n if (f.stage === 'action') {\n // After the challenge Stripe put the intent back to \"needs a payment method\" (the bank refused the authentication): nothing was charged, a definitive failure. Anything else (an abandoned\n // challenge, an error without an intent, a thrown error) proves nothing and stays unknown: the backend cancels the PaymentIntent of an abandoned challenge and answers `failed`.\n const errorIntent = (f.error as { payment_intent?: { status?: string } } | undefined)?.payment_intent;\n const refusedByBank = f.code === 'authentication_failed' || (f.code === 'payment_intent_authentication_failure' && errorIntent?.status === 'requires_payment_method');\n if (refusedByBank && !trace.thrown) { show(f); return { kind: 'failure', reason: f.code }; }\n say('paymentAttempt.authAbandoned');\n return { kind: 'unknown', reason: 'auth_abandoned' };\n }\n if (trace.thrown || (f.type !== undefined && AMBIGUOUS_STRIPE_TYPES.has(f.type)) || AMBIGUOUS_STRIPE_CODES.has(f.code)) return { kind: 'unknown', reason: 'error' };\n // The result stage: Stripe gave an intent in a state that proves the payment did NOT go through (needs a new payment method, cancelled) or one that proves nothing (no intent at all, an\n // unexpected status, a setup that came back without a payment method id: the intent may have succeeded): only the former is a definitive failure.\n if (f.stage === 'result' && f.code !== 'requires_payment_method' && trace.outcome !== 'canceled') return { kind: 'unknown', reason: 'unexpected_status' };\n show(f); // a definitive refusal by Stripe: the payer sees it, the key is renewed\n return { kind: 'failure', reason: f.code };\n }\n\n /** \"Retry loading\" of a blocked Stripe.js / Payment Element: builds the form again. */\n protected reload(): void { this.retryTick.update(n => n + 1); }\n\n /** The host reports that ITS charge call timed out or is ambiguous (only with `duplicateProtection`). */\n markUnknown(): void { this.attempt.markUnknown('host'); }\n /** The host reports that the payment succeeded (locks the form for this payable). */\n markSucceeded(): void { this.attempt.succeed('host'); }\n /** The host reports a DEFINITIVE failure (declined): unlock with a NEW key. */\n markFailed(): void { this.attempt.fail('host'); }\n /** The host did not use the payment and nothing reached Stripe: unlock, the attempt key is KEPT. */\n markNotCharged(): void { this.attempt.markNotCharged(); }\n /** The host starts a deliberate SECOND payment of this payable (an explicit \"pay again\" flow): forgets the paid state this form saw, removes the succeeded record and moves the epoch so the next attempt has a NEW key. Does nothing against the host's own `paid` input. */\n resetPaid(): void { this.attempt.resetPaid(); }\n\n private async confirmCore(options: { useExistingIntent?: boolean; clientSecret?: string }, attemptKey: string | null, trace?: ConfirmTrace, payableRef: string | null = null): Promise<StripeConfirmedEvent | null> {\n const stripe = this.stripe;\n const elements = this.elements;\n if (!stripe || !elements) { this.fail(failure('not_initialized', MSG_NOT_INITIALIZED, 'submit'), trace); return null; }\n const mine = ++this.confirmSeq;\n this.submitting.set(true);\n this.errorText.set('');\n this.announcement.set('');\n let stage: StripeFailureStage = 'submit';\n try {\n const mode = this.mode();\n const existing = options.useExistingIntent === true;\n const deferred = !existing && !this.clientSecret() && !!this.deferred();\n // Stripe only allows createConfirmationToken on a deferred-intent Elements group (no client secret): with a client secret the token is never attempted.\n const wantToken = deferred && this.collectConfirmationToken() && (this.selectedType() ?? 'card') === 'card';\n if (!existing && ((this.submitBeforeConfirm() ?? deferred) || wantToken)) {\n const { error } = await elements.submit();\n if (error) { this.fail(failureFromError(error, 'submit', this.errorOptions('submit')), trace); return null; }\n }\n let token: StripeConfirmationTokenEvent | null = null;\n if (wantToken) {\n const made = await this.makeConfirmationToken(stripe, elements);\n if ('id' in made && made.paymentMethodType === 'card') { token = made; this.confirmationToken.emit(made); }\n }\n let secret: string | undefined = existing ? options.clientSecret : undefined;\n if (deferred) {\n stage = 'intent';\n const create = this.createIntent();\n if (!create) { this.fail(failure('no_intent_factory', MSG_INTENT_FAILED, 'intent'), trace); return null; }\n try {\n const context = token ? { mode, confirmationToken: token } : { mode };\n const created = await create(attemptKey ? { ...context, attemptKey, payableRef } : context);\n if (wasQueuedOffline(created)) { warnQueuedPayment(); this.fail(failure('not_sent', this.labels.t(attemptLabelKey('paymentAttempt.queuedOffline', this.protectionOn() ? mode : 'payment')), 'intent'), trace); return null; } // the offline layer QUEUED the request instead of sending it: no intent exists, and the queued request may still replay\n secret = typeof created === 'string' ? created : created?.clientSecret;\n } catch (err) {\n // The payments service says this attempt FAILED before (`attempt_failed_use_new_key`): not a retryable intent error but a definitive failure that moves the epoch.\n this.fail(failure(isAttemptFailedReplay(err) ? 'attempt_failed_use_new_key' : 'intent_creation_failed', messageOfThrown(err, STRIPE_DEFAULT_ERROR_MESSAGE), 'intent', messageOfThrown(err, '')), trace);\n return null;\n }\n if (!secret) { this.fail(failure('intent_creation_failed', MSG_INTENT_FAILED, 'intent'), trace); return null; }\n }\n stage = 'confirm';\n const confirmParams = this.buildConfirmParams();\n const params: Record<string, unknown> = {\n elements,\n ...(secret ? { clientSecret: secret } : {}),\n ...(confirmParams ? { confirmParams } : {}),\n redirect: this.redirect(),\n };\n const result = mode === 'setup' ? await stripe.confirmSetup(params) : await stripe.confirmPayment(params);\n if (result.error) { this.fail(failureFromError(result.error, 'confirm', this.errorOptions('confirm')), trace); return null; }\n const intent = mode === 'setup' ? result.setupIntent : result.paymentIntent;\n if (!intent) {\n this.fail(failure('not_completed', mode === 'setup' ? MSG_SETUP_INCOMPLETE : MSG_NOT_COMPLETED, 'result'), trace);\n return null;\n }\n let event = normalizeIntent(mode, intent);\n // A setup without a payment method id: unprotected hosts get `no_payment_method` exactly as before. Protected, a setup that Stripe says is `requires_payment_method` / `canceled` is a DEFINITIVE failure (finish() reports it), only the rest (an intent that may have succeeded) is unknown.\n if (mode === 'setup' && !event.paymentMethodId && !(trace && (event.outcome === 'requires_payment_method' || event.outcome === 'canceled'))) { this.fail(failure('no_payment_method', MSG_NO_PAYMENT_METHOD, 'result'), trace); return null; }\n if (mode === 'payment' && event.outcome === 'requires_action' && this.autoHandleCardAction()) {\n stage = 'action';\n if (trace) this.attempt.markPending('auth_required'); // a challenge is open: the request timeout is replaced by authTimeoutMs\n const handled = await this.runCardAction(stripe, intent.client_secret, trace);\n if (!handled) return null;\n event = handled;\n }\n return this.finish(event, false, trace);\n } catch (err) {\n if (trace) trace.thrown = true;\n this.fail(this.thrownFailure(err, stage), trace);\n return null;\n } finally {\n if (mine === this.confirmSeq) this.submitting.set(false);\n }\n }\n\n /**\n * Creates a ConfirmationToken from the typed form (`elements.submit()`, then `stripe.createConfirmationToken({ elements })`) so a host can learn the card's funding before it\n * creates any intent (a fee that depends on credit / debit). Resolves the token event (also emitted as `(confirmationToken)` when it is a card), or the failure (returned only,\n * not emitted, and nothing is shown: Stripe's own form already marks an incomplete field). `null` when nothing was started (already submitting, or disabled).\n */\n async createConfirmationToken(): Promise<StripeConfirmationTokenEvent | StripeFailure | null> {\n if (this.submitting() || this.disabled()) return null;\n const stripe = this.stripe;\n const elements = this.elements;\n if (!stripe || !elements) return failure('not_initialized', MSG_NOT_INITIALIZED, 'submit');\n try {\n const { error } = await elements.submit();\n if (error) return failureFromError(error, 'submit', this.errorOptions('submit'));\n } catch (err) {\n return this.thrownFailure(err, 'submit');\n }\n const made = await this.makeConfirmationToken(stripe, elements);\n if ('id' in made && made.paymentMethodType === 'card') this.confirmationToken.emit(made);\n return made;\n }\n\n /** `stripe.createConfirmationToken({ elements })` (with the billing details as `params` when given); the event, or the failure. Never throws. */\n private async makeConfirmationToken(stripe: StripeLike, elements: StripeElementsLike): Promise<StripeConfirmationTokenEvent | StripeFailure> {\n if (!stripe.createConfirmationToken) return failure('confirmation_token_unavailable', MSG_TOKEN_FAILED, 'confirm');\n const billing = this.billingDetails();\n try {\n const { confirmationToken, error } = await stripe.createConfirmationToken({ elements, ...(billing ? { params: { payment_method_data: { billing_details: billing } } } : {}) });\n if (error) return failureFromError(error, 'confirm', this.errorOptions('confirm'));\n return confirmationToken ? confirmationTokenEventOf(confirmationToken) : failure('confirmation_token_unavailable', MSG_TOKEN_FAILED, 'confirm');\n } catch (err) {\n return this.thrownFailure(err, 'confirm');\n }\n }\n\n /**\n * Runs `stripe.handleCardAction(clientSecret)` (3D Secure) for a payment that came back `requires_action`, and reports the result like `confirm()`.\n * Use it when `autoHandleCardAction` is off and the host handles `outcome: 'requires_action'` itself.\n */\n async handleNextAction(clientSecret: string): Promise<StripeConfirmedEvent | null> {\n if (this.submitting()) return null;\n const stripe = this.stripe;\n if (!stripe) { this.fail(failure('not_initialized', MSG_NOT_INITIALIZED, 'action')); return null; }\n // With the protection on, the host's `confirm()` answered `requires_action` and the attempt is waiting for THIS challenge: its result decides the attempt (success locks, a refusal by the bank\n // unlocks with a new key, an abandoned challenge is unknown), exactly like the automatic challenge of `confirm()`.\n const guarded = this.protectionOn() && this.attempt.inFlight();\n const trace: ConfirmTrace | undefined = guarded ? { held: true, failure: null, thrown: false, outcome: null } : undefined;\n if (guarded) this.attempt.markPending('auth_required');\n this.submitting.set(true);\n this.errorText.set('');\n let event: StripeConfirmedEvent | null = null;\n try {\n const handled = await this.runCardAction(stripe, clientSecret, trace);\n event = handled ? this.finish(handled, false, trace) : null;\n return event;\n } catch (err) {\n if (trace) trace.thrown = true;\n this.fail(this.thrownFailure(err, 'action'), trace);\n return null;\n } finally {\n this.submitting.set(false);\n if (trace) { trace.held = false; this.attempt.apply(this.classifyConfirm(event, trace, true)); }\n }\n }\n\n /**\n * `elements.fetchUpdates()`: after your backend changed the amount of the intent this form was created with (cremo intake: fees differ per payment method),\n * so the form shows the new amount. Resolves `null` when it worked, else the failure (returned only, not emitted: the host decides, cremo ignores it).\n */\n async fetchUpdates(): Promise<StripeFailure | null> {\n const elements = this.elements;\n if (!elements?.fetchUpdates) return failure('not_initialized', MSG_NOT_INITIALIZED, 'submit');\n try {\n const { error } = await elements.fetchUpdates();\n return error ? failureFromError(error, 'confirm', this.errorOptions('confirm')) : null;\n } catch (err) {\n return this.thrownFailure(err, 'confirm');\n }\n }\n\n /** `elements.update(options)`: change the deferred amount, appearance or locale without re-creating the form. */\n updateElements(options: Record<string, unknown>): void { this.elements?.update?.(options); }\n\n /** `paymentElement.update(options)`. */\n updatePaymentElement(options: Record<string, unknown>): void { this.element?.update?.(options); }\n\n /** Removes the Payment Element (host teardown on cancel). The component re-creates it when its inputs change. */\n destroyElements(): void { this.disposeElements(); this.isReady.set(false); }\n\n /** Verify a bank account with the two micro-deposit amounts / the descriptor code of a PaymentIntent (the public \"verify your bank\" page). */\n async verifyMicrodepositsForPayment(clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult> {\n return this.verifyWith('payment', clientSecret, data);\n }\n\n /** Same for a SetupIntent. */\n async verifyMicrodepositsForSetup(clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult> {\n return this.verifyWith('setup', clientSecret, data);\n }\n\n /**\n * After Stripe redirected the customer back to `returnUrl`: retrieves the intent (client secret from the URL by default) and reports it like `confirm()`\n * (`confirmed` for succeeded / processing / needs verification / needs action, `failed` otherwise). `{ event: null, failure: null }` when the URL has no intent.\n * With the duplicate protection on (payment, or setup with `protectSetup`) the result also settles the attempt (see `settleReturn`). A `(confirmed)` event is NOT always a success (`requires_action`, `requires_verification`):\n * a host must check `event.outcome === 'succeeded'` (or `processing`) before it treats the intent as paid / saved.\n * BEHAVIOUR WITH THE PROTECTION ON (also for `mode=\"payment\"`: a host that opts in with `duplicateProtection` and calls this method gets it; without the protection nothing changes): the attempt is settled by the intent that came back, so a\n * `succeeded` / `requires_capture` (and, for a payment, `processing`) intent is a success (`succeeded`, reason `return`), `requires_payment_method` / `canceled` a definitive failure (new key, reason `return`), a bank verification or a further\n * action unknown, a SETUP that is still `processing` unknown (`setup_processing`: a bank debit can still fail) and an intent that could not be read unknown (`error`). Calling it again after a success (a reload of the return page) settles and reports nothing a second time.\n * THE LIBRARY DOES NOT ASK THE BACKEND on this path: a return with `requires_payment_method` / `canceled` fails the attempt at once, so the host's backend must still cancel the SetupIntent / PaymentIntent itself (a SetupIntent that carries an error is\n * still confirmable by a late browser request, which could save a card after the form said \"not saved\").\n */\n async handleReturn(options: { clientSecret?: string; kind?: StripeIntentKind; search?: string } = {}): Promise<StripeReturnResult> {\n const fromUrl = options.clientSecret ? null : readStripeReturnParams(options.search ?? this.doc.defaultView?.location.search ?? '');\n const clientSecret = options.clientSecret ?? fromUrl?.clientSecret;\n if (!clientSecret) return { event: null, failure: null };\n const kind = options.kind ?? fromUrl?.kind ?? this.mode();\n let stripe: StripeLike;\n try { stripe = await this.ensureStripe(); } catch (err) {\n const f = failure('load_error', messageOfThrown(err, MSG_LOAD_FAILED), 'load', messageOfThrown(err, ''));\n this.fail(f);\n this.settleReturn(null);\n return { event: null, failure: f };\n }\n const result = await retrieveIntent(stripe, kind, clientSecret);\n if (result.failure) { this.fail(result.failure); this.settleReturn(null); return result; }\n if (result.event && !this.finish(result.event, true)) { this.settleReturn(result.event); return { event: null, failure: this.lastFailure }; }\n this.settleReturn(result.event);\n return result;\n }\n\n /**\n * With the protection on, the intent a redirect brought back also decides the attempt (so a redirect flow does not stay unknown until the host calls `markSucceeded()`): succeeded / processing / requires_capture = success,\n * `requires_payment_method` / `canceled` = a definitive failure (new key), a bank verification or a further action = unknown (the status check decides), an intent that could not be read = unknown. Nothing without the protection.\n */\n private settleReturn(event: StripeConfirmedEvent | null): void {\n if (!this.protectionOn()) return;\n if (!event) { this.attempt.markUnknown('error'); return; }\n switch (event.outcome) {\n case 'processing':\n // A SetupIntent that is still processing (a bank debit) can fail later: unknown until the status check says it was saved. A processing payment counts as paid, as before.\n if (event.kind === 'setup') this.attempt.markUnknown('setup_processing'); else this.attempt.succeed('return');\n break;\n case 'succeeded': case 'requires_capture': this.attempt.succeed('return'); break;\n case 'requires_payment_method': case 'canceled': this.attempt.fail('return'); break;\n case 'requires_verification': if (this.instantOnly()) this.attempt.fail('instant_only'); else this.attempt.markUnknown('microdeposits'); break;\n default: this.attempt.markUnknown('return_action');\n }\n }\n\n // ── Internals ──────────────────────────────────────────────────────────\n\n private errorOptions(stage: StripeFailureStage): StripeErrorMessageOptions {\n return {\n display: this.errorDisplayByStage()?.[stage] ?? this.errorDisplay(),\n overrides: this.errorMessages(),\n ...(this.errorFallbackByStage()?.[stage] || this.errorFallback() ? { fallback: this.errorFallbackByStage()?.[stage] || this.errorFallback() } : {}),\n };\n }\n\n /** Something Stripe.js threw (an IntegrationError, a network failure) as a failure, with the text chosen like any Stripe error. */\n private thrownFailure(err: unknown, stage: StripeFailureStage): StripeFailure {\n const e = err as { code?: unknown; type?: unknown; decline_code?: unknown; message?: unknown } | null | undefined;\n const error = {\n ...(typeof e?.code === 'string' ? { code: e.code } : {}),\n ...(typeof e?.type === 'string' ? { type: e.type } : {}),\n ...(typeof e?.decline_code === 'string' ? { decline_code: e.decline_code } : {}),\n ...(typeof e?.message === 'string' && e.message ? { message: e.message } : {}),\n };\n const code = stage === 'submit' ? 'submit_failed' : stage === 'action' ? 'action_failed' : 'confirm_failed';\n const { error: _raw, ...failed } = failureFromError(error, stage, this.errorOptions(stage));\n return { ...failed, code: error.code ?? code, ...(stage === 'action' ? { actionHandled: true } : {}) };\n }\n\n private buildConfirmParams(): Record<string, unknown> | null {\n const params: Record<string, unknown> = {};\n const returnUrl = this.returnUrl();\n if (returnUrl !== null) params['return_url'] = returnUrl ?? this.doc.defaultView?.location.href ?? '';\n const billing = this.billingDetails();\n if (billing) params['payment_method_data'] = { billing_details: billing };\n Object.assign(params, this.confirmParams() ?? {});\n return Object.keys(params).length ? params : null;\n }\n\n private fail(f: StripeFailure, trace?: ConfirmTrace): void {\n const override = this.errorMessages()?.[f.code];\n if (override) f = { ...f, message: override.split('{status}').join(f.status ?? '') };\n this.lastFailure = f;\n if (trace) { trace.failure = f; if (trace.held) return; } // a protected confirm decides afterwards whether this is a failure the payer sees (see `classifyConfirm`)\n this.publishFailure(f);\n }\n\n /** Shows and emits a failure (what `fail()` always did). */\n private publishFailure(f: StripeFailure): void {\n if (this.destroyed) return;\n if (this.showErrors()) { this.errorText.set(f.message); this.revealError(f); }\n this.announcement.set('');\n this.failed.emit(f);\n }\n\n /**\n * A blocked submit (incomplete / invalid Element, a refused intent, a declined confirm) must not look like \"nothing happened\": once the alert is rendered it is scrolled into view\n * (instant under `prefers-reduced-motion`, smooth otherwise) and focused, and its `role=\"alert\"` makes a screen reader read the message. Not for load / return failures (nothing was submitted),\n * and never in `mountOnly` (no alert is drawn).\n */\n private revealError(f: StripeFailure): void {\n if (this.mountOnly() || !this.isBrowser || f.stage === 'load' || f.stage === 'return') return;\n afterNextRender(() => {\n const box = this.errorBox()?.nativeElement;\n if (!box) return;\n const reduce = this.doc.defaultView?.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false;\n box.scrollIntoView?.({ block: 'center', behavior: reduce ? 'auto' : 'smooth' });\n box.focus({ preventScroll: true });\n }, { injector: this.injector });\n }\n\n private finish(event: StripeConfirmedEvent, fromReturn = false, trace?: ConfirmTrace): StripeConfirmedEvent | null {\n if (trace) trace.outcome = event.outcome;\n const acted = { ...(event.actionHandled ? { actionHandled: true } : {}), status: event.status };\n // Setup wording (\"Your payment method was not saved\") only for a protected setup: an unprotected form keeps its texts. A host `errorMessages` entry by code still wins (see `fail`).\n const setupProtected = event.kind === 'setup' && this.protectionOn();\n if (event.outcome === 'requires_verification' && this.instantOnly()) {\n // Defensive: an instant-only form never offers micro-deposits, so an intent that wants them is NOT a confirmation: no verification UI, no `(confirmed)`, the payer is told to use a card or a bank with bank login.\n this.fail({ ...failure(INSTANT_ONLY_CODE, this.labels.t('stripePayment.msg.instantOnlyUnavailable'), fromReturn ? 'return' : 'result'), ...acted }, trace);\n return null;\n }\n if (event.outcome === 'requires_payment_method') {\n this.fail({ ...failure('requires_payment_method', setupProtected ? this.labels.t('paymentSetup.requiresPaymentMethod') : MSG_REQUIRES_PAYMENT_METHOD, fromReturn ? 'return' : 'result'), ...acted }, trace);\n return null;\n }\n if (event.outcome === 'unknown' && fromReturn && this.protectionOn()) {\n // A protected return with an intent in a state that proves nothing makes the ATTEMPT unknown (`return_action`, see `settleReturn`): no failure text may be shown or emitted next to the \"Checking...\" status. The caller still gets the failure in the result.\n this.lastFailure = failure('not_completed', setupProtected ? MSG_SETUP_INCOMPLETE : MSG_NOT_COMPLETED, 'return');\n return null;\n }\n if (event.outcome === 'canceled' || event.outcome === 'unknown') {\n this.fail({ ...failure('not_completed', setupProtected ? MSG_SETUP_INCOMPLETE : MSG_NOT_COMPLETED, fromReturn ? 'return' : 'result'), ...acted }, trace);\n return null;\n }\n if (this.destroyed) return event;\n // A protected setup that still \"requires action\" or \"requires verification\" is an UNKNOWN attempt (`setup_action` / `microdeposits`): the attempt status region says so (and its live region announces it), so this region does not announce it a second time\n // (nor a payment: \"Further action is required to complete the payment\") next to it.\n this.announcement.set(setupProtected && (event.outcome === 'requires_action' || event.outcome === 'requires_verification') ? '' : this.announce(event, setupProtected));\n this.confirmed.emit(event);\n return event;\n }\n\n private announce(event: StripeConfirmedEvent, setupProtected = false): string {\n const m = this.messages();\n switch (event.outcome) {\n case 'succeeded': return event.kind === 'setup' ? m.methodSaved : m.paymentReceived;\n case 'processing': return setupProtected ? this.labels.t('paymentSetup.processing') : m.paymentProcessing; // a protected setup is not a payment: it is NOT saved yet (the attempt is unknown until it is confirmed)\n case 'requires_capture': return m.paymentAuthorized;\n case 'requires_verification': return event.kind === 'setup' ? m.verificationNeededSetup : m.verificationNeeded;\n default: return m.actionRequired;\n }\n }\n\n private async runCardAction(stripe: StripeLike, clientSecret: string | null | undefined, trace?: ConfirmTrace): Promise<StripeConfirmedEvent | null> {\n const acted = { actionHandled: true };\n if (!stripe.handleCardAction || !clientSecret) { this.fail({ ...failure('action_unavailable', MSG_AUTH_NOT_COMPLETED, 'action'), ...acted }, trace); return null; }\n const { error, paymentIntent } = await stripe.handleCardAction(clientSecret);\n if (error) { this.fail({ ...failureFromError(error, 'action', { ...this.errorOptions('action'), fallback: MSG_AUTH_FAILED }), ...acted }, trace); return null; }\n if (!paymentIntent) { this.fail({ ...failure('action_incomplete', MSG_AUTH_NOT_COMPLETED, 'action'), ...acted }, trace); return null; }\n const event = { ...normalizeIntent('payment', paymentIntent), ...acted };\n if (event.outcome === 'requires_payment_method') {\n this.fail({ ...failure('authentication_failed', 'Payment authentication failed. Please try a different payment method.', 'action'), ...acted, status: event.status }, trace);\n return null;\n }\n return event;\n }\n\n private async ensureStripe(): Promise<StripeLike> {\n if (this.stripe) return this.stripe;\n const { key, options } = this.connection();\n if (!key) throw new Error(MSG_KEY_MISSING);\n const stripe = await this.loader(key, options);\n if (!stripe) throw new Error(MSG_LOAD_FAILED);\n return stripe;\n }\n\n private async verifyWith(flow: StripeIntentKind, clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult> {\n let stripe: StripeLike;\n try { stripe = await this.ensureStripe(); } catch (err) {\n return { ok: false, outcome: null, intent: null, failure: failure('load_error', messageOfThrown(err, MSG_LOAD_FAILED), 'load', messageOfThrown(err, '')) };\n }\n return verifyMicrodeposits(stripe, flow, clientSecret, data);\n }\n\n private disposeElements(): void {\n const element = this.element;\n this.element = null;\n this.elements = null;\n this.lastType = null;\n this.selectedType.set(null);\n this.complete.set(false);\n if (element) {\n try { element.destroy(); } catch { /* already gone */ }\n if (!this.destroyed) this.stripeReady.emit(null);\n }\n }\n\n private loadFailed(message: string, stripeMessage: string): void {\n this.loading.set(false);\n this.isReady.set(false);\n this.loadErrorText.set(this.loadErrorMessage());\n this.loadError.emit(failure('load_error', message, 'load', stripeMessage));\n }\n\n private async init(\n container: HTMLElement,\n connection: { key: string; options: StripeLoadOptions | undefined },\n elementsConfig: Record<string, unknown> | null,\n elementConfig: Record<string, unknown>,\n ): Promise<void> {\n const generation = ++this.generation;\n this.disposeElements();\n this.isReady.set(false);\n this.errorText.set('');\n this.loadErrorText.set('');\n this.announcement.set('');\n if (!this.isBrowser || !elementsConfig) { this.loading.set(false); return; }\n if (!connection.key) { this.loadFailed(localizeStripeMessage(MSG_KEY_MISSING), ''); return; }\n this.loading.set(true);\n try {\n const signature = JSON.stringify(connection);\n if (!this.stripe || this.stripeSignature !== signature) {\n this.stripe = null;\n const stripe = await this.loader(connection.key, connection.options);\n if (generation !== this.generation) return;\n if (!stripe) { this.loadFailed(localizeStripeMessage(MSG_LOAD_FAILED), ''); return; }\n this.stripe = stripe;\n this.stripeSignature = signature;\n }\n const options: Record<string, unknown> = { ...elementsConfig };\n const deferred = this.deferred();\n if (!options['clientSecret'] && deferred?.amount !== undefined && options['amount'] === undefined) options['amount'] = deferred.amount;\n this.lastAmount = deferred?.amount;\n if (this.appearanceFromTokens() && !options['appearance']) options['appearance'] = readStripeAppearance(this.doc, this.host.nativeElement);\n const elements = this.stripe.elements(options);\n const elementOptions: Record<string, unknown> = { ...elementConfig };\n const defaultValues = this.defaultValues();\n if (defaultValues) elementOptions['defaultValues'] = defaultValues;\n if (this.disabled() && !this.mountOnly()) elementOptions['readOnly'] = true;\n this.appliedDefaultValues = JSON.stringify(defaultValues ?? null);\n this.appliedDisabled = this.disabled();\n const element = elements.create('payment', elementOptions);\n this.elements = elements;\n this.element = element;\n element.on('change', (event) => { if (generation === this.generation) this.onChange(event); });\n element.on('ready', () => {\n if (generation !== this.generation) return;\n this.loading.set(false);\n this.isReady.set(true);\n // Changes made while the element loaded (a customer name typed, the form disabled) are applied now.\n if (!this.mountOnly()) {\n this.applyDefaultValues(this.defaultValues());\n this.applyDisabled(this.disabled());\n }\n this.ready.emit();\n });\n element.on('loaderror', (event) => {\n if (generation !== this.generation) return;\n const message = event?.error?.message || localizeStripeMessage(MSG_LOAD_FAILED);\n this.loadFailed(message, event?.error?.message ?? '');\n });\n element.mount(container);\n this.stripeReady.emit({ stripe: this.stripe, elements, paymentElement: element });\n } catch (err) {\n if (generation !== this.generation) return;\n this.loadFailed(localizeStripeMessage(messageOfThrown(err, MSG_LOAD_FAILED)), messageOfThrown(err, ''));\n }\n }\n\n private applyDefaultValues(defaultValues: Record<string, unknown> | null): void {\n const signature = JSON.stringify(defaultValues ?? null);\n if (this.mountOnly() || !this.element?.update || !this.isReady() || signature === this.appliedDefaultValues) return;\n this.appliedDefaultValues = signature;\n this.element.update({ defaultValues: defaultValues ?? {} });\n }\n\n private applyDisabled(disabled: boolean): void {\n if (this.mountOnly() || !this.element?.update || !this.isReady() || disabled === this.appliedDisabled) return;\n this.appliedDisabled = disabled;\n this.element.update({ readOnly: disabled });\n }\n\n private onChange(event: { complete?: boolean; empty?: boolean; value?: { type?: string }; error?: { message?: string } } | null | undefined): void {\n const type = event?.value?.type ?? null;\n const complete = !!event?.complete;\n this.complete.set(complete);\n if (type) this.selectedType.set(type);\n this.elementChange.emit({ complete, empty: !!event?.empty, type, errorMessage: event?.error?.message ?? null });\n if (type && type !== (this.lastType ?? this.initialPaymentMethodType())) this.paymentMethodTypeChange.emit(type);\n if (type) this.lastType = type;\n }\n}\n","import { UiLabelKey, safeLocale, uiLocale, uiText } from '@forgeroute/ui/core';\n/** How a bank account added with micro-deposits is verified: two deposit amounts, the code of one deposit, or the bank is still confirming it. */\nexport type MicrodepositType = 'amounts' | 'descriptor_code' | 'processing';\n\n/** The text of the pending-verification card, in one place for the component and its tests. */\n/** The text of the pending-verification card; read on every access, so it follows the app's active language. */\nexport const MICRODEPOSIT_COPY = {\n get title() { return uiText('stripeMicrodepositVerify.title'); },\n get processingTitle() { return uiText('stripeMicrodepositVerify.processingTitle'); },\n get processing() { return uiText('stripeMicrodepositVerify.processing'); },\n get cannotPay() { return uiText('stripeMicrodepositVerify.cannotPay'); },\n get readOnly() { return uiText('stripeMicrodepositVerify.readOnly'); },\n get keepsActive() { return uiText('stripeMicrodepositVerify.keepsActive'); },\n get cancelTitle() { return uiText('stripeMicrodepositVerify.cancelTitle'); },\n get verifyLabel() { return uiText('stripeMicrodepositVerify.verifyLabel'); },\n get cancelBase() { return uiText('stripeMicrodepositVerify.cancelBase'); },\n get cancelKeepsActive() { return uiText('stripeMicrodepositVerify.cancelKeepsActive'); },\n get cancelNoOther() { return uiText('stripeMicrodepositVerify.cancelNoOther'); },\n get tooManyAttempts() { return uiText('stripeMicrodepositVerify.tooManyAttempts'); },\n get codeRequired() { return uiText('stripeMicrodepositVerify.codeRequired'); },\n};\n\n/** \"June 5, 2026\" in UTC: the arrival date is a calendar day. Empty for no / an invalid date. */\nexport function microdepositArrivalText(iso: string | null | undefined): string {\n if (!iso) return '';\n const date = new Date(iso);\n return Number.isNaN(date.getTime()) ? '' : date.toLocaleDateString(safeLocale(uiLocale()), { month: 'long', day: 'numeric', year: 'numeric', timeZone: 'UTC' });\n}\n\n/** Amounts: two whole numbers of cents from 1 to 99 (Stripe's micro-deposits are 1 to 99 cents). Empty text = nothing to say yet. */\nexport function depositAmountError(value: unknown): string {\n if (value === '' || value === null || value === undefined) return '';\n const n = Number(value);\n if (!Number.isInteger(n)) return uiText('stripeMicrodepositVerify.wholeCents');\n if (n < 1 || n > 99) return uiText('stripeMicrodepositVerify.centsRange');\n return '';\n}\n\n/** The code as sent to Stripe: trimmed, upper case. */\nexport const normalizeDescriptorCode = (value: string | null | undefined): string => (value ?? '').trim().toUpperCase();\n\n/** The descriptor code: 6 letters or numbers; with `requireSmPrefix` (Stripe's codes look like SMXXXX) it must start with \"SM\". Empty = nothing to say yet. */\nexport function descriptorCodeError(value: string | null | undefined, requireSmPrefix = false): string {\n const code = normalizeDescriptorCode(value);\n if (!code) return '';\n if (!/^[A-Z0-9]{6}$/.test(code)) return uiText('stripeMicrodepositVerify.code6');\n if (requireSmPrefix && !/^SM[A-Z0-9]{4}$/.test(code)) return uiText('stripeMicrodepositVerify.codeSm');\n return '';\n}\n\n/** Only an https link is offered as Stripe's hosted verification page. */\nexport function safeHostedUrl(url: string | null | undefined): string | null {\n return /^https:\\/\\//.test(url ?? '') ? (url as string) : null;\n}\n\n/** What `(verify)` emits: the two amounts in cents, or the code. */\nexport type MicrodepositVerifyEvent = { amounts: [number, number] } | { descriptorCode: string };\n\n/** Who started a pending verification, from the point of view of the user looking at it (a partner page): this user, the partner, or somebody else. */\nexport type MicrodepositStartedBy = 'you' | 'partner' | 'other' | '';\n\nexport interface MicrodepositStepsContext {\n type: Exclude<MicrodepositType, 'processing'>;\n /** ISO timestamp of the day the deposits should arrive. */\n arrivalDate?: string | null;\n /** Set when the user looks at ANOTHER party's account (a crematory looking at a partner): \"{partner}'s account\", \"Ask {partner} for ...\". */\n partnerName?: string;\n /** The user cannot finish it (no form on the card). */\n readOnly?: boolean;\n /** Read-only: who started it. */\n startedBy?: MicrodepositStartedBy;\n /** Read-only: replaces ONLY the middle sentence (\"An administrator of your organization can finish the verification.\" by default). */\n readOnlyText?: string;\n}\n\nconst arrivalClause = (iso: string | null | undefined): string => {\n const text = microdepositArrivalText(iso);\n return text ? uiText('stripeMicrodepositVerify.byDate', { date: text }) : '';\n};\n\n/**\n * The explanation under the bank account: the deposits clause, then what to do (or, with no form, who can finish it), then\n * \"Until then this account can't be used to pay invoices.\" The exact strings of the cremo Settings / Partners cards.\n */\nexport function microdepositStepsText(ctx: MicrodepositStepsContext): string {\n const t = (key: string, params?: Record<string, string | number>) => uiText(`stripeMicrodepositVerify.${key}` as UiLabelKey, params);\n const partner = ctx.partnerName ?? '';\n const holder = partner ? t('holderPartner', { partner }) : t('holderYours');\n const clause = arrivalClause(ctx.arrivalDate);\n const deposits = ctx.type === 'descriptor_code' ? t('depositsDescriptor', { holder, clause }) : t('depositsAmounts', { holder, clause });\n if (ctx.readOnly) {\n const who = ctx.readOnlyText\n ?? (ctx.startedBy === 'partner' ? t('startedByPartner', { partner })\n : ctx.startedBy === 'other' ? t('startedByOther')\n : partner ? t('partnerOrSetup', { partner })\n : MICRODEPOSIT_COPY.readOnly);\n return `${deposits}${who} ${MICRODEPOSIT_COPY.cannotPay}`;\n }\n const enter = ctx.type === 'descriptor_code'\n ? (partner ? t('enterCodePartner', { partner }) : t('enterCodeOwn'))\n : (partner ? t('enterAmountsPartner', { partner }) : t('enterAmountsOwn'));\n return `${deposits}${enter}${MICRODEPOSIT_COPY.cannotPay}`;\n}\n\n/** While the bank is still confirming the account. */\nexport function microdepositProcessingText(partnerName = ''): string {\n return partnerName ? uiText('stripeMicrodepositVerify.processingPartner', { partner: partnerName }) : MICRODEPOSIT_COPY.processing;\n}\n\n/** The note under the steps when a payment method is already saved. */\nexport function microdepositKeepsActiveText(partnerName = ''): string {\n return partnerName ? uiText('stripeMicrodepositVerify.keepsActivePartner', { partner: partnerName }) : MICRODEPOSIT_COPY.keepsActive;\n}\n\n/** The message of the cancel confirm: the saved method stays active only when one is saved. */\nexport function microdepositCancelMessage(options: { partnerName?: string; hasSavedMethod?: boolean } = {}): string {\n const partner = options.partnerName ?? '';\n if (partner) return `${MICRODEPOSIT_COPY.cancelBase} ${options.hasSavedMethod ? uiText('stripeMicrodepositVerify.cancelKeepsActivePartner', { partner }) : uiText('stripeMicrodepositVerify.cancelNoOtherPartner', { partner })}`;\n return MICRODEPOSIT_COPY.cancelBase + (options.hasSavedMethod ? MICRODEPOSIT_COPY.cancelKeepsActive : MICRODEPOSIT_COPY.cancelNoOther);\n}\n","import { ChangeDetectionStrategy, Component, computed, effect, inject, input, output, signal, untracked, viewChild } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { BadgeComponent } from '@forgeroute/ui/badge';\nimport { ButtonComponent, ModalComponent } from '@forgeroute/ui/core';\nimport { FormRowComponent } from '@forgeroute/ui/form-row';\nimport { FormSectionComponent } from '@forgeroute/ui/form-section';\nimport { TextComponent } from '@forgeroute/ui/text';\nimport { TextInputComponent } from '@forgeroute/ui/text-input';\nimport { StripePaymentService, type StripeMicrodepositResult } from '../stripe-payment/stripe-actions';\nimport type { StripeIntentKind } from '../stripe-payment/stripe-outcomes';\nimport {\n MICRODEPOSIT_COPY, depositAmountError, descriptorCodeError, microdepositStepsText, normalizeDescriptorCode, safeHostedUrl,\n type MicrodepositType, type MicrodepositVerifyEvent,\n} from './microdeposit-verify.models';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { localizeStripeMessage } from '../stripe-payment/stripe-outcomes';\n\nlet nextId = 0;\n\n/**\n * \"Bank account waiting for verification\": explains the steps in plain words, takes the two deposit amounts (or the 6-character code),\n * links to Stripe's own verification page, and lets the user cancel. Read-only users see the card but no form and no buttons.\n *\n * Two ways to verify, same screen:\n * - Host verifies (default): `(verify)` emits `{ amounts: [a, b] }` or `{ descriptorCode }`; the host calls its backend and shows\n * `[verifying]` / `[errorText]` (your API owns the rules and the attempts).\n * - Stripe.js verifies (public \"verify your bank\" page): pass `[clientSecret]` (+ `[publishableKey]`, `[stripeAccount]`, `[flow]`); the component calls\n * `verifyMicrodepositsForPayment/Setup` itself, counts failed attempts (`[maxAttempts]`) and emits `(verified)`.\n *\n * <ui-microdeposit-verify type=\"amounts\" bankName=\"Chase\" last4=\"6789\" arrivalDate=\"2026-06-05T00:00:00Z\"\n * [verifying]=\"busy()\" [errorText]=\"error()\" (verify)=\"verify($event)\" (cancelVerification)=\"cancel()\" />\n */\n@Component({\n selector: 'ui-microdeposit-verify',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, AlertComponent, BadgeComponent, ButtonComponent, FormRowComponent, FormSectionComponent, ModalComponent, TextComponent, TextInputComponent],\n template: `\n <div data-testid=\"bank-pending-card\">\n <ui-form-section [label]=\"heading()\">\n <ui-alert variant=\"info\" data-testid=\"bank-pending-alert\">\n <div data-testid=\"bank-pending-summary\">\n @if (bankLine(); as line) { <strong data-testid=\"bank-pending-bank\">{{ line }}</strong> }\n <ui-badge [label]=\"labels.t('stripeMicrodepositVerify.pending')\" variant=\"yellow\" data-testid=\"bank-pending-badge\" />\n </div>\n @if (paymentNotStarted()) {\n <ui-text size=\"sm\" data-testid=\"bank-pending-not-started\" [text]=\"labels.t('stripeMicrodepositVerify.paymentNotStarted')\" />\n }\n @if (stepsText().trim()) {\n <ui-text size=\"sm\" [text]=\"stepsText()\" data-testid=\"bank-pending-steps\" />\n } @else if (isProcessing()) {\n <ui-text size=\"sm\" [text]=\"copy.processing\" data-testid=\"bank-pending-steps\" />\n } @else {\n <ui-text size=\"sm\" data-testid=\"bank-pending-steps\" [text]=\"defaultSteps()\" />\n }\n @if (hasSavedMethod()) {\n <ui-text size=\"sm\" tone=\"muted\" [text]=\"keepsActiveText() || copy.keepsActive\" data-testid=\"bank-pending-keeps-active\" />\n }\n <!-- The hosted page is the processor's own UI: only with the explicit showHostedLink input (own-UI policy), and never to a read-only user (finishing it saves the payment method, a write) -->\n @if (!formHidden() && showHostedLink() && !hideHostedLink() && safeUrl(); as url) {\n <div><ui-button variant=\"link\" size=\"sm\" [href]=\"url\" target=\"_blank\" data-testid=\"bank-hosted-link\">{{ labels.t('stripeMicrodepositVerify.openStripeSVerificationPage') }}</ui-button></div>\n }\n </ui-alert>\n\n @if (!formHidden() && !isProcessing()) {\n @if (type() === 'descriptor_code') {\n <ui-text-input #codeField [label]=\"labels.t('stripeMicrodepositVerify.verificationCode')\" [hint]=\"hintText() || labels.t('stripeMicrodepositVerify.6LettersOrNumbersFrom')\" [maxlength]=\"6\" [required]=\"true\" [showErrors]=\"touched()\"\n [error]=\"touched() ? codeError() : ''\" [ariaInvalid]=\"!!shownError()\" [ariaDescribedBy]=\"shownError() ? errorId : ''\" data-testid=\"bank-code-input\" [ngModel]=\"code()\" (ngModelChange)=\"code.set($event)\" />\n } @else {\n <ui-form-row data-testid=\"bank-amounts-row\">\n <ui-text-input #firstField [label]=\"labels.t('stripeMicrodepositVerify.firstDepositCents')\" type=\"number\" [min]=\"1\" [max]=\"99\" [maxDecimals]=\"0\" [required]=\"true\" [showErrors]=\"touched()\"\n [ariaInvalid]=\"!!shownError()\" [ariaDescribedBy]=\"describedBy()\" [error]=\"touched() ? amountError(first()) : ''\" data-testid=\"bank-amount-first\" [ngModel]=\"first()\" (ngModelChange)=\"first.set($event)\" />\n <ui-text-input #secondField [label]=\"labels.t('stripeMicrodepositVerify.secondDepositCents')\" type=\"number\" [min]=\"1\" [max]=\"99\" [maxDecimals]=\"0\" [required]=\"true\" [showErrors]=\"touched()\"\n [ariaInvalid]=\"!!shownError()\" [ariaDescribedBy]=\"describedBy()\" [error]=\"touched() ? amountError(second()) : ''\" data-testid=\"bank-amount-second\" [ngModel]=\"second()\" (ngModelChange)=\"second.set($event)\" />\n </ui-form-row>\n <ui-text size=\"sm\" tone=\"muted\" [id]=\"amountsHintId\" data-testid=\"bank-amounts-hint\" [text]=\"hintText() || labels.t('stripeMicrodepositVerify.amountsHint')\" />\n }\n @if (shownError(); as text) {\n <ui-alert variant=\"danger\" [id]=\"errorId\" data-testid=\"bank-verify-error\">{{ text }}</ui-alert>\n }\n @if (attemptsText(); as text) {\n <ui-text size=\"sm\" tone=\"muted\" role=\"status\" data-testid=\"bank-attempts-remaining\" [text]=\"text\" />\n }\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"bank-verify-button\" [loading]=\"busy()\" [disabled]=\"busy() || cancelling()\" (click)=\"verify()\">{{ verifyLabel() || copy.verifyLabel }}</ui-button>\n }\n\n @if (!formHidden() && allowCancel()) {\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"bank-cancel-button\" [disabled]=\"busy() || cancelling()\" (click)=\"showCancelConfirm.set(true)\">{{ cancelLabel() || copy.cancelTitle }}</ui-button>\n }\n </ui-form-section>\n\n <ui-modal [open]=\"showCancelConfirm()\" [title]=\"cancelLabel() || copy.cancelTitle\" maxWidth=\"460px\" (close)=\"showCancelConfirm.set(false)\">\n <ui-text size=\"sm\" data-testid=\"bank-cancel-message\" [text]=\"cancelMessage()\" />\n <ui-button modal-footer-left variant=\"secondary\" size=\"sm\" data-testid=\"bank-cancel-keep\" (click)=\"showCancelConfirm.set(false)\">{{ labels.t('stripeMicrodepositVerify.keepWaiting') }}</ui-button>\n <ui-button modal-footer-right variant=\"danger\" size=\"sm\" data-testid=\"bank-cancel-confirm\" [loading]=\"cancelling()\" (click)=\"confirmCancel()\">{{ cancelLabel() || copy.cancelTitle }}</ui-button>\n </ui-modal>\n </div>\n `,\n})\nexport class MicrodepositVerifyComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly service = inject(StripePaymentService);\n\n /** `'amounts'` (two deposits), `'descriptor_code'` (one deposit with a code) or `'processing'` (the bank is still confirming; nothing to enter). */\n readonly type = input<MicrodepositType>('amounts');\n readonly bankName = input('');\n readonly last4 = input('');\n /** The day the deposits should have arrived (ISO timestamp); empty when unknown. See `StripeVerification.arrivalDateIso`. */\n readonly arrivalDate = input<string | null>(null);\n /** Stripe's own verification page; only an https link is shown. */\n readonly hostedVerificationUrl = input<string | null>(null);\n /** Read-only users see the card with `readOnlyText` but no form, link or buttons. */\n readonly readOnly = input(false);\n /** Show the card as plain status: no form, link or buttons, and the steps text is yours (`stepsText`). For a page where someone else finishes the verification. */\n readonly statusOnly = input(false);\n /** Replaces the card heading (default: \"Bank account waiting for verification\" / \"Bank account being confirmed\"). */\n readonly title = input('');\n /** Replaces the whole steps text (the sentences about the deposits and what to enter). Use it for wording the library cannot know (a partner's name, who started it). */\n readonly stepsText = input('');\n /** Read-only / status-only: replaces ONLY the middle sentence of the steps text (the deposits clause before it and \"Until then this account can't be used ...\" after it stay). */\n readonly readOnlyText = input<string>(MICRODEPOSIT_COPY.readOnly);\n /**\n * Show the processor's hosted verification page link (only an https `hostedVerificationUrl`, never to a read-only / status-only card). Default FALSE (own-UI policy: the payer verifies on this card, not on the\n * processor's page). Set it true only for a page that deliberately offers the hosted page.\n */\n readonly showHostedLink = input(false);\n /** Hide the hosted-page link even when `showHostedLink` is on (kept for hosts that already pass it). */\n readonly hideHostedLink = input(false);\n /** Host mode: how many verification attempts the payer has left (from your API). Shown as \"N attempts remaining\" under the button; `null` (default) shows nothing. In Stripe.js mode the component counts by itself (`maxAttempts`). */\n readonly attemptsRemaining = input<number | null>(null);\n /** Replaces the built-in \"N attempts remaining\" sentence (you translate it). Empty = the library text in the app's language. */\n readonly attemptsRemainingText = input('');\n /** Replaces the hint under the code field / the deposit amounts (default: \"6 letters or numbers (SM plus 4) from the deposit description\" / \"Amounts are between 1 and 99 cents ...\"). */\n readonly hint = input('');\n readonly cancelLabel = input('');\n readonly verifyLabel = input('');\n /** Replaces \"Your current payment method stays active until the new bank account is verified.\" */\n readonly keepsActiveText = input('');\n /** Replaces the cancel confirm's message. */\n readonly cancelMessageText = input('');\n /** A payment method is already saved (it stays active until the new bank account is verified). */\n readonly hasSavedMethod = input(false);\n /** Host mode: the host's verify request is running. */\n readonly verifying = input(false);\n /** Host mode: the host's cancel request is running. */\n readonly cancelling = input(false);\n /** Host mode: the verification failed; shown above the button. */\n readonly errorText = input('');\n /** Offer \"Cancel verification\" (with its confirm). */\n readonly allowCancel = input(true);\n /** Descriptor codes must look like Stripe's (`SMXXXX`). */\n readonly requireSmPrefix = input(false);\n\n // Stripe.js mode (set `clientSecret`)\n readonly clientSecret = input<string | null>(null);\n readonly publishableKey = input<string | null>(null);\n readonly stripeAccount = input<string | null>(null);\n /** Which kind of intent `clientSecret` belongs to. */\n readonly flow = input<StripeIntentKind>('payment');\n /** Stripe.js mode: stop sending after this many failed attempts (0 = no limit here). */\n readonly maxAttempts = input(0);\n\n /** Host mode: the amounts / code to verify. */\n readonly verify$ = output<MicrodepositVerifyEvent>({ alias: 'verify' });\n /** The user confirmed cancelling the verification. */\n readonly cancelVerification = output<void>();\n /** Stripe.js mode: the bank account is verified. */\n readonly verified = output<StripeMicrodepositResult>();\n /** Stripe.js mode: a verification attempt failed (the text is already shown). */\n readonly verifyFailed = output<StripeMicrodepositResult>();\n\n readonly copy = MICRODEPOSIT_COPY;\n protected readonly hintText = computed(() => this.hint().trim());\n protected readonly errorId = `ui-mdv-error-${nextId}`;\n protected readonly amountsHintId = `ui-mdv-hint-${nextId++}`;\n /** The error alert (when shown) and the amounts hint describe each deposit field. */\n protected readonly describedBy = computed(() => [this.shownError() ? this.errorId : '', this.amountsHintId].filter(Boolean).join(' '));\n private readonly codeField = viewChild<TextInputComponent>('codeField');\n private readonly firstField = viewChild<TextInputComponent>('firstField');\n private readonly secondField = viewChild<TextInputComponent>('secondField');\n readonly first = signal<string | number>('');\n readonly second = signal<string | number>('');\n readonly code = signal('');\n readonly touched = signal(false);\n readonly showCancelConfirm = signal(false);\n private readonly stripeBusy = signal(false);\n private readonly stripeError = signal('');\n private failedAttempts = 0;\n\n readonly formHidden = computed(() => this.readOnly() || this.statusOnly());\n /**\n * A PAYMENT waits for this verification (Stripe.js mode with a payment intent): the card says plainly that the payment has NOT started and nothing is charged until the deposits are verified.\n * A host that words the whole card itself (`stepsText`) owns that sentence too.\n */\n readonly paymentNotStarted = computed(() => !!this.clientSecret() && this.flow() === 'payment' && !this.stepsText().trim());\n readonly heading = computed(() => this.title() || (this.isProcessing() ? this.copy.processingTitle : this.copy.title));\n /** \"Chase ····6789\"; nothing when neither the bank nor the last 4 digits are known. */\n readonly bankLine = computed(() => {\n const bank = this.bankName().trim();\n const last4 = this.last4().trim();\n if (!bank && !last4) return '';\n return `${bank || this.labels.t('stripeMicrodepositVerify.bankFallback')}${last4 ? ` ····${last4}` : ''}`;\n });\n readonly busy = computed(() => this.verifying() || this.stripeBusy());\n readonly shownError = computed(() => this.stripeError() || this.errorText());\n /** Host mode: \"N attempts remaining\" (the host's `attemptsRemaining`, or its own `attemptsRemainingText`). Empty when the host says nothing. */\n readonly attemptsText = computed(() => {\n const own = this.attemptsRemainingText().trim();\n if (own) return own;\n const left = this.attemptsRemaining();\n if (left === null || !Number.isFinite(left) || left < 0) return '';\n return this.labels.t(left === 1 ? 'stripeMicrodepositVerify.attemptsLeft_one' : 'stripeMicrodepositVerify.attemptsLeft_other', { count: left });\n });\n readonly isProcessing = computed(() => this.type() === 'processing');\n readonly safeUrl = computed(() => safeHostedUrl(this.hostedVerificationUrl()));\n /** The built-in steps text: deposits clause + what to do, or with no form the `readOnlyText` sentence, + \"Until then this account can't be used to pay invoices.\" */\n readonly defaultSteps = computed(() => microdepositStepsText({\n type: this.type() === 'descriptor_code' ? 'descriptor_code' : 'amounts',\n arrivalDate: this.arrivalDate(),\n readOnly: this.formHidden(),\n readOnlyText: this.readOnlyText(),\n }));\n readonly amountError = depositAmountError;\n readonly codeError = computed(() => (this.code().trim() ? descriptorCodeError(this.code(), this.requireSmPrefix()) : this.copy.codeRequired));\n readonly hasInvalid = computed(() => this.type() === 'descriptor_code'\n ? !!this.codeError()\n : !!depositAmountError(this.first()) || !!depositAmountError(this.second()) || this.first() === '' || this.second() === '' || this.first() === null || this.second() === null);\n /** The cancel confirm tells the truth: the saved method stays active only when one is saved. */\n readonly cancelMessage = computed(() => this.cancelMessageText() || this.copy.cancelBase + (this.hasSavedMethod() ? this.copy.cancelKeepsActive : this.copy.cancelNoOther));\n\n constructor() {\n // Resumes cleanly: a new intent (another `clientSecret`) or another kind of verification starts from an empty card (no typed digits, no old error, a fresh attempt count).\n effect(() => {\n this.clientSecret(); this.type();\n untracked(() => { this.first.set(''); this.second.set(''); this.code.set(''); this.touched.set(false); this.stripeError.set(''); this.failedAttempts = 0; });\n });\n // A host error (the `errorText` input) after a verify: the focus goes back to the first field so the payer corrects it without hunting for it.\n effect(() => {\n const text = this.errorText();\n untracked(() => { if (text && this.touched()) this.focusFirstField(); });\n });\n }\n\n /** Puts the focus on the first deposit field / the code field (the first INVALID one when a local rule failed). */\n private focusFirstField(invalidOnly = false): void {\n if (this.type() === 'descriptor_code') { this.codeField()?.focus(); return; }\n const firstBad = !!depositAmountError(this.first()) || this.first() === '' || this.first() === null;\n const secondBad = !!depositAmountError(this.second()) || this.second() === '' || this.second() === null;\n if (invalidOnly && !firstBad && secondBad) this.secondField()?.focus(); else this.firstField()?.focus();\n }\n\n async verify(): Promise<void> {\n if (this.busy()) return;\n this.touched.set(true);\n if (this.hasInvalid()) { this.focusFirstField(true); return; }\n const secret = this.clientSecret();\n if (!secret) {\n this.verify$.emit(this.type() === 'descriptor_code'\n ? { descriptorCode: normalizeDescriptorCode(this.code()) }\n : { amounts: [Number(this.first()), Number(this.second())] });\n return;\n }\n const max = this.maxAttempts();\n if (max > 0 && this.failedAttempts >= max) { this.stripeError.set(this.copy.tooManyAttempts); this.focusFirstField(); return; }\n this.stripeBusy.set(true);\n this.stripeError.set('');\n const data = this.type() === 'descriptor_code'\n ? { descriptor_code: normalizeDescriptorCode(this.code()) }\n : { amounts: [Number(this.first()), Number(this.second())] };\n const connection = { publishableKey: this.publishableKey(), stripeAccount: this.stripeAccount() };\n const result = this.flow() === 'setup'\n ? await this.service.verifyMicrodepositsForSetup(secret, data, connection)\n : await this.service.verifyMicrodepositsForPayment(secret, data, connection);\n this.stripeBusy.set(false);\n if (result.ok) { this.verified.emit(result); return; }\n this.failedAttempts++;\n const message = result.failure?.message ?? localizeStripeMessage('Verification failed');\n const remaining = max - this.failedAttempts;\n this.stripeError.set(max > 0 && remaining > 0 ? this.labels.t(remaining === 1 ? 'stripeMicrodepositVerify.attemptsRemaining_one' : 'stripeMicrodepositVerify.attemptsRemaining_other', { message, count: remaining }) : message);\n this.verifyFailed.emit(result);\n this.focusFirstField();\n }\n\n confirmCancel(): void {\n if (this.cancelling()) return;\n this.showCancelConfirm.set(false);\n this.cancelVerification.emit();\n }\n}\n","import type { DestroyRef, WritableSignal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { Observable } from 'rxjs';\n\n/** What the account-status call answers (the shape of cremo's `GET /organizations/connect/status`). `isComplete` = Stripe accepts charges and payouts. */\nexport interface StripeConnectStatus {\n isComplete: boolean;\n detailsSubmitted?: boolean;\n /** The address of Stripe's onboarding page for an unfinished account. */\n onboardingUrl?: string;\n}\n\n/** What the create-account call answers (cremo's `POST /organizations/connect/create`): the new (or resumed) account and the address of Stripe's onboarding page. */\nexport interface StripeConnectAccount { accountId: string; onboardingUrl: string }\n\n/**\n * What happened after the user pressed a button or the page asked for the state. The flow never shows toasts itself (each app has its own): the host words\n * each outcome, and decides what follows a finished account (for example switching payment collection on).\n *\n * - `complete`: Stripe accepts the account. `source: 'check'` = after \"Check Status\"; `'resume'` = \"Complete Setup\" found it already complete; `'return'` =\n * the state was read again when the user came back to this tab (`refreshOnReturn`).\n * - `verifying`: the details were submitted and Stripe is reviewing them.\n * - `incomplete`: \"Check Status\" found an unfinished onboarding (`onboardingUrl` present).\n * - `link-unavailable`: the answer had no https Stripe address; nothing was opened.\n * - `failed`: a call failed (`action` says which); `error` is what it threw.\n */\nexport type StripeConnectOutcome =\n | { kind: 'complete'; source: 'check' | 'resume' | 'return' }\n | { kind: 'verifying'; source: 'check' | 'resume' | 'return' }\n | { kind: 'incomplete' }\n | { kind: 'link-unavailable' }\n | { kind: 'failed'; action: 'start' | 'check' | 'resume'; error: unknown };\n\n/** The state the flow reads and writes: signals owned by the host (or by the card's two-way models). */\nexport interface StripeConnectState {\n accountId: WritableSignal<string | null>;\n complete: WritableSignal<boolean>;\n detailsSubmitted: WritableSignal<boolean>;\n loading: WritableSignal<boolean>;\n}\n\nexport interface StripeConnectFlowOptions {\n /** Read at call time, so a host can swap the call. Null = no call yet (`start()` does nothing). */\n createAccount: () => (() => Observable<StripeConnectAccount>) | null;\n getStatus: () => (() => Observable<StripeConnectStatus>) | null;\n state: StripeConnectState;\n /** Where outcomes go. */\n emit: (outcome: StripeConnectOutcome) => void;\n /** The buttons and methods do nothing while this says true (a read-only user). */\n disabled?: () => boolean;\n /** How THIS tab is sent to Stripe when the browser refused the new tab (default `window.location.href = url`). */\n navigate?: (url: string) => void;\n destroyRef: DestroyRef;\n}\n\n/** Only an https address on stripe.com or a real subdomain (never `evilstripe.com` / `connect.stripe.com.evil.com`, `http:`, `javascript:`). */\nexport function isStripeUrl(url: string | undefined): url is string {\n if (!url) return false;\n try {\n const u = new URL(url);\n return u.protocol === 'https:' && (u.hostname === 'stripe.com' || u.hostname.endsWith('.stripe.com'));\n } catch { return false; }\n}\n\n/**\n * The Stripe Connect flow of cremo Settings > Payment & Billing, as a plain class: create the account, \"Check Status\", \"Complete Setup\", and the \"back from Stripe\" read.\n * `ui-stripe-connect` runs it behind its card; a host that has to start the flow from code before any view exists (Settings: the first change-detection pass with\n * `?connect=return`) creates its own instance over the same state signals. Stripe's page always opens in a NEW tab opened inside the click (a tab opened after the\n * request is blocked by popup blockers); only an https Stripe address is opened; a failed call closes the empty tab.\n */\nexport class StripeConnectFlow {\n /** A Stripe tab was opened: the card reads the state again when the user comes back (`refreshOnReturn`). */\n tabOpened = false;\n\n constructor(private readonly o: StripeConnectFlowOptions) {}\n\n private get blocked(): boolean { return this.o.state.loading() || !!this.o.disabled?.(); }\n\n /** Creates (or resumes) the account and opens Stripe's onboarding page in a new tab. */\n start(): void {\n const create = this.o.createAccount();\n if (!create || this.blocked) return;\n this.o.state.loading.set(true);\n const tab = this.openBlankTab();\n create().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({\n next: result => {\n this.o.state.accountId.set(result.accountId);\n this.o.state.loading.set(false);\n this.openStripe(tab, result.onboardingUrl);\n },\n error: error => {\n this.closeTab(tab);\n this.o.state.loading.set(false);\n this.o.emit({ kind: 'failed', action: 'start', error });\n },\n });\n }\n\n /** \"Check Status\": reads the state; a finished or submitted account updates the card, an unfinished one is reported. */\n check(): void {\n const status = this.o.getStatus();\n if (!status || this.blocked) return;\n this.o.state.loading.set(true);\n status().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({\n next: s => {\n this.o.state.complete.set(s.isComplete);\n this.o.state.detailsSubmitted.set(s.detailsSubmitted ?? false);\n this.o.state.loading.set(false);\n if (s.isComplete) this.o.emit({ kind: 'complete', source: 'check' });\n else if (s.detailsSubmitted) this.o.emit({ kind: 'verifying', source: 'check' });\n else if (s.onboardingUrl) this.o.emit({ kind: 'incomplete' });\n },\n error: error => { this.o.state.loading.set(false); this.o.emit({ kind: 'failed', action: 'check', error }); },\n });\n }\n\n /** \"Complete Setup\": reads the state and opens the onboarding address of an unfinished account in a new tab (a finished or submitted one just updates the card). */\n resume(): void {\n const status = this.o.getStatus();\n if (!status || this.blocked) return;\n this.o.state.loading.set(true);\n const tab = this.openBlankTab();\n status().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({\n next: s => {\n this.o.state.loading.set(false);\n if (s.isComplete) {\n this.closeTab(tab);\n this.o.state.complete.set(true);\n this.o.emit({ kind: 'complete', source: 'resume' });\n } else if (s.detailsSubmitted) {\n this.closeTab(tab);\n this.o.state.detailsSubmitted.set(true);\n this.o.emit({ kind: 'verifying', source: 'resume' });\n } else {\n this.openStripe(tab, s.onboardingUrl);\n }\n },\n error: error => { this.closeTab(tab); this.o.state.loading.set(false); this.o.emit({ kind: 'failed', action: 'resume', error }); },\n });\n }\n\n /** The state read when the user came back to this tab: silent unless something finished or was submitted. */\n readStatusOnReturn(): void {\n const status = this.o.getStatus();\n if (!status) return;\n status().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({\n next: s => {\n this.o.state.complete.set(s.isComplete);\n this.o.state.detailsSubmitted.set(s.detailsSubmitted ?? false);\n if (s.isComplete) this.o.emit({ kind: 'complete', source: 'return' });\n else if (s.detailsSubmitted) this.o.emit({ kind: 'verifying', source: 'return' });\n },\n error: () => { /* the user can press Check Status; a failed background read says nothing */ },\n });\n }\n\n private openStripe(tab: Window | null, url: string | undefined): void {\n if (isStripeUrl(url) && tab) {\n tab.location.href = url;\n this.tabOpened = true;\n } else if (isStripeUrl(url)) {\n this.navigateCurrentTab(url);\n } else {\n // not an https Stripe address: never navigate to it, close the empty tab and say so\n this.closeTab(tab);\n this.o.emit({ kind: 'link-unavailable' });\n }\n }\n\n /** The empty tab, opened inside the click and cut from this page (`opener`); null when the browser refused. */\n openBlankTab(): Window | null {\n const tab = window.open('about:blank', '_blank');\n if (tab) { try { tab.opener = null; } catch { /* cannot be changed: harmless */ } }\n return tab;\n }\n\n /** The browser refused the new tab: Stripe opens in this one. */\n private navigateCurrentTab(url: string): void {\n if (this.o.navigate) this.o.navigate(url);\n else window.location.href = url;\n }\n\n private closeTab(tab: Window | null): void {\n try { tab?.close(); } catch { /* already closed */ }\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, ViewEncapsulation, afterNextRender, computed, effect, inject, input, model, output } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { Observable } from 'rxjs';\nimport { StripeConnectFlow } from './stripe-connect.flow';\nimport type { StripeConnectAccount, StripeConnectOutcome, StripeConnectStatus } from './stripe-connect.flow';\nexport type { StripeConnectAccount, StripeConnectOutcome, StripeConnectStatus } from './stripe-connect.flow';\nexport { StripeConnectFlow, isStripeUrl } from './stripe-connect.flow';\nimport { BadgeComponent } from '@forgeroute/ui/badge';\nimport { ButtonComponent, uiText } from '@forgeroute/ui/core';\nimport { DetailCardComponent } from '@forgeroute/ui/detail-card';\nimport { StackComponent } from '@forgeroute/ui/stack';\nimport { TextComponent } from '@forgeroute/ui/text';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/**\n * The default wording of an outcome (the texts cremo Settings has always used), for apps that just want a toast: `{ variant, message }`, or null when\n * nothing should be said. `completeText` replaces the sentence of a finished account when the host has more to say about what follows.\n */\nexport function stripeConnectNotice(outcome: StripeConnectOutcome): { variant: 'success' | 'info' | 'error'; message: string } | null {\n switch (outcome.kind) {\n case 'complete':\n return { variant: 'success', message: uiText(outcome.source === 'resume' ? 'stripeStripeConnect.noticeCompleteResume' : 'stripeStripeConnect.noticeComplete') };\n case 'verifying':\n return { variant: 'success', message: uiText('stripeStripeConnect.noticeVerifying') };\n case 'incomplete':\n return { variant: 'error', message: uiText('stripeStripeConnect.noticeIncomplete') };\n case 'link-unavailable':\n return { variant: 'error', message: uiText('stripeStripeConnect.noticeLinkUnavailable') };\n case 'failed':\n return { variant: 'error', message: uiText(outcome.action === 'start' ? 'stripeStripeConnect.failedStart' : outcome.action === 'check' ? 'stripeStripeConnect.failedCheck' : 'stripeStripeConnect.failedLink') };\n }\n}\n\n/**\n * \"Stripe Connect Account\": the card where a business connects the Stripe account it collects payments into (cremo Settings > Payment & Billing, built here\n * once so every app and the setup wizard show and run the SAME flow). The host owns the data (its two calls and the three state values); the component owns\n * the screen and the flow:\n *\n * - no account yet (`accountId` empty): nothing is shown (the host has its own entry point and calls `start()`), or with `showWhenNoAccount` a card with\n * \"Set Up Payment Account\";;\n * - account, not complete, nothing submitted: warning \"Account setup incomplete\" with \"Complete Setup\" (asks the status for the onboarding address and opens it);\n * - details submitted, not complete: info \"Stripe is verifying your account\" with \"Check Status\";\n * - complete: success \"Account setup complete\" with the account id and \"View Stripe Dashboard\".\n *\n * Stripe's onboarding page always opens in a NEW tab: the empty tab is opened inside the click (a tab opened after the request is blocked by popup\n * blockers) and receives the address when it arrives; with the tab refused the address opens in the current tab. Only an https Stripe address is ever opened,\n * never one an answer made up (`javascript:`, `data:`). A failed call closes the empty tab.\n *\n * <ui-stripe-connect [(accountId)]=\"accountId\" [(complete)]=\"complete\" [(detailsSubmitted)]=\"submitted\"\n * [createAccount]=\"createAccount\" [getStatus]=\"getStatus\" [showWhenNoAccount]=\"true\" (outcome)=\"onOutcome($event)\" />\n *\n * where `createAccount = () => http.post<StripeConnectAccount>('/connect/create', {})` and `getStatus = () => http.get<StripeConnectStatus>('/connect/status')`.\n */\n@Component({\n selector: 'ui-stripe-connect',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, BadgeComponent, ButtonComponent, DetailCardComponent, StackComponent, TextComponent],\n template: `\n <!-- Persistent live region: present before the state changes, so every new state is announced (and \"Loading\" while a request runs). -->\n <div class=\"sc-sr\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" data-testid=\"connect-live\">{{ liveText() }}</div>\n @if (visible()) {\n @if (bare()) {\n <ng-container *ngTemplateOutlet=\"body\" />\n } @else {\n <ui-detail-card [collapsible]=\"false\" [title]=\"title()\" [headingLevel]=\"3\" data-testid=\"connect-account-card\">\n <ng-container *ngTemplateOutlet=\"body\" />\n </ui-detail-card>\n }\n }\n\n <ng-template #body>\n @if (!accountId()) {\n <ui-stack gap=\"sm\" class=\"sc-state\" tabindex=\"-1\" data-testid=\"connect-status-none\" [attr.aria-busy]=\"loading() ? 'true' : null\">\n <strong class=\"sc-title\">{{ startTitle() }}</strong>\n <ui-text size=\"sm\" [text]=\"startText()\" />\n <ui-stack direction=\"horizontal\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"connect-start-button\" [disabled]=\"disabled()\" (click)=\"start()\">@if (loading()) {<span aria-hidden=\"true\">{{ labels.t('common.loadingellipsis') }}</span><span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabBusy', { label: startLabel() }) }}</span>} @else { {{ startLabel() }}<span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span>}</ui-button>\n </ui-stack>\n </ui-stack>\n } @else if (complete()) {\n <ui-stack gap=\"sm\" class=\"sc-state\" tabindex=\"-1\" data-testid=\"connect-status-complete\">\n <strong class=\"sc-title\">{{ labels.t('stripeStripeConnect.accountSetupComplete') }}</strong>\n <ui-text size=\"sm\" tone=\"muted\" [text]=\"labels.t('stripeConnect.accountId', { id: accountId() ?? '' })\" />\n <ui-stack direction=\"horizontal\">\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"connect-dashboard-button\" (click)=\"openDashboard()\">{{ labels.t('stripeStripeConnect.viewStripeDashboard') }}<span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span></ui-button>\n </ui-stack>\n </ui-stack>\n } @else if (detailsSubmitted()) {\n <ui-stack gap=\"sm\" class=\"sc-state\" tabindex=\"-1\" data-testid=\"connect-status-verifying\" [attr.aria-busy]=\"loading() ? 'true' : null\">\n <strong class=\"sc-title\">{{ labels.t('stripeStripeConnect.stripeIsVerifyingYourAccount') }}</strong>\n <ui-text size=\"sm\" [text]=\"labels.t('stripeStripeConnect.yourSetupHasBeenSubmitted')\" />\n <ui-stack direction=\"horizontal\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"connect-check-status-button\" [disabled]=\"disabled()\" (click)=\"check()\">@if (loading()) {<span aria-hidden=\"true\">{{ labels.t('stripeStripeConnect.checking') }}</span><span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.checkStatusBusy') }}</span>} @else { {{ labels.t('stripeStripeConnect.checkStatus') }} }</ui-button>\n </ui-stack>\n </ui-stack>\n } @else {\n <ui-stack gap=\"sm\" class=\"sc-state\" tabindex=\"-1\" data-testid=\"connect-status-incomplete\" [attr.aria-busy]=\"loading() ? 'true' : null\">\n <span class=\"sc-badge\"><ui-badge [label]=\"labels.t('stripeStripeConnect.accountSetupIncomplete')\" variant=\"red\" data-testid=\"connect-incomplete-badge\" /></span>\n <ui-text size=\"sm\" [text]=\"labels.t('stripeStripeConnect.completeYourStripeAccountSetup')\" />\n <ui-stack direction=\"horizontal\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"connect-complete-setup-button\" [disabled]=\"disabled()\" (click)=\"resume()\">@if (loading()) {<span aria-hidden=\"true\">{{ labels.t('common.loadingellipsis') }}</span><span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.completeSetupOpensInA') }}</span>} @else { {{ labels.t('stripeStripeConnect.completeSetup') }}<span class=\"sc-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span>}</ui-button>\n </ui-stack>\n </ui-stack>\n }\n </ng-template>\n `,\n styles: [`ui-stripe-connect { display: block; min-width: 0; } ui-stripe-connect .sc-badge { display: flex; } ui-stripe-connect .sc-title { font-size: 0.9375rem; font-weight: 600; color: #1e293b; } ui-stripe-connect .sc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }`],\n encapsulation: ViewEncapsulation.None,\n})\nexport class StripeConnectComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The call that creates the organization's Stripe account (or resumes it) and answers its id and the onboarding address. Needed for `start()`. */\n readonly createAccount = input<(() => Observable<StripeConnectAccount>) | null>(null);\n /** The call that reads the account's state. Needed for `check()`, `resume()` and `refreshOnReturn`. */\n readonly getStatus = input<(() => Observable<StripeConnectStatus>) | null>(null);\n\n /** The Stripe account's id (null / empty = no account yet). Two-way: the component sets it when `start()` created the account. */\n readonly accountId = model<string | null>(null);\n /** Stripe accepts the account (charges and payouts on). Two-way: set by `check()` / `resume()`. */\n readonly complete = model(false);\n /** The details were submitted and Stripe is reviewing them. Two-way: set by `check()` / `resume()`. */\n readonly detailsSubmitted = model(false);\n\n readonly titleInput = input<string | null>(null, { alias: 'title' });\n\n readonly title = computed(() => this.titleInput() ?? this.labels.t('stripeStripeConnect.title'));\n /** No card around the content: the text and the button sit directly in the host's own card (the setup wizard's step card). `title` is not shown then. */\n readonly bare = input(false);\n /** Shows the card (with \"Set Up Payment Account\") while there is no account yet. Default false: hosts with their own entry point show nothing and call `start()`. */\n readonly showWhenNoAccount = input(false);\n readonly startTitleInput = input<string | null>(null, { alias: 'startTitle' });\n readonly startTitle = computed(() => this.startTitleInput() ?? this.labels.t('stripeStripeConnect.startTitle'));\n readonly startTextInput = input<string | null>(null, { alias: 'startText' });\n readonly startText = computed(() => this.startTextInput() ?? this.labels.t('stripeStripeConnect.startText'));\n readonly startLabelInput = input<string | null>(null, { alias: 'startLabel' });\n readonly startLabel = computed(() => this.startLabelInput() ?? this.labels.t('stripeStripeConnect.startLabel'));\n /** The buttons cannot be pressed (a read-only user). */\n readonly disabled = input(false);\n /** After a Stripe tab was opened, the state is read again when this tab becomes visible again (the user came back): `(outcome)` then reports `complete` / `verifying` with source `return`. */\n readonly refreshOnReturn = input(false);\n /** The page \"View Stripe Dashboard\" opens. */\n readonly dashboardUrl = input('https://dashboard.stripe.com');\n\n /** What happened (see {@link StripeConnectOutcome}); the host words it. */\n readonly outcome = output<StripeConnectOutcome>();\n\n /** A request is running: the buttons show \"Loading...\" / \"Checking...\" and cannot be pressed again. Two-way, so a host that shows the state elsewhere can read it. */\n readonly loading = model(false);\n /** How the current tab is sent to Stripe when the browser refused the new tab (default: `window.location.href = url`); a host can route it through its own method. */\n readonly navigateTab = input<((url: string) => void) | null>(null);\n protected readonly visible = computed(() => !!this.accountId() || this.showWhenNoAccount());\n /** Which screen the card shows. */\n protected readonly state = computed((): 'none' | 'complete' | 'verifying' | 'incomplete' =>\n !this.accountId() ? 'none' : this.complete() ? 'complete' : this.detailsSubmitted() ? 'verifying' : 'incomplete');\n /** What the persistent status region says: the current state, plus \"Loading.\" while a request runs. Empty while nothing is shown. */\n protected readonly liveText = computed(() => {\n if (!this.visible()) return '';\n const text = this.labels.t(({ none: 'stripeStripeConnect.liveNone', incomplete: 'stripeStripeConnect.liveIncomplete', verifying: 'stripeStripeConnect.liveVerifying', complete: 'stripeStripeConnect.liveComplete' } as const)[this.state()]);\n return this.loading() ? this.labels.t('stripeStripeConnect.liveLoading', { text }) : text;\n });\n /** The user pressed a button that started a request: when the screen then changes, focus moves to the new screen (the pressed button is gone). */\n private acted = false;\n private lastState = this.state();\n private readonly flow = new StripeConnectFlow({\n createAccount: () => this.createAccount(),\n getStatus: () => this.getStatus(),\n state: { accountId: this.accountId, complete: this.complete, detailsSubmitted: this.detailsSubmitted, loading: this.loading },\n emit: outcome => this.outcome.emit(outcome),\n disabled: () => this.disabled(),\n navigate: url => this.navigateCurrentTab(url),\n destroyRef: this.destroyRef,\n });\n\n constructor() {\n effect(() => {\n const state = this.state();\n if (this.loading()) return;\n const changed = state !== this.lastState;\n this.lastState = state;\n const focusIt = changed && this.acted && this.visible();\n this.acted = false;\n if (focusIt) afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('.sc-state')?.focus(), { injector: this.injector });\n });\n if (typeof document !== 'undefined') {\n const onVisible = () => {\n if (document.visibilityState !== 'visible' || !this.flow.tabOpened || !this.refreshOnReturn() || this.loading()) return;\n this.flow.tabOpened = false;\n this.flow.readStatusOnReturn();\n };\n document.addEventListener('visibilitychange', onVisible);\n this.destroyRef.onDestroy(() => document.removeEventListener('visibilitychange', onVisible));\n }\n }\n\n /** Creates (or resumes) the account and opens Stripe's onboarding page in a new tab. */\n start(): void { const run = this.canRun(this.createAccount()); this.flow.start(); this.acted ||= run; }\n\n /** \"Check Status\": reads the state; a finished or submitted account updates the card, an unfinished one is reported. */\n check(): void { const run = this.canRun(this.getStatus()); this.flow.check(); this.acted ||= run; }\n\n /** \"Complete Setup\": reads the state and opens the onboarding address of an unfinished account in a new tab. */\n resume(): void { const run = this.canRun(this.getStatus()); this.flow.resume(); this.acted ||= run; }\n\n /** The flow will really send a request (the host gave the call, nothing is running, the card is not read-only). */\n private canRun(call: unknown): boolean { return !!call && !this.loading() && !this.disabled(); }\n\n /** Opens the Stripe dashboard in a new tab. */\n openDashboard(): void {\n window.open(this.dashboardUrl(), '_blank', 'noopener,noreferrer');\n }\n\n /** The browser refused the new tab: Stripe opens in this one (through the host's `navigateTab` when it gave one). */\n protected navigateCurrentTab(url: string): void {\n const navigate = this.navigateTab();\n if (navigate) navigate(url);\n else window.location.href = url;\n }\n}\n","import type { PaymentAllocation } from '@forgeroute/ui/payments';\nimport { uiText } from '@forgeroute/ui/core';\nimport type { StripeCardFunding } from '../stripe-payment/stripe-outcomes';\n\n/**\n * Library source 2026-11-21: what `ui-payment-stripe-method (readerLeftPending)` reports. The plugin's body went away (`destroyed`) or its reader screen was removed (`unmounted`: the reader was switched off / the method changed) while a reader\n * payment was open (starting, waiting, declined, retrying, recovering or cancelling). The reader payment MAY STILL EXIST at the processor, so `readerBusyChange` is NOT sent as `false` for it: the host keeps its pay actions blocked\n * (and reads the server's own hold). A reopened body finds the payment again by its attempt key and reports `readerBusyChange` true / false normally.\n */\nexport interface StripeReaderLeftPending {\n reason: 'destroyed' | 'unmounted';\n /** The attempt key of the open reader payment, when known. */\n paymentAttemptKey?: string;\n}\n\n/** What the host's `createIntent` receives: the entered payment and how it is applied to charges. */\nexport interface StripeIntentContext extends PaymentAllocation {\n /** The amount the payer owes (before processing fees), in major units (12.5 = $12.50). */\n amount: number;\n /** The method value that was selected (`'CARD'` / `'ACH'`). */\n paymentMethod: string;\n /** Stripe's name of it: `'card'` or `'us_bank_account'`. */\n paymentMethodType: 'card' | 'us_bank_account';\n receivedDate: string;\n notes: string | null;\n /** Only with `[fundingPreview]=\"true\"` on the plugin and a card: the ConfirmationToken (`ctoken_...`) created from the typed card, so the backend can read the card funding from Stripe before it creates the intent. */\n confirmationTokenId?: string | null;\n /** Only with `[fundingPreview]=\"true\"` and a card: Stripe's funding of the typed card (display only; a backend that charges by it reads it from the token). */\n funding?: StripeCardFunding | null;\n /**\n * Only with `[duplicateProtection]=\"true\"` on the plugin: the key of this PAYMENT ATTEMPT (stable across retries after a timeout / offline loss, a reload and a second tab; renewed only after\n * a definitive failure or success). Send it to your backend, which creates the PaymentIntent with it as Stripe's `Idempotency-Key` and answers `checkStatus(attemptKey)` with it.\n */\n attemptKey?: string;\n /** Only with `[duplicateProtection]=\"true\"`: the payable of this attempt (`payableRef` at the click): the backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key. */\n payableRef?: string | null;\n}\n\n/** What the host's `createIntent` answers. Fees are optional; when given they are shown as rows under the form. */\nexport interface StripeIntentInfo {\n clientSecret: string;\n paymentIntentId: string;\n stripeFee?: number;\n platformFee?: number;\n totalAmount?: number;\n /** Connect account of a direct charge (passed back to `finalize` / `cancel`). `[stripeAccount]` of the plugin must already be this account: Stripe.js is loaded for it before the form shows. */\n stripeAccountId?: string | null;\n /** Shown after \"Processing fee\" / \"Platform fee\", e.g. `'2.9% + $0.30'`. */\n stripeFeeLabel?: string;\n platformFeeLabel?: string;\n}\n\n/** The fees of a payment, shown before the payer pays (the host's `estimateFees`) or after the intent exists. */\nexport interface StripeFees {\n stripeFee?: number;\n platformFee?: number;\n /** What the payer is charged (amount + fees). The Payment Element is created with this amount, so it MUST equal the intent's amount. */\n totalAmount?: number;\n stripeFeeLabel?: string;\n platformFeeLabel?: string;\n}\n\nexport interface StripeFeeContext {\n amount: number;\n paymentMethod: string;\n paymentMethodType: 'card' | 'us_bank_account';\n /**\n * Only with `[fundingPreview]=\"true\"` on the plugin: the funding of the typed card once the card form is complete (`'credit'`, `'debit'`, `'prepaid'`, `'unknown'`), `null` while it is\n * not known (no card yet, a bank account). A credit-only fee schedule answers the credit fee while it is `null` or `'credit'` and no platform fee for `'debit'` / ACH.\n */\n funding?: StripeCardFunding | null;\n /** Only with `[fundingPreview]=\"true\"` once the card is complete: the ConfirmationToken of the typed card, for a backend-side funding lookup in `estimateFees`. */\n confirmationTokenId?: string | null;\n}\n\nexport const STRIPE_PAYMENT_METHODS = [\n { value: 'CARD', label: 'Card' },\n { value: 'ACH', label: 'ACH / Bank Transfer' },\n] as const;\n\n/** The name of a method in the app's active language. */\nexport const stripeMethodLabel = (value: string, english: string): string =>\n value === 'CARD' ? uiText('stripePaymentMethod.methodCard') : value === 'ACH' ? uiText('stripePaymentMethod.methodAch') : english;\n\nexport const stripeMethodType = (method: string): 'card' | 'us_bank_account' => (method === 'ACH' ? 'us_bank_account' : 'card');\n\n/** The texts of the Stripe payment method; read on every access, so they follow the app's active language. */\nexport const STRIPE_METHOD_TEXTS = {\n get amountNeeded() { return uiText('stripePaymentMethod.amountNeeded'); },\n get notCompleted() { return uiText('stripePaymentMethod.notCompleted'); },\n get achTitle() { return uiText('stripePaymentMethod.achTitle'); },\n achMessage: (amount: string) => uiText('stripePaymentMethod.achMessage', { amount }),\n verificationMessage: (amount: string) => uiText('stripePaymentMethod.verificationMessage', { amount }),\n get receiptNote() { return uiText('stripePaymentMethod.receiptNote'); },\n};\n","import type { HostResult, PaymentAllocation } from '@forgeroute/ui/payments';\nimport type { UiLabelKey } from '@forgeroute/ui/core';\nimport type { StripeFees } from '../payment-stripe-method/payment-stripe-method.models';\n\n/**\n * Card-reader (Stripe Terminal smart reader) types of the library. They mirror the answers of the payments service (`GET /v1/terminal/readiness`,\n * `GET /v1/terminal/readers/:id/ready`, the `terminal` object of a card-present payment, `cardSave`; see forgeroute-payments `docs/API.md` section 16.3 and\n * `host-kit/contract/terminal-readiness.json`). The BROWSER never calls the service: every call below is a function the HOST supplies (it calls its own backend,\n * which calls the service), exactly like `ui-stripe-connect`.\n */\n\n/**\n * The ONE state of the reader setup, chosen by the service with this fixed precedence (first match wins). `checking` = the read was slow or failed (nothing is guessed). `unknown` is the OLD name of `checking`: it is still\n * ACCEPTED in an answer a host passes in (and read as `checking`), but the library never produces it: {@link normalizeReadiness} returns `checking`, no screen shows the word and no event carries it.\n */\nexport type StripeReaderReadinessState = 'merchant_not_ready' | 'no_reader' | 'unsupported_only' | 'reader_ready' | 'reader_busy' | 'reader_offline' | 'checking' | 'unknown';\n\n/** The precedence of the service, first match wins (documentation and tests; the service already sends the winning state). */\nexport const STRIPE_READER_STATE_PRECEDENCE: readonly Exclude<StripeReaderReadinessState, 'checking' | 'unknown'>[] = [\n 'merchant_not_ready', 'no_reader', 'unsupported_only', 'reader_ready', 'reader_busy', 'reader_offline',\n];\n\nexport type StripeReaderDeviceStatus = 'online' | 'offline' | 'registering';\n\n/** A reader as the service answers it (register / list / get / rename). */\nexport interface StripeReader {\n id: string;\n label?: string | null;\n status: StripeReaderDeviceStatus | string;\n locationId?: string | null;\n deviceType?: string | null;\n serialNumber?: string | null;\n pairingCode?: string | null;\n action?: 'idle' | 'in_progress' | 'failed' | null;\n actionIntentId?: string | null;\n /** One of the supported smart readers (S700, S710, WisePOS E). Anything else cannot take a payment. */\n supported: boolean;\n /** Human model name, e.g. `Stripe Reader S700`. */\n model?: string | null;\n /** A payment of this merchant waits on the reader, or the processor says it works on an action. */\n busy: boolean;\n /** Only names a payment of THIS merchant. */\n busyPaymentId?: string | null;\n}\n\n/** `GET /v1/terminal/readiness`. */\nexport interface StripeReaderReadiness {\n state: StripeReaderReadinessState;\n readers: StripeReader[];\n /** The single ready reader, else the most recently used ready reader, else null (the user picks). */\n defaultReaderId: string | null;\n checkedAt?: string;\n /** The processor read was slow or failed: nothing was guessed. */\n stale?: boolean;\n /**\n * Why the answer is what it is. With `merchant_not_ready`: `reconnect_required` (offers \"Reconnect payments\"), `sandbox`, `service_disabled` or `processor_unsupported` (see {@link StripeReaderBannerReason}: the banner words these\n * with no button), anything else = payments are not set up yet (\"Set up payments\"). With `no_reader` / `unsupported_only`: the same three no-button reasons, otherwise the usual \"get a reader\" message.\n */\n reason?: StripeReaderBannerReason | string;\n merchantStatus?: string;\n /** Why the processor read failed (`stale`): see {@link StripeReaderTerminal.degradedReason}. */\n degradedReason?: StripeReaderDegradedReason | string;\n}\n\n/** `GET /v1/terminal/readers/:id/ready` (the optional check right before a payment). */\nexport interface StripeReaderReady {\n ready: boolean;\n reason: 'ok' | 'offline' | 'busy' | 'unsupported' | 'merchant_not_ready' | 'reconnect_required' | 'unknown' | string;\n reader?: StripeReader | null;\n checkedAt?: string;\n stale?: boolean;\n degradedReason?: StripeReaderDegradedReason | string;\n}\n\n/**\n * Why the service could not read the processor (`terminal.degradedReason`): `processor_unreachable` / `processor_timeout` are transient (try again), `reconnect_required` (the processor refused our credentials) and\n * `processor_refused` (it refused the read) will NOT fix themselves: the payment account needs attention.\n */\nexport type StripeReaderDegradedReason = 'processor_unreachable' | 'processor_timeout' | 'reconnect_required' | 'processor_refused';\n\n/**\n * `checking` = the processor could not be read in time (the stored payment is answered); `stale` is the same thing named after the `stale` flag. `unknown` is the OLD name: still ACCEPTED in the service's answer (read as\n * `checking`), never produced by the library; the screen words all three as \"still checking\" and never shows the word.\n */\nexport type StripeReaderTerminalState = 'waiting' | 'declined' | 'failed' | 'succeeded' | 'canceled' | 'checking' | 'stale' | 'unknown';\n\n/** True for a terminal state that means \"the processor could not be read\": `checking`, `stale` and the old `unknown`. */\nexport function isTerminalChecking(state: StripeReaderTerminalState | string | null | undefined): boolean {\n return state === 'checking' || state === 'stale' || state === 'unknown';\n}\n\n/**\n * The reasons a host may put in `StripeReaderReadiness.reason` for the \"no usable reader\" banner. Each maps to its own plain message with NO action button:\n * - `sandbox`: the company is a sandbox account (\"Card readers are not available in a sandbox account.\"); apps map `merchant_not_ready` + this reason.\n * - `service_disabled`: the payments service is switched off (\"Card readers are turned off for this account.\").\n * - `processor_unsupported`: the company's processor can never use readers, e.g. Square or QuickBooks (\"Card readers are not available with this payment processor.\").\n * Any other reason (including `reconnect_required`) or none keeps the usual messages and buttons. The table is `STRIPE_READER_BANNER_REASONS`.\n */\nexport type StripeReaderBannerReason = 'sandbox' | 'service_disabled' | 'processor_unsupported';\n\n/** Reason -> label key of the no-button banner message. Exported for documentation and tests. */\nexport const STRIPE_READER_BANNER_REASONS: Readonly<Record<StripeReaderBannerReason, UiLabelKey>> = {\n sandbox: 'stripeReaderBanner.sandbox',\n service_disabled: 'stripeReaderBanner.serviceDisabled',\n processor_unsupported: 'stripeReaderBanner.processorUnsupported',\n};\n\n/** The no-button label key for a readiness reason, or null when the reason has no special wording. */\nexport function readerBannerReasonKey(reason: string | null | undefined): UiLabelKey | null {\n return reason && Object.prototype.hasOwnProperty.call(STRIPE_READER_BANNER_REASONS, reason) ? STRIPE_READER_BANNER_REASONS[reason as StripeReaderBannerReason] : null;\n}\n\n/** The `terminal` object of a card-present payment (also carried by a 409 `payment_in_flight`). */\nexport interface StripeReaderTerminal {\n readerId: string;\n state: StripeReaderTerminalState;\n declineCode?: string;\n message?: string;\n /** `false` with the state `waiting` = the reader dropped its connection while the payment waits. */\n readerOnline?: boolean;\n /** `unknown` + `stale`: the processor could not be read in time; the stored payment is answered. */\n stale?: boolean;\n checkedAt?: string;\n /** With `stale`: why the processor could not be read (transient or needs attention). */\n degradedReason?: StripeReaderDegradedReason | string;\n /** From the 3rd consecutive stale read: how many stale reads in a row. */\n staleReads?: number;\n /** From the 3rd consecutive stale read: ISO time of the first stale read of the run (\"we cannot reach the processor since 10:42\"). */\n staleSince?: string;\n}\n\n/** Whether the card was kept for later (`savePaymentMethod`). Never claim \"saved\" unless `saved` is true. */\nexport interface StripeReaderCardSave {\n requested: boolean;\n saved: boolean;\n /** `no_generated_card`: the issuer / network gave no reusable card; the payment still succeeded. */\n reason?: string;\n}\n\n/** What a card reader payment looks like (the service's payment view plus `terminal` / `cardSave`). Only the fields the library reads are typed. */\nexport interface StripeReaderPayment {\n id: string;\n status?: string;\n amountCents?: number;\n baseCents?: number;\n feeCents?: number;\n platformFeeCents?: number;\n brand?: string | null;\n last4?: string | null;\n attemptKey?: string;\n terminal?: StripeReaderTerminal | null;\n cardSave?: StripeReaderCardSave | null;\n /** `POST .../retry`: a second retry while the reader already waits is a replay. */\n replayed?: boolean;\n [key: string]: unknown;\n}\n\n/** The consent the STAFF records at the counter before a card is kept (`consent` of `POST /v1/terminal/payments`; the service adds `channel: \"terminal\"`). */\nexport interface StripeReaderConsent {\n textVersion: string;\n /** ISO time the staff ticked the box. */\n acceptedAt: string;\n recordedBy: string;\n}\n\n/** Host settings that turn on \"keep the card for future payments\" for a reader payment. */\nexport interface StripeReaderSaveCard {\n /** The customer the card is kept for (`customerRef` of the service). */\n customerRef: string;\n /** Version of the consent wording (the host stores the text it shows under this version). */\n textVersion: string;\n /** Who is at the counter (the staff member's id or e-mail). */\n recordedBy: string;\n /**\n * The exact sentence the staff attests by ticking the box (default: \"The customer agreed to keep this payment method on file for later payments.\"). `textVersion` MUST name this exact text (the host\n * stores the text it shows under that version).\n */\n consentText?: string;\n /** The payer pays the processing fees: \"Later charges will include processing fees.\" is added to the consent sentence (the same sentence as the contractor staff collect panel). */\n customerPaysFees?: boolean;\n}\n\n/** What `startPayment` receives (the host maps it to `POST /v1/terminal/payments`). The amount is in major units. */\nexport interface StripeReaderStartContext {\n readerId: string;\n /** The amount the customer owes before fees, major units (12.5 = $12.50). */\n amount: number;\n /** Stable per click and REUSED when the answer is lost; send it as the service's `attemptKey`. */\n attemptKey: string;\n payableRef: string | null;\n /** Always `'CARD_PRESENT'`. */\n paymentMethod: 'CARD_PRESENT';\n /**\n * The TOTAL in cents the payer saw (`Math.round(quote.totalAmount * 100)` of the CARD_PRESENT quote). Send it as the service's `expectedAmountCents`: a changed quote is refused with 409 `quote_changed` before the\n * reader is touched. Absent when the screen showed no quote.\n */\n expectedAmountCents?: number;\n savePaymentMethod?: boolean;\n customerRef?: string;\n consent?: StripeReaderConsent;\n /** Set only by the payment-panel integration: what the panel's other fields say. */\n receivedDate?: string;\n notes?: string | null;\n allocation?: PaymentAllocation;\n}\n\n/** What `estimateFees` receives for a reader payment. The quote is the CARD_PRESENT one and differs from the online card quote. */\nexport interface StripeReaderFeeContext { amount: number; paymentMethod: 'CARD_PRESENT'; paymentMethodType: 'card_present' }\n\n/** `getPayment`: which payment to read. `paymentId` is known after the start answered; before that only the attempt key is. */\nexport interface StripeReaderPaymentRef { paymentId: string | null; attemptKey: string }\n\nexport type StripeReaderGetReadinessFn = () => HostResult<StripeReaderReadiness>;\nexport type StripeReaderStartFn = (ctx: StripeReaderStartContext) => HostResult<StripeReaderPayment>;\n/** Reads one payment with its `terminal` object. Answer `null` (or reject with 404) when no payment exists for the attempt key. */\nexport type StripeReaderGetPaymentFn = (ref: StripeReaderPaymentRef) => HostResult<StripeReaderPayment | null>;\nexport type StripeReaderRetryFn = (paymentId: string) => HostResult<StripeReaderPayment>;\nexport type StripeReaderCancelFn = (paymentId: string) => HostResult<unknown>;\nexport type StripeReaderFeesFn = (ctx: StripeReaderFeeContext) => HostResult<StripeFees>;\n\n/** The one bundle of host callbacks that turns card-reader mode on in `ui-payment-stripe-method` (`[reader]`). */\nexport interface StripeReaderConfig {\n getReadiness: StripeReaderGetReadinessFn;\n startPayment: StripeReaderStartFn;\n getPayment: StripeReaderGetPaymentFn;\n retryPayment: StripeReaderRetryFn;\n cancelPayment: StripeReaderCancelFn;\n /** The CARD_PRESENT fee quote. REQUIRED: a reader payment shows the breakdown (and sends `expectedAmountCents`) before the tap. */\n estimateFees: StripeReaderFeesFn;\n /** The address of the receipt of a paid payment (host-built; only https or in-app `/paths` are linked). */\n receiptUrl?: (payment: StripeReaderPayment) => string | null | undefined;\n /** Turns on the \"Save this card for future payments\" choice. */\n saveCard?: StripeReaderSaveCard | null;\n /**\n * How often (ms) the waiting payment's status is read while the payer taps (default 2000). Clamped to {@link STRIPE_READER_POLL_MIN_MS}..{@link STRIPE_READER_POLL_MAX_MS}. The `[readerPollMs]` input of\n * `ui-payment-stripe-method`, when set, wins over this value.\n */\n pollMs?: number;\n}\n\n/** The fastest and the slowest status poll of a waiting reader payment (ms): a faster one would hammer the host's backend, a slower one would leave the payer staring at a stale screen. */\nexport const STRIPE_READER_POLL_MIN_MS = 500;\nexport const STRIPE_READER_POLL_MAX_MS = 30_000;\nconst STRIPE_READER_POLL_DEFAULT_MS = 2000;\n\n/** A poll cadence the library will actually use: not a finite number > 0 = the default (2000 ms); otherwise rounded and clamped to 500..30 000 ms. */\nexport function clampReaderPollMs(value: number | null | undefined): number {\n if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) return STRIPE_READER_POLL_DEFAULT_MS;\n return Math.min(STRIPE_READER_POLL_MAX_MS, Math.max(STRIPE_READER_POLL_MIN_MS, Math.round(value)));\n}\n\n/** A refusal of `startPayment` / `retryPayment` the library words itself. */\nexport interface StripeReaderRefusal {\n code: string;\n /** The service's own text, shown only for a code the library has no wording for. */\n message: string;\n paymentId: string | null;\n terminal: StripeReaderTerminal | null;\n /** `quote_changed`: the new total / fees in cents, as the service answered them. */\n amountCents?: number | null;\n feeCents?: number | null;\n platformFeeCents?: number | null;\n}\n\n/** Reads the flat `code`, status, `paymentId` and `terminal` of a failed host call (the error itself or its `error` body). */\nexport function readerErrorInfo(error: unknown): StripeReaderRefusal & { status: number | null } {\n type Body = { code?: unknown; message?: unknown; paymentId?: unknown; terminal?: unknown; amountCents?: unknown; feeCents?: unknown; platformFeeCents?: unknown };\n const e = error as (Body & { status?: unknown; response?: { status?: unknown } | null; error?: Body | null }) | null | undefined;\n const pick = <T>(guard: (v: unknown) => v is T, ...values: unknown[]): T | null => { for (const v of values) if (guard(v)) return v; return null; };\n const isString = (v: unknown): v is string => typeof v === 'string' && v.length > 0;\n const isCents = (v: unknown): v is number => typeof v === 'number' && Number.isFinite(v) && v >= 0;\n const isObject = (v: unknown): v is StripeReaderTerminal => !!v && typeof v === 'object' && typeof (v as { state?: unknown }).state === 'string';\n const status = typeof e?.status === 'number' ? e.status : typeof e?.response?.status === 'number' ? e.response.status : null;\n const body = (e?.error && typeof e.error === 'object' ? e.error : null) as Body | null;\n // the quote_changed amounts are present only when the service sent them (a refusal without them has no such keys)\n const cents = (key: 'amountCents' | 'feeCents' | 'platformFeeCents'): Partial<Record<typeof key, number>> => { const v = pick(isCents, e?.[key], body?.[key]); return v === null ? {} : ({ [key]: v } as Partial<Record<typeof key, number>>); };\n return {\n code: (pick(isString, e?.code, body?.code) ?? '').toLowerCase(),\n message: pick(isString, body?.message, e?.message) ?? '',\n paymentId: pick(isString, e?.paymentId, body?.paymentId),\n terminal: pick(isObject, e?.terminal, body?.terminal),\n ...cents('amountCents'), ...cents('feeCents'), ...cents('platformFeeCents'),\n status,\n };\n}\n\n/** A refusal without the HTTP status (the refusal the screen keeps is the same shape whatever the transport said). */\nexport function toRefusal(info: StripeReaderRefusal & { status?: number | null }): StripeReaderRefusal {\n const { status: _status, ...rest } = info;\n void _status;\n return rest;\n}\n\n/** What a payment was STARTED for (before fees, major units): `baseCents`, else the total minus the fees, else the total; `null` when the service gave no amount. Never 0 for a missing amount. */\nexport function paymentBaseAmount(payment: StripeReaderPayment | null | undefined): number | null {\n if (!payment) return null;\n if (typeof payment.baseCents === 'number' && payment.baseCents > 0) return payment.baseCents / 100;\n if (typeof payment.amountCents === 'number' && payment.amountCents > 0) {\n const fees = (typeof payment.feeCents === 'number' ? payment.feeCents : 0) + (typeof payment.platformFeeCents === 'number' ? payment.platformFeeCents : 0);\n return Math.max(0, payment.amountCents - fees) / 100 || payment.amountCents / 100;\n }\n return null;\n}\n\n/** How the screen words a terminal the service could not read (`checking` / `stale`). */\nexport type StripeReaderDegraded = { kind: 'transient' } | { kind: 'since'; since: string } | { kind: 'attention' };\n\n/**\n * `null` when the terminal was read normally. Otherwise: `attention` for a reason that will not fix itself (`reconnect_required`, `processor_refused`: \"the payment account needs attention\"), `since` from the 3rd\n * consecutive stale read (\"cannot reach the processor since 10:42\") and `transient` for the rest (`processor_unreachable`, `processor_timeout`, none given). Never a resubmit in any of them.\n */\nexport function readerDegraded(terminal: Pick<StripeReaderTerminal, 'state' | 'stale' | 'degradedReason' | 'staleReads' | 'staleSince'> | null | undefined, locale?: string): StripeReaderDegraded | null {\n if (!terminal || !(isTerminalChecking(terminal.state) || terminal.stale === true)) return null;\n if (terminal.degradedReason === 'reconnect_required' || terminal.degradedReason === 'processor_refused') return { kind: 'attention' };\n if (typeof terminal.staleReads === 'number' && terminal.staleReads >= 3 && terminal.staleSince) {\n const at = new Date(terminal.staleSince);\n if (!Number.isNaN(at.getTime())) {\n try { return { kind: 'since', since: new Intl.DateTimeFormat(locale, { hour: 'numeric', minute: '2-digit' }).format(at) }; } catch { /* fall through to transient */ }\n }\n }\n return { kind: 'transient' };\n}\n\n/** The TOTAL a payment charged (major units), from the service's `amountCents`; `null` when absent. */\nexport function paymentChargedAmount(payment: StripeReaderPayment | null | undefined): number | null {\n return payment && typeof payment.amountCents === 'number' && payment.amountCents > 0 ? payment.amountCents / 100 : null;\n}\n\n/** The label key of the wording of a reader refusal code, or null for a code the library does not know (the service's message is shown). */\nexport function readerRefusalLabelKey(code: string): UiLabelKey | null {\n switch (code) {\n case 'reader_busy': return 'stripeReader.refusal.reader_busy';\n case 'reader_offline': return 'stripeReader.refusal.reader_offline';\n case 'reader_not_supported': return 'stripeReader.refusal.reader_not_supported';\n case 'reader_unreachable': return 'stripeReader.refusal.reader_unreachable';\n case 'terminal_not_retryable': return 'stripeReader.refusal.terminal_not_retryable';\n case 'payment_in_flight': return 'stripeReader.refusal.payment_in_flight';\n case 'merchant_not_ready': return 'stripeReader.refusal.merchant_not_ready';\n case 'reconnect_required': return 'stripeReader.refusal.reconnect_required';\n case 'consent_required': return 'stripeReader.refusal.consent_required';\n case 'terminal_save_needs_direct': return 'stripeReader.refusal.terminal_save_needs_direct';\n case 'not_supported_by_processor': return 'stripeReader.refusal.not_supported_by_processor';\n case 'exceeds_amount_due': return 'stripeReader.refusal.exceeds_amount_due';\n case 'duplicate_suspected': return 'stripeReader.refusal.duplicate_suspected';\n case 'quote_changed': return 'stripeReader.refusal.quote_changed';\n case 'attempt_failed_use_new_key': return 'stripeReader.refusal.attempt_failed_use_new_key';\n case 'payment_being_sent': return 'stripeReader.refusal.payment_being_sent';\n // raised by the library itself (the attempt machine refused the click, a start / retry could not be settled, or the service answered 429)\n case 'paid': return 'stripeReader.refusal.paid';\n case 'offline': return 'stripeReader.refusal.offline';\n case 'outcome_checking':\n case 'outcome_unknown': return 'stripeReader.refusal.outcome_checking'; // `outcome_unknown` = the old code, still worded; the library raises `outcome_checking`\n case 'queued_offline': return 'stripeReader.refusal.queued_offline';\n case 'start_not_received': return 'stripeReader.refusal.start_not_received';\n case 'retry_unreachable': return 'stripeReader.refusal.retry_unreachable';\n case 'rate_limited': return 'stripeReader.refusal.rate_limited';\n default: return null;\n }\n}\n\n/** Codes that prove NOTHING was created or charged: the attempt is released (key kept) and the payer may start again. */\nexport const STRIPE_READER_NOT_CREATED_CODES: readonly string[] = [\n 'reader_busy', 'reader_offline', 'reader_not_supported', 'merchant_not_ready', 'reconnect_required', 'consent_required', 'terminal_save_needs_direct', 'not_supported_by_processor', 'exceeds_amount_due', 'quote_changed',\n];\n\n/** The supported smart readers (the service refuses anything else with 400 `reader_not_supported`). */\nexport const STRIPE_READER_MODELS: readonly { deviceType: string; model: string }[] = [\n { deviceType: 'stripe_s700', model: 'Stripe Reader S700' },\n { deviceType: 'stripe_s710', model: 'Stripe Reader S710' },\n { deviceType: 'bbpos_wisepos_e', model: 'BBPOS WisePOS E' },\n];\n\nconst KNOWN_STATES: readonly StripeReaderReadinessState[] = ['merchant_not_ready', 'no_reader', 'unsupported_only', 'reader_ready', 'reader_busy', 'reader_offline', 'checking', 'unknown'];\n\n/** A defensive copy of an answer: an unrecognised state (or the old `unknown`) becomes `checking`, a missing list `[]` (nothing is ever guessed ready). The result's state is never `unknown`. */\nexport function normalizeReadiness(raw: unknown): StripeReaderReadiness {\n const r = raw as Partial<StripeReaderReadiness> | null | undefined;\n const readers = Array.isArray(r?.readers) ? r!.readers!.filter(x => !!x && typeof x.id === 'string') : [];\n let state = KNOWN_STATES.includes(r?.state as StripeReaderReadinessState) ? (r!.state as StripeReaderReadinessState) : 'checking';\n if (state === 'unknown') state = 'checking';\n // `reader_ready` with no reader that is supported, online and free can take no payment: nothing is guessed ready.\n if (state === 'reader_ready' && !readers.some(isReaderFree)) state = 'checking';\n return {\n state, readers, defaultReaderId: typeof r?.defaultReaderId === 'string' ? r.defaultReaderId : null,\n ...(r?.checkedAt ? { checkedAt: r.checkedAt } : {}), ...(r?.stale ? { stale: true } : {}), ...(r?.reason ? { reason: r.reason } : {}), ...(r?.merchantStatus ? { merchantStatus: r.merchantStatus } : {}),\n ...(r?.degradedReason ? { degradedReason: r.degradedReason } : {}),\n };\n}\n\n/**\n * \"10:42 AM\" of a moment, in the user's language (explicit locale, the user's own time zone). `''` for a missing / unreadable value. Library source 2026-11-21 (used by `ui-stripe-reader-banner`: \"last confirmed at ...\").\n */\nexport function formatReaderTime(value: Date | string | number | null | undefined, locale?: string): string {\n if (value == null || value === '') return '';\n const at = value instanceof Date ? value : new Date(value);\n if (Number.isNaN(at.getTime())) return '';\n try { return new Intl.DateTimeFormat(locale, { hour: 'numeric', minute: '2-digit' }).format(at); } catch { return ''; }\n}\n\n/** The name a reader is shown under: its label, else its model, else its id. */\nexport function readerDisplayName(reader: Pick<StripeReader, 'id' | 'label' | 'model' | 'deviceType'> | null | undefined): string {\n if (!reader) return '';\n return reader.label?.trim() || reader.model?.trim() || STRIPE_READER_MODELS.find(m => m.deviceType === reader.deviceType)?.model || reader.id;\n}\n\n/** Can this reader take a payment right now (supported, online, free)? */\nexport function isReaderFree(reader: StripeReader): boolean { return reader.supported && reader.status === 'online' && !reader.busy; }\n\n/** Only an https address or an in-app `/path` is ever linked or opened (never `javascript:`, `data:`, `//host`). */\nexport function isSafeReceiptUrl(url: string | null | undefined): url is string {\n if (!url || /[\\u0000-\\u001f\\\\]/.test(url)) return false;\n if (url.startsWith('/') && !url.startsWith('//')) return true;\n try { return new URL(url).protocol === 'https:'; } catch { return false; }\n}\n\n/** `m:ss` of an elapsed time in ms (never negative). */\nexport function formatElapsed(ms: number): string {\n const total = Math.max(0, Math.floor((Number.isFinite(ms) ? ms : 0) / 1000));\n const m = Math.floor(total / 60);\n const s = total % 60;\n return `${m}:${s < 10 ? '0' : ''}${s}`;\n}\n\n/** A Stripe location a reader is registered to. */\nexport interface StripeReaderLocation {\n id: string;\n displayName: string;\n address?: { line1?: string; city?: string; state?: string; postalCode?: string; country?: string } | null;\n}\n\n/** What `registerReader` receives. The registration code is typed once by the user and never kept: it is cleared from the form BEFORE the call and never echoed back. */\nexport interface StripeReaderRegisterContext { registrationCode: string; label: string; locationId: string }\n\n/** What `createLocation` receives (the host maps it to `POST /v1/terminal/locations`). */\nexport interface StripeReaderCreateLocationContext {\n displayName: string;\n address: { line1: string; city: string; state: string; postalCode: string; country: string };\n}\n\nexport type StripeReaderRegisterFn = (ctx: StripeReaderRegisterContext) => HostResult<StripeReader>;\nexport type StripeReaderRenameFn = (readerId: string, label: string) => HostResult<StripeReader>;\nexport type StripeReaderRemoveFn = (readerId: string) => HostResult<unknown>;\nexport type StripeReaderListLocationsFn = () => HostResult<readonly StripeReaderLocation[]>;\nexport type StripeReaderCreateLocationFn = (ctx: StripeReaderCreateLocationContext) => HostResult<StripeReaderLocation>;\n","import { computed, signal } from '@angular/core';\nimport { PAYMENT_REQUEST_TIMEOUT_MS, callHost, wasQueuedOffline, type HostResult } from '@forgeroute/ui/payments';\nimport {\n STRIPE_READER_NOT_CREATED_CODES, isTerminalChecking, paymentBaseAmount, readerErrorInfo, toRefusal,\n type StripeReaderCancelFn, type StripeReaderCardSave, type StripeReaderConsent, type StripeReaderGetPaymentFn, type StripeReaderPayment, type StripeReaderRefusal, type StripeReaderRetryFn,\n type StripeReaderStartContext, type StripeReaderStartFn, type StripeReaderTerminal,\n} from './stripe-reader.models';\n\n/**\n * Where a card reader payment is. One value, always:\n * - `idle`: nothing started (or an earlier payment ended: canceled / failed / refused);\n * - `starting`: the click was accepted and the payment is on its way to the service (the answer is not here yet);\n * - `recovering`: the answer of `starting` was lost (timeout, connection): the attempt key is looked up until the payment is found (or, after the grace period, the service still has none: then `recoveryExpired` is set and\n * the payer is asked to check again; only a second \"none\" answer, asked by the payer, releases the attempt). NEVER a second start;\n * - `waiting`: the reader waits for the customer to tap, insert or swipe;\n * - `declined`: the card was declined; the payment stays open (retry the SAME payment or cancel it);\n * - `stopped`: the reader stopped waiting without a decline; the payment stays open (retry or cancel);\n * - `retrying`: the same payment is being sent to the reader again;\n * - `cancelling`: a cancel is running (the payment is canceled ONLY when the service confirms);\n * - `succeeded`, `canceled`, `failed`: final.\n */\nexport type StripeReaderPhase = 'idle' | 'starting' | 'recovering' | 'waiting' | 'declined' | 'stopped' | 'retrying' | 'cancelling' | 'succeeded' | 'canceled' | 'failed';\n\n/** What the flow needs of the payment-attempt machine (`PaymentAttempt` of `@forgeroute/ui/payments` fits it; specs use a fake). */\nexport interface StripeReaderAttemptPort {\n begin(): { ok: true; key: string } | { ok: false; reason: 'locked' | 'paid' | 'unknown' | 'offline' };\n /** The key of the attempt in effect. */\n key(): string;\n /** The payment succeeded: locks the payable as paid. */\n succeed(reason?: string): void;\n /** A DEFINITIVE end without money (canceled, failed): unlocks with a NEW key. */\n fail(reason?: string): void;\n /** Nothing was created at the service: unlock, KEEP the key. */\n markNotCharged(): void;\n /** The answer of the start was lost: lock (key kept) until the payment is found. */\n markUnknown(reason: string): void;\n}\n\nexport type StripeReaderFlowEvent =\n | { kind: 'started'; payment: StripeReaderPayment; attemptKey: string }\n | { kind: 'declined'; payment: StripeReaderPayment }\n | { kind: 'succeeded'; payment: StripeReaderPayment; attemptKey: string }\n | { kind: 'canceled'; payment: StripeReaderPayment | null }\n | { kind: 'failed'; payment: StripeReaderPayment | null }\n | { kind: 'refused'; refusal: StripeReaderRefusal }\n | { kind: 'connection-lost' }\n | { kind: 'connection-restored' };\n\nexport interface StripeReaderFlowOptions {\n attempt: StripeReaderAttemptPort;\n /** The calls are read at call time (a host may swap them); null = not provided (the action does nothing). */\n start: () => StripeReaderStartFn | null;\n getPayment: () => StripeReaderGetPaymentFn | null;\n retry: () => StripeReaderRetryFn | null;\n cancel: () => StripeReaderCancelFn | null;\n /** How often the open payment is read (default 2000 ms). */\n pollMs?: () => number;\n /** A poll slower than this counts as a lost connection (default 8000 ms). */\n pollTimeoutMs?: () => number;\n /** One start / retry / cancel call slower than this is treated as unreachable: a start becomes a lost answer (looked up by its attempt key, never re-sent), a retry / cancel leaves the payment as it was (default 60 000 ms). */\n requestTimeoutMs?: () => number;\n /** After a lost start answer (or an adopted attempt), \"no payment for this attempt key\" is believed only after this long, MEASURED FROM THE MOMENT RECOVERY STARTS (default 360 000 ms: the service may take up to 5 minutes to create the payment\n * of a request whose answer the browser gave up on, API.md 16.3, plus 1 minute of margin). */\n lostAnswerGraceMs?: () => number;\n now?: () => number;\n onEvent?: (event: StripeReaderFlowEvent) => void;\n}\n\n/** What the screen passes to `start()`. */\nexport interface StripeReaderStartInput {\n readerId: string;\n /** Major units. */\n amount: number;\n payableRef: string | null;\n /** The total in cents the payer saw (the CARD_PRESENT quote); sent as `expectedAmountCents`. */\n expectedAmountCents?: number;\n save?: { customerRef: string; consent: StripeReaderConsent } | null;\n extras?: Pick<StripeReaderStartContext, 'receivedDate' | 'notes' | 'allocation'>;\n}\n\nexport const STRIPE_READER_POLL_MS = 2000;\nexport const STRIPE_READER_POLL_TIMEOUT_MS = 8000;\n/** The service's create window (5 minutes) plus a minute of margin: \"no payment for this key\" earlier than this may only mean the payment is not created yet. */\nexport const STRIPE_READER_LOST_ANSWER_GRACE_MS = 6 * 60_000;\n/** A start / retry / cancel call that has not answered by then is unreachable (the library's request timeout). */\nexport const STRIPE_READER_REQUEST_TIMEOUT_MS = PAYMENT_REQUEST_TIMEOUT_MS;\n\n/** The service's definitive refusals of a start that prove nothing was created and that are NOT worded as \"not charged\" retries: the existing payment is shown. */\nconst DEFINITIVE_START_CODES: readonly string[] = ['duplicate_suspected'];\n\nconst OPEN: readonly StripeReaderPhase[] = ['starting', 'recovering', 'waiting', 'declined', 'stopped', 'retrying', 'cancelling'];\nconst FINAL: readonly StripeReaderPhase[] = ['succeeded', 'canceled', 'failed'];\n\n/**\n * The card reader payment flow as a plain class (no view): readiness is the screen's job, this starts ONE payment on a reader, follows it by polling the service through the host's calls, and lets the payer retry\n * (the SAME payment, never a new charge) or cancel it. `ui-stripe-reader-payment` runs it; specs drive it with fake calls and a fake clock.\n *\n * Money rules it enforces:\n * - ONE payment at a time: `start()` is synchronous up to the attempt's `begin()` (a double click / second tab is refused) and every state in {@link OPEN} refuses another start;\n * - the attempt key is the one the attempt machine pinned at the click and is REUSED when the answer is lost (the service answers the same attempt key with the same payment, one intent, one reader action);\n * - a lost answer is never \"failed\": it is `recovering` (polling by attempt key) until the payment shows up, or the grace period has passed with the service still saying \"no payment for this key\";\n * - a cancel never claims success unless the service confirmed it (`reader_unreachable` leaves the payment open and says so);\n * - a poll that fails (connection lost) never changes the payment's state: it is reported and polling continues; the state shown on reconnect is the service's truth;\n * - the service's `terminal.state` `unknown` / `stale` is \"still checking\" (never an error, never a resubmit).\n */\nexport class StripeReaderFlow {\n readonly phase = signal<StripeReaderPhase>('idle');\n readonly payment = signal<StripeReaderPayment | null>(null);\n readonly terminal = computed((): StripeReaderTerminal | null => this.payment()?.terminal ?? null);\n /** The service could not read the processor (`terminal.state` `unknown` or `stale`): \"still checking\". */\n readonly checking = signal(false);\n /** The browser could not reach the host while a payment is open: the reader may still take the payment. */\n readonly connectionLost = signal(false);\n /** `recovering` only: the grace period is over and the service still has no payment for the attempt key. Polling stops; the payer is asked to \"Check again\" (`recheck()`), and only another \"none\" releases the attempt. */\n readonly recoveryExpired = signal(false);\n /** `recheck()` is running. */\n readonly rechecking = signal(false);\n /** The reader dropped its connection while the payment waits (`terminal.readerOnline === false`). */\n readonly readerOffline = signal(false);\n /** The last refusal of a start / retry (worded by the screen); cleared by the next start. */\n readonly refusal = signal<StripeReaderRefusal | null>(null);\n /** A cancel could not be confirmed (the reader or the processor was unreachable): the payment is STILL open. */\n readonly cancelUnreachable = signal(false);\n readonly cardSave = signal<StripeReaderCardSave | null>(null);\n readonly elapsedMs = signal(0);\n /** What the last start (or the adopted payment) is for, before fees (major units); `null` until known. */\n readonly baseAmount = computed((): number | null => paymentBaseAmount(this.payment()) ?? this.startInput()?.amount ?? null);\n /** The input of the last start (a signal, so the screen follows it). */\n readonly startInput = signal<StripeReaderStartInput | null>(null);\n /** The attempt key of the payment being started / followed. */\n readonly attemptKey = signal<string | null>(null);\n /** No other payment may be started and the payer must not leave. */\n readonly locked = computed(() => OPEN.includes(this.phase()));\n /** A payment exists at the service and is not decided (cancel is possible). */\n readonly cancellable = computed(() => ['waiting', 'declined', 'stopped'].includes(this.phase()) && !!this.payment()?.id);\n readonly retryable = computed(() => ['declined', 'stopped'].includes(this.phase()) && !!this.payment()?.id);\n\n private disposed = false;\n private pollTimer: ReturnType<typeof setTimeout> | null = null;\n private tickTimer: ReturnType<typeof setInterval> | null = null;\n private pollGen = 0;\n private polling = false;\n private startedAt = 0;\n /** When recovery began (a lost start answer, or an adopted attempt): the grace is counted from here, never from the click. */\n private recoverStartedAt = 0;\n private explicitCheck = false;\n /** The payment id the service named in a 409 `request_in_progress` (the same attempt key is being created): used to read the payment while the answer of the start is lost. Never used to cancel. */\n private adoptedPaymentId: string | null = null;\n private cancelRun: Promise<boolean> | null = null;\n /** The phase to go back to when a retry or a cancel did not change anything. */\n private before: StripeReaderPhase = 'waiting';\n\n constructor(private readonly o: StripeReaderFlowOptions) {}\n\n private now(): number { return this.o.now ? this.o.now() : Date.now(); }\n private emit(event: StripeReaderFlowEvent): void { if (!this.disposed) this.o.onEvent?.(event); }\n\n /** Starts ONE payment on a reader. Synchronous up to the attempt's `begin()`: a second click in the same tick is refused. */\n async start(input: StripeReaderStartInput): Promise<void> {\n if (this.disposed || this.locked() || this.phase() === 'succeeded') return;\n const start = this.o.start();\n if (!start) return;\n const begun = this.o.attempt.begin();\n if (!begun.ok) {\n if (begun.reason !== 'locked') this.refuse({ code: begun.reason === 'unknown' ? 'outcome_checking' : begun.reason, message: '', paymentId: null, terminal: null });\n return;\n }\n this.phase.set('starting');\n this.startInput.set(input);\n this.attemptKey.set(begun.key);\n this.startedAt = this.now();\n this.elapsedMs.set(0);\n this.refusal.set(null);\n this.cancelUnreachable.set(false);\n this.connectionLost.set(false);\n this.checking.set(false);\n this.recoveryExpired.set(false);\n this.cardSave.set(null);\n this.payment.set(null);\n this.adoptedPaymentId = null;\n this.startTick();\n const ctx: StripeReaderStartContext = {\n readerId: input.readerId, amount: input.amount, attemptKey: begun.key, payableRef: input.payableRef, paymentMethod: 'CARD_PRESENT',\n ...(input.expectedAmountCents !== undefined && Number.isFinite(input.expectedAmountCents) && input.expectedAmountCents >= 1 ? { expectedAmountCents: Math.round(input.expectedAmountCents) } : {}),\n ...(input.save ? { savePaymentMethod: true, customerRef: input.save.customerRef, consent: input.save.consent } : {}),\n ...(input.extras ?? {}),\n };\n let answer: StripeReaderPayment | null | undefined;\n try { answer = await this.call(() => start(ctx)); } catch (error) { this.onStartError(error); return; }\n if (this.disposed) return;\n if (wasQueuedOffline(answer)) {\n // The offline layer queued the request (a synthetic 202): nothing reached the service. Payments are never queued.\n this.o.attempt.markNotCharged();\n this.endNotCreated({ code: 'queued_offline', message: '', paymentId: null, terminal: null });\n return;\n }\n if (!answer || typeof answer.id !== 'string' || !answer.id) { this.lostAnswer(); return; }\n this.emit({ kind: 'started', payment: answer, attemptKey: begun.key });\n this.apply(answer);\n this.schedulePoll();\n }\n\n private onStartError(error: unknown): void {\n if (this.disposed) return;\n const info = readerErrorInfo(error);\n // The key can never complete (a failed payment superseded by a newer one, returned by the bank...): a DEFINITIVE end of this key, the attempt starts again with a NEW key. Never a lost answer.\n if (info.code === 'attempt_failed_use_new_key') {\n this.o.attempt.fail('replay');\n this.endNotCreated(toRefusal(info));\n return;\n }\n // The same attempt key is being created right now (`request_in_progress`, whatever the status): the payment may exist, so NEVER a second start and never idle. It is looked up by its attempt key (and by the payment id when the service names it).\n if (info.code === 'request_in_progress') {\n if (info.paymentId) this.adoptedPaymentId = info.paymentId;\n this.lostAnswer();\n return;\n }\n // Another payment of this reference holds the reader: when it IS a card reader payment (`terminal` is answered) it is followed, so staff can cancel / retry / watch the open payment instead of being stuck.\n if (info.code === 'payment_in_flight' && info.paymentId && info.terminal) {\n // The marker is KEPT (unknown) while the open payment is followed: a reload or a second tab must not find a free screen while a payment waits on the reader. It ends with the followed payment (succeeded / canceled / failed).\n this.o.attempt.markUnknown('payment_in_flight');\n this.follow({ id: info.paymentId, status: 'CREATED', terminal: info.terminal }, toRefusal(info));\n return;\n }\n // The reader holds another payment, or this reference has an open payment of another attempt (or a suspected duplicate): nothing was created by THIS click.\n if (info.code === 'payment_in_flight' || DEFINITIVE_START_CODES.includes(info.code) || STRIPE_READER_NOT_CREATED_CODES.includes(info.code)) {\n this.o.attempt.markNotCharged();\n this.endNotCreated(toRefusal(info));\n return;\n }\n // 429 (a risk block or a rate limit): the service creates NOTHING (API.md), so it is a definitive \"not created\". The same attempt key is idempotent at the service, so the payer may simply try again.\n if (info.status === 429) {\n this.o.attempt.markNotCharged();\n this.endNotCreated({ ...toRefusal(info), code: 'rate_limited' });\n return;\n }\n // A definitive refusal of the request itself (a 4xx the service answered, no code we know): nothing was created either. 408 (gateway timeout), 409 and 425 (too early) can follow a request the service already took: those are a lost answer.\n if (info.status !== null && info.status >= 400 && info.status < 500 && info.status !== 408 && info.status !== 409 && info.status !== 425) {\n this.o.attempt.markNotCharged();\n this.endNotCreated(toRefusal(info));\n return;\n }\n // Timeout, connection, 5xx, 408/409/425 without a known code: the payment may exist.\n this.lostAnswer();\n }\n\n /** Follows an open reader payment of another attempt (the service said so with `payment_in_flight` + `terminal`): the screen shows it like its own, with its refusal text above. */\n private follow(payment: StripeReaderPayment, refusal: StripeReaderRefusal): void {\n this.stopTick();\n this.startTick();\n this.payment.set(payment);\n this.phase.set('waiting');\n this.apply(payment);\n this.refuse(refusal);\n if (!FINAL.includes(this.phase())) this.schedulePoll();\n }\n\n /**\n * A reload or a second tab found an UNDECIDED attempt of this payable (the attempt machine is `unknown`): the payment may be waiting on a reader right now. The attempt key is looked up (never a new start)\n * until the payment shows up (then it is followed like any other) or, after the grace period, the service still has none.\n */\n adopt(): void {\n if (this.disposed || this.locked() || FINAL.includes(this.phase())) return;\n this.attemptKey.set(this.o.attempt.key());\n this.adoptedPaymentId = null;\n this.startedAt = this.now();\n this.recoverStartedAt = this.now();\n this.recoveryExpired.set(false);\n this.elapsedMs.set(0);\n this.refusal.set(null);\n this.startTick();\n this.phase.set('recovering');\n this.schedulePoll();\n }\n\n private endNotCreated(refusal: StripeReaderRefusal): void {\n this.recoveryExpired.set(false);\n this.stopTick();\n this.stopPolling();\n this.phase.set('idle');\n this.refuse(refusal);\n }\n\n private refuse(refusal: StripeReaderRefusal): void {\n this.refusal.set(refusal);\n this.emit({ kind: 'refused', refusal });\n }\n\n /** The answer of the start is lost: lock with the key kept and look the attempt key up until the payment shows up. */\n private lostAnswer(): void {\n this.o.attempt.markUnknown('timeout');\n this.recoverStartedAt = this.now();\n this.recoveryExpired.set(false);\n this.phase.set('recovering');\n this.schedulePoll();\n }\n\n // ── Polling ──────────────────────────────────────────────────────────────\n\n /** Reads the payment now (also after the browser says it is back online). */\n pollNow(): void {\n if (this.disposed || !this.shouldPoll()) return;\n this.stopPolling();\n void this.pollOnce(this.pollGen);\n }\n\n /** The browser reports offline / online. Offline only marks the loss; the next successful poll restores. */\n markConnection(online: boolean): void {\n if (this.disposed || !this.shouldPoll()) return;\n if (!online) this.setConnectionLost(true);\n else this.pollNow();\n }\n\n private shouldPoll(): boolean { return ['recovering', 'waiting', 'declined', 'stopped', 'retrying'].includes(this.phase()); }\n\n private schedulePoll(): void {\n this.stopPolling();\n if (this.disposed || !this.shouldPoll() || this.recoveryExpired()) return;\n const gen = this.pollGen;\n const every = Math.max(1, this.o.pollMs?.() ?? STRIPE_READER_POLL_MS);\n this.pollTimer = setTimeout(() => { this.pollTimer = null; void this.pollOnce(gen); }, every);\n }\n\n private stopPolling(): void {\n this.pollGen++;\n if (this.pollTimer) { clearTimeout(this.pollTimer); this.pollTimer = null; }\n }\n\n private async pollOnce(gen: number): Promise<void> {\n const read = this.o.getPayment();\n if (!read || this.polling || gen !== this.pollGen || !this.shouldPoll()) { if (gen === this.pollGen) this.schedulePoll(); return; }\n this.polling = true;\n const phaseAtStart = this.phase();\n const explicit = this.explicitCheck;\n let answer: StripeReaderPayment | null | 'failed' = 'failed';\n let notFound = false;\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<'timeout'>(resolve => { timer = setTimeout(() => resolve('timeout'), this.o.pollTimeoutMs?.() ?? STRIPE_READER_POLL_TIMEOUT_MS); });\n const result = await Promise.race([callHost(() => read({ paymentId: this.payment()?.id ?? this.adoptedPaymentId, attemptKey: this.attemptKey() ?? this.o.attempt.key() })), timeout]);\n if (result === 'timeout') answer = 'failed';\n else if (result && typeof result === 'object' && typeof result.id === 'string') answer = result;\n else { answer = null; notFound = true; }\n } catch (error) {\n const info = readerErrorInfo(error);\n if (info.status === 404 && !this.payment() && !this.adoptedPaymentId) { answer = null; notFound = true; } else answer = 'failed';\n } finally { if (timer) clearTimeout(timer); this.polling = false; }\n if (this.disposed || gen !== this.pollGen) return;\n if (answer === 'failed') {\n this.setConnectionLost(true);\n } else if (answer) {\n this.setConnectionLost(false);\n if (phaseAtStart === 'recovering' && this.phase() === 'recovering') this.emit({ kind: 'started', payment: answer, attemptKey: this.attemptKey() ?? '' });\n this.apply(answer);\n } else if (notFound) {\n this.setConnectionLost(false);\n if (this.phase() === 'recovering' && this.now() - this.recoverStartedAt >= Math.max(0, this.o.lostAnswerGraceMs?.() ?? STRIPE_READER_LOST_ANSWER_GRACE_MS)) {\n if (explicit && this.recoveryExpired()) {\n // The payer asked again AFTER the grace (longer than the service needs to create a payment) and the service still has none for this key: nothing was created. The marker is released (key kept: the service answers the same key with the same payment).\n this.o.attempt.markNotCharged();\n this.endNotCreated({ code: 'start_not_received', message: '', paymentId: null, terminal: null });\n return;\n }\n // The grace is over and the service still says \"none\": never claim \"nothing was charged\" on this alone. Polling stops, the marker stays, the payer is asked to check again.\n this.recoveryExpired.set(true);\n this.stopPolling();\n return;\n }\n }\n this.schedulePoll();\n }\n\n /**\n * \"Check again\" of an unconfirmed payment (`recoveryExpired`): reads the attempt key once more. Found: followed like any payment. Still none (the grace is over): the attempt is released and the payer may start again (the same key is\n * idempotent at the service). A failed read changes nothing (connection lost) and the payer can check again.\n */\n async recheck(): Promise<void> {\n if (this.disposed || this.phase() !== 'recovering' || !this.recoveryExpired() || this.polling || this.rechecking()) return;\n this.explicitCheck = true;\n this.rechecking.set(true);\n this.stopPolling();\n try { await this.pollOnce(this.pollGen); } finally { this.explicitCheck = false; this.rechecking.set(false); }\n }\n\n private setConnectionLost(lost: boolean): void {\n if (this.connectionLost() === lost) return;\n this.connectionLost.set(lost);\n this.emit({ kind: lost ? 'connection-lost' : 'connection-restored' });\n }\n\n // ── Applying what the service says ──────────────────────────────────────\n\n /** Applies a payment answer (a start / read / retry answer). Only an OPEN phase follows it: a late answer after a final state changes nothing. */\n private apply(payment: StripeReaderPayment): void {\n if (this.disposed || FINAL.includes(this.phase())) return;\n this.payment.set(payment);\n if (payment.cardSave) this.cardSave.set(payment.cardSave);\n const status = String(payment.status ?? '').toUpperCase();\n const t = payment.terminal ?? null;\n if (status === 'SUCCEEDED' || t?.state === 'succeeded') { this.settle('succeeded'); return; }\n if (status === 'CANCELED' || t?.state === 'canceled') { this.settle('canceled'); return; }\n if (status === 'FAILED') { this.settle('failed'); return; }\n this.recoveryExpired.set(false);\n this.checking.set(!!t && (isTerminalChecking(t.state) || t.stale === true));\n this.readerOffline.set(!!t && t.readerOnline === false);\n // While a cancel or a retry runs, a poll answer never moves the phase (a decline read meanwhile would show \"Try again\" while the retry request is still in flight); a final state (succeeded / canceled / failed) still settles above.\n const busyOp = this.phase() === 'cancelling' || this.phase() === 'retrying';\n if (t?.state === 'declined') { if (!busyOp) { const was = this.phase(); this.phase.set('declined'); if (was !== 'declined') this.emit({ kind: 'declined', payment }); } return; }\n if (t?.state === 'failed') { if (!busyOp) this.phase.set('stopped'); return; }\n // waiting, unknown (still checking) or no terminal object: the reader waits\n if (!busyOp) this.phase.set('waiting');\n }\n\n private settle(phase: 'succeeded' | 'canceled' | 'failed'): void {\n const payment = this.payment();\n this.stopPolling();\n this.stopTick();\n this.checking.set(false);\n this.connectionLost.set(false);\n this.readerOffline.set(false);\n this.cancelUnreachable.set(false);\n this.recoveryExpired.set(false);\n this.phase.set(phase);\n if (phase === 'succeeded') {\n const key = this.attemptKey() ?? this.o.attempt.key();\n this.o.attempt.succeed('reader');\n if (payment) this.emit({ kind: 'succeeded', payment, attemptKey: key });\n } else {\n this.o.attempt.fail(phase);\n this.emit({ kind: phase, payment });\n }\n }\n\n // ── Retry and cancel ────────────────────────────────────────────────────\n\n /** After a decline (or a stop): sends the SAME payment to the reader again. Never creates a payment. */\n async retry(): Promise<void> {\n const retry = this.o.retry();\n const id = this.payment()?.id;\n if (this.disposed || !retry || !id || !this.retryable()) return;\n this.before = this.phase();\n this.phase.set('retrying');\n this.refusal.set(null);\n this.stopPolling();\n try {\n const answer = await this.call(() => retry(id));\n if (this.disposed) return;\n if (answer && typeof answer.id === 'string') { this.phase.set(this.before); this.apply(answer); } else { this.phase.set(this.before); }\n this.schedulePoll();\n } catch (error) {\n if (this.disposed) return;\n const info = readerErrorInfo(error);\n this.phase.set(this.before);\n // The payment is not open any more (a tap or a cancel happened meanwhile): read it, show its real state.\n if (info.code === 'terminal_not_retryable') { this.refuse(toRefusal(info)); this.pollNow(); return; }\n this.refuse(toRefusal(info.code ? info : { ...info, code: 'retry_unreachable' }));\n this.schedulePoll();\n }\n }\n\n /**\n * Cancels the payment at the service. Resolves true only when the service confirmed the cancel (or already reports the payment canceled). While it runs the payment is `cancelling`; when the\n * service cannot reach the reader or the processor (503 `reader_unreachable`, a lost connection) the payment STAYS open, `cancelUnreachable` is set and the payer may cancel again.\n */\n cancel(): Promise<boolean> {\n if (this.cancelRun) return this.cancelRun;\n const cancel = this.o.cancel();\n const id = this.payment()?.id;\n if (this.disposed || !cancel || !id || !(this.cancellable() || (this.phase() === 'cancelling'))) return Promise.resolve(this.phase() === 'canceled');\n this.cancelRun = this.runCancel(cancel, id).finally(() => { this.cancelRun = null; });\n return this.cancelRun;\n }\n\n private async runCancel(cancel: StripeReaderCancelFn, id: string): Promise<boolean> {\n this.before = this.phase() === 'cancelling' ? this.before : this.phase();\n this.phase.set('cancelling');\n this.cancelUnreachable.set(false);\n this.refusal.set(null);\n this.stopPolling();\n try {\n await this.call(() => cancel(id));\n if (this.disposed) return false;\n this.settle('canceled');\n return true;\n } catch (error) {\n if (this.disposed) return false;\n const info = readerErrorInfo(error);\n this.phase.set(this.before);\n if (info.code === 'payment_being_sent') {\n // The payment is still being sent to the reader: nothing could be canceled yet. Say so (\"wait a moment, then cancel again\"); the poll keeps following it. The service's instruction is `replay_attempt_key`, but a\n // second start is never sent from here: the payment is already known, and the poll (by attempt key) shows its real state. The id of the payment being cancelled is the one already known (a different id in the body is ignored).\n this.refuse(toRefusal(info));\n this.schedulePoll();\n return false;\n }\n if (info.status === 409 && info.code !== 'reader_unreachable') {\n // A tap that already happened (or races the cancel) is recorded as the payment: read the truth now.\n this.pollNow();\n return false;\n }\n this.cancelUnreachable.set(true);\n this.schedulePoll();\n return false;\n }\n }\n\n /** Runs one host call raced against the request timeout: a call that never answers cannot lock the flow forever. A late answer after the timeout is ignored (the next poll reads the truth). */\n private async call<T>(thunk: () => HostResult<T>): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<never>((_, reject) => {\n timer = setTimeout(() => reject(Object.assign(new Error('request timeout'), { status: null, code: '' })), Math.max(1, this.o.requestTimeoutMs?.() ?? STRIPE_READER_REQUEST_TIMEOUT_MS));\n });\n return await Promise.race([callHost(thunk), timeout]);\n } finally { if (timer) clearTimeout(timer); }\n }\n\n /** From `canceled` / `failed`: back to a fresh start (a NEW key, the attempt machine already renewed it). */\n reset(): void {\n if (this.disposed || !(['canceled', 'failed'] as StripeReaderPhase[]).includes(this.phase())) return;\n this.phase.set('idle');\n this.payment.set(null);\n this.refusal.set(null);\n this.cardSave.set(null);\n this.attemptKey.set(null);\n this.elapsedMs.set(0);\n }\n\n /** The input of the last start (the screen re-sends it after \"Start again\"). */\n lastStartInput(): StripeReaderStartInput | null { return this.startInput(); }\n\n // ── Elapsed time ────────────────────────────────────────────────────────\n\n private startTick(): void {\n this.stopTick();\n this.tickTimer = setInterval(() => this.elapsedMs.set(Math.max(0, this.now() - this.startedAt)), 1000);\n }\n\n private stopTick(): void {\n if (this.tickTimer) { clearInterval(this.tickTimer); this.tickTimer = null; }\n }\n\n /** The screen is gone: timers stop. Nothing is cancelled here (the screen decides; a payment that is open stays open at the service and is found again by its attempt key). */\n dispose(): void {\n this.disposed = true;\n this.stopPolling();\n this.stopTick();\n }\n}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject, input, output } from '@angular/core';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent, UiLabelsService, type UiLabelKey } from '@forgeroute/ui/core';\nimport { LiveRegionComponent } from '@forgeroute/ui/live-region';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { readerDegraded, readerDisplayName, type StripeReaderReadiness, type StripeReaderReadinessState } from './stripe-reader.models';\n\n/**\n * The state the banner shows: the service's single readiness state, `loading` while a first read runs, `checking` when there is no usable answer (the read failed, was slow, or the service could not tell), and `attention` when the service says the payment account\n * needs attention. The component NEVER produces a state named `unknown` (the type keeps the member only because the readiness INPUT may carry it).\n */\nexport type StripeReaderBannerState = StripeReaderReadinessState | 'loading' | 'checking' | 'attention';\n\n/**\n * The ONE card-reader banner. It is rendered from the service's single readiness `state` (never from several flags), so a payment screen can never show two reader messages at once:\n *\n * - `merchant_not_ready`: payments are not set up (action: open payment setup); with the reason `reconnect_required` the payment account must be reconnected (\"Reconnect payments\", the same `openSetup` output: the host opens the place where the account is set up / reconnected);\n * - `no_reader` / `unsupported_only`: \"No card reader set up\" with the ONE action \"Get a card reader\" / \"How to get a card reader\" (the host opens its order flow or an info card);\n * - `reader_busy`: \"A payment is waiting on <reader>\" (+ \"Cancel that payment\" when the payment is this screen's own);\n * - `reader_offline`: \"Card reader not connected\" + \"Connect Your Reader\" + \"Check again\";\n * - `checking`: there is no usable answer (the check failed, was too slow, or the service could not tell; nothing is guessed): \"Checking the card reader\" + \"Check again\"; when the service says WHY and it will not fix itself (`degradedReason` `reconnect_required` / `processor_refused`) the state is `attention`: the payment account needs attention (+ \"Reconnect payments\"). There is no state named `unknown`;\n * - `reader_ready`: no banner (a polite announcement only).\n *\n * The component has no HTTP: the host reads the readiness (see `ui-stripe-reader-payment` / `ui-stripe-readers`) and passes it in; the buttons are outputs.\n *\n * <ui-stripe-reader-status [readiness]=\"readiness()\" [loading]=\"loading()\" (connectReader)=\"openPairing()\" (getReader)=\"openOrder()\" (recheck)=\"reload()\" />\n */\n@Component({\n selector: 'ui-stripe-reader-status',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [AlertComponent, ButtonComponent, LiveRegionComponent, SkeletonComponent],\n template: `\n <ui-live-region data-testid=\"reader-status-live\" [message]=\"liveText()\" />\n @switch (state()) {\n @case ('loading') {\n <div class=\"srs-loading\" data-testid=\"reader-status-loading\" [attr.aria-busy]=\"'true'\">\n <ui-skeleton [height]=\"44\" [ariaLabel]=\"labels.t('stripeReader.status.loading')\" />\n </div>\n }\n @case ('reader_ready') { }\n @default {\n <ui-alert [variant]=\"variant()\" [title]=\"title()\" [quiet]=\"true\" class=\"srs-alert\" data-testid=\"reader-status\" [attr.data-state]=\"state()\">\n <p class=\"srs-text\" data-testid=\"reader-status-text\">{{ text() }}</p>\n <div class=\"srs-actions\">\n @if (state() === 'no_reader' || state() === 'unsupported_only') {\n <!-- no reader yet: the ONLY action is how to get one -->\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-status-get\" (click)=\"getReader.emit()\">{{ labels.t(hardwareShopAvailable() ? 'stripeReader.status.get' : 'stripeReader.status.getInfo') }}</ui-button>\n }\n @if (state() === 'merchant_not_ready' || attention()) {\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-status-setup\" (click)=\"openSetup.emit()\">{{ labels.t(reconnect() || attention() ? 'stripeReader.status.reconnect' : 'stripeReader.status.setup') }}</ui-button>\n }\n @if (state() === 'reader_offline' && !hideConnect()) {\n <!-- a reader exists but is not connected: connecting it again is one click -->\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-status-connect\" (click)=\"connectReader.emit()\">{{ labels.t('stripeReader.status.connectYours') }}</ui-button>\n }\n @if (state() === 'reader_offline' || state() === 'checking' || state() === 'attention') {\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-status-recheck\" (click)=\"recheck.emit()\">{{ labels.t('stripeReader.status.recheck') }}</ui-button>\n }\n @if (state() === 'reader_busy') {\n @if (ownBusyPaymentId()) {\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-status-cancel\" [loading]=\"cancelling()\" [disabled]=\"cancelling()\" (click)=\"cancelBusy.emit(ownBusyPaymentId()!)\">{{ labels.t('stripeReader.status.cancelBusy') }}</ui-button>\n }\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-status-recheck\" (click)=\"recheck.emit()\">{{ labels.t('stripeReader.status.recheck') }}</ui-button>\n }\n @if (showManual()) {\n <ui-button variant=\"ghost\" size=\"sm\" data-testid=\"reader-status-manual\" (click)=\"manual.emit()\">{{ labels.t('stripeReader.status.manual') }}</ui-button>\n }\n </div>\n </ui-alert>\n }\n }\n `,\n styles: [`\n ui-stripe-reader-status { display: block; min-width: 0; }\n ui-stripe-reader-status .srs-text { margin: 0 0 8px; }\n ui-stripe-reader-status .srs-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n `],\n})\nexport class StripeReaderStatusComponent {\n protected readonly labels = inject(UiLabelsService);\n\n /** The service's last readiness answer (`null` = none yet or the read failed). */\n readonly readiness = input<StripeReaderReadiness | null>(null);\n /** A read is running and there is no answer to show yet: a skeleton. */\n readonly loading = input(false);\n /** The id of a payment THIS screen started and that holds the reader: the banner then offers \"Cancel that payment\". */\n readonly ownBusyPaymentId = input<string | null>(null);\n /** That cancel is running. */\n readonly cancelling = input(false);\n /** Adds \"Take a manual payment instead\" (a payment screen that has a manual path). */\n readonly showManual = input(false);\n /** Hides \"Connect Your Reader\" (the pairing screen itself shows the banner). */\n readonly hideConnect = input(false);\n /**\n * Library source 2026-11-21 (additive). `true` (default): \"Get a card reader\" opens the host's order flow. `false`: the account cannot order readers in the app, the button reads \"How to get a card reader\" and the host\n * opens an info card instead (the same `getReader` output).\n */\n readonly hardwareShopAvailable = input(true);\n\n /** \"Connect Your Reader\" (`reader_offline`): the host opens its pairing panel (`ui-stripe-readers`). */\n readonly connectReader = output<void>();\n /** \"Get a card reader\": the host opens its order flow. */\n readonly getReader = output<void>();\n /** \"Check again\". */\n readonly recheck = output<void>();\n /** \"Set up payments\": the host opens payment setup. */\n readonly openSetup = output<void>();\n /** \"Cancel that payment\" (the payment id). */\n readonly cancelBusy = output<string>();\n /** \"Take a manual payment instead\". */\n readonly manual = output<void>();\n\n /** Which banner: no answer and loading = `loading`; no answer and not loading = `checking`; a service `checking` (old name `unknown`) = `attention` (reason that will not fix itself) or `checking`; else the service's state. Never `unknown`. */\n readonly state = computed((): StripeReaderBannerState => {\n const r = this.readiness();\n if (!r) return this.loading() ? 'loading' : 'checking';\n if (r.state === 'checking' || r.state === 'unknown') return readerDegraded({ state: 'checking', stale: true, degradedReason: r.degradedReason })?.kind === 'attention' ? 'attention' : 'checking'; // `unknown` = the old name, accepted\n return r.state;\n });\n\n protected readonly variant = computed(() => (this.state() === 'no_reader' || this.state() === 'unsupported_only' || this.state() === 'reader_busy' ? 'info' : 'warning'));\n\n private readonly busyName = computed(() => {\n const r = this.readiness();\n const reader = r?.readers.find(x => x.busy) ?? r?.readers.find(x => x.id === r.defaultReaderId) ?? null;\n return reader ? readerDisplayName(reader) : this.labels.t('stripeReader.theReader');\n });\n\n /** `merchant_not_ready` because the payment account must be reconnected (the service's `reason`). Any other merchant status (onboarding, disconnected...) is \"not set up\". */\n protected readonly reconnect = computed(() => this.state() === 'merchant_not_ready' && this.readiness()?.reason === 'reconnect_required');\n /** The service could not read the processor for a reason that will not fix itself (`reconnect_required`, `processor_refused`): the account needs attention. Transient reasons (and none) stay \"checking, check again\". */\n protected readonly attention = computed(() => this.state() === 'attention');\n /** The label group of the banner: the state, or a more exact one for a reconnect / attention case. */\n private readonly textKey = computed(() => (this.reconnect() ? 'reconnect_required' : this.attention() ? 'stale_attention' : this.state()));\n\n protected readonly title = computed(() => this.labels.t(`stripeReader.status.${this.textKey()}.title` as UiLabelKey));\n protected readonly text = computed(() => this.labels.t(`stripeReader.status.${this.textKey()}.text` as UiLabelKey, { reader: this.busyName() }));\n\n /** What the polite region says: the banner's title (a change of state is announced), \"ready\" for a ready reader, nothing while loading. */\n protected readonly liveText = computed(() => {\n const state = this.state();\n if (state === 'loading') return '';\n if (state === 'reader_ready') {\n const r = this.readiness();\n const reader = r?.readers.find(x => x.id === r.defaultReaderId) ?? r?.readers.find(x => x.supported && x.status === 'online' && !x.busy);\n return this.labels.t('stripeReader.status.reader_ready.live', { reader: reader ? readerDisplayName(reader) : this.labels.t('stripeReader.theReader') });\n }\n return `${this.title()}. ${this.text()}`;\n });\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, ViewEncapsulation, afterNextRender, computed, effect, inject, input, isDevMode, output, signal, untracked } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent, UiLabelsService, type UiLabelKey } from '@forgeroute/ui/core';\nimport { CheckboxComponent } from '@forgeroute/ui/checkbox';\nimport { IconComponent } from '@forgeroute/ui/icon';\nimport { LiveRegionComponent } from '@forgeroute/ui/live-region';\nimport { SelectComponent } from '@forgeroute/ui/select';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { PAYMENT_ATTEMPT_STORAGE, PaymentAttempt, builtInReadinessReasons, callHost, type PaymentAllocation } from '@forgeroute/ui/payments';\nimport { formatCurrency } from '@forgeroute/ui/utils';\nimport type { StripeFees } from '../payment-stripe-method/payment-stripe-method.models';\nimport { STRIPE_READER_LOST_ANSWER_GRACE_MS, STRIPE_READER_REQUEST_TIMEOUT_MS, StripeReaderFlow, type StripeReaderFlowEvent } from './stripe-reader.flow';\nimport { StripeReaderStatusComponent } from './stripe-reader-status.component';\nimport {\n clampReaderPollMs, formatElapsed, isReaderFree, isSafeReceiptUrl, normalizeReadiness, paymentChargedAmount, readerDegraded, readerDisplayName, readerErrorInfo, readerRefusalLabelKey,\n type StripeReaderCancelFn, type StripeReaderFeesFn, type StripeReaderGetPaymentFn, type StripeReaderGetReadinessFn, type StripeReaderPayment, type StripeReaderReadiness,\n type StripeReaderReadinessState, type StripeReaderRetryFn, type StripeReaderSaveCard, type StripeReaderStartFn,\n} from './stripe-reader.models';\n\n/** The readiness states the panel's top banner speaks for: no usable card reader, or a reader that is not connected (\"Your card reader is not connected.\" + \"Connect Your Reader\"). */\nconst STRIPE_READER_NO_READER_STATES: readonly StripeReaderReadinessState[] = ['no_reader', 'unsupported_only', 'merchant_not_ready', 'reader_offline'];\n\n/** What `(succeeded)` reports. */\nexport interface StripeReaderSucceededEvent {\n payment: StripeReaderPayment;\n attemptKey: string;\n /** The amount the payment was STARTED with (major units, before fees). */\n amount: number;\n readerId: string;\n}\n\n/** What `(outcome)` reports, for a host that wants to word a toast or log (the component never toasts). */\nexport type StripeReaderOutcome =\n | { kind: 'started'; payment: StripeReaderPayment }\n | { kind: 'declined'; payment: StripeReaderPayment }\n | { kind: 'canceled' }\n | { kind: 'failed' }\n | { kind: 'refused'; code: string }\n | { kind: 'connection-lost' }\n | { kind: 'connection-restored' }\n /** The panel was closed while the answer of the start was still on its way / lost: the payment is looked up again when the screen opens. The host may word it (\"We are still confirming your payment\"). */\n | { kind: 'left-pending' };\n\n/**\n * Takes a card payment on a Stripe smart reader (S700, S710, WisePOS E): the card reader flow of the payment screen. The HOST owns the calls (it calls its own backend, which calls the\n * payments service; the browser never talks to the service), the component owns the screen and the flow ({@link StripeReaderFlow}):\n *\n * 1. it reads the readiness (ONE state, see `ui-stripe-reader-status`) now and every `readinessEveryMs`, and shows the ONE banner when the reader cannot be used;\n * 2. with `reader_ready` it shows the reader, the amount and the card-reader FEE quote (`estimateFees`, method CARD_PRESENT: cleared at once when the amount changes, \"Send to the reader\"\n * stays off until the quote for the current amount is here), the optional \"Save this card\" consent and \"Send to the reader\";\n * 3. while a payment waits: \"Waiting for the customer to tap, insert or swipe their card on <reader>\", the amount, the fees, the elapsed time and ONLY \"Cancel payment\";\n * 4. a decline shows \"Card declined\" with \"Try again\" (the SAME payment) / \"Cancel payment\" / \"Take a manual payment instead\"; a success shows the receipt link and whether the card was saved.\n *\n * Nothing else can start a payment while one is open (every start button is off, a double click and a second tab are refused by the attempt machine), the attempt key is stable per click and\n * REUSED when the answer is lost, and a lost connection never changes the state shown: the payment is read again by its attempt key when the connection is back. Offline / slow connections\n * block \"Send to the reader\" before it starts (payments are never queued). A manual payment is always one click away (`(manual)`).\n *\n * <ui-stripe-reader-payment [amount]=\"amount()\" payableRef=\"unit:42\" [getReadiness]=\"readiness\" [startPayment]=\"start\" [getPayment]=\"read\" [retryPayment]=\"retry\" [cancelPayment]=\"cancel\"\n * [estimateFees]=\"fees\" (manual)=\"useManual()\" (connectReader)=\"openPairing()\" (getReader)=\"openOrder()\" (succeeded)=\"onPaid($event)\" />\n */\n@Component({\n selector: 'ui-stripe-reader-payment',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [FormsModule, NgTemplateOutlet, AlertComponent, ButtonComponent, CheckboxComponent, IconComponent, LiveRegionComponent, SelectComponent, SkeletonComponent, StripeReaderStatusComponent],\n template: `\n <ui-live-region data-testid=\"reader-live\" [message]=\"announcement()\" />\n @if (blockReason(); as reason) {\n @if (showBlocked()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-blocked\" [attr.data-reason]=\"reason\">{{ blockText() }}</ui-alert>\n }\n } @else if (showReadiness()) {\n <ui-stripe-reader-status [readiness]=\"shownReadiness()\" [loading]=\"readinessLoading() && !readiness()\" [ownBusyPaymentId]=\"busyOwnPaymentId()\" [cancelling]=\"cancellingBusy()\"\n [hideConnect]=\"false\"\n (connectReader)=\"connectReader.emit()\" (getReader)=\"getReader.emit()\" (recheck)=\"loadReadiness()\" (openSetup)=\"openSetup.emit()\" (cancelBusy)=\"cancelBusy($event)\" />\n }\n\n @if (active()) {\n @if (closeBlocked() && flow.locked()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-close-blocked\">{{ labels.t('stripeReader.closeBlocked') }}</ui-alert>\n }\n\n @switch (flow.phase()) {\n @case ('starting') {\n <section class=\"srp-box srp-focus\" data-testid=\"reader-starting\" tabindex=\"-1\" [attr.aria-busy]=\"'true'\">\n <ui-skeleton [height]=\"44\" [ariaLabel]=\"labels.t('stripeReader.starting')\" />\n <p class=\"srp-text\">{{ labels.t('stripeReader.startingText') }}</p>\n @if (waitAmount(); as shown) { <p class=\"srp-text\" data-testid=\"reader-wait-amount\">{{ shown }}</p> }\n <p class=\"srp-elapsed\" data-testid=\"reader-leave-hint\">{{ labels.t('stripeReader.leaveHint') }}</p>\n </section>\n }\n @case ('succeeded') {\n <ui-alert variant=\"success\" [title]=\"labels.t('stripeReader.done.title')\" data-testid=\"reader-succeeded\" tabindex=\"-1\" class=\"srp-focus\">\n <p class=\"srp-text\" data-testid=\"reader-succeeded-text\">{{ succeededText() }}</p>\n @if (cardLine(); as card) { <p class=\"srp-text\" data-testid=\"reader-succeeded-card\">{{ card }}</p> }\n @if (cardSaveText(); as note) { <p class=\"srp-text\" data-testid=\"reader-card-save\" [attr.data-saved]=\"flow.cardSave()?.saved ? 'true' : 'false'\">{{ note }}</p> }\n @if (receiptHref(); as href) {\n <p class=\"srp-text\"><a [href]=\"href\" target=\"_blank\" rel=\"noopener noreferrer\" data-testid=\"reader-receipt\">{{ labels.t('stripeReader.receipt') }}<span class=\"srp-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span></a></p>\n }\n </ui-alert>\n @if (feeRows().length) { <ng-container [ngTemplateOutlet]=\"feeTable\" /> }\n }\n @case ('canceled') {\n <ui-alert variant=\"info\" [title]=\"labels.t('stripeReader.canceled.title')\" data-testid=\"reader-canceled\" tabindex=\"-1\" class=\"srp-focus\">\n <p class=\"srp-text\">{{ labels.t('stripeReader.canceled.text') }}</p>\n <div class=\"srp-actions\">\n @if (manualAvailable()) { <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-take-manual\" (click)=\"manual.emit()\">{{ labels.t('stripeReader.takeManual') }}</ui-button> }\n <ui-button [variant]=\"manualAvailable() ? 'secondary' : 'primary'\" size=\"sm\" data-testid=\"reader-start-again\" (click)=\"startAgain()\">{{ labels.t('stripeReader.startAgain') }}</ui-button>\n </div>\n </ui-alert>\n }\n @case ('failed') {\n <ui-alert variant=\"danger\" [title]=\"labels.t('stripeReader.failed.title')\" data-testid=\"reader-failed\" tabindex=\"-1\" class=\"srp-focus\">\n <p class=\"srp-text\">{{ labels.t('stripeReader.failed.text') }}</p>\n <div class=\"srp-actions\">\n @if (manualAvailable()) { <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-take-manual\" (click)=\"manual.emit()\">{{ labels.t('stripeReader.takeManual') }}</ui-button> }\n <ui-button [variant]=\"manualAvailable() ? 'secondary' : 'primary'\" size=\"sm\" data-testid=\"reader-start-again\" (click)=\"startAgain()\">{{ labels.t('stripeReader.startAgain') }}</ui-button>\n </div>\n </ui-alert>\n }\n @case ('idle') {\n <section class=\"srp-box\" data-testid=\"reader-ready-section\">\n @switch (idleNotice()) {\n @case ('paid') {\n <ui-alert variant=\"info\" [quiet]=\"true\" data-testid=\"reader-paid\">{{ labels.t('stripeReader.refusal.paid') }}</ui-alert>\n }\n @case ('pending-other') {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-pending-other\">{{ labels.t('stripeReader.refusal.outcome_checking') }}</ui-alert>\n }\n @case ('cancel-timeout') {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-cancel-busy-timeout\">{{ labels.t('stripeReader.cancelBusy.timeout') }}\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-cancel-busy-recheck\" (click)=\"dismissCancelTimeout()\">{{ labels.t('stripeReader.status.recheck') }}</ui-button>\n </ui-alert>\n }\n @case ('quote-changed') {\n @if (flow.refusal(); as refusal) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-refusal\" [attr.data-code]=\"refusal.code\">{{ refusalText() }}</ui-alert>\n }\n <div class=\"srp-actions\" role=\"group\" data-testid=\"reader-quote-changed\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-confirm-total\" [disabled]=\"quoting()\" (click)=\"confirmNewTotal()\">{{ labels.t('stripeReader.confirmTotal', { amount: confirmTotalText() }) }}</ui-button>\n </div>\n }\n @case ('refusal') {\n @if (flow.refusal(); as refusal) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-refusal\" [attr.data-code]=\"refusal.code\">{{ refusalText() }}\n @if (existingPaymentHref(); as href) {\n <a [href]=\"href\" target=\"_blank\" rel=\"noopener noreferrer\" data-testid=\"reader-existing-payment\">{{ labels.t('stripeReader.refusal.viewExisting') }}<span class=\"srp-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span></a>\n }\n </ui-alert>\n }\n }\n }\n @if (ready() && !blockReason()) {\n @if (freeReaders().length > 1) {\n <ui-select [label]=\"labels.t('stripeReader.selectReader')\" [options]=\"readerOptions()\" [ngModel]=\"readerId()\" (ngModelChange)=\"selectedReaderId.set($event ?? '')\" data-testid=\"reader-select\" />\n } @else {\n <p class=\"srp-text\" data-testid=\"reader-name\">{{ labels.t('stripeReader.readerLine', { reader: readerName() }) }}</p>\n }\n @if (amount() == null) {\n <p class=\"srp-text\" data-testid=\"reader-amount-needed\">{{ labels.t('stripePaymentMethod.amountNeeded') }}</p>\n }\n @if (feesMissing()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-fees-unavailable\">{{ labels.t('stripeReader.fees.unavailable') }}</ui-alert>\n } @else if (quoteFailed()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-fees-failed\">{{ labels.t('stripeReader.fees.failed') }}\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-fees-retry\" (click)=\"retryQuote()\">{{ labels.t('common.tryAgain') }}</ui-button>\n </ui-alert>\n } @else if (quoting()) {\n <p class=\"srp-text\" data-testid=\"reader-fees-loading\" role=\"status\">{{ labels.t('stripeReader.fees.loading') }}</p>\n }\n @if (feeRows().length) { <ng-container [ngTemplateOutlet]=\"feeTable\" /> }\n @if (saveCard() && !saveUnavailable()) {\n <ui-checkbox [label]=\"labels.t('stripeReader.saveCard.label')\" [hint]=\"consentText()\" [checked]=\"saveChecked()\" (checkedChange)=\"onSaveChange($event)\" testId=\"reader-save-card\" />\n }\n <div class=\"srp-actions\">\n <ui-button variant=\"primary\" data-testid=\"reader-start\" [disabled]=\"!canStart()\" (click)=\"start()\">{{ startLabel() }}</ui-button>\n </div>\n }\n @if (manualAvailable()) {\n <div class=\"srp-actions\">\n <ui-button variant=\"link\" data-testid=\"reader-manual\" (click)=\"manual.emit()\">{{ labels.t('stripeReader.manualInstead') }}</ui-button>\n </div>\n }\n </section>\n }\n @default {\n <!-- Focus lands on this box when it appears; it has NO role and NO accessible name on purpose: the polite live region announces the title and the text, a labelled group would read them a second time. -->\n <section class=\"srp-wait\" data-testid=\"reader-waiting\" [attr.data-phase]=\"flow.phase()\" tabindex=\"-1\">\n <div class=\"srp-wait-head\">\n <span class=\"srp-pulse\" aria-hidden=\"true\" data-testid=\"reader-indicator\"><ui-icon name=\"card\" [size]=\"22\" [interactive]=\"false\" /></span>\n <h3 class=\"srp-title\" data-testid=\"reader-wait-title\">{{ waitTitle() }}</h3>\n </div>\n <p class=\"srp-text\" data-testid=\"reader-wait-text\">{{ waitText() }}</p>\n @if (waitAmount(); as shown) { <p class=\"srp-text\" data-testid=\"reader-wait-amount\">{{ shown }}</p> }\n @if (flow.phase() === 'recovering') { <p class=\"srp-elapsed\" data-testid=\"reader-leave-hint\">{{ labels.t('stripeReader.leaveHint') }}</p> }\n\n @if (flow.connectionLost()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-connection-lost\">{{ labels.t('stripeReader.connectionLost') }}</ui-alert>\n }\n @if (flow.readerOffline() && !flow.connectionLost()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-disconnected\">{{ labels.t('stripeReader.readerDisconnected') }}</ui-alert>\n }\n @if (flow.checking() && !flow.connectionLost()) {\n <ui-alert [variant]=\"degraded()?.kind === 'transient' ? 'info' : 'warning'\" [quiet]=\"true\" data-testid=\"reader-still-checking\" [attr.data-kind]=\"degraded()?.kind ?? 'transient'\">{{ checkingText() }}</ui-alert>\n }\n @if (flow.cancelUnreachable()) {\n <ui-alert variant=\"danger\" [quiet]=\"true\" data-testid=\"reader-cancel-unreachable\">{{ labels.t('stripeReader.cancelUnreachable') }}</ui-alert>\n }\n @if (flow.refusal(); as refusal) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"reader-refusal\" [attr.data-code]=\"refusal.code\">{{ refusalText() }}</ui-alert>\n }\n @if (feeRows().length) { <ng-container [ngTemplateOutlet]=\"feeTable\" /> }\n <p class=\"srp-elapsed\" data-testid=\"reader-elapsed\">{{ labels.t('stripeReader.elapsed', { time: elapsedText() }) }}</p>\n <div class=\"srp-actions\">\n @if (flow.phase() === 'recovering' && flow.recoveryExpired()) {\n <ui-button variant=\"primary\" data-testid=\"reader-recheck\" [loading]=\"flow.rechecking()\" [disabled]=\"flow.rechecking()\" (click)=\"recheck()\">{{ labels.t('stripeReader.status.recheck') }}</ui-button>\n }\n @if (flow.retryable()) {\n <ui-button variant=\"primary\" data-testid=\"reader-retry\" (click)=\"retry()\">{{ labels.t('common.tryAgain') }}</ui-button>\n }\n @if (flow.cancellable() || flow.phase() === 'cancelling') {\n <ui-button [variant]=\"flow.retryable() ? 'secondary' : 'danger'\" data-testid=\"reader-cancel\" [loading]=\"flow.phase() === 'cancelling'\" [disabled]=\"flow.phase() === 'cancelling'\" (click)=\"cancelPayment()\">{{ labels.t('stripeReader.cancel') }}</ui-button>\n }\n @if (flow.retryable() && manualAvailable()) {\n <ui-button variant=\"ghost\" data-testid=\"reader-use-manual\" (click)=\"switchToManual()\">{{ labels.t('stripeReader.takeManual') }}</ui-button>\n }\n </div>\n </section>\n }\n }\n }\n\n <ng-template #feeTable>\n <dl class=\"srp-fees\" data-testid=\"reader-fees\" [attr.aria-label]=\"labels.t('stripePaymentStripeMethod.paymentTotal')\">\n @for (row of feeRows(); track row.key) {\n <div class=\"srp-fee\" [attr.data-testid]=\"'reader-fee-' + row.key\"><dt>{{ row.label }}</dt><dd>{{ row.value }}</dd></div>\n }\n </dl>\n </ng-template>\n `,\n styles: [`\n ui-stripe-reader-payment { display: block; min-width: 0; }\n ui-stripe-reader-payment .srp-box, ui-stripe-reader-payment .srp-wait { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; min-width: 0; }\n ui-stripe-reader-payment .srp-wait { padding: 16px; border: 2px solid var(--ui-psp-border, #cbd5e1); border-radius: 12px; background: var(--ui-psp-sunken, #f8fafc); }\n ui-stripe-reader-payment .srp-wait[data-phase='declined'], ui-stripe-reader-payment .srp-wait[data-phase='stopped'] { border-color: var(--ui-psp-danger, #b91c1c); }\n ui-stripe-reader-payment .srp-wait:focus { outline: none; }\n ui-stripe-reader-payment .srp-wait-head { display: flex; align-items: center; gap: 12px; }\n ui-stripe-reader-payment .srp-title { margin: 0; font-size: 1.0625rem; font-weight: 700; color: var(--ui-psp-text, #1e293b); }\n ui-stripe-reader-payment .srp-text, ui-stripe-reader-payment .srp-elapsed { margin: 0; font-size: 0.9375rem; color: var(--ui-psp-text, #1e293b); }\n ui-stripe-reader-payment .srp-elapsed { font-size: 0.8125rem; color: var(--ui-psp-muted, #475569); font-variant-numeric: tabular-nums; }\n ui-stripe-reader-payment .srp-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n ui-stripe-reader-payment .srp-focus:focus { outline: none; }\n ui-stripe-reader-payment .srp-pulse { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ui-psp-text, #1e293b); border: 2px solid currentColor; animation: srp-pulse 1.6s ease-in-out infinite; }\n ui-stripe-reader-payment .srp-fees { margin: 0; padding: 12px 14px; border: 1px solid var(--ui-psp-border, #e2e8f0); border-radius: 10px; font-size: 0.8125rem; }\n ui-stripe-reader-payment .srp-fee { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--ui-psp-muted, #475569); }\n ui-stripe-reader-payment .srp-fee dt, ui-stripe-reader-payment .srp-fee dd { margin: 0; }\n ui-stripe-reader-payment .srp-fee:last-child { font-weight: 700; color: var(--ui-psp-text, #1e293b); }\n ui-stripe-reader-payment .srp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }\n @keyframes srp-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.94); } }\n @media (prefers-reduced-motion: reduce) { ui-stripe-reader-payment .srp-pulse { animation: none; } }\n @media (forced-colors: active) { ui-stripe-reader-payment .srp-wait, ui-stripe-reader-payment .srp-fees { border-color: CanvasText; } }\n `],\n})\nexport class StripeReaderPaymentComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly storage = inject(PAYMENT_ATTEMPT_STORAGE);\n\n // ── Inputs: what is paid ─────────────────────────────────────────────────\n /** The amount the customer owes before fees, major units. `null` = nothing to take yet. */\n readonly amount = input<number | null>(null);\n readonly currency = input('USD');\n /** The payable (an invoice, a balance): the attempt marker is stored under it, so a reload or a second tab finds an open payment instead of starting another. */\n readonly payableRef = input<string | null>(null);\n /** A key the host supplies; empty = derived from the payable / generated by the attempt machine. */\n readonly attemptKey = input<string | null>(null);\n /** The payable is paid (host re-render): no payment can start. */\n readonly paid = input(false);\n /** Extra fields the host's backend wants with the start (the payment panel passes its date, note and allocation). */\n readonly startExtras = input<{ receivedDate?: string; notes?: string | null; allocation?: PaymentAllocation } | null>(null);\n\n // ── Inputs: the host's calls (see docs/card-readers.md) ─────────────────\n readonly getReadiness = input<StripeReaderGetReadinessFn | null>(null);\n readonly startPayment = input<StripeReaderStartFn | null>(null);\n readonly getPayment = input<StripeReaderGetPaymentFn | null>(null);\n readonly retryPayment = input<StripeReaderRetryFn | null>(null);\n readonly cancelPaymentFn = input<StripeReaderCancelFn | null>(null, { alias: 'cancelPayment' });\n /** The CARD_PRESENT fee quote. REQUIRED: a reader payment always shows the card reader fee breakdown before the tap, so without it \"Send to the reader\" stays off and says the fees are not available. */\n readonly estimateFees = input<StripeReaderFeesFn | null>(null);\n readonly receiptUrl = input<((payment: StripeReaderPayment) => string | null | undefined) | null>(null);\n /** Turns on \"Save this card for future payments\" (the consent the staff records at the counter). */\n readonly saveCard = input<StripeReaderSaveCard | null>(null);\n /** The id of an open reader payment THIS user owns (from the host's records): with it the \"reader busy\" banner offers \"Cancel that payment\". */\n readonly ownPaymentId = input<string | null>(null);\n\n // ── Inputs: behaviour ───────────────────────────────────────────────────\n /** `true` = the full reader screen; `false` = only the banner (the payment screen is in manual mode but still tells that a reader could be used). */\n readonly active = input(true);\n /** A manual payment path exists: \"Enter the card manually instead\" / \"Take a manual payment instead\" show and the offline text says a manual payment can still be recorded. */\n readonly manualAvailable = input(true);\n /** The buttons that start something do nothing (a read-only user). Cancel stays possible. */\n readonly disabled = input(false);\n /**\n * Library 2026-11-21 (additive; NOT set by the payment panel's Stripe body, so nothing in the library uses it): `true` draws NO \"checking\" placeholder while there is no usable answer (a usable answer, or a payment, is still drawn here).\n * It is for a host that shows its own checking text elsewhere. NOTE: `ui-stripe-reader-banner` (the payment panel's top banner) shows NOTHING while the read is pending, failed or `checking`, so with `hideChecking` nobody speaks for that state.\n * Default `false`: the screen shows its own checking state with \"Check again\" (also inside the payment panel).\n */\n readonly hideChecking = input(false);\n /**\n * Library 2026-11-21 (additive): the payment panel's top banner (`ctx.readerBanner`) is ALWAYS on screen and shows the \"get a card reader\" message when the organization has NO usable reader. With this input this screen draws no readiness banner for\n * those states (`no_reader`, `unsupported_only`, `merchant_not_ready`, and `reader_offline`: \"not connected\" + \"Connect Your Reader\") so the message never shows twice, and keeps everything else: its own \"checking\", busy (with \"Cancel that payment\"), connection notices, the reader choice, fees, \"Send to the reader\" and the\n * payment boxes. A standalone host that keeps `ui-stripe-reader-banner` above its tab bar passes it too. Default `false`.\n */\n readonly hideBanner = input(false);\n /** Asked right before \"Send to the reader\" starts anything; `false` = do not start (the payment panel validates its own fields here and shows their messages). */\n readonly beforeStart = input<(() => boolean) | null>(null);\n readonly readinessEveryMs = input(15_000);\n readonly readinessTimeoutMs = input(4000);\n /** How often the waiting payment's status is read (ms; default 2000). Clamped to 500..30 000 ms. */\n readonly pollMs = input(2000);\n readonly pollTimeoutMs = input(8000);\n /** After a lost start answer (or an adopted attempt) the service's \"no payment for this attempt key\" is believed only after this long, counted from the moment recovery starts. Default 6 minutes: the service's 5-minute create window plus a minute (ms). */\n readonly lostAnswerGraceMs = input(STRIPE_READER_LOST_ANSWER_GRACE_MS);\n /** A start / retry / cancel call slower than this is unreachable (ms): a start is looked up by its attempt key, a retry / cancel leaves the payment as it was. */\n readonly requestTimeoutMs = input(STRIPE_READER_REQUEST_TIMEOUT_MS);\n /** A quote slower than this: \"Try again\" is offered and Send stays off (ms). */\n readonly feeTimeoutMs = input(10_000);\n /** Managed environments where `navigator.onLine === false` is a false negative: the browser's offline flag does not block (default false). */\n readonly offlineOverride = input(false);\n\n // ── Outputs ─────────────────────────────────────────────────────────────\n /** The user wants to enter the card manually (the host switches its method). Emitted only when nothing is waiting on the reader. */\n readonly manual = output<void>();\n /** \"Connect Your Reader\": the host opens its pairing panel. */\n readonly connectReader = output<void>();\n /** \"Get a card reader\": the host opens its order flow. */\n readonly getReader = output<void>();\n /** \"Set up payments\": the host opens payment setup. */\n readonly openSetup = output<void>();\n /** The payment succeeded. */\n readonly succeeded = output<StripeReaderSucceededEvent>();\n /** Everything else that happened, for the host to word. */\n readonly outcome = output<StripeReaderOutcome>();\n /** A readiness read finished: its state (`null` = no answer / the read failed). The payment panel's FIRST answer decides whether the reader is the default. */\n readonly readinessChange = output<StripeReaderReadinessState | null>();\n /** A payment is open on the reader (starting, waiting, declined, cancelling...): the host locks everything else. */\n readonly busyChange = output<boolean>();\n\n // ── State ───────────────────────────────────────────────────────────────\n readonly readiness = signal<StripeReaderReadiness | null>(null);\n protected readonly readinessLoading = signal(false);\n readonly selectedReaderId = signal('');\n readonly saveChecked = signal(false);\n /** The card cannot be kept on this account (`terminal_save_needs_direct`): the choice is hidden, the payment can still be taken. */\n protected readonly saveUnavailable = signal(false);\n /** `quote_changed`: the total shown is not the total any more; Send stays off until the payer confirms the new one. */\n protected readonly quoteChanged = signal<{ total: number | null } | null>(null);\n readonly closeBlocked = signal(false);\n protected readonly cancellingBusy = signal(false);\n /** The \"Cancel that payment\" call did not answer in time: the payment may still be open (a notice with \"Check again\" shows instead of the banner). */\n protected readonly cancelTimedOut = signal(false);\n protected readonly quote = signal<StripeFees | null>(null);\n /** The amount the quote was asked for (a quote is shown only while it matches the amount on screen). */\n private readonly quotedFor = signal<number | null>(null);\n protected readonly quoting = signal(false);\n protected readonly quoteFailed = signal(false);\n private readonly quoteTick = signal(0);\n private quoteRun = 0;\n /** What the held quote was asked for: a phase change alone (a refusal, a canceled payment) keeps a held quote of the same amount; the service still checks the total (`quote_changed`). */\n private heldEstimate: unknown = null;\n private heldAmount: number | null | undefined = undefined;\n private heldTick = -1;\n private readonly builtIns = signal<string[]>([]);\n\n readonly attempt = new PaymentAttempt({\n destroyRef: this.destroyRef,\n payableRef: () => this.payableRef(),\n amount: () => this.amount(),\n method: () => 'CARD_PRESENT',\n attemptKey: () => this.attemptKey(),\n checkStatus: () => null,\n paid: () => this.paid(),\n offlineMidFlight: false,\n offlineOverride: () => this.offlineOverride(),\n storage: this.storage,\n });\n\n readonly flow = new StripeReaderFlow({\n attempt: this.attempt,\n start: () => this.startPayment(),\n getPayment: () => this.getPayment(),\n retry: () => this.retryPayment(),\n cancel: () => this.cancelPaymentFn(),\n pollMs: () => clampReaderPollMs(this.pollMs()),\n pollTimeoutMs: () => this.pollTimeoutMs(),\n lostAnswerGraceMs: () => this.lostAnswerGraceMs(),\n requestTimeoutMs: () => this.requestTimeoutMs(),\n onEvent: event => this.onFlowEvent(event),\n });\n\n /** The user pressed a button that changes the screen: when the phase changes, focus moves to the new box (the pressed button is gone). */\n private acted = false;\n private lastPhase = this.flow.phase();\n private destroyed = false;\n private readRun = 0;\n private readTimer: ReturnType<typeof setTimeout> | null = null;\n\n protected readonly ready = computed(() => this.readiness()?.state === 'reader_ready');\n protected readonly freeReaders = computed(() => (this.readiness()?.readers ?? []).filter(isReaderFree));\n protected readonly readerId = computed(() => {\n const free = this.freeReaders();\n const chosen = this.selectedReaderId();\n if (chosen && free.some(r => r.id === chosen)) return chosen;\n const def = this.readiness()?.defaultReaderId;\n if (def && free.some(r => r.id === def)) return def;\n return free[0]?.id ?? '';\n });\n protected readonly readerOptions = computed(() => this.freeReaders().map(r => ({ value: r.id, label: r.model && r.label ? `${readerDisplayName(r)} (${r.model})` : readerDisplayName(r) })));\n /** The name of the reader the payment is (or would be) on. */\n protected readonly readerName = computed(() => {\n const id = this.flow.terminal()?.readerId ?? this.readerId();\n const readers = this.readiness()?.readers ?? [];\n return readerDisplayName(readers.find(r => r.id === id) ?? null) || this.labels.t('stripeReader.theReader');\n });\n /** Why a reader payment cannot be started before it starts: offline, a slow connection, a browser that cannot pay safely. Empty = none. */\n protected readonly blockReason = computed((): '' | 'offline' | 'slow_connection' | 'unsupported_browser' => {\n if (this.attempt.blockedOffline()) return 'offline';\n const reasons = this.builtIns();\n if (reasons.includes('slow_connection')) return 'slow_connection';\n if (reasons.includes('unsupported_browser')) return 'unsupported_browser';\n return '';\n });\n protected readonly blockText = computed(() => {\n switch (this.blockReason()) {\n case 'offline': return this.labels.t(this.manualAvailable() ? 'stripeReader.offline.withManual' : 'stripeReader.offline.noManual');\n case 'slow_connection': return this.labels.t('paymentReadiness.slow_connection');\n case 'unsupported_browser': return this.labels.t('paymentReadiness.unsupported_browser');\n default: return '';\n }\n });\n /** No fee quote call: a reader payment must always show the CARD_PRESENT breakdown before the tap, so nothing can be sent. */\n protected readonly feesMissing = computed(() => !this.estimateFees());\n /**\n * The ONE message block of the idle screen, by precedence: already paid > an earlier payment still being confirmed > a cancel that timed out > the total changed > a refusal of the last start. The readiness banner and\n * the \"blocked\" notice show only when none of these does (and never in the canceled / failed boxes).\n */\n protected readonly idleNotice = computed((): 'paid' | 'pending-other' | 'cancel-timeout' | 'quote-changed' | 'refusal' | null => {\n if (!this.active() || this.flow.phase() !== 'idle') return null;\n if (this.attempt.paidLocked()) return 'paid';\n if (this.foreignPending()) return 'pending-other';\n if (this.cancelTimedOut()) return 'cancel-timeout';\n if (this.quoteChanged()) return 'quote-changed';\n if (this.flow.refusal()) return 'refusal';\n return null;\n });\n protected readonly showBlocked = computed(() => this.active() && this.flow.phase() === 'idle' && !this.idleNotice());\n /**\n * Library source 2026-11-21: this screen is showing a card reader message of its own right now (the readiness banner, a connection notice, one of the idle notices, or a payment box), so a second reader banner elsewhere\n * on the page must step aside. `false` when it shows nothing about the reader (a ready reader and an idle screen). Mirrors the template exactly (with `hideBanner` the no-reader states are not drawn here, so they do not count).\n */\n readonly ownsReaderMessage = computed(() => {\n if (this.flow.phase() !== 'idle' || this.flow.locked()) return true;\n if (this.idleNotice()) return true;\n if (this.blockReason()) return this.showBlocked();\n return this.showReadiness() && this.shownReadiness()?.state !== 'reader_ready';\n });\n /**\n * The readiness the banner is drawn from: a usable answer only. No answer (loading, failed, slow) and a service `checking` (old name `unknown`) that does not need the account's attention are NOT shown as a state of their own (there is no \"unknown\" banner): `null`, and the status component's \"Checking the card reader\" placeholder speaks (unless the host set `hideChecking`; the top banner never speaks for that state).\n */\n protected readonly shownReadiness = computed((): StripeReaderReadiness | null => {\n const r = this.readiness();\n if (!r) return null;\n if ((r.state === 'checking' || r.state === 'unknown') && readerDegraded({ state: 'checking', stale: true, degradedReason: r.degradedReason })?.kind !== 'attention') return null;\n return r;\n });\n protected readonly showReadiness = computed(() => {\n if (this.flow.locked() || this.flow.phase() === 'succeeded') return false;\n if (!this.shownReadiness() && this.hideChecking()) return false; // no usable answer: the panel's top banner speaks, nothing of our own\n if (this.hideBanner() && STRIPE_READER_NO_READER_STATES.includes(this.shownReadiness()?.state as StripeReaderReadinessState)) return false; // the top banner speaks for these states (get a reader / connect your reader)\n return this.active() ? this.flow.phase() === 'idle' && !this.idleNotice() : true;\n });\n /** The own payment that holds a reader, when the host knows it. */\n protected readonly busyOwnPaymentId = computed(() => {\n const id = this.ownPaymentId();\n return id && (this.readiness()?.readers ?? []).some(r => r.busyPaymentId === id) ? id : null;\n });\n private readonly amountValid = computed(() => { const a = this.amount(); return a != null && Number.isFinite(a) && a > 0; });\n /** The quote of the amount on screen (a quote for another amount is never shown). */\n protected readonly currentQuote = computed(() => (this.quotedFor() === this.amount() ? this.quote() : null));\n protected readonly feeRows = computed(() => {\n const fees = this.currentQuote();\n const amount = this.flow.locked() || this.flow.phase() === 'succeeded' ? (this.flow.baseAmount() ?? this.amount()) : this.amount();\n if (!fees || amount == null || (fees.stripeFee === undefined && fees.platformFee === undefined && fees.totalAmount === undefined)) return [];\n const money = (n: number) => formatCurrency(n, { currency: this.currency() });\n const rows: { key: string; label: string; value: string }[] = [{ key: 'amount', label: this.labels.t('stripePaymentMethod.paymentAmount'), value: money(amount) }];\n if (fees.stripeFee !== undefined) rows.push({ key: 'processing', label: `${this.labels.t('stripePaymentMethod.processingFee')}${fees.stripeFeeLabel ? ` (${fees.stripeFeeLabel})` : ''}`, value: money(fees.stripeFee) });\n if (fees.platformFee !== undefined) rows.push({ key: 'platform', label: `${this.labels.t('stripePaymentMethod.platformFee')}${fees.platformFeeLabel ? ` (${fees.platformFeeLabel})` : ''}`, value: money(fees.platformFee) });\n if (fees.totalAmount !== undefined) rows.push({ key: 'total', label: this.labels.t('stripePaymentStripeMethod.totalCharged'), value: money(fees.totalAmount) });\n return rows;\n });\n /** Everything that must be true before \"Send to the reader\" works. */\n readonly canStart = computed(() =>\n this.active() && this.ready() && !this.blockReason() && !!this.readerId() && this.amountValid() && !this.disabled() && !this.paid() && !this.flow.locked()\n && this.flow.phase() !== 'succeeded' && !this.attempt.locked() && !this.quoting() && !this.quoteFailed() && !this.feesMissing() && !!this.currentQuote() && !this.quoteChanged());\n protected readonly startLabel = computed(() => (this.amount() != null && this.amountValid()\n ? this.labels.t('stripeReader.start', { amount: formatCurrency(this.currentQuote()?.totalAmount ?? this.amount(), { currency: this.currency() }) })\n : this.labels.t('stripeReader.startNoAmount')));\n /** The sentence the staff attests by ticking the box (the host's `consentText`, else the library default) plus the fee clause when the payer pays fees. `saveCard.textVersion` must name exactly this text. */\n protected readonly consentText = computed(() => {\n const cfg = this.saveCard();\n const base = cfg?.consentText || this.labels.t('stripeReader.saveCard.consent');\n return cfg?.customerPaysFees ? `${base} ${this.labels.t('stripeReader.saveCard.consentFees')}` : base;\n });\n /** A reload / second tab found an undecided attempt of ANOTHER method (a manual card): it is never followed as a reader payment, only worded. */\n protected readonly foreignPending = computed(() => this.attempt.unknown() && !this.flow.locked() && this.flow.phase() === 'idle' && this.attempt.pinnedMethod() !== 'CARD_PRESENT');\n protected readonly degraded = computed(() => readerDegraded(this.flow.terminal()));\n protected readonly checkingText = computed(() => {\n const d = this.degraded();\n if (d?.kind === 'attention') return this.labels.t('stripeReader.degraded.attention');\n if (d?.kind === 'since') return this.labels.t('stripeReader.degraded.since', { time: d.since });\n return this.labels.t('stripeReader.stillChecking');\n });\n /** What was actually charged (the service's `amountCents`), else the quote total of the open payment; `null` when neither is known. */\n private readonly chargedTotal = computed((): number | null => paymentChargedAmount(this.flow.payment()) ?? (this.flow.locked() || this.flow.phase() === 'succeeded' ? this.currentQuote()?.totalAmount ?? null : null));\n /** The amount line of the waiting screen: the total when known, else the base amount (fees may be added). Always present once an amount is known, quote or not (also after a reload that adopted the payment). */\n protected readonly waitAmount = computed(() => {\n const money = (n: number) => formatCurrency(n, { currency: this.currency() });\n const total = this.chargedTotal();\n if (total != null) return this.labels.t('stripeReader.wait.amount', { amount: money(total) });\n const base = this.flow.baseAmount();\n return base != null ? this.labels.t('stripeReader.wait.amountBase', { amount: money(base) }) : '';\n });\n protected readonly confirmTotalText = computed(() => { const total = this.currentQuote()?.totalAmount ?? this.quoteChanged()?.total ?? null; return total == null ? '' : formatCurrency(total, { currency: this.currency() }); });\n protected readonly existingPaymentHref = computed(() => {\n const refusal = this.flow.refusal();\n if (refusal?.code !== 'duplicate_suspected' || !refusal.paymentId) return null;\n const url = this.receiptUrl()?.({ id: refusal.paymentId });\n return isSafeReceiptUrl(url) ? url : null;\n });\n protected readonly elapsedText = computed(() => formatElapsed(this.flow.elapsedMs()));\n protected readonly waitTitle = computed(() => this.labels.t(`stripeReader.wait.${this.waitKey()}.title` as UiLabelKey));\n protected readonly waitText = computed(() => {\n const t = this.flow.terminal();\n if (this.waitKey() === 'declined' && t?.message) return t.message;\n return this.labels.t(`stripeReader.wait.${this.waitKey()}.text` as UiLabelKey, { reader: this.readerName() });\n });\n private readonly waitKey = computed((): 'waiting' | 'declined' | 'stopped' | 'retrying' | 'cancelling' | 'recovering' | 'unconfirmed' => {\n const p = this.flow.phase();\n if (p === 'recovering' && this.flow.recoveryExpired()) return 'unconfirmed';\n return p === 'declined' || p === 'stopped' || p === 'retrying' || p === 'cancelling' || p === 'recovering' ? p : 'waiting';\n });\n protected readonly refusalText = computed(() => {\n const refusal = this.flow.refusal();\n if (!refusal) return '';\n if (refusal.code === 'quote_changed') {\n return typeof refusal.amountCents === 'number'\n ? this.labels.t('stripeReader.refusal.quote_changed', { amount: formatCurrency(refusal.amountCents / 100, { currency: this.currency() }) })\n : this.labels.t('stripeReader.refusal.quote_changedNoAmount');\n }\n const key = readerRefusalLabelKey(refusal.code);\n return key ? this.labels.t(key) : refusal.message || this.labels.t('stripeReader.refusal.generic');\n });\n protected readonly succeededText = computed(() => {\n // What was actually charged (the service's own total), else the quote the payer saw, else the base amount; never a made-up 0.\n const amount = this.chargedTotal() ?? this.flow.baseAmount() ?? this.amount();\n return amount == null\n ? this.labels.t('stripeReader.done.textNoAmount', { reader: this.readerName() })\n : this.labels.t('stripeReader.done.text', { amount: formatCurrency(amount, { currency: this.currency() }), reader: this.readerName() });\n });\n protected readonly cardLine = computed(() => {\n const p = this.flow.payment();\n return p?.last4 ? this.labels.t('stripeReader.done.card', { brand: p.brand ? String(p.brand).replace(/^./, c => c.toUpperCase()) : this.labels.t('stripeReader.done.cardWord'), last4: p.last4 }) : '';\n });\n /** What happened to the \"save this card\" choice: never \"saved\" unless the service says so. */\n protected readonly cardSaveText = computed(() => {\n const save = this.flow.cardSave();\n if (save?.saved) return this.labels.t('stripeReader.cardSaved');\n // Saving was asked for (the service says so, or this screen asked and the service did not answer `cardSave`): never claimed as saved, always \"not confirmed\".\n if (save?.requested || (!save && !!this.flow.startInput()?.save)) return this.labels.t('stripeReader.cardNotSaved');\n return '';\n });\n protected readonly receiptHref = computed(() => {\n const payment = this.flow.payment();\n const url = payment ? this.receiptUrl()?.(payment) : null;\n return isSafeReceiptUrl(url) ? url : null;\n });\n /** What the polite region says: one text, the most important thing first, changing with every state. */\n protected readonly announcement = computed(() => {\n const phase = this.flow.phase();\n if (!this.active()) return ''; // manual mode: the reader is only a banner, the manual form speaks for the page\n if (this.blockReason() && !this.flow.locked() && phase !== 'succeeded') return this.blockText();\n if (this.closeBlocked() && this.flow.locked()) return this.labels.t('stripeReader.closeBlocked');\n if (phase === 'idle') return this.foreignPending() ? this.labels.t('stripeReader.refusal.outcome_checking') : '';\n if (phase === 'starting') return this.labels.t('stripeReader.startingText');\n if (phase === 'succeeded') return ''; // the success alert is the announcement (a second one here would say it twice, and with another amount)\n if (phase === 'canceled') return `${this.labels.t('stripeReader.canceled.title')}. ${this.labels.t('stripeReader.canceled.text')}`;\n if (phase === 'failed') return `${this.labels.t('stripeReader.failed.title')}. ${this.labels.t('stripeReader.failed.text')}`;\n if (this.flow.cancelUnreachable()) return this.labels.t('stripeReader.cancelUnreachable');\n if (this.flow.connectionLost()) return this.labels.t('stripeReader.connectionLost');\n if (this.flow.readerOffline()) return this.labels.t('stripeReader.readerDisconnected');\n if (this.flow.checking()) return this.checkingText();\n return `${this.waitTitle()}. ${this.waitText()}`;\n });\n\n constructor() {\n this.refreshBuiltIns();\n if (typeof window !== 'undefined') {\n const refresh = (): void => this.refreshBuiltIns();\n window.addEventListener('online', refresh);\n window.addEventListener('offline', refresh);\n this.destroyRef.onDestroy(() => { window.removeEventListener('online', refresh); window.removeEventListener('offline', refresh); });\n }\n this.destroyRef.onDestroy(() => { this.destroyed = true; this.flow.dispose(); if (this.readTimer) clearTimeout(this.readTimer); this.quoteRun++; });\n // The readiness is read as soon as the host gave the call, then every `readinessEveryMs` (and again after a payment ends).\n effect(() => { const read = this.getReadiness(); untracked(() => { if (read) void this.loadReadiness(); }); });\n effect(() => { const locked = this.flow.locked(); untracked(() => { this.busyChange.emit(locked); if (!locked) this.closeBlocked.set(false); }); });\n effect(() => {\n const phase = this.flow.phase();\n untracked(() => {\n const changed = phase !== this.lastPhase;\n this.lastPhase = phase;\n if (changed && this.acted && phase !== 'idle') { this.acted = false; afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('[data-testid=\"reader-starting\"], [data-testid=\"reader-waiting\"], [data-testid=\"reader-succeeded\"], [data-testid=\"reader-canceled\"], [data-testid=\"reader-failed\"]')?.focus(), { injector: this.injector }); }\n });\n });\n effect(() => { const phase = this.flow.phase(); untracked(() => { if (phase === 'canceled' || phase === 'failed' || phase === 'succeeded') void this.loadReadiness(); }); });\n // A reload / a second tab found an open attempt of this payable: look its payment up (never start another). The marker is per PAYABLE, not per method: only a card READER attempt is followed on the terminal\n // channel; a manual card attempt is worded (\"still confirming an earlier payment\") and keeps Send off, but is never polled as a reader payment.\n effect(() => {\n const unknown = this.attempt.unknown();\n const method = this.attempt.pinnedMethod();\n untracked(() => { if (unknown && method === 'CARD_PRESENT' && !this.flow.locked() && this.flow.phase() === 'idle') this.flow.adopt(); });\n });\n // `quote_changed`: the total shown is stale. The quote is asked again at once and Send stays off until the payer confirms the new total. `terminal_save_needs_direct`: keeping the card is impossible on this account.\n effect(() => {\n const refusal = this.flow.refusal();\n untracked(() => {\n if (refusal?.code === 'quote_changed') { this.quoteChanged.set({ total: typeof refusal.amountCents === 'number' ? refusal.amountCents / 100 : null }); this.quoteTick.update(n => n + 1); }\n if (refusal?.code === 'terminal_save_needs_direct') { this.saveUnavailable.set(true); this.saveChecked.set(false); }\n });\n });\n // The consent belongs to ONE start: after a canceled / failed payment the box is cleared (the staff attest again; the timestamp is taken at every start).\n effect(() => { const phase = this.flow.phase(); untracked(() => { if (phase === 'canceled' || phase === 'failed') this.saveChecked.set(false); }); });\n // Another amount is another quote: the \"confirm the new total\" step is over.\n effect(() => { this.amount(); untracked(() => this.quoteChanged.set(null)); });\n // Without a payable reference the reload / second-tab protection cannot work (the marker is stored under it).\n effect(() => { const ref = this.payableRef(); untracked(() => { if (isDevMode() && ref == null) console.warn('[ui-stripe-reader-payment] payableRef is not set: a reload or a second tab cannot find an open reader payment, so the duplicate protection only covers this page instance.'); }); });\n effect(() => { const estimate = this.estimateFees(); untracked(() => { if (isDevMode() && !estimate) console.warn('[ui-stripe-reader-payment] estimateFees is not set: a reader payment must show the card reader fee breakdown before the tap.'); }); });\n // The browser's own offline / online events while a payment is open.\n effect(() => { const offline = this.attempt.offline(); untracked(() => { if (this.flow.locked()) this.flow.markConnection(!offline); }); });\n // The fee quote: cleared AT ONCE when the amount changes (a quote for another amount is never shown), asked again after a short pause, and Send stays off until the quote of the current amount arrives.\n effect(onCleanup => {\n const estimate = this.estimateFees();\n const amount = this.amount();\n const tick = this.quoteTick();\n const phase = this.flow.phase();\n const active = this.active();\n if (phase !== 'idle' && phase !== 'canceled' && phase !== 'failed') return; // while a payment is open (or done) the quote on screen belongs to it\n if (!active) { this.heldTick = -1; untracked(() => { this.quote.set(null); this.quotedFor.set(null); this.quoteFailed.set(false); this.quoting.set(false); }); return; } // the reader is only a banner (manual mode): no card-present quote is asked\n // Only the phase moved (a refusal or a canceled payment brought the screen back): the quote held for this very amount is still the one to show. Anything else (another amount, another call, \"Try again\", a changed total) asks again.\n const unchanged = estimate === this.heldEstimate && amount === this.heldAmount && tick === this.heldTick;\n if (unchanged && untracked(() => !!this.quote() && this.quotedFor() === amount)) return;\n this.heldEstimate = estimate; this.heldAmount = amount; this.heldTick = tick;\n const run = ++this.quoteRun;\n untracked(() => { this.quote.set(null); this.quotedFor.set(null); this.quoteFailed.set(false); this.quoting.set(false); });\n if (!estimate || amount == null || !Number.isFinite(amount) || amount <= 0) return;\n untracked(() => this.quoting.set(true));\n let hung: ReturnType<typeof setTimeout> | null = null;\n const timer = setTimeout(async () => {\n hung = setTimeout(() => { if (run === this.quoteRun) { this.quoting.set(false); this.quoteFailed.set(true); } }, Math.max(1, this.feeTimeoutMs()));\n let fees: StripeFees | null = null;\n try { fees = (await callHost(() => estimate({ amount, paymentMethod: 'CARD_PRESENT', paymentMethodType: 'card_present' }))) ?? null; } catch { fees = null; }\n if (hung) { clearTimeout(hung); hung = null; }\n if (this.destroyed || run !== this.quoteRun) return;\n this.quoting.set(false);\n if (fees) { this.quote.set(fees); this.quotedFor.set(amount); this.quoteFailed.set(false); } else { this.quote.set(null); this.quotedFor.set(null); this.quoteFailed.set(true); }\n }, 300);\n onCleanup(() => { clearTimeout(timer); if (hung) clearTimeout(hung); });\n });\n }\n\n private refreshBuiltIns(): void { this.builtIns.set(builtInReadinessReasons(this.offlineOverride())); }\n\n // ── Readiness ───────────────────────────────────────────────────────────\n\n /** Reads the readiness now (\"Check again\"). A slow (over `readinessTimeoutMs`) or failed read leaves NO answer: the banner says it could not be checked and nothing is started. */\n async loadReadiness(): Promise<void> {\n const read = this.getReadiness();\n if (!read || this.destroyed) return;\n if (this.readTimer) { clearTimeout(this.readTimer); this.readTimer = null; }\n const run = ++this.readRun;\n this.readinessLoading.set(true);\n let result: StripeReaderReadiness | null = null;\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<'timeout'>(resolve => { timer = setTimeout(() => resolve('timeout'), this.readinessTimeoutMs()); });\n const raw = await Promise.race([callHost(() => read()), timeout]);\n result = raw === 'timeout' ? null : normalizeReadiness(raw);\n } catch { result = null; } finally { if (timer) clearTimeout(timer); }\n if (this.destroyed || run !== this.readRun) return;\n this.readinessLoading.set(false);\n this.readiness.set(result);\n this.readinessChange.emit(result?.state ?? null);\n this.scheduleReadiness();\n }\n\n private scheduleReadiness(): void {\n if (this.destroyed) return;\n if (this.readTimer) clearTimeout(this.readTimer);\n this.readTimer = setTimeout(() => { this.readTimer = null; if (this.flow.locked()) this.scheduleReadiness(); else void this.loadReadiness(); }, Math.max(1, this.readinessEveryMs()));\n }\n\n // ── Actions ─────────────────────────────────────────────────────────────\n\n /** \"Send to the reader\". Synchronous up to the attempt lock: a double click sends ONE payment. */\n start(): void {\n this.refreshBuiltIns();\n if (!this.canStart()) return;\n const before = this.beforeStart();\n if (before && !before()) return;\n const amount = this.amount() as number;\n const cfg = this.saveCard();\n // The consent time is taken at THIS start (never a timestamp from an earlier, canceled or declined payment).\n const save = cfg && this.saveChecked() && !this.saveUnavailable()\n ? { customerRef: cfg.customerRef, consent: { textVersion: cfg.textVersion, acceptedAt: new Date().toISOString(), recordedBy: cfg.recordedBy } }\n : null;\n const total = this.currentQuote()?.totalAmount;\n this.closeBlocked.set(false);\n void this.flow.start({\n readerId: this.readerId(), amount, payableRef: this.payableRef(), save, extras: this.startExtras() ?? undefined,\n ...(total !== undefined && Number.isFinite(total) ? { expectedAmountCents: Math.round(total * 100) } : {}),\n });\n this.acted = true;\n }\n\n protected onSaveChange(checked: boolean): void { this.saveChecked.set(checked); }\n\n /** \"Confirm the new total\": the payer saw the new total, Send is available again. */\n protected confirmNewTotal(): void { this.quoteChanged.set(null); }\n\n protected retry(): void { this.acted = true; void this.flow.retry(); }\n\n /** \"Check again\" of an unconfirmed payment: reads the attempt key once more (found: followed; still none after the grace: released, \"Start again\"). */\n protected recheck(): void { void this.flow.recheck(); }\n\n protected dismissCancelTimeout(): void { this.cancelTimedOut.set(false); void this.loadReadiness(); }\n\n protected cancelPayment(): void { this.acted = true; void this.flow.cancel(); }\n\n protected startAgain(): void { this.flow.reset(); }\n\n protected retryQuote(): void { this.quoteTick.update(n => n + 1); }\n\n /** \"Take a manual payment instead\" while a payment is open: the payment is canceled FIRST; the host is told only when the service confirmed it. */\n protected async switchToManual(): Promise<void> {\n if (await this.cancelAndWait()) this.manual.emit();\n }\n\n /** Cancels an open reader payment and resolves true when nothing is open any more (nothing was waiting, or the service confirmed the cancel). False = the payment is STILL open. */\n async cancelAndWait(): Promise<boolean> {\n if (!this.flow.locked()) return true;\n if (this.flow.phase() === 'starting' || this.flow.phase() === 'recovering' || this.flow.phase() === 'retrying') return false;\n return this.flow.cancel();\n }\n\n /** Is a reader payment open (starting, waiting, declined, cancelling...)? */\n isLocked(): boolean { return this.flow.locked(); }\n\n /** The panel wants to close: allowed (true) only when nothing is open. Otherwise the warning shows and focus goes to \"Cancel payment\". */\n requestClose(): boolean {\n if (!this.flow.locked()) return true;\n // Nothing is waiting on the reader yet (the answer of the start is on its way or lost): there is nothing to cancel. The panel may close; the attempt marker is kept, so reopening it\n // finds the payment by its attempt key (\"Checking the payment\" with the same hint) and NEVER starts another.\n const phase = this.flow.phase();\n if (phase === 'starting' || phase === 'recovering') { this.outcome.emit({ kind: 'left-pending' }); return true; }\n this.closeBlocked.set(true);\n afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('[data-testid=\"reader-cancel\"] button, [data-testid=\"reader-waiting\"]')?.focus(), { injector: this.injector });\n return false;\n }\n\n /** Fire-and-forget cancel of an open payment (the host closed the panel anyway). Never claims the payment is canceled. */\n cancelBestEffort(): void {\n const cancel = this.cancelPaymentFn();\n const id = this.flow.payment()?.id;\n if (!cancel || !id || !this.flow.cancellable()) return;\n callHost(() => cancel(id)).catch(() => { /* the service keeps the payment open and the reconciler settles it */ });\n }\n\n /** \"Cancel that payment\" of the busy banner: cancels the user's own payment that holds the reader, then reads the readiness again. */\n protected async cancelBusy(id: string): Promise<void> {\n const cancel = this.cancelPaymentFn();\n if (!cancel || this.cancellingBusy()) return;\n this.cancellingBusy.set(true);\n this.cancelTimedOut.set(false);\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n // Raced against the request timeout: a call that never answers cannot leave \"Cancel that payment\" busy forever. A timed-out cancel may have gone through: the readiness is read again at once.\n const timeout = new Promise<never>((_, reject) => { timer = setTimeout(() => reject(Object.assign(new Error('request timeout'), { status: null, code: 'request_timeout' })), Math.max(1, this.requestTimeoutMs())); });\n await Promise.race([callHost(() => cancel(id)), timeout]);\n } catch (error) {\n const code = readerErrorInfo(error).code;\n if (code === 'request_timeout') this.cancelTimedOut.set(!this.destroyed);\n this.outcome.emit({ kind: 'refused', code: code || 'reader_unreachable' });\n } finally { if (timer) clearTimeout(timer); }\n if (this.destroyed) return;\n this.cancellingBusy.set(false);\n void this.loadReadiness();\n }\n\n private onFlowEvent(event: StripeReaderFlowEvent): void {\n switch (event.kind) {\n case 'started': this.outcome.emit({ kind: 'started', payment: event.payment }); break;\n case 'declined': this.outcome.emit({ kind: 'declined', payment: event.payment }); break;\n case 'succeeded':\n // The amount of THIS payment: the service's base amount (also after a reload that adopted it), else what this screen started with; never a made-up 0.\n this.succeeded.emit({ payment: event.payment, attemptKey: event.attemptKey, amount: this.flow.baseAmount() ?? this.amount() ?? paymentChargedAmount(event.payment) ?? 0, readerId: event.payment.terminal?.readerId ?? this.flow.lastStartInput()?.readerId ?? '' });\n break;\n case 'canceled': this.outcome.emit({ kind: 'canceled' }); break;\n case 'failed': this.outcome.emit({ kind: 'failed' }); break;\n case 'refused': this.outcome.emit({ kind: 'refused', code: event.refusal.code }); break;\n case 'connection-lost': this.outcome.emit({ kind: 'connection-lost' }); break;\n case 'connection-restored': this.outcome.emit({ kind: 'connection-restored' }); break;\n }\n }\n}\n","import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, ViewEncapsulation, afterNextRender, computed, effect, inject, input, signal, untracked, viewChild } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { HintComponent } from '@forgeroute/ui/hint';\nimport { KpiCardComponent } from '@forgeroute/ui/kpi-card';\nimport { RadioGroupComponent } from '@forgeroute/ui/radio';\nimport { callHost, isFinalPaymentRefusal, paymentErrorLabelKey, refusalLabelKey, wasQueuedOffline, warnQueuedPayment, type PaymentAttemptControls, type PaymentAttemptOutcome, type PaymentMethodContext } from '@forgeroute/ui/payments';\nimport { formatCurrency } from '@forgeroute/ui/utils';\nimport { StripePaymentComponent, type StripeBillingDetails, type StripeDeferredIntent } from '../stripe-payment/stripe-payment.component';\nimport type { StripeCardFunding, StripeConfirmationTokenEvent, StripeConfirmedEvent, StripeElementChange, StripeFailure } from '../stripe-payment/stripe-outcomes';\nimport type { StripePaymentMethodComponent } from './payment-stripe-method.component';\nimport { STRIPE_METHOD_TEXTS, stripeMethodType, type StripeFees, type StripeIntentInfo } from './payment-stripe-method.models';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { StripeReaderPaymentComponent, type StripeReaderSucceededEvent } from '../stripe-reader/stripe-reader-payment.component';\nimport { paymentBaseAmount, type StripeReaderReadinessState } from '../stripe-reader/stripe-reader.models';\nimport { STRIPE_READER_POLL_MS } from '../stripe-reader/stripe-reader.flow';\n\nconst WALLETS = { applePay: 'never', googlePay: 'never' };\nconst FIELDS = { billingDetails: { address: { country: 'auto', postalCode: 'auto' } } };\n\n/** The body `ui-payment-stripe-method` hands to the panel: the Payment Element, the fee rows and the whole Stripe flow, talking to the panel through `ctx`. */\n@Component({\n selector: 'ui-payment-stripe-body',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [FormsModule, AlertComponent, ButtonComponent, HintComponent, KpiCardComponent, RadioGroupComponent, StripePaymentComponent, StripeReaderPaymentComponent],\n template: `\n <div class=\"psm\">\n @if (confirmation(); as notice) {\n <ui-alert [variant]=\"notice.verification ? 'warning' : 'success'\" [title]=\"notice.title\" tabindex=\"-1\" class=\"psm-notice\" data-testid=\"stripe-method-confirmation\">\n <p>{{ notice.message }}</p>\n @if (!notice.verification) {\n <p>{{ receiptNote() }}</p>\n }\n </ui-alert>\n } @else {\n <!-- the region stays in the DOM (only its content toggles) so a screen reader announces the reason when it appears -->\n <div role=\"status\" aria-live=\"polite\" class=\"psm-blocked\" data-testid=\"stripe-method-blocked-status\">\n @if (blockedMessage(); as reason) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" data-testid=\"stripe-method-blocked\">{{ reason }}</ui-alert>\n }\n </div>\n @if (readerEnabled()) {\n @if (!readerPaid()) {\n <!-- a refused switch re-creates the group (new epoch) so the radio shows the mode that is really in effect -->\n @for (epoch of [modeEpoch()]; track epoch) {\n <ui-radio-group class=\"psm-mode\" [label]=\"labels.t('stripeReader.mode.label')\" [options]=\"modeOptions()\" orientation=\"horizontal\" [ngModel]=\"modeShown()\" (ngModelChange)=\"chooseMode($event)\"\n [disabled]=\"modeLocked()\" data-testid=\"stripe-reader-mode\" />\n }\n @if (modeBlocked()) {\n <ui-alert variant=\"warning\" [quiet]=\"true\" class=\"psm-mode-blocked\" data-testid=\"stripe-reader-mode-blocked\">{{ labels.t(modeBlockedWhy() === 'manual-pending' ? 'stripeReader.mode.blockedManual' : 'stripeReader.mode.blocked') }}</ui-alert>\n }\n }\n <ui-stripe-reader-payment [active]=\"mode() === 'reader'\" [amount]=\"ctx().amount\" [currency]=\"ctx().currency\" [payableRef]=\"config().payableRef()\" [paid]=\"config().paid()\"\n [startExtras]=\"readerExtras()\" [getReadiness]=\"reader()!.getReadiness\" [startPayment]=\"reader()!.startPayment\" [getPayment]=\"reader()!.getPayment\" [retryPayment]=\"reader()!.retryPayment\"\n [cancelPayment]=\"reader()!.cancelPayment\" [estimateFees]=\"reader()!.estimateFees\" [receiptUrl]=\"reader()!.receiptUrl ?? null\" [saveCard]=\"reader()!.saveCard ?? null\"\n [offlineOverride]=\"config().offlineOverride()\" [beforeStart]=\"beforeReaderStart\" [manualAvailable]=\"true\" [disabled]=\"isBlocked()\" [hideBanner]=\"!!ctx().readerBanner\" [pollMs]=\"readerPollMs()\"\n (manual)=\"onReaderManual()\" (connectReader)=\"config().readerConnect.emit()\" (getReader)=\"config().readerOrder.emit()\" (openSetup)=\"config().readerSetup.emit()\"\n (succeeded)=\"onReaderPaid($event)\" (readinessChange)=\"onReaderReadiness($event)\" (busyChange)=\"onReaderBusy($event)\" />\n }\n @if (showManual()) {\n @if (ctx().amount == null) {\n <ui-hint data-testid=\"stripe-method-amount-needed\">{{ texts.amountNeeded }}</ui-hint>\n }\n @if (estimateError()) {\n <div class=\"psm-error\">\n <ui-alert variant=\"warning\" data-testid=\"stripe-method-estimate-error\">{{ estimateError() }}\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"stripe-method-estimate-retry\" (click)=\"retryEstimate()\">{{ labels.t('common.tryAgain') }}</ui-button>\n </ui-alert>\n </div>\n }\n @if (lastAmount() != null) {\n <ui-stripe-payment #payment mode=\"payment\" [publishableKey]=\"config().publishableKey()\" [stripeAccount]=\"config().stripeAccount()\" [deferred]=\"deferred()\"\n [createIntent]=\"createIntentFn\" [paymentMethodTypes]=\"[methodType()]\" [showSubmit]=\"false\" [showErrors]=\"false\" [autoHandleCardAction]=\"true\" [collectConfirmationToken]=\"config().fundingPreview()\"\n [duplicateProtection]=\"config().duplicateProtection()\" [attemptAmount]=\"ctx().amount\" [attemptMethod]=\"ctx().method\" [payableRef]=\"config().payableRef()\" [attemptKey]=\"config().attemptKey()\" [checkStatus]=\"config().checkStatus()\" [paid]=\"config().paid()\" [hostPending]=\"config().hostPending()\"\n [statusPollMs]=\"config().statusPollMs()\" [statusPollMaxMs]=\"config().statusPollMaxMs()\" [statusCheckTimeoutMs]=\"config().statusCheckTimeoutMs()\" [statusFailGraceMs]=\"config().statusFailGraceMs()\" [authTimeoutMs]=\"config().authTimeoutMs()\" [allowStartOver]=\"config().allowStartOver()\" [offlineOverride]=\"config().offlineOverride()\" [confirmTimeoutMs]=\"config().confirmTimeoutMs()\"\n [readinessCheck]=\"config().readinessCheck()\" [readinessTimeoutMs]=\"config().readinessTimeoutMs()\" [readinessEveryMs]=\"config().readinessEveryMs()\" (outcome)=\"onAttemptOutcome($event)\"\n [wallets]=\"wallets\" [fields]=\"fields\" [defaultValues]=\"defaultValues()\" [appearance]=\"$any(config().appearance())\" [appearanceFromTokens]=\"true\" [label]=\"labels.t('stripePaymentStripeMethod.paymentDetails')\"\n (ready)=\"onReady()\" (elementChange)=\"onElementChange($event)\" (failed)=\"onFailed($event)\" (loadError)=\"onFailed($event)\" />\n @if (totalCard(); as card) {\n <ui-kpi-card class=\"psm-total\" data-testid=\"stripe-method-total\" [label]=\"labels.t('stripePaymentStripeMethod.totalCharged')\" [value]=\"card.value\" [subtitle]=\"card.subtitle\" icon=\"dollar\" color=\"blue\" valueColor=\"blue\" />\n }\n @if (feeRows().length) {\n <dl class=\"psm-fees\" data-testid=\"stripe-method-fees\" [attr.aria-label]=\"labels.t('stripePaymentStripeMethod.paymentTotal')\">\n @for (row of feeRows(); track row.key) {\n <div class=\"psm-fee\" [attr.data-testid]=\"'stripe-fee-' + row.key\"><dt>{{ row.label }}</dt><dd>{{ row.value }}</dd></div>\n }\n </dl>\n }\n @if (error()) { <div class=\"psm-error\"><ui-alert variant=\"danger\" data-testid=\"stripe-method-error\">{{ error() }}</ui-alert></div> }\n }\n }\n }\n </div>\n `,\n styles: [`\n ui-payment-stripe-body { display: block; min-width: 0; }\n ui-payment-stripe-body .psm-error { margin-top: 12px; }\n ui-payment-stripe-body .psm-mode { display: block; margin-bottom: 12px; }\n ui-payment-stripe-body .psm-mode-blocked { display: block; margin-bottom: 12px; }\n ui-payment-stripe-body .psm-blocked { display: block; margin-bottom: 12px; }\n ui-payment-stripe-body .psm-blocked:empty { display: none; }\n ui-payment-stripe-body .psm-total { display: block; margin-top: 16px; }\n ui-payment-stripe-body .psm-fees { margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--ui-psp-border, #e2e8f0); border-radius: 10px; font-size: 0.8125rem; }\n ui-payment-stripe-body .psm-fee { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--ui-psp-muted, #475569); }\n ui-payment-stripe-body .psm-fee dt, ui-payment-stripe-body .psm-fee dd { margin: 0; }\n ui-payment-stripe-body .psm-notice:focus { outline: none; }\n ui-payment-stripe-body .psm-notice p { margin: 0 0 6px; }\n `],\n})\nexport class PaymentStripeBodyComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly injector = inject(Injector);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly ctx = input.required<PaymentMethodContext>();\n readonly config = input.required<StripePaymentMethodComponent>();\n private readonly payment = viewChild(StripePaymentComponent);\n private readonly readerView = viewChild(StripeReaderPaymentComponent);\n\n // ── Card reader mode (opt-in: only with `[reader]` on the plugin and the method Card) ──\n protected readonly reader = computed(() => this.config().reader());\n protected readonly readerEnabled = computed(() => !!this.reader() && this.ctx().method === 'CARD');\n /** The last readiness state the reader screen reported (`null` = no answer / failed). */\n readonly readerState = signal<StripeReaderReadinessState | null>(null);\n /** This screen's reader read answered at least once for the selected method (a failed read counts): the next CHANGE of state asks the panel's top banner to read again. */\n private readerAnswered = false;\n /** The payer's choice. `null` until the FIRST readiness answer: then the reader when it is ready (and `readerFirst`), else manual. Never changes by itself after that (a card being typed must not be swapped away). */\n readonly choice = signal<'reader' | 'manual' | null>(null);\n /** What the choice control shows (it follows `mode()` and is moved first when the payer picks, so a refused switch can put it back). */\n protected readonly modeShown = signal<string>('manual');\n /** The reader payment that was taken (the success box and \"Done\" show). */\n readonly readerPaid = signal<StripeReaderSucceededEvent | null>(null);\n private readerBusy = false;\n /** The attempt key of the open reader payment (read while its screen exists; the screen is already gone when the body or the reader is removed). */\n private readerAttemptKey: string | undefined;\n readonly mode = computed((): 'reader' | 'manual' => (this.readerEnabled() ? (this.choice() ?? 'manual') : 'manual'));\n /** The Payment Element shows (manual card): no reader, or manual chosen after the first readiness answer. */\n protected readonly showManual = computed(() => !this.readerEnabled() || (this.choice() === 'manual'));\n protected readonly readerActive = computed(() => this.readerEnabled() && this.mode() === 'reader');\n protected readonly modeOptions = computed(() => [\n { value: 'reader', label: this.labels.t('stripeReader.mode.reader'), testId: 'stripe-reader-mode-reader' },\n { value: 'manual', label: this.labels.t('stripeReader.mode.manual'), testId: 'stripe-reader-mode-manual' },\n ]);\n /** The choice cannot move while the manual form pays or its outcome is unknown. It IS available before the first readiness answer (nothing is selected then): choosing manual at once cancels nothing, and the default never flips it back. */\n protected readonly modeLocked = computed(() => this.processing() || this.done() || this.switching() || this.isBlocked());\n /** The poll cadence of the waiting reader payment: the `[readerPollMs]` input, else `reader.pollMs`, else the library default; clamped by the reader screen to 500..30 000 ms. */\n protected readonly readerPollMs = computed(() => this.config().readerPollMs() ?? this.reader()?.pollMs ?? STRIPE_READER_POLL_MS);\n /** Blocked by the plugin's own `[blocked]` or by the panel's (`ctx.blocked`). */\n protected readonly isBlocked = computed(() => this.config().blocked() || !!this.ctx().blocked);\n /** The message of the plugin's own `[blocked]`; empty when not blocked or when the panel shows it already (never twice), and not after the payment was taken. */\n protected readonly blockedMessage = computed(() => (this.config().blocked() && !this.ctx().blocked && !this.done() && !this.readerPaid() && !this.confirmation()\n ? (this.config().blockedReason().trim() || this.labels.t('paymentBlocked.default')) : ''));\n /** A switch to manual is waiting for the reader payment's cancel to be confirmed. */\n private readonly switching = signal(false);\n /** The switch was refused (a payment is open): the text says why. */\n protected readonly modeBlocked = signal(false);\n /** Why the switch was refused: a card READER payment is still open (going to manual), or a MANUAL card payment is still being confirmed (going to the reader). The text says which one is true. */\n protected readonly modeBlockedWhy = signal<'reader-open' | 'manual-pending'>('reader-open');\n protected readonly modeEpoch = signal(0);\n protected readonly readerExtras = computed(() => { const c = this.ctx(); return { receivedDate: c.receivedDate, notes: c.note || null, allocation: c.allocation }; });\n /** Called by the reader's Send button: the panel's fields must be valid (and show their messages). */\n protected readonly beforeReaderStart = (): boolean => this.ctx().validate();\n\n protected readonly texts = STRIPE_METHOD_TEXTS;\n protected readonly wallets = WALLETS;\n protected readonly fields = FIELDS;\n\n readonly complete = signal(false);\n readonly processing = signal(false);\n /** What the attempt was STARTED with (pinned at the click). */\n private payAmount: number | null = null;\n /** The attempt's outcome is unknown right now (kept here, not read from the form: the form is already gone when the panel closes). */\n private attemptUnknown = false;\n private payMethod: string | null = null;\n /** What the payment that was RECORDED was made with (a late answer of an older attempt is recorded with its own amount and method). */\n private doneAmount: number | null = null;\n /** The amount and the panel's method of every attempt of this panel, by attempt key: a late answer of an OLDER attempt is recorded with its own (the form's outcome carries the Stripe type, not the panel's method). */\n private readonly attempts = new Map<string, { amount: number; method: string }>();\n private doneMethod: string | null = null;\n /** The payment was accepted (the panel was told, or the notice is up): Pay stays off even if the host keeps the panel open. */\n readonly done = signal(false);\n readonly error = signal('');\n /** The service gave an answer a retry cannot change (see `isFinalPaymentRefusal`), for THIS method, payable and amount: the text stays and Pay stays off until one of them changes (then the refusal and its text are cleared for good; it comes back only if the service answers it again). */\n readonly finalRefusal = signal<{ method: string; ref: string | null; amount: number } | null>(null);\n /** Fees from the host's estimate (before the payer pays); they decide the amount of the Payment Element. */\n readonly estimate = signal<StripeFees | null>(null);\n private readonly estimating = signal(false);\n protected readonly estimateError = signal('');\n private readonly estimateTick = signal(0);\n /** Fees the host answered when it created the intent. */\n private readonly intentFees = signal<StripeFees | null>(null);\n /** The notice after an accepted bank payment. `verification`: the payment has NOT started (a warning, no title because the message opens with \"Bank verification required\", no receipt note). */\n protected readonly confirmation = signal<{ title: string; message: string; verification?: boolean } | null>(null);\n /** The last valid amount: the Payment Element stays mounted (and keeps the typed card data) while the amount is briefly empty or invalid. */\n protected readonly lastAmount = signal<number | null>(null);\n private intent: StripeIntentInfo | null = null;\n private estimateRun = 0;\n /**\n * `fundingPreview`: the funding of the complete typed card; `null` while the card is incomplete / not a card. Only the FUNDING is reactive (a primitive, so setting the same value\n * again notifies nobody): the estimate effect runs once per funding change, not once per token. The id of the token that produced it is kept in `previewTokenId`.\n */\n private readonly previewFunding = signal<StripeCardFunding | null>(null);\n /** The id of the latest ConfirmationToken of the complete typed card (read when the estimate is asked); not reactive on purpose. */\n private previewTokenId: string | null = null;\n private previewRun = 0;\n /** `fundingPreview` only: a complete card changed and its token (and so its funding and the fee rows / total) is not known yet: Pay stays off, the rows on screen belong to the previous card. */\n private readonly previewPending = signal(false);\n private previewTimer: ReturnType<typeof setTimeout> | null = null;\n /** An estimate answer was dropped because a payment was being confirmed: ask again when that ends (else Pay would be free for the base amount). */\n private estimateStale = false;\n\n private readonly amountValue = computed(() => this.ctx().amount);\n private readonly methodValue = computed(() => this.ctx().method);\n protected readonly methodType = computed(() => stripeMethodType(this.ctx().method));\n private readonly total = computed(() => this.estimate()?.totalAmount ?? this.lastAmount() ?? 0);\n protected readonly receiptNote = computed(() => this.config().receiptNote());\n protected readonly deferred = computed((): StripeDeferredIntent => ({ mode: 'payment', amount: Math.round(this.total() * 100), currency: this.ctx().currency.toLowerCase() }));\n protected readonly defaultValues = computed(() => {\n const b: StripeBillingDetails | null = this.config().billingDetails();\n return b ? { billingDetails: b } : null;\n });\n protected readonly feeRows = computed(() => {\n const fees = this.intentFees() ?? this.estimate();\n const amount = this.lastAmount();\n if (!fees || amount == null || (fees.stripeFee === undefined && fees.platformFee === undefined)) return [];\n const money = (n: number) => formatCurrency(n, { currency: this.ctx().currency });\n const rows: { key: string; label: string; value: string }[] = [{ key: 'amount', label: this.labels.t('stripePaymentMethod.paymentAmount'), value: money(amount) }];\n if (fees.stripeFee !== undefined) rows.push({ key: 'processing', label: `${this.labels.t('stripePaymentMethod.processingFee')}${fees.stripeFeeLabel ? ` (${fees.stripeFeeLabel})` : ''}`, value: money(fees.stripeFee) });\n if (fees.platformFee !== undefined) rows.push({ key: 'platform', label: `${this.labels.t('stripePaymentMethod.platformFee')}${fees.platformFeeLabel ? ` (${fees.platformFeeLabel})` : ''}`, value: money(fees.platformFee) });\n return rows;\n });\n /** The headline figure: what the payer is charged, once fees are known. */\n protected readonly totalCard = computed(() => {\n const fees = this.intentFees() ?? this.estimate();\n if (!fees || this.lastAmount() == null || fees.totalAmount === undefined) return null;\n return { value: formatCurrency(fees.totalAmount, { currency: this.ctx().currency }), subtitle: this.labels.t('stripePaymentMethod.amountPlusFees') };\n });\n\n /** Bound as `[createIntent]` of ui-stripe-payment: called on Pay with the deferred form. */\n protected readonly createIntentFn = async (context?: { mode: 'payment' | 'setup'; confirmationToken?: StripeConfirmationTokenEvent | null; attemptKey?: string; payableRef?: string | null }): Promise<string> => {\n const create = this.config().createIntent();\n const ctx = this.ctx();\n if (!create || ctx.amount == null) throw new Error(this.labels.t('stripePayment.msg.cardsUnavailable'));\n this.cancelIntent(true); // a previous attempt that failed leaves an intent behind: cancel it even though a payment is \"processing\" now\n // The amount and method of THIS attempt are the PINNED ones (the click that started it), never what the amount field says by the time the intent is created.\n const attempt = this.payment()?.attempt;\n const amount: number = attempt?.pinnedAmount() ?? ctx.amount;\n const method: string = attempt?.pinnedMethod() ?? ctx.method;\n if (context?.attemptKey) { this.attempts.set(context.attemptKey, { amount, method }); this.config().rememberAttempt(context.attemptKey, 'manual', amount); } // the plugin keeps it for a later \"Check again\" of the panel\n let info: StripeIntentInfo | null | undefined;\n try { info = await callHost(() => create({\n amount, paymentMethod: method, paymentMethodType: this.methodType(), receivedDate: ctx.receivedDate, notes: ctx.note || null, ...ctx.allocation,\n ...(context?.confirmationToken ? { confirmationTokenId: context.confirmationToken.id, funding: context.confirmationToken.funding } : {}),\n ...(context?.attemptKey ? { attemptKey: context.attemptKey } : {}),\n ...(context?.attemptKey && context.payableRef !== undefined ? { payableRef: context.payableRef } : {}),\n })); } catch (err) {\n // The reference / payment-link codes are worded in OUR (translated) words; a final one keeps the text and turns Pay off instead of looping. The error keeps its code (the form still tells a failed-attempt replay).\n const labelKey = paymentErrorLabelKey(err);\n // Only the CURRENT attempt can raise it: a late answer of a superseded attempt says nothing about the current method, payable and amount.\n if (isFinalPaymentRefusal(err) && (!context?.attemptKey || attempt?.isLive(context.attemptKey))) this.finalRefusal.set({ method: ctx.method, ref: this.config().payableRef(), amount });\n if (labelKey) throw Object.assign(new Error(this.labels.t(labelKey)), { status: (err as { status?: unknown }).status, code: (err as { code?: unknown; error?: { code?: unknown } }).code ?? (err as { error?: { code?: unknown } }).error?.code });\n throw err;\n }\n if (wasQueuedOffline(info)) { warnQueuedPayment(); throw new Error(this.labels.t('paymentAttempt.queuedOffline')); } // the offline layer QUEUED the request (a synthetic 202): no intent exists, the payer may try again\n if (!info?.clientSecret) throw new Error(this.labels.t('stripePayment.msg.initFailed'));\n this.intent = info;\n this.intentFees.set({ stripeFee: info.stripeFee, platformFee: info.platformFee, totalAmount: info.totalAmount, stripeFeeLabel: info.stripeFeeLabel, platformFeeLabel: info.platformFeeLabel });\n return info.clientSecret;\n };\n\n constructor() {\n effect(() => { const amount = this.amountValue(); if (amount != null) untracked(() => this.lastAmount.set(amount)); });\n // A final refusal belongs to the method, payable and amount it was raised for: when one of them changes the refusal and its text are cleared (and stay cleared unless the service answers it again).\n effect(() => {\n const scope = this.finalRefusal();\n if (!scope) return;\n const ctx = this.ctx();\n if (ctx.method !== scope.method || ctx.amount !== scope.amount || this.config().payableRef() !== scope.ref) untracked(() => { this.finalRefusal.set(null); this.error.set(''); });\n });\n // The panel's footer button for this method.\n effect(() => {\n const ctx = this.ctx();\n const processing = this.processing();\n const notice = this.confirmation();\n const complete = this.complete();\n const estimating = this.estimating();\n const done = this.done();\n const estimateFailed = !!this.estimateError();\n const previewPending = this.previewPending();\n const finalRefusal = !!this.finalRefusal();\n const readerActive = this.readerActive();\n const readerPaid = this.readerPaid();\n const blocked = this.isBlocked();\n const protectedOff = !!this.payment()?.duplicateProtection() && (this.payment()!.attempt.unknown() || this.payment()!.attempt.paidLocked() || !this.payment()!.readiness.ready());\n const label = notice ? this.labels.t('common.done') : ctx.amount != null ? `${this.labels.t('stripePayment.pay')} ${formatCurrency(this.total(), { currency: ctx.currency })}` : this.labels.t('stripePayment.pay');\n // Card reader mode: the reader screen has its own buttons (Send / Cancel); after a reader payment only \"Done\" shows.\n if (readerPaid) { untracked(() => ctx.setPrimary({ label: this.labels.t('common.done'), disabled: done, onClick: () => this.finish() })); return; }\n if (readerActive) { untracked(() => ctx.setPrimary(null)); return; }\n untracked(() => ctx.setPrimary({\n label, loading: processing && !notice,\n disabled: notice ? done : !complete || processing || estimating || previewPending || estimateFailed || ctx.amount == null || done || protectedOff || finalRefusal || blocked,\n onClick: () => (notice ? this.finish() : void this.pay()),\n }));\n });\n // Estimated fees, debounced; they change the amount the Payment Element is created with.\n effect((onCleanup) => {\n const estimate = this.config().estimateFees();\n const amount = this.amountValue();\n const method = this.methodValue();\n const funding = this.previewFunding();\n const readerActive = this.readerActive();\n // Before the FIRST readiness answer nothing is mounted and nothing is estimated (the ONLINE quote would be asked for a payer who may pay on the reader).\n const modePending = this.readerEnabled() && this.choice() === null;\n this.estimateTick();\n const run = ++this.estimateRun; // any change makes an answer that is still on its way stale\n untracked(() => { this.estimate.set(null); this.intentFees.set(null); this.estimateError.set(''); });\n if (!estimate || amount == null || readerActive || modePending) { untracked(() => this.estimating.set(false)); return; }\n untracked(() => this.estimating.set(true));\n let hung: ReturnType<typeof setTimeout> | null = null;\n const failure = this.labels.t('stripePayment.msg.feesFailed');\n const timer = setTimeout(async () => {\n // A hung estimate must not block the user forever: after the timeout \"Try again\" is offered, and Pay stays off (the form\n // would be created for the wrong amount). A late answer still recovers.\n hung = setTimeout(() => {\n if (run !== this.estimateRun) return;\n this.estimating.set(false);\n this.estimateError.set(failure);\n }, Math.max(1, this.config().estimateTimeoutMs()));\n let fees: StripeFees | null = null;\n try {\n fees = (await callHost(() => estimate({\n amount, paymentMethod: method, paymentMethodType: stripeMethodType(method),\n ...(this.config().fundingPreview() ? { funding, confirmationTokenId: funding === null ? null : this.previewTokenId } : {}),\n }))) ?? null;\n } catch { fees = null; }\n if (hung) { clearTimeout(hung); hung = null; }\n if (run !== this.estimateRun) return;\n this.estimating.set(false);\n if (this.processing()) { this.estimateStale = true; return; } // a payment is being confirmed: the form must not change under it; asked again when it ends\n if (fees) { this.estimate.set(fees); this.estimateError.set(''); }\n else { this.estimate.set(null); this.estimateError.set(this.config().feesRequired() ? failure : ''); }\n }, 300);\n onCleanup(() => { clearTimeout(timer); if (hung) clearTimeout(hung); });\n });\n effect(() => {\n if (this.processing()) return;\n untracked(() => {\n if (!this.estimateStale) return;\n this.estimateStale = false;\n // After a success (or while the notice shows) the fees on screen belong to the payment that was taken: keep them.\n if (!this.done() && !this.confirmation()) this.estimateTick.update(n => n + 1);\n });\n });\n // A new form is built for another method: it is not complete until Stripe says so.\n effect(() => { this.methodValue(); untracked(() => { this.complete.set(false); this.error.set(''); this.cancelPreview(); this.choice.set(null); this.readerState.set(null); this.readerAnswered = false; }); });\n // The panel tells us when it is closing or the method changes before this body is removed: an unfinished intent is cancelled,\n // and an accepted payment whose notice is still up is reported as recorded (finalize already ran).\n effect(() => { const ctx = this.ctx(); untracked(() => ctx.onCancel(() => {\n // The panel clears the close guard when it runs this hook: the guard is registered again, or a panel that stays open (a reset) would let the payment be abandoned.\n this.registerCloseGuard(ctx);\n if (this.readerPaid()) { this.finish(); return; }\n const view = this.readerView();\n if (view?.isLocked()) { view.cancelBestEffort(); return; }\n if (this.confirmation()) this.finish(); else this.cancelIntent();\n })); });\n // The panel asks before it closes: a payment that waits on a card reader must be canceled first.\n effect(() => { const ctx = this.ctx(); untracked(() => this.registerCloseGuard(ctx)); });\n // Round 5: the panel's top reader banner (`ctx.readerBanner`) never steps aside; this screen draws no reader banner of its own then (`hideBanner` above), so exactly ONE banner per state. Without a panel banner the reader screen shows its own.\n // Switching between the reader and the manual card clears every manual fee / funding preview at once and asks again when manual comes back.\n // Before the first readiness answer nothing is selected (no mode is \"in effect\" yet, and the reader may still become the default); the payer may pick either at once.\n effect(() => { const mode = this.mode(); const pending = this.readerEnabled() && this.choice() === null; untracked(() => { this.modeShown.set(pending ? '' : mode); if (mode === 'reader') this.cancelPreview(); }); });\n inject(DestroyRef).onDestroy(() => { this.estimateRun++; this.cancelPreview(); this.cancelIntent(); });\n // The body is going away (method changed, panel closed): a reader payment that was open MAY STILL EXIST at the processor, so the host is NOT told it is idle: it hears `readerLeftPending` (once, only if it had been told \"busy\").\n inject(DestroyRef).onDestroy(() => this.leaveReaderPending('destroyed'));\n // The reader screen is removed while a payment is open on it (the reader was switched off, or the method left Card): the payment may still exist, the same rule applies, and the panel is told so it can unlock its own fields without reporting idle.\n effect(() => { const enabled = this.readerEnabled(); untracked(() => { if (!enabled && this.readerBusy) this.leaveReaderPending('unmounted'); }); });\n // The host resolves an undecided attempt through the plugin component (markSucceeded / markFailed / markNotCharged / markUnknown), without a status check.\n const controls: PaymentAttemptControls = {\n markUnknown: () => this.payment()?.markUnknown(),\n markSucceeded: () => this.payment()?.markSucceeded(),\n markFailed: () => this.payment()?.markFailed(),\n resetPaid: () => { this.payment()?.resetPaid(); this.readerView()?.attempt.resetPaid(); this.readerPaid.set(null); this.done.set(false); this.confirmation.set(null); this.error.set(''); this.ctx().setExclusive(false); },\n markNotCharged: () => { this.payment()?.markNotCharged(); this.processing.set(false); this.ctx().setBusy(false); this.ctx().flowOver?.(); },\n };\n // The controls are handed to the plugin that is bound NOW and taken back from that same one when the binding changes or the body is destroyed. (Reading `this.config()` in a destroy callback threw NG0950 when the body\n // was destroyed before its required config input was ever bound, which aborted the rest of the view's cleanups.)\n effect(onCleanup => {\n const config = this.config();\n untracked(() => config.attachControls(controls));\n onCleanup(() => config.detachControls(controls));\n });\n }\n\n // ── Card reader handlers ──\n\n private registerCloseGuard(ctx: PaymentMethodContext): void {\n ctx.setCloseGuard?.(() => {\n const view = this.readerView();\n const wasOpen = !!view?.isLocked();\n const allowed = view?.requestClose() ?? true;\n // The panel may close while the start answer is still on its way (starting / recovering): the payment is not canceled, so the host hears which attempt is left open.\n if (allowed && wasOpen) ctx.report('reader-left-pending', { ...(this.readerAttemptKey ? { attemptKey: this.readerAttemptKey } : {}) });\n return allowed;\n });\n }\n\n /** A reader payment that MAY STILL EXIST is let go of: never reported idle. The host hears `readerLeftPending` (and a panel hears `ctx.leavePending`). Once per busy period. */\n private leaveReaderPending(reason: 'destroyed' | 'unmounted'): void {\n if (!this.readerBusy) return;\n this.readerBusy = false;\n const paymentAttemptKey = this.readerAttemptKey;\n try { this.config().readerLeftPending.emit({ reason, ...(paymentAttemptKey ? { paymentAttemptKey } : {}) }); } catch { /* the plugin is already gone */ }\n if (reason === 'unmounted') { try { this.ctx().leavePending?.({ reason: 'unmounted', ...(paymentAttemptKey ? { paymentAttemptKey } : {}) }); } catch { /* the panel is already gone */ } }\n }\n\n /** The reader screen read the readiness. The FIRST answer decides the default: the reader when it is ready, else manual. */\n protected onReaderReadiness(state: StripeReaderReadinessState | null): void {\n const previous = this.readerState();\n const answeredBefore = this.readerAnswered;\n this.readerAnswered = true;\n this.readerState.set(state);\n // Round 5: the panel's top banner is the only reader banner on screen, so when this screen's own (15-second) read sees the reader's state CHANGE (ready -> offline, busy -> ready...) the top banner reads again: it never keeps saying \"connected\" for a reader that went away.\n if (answeredBefore && state !== null && previous !== state && this.ctx().readerBanner) { try { this.ctx().refreshReaderBanner?.(); } catch { /* the panel is already gone */ } }\n if (this.choice() === null) this.choice.set(state === 'reader_ready' && this.config().readerFirst() ? 'reader' : 'manual');\n }\n\n /** A reader payment is open: everything else is locked (fields, method, the manual form). */\n protected onReaderBusy(locked: boolean): void {\n if (locked === this.readerBusy) return;\n this.readerBusy = locked;\n if (locked) {\n try { this.readerAttemptKey = this.readerView()?.attempt.key() || undefined; } catch { this.readerAttemptKey = undefined; }\n this.config().rememberAttempt(this.readerAttemptKey, 'reader', this.ctx().amount ?? undefined); // the plugin keeps it for a later \"Check again\" of the panel\n }\n this.config().readerBusyChange.emit(locked);\n if (!locked) this.modeBlocked.set(false);\n // A reader payment is open (started here, or found again after a reload / in a second tab): its screen is the one to show, never the manual form behind it.\n else if (this.choice() !== 'reader') this.choice.set('reader');\n this.ctx().setBusy(locked);\n if (!locked) this.ctx().flowOver?.(); // the reader screen's flow ended (found nothing, found it canceled / paid, the user's cancel was confirmed): the panel's hold for it is over\n }\n\n /**\n * The payer picks reader or manual. Leaving the reader while a payment waits first cancels it THROUGH THE HOST; only when the service confirmed it does the manual form open. The control is NOT moved before\n * the answer (it is disabled while the cancel runs); a refused switch says why and re-creates the control so it shows the mode that is really in effect.\n */\n protected async chooseMode(next: string | null): Promise<void> {\n const target = next === 'reader' ? 'reader' : 'manual';\n if (this.switching() || (target === this.mode() && this.choice() !== null)) return;\n this.modeBlocked.set(false);\n if (target === 'manual') {\n const view = this.readerView();\n if (view?.isLocked()) {\n this.switching.set(true);\n let canceled = false;\n try { canceled = await view.cancelAndWait(); } finally { this.switching.set(false); }\n if (!canceled) { this.refuseSwitch('reader-open'); return; }\n this.ctx().flowOver?.(); // the service confirmed the cancel: nothing is open on the reader any more\n }\n } else if (this.processing() || this.attemptUnknown) { this.refuseSwitch('manual-pending'); return; }\n this.choice.set(target);\n }\n\n private refuseSwitch(why: 'reader-open' | 'manual-pending'): void {\n this.modeBlockedWhy.set(why);\n this.modeBlocked.set(true);\n this.modeEpoch.update(n => n + 1);\n this.modeShown.set(this.mode());\n afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('[data-testid=\"stripe-reader-mode\"] input:checked')?.focus(), { injector: this.injector });\n }\n\n /** The reader screen asked for the manual form (its payment is already canceled or never started). */\n protected onReaderManual(): void { this.choice.set('manual'); this.ctx().flowOver?.(); }\n\n /** The reader took the payment: reported like any live payment; \"Done\" completes the panel (the success box with the receipt and the saved-card result stays until then). */\n protected onReaderPaid(event: StripeReaderSucceededEvent): void {\n if (this.done() || this.readerPaid()) return;\n const ctx = this.ctx();\n // The amount of the reader payment itself; never reported as 0 while any amount is known: the event's, else the payment's own base amount (what the service says), else what the panel says now, else the last amount it said.\n const amount = event.amount > 0 ? event.amount : (paymentBaseAmount(event.payment) ?? ctx.amount ?? this.lastAmount() ?? event.amount);\n this.readerPaid.set(event);\n this.doneAmount = amount;\n this.doneMethod = ctx.method;\n ctx.report('paid', { result: { type: 'stripe', paymentMethod: ctx.method, amount } });\n ctx.setExclusive(true);\n ctx.setBusy(false);\n if (this.readerBusy) { this.readerBusy = false; this.config().readerBusyChange.emit(false); }\n }\n\n /** Every change of the Payment Element: completeness for Pay, and (only with `fundingPreview`) the card funding preview. */\n protected onElementChange(change: StripeElementChange): void {\n this.complete.set(change.complete);\n if (!this.config().fundingPreview() || !this.config().estimateFees() || this.methodType() !== 'card') return;\n this.stopPreviewTimer();\n const run = ++this.previewRun;\n if (!change.complete) { this.previewTokenId = null; this.previewFunding.set(null); this.previewPending.set(false); return; } // the card was edited: its funding is unknown again\n this.previewPending.set(true);\n this.previewTimer = setTimeout(() => void this.runPreview(run), 400);\n }\n\n private async runPreview(run: number): Promise<void> {\n this.previewTimer = null;\n const payment = this.payment();\n if (!payment || this.processing() || this.done() || run !== this.previewRun) { if (run === this.previewRun) this.previewPending.set(false); return; }\n const made = await payment.createConfirmationToken();\n if (run !== this.previewRun) return; // a newer change owns the pending flag\n if (!made || !('id' in made) || made.paymentMethodType !== 'card') {\n // No token for THIS card: its funding is unknown (never the previous card's): the estimate is asked again with funding null, then Pay is released.\n this.previewTokenId = null;\n this.previewFunding.set(null);\n this.previewPending.set(false);\n return;\n }\n // A new token for a card of the same funding must not ask for the estimate again (Pay would flicker and the effect would loop on its own answers).\n this.previewTokenId = made.id;\n this.previewFunding.set(made.funding);\n this.previewPending.set(false);\n }\n\n private stopPreviewTimer(): void { if (this.previewTimer) { clearTimeout(this.previewTimer); this.previewTimer = null; } }\n\n private cancelPreview(): void { this.stopPreviewTimer(); this.previewRun++; this.previewTokenId = null; this.previewFunding.set(null); this.previewPending.set(false); }\n\n protected retryEstimate(): void { this.estimateTick.update(n => n + 1); }\n\n protected onReady(): void {\n this.complete.set(false);\n this.ctx().announce(this.labels.t('stripePaymentMethod.announceReady'));\n }\n\n protected onFailed(failure: StripeFailure): void {\n this.error.set(failure.message); // shown in a role=alert ui-alert: that is the announcement\n this.processing.set(false);\n this.ctx().report('failed', { message: failure.message });\n }\n\n /** The inner form's attempt resolved OUTSIDE the click (only with `duplicateProtection`): unknown -> reported and kept locked; a status check that says paid completes the payment. */\n protected onAttemptOutcome(outcome: PaymentAttemptOutcome): void {\n const ctx = this.ctx();\n const duplicate = outcome.kind === 'unknown' && outcome.reason === 'duplicate_suspected';\n if (outcome.kind === 'unknown' && !duplicate) this.attemptUnknown = true; // a suspected duplicate is a report about ANOTHER (second) payment: this attempt's lock and intent are not touched\n else if (outcome.kind === 'succeeded' || outcome.kind === 'failed') this.attemptUnknown = false;\n if (duplicate) {\n const message = this.labels.t('paymentAttempt.duplicate');\n this.error.set(message);\n ctx.report('duplicate_suspected', { message, attemptKey: outcome.attemptKey });\n ctx.announce(message);\n } else if (outcome.kind === 'unknown') {\n this.payAmount = this.payment()?.attempt.pinnedAmount() ?? this.payAmount; // the amount and method of the attempt that is UNKNOWN (an adopted one included), never a stale earlier one\n this.payMethod = this.payment()?.attempt.pinnedMethod() ?? this.payMethod;\n if (outcome.reason === 'microdeposits') return; // the verification notice (afterConfirm: report `verification`) is the message; the intent is kept (attemptUnknown) and the status check decides\n const message = this.labels.t(outcome.reason === 'offline' ? 'paymentAttempt.offlineInFlight' : outcome.reason === 'auth_abandoned' ? 'paymentAttempt.authAbandoned' : outcome.reason === 'timeout' ? 'paymentAttempt.timeout' : this.payment()?.attempt.awaitingVerification() ? 'paymentAttempt.awaitingVerification' : 'paymentAttempt.checking'); // a reload / another tab that adopted a bank verification wait says so too\n ctx.report('unknown', { message });\n ctx.announce(message);\n } else if (outcome.kind === 'refused') {\n const refusedReason = outcome.reason ?? '';\n // worded through the readiness gate (payment_in_flight + awaitingVerification, awaiting_verification); `unknown` while a bank verification wait is on is the verification text, never \"Checking your payment...\"\n const refusedKey = refusedReason === 'unknown' && this.payment()?.attempt.awaitingVerification() ? 'paymentAttempt.awaitingVerification' : (this.payment()?.readiness.labelKeyFor(refusedReason) ?? refusalLabelKey(refusedReason));\n ctx.report('refused', { message: this.labels.t(refusedKey) });\n } else if (outcome.kind === 'succeeded' && outcome.reason === 'other_tab') {\n // Another tab / page load paid this payable: this form only shows the paid lock. Nothing is recorded here (no `paid`, no `complete`): no money moved through THIS form and the amount typed here is not what was paid.\n // A host that wants to reconcile reads the paid attempt's key, amount and method from the report (and from the form's own `(outcome)`).\n ctx.report('paid_elsewhere', { message: this.labels.t('paymentAttempt.paid'), attemptKey: outcome.attemptKey, ...(outcome.method !== undefined ? { paid: { amount: outcome.amount ?? null, method: outcome.method } } : {}) });\n } else if (outcome.kind === 'succeeded' && !this.done() && (outcome.reason === 'status_check' || outcome.reason === 'host' || !this.processing() || this.isOlderAttempt(outcome.attemptKey))) {\n // A status check or the host settled it, or the confirmation answered LATE (after a timeout, when `pay()` has already returned, or while a NEWER attempt runs): the payment is recorded exactly once here,\n // with the amount and method of THAT attempt (the outcome carries them for a late answer).\n void this.completeAfterCheck(ctx, this.isOlderAttempt(outcome.attemptKey), outcome);\n } else if (outcome.kind === 'failed' && (outcome.reason === 'status_check' || outcome.reason === 'host')) {\n const message = this.labels.t('paymentAttempt.failedAfterCheck');\n this.error.set(message);\n ctx.report('failed', { message });\n this.cancelIntent(true);\n ctx.setBusy(false);\n }\n }\n\n /** Is `key` an attempt OLDER than the one running now (its answer came late, after the host unlocked it and a newer attempt began)? */\n private isOlderAttempt(key: string): boolean {\n const attempt = this.payment()?.attempt;\n return !!attempt && attempt.inFlight() && attempt.key() !== key;\n }\n\n /**\n * A status check found the payment paid after an unknown outcome: the host records it exactly as after a normal confirmation. For an OLDER attempt (its answer came while a newer one runs) the intent\n * and `finalize` belong to the NEWER attempt and are left alone: the host's webhook reconciles the older payment, which it knows by its attempt key.\n */\n private async completeAfterCheck(ctx: PaymentMethodContext, older = false, outcome?: PaymentAttemptOutcome): Promise<void> {\n if (this.done()) return;\n this.done.set(true); // synchronously, BEFORE any await: a second outcome (status check and host report at once) can never report `paid` twice\n const info = older ? null : this.intent;\n if (!older) this.intent = null;\n let finalizeFailed = false;\n const finalize = this.config().finalize();\n if (finalize && info) { try { await callHost(() => finalize(info)); } catch { finalizeFailed = true; } }\n const known = outcome ? this.attempts.get(outcome.attemptKey) : undefined;\n const result = { type: 'stripe' as const, paymentMethod: known?.method ?? this.payMethod ?? ctx.method, amount: known?.amount ?? outcome?.amount ?? this.payAmount ?? ctx.amount ?? this.lastAmount() ?? 0 };\n this.doneAmount = result.amount;\n this.doneMethod = result.paymentMethod;\n ctx.report(finalizeFailed ? 'finalize-failed' : 'paid', { result });\n ctx.setBusy(false);\n ctx.complete(result);\n }\n\n /** Pays: validates the panel, confirms the Payment Element (creating the intent), then records it through the host. */\n async pay(): Promise<void> {\n const ctx = this.ctx();\n const payment = this.payment();\n if (this.processing() || this.estimating() || this.done() || !payment || this.isBlocked()) return;\n if (!ctx.validate() || ctx.amount == null) return;\n this.payAmount = ctx.amount; // PINNED: what is recorded later is what this click asked for, whatever the amount field says by then\n this.payMethod = ctx.method;\n const attemptAmount: number = ctx.amount; // captured for THIS attempt: a late answer must not read the fields a newer click overwrote\n const attemptMethod: string = ctx.method;\n this.error.set('');\n this.processing.set(true);\n ctx.setBusy(true);\n ctx.announce(this.labels.t('stripePaymentMethod.announceProcessing'));\n let finished = false;\n try {\n const event = await payment.confirm();\n if (event) finished = await this.afterConfirm(event, ctx, attemptAmount, attemptMethod);\n } finally {\n this.processing.set(false);\n // An UNKNOWN outcome keeps the panel busy: the status check, the host or a late answer settles it (onAttemptOutcome frees the panel).\n if (!finished && !payment.attempt.unknown()) ctx.setBusy(false);\n }\n }\n\n private async afterConfirm(event: StripeConfirmedEvent, ctx: PaymentMethodContext, amount: number, method: string): Promise<boolean> {\n if (this.done()) return true; // already recorded by a status check while the confirmation was still pending\n const money = formatCurrency(amount, { currency: ctx.currency });\n if (event.outcome !== 'succeeded' && event.outcome !== 'processing' && event.outcome !== 'requires_verification') {\n this.error.set(this.texts.notCompleted);\n return false;\n }\n // Paid or accepted: the intent is the host's now, a close must not cancel it.\n const info = this.intent;\n this.intent = null;\n let finalizeFailed = false;\n const finalize = this.config().finalize();\n if (finalize && info) {\n try { await callHost(() => finalize(info)); } catch { finalizeFailed = true; } // Stripe took the payment: the host's webhook reconciles\n }\n const result = { type: 'stripe' as const, paymentMethod: method, amount };\n this.doneAmount = amount;\n this.doneMethod = method;\n if (event.outcome === 'succeeded') {\n ctx.report(finalizeFailed ? 'finalize-failed' : 'paid', { result });\n this.done.set(true);\n ctx.complete(result);\n return true;\n }\n const verification = event.outcome === 'requires_verification';\n ctx.report(finalizeFailed ? 'finalize-failed' : verification ? 'verification' : 'processing', { result });\n this.confirmation.set(verification\n ? { title: '', message: this.texts.verificationMessage(money), verification: true }\n : { title: this.texts.achTitle, message: this.texts.achMessage(money) });\n ctx.setExclusive(true);\n ctx.setBusy(false);\n afterNextRender(() => this.host.nativeElement.querySelector<HTMLElement>('.psm-notice')?.focus(), { injector: this.injector });\n return true;\n }\n\n /** \"Done\" on the ACH / verification notice, or closing the panel while the notice is up: the accepted payment is reported as recorded (once). */\n private finish(): void {\n const ctx = this.ctx();\n if (this.done()) return;\n this.done.set(true);\n ctx.complete({ type: 'stripe', paymentMethod: this.doneMethod ?? ctx.method, amount: this.doneAmount || ctx.amount || this.lastAmount() || 0 });\n }\n\n /**\n * Cancels the abandoned intent (close, another method, a retry). Unless `force`, it is left alone while a payment is being confirmed:\n * a retry (`createIntentFn`) runs inside `pay()`, so it forces the cancel of the PREVIOUS attempt's intent.\n */\n private cancelIntent(force = false): void {\n const info = this.intent;\n if (!info || (this.processing() && !force)) return;\n if (this.attemptUnknown) return; // the confirmation may still be running at Stripe: cancelling its intent could cancel a payment that is about to succeed\n this.intent = null;\n const cancel = this.config().cancel();\n if (cancel) callHost(() => cancel(info)).catch(() => { /* best effort */ });\n }\n}\n","import { ChangeDetectionStrategy, Component, DestroyRef, ViewEncapsulation, computed, effect, inject, input, output, signal, untracked } from '@angular/core';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent, UiLabelsService } from '@forgeroute/ui/core';\nimport { builtInReadinessReasons, callHost, type PaymentReaderBannerConfig, type PaymentReaderState } from '@forgeroute/ui/payments';\nimport { normalizeReadiness, readerBannerReasonKey, type StripeReaderGetReadinessFn, type StripeReaderReadiness } from './stripe-reader.models';\n\n/**\n * Gives a host without `ui-payment-stripe-method` in its panel the `[readerBanner]` config of `ui-payment-side-panel` (merchant not ready, collection off, no payable version: no plugin is rendered, but the banner must show).\n * With the plugin rendered a plain `{ getReadiness }` object is enough (the plugin supplies the component).\n *\n * readonly banner = computed(() => stripeReaderBannerConfig({ getReadiness: this.readiness, refreshKey: this.readersVersion() }));\n */\nexport function stripeReaderBannerConfig(config: Omit<PaymentReaderBannerConfig, 'component'>): PaymentReaderBannerConfig {\n return { ...config, component: StripeReaderBannerComponent };\n}\n\n/**\n * The service states the banner shows: the organization has NO usable card reader (`no_reader`, `unsupported_only`, `merchant_not_ready`) or HAS one that is not connected (`reader_offline`).\n * Busy, ready, checking and a failed read show nothing (busy means in use, never \"not connected\").\n */\nexport const STRIPE_READER_BANNER_STATES: readonly StripeReaderReadiness['state'][] = ['no_reader', 'unsupported_only', 'merchant_not_ready', 'reader_offline'];\n\n/** The banner states in which a reader exists but is not connected: \"Your card reader is not connected.\" with the one action \"Connect Your Reader\". */\nexport const STRIPE_READER_NOT_CONNECTED_STATES: readonly StripeReaderReadiness['state'][] = ['reader_offline'];\n\n/**\n * The card reader banner: a SMALL `ui-alert` (info, one line, ONE action) for a STAFF place where a customer payment can be taken. Two situations show it:\n * - NO reader (`no_reader`, `unsupported_only`): \"Get a card reader to take in-person card payments.\" with ONLY \"Get a card reader\" (`order`; \"How to get a card reader\" when `hardwareShopAvailable` is false);\n * - a reader that is NOT CONNECTED (`reader_offline`): \"Your card reader is not connected.\" with ONLY \"Connect Your Reader\" (`connect`);\n * - `merchant_not_ready`: payments must be set up first (`setup`).\n * It renders NOTHING in every other state (reader ready, busy = in use, still checking, a failed read, an offline browser): those belong to the reader screen the payment plugin shows when Card is chosen. `ui-payment-side-panel [readerBanner]` renders it as the first element of the panel. Never use it in a payer-facing component.\n *\n * <ui-stripe-reader-banner [getReadiness]=\"readiness\" [refreshKey]=\"readersVersion()\" [hardwareShopAvailable]=\"canOrder()\" (connect)=\"openPairing()\" (order)=\"openOrder()\" (setup)=\"openSetup()\" />\n *\n * A readiness `reason` of `sandbox`, `service_disabled` or `processor_unsupported` (in any state the banner shows) gives its own plain message and NO button (see `STRIPE_READER_BANNER_REASONS`: \"Card readers are not available in a sandbox account.\", \"Card readers are turned off for this account.\", \"Card readers are not available with this payment processor.\"; Spanish in the dictionary); the banner still appears only in its listed states (no_reader, unsupported_only, merchant_not_ready, reader_offline).\n * `hardwareShopAvailable` false: \"How to get a card reader\", the same `order` output; `merchant_not_ready` says payments must be\n * set up first and offers \"Set up payments\" (\"Reconnect payments\" when the account must be reconnected; `setup`). The container is always in the DOM (it mounts when the panel opens, the host never gates anything on the read); the alert appears when the answer\n * arrives. The readiness is read FRESH on every start and every `refreshKey` change (and `refresh()`), never cached or polled; a failed or slow read (over `readinessTimeoutMs`) or an offline browser shows nothing and asks nothing more. No HTTP: the host's `getReadiness` calls its own backend.\n */\n@Component({\n selector: 'ui-stripe-reader-banner',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n // the host is `hidden` (display: none) while the banner shows nothing, so a flex / gap parent (the payment panel) leaves no empty gap\n host: { '[hidden]': '!shown()' },\n imports: [AlertComponent, ButtonComponent],\n template: `\n <div class=\"srb\" data-testid=\"reader-banner\" [attr.data-state]=\"shownState()\">\n @if (shown(); as r) {\n <ui-alert variant=\"info\" [quiet]=\"true\" data-testid=\"reader-banner-message\">\n <span class=\"srb-line\">{{ message() }}</span>\n @if (!reasonKey()) {\n <!-- a sandbox / service-off / unsupported-processor reason has no action: only the message -->\n <span class=\"srb-actions\">\n @if (r.state === 'merchant_not_ready') {\n <ui-button variant=\"link\" size=\"sm\" data-testid=\"reader-banner-setup\" (click)=\"setup.emit()\">{{ labels.t(r.reason === 'reconnect_required' ? 'stripeReader.status.reconnect' : 'stripeReader.status.setup') }}</ui-button>\n } @else if (notConnected()) {\n <!-- a reader exists but is not connected: the ONLY action is to connect it -->\n <ui-button variant=\"link\" size=\"sm\" data-testid=\"reader-banner-connect\" (click)=\"connect.emit()\">{{ labels.t('stripeReader.status.connectYours') }}</ui-button>\n } @else {\n <!-- no reader yet: the ONLY action is how to get one -->\n <ui-button variant=\"link\" size=\"sm\" data-testid=\"reader-banner-get\" (click)=\"order.emit()\">{{ labels.t(hardwareShopAvailable() ? 'stripeReader.status.get' : 'stripeReader.status.getInfo') }}</ui-button>\n }\n </span>\n }\n </ui-alert>\n }\n </div>\n `,\n styles: [`\n ui-stripe-reader-banner { display: block; min-width: 0; }\n ui-stripe-reader-banner[hidden] { display: none; }\n ui-stripe-reader-banner .srb-line { margin-right: 8px; }\n ui-stripe-reader-banner .srb-actions { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }\n `],\n})\nexport class StripeReaderBannerComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly destroyRef = inject(DestroyRef);\n\n /** The host's readiness call (`GET /v1/terminal/readiness`, through its own backend). Called FRESH every time. */\n readonly getReadiness = input<StripeReaderGetReadinessFn | null>(null);\n /** Any value that changes when the host knows the readers changed (a reader was connected, an order was placed): every change reads the readiness again. */\n readonly refreshKey = input<unknown>(null);\n /** `true` (default): \"Get a card reader\" opens the host's order flow. `false`: \"How to get a card reader\" and the host opens an info card. Same `order` output. */\n readonly hardwareShopAvailable = input(true);\n /** Kept for backward compatibility: there is no connected line any more, so it changes nothing. */\n readonly hideReady = input(false);\n /** A read slower than this shows nothing (ms). */\n readonly readinessTimeoutMs = input(4000);\n /** Managed environments where `navigator.onLine === false` is a false negative: do not treat the browser's offline flag as offline (default false). */\n readonly offlineOverride = input(false);\n /** `true` while the banner is kept but not shown (the panel hides it after a payment was taken): it asks the host nothing; shown again it reads once only if a read was asked for meanwhile. */\n readonly paused = input(false);\n\n /** \"Connect Your Reader\" (a reader that is not connected): the host opens its pairing screen. */\n readonly connect = output<void>();\n /** \"Get a card reader\" / \"How to get a card reader\": the host opens its order flow or an info card. */\n readonly order = output<void>();\n /** \"Set up payments\" / \"Reconnect payments\": the host opens payment setup. */\n readonly setup = output<void>();\n /** The banner's readiness state whenever it changes (`{ state, stale, at, ready }`; `state` is `checking` when the last read failed; never `unknown`). `ui-payment-side-panel` re-emits it as `(readerState)`. */\n readonly stateChange = output<PaymentReaderState>();\n\n private readonly confirmed = signal<{ readiness: StripeReaderReadiness; at: Date } | null>(null);\n private readonly failed = signal(false);\n private readonly offline = signal(false);\n private run = 0;\n private destroyed = false;\n private readWhenShown = false;\n\n /** The answer on screen: only a CONFIRMED, latest answer in which the organization has no usable reader. */\n protected readonly shown = computed((): StripeReaderReadiness | null => {\n const c = this.confirmed();\n return c && !this.failed() && !this.offline() && STRIPE_READER_BANNER_STATES.includes(c.readiness.state) ? c.readiness : null;\n });\n readonly shownState = computed(() => this.shown()?.state ?? 'none');\n /** A reader exists but is not connected (`reader_offline`). */\n protected readonly notConnected = computed(() => STRIPE_READER_NOT_CONNECTED_STATES.includes(this.shown()?.state as StripeReaderReadiness['state']));\n /** The label key of a reason with its own no-button wording (`sandbox`, `service_disabled`, `processor_unsupported`), else null. Never for a not-connected reader (its message is about the reader). */\n protected readonly reasonKey = computed(() => (this.notConnected() ? null : readerBannerReasonKey(this.shown()?.reason)));\n protected readonly message = computed(() => this.labels.t(this.reasonKey() ?? (this.notConnected() ? 'stripeReader.banner.notConnected' : this.shown()?.state === 'merchant_not_ready' ? 'stripeReaderBanner.setupFirst' : 'stripeReaderBanner.getReader')));\n\n constructor() {\n this.destroyRef.onDestroy(() => { this.destroyed = true; });\n const syncOffline = (): void => { this.offline.set(builtInReadinessReasons(this.offlineOverride()).includes('offline')); };\n if (typeof window !== 'undefined') {\n const update = (): void => { syncOffline(); untracked(() => { if (!this.offline()) void this.refresh(); }); };\n window.addEventListener('online', update);\n window.addEventListener('offline', update);\n this.destroyRef.onDestroy(() => { window.removeEventListener('online', update); window.removeEventListener('offline', update); });\n }\n effect(() => {\n const read = this.getReadiness();\n this.refreshKey();\n this.offlineOverride();\n untracked(() => { syncOffline(); if (read) void this.refresh(); });\n });\n effect(() => {\n const paused = this.paused();\n untracked(() => { if (!paused && this.readWhenShown) { this.readWhenShown = false; void this.refresh(); } });\n });\n effect(() => {\n const c = this.confirmed();\n const failed = this.failed();\n const next: PaymentReaderState | null = c && !failed ? { state: c.readiness.state, stale: false, at: c.at, ready: c.readiness.state === 'reader_ready' } : failed ? { state: 'checking', stale: true, at: null, ready: false } : null;\n untracked(() => { if (next) this.stateChange.emit(next); });\n });\n }\n\n /** Reads the readiness NOW. Never cached. A failed, slow or `checking` answer shows nothing; offline asks nothing. */\n async refresh(): Promise<void> {\n const read = this.getReadiness();\n if (!read || this.destroyed || this.offline()) return;\n if (untracked(() => this.paused())) { this.readWhenShown = true; return; }\n const run = ++this.run;\n let result: StripeReaderReadiness | null = null;\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<'timeout'>(resolve => { timer = setTimeout(() => resolve('timeout'), Math.max(1, this.readinessTimeoutMs())); });\n const raw = await Promise.race([callHost(() => read()), timeout]);\n result = raw === 'timeout' ? null : normalizeReadiness(raw);\n } catch { result = null; } finally { if (timer) clearTimeout(timer); }\n if (this.destroyed || run !== this.run) return;\n if (result && result.state !== 'checking') {\n const at = result.checkedAt ? new Date(result.checkedAt) : new Date();\n this.confirmed.set({ readiness: result, at: Number.isNaN(at.getTime()) ? new Date() : at });\n this.failed.set(false);\n } else {\n this.failed.set(true);\n }\n }\n}\n","import { ChangeDetectionStrategy, Component, TemplateRef, forwardRef, input, output, viewChild, computed, signal } from '@angular/core';\nimport { callHost, PAYMENT_METHOD_PLUGIN, PAYMENT_READINESS_EVERY_MS, PAYMENT_READINESS_TIMEOUT_MS, PAYMENT_REQUEST_TIMEOUT_MS, PAYMENT_STATUS_CHECK_TIMEOUT_MS, PAYMENT_STATUS_FAIL_GRACE_MS, PAYMENT_AUTH_TIMEOUT_MS, PAYMENT_STATUS_POLL_MAX_MS, PAYMENT_STATUS_POLL_MS, PaymentMethodPlugin, type CheckPaymentStatusFn, type PaymentAttemptControls, type HostResult, type PaymentMethodBodyContext, type PaymentPendingCheckInfo, type PaymentPendingCheckResult, type PaymentPluginMethod, type ReadinessCheckFn } from '@forgeroute/ui/payments';\nimport type { StripeBillingDetails } from '../stripe-payment/stripe-payment.component';\nimport type { StripeReaderConfig, StripeReaderPayment } from '../stripe-reader/stripe-reader.models';\nimport { PaymentStripeBodyComponent } from './payment-stripe-body.component';\nimport { StripeReaderBannerComponent } from '../stripe-reader/stripe-reader-banner.component';\nimport { STRIPE_READER_LOST_ANSWER_GRACE_MS } from '../stripe-reader/stripe-reader.flow';\nimport { paymentBaseAmount, readerErrorInfo } from '../stripe-reader/stripe-reader.models';\nimport { STRIPE_METHOD_TEXTS, STRIPE_PAYMENT_METHODS, type StripeReaderLeftPending, type StripeFeeContext, type StripeFees, type StripeIntentContext, type StripeIntentInfo, stripeMethodLabel } from './payment-stripe-method.models';\n\n/**\n * Adds LIVE Card and ACH (Stripe) to `ui-payment-side-panel`. Put it inside the panel only for customers who use Stripe: its presence replaces the\n * record-only Card / ACH (last 4 digits) with the Payment Element; remove it and the panel is record-only again.\n *\n * <ui-payment-side-panel ...>\n * @if (stripeEnabled()) {\n * <ui-payment-stripe-method [publishableKey]=\"key\" [createIntent]=\"createIntent\" [finalize]=\"finalize\" [cancel]=\"cancel\" />\n * }\n * </ui-payment-side-panel>\n *\n * The host owns the HTTP: `createIntent(ctx)` (POST create-payment-intent) answers `{ clientSecret, paymentIntentId, fees... }`, `finalize(info)` (POST\n * process-payment) runs after Stripe took the payment, `cancel(info)` cancels an abandoned intent. Outcomes arrive as the panel's `outcome` events with\n * kind `'plugin'` and codes `paid`, `processing`, `verification`, `finalize-failed` and `failed`.\n */\n@Component({\n selector: 'ui-payment-stripe-method',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [PaymentStripeBodyComponent],\n providers: [{ provide: PAYMENT_METHOD_PLUGIN, useExisting: forwardRef(() => StripePaymentMethodComponent) }],\n host: { style: 'display: none' },\n template: `<ng-template #body let-ctx><ui-payment-stripe-body [ctx]=\"ctx\" [config]=\"self\" /></ng-template>`,\n})\nexport class StripePaymentMethodComponent extends PaymentMethodPlugin {\n protected readonly self = this;\n /** Creates the PaymentIntent on the host's backend (called when the payer presses Pay). */\n readonly createIntent = input<((ctx: StripeIntentContext) => HostResult<StripeIntentInfo>) | null>(null);\n /** Records the payment after Stripe accepted it (succeeded, processing or needs bank verification). A failure here is reported, the payment still counts as taken. */\n readonly finalize = input<((info: StripeIntentInfo) => HostResult<unknown>) | null>(null);\n /** Cancels an intent that was created but not paid (panel closed, another method, a retry). */\n readonly cancel = input<((info: StripeIntentInfo) => HostResult<unknown>) | null>(null);\n /** Optional fee preview before paying; its `totalAmount` becomes the amount of the Payment Element (it must equal the intent's amount). */\n readonly estimateFees = input<((ctx: StripeFeeContext) => HostResult<StripeFees>) | null>(null);\n readonly publishableKey = input<string | null>(null);\n /** Connect account for direct charges; Stripe.js is loaded for it. */\n readonly stripeAccount = input<string | null>(null);\n readonly billingDetails = input<StripeBillingDetails | null>(null);\n readonly appearance = input<Record<string, unknown> | null>(null);\n /** The methods this plugin takes over (default: Card and ACH / Bank Transfer). Pass `[{ value: 'CARD', label: 'Card' }]` for cards only. */\n readonly methodListInput = input<readonly PaymentPluginMethod[] | null>(null, { alias: 'methodList' });\n readonly methodList = computed((): readonly PaymentPluginMethod[] => this.methodListInput() ?? STRIPE_PAYMENT_METHODS.map(m => ({ ...m, label: stripeMethodLabel(m.value, m.label) })));\n /** How long a fee estimate may take before Pay is released and \"Try again\" is offered (ms). */\n readonly estimateTimeoutMs = input(10000);\n /** The payer covers fees, so the intent amount is payment + fees: a rejected or empty estimate keeps Pay off (with \"Try again\") instead of falling back to the base amount, which Stripe would reject as a mismatch. */\n readonly feesRequired = input(false);\n /**\n * Opt-in (default off: the estimate and the intent request are exactly as before). For a fee schedule that depends on the card's funding (a platform fee on credit cards only):\n * once the typed card is complete a ConfirmationToken is made from the Payment Element, its funding is passed to `estimateFees` (`ctx.funding`, `ctx.confirmationTokenId`) so\n * the fee rows and the total update (credit vs debit vs bank account), and `createIntent` gets `confirmationTokenId` + `funding` for the backend's own lookup. Needs `[estimateFees]`.\n */\n readonly fundingPreview = input(false);\n // ── Duplicate-payment protection and readiness gate (opt-in: with `duplicateProtection` off the plugin behaves exactly as before) ──\n /** Turns on the duplicate-charge protection and the readiness gate of the Payment Element (docs: \"Duplicate-payment protection\", \"Readiness gate\"). Default off. */\n readonly duplicateProtection = input(false);\n /**\n * The payable this is for (an invoice, a balance, a payment link). While an attempt is undecided its opaque marker (key, amount, method) is stored under it in `localStorage`, so a RELOAD or a\n * SECOND TAB of the same payable starts locked (unknown) with the same attempt key. Without it the protection covers this page instance only. Nothing else is stored.\n */\n readonly payableRef = input<string | null>(null);\n /** A key the host supplies; empty = generated per payment attempt session (it arrives in `createIntent(ctx).attemptKey`). */\n readonly attemptKey = input<string | null>(null);\n /** The host's status check by attempt key: resolves an UNKNOWN outcome (timeout, offline mid-flight, abandoned 3-D Secure challenge). */\n readonly checkStatus = input<CheckPaymentStatusFn | null>(null);\n /** The payable is paid (host re-render, back navigation): Pay stays locked for good. */\n readonly paid = input(false);\n /** The host reports an ambiguous result of ITS charge call: \"Checking your payment...\" while true. */\n readonly hostPending = input(false);\n readonly statusPollMs = input(PAYMENT_STATUS_POLL_MS);\n readonly statusPollMaxMs = input(PAYMENT_STATUS_POLL_MAX_MS);\n /** A status check slower than this counts as unknown (ms). */\n readonly statusCheckTimeoutMs = input(PAYMENT_STATUS_CHECK_TIMEOUT_MS);\n /** While the attempt's own request is unsettled, a status answer `failed` is ignored for this long (ms). */\n readonly statusFailGraceMs = input(PAYMENT_STATUS_FAIL_GRACE_MS);\n /** Offer \"Start over\" after the status polling window (a new attempt with a NEW key). Turn it on ONLY when your backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key: that rule is what makes it safe. */\n readonly allowStartOver = input(false);\n /** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a payment because of the browser's offline flag (default false). */\n readonly offlineOverride = input(false);\n /** The request timeout is replaced by this while a 3-D Secure challenge or the bank window is open (ms). */\n readonly authTimeoutMs = input(PAYMENT_AUTH_TIMEOUT_MS);\n /** How long ONE confirmation (intent creation + Stripe confirmation) may take before the outcome counts as unknown (ms). */\n readonly confirmTimeoutMs = input(PAYMENT_REQUEST_TIMEOUT_MS);\n /** The host's readiness endpoint (`GET /api/payments/ready`): `{ ready, reasons[] }`. */\n readonly readinessCheck = input<ReadinessCheckFn | null>(null);\n readonly readinessTimeoutMs = input(PAYMENT_READINESS_TIMEOUT_MS);\n readonly readinessEveryMs = input(PAYMENT_READINESS_EVERY_MS);\n // ── Card reader mode (opt-in: with no `[reader]` nothing changes) ──\n /**\n * The card-reader calls. With it, the method Card gets a choice \"Card reader | Enter card manually\" above the form and the READER is the default as soon as the first readiness answer says `reader_ready`\n * (`[readerFirst]`); otherwise manual stays the default and one reader banner explains why. The payer can always switch to the manual card; switching away while a reader payment waits first cancels it through\n * `reader.cancelPayment`. See docs/card-readers.md.\n */\n readonly reader = input<StripeReaderConfig | null>(null);\n /** The reader is the default when it is ready (default true). `false` keeps manual as the default and only offers the choice. */\n readonly readerFirst = input(true);\n /** \"Connect Your Reader\" (banner, a reader that is not connected): the host opens its pairing panel (`ui-stripe-readers`). */\n readonly readerConnect = output<void>();\n /** \"Get a card reader\": the host opens its order flow. */\n readonly readerOrder = output<void>();\n /** \"Set up payments\": the host opens payment setup. */\n readonly readerSetup = output<void>();\n /**\n * Library source 2026-11-21: how often (ms) the waiting reader payment's status is read (default 2000; clamped to 500..30 000). Wins over `reader.pollMs`. Unset (`null`) = `reader.pollMs`, else 2000.\n */\n readonly readerPollMs = input<number | null>(null);\n /**\n * Library source 2026-11-21: `true` while a reader payment is open (starting, waiting for the tap, declined and retryable, retrying, cancelling or recovering a lost answer), `false` when it is idle or\n * finished. Emitted only when the value changes (nothing at start), so a host can block its other pay actions and keep the panel locked meanwhile (see also `ui-payment-side-panel`'s `(busyChange)`).\n * It is NEVER sent as `false` for a reader payment that may still exist at the processor: when the body is destroyed or the reader screen is removed while one is open, `readerLeftPending` is emitted instead.\n */\n readonly readerBusyChange = output<boolean>();\n /**\n * Library source 2026-11-21: the body went away (panel closed, method changed, plugin removed) or the reader screen was removed (reader switched off) while a reader payment was open. No `readerBusyChange(false)` is sent for it (the payment may\n * still exist): the host keeps its other pay actions blocked and reads the server's own hold. Inside `ui-payment-side-panel` bind the panel's `(leftPending)` instead (it also covers manual confirmations, terminal payments and record requests).\n */\n readonly readerLeftPending = output<StripeReaderLeftPending>();\n // ── Blocked (opt-in: unset = nothing changes) ──\n /**\n * Library source 2026-11-21: while `true` the Pay button of this method is disabled and `pay()` does nothing, the reader's \"Send to the reader\" starts nothing (a reader payment that is already open keeps its \"Try again\" and Cancel) and the Reader | Manual\n * choice cannot be switched; `blockedReason` is shown as a `role=\"status\"` message. A payment that is already running is not cancelled and keeps its Cancel. Inside `ui-payment-side-panel` use the\n * panel's own `[blocked]` instead (it also blocks the method select and shows the message once); this input is for a plugin used on its own.\n */\n readonly blocked = input(false);\n /** Why it is blocked (shown while `blocked`). Empty = the default text of the label `paymentBlocked.default`. */\n readonly blockedReason = input('');\n readonly receiptNoteInput = input<string | null>(null, { alias: 'receiptNote' });\n readonly receiptNote = computed((): string => this.receiptNoteInput() ?? STRIPE_METHOD_TEXTS.receiptNote);\n\n private readonly body = viewChild<TemplateRef<PaymentMethodBodyContext>>('body');\n\n // ── The host resolves an undecided attempt itself (without a status check): the body registers its controls here ──\n private readonly controls = signal<PaymentAttemptControls | null>(null);\n /** @internal The body registers itself. */\n attachControls(controls: PaymentAttemptControls): void { this.controls.set(controls); }\n /** @internal The body leaves. */\n detachControls(controls: PaymentAttemptControls): void { if (this.controls() === controls) this.controls.set(null); }\n /** The host's charge of this payment is ambiguous (its call timed out): the plugin shows \"Checking your payment...\" and stays locked (see `checkStatus`). */\n markUnknown(): void { this.controls()?.markUnknown(); }\n /** The host's charge succeeded: the plugin records it (paid + complete) and locks the payable. */\n markSucceeded(): void { this.controls()?.markSucceeded(); }\n /** The host's charge was DEFINITIVELY refused: the plugin unlocks with a NEW attempt key. */\n markFailed(): void { this.controls()?.markFailed(); }\n /** NOTHING was sent to the processor: the plugin unlocks and the attempt key is KEPT (the backend must still answer the state of an attempt it already holds for that key). */\n markNotCharged(): void { this.controls()?.markNotCharged(); }\n /** The host starts a deliberate SECOND payment of this payable (an explicit \"pay again\" flow): forgets the paid state this form saw, removes the succeeded record and moves the epoch so the next attempt has a NEW key. Does nothing against the host's own `paid` input. */\n resetPaid(): void { this.controls()?.resetPaid(); }\n\n\n /** The attempt this plugin last started (a reader payment or a manual card confirmation), kept here because the body is gone when the panel closes: what the panel's \"Check again\" reads. */\n private remembered: { key: string; kind: 'reader' | 'manual'; amount?: number } | null = null;\n /** @internal The body names the attempt it just started. */\n rememberAttempt(key: string | undefined, kind: 'reader' | 'manual', amount?: number): void { if (key) this.remembered = { key, kind, ...(amount !== undefined ? { amount } : {}) }; }\n\n /**\n * Library round 4 (2026-11-21): the truth of the payment the panel is holding, read by ATTEMPT KEY. A reader payment is read with `reader.getPayment`, a manual card / bank confirmation with `checkStatus`.\n * `over` only when the answer proves nothing is open (a canceled / failed payment; \"never seen\" only once the hold is older than the processing window, because a slow original request may still be on its way);\n * `succeeded` when it was paid; `open` while it runs; `checking` when it cannot be told (no key, no host call, a failed read).\n */\n override async checkPending(info: PaymentPendingCheckInfo): Promise<PaymentPendingCheckResult> {\n const key = info.paymentAttemptKey ?? this.remembered?.key;\n if (!key) return { state: 'checking' };\n const known = this.remembered && this.remembered.key === key ? this.remembered : null;\n const kind = known?.kind ?? (this.reader() ? 'reader' : 'manual');\n if (kind === 'reader') {\n const reader = this.reader();\n if (!reader) return { state: 'checking' };\n let payment: StripeReaderPayment | null = null;\n try { payment = (await callHost(() => reader.getPayment({ paymentId: null, attemptKey: key }))) ?? null; } catch (error) {\n if (readerErrorInfo(error).status !== 404) return { state: 'checking' };\n payment = null;\n }\n if (!payment || typeof payment !== 'object' || typeof payment.id !== 'string') return { state: info.ageMs >= STRIPE_READER_LOST_ANSWER_GRACE_MS ? 'over' : 'checking' };\n const status = String(payment.status ?? '').toUpperCase();\n const terminal = payment.terminal?.state;\n if (status === 'SUCCEEDED' || terminal === 'succeeded') {\n const amount = paymentBaseAmount(payment) ?? known?.amount;\n return { state: 'succeeded', result: { type: 'stripe', paymentMethod: info.method, ...(amount !== undefined && amount !== null ? { amount } : {}) } };\n }\n if (status === 'CANCELED' || status === 'FAILED' || terminal === 'canceled') return { state: 'over' };\n return { state: 'open' };\n }\n const check = this.checkStatus();\n if (!check) return { state: 'checking' };\n let answer: string;\n try { answer = String(await callHost(() => check(key))); } catch { return { state: 'checking' }; }\n switch (answer) {\n case 'succeeded': return { state: 'succeeded', result: { type: 'stripe', paymentMethod: info.method, ...(known?.amount !== undefined ? { amount: known.amount } : {}) } };\n case 'failed': return { state: 'over' };\n case 'not_found': return { state: info.ageMs >= this.confirmTimeoutMs() + this.statusFailGraceMs() ? 'over' : 'checking' };\n case 'in_flight':\n case 'awaiting_verification': return { state: 'open' };\n default: return { state: 'checking' };\n }\n }\n\n readonly methods = this.methodList;\n readonly template = this.body;\n /** The card reader banner the panel's `[readerBanner]` renders (library source 2026-11-21): rendering this plugin in the panel is all a host needs to do for it. */\n override readonly readerBannerComponent = StripeReaderBannerComponent;\n}\n","import { ChangeDetectionStrategy, Component, DestroyRef, ViewEncapsulation, computed, effect, inject, input, output, signal, untracked, viewChildren } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { BadgeComponent } from '@forgeroute/ui/badge';\nimport { ButtonComponent, ModalComponent, UiFieldValidity, UiLabelsService, type UiLabelKey } from '@forgeroute/ui/core';\nimport { FormRowComponent } from '@forgeroute/ui/form-row';\nimport { FormSectionComponent } from '@forgeroute/ui/form-section';\nimport { LiveRegionComponent } from '@forgeroute/ui/live-region';\nimport { SelectComponent } from '@forgeroute/ui/select';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { TextInputComponent } from '@forgeroute/ui/text-input';\nimport { callHost, type HostResult } from '@forgeroute/ui/payments';\nimport { STRIPE_READER_REQUEST_TIMEOUT_MS } from './stripe-reader.flow';\nimport { StripeReaderStatusComponent } from './stripe-reader-status.component';\nimport {\n STRIPE_READER_MODELS, normalizeReadiness, readerDisplayName, readerErrorInfo,\n type StripeReader, type StripeReaderCreateLocationFn, type StripeReaderGetReadinessFn, type StripeReaderListLocationsFn, type StripeReaderLocation, type StripeReaderReadiness,\n type StripeReaderRegisterFn, type StripeReaderRemoveFn, type StripeReaderRenameFn,\n} from './stripe-reader.models';\n\n/** What `(outcome)` reports. */\nexport type StripeReadersOutcome =\n | { kind: 'registered'; reader: StripeReader }\n | { kind: 'renamed'; reader: StripeReader }\n | { kind: 'removed'; readerId: string }\n | { kind: 'location-created'; location: StripeReaderLocation }\n | { kind: 'failed'; action: 'load' | 'register' | 'rename' | 'remove' | 'location'; code: string; message: string };\n\n/** `RegisterReaderDto.registrationCode` of the payments service (forgeroute-payments `terminal.dto.ts`). */\nconst CODE_PATTERN = /^[A-Za-z0-9-]{3,100}$/;\n\ntype Busy = '' | 'load' | 'register' | 'rename' | 'remove' | 'location';\n\n/**\n * Staff screen to connect and manage card readers (put it inside the host's own side panel). Everything is a host call (the browser never talks to the payments service):\n *\n * - the banner is the SAME single readiness state as the payment screen (`ui-stripe-reader-status`, without \"Connect a reader\": you are already here);\n * - \"Connect a reader\": the registration code the reader shows (Stripe Reader S700 / S710: Settings, generate a pairing code; BBPOS WisePOS E: press 0-7-1-3-9 on the home screen), a name and a\n * location. The code is typed once, cleared from the form BEFORE the call and never shown, stored or logged again, success or failure;\n * - the list shows each reader with its model and a status badge (Online / Offline / Registering, Busy, Not supported) and lets staff rename or remove it (removing asks for confirmation; a reader that\n * holds a payment is refused with `reader_busy`: cancel the payment first);\n * - \"Get a card reader\" is an output: the host opens its order flow.\n *\n * <ui-stripe-readers [getReadiness]=\"readiness\" [registerReader]=\"register\" [renameReader]=\"rename\" [removeReader]=\"remove\" [listLocations]=\"locations\" [createLocation]=\"createLocation\"\n * (getReader)=\"openOrder()\" (changed)=\"refreshPayments()\" />\n */\n@Component({\n selector: 'ui-stripe-readers',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [FormsModule, AlertComponent, BadgeComponent, ButtonComponent, FormRowComponent, FormSectionComponent, LiveRegionComponent, ModalComponent, SelectComponent, SkeletonComponent, StripeReaderStatusComponent, TextInputComponent],\n template: `\n <ui-live-region data-testid=\"readers-live\" [message]=\"announcement()\" />\n <div class=\"srs-readers\">\n <ui-stripe-reader-status [readiness]=\"readiness()\" [loading]=\"busy() === 'load' && !readiness()\" [hideConnect]=\"true\" (getReader)=\"getReader.emit()\" (recheck)=\"load()\" (openSetup)=\"openSetup.emit()\" />\n\n @if (error(); as err) {\n <ui-alert variant=\"danger\" [quiet]=\"true\" data-testid=\"readers-error\" [attr.data-action]=\"err.action\">{{ err.text }}</ui-alert>\n }\n\n <section class=\"srs-section\" [attr.aria-labelledby]=\"ids + '-list-title'\">\n <h3 class=\"srs-h\" [id]=\"ids + '-list-title'\">{{ labels.t('stripeReaders.list.title') }}</h3>\n @if (busy() === 'load' && !readiness()) {\n <ui-skeleton [height]=\"44\" [ariaLabel]=\"labels.t('stripeReader.status.loading')\" />\n } @else if (readers().length === 0) {\n <p class=\"srs-muted\" data-testid=\"readers-empty\">{{ labels.t('stripeReaders.list.empty') }}</p>\n } @else {\n <ul class=\"srs-list\" data-testid=\"readers-list\">\n @for (reader of readers(); track reader.id) {\n <li class=\"srs-item\" data-testid=\"reader-item\" [attr.data-reader-id]=\"reader.id\">\n @if (renamingId() === reader.id) {\n <ui-text-input class=\"srs-rename\" [label]=\"labels.t('stripeReaders.rename.label')\" [required]=\"true\" [maxlength]=\"100\" [ngModel]=\"renameValue()\" (ngModelChange)=\"renameValue.set($event ?? '')\"\n [showErrors]=\"renameTouched()\" inputTestId=\"reader-rename-input\" />\n <div class=\"srs-actions\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"reader-rename-save\" [loading]=\"busy() === 'rename'\" [disabled]=\"busy() !== ''\" (click)=\"saveRename(reader)\">{{ labels.t('common.save') }}</ui-button>\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-rename-cancel\" [disabled]=\"busy() === 'rename'\" (click)=\"renamingId.set('')\">{{ labels.t('common.cancel') }}</ui-button>\n </div>\n } @else {\n <div class=\"srs-item-main\">\n <strong class=\"srs-name\" data-testid=\"reader-name\">{{ name(reader) }}</strong>\n <span class=\"srs-muted\" data-testid=\"reader-model\">{{ model(reader) }}</span>\n </div>\n <div class=\"srs-badges\">\n <ui-badge [label]=\"statusLabel(reader)\" [variant]=\"statusVariant(reader)\" data-testid=\"reader-device-status\" />\n @if (reader.busy) { <ui-badge [label]=\"labels.t('stripeReaders.badge.busy')\" variant=\"amber\" data-testid=\"reader-busy\" /> }\n @if (!reader.supported) { <ui-badge [label]=\"labels.t('stripeReaders.badge.unsupported')\" variant=\"red\" data-testid=\"reader-unsupported\" /> }\n </div>\n <div class=\"srs-actions\">\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-rename\" [ariaLabel]=\"labels.t('stripeReaders.rename.for', { name: name(reader) })\" [disabled]=\"busy() !== ''\" (click)=\"startRename(reader)\">{{ labels.t('stripeReaders.rename.action') }}</ui-button>\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-remove\" [ariaLabel]=\"labels.t('stripeReaders.remove.for', { name: name(reader) })\" [ariaDescribedBy]=\"reader.busy ? ids + '-busy-' + reader.id : ''\"\n [disabled]=\"busy() !== '' || !!reader.busy\" (click)=\"askRemove(reader)\">{{ labels.t('stripeReaders.remove.action') }}</ui-button>\n </div>\n @if (reader.busy) {\n <p class=\"srs-muted srs-busy-hint\" [id]=\"ids + '-busy-' + reader.id\" data-testid=\"reader-remove-busy-hint\">{{ labels.t('stripeReaders.remove.busy') }}</p>\n }\n }\n </li>\n }\n </ul>\n }\n </section>\n\n <section class=\"srs-section\" [attr.aria-labelledby]=\"ids + '-add-title'\" data-testid=\"readers-add\">\n <h3 class=\"srs-h\" [id]=\"ids + '-add-title'\">{{ labels.t('stripeReaders.add.title') }}</h3>\n <ul class=\"srs-how\" data-testid=\"readers-how\">\n <li>{{ labels.t('stripeReaders.add.howS700') }}</li>\n <li>{{ labels.t('stripeReaders.add.howWisepos') }}</li>\n </ul>\n <p class=\"srs-muted\" data-testid=\"readers-supported\">{{ labels.t('stripeReaders.add.supported', { models: supportedModels }) }}</p>\n <ui-form-section>\n <ui-text-input [label]=\"labels.t('stripeReaders.code.label')\" [hint]=\"labels.t('stripeReaders.code.hint')\" [required]=\"true\" [maxlength]=\"100\" autocomplete=\"off\"\n [error]=\"touched() ? codeError() : ''\" [ngModel]=\"code()\" (ngModelChange)=\"code.set($event ?? '')\" [showErrors]=\"touched()\" [disabled]=\"busy() === 'register'\" inputTestId=\"reader-code\" />\n <ui-text-input [label]=\"labels.t('stripeReaders.name.label')\" [hint]=\"labels.t('stripeReaders.name.hint')\" [required]=\"true\" [maxlength]=\"100\"\n [ngModel]=\"label()\" (ngModelChange)=\"label.set($event ?? '')\" [showErrors]=\"touched()\" [disabled]=\"busy() === 'register'\" inputTestId=\"reader-label\" />\n @if (locations().length || !createLocation()) {\n <ui-select [label]=\"labels.t('stripeReaders.location.label')\" [placeholder]=\"labels.t('stripeReaders.location.placeholder')\" [required]=\"true\" [options]=\"locationOptions()\"\n [ngModel]=\"locationId()\" (ngModelChange)=\"locationId.set($event ?? '')\" [showErrors]=\"touched()\" [disabled]=\"busy() === 'register'\" data-testid=\"reader-location\" />\n }\n @if (createLocation()) {\n @if (!showNewLocation() && locations().length) {\n <div class=\"srs-actions\"><ui-button variant=\"link\" data-testid=\"reader-new-location\" (click)=\"showNewLocation.set(true)\">{{ labels.t('stripeReaders.location.new') }}</ui-button></div>\n }\n @if (showNewLocation() || !locations().length) {\n <div class=\"srs-new-location\" role=\"group\" [attr.aria-label]=\"labels.t('stripeReaders.location.new')\" data-testid=\"reader-location-form\">\n <ui-text-input [label]=\"labels.t('stripeReaders.location.name')\" [required]=\"true\" [maxlength]=\"200\" [ngModel]=\"locName()\" (ngModelChange)=\"locName.set($event ?? '')\" [showErrors]=\"locTouched()\" inputTestId=\"reader-loc-name\" />\n <ui-text-input [label]=\"labels.t('stripeReaders.location.line1')\" [required]=\"true\" [maxlength]=\"200\" autocomplete=\"street-address\" [ngModel]=\"locLine1()\" (ngModelChange)=\"locLine1.set($event ?? '')\" [showErrors]=\"locTouched()\" inputTestId=\"reader-loc-line1\" />\n <ui-form-row [cols]=\"3\">\n <ui-text-input [label]=\"labels.t('stripeReaders.location.city')\" [required]=\"true\" [maxlength]=\"100\" [ngModel]=\"locCity()\" (ngModelChange)=\"locCity.set($event ?? '')\" [showErrors]=\"locTouched()\" inputTestId=\"reader-loc-city\" />\n <ui-text-input [label]=\"labels.t('stripeReaders.location.state')\" [required]=\"true\" [maxlength]=\"100\" [ngModel]=\"locState()\" (ngModelChange)=\"locState.set($event ?? '')\" [showErrors]=\"locTouched()\" inputTestId=\"reader-loc-state\" />\n <ui-text-input [label]=\"labels.t('stripeReaders.location.postal')\" [required]=\"true\" [maxlength]=\"20\" autocomplete=\"postal-code\" [ngModel]=\"locPostal()\" (ngModelChange)=\"locPostal.set($event ?? '')\" [showErrors]=\"locTouched()\" inputTestId=\"reader-loc-postal\" />\n </ui-form-row>\n <div class=\"srs-actions\">\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"reader-loc-create\" [loading]=\"busy() === 'location'\" [disabled]=\"busy() !== ''\" (click)=\"createNewLocation()\">{{ labels.t('stripeReaders.location.create') }}</ui-button>\n @if (locations().length) { <ui-button variant=\"ghost\" size=\"sm\" data-testid=\"reader-loc-cancel\" [disabled]=\"busy() === 'location'\" (click)=\"showNewLocation.set(false)\">{{ labels.t('common.cancel') }}</ui-button> }\n </div>\n </div>\n }\n }\n </ui-form-section>\n <div class=\"srs-actions\">\n <ui-button variant=\"primary\" data-testid=\"reader-register\" [loading]=\"busy() === 'register'\" [disabled]=\"busy() !== '' || (touched() && hasInvalid())\" (click)=\"register()\">{{ busy() === 'register' ? labels.t('stripeReaders.add.connecting') : labels.t('stripeReaders.add.connect') }}</ui-button>\n </div>\n </section>\n </div>\n\n <ui-modal [open]=\"!!removing()\" [title]=\"labels.t('stripeReaders.remove.title')\" maxWidth=\"440px\" [describedBy]=\"ids + '-remove-text'\" [busy]=\"busy() === 'remove'\" (close)=\"cancelRemove()\" dialogTestId=\"reader-remove-dialog\">\n <p class=\"srs-text\" [id]=\"ids + '-remove-text'\" data-testid=\"reader-remove-text\">{{ removeText() }}</p>\n @if (removeError()) { <ui-alert variant=\"danger\" [quiet]=\"true\" data-testid=\"reader-remove-error\">{{ removeError() }}</ui-alert> }\n <ui-button modal-footer-left variant=\"secondary\" size=\"sm\" data-testid=\"reader-remove-cancel\" [disabled]=\"busy() === 'remove'\" (click)=\"cancelRemove()\">{{ labels.t('common.cancel') }}</ui-button>\n <ui-button modal-footer-right variant=\"danger\" size=\"sm\" data-testid=\"reader-remove-confirm\" [loading]=\"busy() === 'remove'\" [disabled]=\"busy() === 'remove'\" (click)=\"confirmRemove()\">{{ labels.t('stripeReaders.remove.confirm') }}</ui-button>\n </ui-modal>\n `,\n styles: [`\n ui-stripe-readers { display: block; min-width: 0; }\n ui-stripe-readers .srs-readers { display: flex; flex-direction: column; gap: 16px; }\n ui-stripe-readers .srs-section { display: flex; flex-direction: column; gap: 10px; }\n ui-stripe-readers .srs-h { margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--ui-psp-text, #1e293b); }\n ui-stripe-readers .srs-muted { margin: 0; font-size: 0.8125rem; color: var(--ui-psp-muted, #475569); }\n ui-stripe-readers .srs-text { margin: 0 0 12px; font-size: 0.9375rem; }\n ui-stripe-readers .srs-list, ui-stripe-readers .srs-how { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }\n ui-stripe-readers .srs-how { list-style: disc; padding-left: 18px; font-size: 0.875rem; color: var(--ui-psp-text, #1e293b); }\n ui-stripe-readers .srs-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; border: 1px solid var(--ui-psp-border, #e2e8f0); border-radius: 10px; }\n ui-stripe-readers .srs-item-main { display: flex; flex-direction: column; flex: 1 1 160px; min-width: 0; }\n ui-stripe-readers .srs-name { overflow-wrap: anywhere; }\n ui-stripe-readers .srs-badges, ui-stripe-readers .srs-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n ui-stripe-readers .srs-busy-hint { flex: 1 1 100%; }\n ui-stripe-readers .srs-rename { flex: 1 1 200px; min-width: 0; }\n ui-stripe-readers .srs-new-location { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px dashed var(--ui-psp-border, #cbd5e1); border-radius: 10px; }\n @media (forced-colors: active) { ui-stripe-readers .srs-item, ui-stripe-readers .srs-new-location { border-color: CanvasText; } }\n `],\n})\nexport class StripeReadersComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly destroyRef = inject(DestroyRef);\n private static seq = 0;\n /** Unique per instance: two screens on one page never share an id. */\n protected readonly ids = `srd-${++StripeReadersComponent.seq}`;\n\n /** Reads `GET /v1/terminal/readiness` through the host: the readers and the ONE state. */\n readonly getReadiness = input<StripeReaderGetReadinessFn | null>(null);\n /** Registers a reader (`POST /v1/terminal/readers`). */\n readonly registerReader = input<StripeReaderRegisterFn | null>(null);\n readonly renameReader = input<StripeReaderRenameFn | null>(null);\n /** Deletes a reader. Refused with 409 `reader_busy` while a payment waits on it. */\n readonly removeReader = input<StripeReaderRemoveFn | null>(null);\n /** The locations a reader can be registered to (`GET /v1/terminal/locations`). */\n readonly listLocations = input<StripeReaderListLocationsFn | null>(null);\n /** Creates a location (`POST /v1/terminal/locations`); without it only existing locations can be chosen. */\n readonly createLocation = input<StripeReaderCreateLocationFn | null>(null);\n /** The label the new reader's name starts with (empty by default). */\n readonly defaultLabel = input('');\n /** The value the address country is created with. */\n readonly country = input('US');\n /** A host call (read, register, rename, remove, create location) slower than this is unreachable (ms): the screen says so, becomes usable again and reads the list again (the call may have gone through). */\n readonly requestTimeoutMs = input(STRIPE_READER_REQUEST_TIMEOUT_MS);\n\n /** \"Get a card reader\": the host opens its order flow. */\n readonly getReader = output<void>();\n /** \"Set up payments\". */\n readonly openSetup = output<void>();\n /** A reader was added, renamed or removed (the host refreshes whatever shows readers). */\n readonly changed = output<void>();\n readonly outcome = output<StripeReadersOutcome>();\n\n protected readonly readiness = signal<StripeReaderReadiness | null>(null);\n protected readonly readers = computed(() => this.readiness()?.readers ?? []);\n protected readonly locations = signal<readonly StripeReaderLocation[]>([]);\n protected readonly busy = signal<Busy>('');\n protected readonly error = signal<{ action: string; text: string } | null>(null);\n protected readonly announcement = signal('');\n protected readonly supportedModels = STRIPE_READER_MODELS.map(m => m.model).join(', ');\n\n // the form: the registration code lives here only until the click\n protected readonly code = signal('');\n protected readonly label = signal('');\n protected readonly locationId = signal('');\n protected readonly touched = signal(false);\n protected readonly showNewLocation = signal(false);\n protected readonly locName = signal('');\n protected readonly locLine1 = signal('');\n protected readonly locCity = signal('');\n protected readonly locState = signal('');\n protected readonly locPostal = signal('');\n protected readonly locTouched = signal(false);\n protected readonly renamingId = signal('');\n protected readonly renameValue = signal('');\n protected readonly renameTouched = signal(false);\n protected readonly removing = signal<StripeReader | null>(null);\n protected readonly removeError = signal('');\n\n private readonly fields = viewChildren(UiFieldValidity);\n /** The same rule as the service (`registrationCode`: 3 to 100 letters, digits or hyphens): an invalid code is never sent. Empty is the built-in \"required\" message. */\n protected readonly codeError = computed(() => (this.code().trim() && !CODE_PATTERN.test(this.code().trim()) ? this.labels.t('stripeReaders.code.invalid') : ''));\n protected readonly hasInvalid = computed(() => this.fields().some(f => f.invalid()) || !this.code().trim() || !!this.codeError() || !this.label().trim() || !this.locationId());\n protected readonly locationOptions = computed(() => this.locations().map(l => ({ value: l.id, label: l.displayName })));\n protected readonly removeText = computed(() => this.labels.t('stripeReaders.remove.text', { name: this.removing() ? readerDisplayName(this.removing()) : '' }));\n private destroyed = false;\n private loadRun = 0;\n\n /** Runs one host call raced against the request timeout (a call that never answers cannot leave the screen busy forever); a timeout rejects with `code: 'request_timeout'`. */\n private async call<T>(thunk: () => HostResult<T>): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<never>((_, reject) => { timer = setTimeout(() => reject(Object.assign(new Error('request timeout'), { status: null, code: 'request_timeout' })), Math.max(1, this.requestTimeoutMs())); });\n return await Promise.race([callHost(thunk), timeout]);\n } finally { if (timer) clearTimeout(timer); }\n }\n\n constructor() {\n effect(() => { const start = this.defaultLabel(); untracked(() => { if (!this.label()) this.label.set(start); }); });\n this.destroyRef.onDestroy(() => { this.destroyed = true; this.code.set(''); });\n effect(() => { const read = this.getReadiness(); untracked(() => { if (read) void this.load(); }); });\n effect(() => { const list = this.listLocations(); untracked(() => { if (list) void this.loadLocations(list); }); });\n }\n\n protected name(reader: StripeReader): string { return readerDisplayName(reader); }\n protected model(reader: StripeReader): string { return reader.model || STRIPE_READER_MODELS.find(m => m.deviceType === reader.deviceType)?.model || reader.deviceType || ''; }\n protected statusLabel(reader: StripeReader): string {\n return this.labels.t(reader.status === 'online' ? 'stripeReaders.status.online' : reader.status === 'registering' ? 'stripeReaders.status.registering' : 'stripeReaders.status.offline');\n }\n protected statusVariant(reader: StripeReader): 'green' | 'slate' | 'sky' { return reader.status === 'online' ? 'green' : reader.status === 'registering' ? 'sky' : 'slate'; }\n\n /** Reads the readiness (the list and the banner). A failed or slow read leaves the list as it was and says so. */\n async load(quiet = false): Promise<void> {\n const read = this.getReadiness();\n if (!read || this.destroyed) return;\n const run = ++this.loadRun;\n if (this.busy() === '' && !quiet) this.busy.set('load');\n try {\n const raw = await this.call(() => read());\n if (this.destroyed || run !== this.loadRun) return;\n this.readiness.set(normalizeReadiness(raw));\n if (this.error()?.action === 'load') this.error.set(null);\n } catch (err) {\n if (this.destroyed || run !== this.loadRun) return;\n if (!quiet) this.fail('load', err);\n } finally { if (!this.destroyed && run === this.loadRun && this.busy() === 'load') this.busy.set(''); }\n }\n\n private async loadLocations(list: StripeReaderListLocationsFn): Promise<void> {\n try {\n const result = await this.call(() => list());\n if (this.destroyed) return;\n const locations = Array.isArray(result) ? [...result] : [];\n this.locations.set(locations);\n if (!this.locationId() && locations.length === 1) this.locationId.set(locations[0].id);\n } catch (err) { if (!this.destroyed) this.fail('location', err); }\n }\n\n private fail(action: 'load' | 'register' | 'rename' | 'remove' | 'location', err: unknown): string {\n const info = readerErrorInfo(err);\n // Only the codes that mean something on this screen are worded here; the payment refusals (\"Nothing was charged\") do not belong to it.\n const key: UiLabelKey | null = info.code === 'request_timeout' ? 'stripeReaders.failed.timeout'\n : action === 'remove' && info.code === 'reader_busy' ? 'stripeReaders.remove.busy'\n : info.code === 'reader_not_supported' ? 'stripeReaders.failed.notSupported'\n : info.code === 'merchant_not_ready' || info.code === 'reconnect_required' ? 'stripeReader.status.merchant_not_ready.text'\n : null;\n // A registration failure is ALWAYS the fixed text: the service's message may repeat what was typed (the registration code), and it must not be shown, announced or emitted. Other actions show the service's text.\n const text = key ? this.labels.t(key) : action !== 'load' && action !== 'register' && info.message ? info.message : this.labels.t(`stripeReaders.failed.${action}` as UiLabelKey);\n this.error.set({ action, text });\n this.outcome.emit({ kind: 'failed', action, code: action === 'register' ? info.code.replace(/[^a-z0-9_]/g, '').slice(0, 64) : info.code, message: text });\n this.announcement.set(text);\n return text;\n }\n\n /** \"Connect reader\". The code is read, then cleared from the form BEFORE the call: it is never shown or kept again, whatever the answer. */\n async register(): Promise<void> {\n const call = this.registerReader();\n if (!call || this.busy() !== '') return;\n this.touched.set(true);\n if (this.hasInvalid()) return;\n const ctx = { registrationCode: this.code().trim(), label: this.label().trim(), locationId: this.locationId() };\n this.code.set('');\n this.busy.set('register');\n this.error.set(null);\n try {\n const reader = await this.call(() => call(ctx));\n if (this.destroyed) return;\n this.label.set(this.defaultLabel());\n this.touched.set(false);\n this.announcement.set(this.labels.t('stripeReaders.add.done', { name: readerDisplayName(reader ?? { id: '', label: ctx.label }) }));\n if (reader) this.outcome.emit({ kind: 'registered', reader });\n this.changed.emit();\n this.busy.set('');\n await this.load();\n } catch (err) {\n if (this.destroyed) return;\n this.touched.set(false); // the code is gone: the field does not shout \"required\" before the user types the next one\n const info = readerErrorInfo(err);\n this.fail('register', err);\n this.busy.set('');\n // The answer may have been lost AFTER the reader was registered (timeout, connection, 5xx): read the list again (quietly, the error above stays) so a registered reader shows up instead of being registered twice.\n if (info.status === null || info.status === 0 || info.status >= 500 || info.status === 408) { void this.load(true); }\n }\n }\n\n protected startRename(reader: StripeReader): void {\n this.renamingId.set(reader.id);\n this.renameValue.set(reader.label ?? '');\n this.renameTouched.set(false);\n }\n\n protected async saveRename(reader: StripeReader): Promise<void> {\n const call = this.renameReader();\n const value = this.renameValue().trim();\n if (!call || this.busy() !== '') return;\n if (!value) { this.renameTouched.set(true); return; }\n this.busy.set('rename');\n this.error.set(null);\n try {\n const updated = await this.call(() => call(reader.id, value));\n if (this.destroyed) return;\n this.renamingId.set('');\n this.announcement.set(this.labels.t('stripeReaders.rename.done', { name: value }));\n if (updated) this.outcome.emit({ kind: 'renamed', reader: updated });\n this.changed.emit();\n this.busy.set('');\n await this.load();\n } catch (err) {\n if (this.destroyed) return;\n this.fail('rename', err);\n this.busy.set('');\n // A rename that timed out may have gone through: read the list again (quietly, the message above stays).\n if (readerErrorInfo(err).code === 'request_timeout') void this.load(true);\n }\n }\n\n protected askRemove(reader: StripeReader): void { this.removeError.set(''); this.removing.set(reader); }\n\n protected cancelRemove(): void { if (this.busy() === 'remove') return; this.removing.set(null); this.removeError.set(''); }\n\n protected async confirmRemove(): Promise<void> {\n const call = this.removeReader();\n const reader = this.removing();\n if (!call || !reader || this.busy() !== '') return;\n this.busy.set('remove');\n this.removeError.set('');\n try {\n await this.call(() => call(reader.id));\n if (this.destroyed) return;\n this.removing.set(null);\n this.announcement.set(this.labels.t('stripeReaders.remove.done', { name: readerDisplayName(reader) }));\n this.outcome.emit({ kind: 'removed', readerId: reader.id });\n this.changed.emit();\n this.busy.set('');\n await this.load();\n } catch (err) {\n if (this.destroyed) return;\n // a reader that holds a payment is refused (reader_busy): the dialog stays open and says why\n this.removeError.set(this.fail('remove', err));\n this.busy.set('');\n // A remove that timed out may have gone through: read the list again; a reader that is gone closes the dialog and counts as removed.\n if (readerErrorInfo(err).code === 'request_timeout') {\n await this.load(true);\n if (!this.destroyed && this.removing()?.id === reader.id && !this.readers().some(r => r.id === reader.id)) {\n this.removing.set(null);\n this.removeError.set('');\n this.error.set(null);\n this.announcement.set(this.labels.t('stripeReaders.remove.done', { name: readerDisplayName(reader) }));\n this.outcome.emit({ kind: 'removed', readerId: reader.id });\n this.changed.emit();\n }\n }\n }\n }\n\n protected async createNewLocation(): Promise<void> {\n const call = this.createLocation();\n if (!call || this.busy() !== '') return;\n this.locTouched.set(true);\n const name = this.locName().trim(); const line1 = this.locLine1().trim(); const city = this.locCity().trim(); const state = this.locState().trim(); const postal = this.locPostal().trim();\n if (!name || !line1 || !city || !state || !postal) return;\n this.busy.set('location');\n this.error.set(null);\n try {\n const location = await this.call(() => call({ displayName: name, address: { line1, city, state, postalCode: postal, country: this.country() } }));\n if (this.destroyed) return;\n this.locations.update(list => [...list, location]);\n this.locationId.set(location.id);\n this.showNewLocation.set(false);\n this.locTouched.set(false);\n for (const s of [this.locName, this.locLine1, this.locCity, this.locState, this.locPostal]) s.set('');\n this.outcome.emit({ kind: 'location-created', location });\n this.announcement.set(this.labels.t('stripeReaders.location.created', { name: location.displayName }));\n } catch (err) {\n if (this.destroyed) return;\n this.fail('location', err);\n // A location that timed out may have been created: read the list of locations again so it shows up instead of being created twice.\n if (readerErrorInfo(err).code === 'request_timeout') { const list = this.listLocations(); if (list) void this.loadLocations(list); }\n } finally { if (!this.destroyed) this.busy.set(''); }\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Stripe Connect embedded components of the card reader ordering flow (D-R6). The library holds NO `@stripe/connect-js` types or code of its own: the types below are the minimal shape it uses, and the SDK is Stripe's\n * script (`https://connect-js.stripe.com/v1.0/connect.js`) that the default loader adds to the page lazily, so an app that never orders readers never downloads it, and no app needs the `@stripe/connect-js` package.\n *\n * Content-Security-Policy: Connect.js loads from `https://connect-js.stripe.com` and the embedded component runs in frames of `https://js.stripe.com` (and `https://connect-js.stripe.com`): the host app must allow them\n * (`script-src`, `frame-src`, `connect-src` as its policy requires). See docs/card-readers.md.\n */\n\n/** The Connect embedded components this library mounts (the names of the account session's `components`). */\nexport type StripeConnectEmbedName = 'terminal_hardware_shop' | 'terminal_hardware_orders';\n\n/** The element a Connect component creates (a web component). Only the setters the library calls are typed; every one is optional (a missing one is skipped). */\nexport interface StripeConnectEmbedElement extends HTMLElement {\n /** The customer finished the checkout (an order was placed). */\n setOnCheckoutFinished?(handler: (event?: unknown) => void): void;\n /** The component failed to load. */\n setOnLoadError?(handler: (event?: unknown) => void): void;\n /** The component started loading. */\n setOnLoaderStart?(handler: (event?: unknown) => void): void;\n}\n\n/** What `loadConnectAndInitialize` returns, as far as the library uses it. */\nexport interface StripeConnectInstanceLike {\n create(component: StripeConnectEmbedName): StripeConnectEmbedElement;\n logout?(): void | Promise<void>;\n}\n\n/** What the loader is given. `fetchClientSecret` is called by Connect.js whenever it needs a (new) account session secret; the library never keeps what it returns. */\nexport interface StripeConnectInitOptions {\n publishableKey: string;\n fetchClientSecret: () => Promise<string>;\n appearance?: Record<string, unknown> | null;\n}\n\n/** Loads and initialises Connect.js: resolves the instance (or `null` when it could not be created). Replaceable (tests, a self-hosted loader). */\nexport type StripeConnectLoaderFn = (options: StripeConnectInitOptions) => Promise<StripeConnectInstanceLike | null>;\n\ninterface ConnectSdkLike {\n init(options: { publishableKey: string; fetchClientSecret: () => Promise<string>; appearance?: Record<string, unknown> }): {\n create(tag: string): unknown;\n logout?(): void | Promise<void>;\n };\n}\n\n/** Stripe's own script for Connect.js (the documented no-npm route). It defines `window.StripeConnect.init`. Allowed by the CSP described above. */\nexport const STRIPE_CONNECT_SCRIPT_URL = 'https://connect-js.stripe.com/v1.0/connect.js';\n\nlet connectScript: Promise<ConnectSdkLike> | null = null;\n\nfunction loadConnectScript(): Promise<ConnectSdkLike> {\n const existing = (globalThis as { StripeConnect?: ConnectSdkLike }).StripeConnect;\n if (existing) return Promise.resolve(existing);\n connectScript ??= new Promise<ConnectSdkLike>((resolve, reject) => {\n const fail = (message: string) => { connectScript = null; reject(new Error(message)); };\n const script = document.createElement('script');\n script.src = STRIPE_CONNECT_SCRIPT_URL;\n script.async = true;\n script.onload = () => {\n const sdk = (globalThis as { StripeConnect?: ConnectSdkLike }).StripeConnect;\n if (sdk) resolve(sdk); else fail('Stripe Connect.js did not load');\n };\n script.onerror = () => fail('Stripe Connect.js could not be loaded');\n document.head.appendChild(script);\n });\n return connectScript;\n}\n\n/**\n * Loads Connect.js (internal: not part of the public API; replaceable in a spec). It is Stripe's own script added to the page the first time a shop is mounted, NOT an npm package: the library and the apps\n * need no `@stripe/connect-js` dependency and no bundler ever resolves it.\n */\nexport const connectSdkImporter: { load: () => Promise<ConnectSdkLike> } = {\n load: () => loadConnectScript(),\n};\n\n/** The default loader: loads Connect.js lazily and maps the component name to Connect.js's tag (`terminal_hardware_shop` -> `terminal-hardware-shop`; verify against Stripe's current Connect.js docs). */\nexport const defaultStripeConnectLoader: StripeConnectLoaderFn = async options => {\n const sdk = await connectSdkImporter.load();\n const instance = sdk.init({\n publishableKey: options.publishableKey,\n fetchClientSecret: options.fetchClientSecret,\n ...(options.appearance ? { appearance: options.appearance } : {}),\n });\n return {\n create: component => instance.create(component.replace(/_/g, '-')) as StripeConnectEmbedElement,\n logout: () => instance.logout?.(),\n };\n};\n\n/** How Connect.js is loaded. Provide your own to fake it in tests or to load it differently. Defaults to {@link defaultStripeConnectLoader}. */\nexport const STRIPE_CONNECT_LOADER = new InjectionToken<StripeConnectLoaderFn>('STRIPE_CONNECT_LOADER', { providedIn: 'root', factory: () => defaultStripeConnectLoader });\n","import type { HostResult } from '@forgeroute/ui/payments';\nimport { readerErrorInfo } from '../stripe-reader/stripe-reader.models';\n\n/**\n * Ordering card readers inside the app (D-R6): the host's backend calls the payments service (`POST /v1/terminal/hardware/account-session` `{ merchantId }` -> `{ clientSecret, expiresAt, components }`) and hands the\n * browser the short-lived Connect account session secret; the BROWSER NEVER talks to the payments service. The components below embed Stripe's Connect components `terminal_hardware_shop` / `terminal_hardware_orders`.\n */\n\n/** What the host's `getAccountSession` answers. The secret goes to Connect.js and is never rendered, logged, stored or kept after use. */\nexport interface StripeReaderAccountSession {\n clientSecret: string;\n /** ISO time the session ends; a session that is already over is never handed to Connect.js (the host is asked for a new one). */\n expiresAt?: string;\n}\n\nexport type StripeReaderAccountSessionFn = () => HostResult<StripeReaderAccountSession>;\n\n/** Why the shop cannot be shown (the service's `hardware_shop_unavailable` `reason`, or `not_enabled_for_app` when the host says the capability flag `terminalHardwareShop` is off). */\nexport type StripeReaderShopUnavailableReason = 'platform_not_enabled' | 'account_not_eligible' | 'processor_refused' | 'not_enabled_for_app' | 'other';\n\n/** Where the embedded component is. `placed`: the checkout finished (an order was placed). */\nexport type StripeReaderEmbedState = 'loading' | 'ready' | 'unavailable' | 'error' | 'offline' | 'placed';\n\nconst REASONS: readonly string[] = ['platform_not_enabled', 'account_not_eligible', 'processor_refused', 'not_enabled_for_app'];\n\n/** Reads a failed `getAccountSession`: `unavailable` (with the reason) when the service said so (`hardware_shop_unavailable`, or the account is not ready to take payments), else a plain error (Retry is offered). */\nexport function readerShopFailure(error: unknown): { kind: 'unavailable'; reason: StripeReaderShopUnavailableReason } | { kind: 'error' } {\n const info = readerErrorInfo(error);\n const e = error as { reason?: unknown; error?: { reason?: unknown } | null } | null | undefined;\n const raw = typeof e?.reason === 'string' ? e.reason : typeof e?.error?.reason === 'string' ? e.error.reason : '';\n if (info.code === 'hardware_shop_unavailable') {\n // The service's reason `app_not_enabled` (API.md 16.3c: this app is not allowed to order readers) is the library's `not_enabled_for_app`.\n if (raw === 'app_not_enabled') return { kind: 'unavailable', reason: 'not_enabled_for_app' };\n return { kind: 'unavailable', reason: REASONS.includes(raw) ? (raw as StripeReaderShopUnavailableReason) : 'other' };\n }\n if (info.code === 'merchant_not_ready' || info.code === 'reconnect_required' || info.code === 'not_supported_by_processor') return { kind: 'unavailable', reason: 'account_not_eligible' };\n return { kind: 'error' };\n}\n","import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, ViewEncapsulation, computed, effect, inject, input, isDevMode, output, signal, untracked, viewChild } from '@angular/core';\nimport { AlertComponent } from '@forgeroute/ui/alert';\nimport { ButtonComponent, UiLabelsService } from '@forgeroute/ui/core';\nimport { LiveRegionComponent } from '@forgeroute/ui/live-region';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { callHost } from '@forgeroute/ui/payments';\nimport { STRIPE_READER_MODELS, isSafeReceiptUrl, readerErrorInfo } from '../stripe-reader/stripe-reader.models';\nimport { STRIPE_CONNECT_LOADER, type StripeConnectEmbedElement, type StripeConnectEmbedName, type StripeConnectInstanceLike } from './stripe-connect-embed';\nimport { readerShopFailure, type StripeReaderAccountSessionFn, type StripeReaderEmbedState, type StripeReaderShopUnavailableReason } from './stripe-reader-shop.models';\n\n/** The template both embed components share (they only differ in which Connect component they mount). */\nconst EMBED_TEMPLATE = `\n <ui-live-region data-testid=\"shop-live\" [message]=\"announcement()\" />\n @switch (state()) {\n @case ('loading') {\n <div class=\"srh-loading\" data-testid=\"shop-loading\" [attr.aria-busy]=\"'true'\">\n <ui-skeleton [height]=\"240\" [ariaLabel]=\"loadingText()\" />\n </div>\n }\n @case ('offline') {\n <ui-alert variant=\"warning\" [title]=\"labels.t('stripeReaderShop.offline.title')\" data-testid=\"shop-offline\">\n <p class=\"srh-text\">{{ labels.t('stripeReaderShop.offline.text') }}</p>\n </ui-alert>\n }\n @case ('error') {\n <ui-alert variant=\"danger\" [title]=\"labels.t('stripeReaderShop.error.title')\" data-testid=\"shop-error\">\n <p class=\"srh-text\">{{ labels.t('stripeReaderShop.error.text') }}</p>\n <div class=\"srh-actions\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"shop-retry\" (click)=\"retry()\">{{ labels.t('common.tryAgain') }}</ui-button>\n </div>\n </ui-alert>\n }\n @case ('unavailable') {\n <section class=\"srh-card\" data-testid=\"shop-unavailable\" [attr.data-reason]=\"unavailableReason()\" role=\"group\" [attr.aria-labelledby]=\"ids + '-unavailable'\">\n <h3 class=\"srh-title\" [id]=\"ids + '-unavailable'\">{{ labels.t('stripeReaderShop.unavailable.title') }}</h3>\n <p class=\"srh-text\" data-testid=\"shop-unavailable-reason\">{{ unavailableText() }}</p>\n <p class=\"srh-text\">{{ labels.t('stripeReaderShop.unavailable.models') }}</p>\n <ul class=\"srh-models\" data-testid=\"shop-models\">\n @for (model of models; track model.deviceType) {\n <li>{{ model.model }}: {{ labels.t(model.key) }}</li>\n }\n </ul>\n <p class=\"srh-text\" data-testid=\"shop-how\">{{ labels.t('stripeReaderShop.unavailable.how') }}</p>\n <div class=\"srh-actions\">\n @if (helpHref(); as href) {\n <a [href]=\"href\" target=\"_blank\" rel=\"noopener noreferrer\" data-testid=\"shop-help\">{{ labels.t('stripeReaderShop.help.link') }}<span class=\"srh-sr\">{{ labels.t('stripeStripeConnect.opensInNewTabSr') }}</span></a>\n }\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"shop-connect\" (click)=\"connectReader.emit()\">{{ labels.t('stripeReader.status.connect') }}</ui-button>\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"shop-close\" (click)=\"closed.emit()\">{{ labels.t('common.close') }}</ui-button>\n </div>\n </section>\n }\n @case ('placed') {\n <ui-alert variant=\"success\" [title]=\"labels.t('stripeReaderShop.placed.title')\" data-testid=\"shop-placed\">\n <p class=\"srh-text\" data-testid=\"shop-placed-text\">{{ labels.t('stripeReaderShop.placed.text') }}</p>\n <div class=\"srh-actions\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"shop-connect\" (click)=\"connectReader.emit()\">{{ labels.t('stripeReader.status.connect') }}</ui-button>\n <ui-button variant=\"secondary\" size=\"sm\" data-testid=\"shop-close\" (click)=\"closed.emit()\">{{ labels.t('common.close') }}</ui-button>\n </div>\n </ui-alert>\n }\n }\n <div #embed class=\"srh-embed\" data-testid=\"shop-embed\" [hidden]=\"state() !== 'ready'\"></div>\n`;\n\nconst EMBED_STYLES = `\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) { display: block; min-width: 0; }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--ui-psp-border, #cbd5e1); border-radius: 12px; background: var(--ui-psp-sunken, #f8fafc); }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-title { margin: 0; font-size: 1.0625rem; font-weight: 700; color: var(--ui-psp-text, #1e293b); }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-text { margin: 0 0 8px; font-size: 0.9375rem; color: var(--ui-psp-text, #1e293b); }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-card .srh-text { margin: 0; }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-models { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; color: var(--ui-psp-text, #1e293b); }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-embed { min-height: 240px; }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-embed[hidden] { display: none; }\n :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }\n @media (forced-colors: active) { :is(ui-stripe-reader-shop, ui-stripe-reader-orders) .srh-card { border-color: CanvasText; } }\n`;\n\nconst MODEL_KEYS = {\n stripe_s700: 'stripeReaderShop.model.s700',\n stripe_s710: 'stripeReaderShop.model.s710',\n bbpos_wisepos_e: 'stripeReaderShop.model.wisepos',\n} as const;\n\n/**\n * Shared behaviour of the two embed components (an abstract directive, not a component of its own): it asks the host for an account session when it mounts, hands the secret to Connect.js (and asks the host again\n * when Connect.js needs a fresh one), mounts the embedded component and words every state. The secret is passed on and forgotten: never rendered, logged, stored in a signal or kept after use.\n */\n@Directive()\nexport abstract class StripeReaderEmbedBase {\n protected readonly labels = inject(UiLabelsService);\n private readonly loader = inject(STRIPE_CONNECT_LOADER);\n private readonly destroyRef = inject(DestroyRef);\n private readonly container = viewChild<ElementRef<HTMLElement>>('embed');\n private static seq = 0;\n protected readonly ids = `srh-${++StripeReaderEmbedBase.seq}`;\n protected readonly models = STRIPE_READER_MODELS.map(m => ({ ...m, key: MODEL_KEYS[m.deviceType as keyof typeof MODEL_KEYS] }));\n\n /** The publishable key (`pk_...`) of the platform: not a secret. */\n readonly publishableKey = input<string | null>(null);\n /** The host's call to ITS backend, which calls the payments service (`POST /v1/terminal/hardware/account-session`). Called when the component mounts and whenever Connect.js asks for a refreshed secret. */\n readonly getAccountSession = input<StripeReaderAccountSessionFn | null>(null);\n /** The merchant capability flag `terminalHardwareShop`: `false` shows the \"how to order\" card at once (nothing is requested). */\n readonly enabled = input(true);\n /** An address that explains how to order a reader (only https or in-app `/paths` are linked). */\n readonly orderHelpUrl = input<string | null>(null);\n /** Connect.js appearance (variables / overlays), passed through. */\n readonly appearance = input<Record<string, unknown> | null>(null);\n /** Managed environments where `navigator.onLine === false` is a false negative (default false). */\n readonly offlineOverride = input(false);\n /** An account session call slower than this is an error with \"Try again\" (ms). */\n readonly requestTimeoutMs = input(20_000);\n\n /** The checkout finished (an order was placed). */\n readonly checkoutFinished = output<void>();\n /** The user closed the shop (the host closes its panel). */\n readonly closed = output<void>();\n /** \"Connect a reader\": the host opens its pairing panel (`ui-stripe-readers`). */\n readonly connectReader = output<void>();\n\n readonly state = signal<StripeReaderEmbedState>('loading');\n /** The embedded component reported that it started its own loading (`setOnLoaderStart`); \"ready\" is announced only then (an element without that setter is announced when it is mounted: nothing better is known). */\n private readonly loaded = signal(false);\n /** Only whether a session call exists is a reason to mount: a host that passes a NEW function on every change detection pass must not remount the shop in a loop. The latest function is read (untracked) when it is called. */\n private readonly hasSession = computed(() => !!this.getAccountSession());\n readonly unavailableReason = signal<StripeReaderShopUnavailableReason>('not_enabled_for_app');\n private readonly retryTick = signal(0);\n private runId = 0;\n private instance: StripeConnectInstanceLike | null = null;\n private element: StripeConnectEmbedElement | null = null;\n /** The secret of the first session of THIS mount, handed to Connect.js once and then dropped (never a signal, never rendered; a newer mount has its own holder). */\n private secretHolder: { secret: string | null } | null = null;\n private destroyed = false;\n\n /** The Connect component this one mounts. */\n protected abstract component(): StripeConnectEmbedName;\n\n protected readonly loadingText = computed(() => this.labels.t(this.component() === 'terminal_hardware_orders' ? 'stripeReaderShop.orders.loading' : 'stripeReaderShop.loading'));\n protected readonly unavailableText = computed(() => this.labels.t(`stripeReaderShop.unavailable.${this.unavailableReason()}` as 'stripeReaderShop.unavailable.other'));\n protected readonly helpHref = computed(() => { const url = this.orderHelpUrl(); return isSafeReceiptUrl(url) ? url : null; });\n protected readonly announcement = computed(() => {\n switch (this.state()) {\n case 'loading': return '';\n case 'ready': return this.loaded() ? this.labels.t('stripeReaderShop.live.ready') : '';\n case 'offline': return this.labels.t('stripeReaderShop.offline.title');\n case 'error': return this.labels.t('stripeReaderShop.error.title');\n case 'unavailable': return `${this.labels.t('stripeReaderShop.unavailable.title')}. ${this.unavailableText()}`;\n case 'placed': return this.labels.t('stripeReaderShop.placed.text');\n }\n });\n\n constructor() {\n if (typeof window !== 'undefined') {\n const online = (): void => { if (this.state() === 'offline') this.retry(); };\n window.addEventListener('online', online);\n this.destroyRef.onDestroy(() => window.removeEventListener('online', online));\n }\n this.destroyRef.onDestroy(() => { this.destroyed = true; this.runId++; this.teardown(); });\n effect(() => {\n // Remount only for: enabled, the key, the mounted component, a retry, and whether a session call exists. The call itself and the appearance are read when needed (latest value, untracked).\n this.enabled(); this.publishableKey(); this.hasSession(); this.component(); this.retryTick();\n const box = this.container();\n untracked(() => { if (box) void this.mount(box.nativeElement); });\n });\n }\n\n /** \"Try again\". */\n retry(): void { this.retryTick.update(n => n + 1); }\n\n private offlineNow(): boolean { return !this.offlineOverride() && typeof navigator !== 'undefined' && navigator.onLine === false; }\n\n private async mount(box: HTMLElement): Promise<void> {\n this.teardown();\n const run = ++this.runId;\n if (!this.enabled()) { this.unavailable('not_enabled_for_app'); return; }\n const key = this.publishableKey();\n const get = untracked(() => this.getAccountSession());\n if (!key || !get) {\n this.state.set('loading');\n if (isDevMode()) console.warn('[ui-stripe-reader-shop] publishableKey and getAccountSession are required: the shop cannot load without them.');\n return;\n }\n if (this.offlineNow()) { this.state.set('offline'); return; } // nothing is requested while offline\n this.state.set('loading');\n this.loaded.set(false);\n let first: string;\n try { first = await this.fetchSecret(); } catch (error) { if (run === this.runId) this.onFailure(error); return; }\n if (run !== this.runId) return; // replaced meanwhile: this secret is dropped (a newer run has its own holder)\n const holder = { secret: first as string | null };\n this.secretHolder = holder;\n let instance: StripeConnectInstanceLike | null = null;\n try {\n instance = await this.loader({\n publishableKey: key,\n appearance: untracked(() => this.appearance()),\n fetchClientSecret: async () => {\n // The first call gets the session asked for at mount (once); every later call (Connect.js needs a fresh secret) asks the host again.\n const initial = holder.secret;\n holder.secret = null;\n if (initial) return initial;\n try { return await this.fetchSecret(); } catch (error) {\n // A failed refresh while the shop is in use (the host said 429, the connection dropped, the session expired) is only REJECTED to Connect.js, which shows its own error: the embed (and a checkout in progress) is kept.\n // Only a refusal that will not recover (`hardware_shop_unavailable`) removes it and shows the \"unavailable\" card.\n if (run === this.runId && readerErrorInfo(error).code === 'hardware_shop_unavailable') this.onFailure(error);\n throw new Error('account session unavailable');\n }\n },\n });\n } catch { instance = null; }\n if (run !== this.runId) { holder.secret = null; try { void instance?.logout?.(); } catch { /* nothing to log out */ } return; }\n if (!instance) { holder.secret = null; this.state.set('error'); return; }\n let element: StripeConnectEmbedElement;\n try { element = instance.create(this.component()); } catch { holder.secret = null; this.state.set('error'); return; }\n this.instance = instance;\n this.element = element;\n element.setOnLoadError?.(() => { if (run === this.runId && this.state() !== 'unavailable') this.state.set('error'); });\n element.setOnCheckoutFinished?.(() => { if (run === this.runId) this.onCheckoutFinished(); });\n if (element.setOnLoaderStart) element.setOnLoaderStart(() => { if (run === this.runId) this.loaded.set(true); }); else this.loaded.set(true);\n box.appendChild(element);\n this.state.set('ready');\n }\n\n /** Asks the host for an account session within the request timeout; returns ONLY the secret (a session that is already over, or one without a secret, is refused). */\n private async fetchSecret(): Promise<string> {\n const get = untracked(() => this.getAccountSession());\n if (!get) throw new Error('account session: no call supplied');\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n const timeout = new Promise<never>((_, reject) => { timer = setTimeout(() => reject(new Error('account session timeout')), Math.max(1, this.requestTimeoutMs())); });\n const session = await Promise.race([callHost(get), timeout]);\n const secret = typeof session?.clientSecret === 'string' ? session.clientSecret : '';\n if (!secret) throw new Error('account session without a secret');\n if (session.expiresAt) { const ends = Date.parse(session.expiresAt); if (!Number.isNaN(ends) && ends <= Date.now()) throw new Error('account session expired'); }\n return secret;\n } finally { if (timer) clearTimeout(timer); }\n }\n\n private onFailure(error: unknown): void {\n this.teardown();\n const failure = readerShopFailure(error);\n if (failure.kind === 'unavailable') this.unavailable(failure.reason); else this.state.set('error');\n }\n\n private unavailable(reason: StripeReaderShopUnavailableReason): void {\n this.unavailableReason.set(reason);\n this.state.set('unavailable');\n }\n\n private onCheckoutFinished(): void {\n this.checkoutFinished.emit();\n if (this.component() === 'terminal_hardware_shop' && !this.destroyed) { this.teardown(); this.state.set('placed'); }\n }\n\n /** Removes the embedded component and forgets the session (the secret is never kept). */\n private teardown(): void {\n if (this.secretHolder) this.secretHolder.secret = null;\n this.secretHolder = null;\n const element = this.element;\n const instance = this.instance;\n this.element = null;\n this.instance = null;\n try { element?.remove(); } catch { /* already gone */ }\n try { void instance?.logout?.(); } catch { /* nothing to log out */ }\n }\n}\n\n/**\n * The card reader SHOP of the app: Stripe's Connect embedded component `terminal_hardware_shop` (or, with `mode=\"orders\"`, `terminal_hardware_orders`, the order history). The host supplies the account session\n * (`getAccountSession` calls its OWN backend, which calls the payments service; the browser never talks to the service) and the publishable key. States: loading skeleton, ready, unavailable (a \"how to order\" card with\n * the supported models, the user is never blocked), error with Try again, offline (nothing is requested) and placed (\"Your order was placed. When the reader arrives, choose Connect a reader and enter the code the\n * device shows\", output `connectReader`). Put it in the host's side panel, or use `ui-stripe-reader-order-panel`.\n *\n * <ui-stripe-reader-shop [publishableKey]=\"pk\" [getAccountSession]=\"session\" [enabled]=\"merchant.terminalHardwareShop\" orderHelpUrl=\"https://example.com/readers\"\n * (checkoutFinished)=\"refresh()\" (connectReader)=\"openPairing()\" (closed)=\"close()\" />\n */\n@Component({\n selector: 'ui-stripe-reader-shop',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [AlertComponent, ButtonComponent, LiveRegionComponent, SkeletonComponent],\n template: EMBED_TEMPLATE,\n styles: [EMBED_STYLES],\n})\nexport class StripeReaderShopComponent extends StripeReaderEmbedBase {\n /** `shop` (default) mounts `terminal_hardware_shop`; `orders` mounts `terminal_hardware_orders` (the order history). */\n readonly mode = input<'shop' | 'orders'>('shop');\n protected override component(): StripeConnectEmbedName { return this.mode() === 'orders' ? 'terminal_hardware_orders' : 'terminal_hardware_shop'; }\n}\n\n/** The order history of the card readers: Stripe's Connect embedded component `terminal_hardware_orders`, with the same loader, states and host contract as `ui-stripe-reader-shop`. */\n@Component({\n selector: 'ui-stripe-reader-orders',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [AlertComponent, ButtonComponent, LiveRegionComponent, SkeletonComponent],\n template: EMBED_TEMPLATE,\n styles: [EMBED_STYLES],\n})\nexport class StripeReaderOrdersComponent extends StripeReaderEmbedBase {\n protected override component(): StripeConnectEmbedName { return 'terminal_hardware_orders'; }\n}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject, input, output } from '@angular/core';\nimport { SidePanelComponent, UiLabelsService } from '@forgeroute/ui/core';\nimport { StripeReaderShopComponent } from './stripe-reader-shop.component';\nimport type { StripeReaderAccountSessionFn } from './stripe-reader-shop.models';\n\n/**\n * The ready-made side panel for ordering card readers: a `ui-side-panel` (\"Get a card reader\" / \"Card reader orders\") that mounts `ui-stripe-reader-shop` only while it is open (nothing is requested while it is\n * closed, and the account session secret is dropped as soon as it closes). The host opens it from the `getReader` / `readerOrder` outputs and opens its pairing panel from `(connectReader)`.\n *\n * @defer (when orderOpen()) {\n * <ui-stripe-reader-order-panel [open]=\"orderOpen()\" [publishableKey]=\"pk\" [getAccountSession]=\"session\" [enabled]=\"merchant.terminalHardwareShop\"\n * (closed)=\"orderOpen.set(false)\" (checkoutFinished)=\"refreshReaders()\" (connectReader)=\"orderOpen.set(false); pairingOpen.set(true)\" />\n * }\n */\n@Component({\n selector: 'ui-stripe-reader-order-panel',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [SidePanelComponent, StripeReaderShopComponent],\n template: `\n <ui-side-panel [open]=\"open()\" [title]=\"title()\" [cancelLabel]=\"labels.t('common.close')\" [wide]=\"true\" cancelTestId=\"reader-order-panel-close\" (closed)=\"closed.emit()\">\n @if (open()) {\n <ui-stripe-reader-shop [mode]=\"mode()\" [publishableKey]=\"publishableKey()\" [getAccountSession]=\"getAccountSession()\" [enabled]=\"enabled()\" [orderHelpUrl]=\"orderHelpUrl()\"\n [appearance]=\"appearance()\" [offlineOverride]=\"offlineOverride()\" [requestTimeoutMs]=\"requestTimeoutMs()\"\n (checkoutFinished)=\"checkoutFinished.emit()\" (connectReader)=\"connectReader.emit()\" (closed)=\"closed.emit()\" />\n }\n </ui-side-panel>\n `,\n})\nexport class StripeReaderOrderPanelComponent {\n protected readonly labels = inject(UiLabelsService);\n\n readonly open = input(false);\n /** `shop` (default): order a reader; `orders`: the order history. */\n readonly mode = input<'shop' | 'orders'>('shop');\n readonly publishableKey = input<string | null>(null);\n readonly getAccountSession = input<StripeReaderAccountSessionFn | null>(null);\n readonly enabled = input(true);\n readonly orderHelpUrl = input<string | null>(null);\n readonly appearance = input<Record<string, unknown> | null>(null);\n readonly offlineOverride = input(false);\n readonly requestTimeoutMs = input(20_000);\n\n readonly closed = output<void>();\n readonly checkoutFinished = output<void>();\n readonly connectReader = output<void>();\n\n protected readonly title = computed(() => this.labels.t(this.mode() === 'orders' ? 'stripeReaderShop.orders.title' : 'stripeReaderShop.title'));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAa,cAA2G,EACtH,YAAY,OAAO,qBACpB;AAMD,MAAa,sBAAsC,OAAO,gBAAgB,YAAW;CACnF,MAAM,MAAM,MAAM,YAAY,KAAI;CAElC,OADe,YAAY,SAAY,MAAM,IAAI,WAAW,cAAc,IAAI,MAAM,IAAI,WAAW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