@juspay-tech/react-native-hyperswitch 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.bundle.js","sources":["../../../../src/codegen/modules/NativeHyperswitchModule.ts","../../../../src/codegen/modules/NativeWidgetHelperModule.ts","../../../../src/native/NativeResponseMapper.ts","../../../../src/widget/WidgetRegistry.ts","../../../../src/native/InitializationState.ts","../../../../src/session/presentPaymentSheet.ts","../../../../src/session/SavedPaymentMethods.ts","../../../../src/session/WalletSession.ts","../../../../src/session/binders.ts","../../../../src/utils/LaunchOptions.ts","../../../../src/session/PaymentSession.ts","../../../../src/session/Elements.ts","../../node_modules/react/cjs/react-jsx-runtime.development.js","../../node_modules/react/jsx-runtime.js","../../node_modules/react/cjs/react-jsx-runtime.production.js","../../../../src/context/HyperElements.tsx","../../../../src/views/PaymentWidgetBridge.ts","../../../../src/views/useNativeViewTag.ts","../../../../src/views/CVCElement.tsx","../../../../src/utils/EventValidator.ts","../../../../src/views/PaymentElement.tsx","../../../../src/session/PlatformPaySupport.ts","../../../../src/views/useWalletLaunch.ts","../../../../src/views/walletButtonConfig.ts","../../../../src/views/GooglePayButton.tsx","../../../../src/views/ApplePayButton.tsx","../../../../src/index.ts"],"sourcesContent":["import type { TurboModule } from 'react-native';\nimport { NativeModules, TurboModuleRegistry } from 'react-native';\n\nexport type CustomEndpoints = Object;\n\nexport interface Spec extends TurboModule {\n initialise(\n publishableKey: string,\n platformPublishableKey: string,\n profileId: string,\n environment: string,\n customEndpoints: CustomEndpoints\n ): Promise<string>;\n\n presentPaymentSheet(params: Object): Promise<string>;\n\n getCustomerSavedPaymentMethods(params?: Object): Promise<string>;\n\n getCustomerLastUsedPaymentMethodData(): Promise<string>;\n\n getCustomerDefaultSavedPaymentMethodData(): Promise<string>;\n\n getCustomerSavedPaymentMethodData(): Promise<string>;\n\n confirmWithCustomerLastUsedPaymentMethod(reactTag: number): Promise<string>;\n\n confirmWithCustomerDefaultPaymentMethod(reactTag: number): Promise<string>;\n\n confirmWithCustomerPaymentToken(\n reactTag: number,\n token: string\n ): Promise<string>;\n\n isGooglePaySupported(): Promise<boolean>;\n\n isApplePaySupported(): Promise<boolean>;\n\n getWalletSession(params?: Object): Promise<string>;\n\n isWalletEligible(wallet: string): Promise<boolean>;\n\n launchWallet(wallet: string): Promise<string>;\n}\n\n/**\n * Use `TurboModuleRegistry.get` first for new-arch TurboModules, and fall back\n * to `NativeModules` for legacy/old-arch support.\n */\nconst NativeHyperswitchModule =\n TurboModuleRegistry.get<Spec>('NativeHyperswitchModule') ??\n NativeModules.NativeHyperswitchModule;\n\nexport default NativeHyperswitchModule as Spec;\nexport { NativeHyperswitchModule };\n","import type { TurboModule } from 'react-native';\nimport { NativeModules, TurboModuleRegistry } from 'react-native';\n\nexport interface Spec extends TurboModule {\n confirmPayment(reactTag: number, callback: (result: string) => void): void;\n updateIntentInitForWidget(\n reactTag: number,\n callback: (result: string) => void\n ): void;\n updateIntentCompleteForWidget(\n reactTag: number,\n sdkAuthorization: string,\n callback: (result: string) => void\n ): void;\n}\n\nconst NativeWidgetHelperModule =\n TurboModuleRegistry.get<Spec>('NativeWidgetHelperModule') ??\n NativeModules.NativeWidgetHelperModule;\n\nexport default NativeWidgetHelperModule as Spec;\n","import type { PaymentResult } from '../types/paymentresult';\n\ninterface NativeResponse {\n status: string;\n message: string;\n code?: string;\n type?: string;\n data?: any;\n}\n\nexport function parseNativeResponse(\n raw: string | NativeResponse\n): NativeResponse {\n if (typeof raw === 'object' && raw !== null) {\n return raw as NativeResponse;\n }\n try {\n return JSON.parse(raw as string) as NativeResponse;\n } catch {\n return { status: 'failed', message: String(raw) };\n }\n}\n\nexport function mapStatus(status: string): PaymentResult['status'] {\n switch (status) {\n case 'succeeded':\n case 'completed':\n case 'requires_capture':\n case 'success':\n return 'completed';\n case 'cancelled':\n case 'canceled':\n return 'canceled';\n case 'failed':\n case 'error':\n default:\n return 'failed';\n }\n}\n\nexport function mapNativeResponseToPaymentResult(\n raw: string | NativeResponse\n): PaymentResult {\n const parsed = parseNativeResponse(raw);\n return {\n status: mapStatus(parsed.status),\n type: parsed.type ?? parsed.code ?? mapStatus(parsed.status) ?? '',\n message: parsed.message ?? parsed.code ?? '',\n };\n}\n","import NativeWidgetHelperModule from '../codegen/modules/NativeWidgetHelperModule';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\nimport type { PaymentResult } from '../types/paymentresult';\n\nconst widgetTags = new Map<string, number>();\n\nexport function registerWidget(widgetId: string, nativeViewTag: number): void {\n widgetTags.set(widgetId, nativeViewTag);\n}\n\nexport function getWidget(widgetId: string): number | undefined {\n return widgetTags.get(widgetId);\n}\n\nexport function unregisterWidget(widgetId: string): void {\n widgetTags.delete(widgetId);\n}\n\n/**\n * @deprecated Pass a `ref` to `<PaymentElement>` instead and call\n * `elements.confirmPayment(ref)`. The widget-id (string) path\n * exists only for backward compatibility and will be removed\n * in the next major release.\n */\nexport function confirmPayment(widgetId: string): Promise<string> {\n const nativeTag = widgetTags.get(widgetId);\n if (nativeTag === undefined) {\n return Promise.resolve(\n JSON.stringify({\n status: 'failed',\n message: `Widget ${widgetId} not found or not mounted`,\n type: undefined,\n })\n );\n }\n return new Promise((resolve) => {\n NativeWidgetHelperModule.confirmPayment(nativeTag, resolve);\n });\n}\n\nexport function updateIntentInitForAllWidgets(): Promise<PaymentResult[]> {\n const promises = [...widgetTags.values()].map(\n (tag) =>\n new Promise<PaymentResult>((resolve) => {\n NativeWidgetHelperModule.updateIntentInitForWidget(tag, (raw: string) =>\n resolve(mapNativeResponseToPaymentResult(raw))\n );\n })\n );\n return Promise.all(promises);\n}\n\nexport function updateIntentCompleteForAllWidgets(\n sdkAuthorization: string\n): Promise<PaymentResult[]> {\n const promises = [...widgetTags.values()].map(\n (tag) =>\n new Promise<PaymentResult>((resolve) => {\n NativeWidgetHelperModule.updateIntentCompleteForWidget(\n tag,\n sdkAuthorization,\n (raw: string) => resolve(mapNativeResponseToPaymentResult(raw))\n );\n })\n );\n return Promise.all(promises);\n}\n","/**\n * Tracks whether the Hyperswitch SDK is currently initialising (or re-initialising\n * after a reload). presentPaymentSheet should be blocked while this flag is true\n * so the native SDK is not asked to open a sheet before it is ready.\n *\n * Also tracks whether a payment sheet is currently presented so that a hot-reload\n * (or any other code path) cannot stack a second sheet on top of an open one.\n */\n\nlet _isInitializing = false;\n\nexport function setInitializing(value: boolean): void {\n _isInitializing = value;\n}\n\nexport function isInitializing(): boolean {\n return _isInitializing;\n}\n\nlet _isSheetPresented = false;\n\nexport function setSheetPresented(value: boolean): void {\n _isSheetPresented = value;\n}\n\nexport function isSheetPresented(): boolean {\n return _isSheetPresented;\n}\n","import NativeHyperswitchModule from '../codegen/modules/NativeHyperswitchModule';\nimport type { NativePaymentSheetPayload } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\nimport {\n isInitializing,\n isSheetPresented,\n setSheetPresented,\n} from '../native/InitializationState';\n\n/**\n * Low-level wrapper over `NativeHyperswitchModule.presentPaymentSheet`.\n *\n * Guards against two failure modes that silently confused merchants in\n * older SDK versions:\n * 1. Opening a sheet while `loadHyper()` is still initialising returns a\n * \"initialization_in_progress\" failure instead of passing an\n * inconsistent state to the native side.\n * 2. A second call while a sheet is already presented (fast-refresh,\n * developer mistake) short-circuits to \"sheet_already_presented\"\n * instead of stacking a duplicate.\n */\nexport async function presentPaymentSheetWithPayload(\n payload: NativePaymentSheetPayload\n): Promise<PaymentResult> {\n if (isInitializing()) {\n return {\n status: 'failed',\n type: 'initialization_in_progress',\n message:\n 'SDK is reloading. Please wait for initialisation to complete before presenting the payment sheet.',\n };\n }\n if (isSheetPresented()) {\n // A sheet is already open (e.g. a hot-reload fired while the sheet was\n // visible). Silently skip so the existing sheet is not covered by a\n // new one.\n return {\n status: 'canceled',\n type: 'sheet_already_presented',\n message: 'A payment sheet is already presented.',\n };\n }\n setSheetPresented(true);\n try {\n const raw = await NativeHyperswitchModule.presentPaymentSheet({\n hyperswitchConfig: payload.hyperswitchConfig,\n paymentSessionConfig: payload.paymentSessionConfig,\n configuration: payload.configuration,\n });\n return mapNativeResponseToPaymentResult(raw);\n } finally {\n setSheetPresented(false);\n }\n}\n","import NativeHyperswitchModule from '../codegen/modules/NativeHyperswitchModule';\nimport {\n HyperswitchConfiguration,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport {\n CustomerSavedPaymentMethodsSession,\n CustomerLastUsedPaymentMethod,\n SavedPaymentMethodsConfiguration,\n} from '../types/savedPaymentMethods';\nimport type { PaymentResult } from '../types/paymentresult';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\nimport { getWidget } from '../widget/WidgetRegistry';\n\nfunction getReactTag(widgetId?: string): number {\n if (!widgetId) {\n throw new Error('A widgetId is required to confirm a saved payment method');\n }\n\n const reactTag = getWidget(widgetId);\n if (reactTag === undefined) {\n throw new Error(`Widget ${widgetId} not found or not mounted`);\n }\n return reactTag;\n}\n\ntype RawCustomerPaymentMethod = Omit<\n CustomerLastUsedPaymentMethod,\n 'billing'\n> & {\n billing?: string | CustomerLastUsedPaymentMethod['billing'];\n};\n\nfunction parseBilling(\n raw: RawCustomerPaymentMethod['billing']\n): CustomerLastUsedPaymentMethod['billing'] {\n if (raw == null || typeof raw !== 'string') {\n return (raw ?? null) as CustomerLastUsedPaymentMethod['billing'];\n }\n try {\n return JSON.parse(raw) as CustomerLastUsedPaymentMethod['billing'];\n } catch {\n return null;\n }\n}\n\nfunction parsePaymentMethod(raw: string): CustomerLastUsedPaymentMethod | null {\n try {\n const parsed = JSON.parse(raw) as RawCustomerPaymentMethod;\n const result: CustomerLastUsedPaymentMethod = {\n ...parsed,\n billing: parseBilling(parsed.billing),\n };\n return result;\n } catch {\n return null;\n }\n}\n\nexport function createCustomerSavedPaymentMethodsSession(): CustomerSavedPaymentMethodsSession {\n return {\n async getCustomerLastUsedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerLastUsedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async getCustomerDefaultSavedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerDefaultSavedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async getCustomerSavedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerSavedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async confirmWithCustomerLastUsedPaymentMethod(args?: {\n id?: string;\n }): Promise<PaymentResult> {\n const raw =\n await NativeHyperswitchModule.confirmWithCustomerLastUsedPaymentMethod(\n getReactTag(args?.id)\n );\n return mapNativeResponseToPaymentResult(raw);\n },\n\n async confirmWithCustomerDefaultPaymentMethod(args?: {\n id?: string;\n }): Promise<PaymentResult> {\n const raw =\n await NativeHyperswitchModule.confirmWithCustomerDefaultPaymentMethod(\n getReactTag(args?.id)\n );\n return mapNativeResponseToPaymentResult(raw);\n },\n };\n}\n\nexport async function getCustomerSavedPaymentMethods(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration,\n configuration?: SavedPaymentMethodsConfiguration\n): Promise<CustomerSavedPaymentMethodsSession> {\n const payload = {\n hyperswitchConfig,\n paymentSessionConfig,\n configuration : {\n ...configuration,\n paymentMethodLayout : {\n savedMethodCustomization : {\n hiddenPaymentMethods : configuration?.hiddenPaymentMethods ?? [],\n },\n }\n },\n };\n await NativeHyperswitchModule.getCustomerSavedPaymentMethods(payload);\n return createCustomerSavedPaymentMethodsSession();\n}\n","import NativeHyperswitchModule from '../codegen/modules/NativeHyperswitchModule';\nimport type {\n HyperswitchConfiguration,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type {\n WalletName,\n WalletSessionHandle,\n} from '../types/walletSession';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\n\nexport function createWalletSession(): WalletSessionHandle {\n return {\n isWalletEligible(wallet: WalletName): Promise<boolean> {\n return NativeHyperswitchModule.isWalletEligible(wallet).catch(() => false);\n },\n\n isGooglePayEligible(): Promise<boolean> {\n return NativeHyperswitchModule.isWalletEligible('google_pay').catch(\n () => false\n );\n },\n\n isApplePayEligible(): Promise<boolean> {\n return NativeHyperswitchModule.isWalletEligible('apple_pay').catch(\n () => false\n );\n },\n\n async launchWallet(wallet: WalletName): Promise<PaymentResult> {\n const raw = await NativeHyperswitchModule.launchWallet(wallet);\n return mapNativeResponseToPaymentResult(raw);\n },\n\n async launchGooglePay(): Promise<PaymentResult> {\n const raw = await NativeHyperswitchModule.launchWallet('google_pay');\n return mapNativeResponseToPaymentResult(raw);\n },\n\n async launchApplePay(): Promise<PaymentResult> {\n const raw = await NativeHyperswitchModule.launchWallet('apple_pay');\n return mapNativeResponseToPaymentResult(raw);\n },\n };\n}\n\nconst WALLET_SESSION_TIMEOUT_MS = 15000;\n\nfunction withTimeout<T>(promise: Promise<T>, label: string): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => {\n reject(new Error(`${label} timed out after ${WALLET_SESSION_TIMEOUT_MS}ms`));\n }, WALLET_SESSION_TIMEOUT_MS);\n\n promise.then(\n (value) => {\n clearTimeout(timer);\n resolve(value);\n },\n (error) => {\n clearTimeout(timer);\n reject(error);\n }\n );\n });\n}\n\nexport async function getWalletSession(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): Promise<WalletSessionHandle> {\n const raw = await withTimeout(\n NativeHyperswitchModule.getWalletSession({\n hyperswitchConfig,\n paymentSessionConfig,\n }),\n 'getWalletSession'\n );\n\n let status: string | undefined;\n let message: string | undefined;\n try {\n const parsed = JSON.parse(raw) as { status?: string; message?: string };\n status = parsed.status;\n message = parsed.message;\n } catch {\n status = undefined;\n }\n\n if (status === 'failed') {\n throw new Error(message ?? 'Failed to initialise the wallet session');\n }\n\n return createWalletSession();\n}\n","import type {\n HyperswitchConfiguration,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { PaymentSheetConfiguration } from '../types/PaymentSheetConfiguration';\nimport type {\n CustomerSavedPaymentMethodsSession,\n SavedPaymentMethodsConfiguration,\n} from '../types/savedPaymentMethods';\nimport { buildPresentPaymentSheetPayload } from '../utils/LaunchOptions';\nimport { presentPaymentSheetWithPayload } from './presentPaymentSheet';\nimport { getCustomerSavedPaymentMethods } from './SavedPaymentMethods';\nimport { getWalletSession } from './WalletSession';\nimport type { WalletSessionHandle } from '../types/walletSession';\n\n/** Options captured by every session-style factory (PaymentSession + Elements). */\ntype SessionBindings = {\n hyperswitchConfig: HyperswitchConfiguration;\n paymentSessionConfig: PaymentSessionConfiguration;\n};\n\n/**\n * Shared `presentPaymentSheet` implementation used by both\n * `PaymentSession` and `Elements` so sheet-presentation behavior cannot\n * drift between the two surfaces.\n */\nexport function bindPresentPaymentSheet(bindings: SessionBindings) {\n return async function presentPaymentSheet(\n configuration?: PaymentSheetConfiguration\n ): Promise<PaymentResult> {\n const payload = buildPresentPaymentSheetPayload(\n bindings.hyperswitchConfig,\n bindings.paymentSessionConfig,\n configuration\n );\n return presentPaymentSheetWithPayload(payload);\n };\n}\n\n/**\n * Shared `getCustomerSavedPaymentMethods` implementation used by both\n * `PaymentSession` and `Elements`.\n */\nexport function bindGetCustomerSavedPaymentMethods(bindings: SessionBindings) {\n return function getSaved(\n configuration?: SavedPaymentMethodsConfiguration\n ): Promise<CustomerSavedPaymentMethodsSession> {\n return getCustomerSavedPaymentMethods(\n bindings.hyperswitchConfig,\n bindings.paymentSessionConfig,\n configuration\n );\n };\n}\n\nexport function bindGetWalletSession(bindings: SessionBindings) {\n return function getWallets(): Promise<WalletSessionHandle> {\n return getWalletSession(\n bindings.hyperswitchConfig,\n bindings.paymentSessionConfig\n );\n };\n}\n","import type { PaymentSheetConfiguration } from '../types/PaymentSheetConfiguration';\nimport type {\n HyperswitchConfiguration,\n NativePaymentSheetPayload,\n PaymentSessionConfiguration,\n} from '../types/definitions';\n\nfunction buildPresentPaymentSheetPayload(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration,\n configuration?: PaymentSheetConfiguration\n): NativePaymentSheetPayload {\n // platformPublishableKey is internal to the RN bridge; it is not part of the\n // merchant-facing hyperswitchConfig payload.\n const restConfig = { ...hyperswitchConfig };\n delete restConfig.platformPublishableKey;\n return {\n hyperswitchConfig: restConfig as Record<string, unknown>,\n paymentSessionConfig: paymentSessionConfig,\n configuration: (configuration ?? {}) as Record<string, unknown>,\n };\n}\n\nexport { buildPresentPaymentSheetPayload };\n","import type {\n HyperswitchConfiguration,\n PaymentSession,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport {\n updateIntentInitForAllWidgets,\n updateIntentCompleteForAllWidgets,\n} from '../widget/WidgetRegistry';\nimport {\n bindGetCustomerSavedPaymentMethods,\n bindGetWalletSession,\n bindPresentPaymentSheet,\n} from './binders';\n\nexport async function updateIntent(\n intentResolver: () => Promise<PaymentSessionConfiguration>\n): Promise<void> {\n let newIntent: PaymentSessionConfiguration;\n try {\n await updateIntentInitForAllWidgets();\n newIntent = await intentResolver();\n await updateIntentCompleteForAllWidgets(newIntent.sdkAuthorization);\n } catch {\n await updateIntentCompleteForAllWidgets('');\n return;\n }\n}\n\nexport function createPaymentSession(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): PaymentSession {\n const bindings = { hyperswitchConfig, paymentSessionConfig };\n return {\n presentPaymentSheet: bindPresentPaymentSheet(bindings),\n getCustomerSavedPaymentMethods:\n bindGetCustomerSavedPaymentMethods(bindings),\n getWalletSession: bindGetWalletSession(bindings),\n updateIntent,\n };\n}\n","import type {\n HyperswitchConfiguration,\n PaymentElementHandle,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { Elements } from '../types/elements';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\nimport { confirmPayment as confirmWidgetPayment } from '../widget/WidgetRegistry';\nimport { updateIntent } from './PaymentSession';\nimport {\n bindGetCustomerSavedPaymentMethods,\n bindGetWalletSession,\n bindPresentPaymentSheet,\n} from './binders';\n\ntype ElementsNativeActions = Pick<\n Elements,\n | 'confirmPayment'\n | 'presentPaymentSheet'\n | 'getCustomerSavedPaymentMethods'\n | 'getWalletSession'\n | 'updateIntent'\n>;\n\nexport function createElementsNativeActions(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): ElementsNativeActions {\n const bindings = { hyperswitchConfig, paymentSessionConfig };\n return {\n presentPaymentSheet: bindPresentPaymentSheet(bindings),\n\n async confirmPayment(\n paymentElementRef: { current: PaymentElementHandle | null } | string,\n confirmOptions?: { confirmParams?: Record<string, any> }\n ): Promise<PaymentResult> {\n if (typeof paymentElementRef === 'string') {\n const result = await confirmWidgetPayment(paymentElementRef);\n return mapNativeResponseToPaymentResult(result);\n }\n\n const ref = paymentElementRef.current;\n if (!ref) {\n throw new Error('PaymentElement reference is not mounted');\n }\n return ref.confirmPayment(confirmOptions);\n },\n\n getCustomerSavedPaymentMethods:\n bindGetCustomerSavedPaymentMethods(bindings),\n\n getWalletSession: bindGetWalletSession(bindings),\n\n updateIntent,\n };\n}\n\nexport function createElements(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): Elements {\n return {\n hyperswitchConfig,\n ...createElementsNativeActions(hyperswitchConfig, paymentSessionConfig),\n };\n}\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useState,\n type ReactNode,\n} from 'react';\nimport type {\n HyperswitchConfiguration,\n HyperswitchSession,\n PaymentSession,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport type { Elements } from '../types/elements';\nimport type { WalletSessionHandle } from '../types/walletSession';\n\nexport type WalletEligibility = {\n googlePay: boolean;\n applePay: boolean;\n};\n\ninterface HyperElementsContext {\n paymentSession: PaymentSession | null;\n walletSession: WalletSessionHandle | null;\n walletEligibility: WalletEligibility;\n walletLoading: boolean;\n loadWalletSession: () => Promise<WalletSessionHandle | null>;\n elements: Elements | null;\n publishableKey: string | null;\n sdkAuthorization: string | null;\n hyperswitchConfig: HyperswitchConfiguration | null;\n paymentSessionConfig: PaymentSessionConfiguration | null;\n loading: boolean;\n error: Error | null;\n}\n\nconst HyperElementsContext = createContext<HyperElementsContext | undefined>(\n undefined\n);\n\nHyperElementsContext.displayName = 'HyperElementsContext';\n\nexport interface HyperElementsProps {\n hyper: HyperswitchSession | Promise<HyperswitchSession> | null;\n options: { sdkAuthorization: string };\n children: ReactNode;\n}\n\nexport function HyperElements({\n hyper,\n options,\n children,\n}: HyperElementsProps) {\n const [paymentSession, setPaymentSession] = useState<PaymentSession | null>(\n null\n );\n const [elements, setElements] = useState<Elements | null>(null);\n const [hyperswitchConfig, setHyperswitchConfig] =\n useState<HyperswitchConfiguration | null>(null);\n const [paymentSessionConfig, setPaymentSessionConfig] =\n useState<PaymentSessionConfiguration | null>(null);\n const [publishableKey, setPublishableKey] = useState<string | null>(null);\n const [sdkAuthorization, setSdkAuthorization] = useState<string | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const [walletSession, setWalletSession] = useState<WalletSessionHandle | null>(\n null\n );\n const [walletEligibility, setWalletEligibility] = useState<WalletEligibility>({\n googlePay: false,\n applePay: false,\n });\n const [walletLoading, setWalletLoading] = useState(false);\n\n const loadWalletSession = useCallback(async () => {\n if (!paymentSession) {\n return null;\n }\n setWalletLoading(true);\n try {\n const wallets = await paymentSession.getWalletSession();\n const [googlePay, applePay] = await Promise.all([\n wallets.isGooglePayEligible(),\n wallets.isApplePayEligible(),\n ]);\n setWalletSession(wallets);\n setWalletEligibility({ googlePay, applePay });\n return wallets;\n } catch {\n setWalletSession(null);\n setWalletEligibility({ googlePay: false, applePay: false });\n return null;\n } finally {\n setWalletLoading(false);\n }\n }, [paymentSession]);\n\n useEffect(() => {\n setWalletSession(null);\n setWalletEligibility({ googlePay: false, applePay: false });\n }, [paymentSession]);\n\n useEffect(() => {\n if (!hyper) return;\n\n let cancelled = false;\n\n (async () => {\n try {\n const session = await Promise.resolve(hyper);\n const sessionConfig = {\n sdkAuthorization: options.sdkAuthorization,\n };\n const els = await session.elements(sessionConfig);\n\n if (!cancelled) {\n setPaymentSession({\n ...els,\n } as PaymentSession);\n setHyperswitchConfig(els.hyperswitchConfig);\n setPaymentSessionConfig(sessionConfig);\n setElements(els);\n setPublishableKey(session.publishableKey ?? null);\n setSdkAuthorization(options.sdkAuthorization ?? null);\n setLoading(false);\n }\n } catch (err) {\n if (!cancelled) {\n setError(err instanceof Error ? err : new Error(String(err)));\n setLoading(false);\n }\n }\n })();\n\n return () => {\n cancelled = true;\n };\n }, [hyper, options.sdkAuthorization]);\n\n return (\n <HyperElementsContext.Provider\n value={{\n paymentSession,\n walletSession,\n walletEligibility,\n walletLoading,\n loadWalletSession,\n elements,\n publishableKey,\n sdkAuthorization,\n loading,\n error,\n paymentSessionConfig,\n hyperswitchConfig,\n }}\n >\n {children}\n </HyperElementsContext.Provider>\n );\n}\n\nexport function useHyperElementsContext(): HyperElementsContext {\n const ctx = useContext(HyperElementsContext);\n if (ctx === undefined) {\n throw new Error(\n 'useHyperElementsContext must be used inside <HyperElements>'\n );\n }\n return ctx;\n}\n\nexport type UseWalletSessionResult = {\n walletSession: WalletSessionHandle | null;\n isGooglePayEligible: boolean;\n isApplePayEligible: boolean;\n loading: boolean;\n load: () => Promise<WalletSessionHandle | null>;\n};\n\nexport function useWalletSession(): UseWalletSessionResult {\n const ctx = useHyperElementsContext();\n return {\n walletSession: ctx.walletSession,\n isGooglePayEligible: ctx.walletEligibility.googlePay,\n isApplePayEligible: ctx.walletEligibility.applePay,\n loading: ctx.walletLoading,\n load: ctx.loadWalletSession,\n };\n}\n\nexport function useOptionalWalletSession(): UseWalletSessionResult {\n const ctx = useContext(HyperElementsContext);\n return {\n walletSession: ctx?.walletSession ?? null,\n isGooglePayEligible: ctx?.walletEligibility.googlePay ?? false,\n isApplePayEligible: ctx?.walletEligibility.applePay ?? false,\n loading: ctx?.walletLoading ?? false,\n load: ctx?.loadWalletSession ?? (async () => null),\n };\n}\n\nexport function useOptionalPaymentSession(): PaymentSession | null {\n const ctx = useContext(HyperElementsContext);\n return ctx?.paymentSession ?? null;\n}\n\nexport function usePaymentSession(): PaymentSession | null {\n const ctx = useHyperElementsContext();\n return ctx.paymentSession;\n}\n\nexport function useElements(): Elements | null {\n const ctx = useHyperElementsContext();\n return ctx.elements;\n}\n","import { requireNativeComponent } from 'react-native';\nimport type { NativePaymentWidgetPropTypes } from '../types/NativeEventTypes';\n\ndeclare global {\n var nativeFabricUIManager: unknown | null | undefined;\n}\n\ntype NativePaymentWidgetComponent =\n React.ComponentType<NativePaymentWidgetPropTypes>;\n\nconst NativePaymentWidgetImpl: NativePaymentWidgetComponent =\n global.nativeFabricUIManager != null\n ? (require('../codegen/components/PaymentWidgetNativeComponent')\n .default as NativePaymentWidgetComponent)\n : (requireNativeComponent(\n 'RCTNativePaymentWidget'\n ) as unknown as NativePaymentWidgetComponent);\n\nexport default NativePaymentWidgetImpl;\n","import { useEffect, useState } from 'react';\nimport { findNodeHandle } from 'react-native';\n\nconst MAX_ATTEMPTS = 20;\nconst RETRY_INTERVAL_MS = 100;\n\n/**\n * Polls `findNodeHandle` until the native view is attached and returns the\n * native view tag. Retries up to {@link MAX_ATTEMPTS} times spaced\n * {@link RETRY_INTERVAL_MS}ms apart to give Fabric time to attach the\n * shadow node on slower devices.\n *\n * Calls `onReady` exactly once — on the first successful poll.\n */\nexport function useNativeViewTag(\n viewRef: React.RefObject<unknown>,\n onReady?: () => void\n): number | undefined {\n const [viewTag, setViewTag] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n if (viewTag !== undefined) return;\n\n let isMounted = true;\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n const poll = (attempt: number) => {\n if (!isMounted) return;\n if (viewRef.current == null) {\n if (attempt < MAX_ATTEMPTS) {\n timer = setTimeout(() => poll(attempt + 1), RETRY_INTERVAL_MS);\n }\n return;\n }\n const tag =\n findNodeHandle(\n viewRef.current as Parameters<typeof findNodeHandle>[0]\n ) ?? -1;\n if (tag !== -1) {\n onReady?.();\n setViewTag(tag);\n } else if (attempt < MAX_ATTEMPTS) {\n timer = setTimeout(() => poll(attempt + 1), RETRY_INTERVAL_MS);\n }\n };\n\n poll(0);\n\n return () => {\n isMounted = false;\n if (timer !== undefined) clearTimeout(timer);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [viewTag]);\n\n return viewTag;\n}\n","import { forwardRef, useEffect, useMemo, useRef } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { useHyperElementsContext } from '../context/HyperElements';\nimport type { CvcWidgetOptions } from '../types/definitions';\nimport { registerWidget, unregisterWidget } from '../widget/WidgetRegistry';\nimport type {\n PaymentEventNative,\n PaymentEventResult,\n} from '../types/NativeEventTypes';\nimport type { SavedMethodCustomization } from '../types/PaymentSheetConfiguration';\nimport NativePaymentWidgetImpl from './PaymentWidgetBridge';\nimport { useNativeViewTag } from './useNativeViewTag';\nimport { PaymentResult } from '../types/paymentresult';\n\ntype CVCElementProps = {\n id?: string;\n options?: CvcWidgetOptions;\n onChange?: (event: PaymentEventResult) => void;\n onFocus?: () => void;\n onReady?: () => void;\n onBlur?: () => void;\n onPaymentResult?: (result: PaymentResult) => void;\n style?: ViewStyle;\n};\n\ntype CVCWidgetRef = {\n confirmPayment: () => Promise<PaymentResult>;\n};\n\nfunction parsePaymentResult(result: string): PaymentResult {\n return JSON.parse(result);\n}\n\nexport const CVCElement = forwardRef<CVCWidgetRef, CVCElementProps>(\n (props, _ref) => {\n const {\n id,\n options,\n onChange,\n onFocus,\n onBlur,\n onPaymentResult,\n style,\n onReady,\n } = props;\n const { paymentSessionConfig, hyperswitchConfig } =\n useHyperElementsContext();\n const viewRef = useRef(null);\n const viewTag = useNativeViewTag(viewRef, onReady);\n\n const shouldRegister = id !== undefined && viewTag !== undefined;\n useEffect(() => {\n if (!shouldRegister) return undefined;\n const widgetId = id as string;\n const tag = viewTag as number;\n registerWidget(widgetId, tag);\n return () => unregisterWidget(widgetId);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [shouldRegister]);\n\n const nativeOptions = useMemo(() => {\n const opts = options as\n | (CvcWidgetOptions & {\n paymentMethodLayout?: {\n savedMethodCustomization?: SavedMethodCustomization;\n };\n })\n | undefined;\n const layout = opts?.paymentMethodLayout;\n return {\n ...opts,\n paymentMethodLayout: {\n ...layout,\n savedMethodCustomization: {\n ...layout?.savedMethodCustomization,\n cvcIcon: opts?.cvcIcon ?? 'shown',\n },\n },\n };\n }, [options]);\n\n const onPaymentEventInternal = (event: PaymentEventNative) => {\n onChange?.(event.nativeEvent);\n\n if (event.nativeEvent.eventName === 'CVC_STATUS') {\n try {\n const payloadString = event.nativeEvent.payload;\n const outerDict = (\n typeof payloadString === 'string'\n ? JSON.parse(payloadString)\n : payloadString\n ) as Record<string, unknown> | undefined;\n if (!outerDict) {\n return;\n }\n const cvcStatus = outerDict.cvcStatus as\n Record<string, unknown> | undefined;\n if (!cvcStatus) {\n return;\n }\n const isCvcFocused = Boolean(cvcStatus.isCvcFocused);\n const isCvcBlur = Boolean(cvcStatus.isCvcBlur);\n if (isCvcFocused) {\n onFocus?.();\n }\n if (isCvcBlur) {\n onBlur?.();\n }\n } catch {\n // Ignore malformed native events\n }\n }\n };\n\n const onPaymentResultInternal = (event: {\n nativeEvent: { result?: string };\n }) => {\n onPaymentResult?.(parsePaymentResult(event.nativeEvent.result ?? ''));\n };\n\n return (\n <NativePaymentWidgetImpl\n ref={viewRef}\n widgetType=\"cvcWidget\"\n sdkAuthorization={paymentSessionConfig?.sdkAuthorization ?? ''}\n onPaymentEvent={onPaymentEventInternal}\n onPaymentResult={onPaymentResultInternal}\n options={{\n hyperswitchConfig: hyperswitchConfig || undefined,\n paymentSessionConfig: paymentSessionConfig || undefined,\n configuration: nativeOptions as Record<string, unknown>,\n }}\n style={style}\n />\n );\n }\n);\n","const validEventStrings = [\n 'PAYMENT_METHOD_INFO_CARD',\n 'PAYMENT_METHOD_STATUS',\n 'FORM_STATUS',\n 'PAYMENT_METHOD_INFO_ADDRESS',\n 'PAYMENT_METHOD_INFO_BILLING_ADDRESS',\n 'CVC_STATUS',\n];\n\nexport function getValidEventsString(): string {\n return validEventStrings.join(', ');\n}\n\nexport function validateSubscribedEventStrings(\n subscribedEvents: string[] | undefined\n): string[] {\n if (!subscribedEvents) {\n return [];\n }\n return subscribedEvents.filter((event) => !validEventStrings.includes(event));\n}\n\nexport type UnknownEventWarningPayload = {\n message: string;\n invalidEvents: string[];\n validEvents: string[];\n};\n\nexport function makeUnknownEventWarningPayload(\n invalidEvents: string[]\n): UnknownEventWarningPayload {\n const invalidEventsStr = invalidEvents.join(', ');\n const validEventsStr = getValidEventsString();\n return {\n message: `Unknown event(s) subscribed: [${invalidEventsStr}]. Valid events are: ${validEventsStr}`,\n invalidEvents,\n validEvents: validEventStrings,\n };\n}\n","import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\nimport { UIManager, findNodeHandle, type ViewStyle, Platform } from 'react-native';\nimport NativePaymentWidgetImpl from './PaymentWidgetBridge';\nimport { registerWidget, unregisterWidget } from '../widget/WidgetRegistry';\nimport type { PaymentSheetConfiguration } from '../types/PaymentSheetConfiguration';\nimport { useHyperElementsContext } from '../context/HyperElements';\nimport {\n makeUnknownEventWarningPayload,\n validateSubscribedEventStrings,\n} from '../utils/EventValidator';\nimport type {\n PaymentEventNative,\n NativeEventEnvelope,\n PaymentEventResult,\n} from '../types/NativeEventTypes';\nimport type { PaymentElementHandle } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\nimport NativeWidgetHelperModule from '../codegen/modules/NativeWidgetHelperModule';\nimport { useNativeViewTag } from './useNativeViewTag';\n\ntype PaymentElementProps = {\n widgetId: string;\n options?: PaymentSheetConfiguration;\n onPaymentResult: (result: PaymentResult) => void;\n onChange?: (event: PaymentEventResult) => void;\n onReady?: () => void;\n style?: ViewStyle;\n};\n\nexport const PaymentElement = forwardRef<\n PaymentElementHandle,\n PaymentElementProps\n>((props, ref) => {\n const { widgetId, options, onPaymentResult, onChange, onReady, style } =\n props;\n const { paymentSessionConfig, hyperswitchConfig } = useHyperElementsContext();\n const viewRef = useRef(null);\n const viewTag = useNativeViewTag(viewRef, onReady);\n\n useEffect(() => {\n if (viewTag === undefined) return undefined;\n registerWidget(widgetId, viewTag);\n return () => unregisterWidget(widgetId);\n }, [viewTag, widgetId]);\n\n // Old-arch view manager command \"1\": tells the native view to attach itself\n // to the active payment session. Without it the widget mounts but renders\n // an empty container on Paper.\n useEffect(() => {\n if (viewTag !== undefined) {\n UIManager.dispatchViewManagerCommand(viewTag, 1, []);\n }\n }, [viewTag]);\n\n useImperativeHandle(\n ref,\n () => ({\n confirmPayment: (_options?: {\n confirmParams?: Record<string, any>;\n }): Promise<PaymentResult> => {\n if (viewRef.current == null) {\n return Promise.resolve({\n status: 'failed',\n type: 'widget_not_ready',\n message: 'Widget not ready',\n });\n }\n const id =\n findNodeHandle(\n viewRef.current as Parameters<typeof findNodeHandle>[0]\n ) ?? -1;\n if (id === -1) {\n return Promise.resolve({\n status: 'failed',\n type: 'widget_not_ready',\n message: 'Unable to find native view handle',\n });\n }\n return new Promise<PaymentResult>((resolve) => {\n NativeWidgetHelperModule.confirmPayment(id, (raw) => {\n resolve(mapNativeResponseToPaymentResult(raw));\n });\n });\n },\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [viewTag]\n );\n\n const warningEmitted = useRef(false);\n\n useEffect(() => {\n if (!options || !onChange || warningEmitted.current) {\n return;\n }\n const subscribedEvents = options.subscribedEvents as string[] | undefined;\n\n const invalidEvents = validateSubscribedEventStrings(subscribedEvents);\n if (invalidEvents.length > 0) {\n warningEmitted.current = true;\n const warningPayload = makeUnknownEventWarningPayload(invalidEvents);\n onChange({\n eventName: 'UNKNOWN_EVENT_SUBSCRIBED',\n payload: JSON.stringify({\n message: warningPayload.message,\n invalidEvents: warningPayload.invalidEvents,\n validEvents: warningPayload.validEvents,\n }),\n });\n }\n }, [options, onChange]);\n\n const onPaymentResultInternal = (event: NativeEventEnvelope & { nativeEvent: {\n eventName: string;\n payload: string;\n target: number;\n}}) => {\n onPaymentResult(\n mapNativeResponseToPaymentResult(\n Platform.OS === 'ios'\n ? event.nativeEvent.result ?? \"\"\n : event.nativeEvent.payload ?? \"\"\n )\n );\n };\n\n const onPaymentEventInternal = (event: PaymentEventNative) => {\n onChange?.(event.nativeEvent);\n };\n\n return (\n <NativePaymentWidgetImpl\n ref={viewRef}\n sdkAuthorization={paymentSessionConfig?.sdkAuthorization ?? ''}\n widgetType=\"widgetPaymentSheet\"\n onPaymentEvent={onPaymentEventInternal}\n onPaymentResult={onPaymentResultInternal}\n options={{\n hyperswitchConfig: hyperswitchConfig || undefined,\n paymentSessionConfig: paymentSessionConfig || undefined,\n configuration: options as Record<string, unknown> | undefined,\n }}\n style={{ ...style, flex: 1 }}\n />\n );\n});\n","import { Platform } from 'react-native';\nimport NativeHyperswitchModule from '../codegen/modules/NativeHyperswitchModule';\nimport type { WalletName } from '../types/walletSession';\n\nexport function isGooglePaySupported(): Promise<boolean> {\n return NativeHyperswitchModule.isGooglePaySupported().catch(() => false);\n}\n\nexport function isApplePaySupported(): Promise<boolean> {\n return NativeHyperswitchModule.isApplePaySupported().catch(() => false);\n}\n\nexport function isWalletSupported(wallet: WalletName): Promise<boolean> {\n return wallet === 'google_pay'\n ? isGooglePaySupported()\n : isApplePaySupported();\n}\n\nexport function isPlatformPaySupported(): Promise<boolean> {\n if (Platform.OS === 'ios') {\n return isApplePaySupported();\n }\n if (Platform.OS === 'android') {\n return isGooglePaySupported();\n }\n return Promise.resolve(false);\n}\n","import { useRef } from 'react';\nimport {\n useOptionalPaymentSession,\n useOptionalWalletSession,\n} from '../context/HyperElements';\nimport type { PaymentSession } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { WalletName } from '../types/walletSession';\n\nexport type WalletLaunchOptions = {\n wallet: WalletName;\n label: string;\n session?: PaymentSession;\n onPaymentResult?: (result: PaymentResult) => void;\n};\n\nexport function useWalletLaunch({\n wallet,\n label,\n session,\n onPaymentResult,\n}: WalletLaunchOptions): () => Promise<void> {\n const contextSession = useOptionalPaymentSession();\n const { walletSession, load } = useOptionalWalletSession();\n const inFlight = useRef(false);\n\n return async () => {\n const activeSession = session ?? contextSession;\n\n if (!activeSession && !walletSession) {\n const error = new Error(\n `${label} was pressed without a payment session. Pass a \"session\" prop or render it inside <HyperElements>.`\n );\n if (!onPaymentResult) {\n throw error;\n }\n onPaymentResult({\n status: 'failed',\n type: 'no_session',\n message: error.message,\n });\n return;\n }\n\n if (inFlight.current) {\n const error = new Error(\n `${label} is already processing a payment. Ignoring this press.`\n );\n if (!onPaymentResult) {\n throw error;\n }\n onPaymentResult({\n status: 'failed',\n type: 'already_in_progress',\n message: error.message,\n });\n return;\n }\n inFlight.current = true;\n\n try {\n const wallets =\n walletSession ??\n (await load()) ??\n (await activeSession!.getWalletSession());\n\n const eligible = await wallets.isWalletEligible(wallet);\n if (!eligible) {\n const error = new Error(\n `${label} is not eligible for this payment.`\n );\n if (!onPaymentResult) {\n throw error;\n }\n onPaymentResult({\n status: 'failed',\n type: 'not_eligible',\n message: error.message,\n });\n return;\n }\n\n const result = await wallets.launchWallet(wallet);\n onPaymentResult?.(result);\n } catch (e) {\n const message = e instanceof Error ? e.message : String(e);\n if (!onPaymentResult) {\n throw e;\n }\n onPaymentResult({\n status: 'failed',\n type: 'launch_failed',\n message,\n });\n } finally {\n inFlight.current = false;\n }\n };\n}\n","import type {\n ApplePayButtonStyle,\n ApplePayButtonType,\n ApplePayConfiguration,\n GooglePayButtonStyle,\n GooglePayButtonType,\n GooglePayConfiguration,\n PaymentSheetConfiguration,\n} from '../types/PaymentSheetConfiguration';\n\nconst GOOGLE_PAY_BUTTON_TYPE: Record<GooglePayButtonType, number> = {\n BUY: 1,\n BOOK: 6,\n CHECKOUT: 5,\n DONATE: 4,\n ORDER: 11,\n PAY: 1000,\n SUBSCRIBE: 7,\n PLAIN: 1001,\n};\n\nconst GOOGLE_PAY_APPEARANCE: Record<GooglePayButtonStyle, number> = {\n light: 1,\n dark: 2,\n};\n\nconst APPLE_PAY_BUTTON_TYPE: Record<ApplePayButtonType, number> = {\n plain: 0,\n buy: 1,\n setUp: 2,\n inStore: 3,\n donate: 4,\n checkout: 5,\n book: 6,\n subscribe: 7,\n};\n\nconst APPLE_PAY_BUTTON_STYLE: Record<ApplePayButtonStyle, number> = {\n white: 0,\n whiteOutline: 1,\n black: 2,\n};\n\nexport function isHidden(\n config?: GooglePayConfiguration | ApplePayConfiguration\n): boolean {\n return config?.visibility === 'hidden';\n}\n\nexport function getBorderRadius(options?: PaymentSheetConfiguration): number {\n return (\n options?.appearance?.primaryButton?.shapes?.borderRadius ??\n options?.appearance?.shapes?.borderRadius ??\n 4\n );\n}\n\nfunction isDarkTheme(\n options: PaymentSheetConfiguration | undefined,\n colorScheme: 'light' | 'dark'\n): boolean {\n const theme = options?.appearance?.theme;\n if (theme === 'Dark') {\n return true;\n }\n if (theme === 'Light') {\n return false;\n }\n return colorScheme === 'dark';\n}\n\nexport function resolveGooglePayProps(\n options: PaymentSheetConfiguration | undefined,\n colorScheme: 'light' | 'dark'\n) {\n const config = options?.walletButtonsConfiguration?.googlePay;\n const dark = isDarkTheme(options, colorScheme);\n const style = dark ? config?.buttonStyle?.dark : config?.buttonStyle?.light;\n\n return {\n hidden: isHidden(config),\n type: GOOGLE_PAY_BUTTON_TYPE[config?.buttonType ?? 'PLAIN'],\n appearance: GOOGLE_PAY_APPEARANCE[style ?? (dark ? 'dark' : 'light')],\n borderRadius: getBorderRadius(options),\n };\n}\n\nexport function resolveApplePayProps(\n options: PaymentSheetConfiguration | undefined,\n colorScheme: 'light' | 'dark'\n) {\n const config = options?.walletButtonsConfiguration?.applePay;\n const dark = isDarkTheme(options, colorScheme);\n const style = dark ? config?.buttonStyle?.dark : config?.buttonStyle?.light;\n\n return {\n hidden: isHidden(config),\n type: APPLE_PAY_BUTTON_TYPE[config?.buttonType ?? 'plain'],\n buttonStyle: APPLE_PAY_BUTTON_STYLE[style ?? (dark ? 'white' : 'black')],\n borderRadius: getBorderRadius(options),\n };\n}\n","import {\n Platform,\n Pressable,\n StyleSheet,\n requireNativeComponent,\n useColorScheme,\n} from 'react-native';\nimport type { ViewProps, ViewStyle } from 'react-native';\nimport { useWalletLaunch } from './useWalletLaunch';\nimport { resolveGooglePayProps } from './walletButtonConfig';\nimport type { PaymentSession } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { PaymentSheetConfiguration } from '../types/PaymentSheetConfiguration';\n\ndeclare global {\n var nativeFabricUIManager: unknown | null | undefined;\n}\n\ntype NativeProps = ViewProps & {\n type?: number;\n appearance: number;\n borderRadius?: number;\n};\n\nfunction resolveNativeComponent(): React.ComponentType<NativeProps> | null {\n if (Platform.OS !== 'android') {\n return null;\n }\n try {\n if (globalThis.nativeFabricUIManager != null) {\n return require('../codegen/components/HyperGooglePayNativeComponent')\n .default as React.ComponentType<NativeProps>;\n }\n return requireNativeComponent(\n 'HyperGooglePayButton'\n ) as unknown as React.ComponentType<NativeProps>;\n } catch {\n return null;\n }\n}\n\nconst NativeHyperGooglePayButton = resolveNativeComponent();\n\nexport type GooglePayButtonProps = {\n options?: PaymentSheetConfiguration;\n session?: PaymentSession;\n onPaymentResult?: (result: PaymentResult) => void;\n style?: ViewStyle;\n};\n\nexport function GooglePayButton({\n options,\n session,\n onPaymentResult,\n style,\n}: GooglePayButtonProps) {\n const colorScheme = useColorScheme();\n const launch = useWalletLaunch({\n wallet: 'google_pay',\n label: 'Google Pay',\n session,\n onPaymentResult,\n });\n\n const { hidden, type, appearance, borderRadius } = resolveGooglePayProps(\n options,\n colorScheme === 'dark' ? 'dark' : 'light'\n );\n\n if (hidden || NativeHyperGooglePayButton == null) {\n return null;\n }\n\n return (\n <Pressable\n focusable\n accessible\n accessibilityRole=\"button\"\n accessibilityLabel=\"Google Pay\"\n onPress={launch}\n style={style}\n >\n <NativeHyperGooglePayButton\n type={type}\n appearance={appearance}\n borderRadius={borderRadius}\n style={StyleSheet.absoluteFill}\n />\n </Pressable>\n );\n}\n","import {\n Platform,\n Pressable,\n StyleSheet,\n requireNativeComponent,\n useColorScheme,\n} from 'react-native';\nimport type { ViewProps, ViewStyle } from 'react-native';\nimport { useWalletLaunch } from './useWalletLaunch';\nimport { resolveApplePayProps } from './walletButtonConfig';\nimport type { PaymentSession } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { PaymentSheetConfiguration } from '../types/PaymentSheetConfiguration';\n\ndeclare global {\n var nativeFabricUIManager: unknown | null | undefined;\n}\n\ntype NativeProps = ViewProps & {\n type?: number;\n buttonStyle?: number;\n buttonBorderRadius?: number;\n disabled?: boolean;\n};\n\nfunction resolveNativeComponent(): React.ComponentType<NativeProps> | null {\n if (Platform.OS !== 'ios') {\n return null;\n }\n try {\n if (globalThis.nativeFabricUIManager != null) {\n return require('../codegen/components/HyperApplePayNativeComponent')\n .default as React.ComponentType<NativeProps>;\n }\n return requireNativeComponent(\n 'HyperApplePayButton'\n ) as unknown as React.ComponentType<NativeProps>;\n } catch {\n return null;\n }\n}\n\nconst NativeHyperApplePayButton = resolveNativeComponent();\n\nexport type ApplePayButtonProps = {\n options?: PaymentSheetConfiguration;\n session?: PaymentSession;\n onPaymentResult?: (result: PaymentResult) => void;\n disabled?: boolean;\n style?: ViewStyle;\n};\n\nexport function ApplePayButton({\n options,\n session,\n onPaymentResult,\n disabled = false,\n style,\n}: ApplePayButtonProps) {\n const colorScheme = useColorScheme();\n const launch = useWalletLaunch({\n wallet: 'apple_pay',\n label: 'Apple Pay',\n session,\n onPaymentResult,\n });\n\n const { hidden, type, buttonStyle, borderRadius } = resolveApplePayProps(\n options,\n colorScheme === 'dark' ? 'dark' : 'light'\n );\n\n if (hidden || NativeHyperApplePayButton == null) {\n return null;\n }\n\n return (\n <Pressable\n focusable\n accessible\n accessibilityRole=\"button\"\n accessibilityLabel=\"Apple Pay\"\n onPress={launch}\n disabled={disabled}\n style={style}\n >\n <NativeHyperApplePayButton\n type={type}\n buttonStyle={buttonStyle}\n buttonBorderRadius={borderRadius}\n disabled={disabled}\n style={StyleSheet.absoluteFill}\n />\n </Pressable>\n );\n}\n","import type {\n HyperswitchConfiguration,\n PaymentSession,\n PaymentSessionConfiguration,\n HyperswitchSession,\n} from './types/definitions';\nexport type * from './types/savedPaymentMethods';\nexport type * from './types/walletSession';\nexport type * from './types/definitions';\nexport type * from './types/elements';\nexport type * from './types/NativeEventTypes';\nexport type * from './types/PaymentSheetConfiguration';\nexport type * from './types/paymentresult';\nimport NativeHyperswitchModule from './codegen/modules/NativeHyperswitchModule';\nimport { createPaymentSession } from './session/PaymentSession';\nimport { Elements } from './types/elements';\nimport { createElements } from './session/Elements';\nimport { setInitializing } from './native/InitializationState';\n\nexport function loadHyper(\n config: HyperswitchConfiguration\n): Promise<HyperswitchSession> {\n setInitializing(true);\n return NativeHyperswitchModule.initialise(\n config.publishableKey,\n config.platformPublishableKey ?? '',\n config.profileId ?? '',\n config.environment ?? 'PROD',\n config.customEndpoints ?? {}\n )\n .then(() => {\n setInitializing(false);\n return {\n publishableKey: config.publishableKey,\n async initPaymentSession(\n options: PaymentSessionConfiguration\n ): Promise<PaymentSession> {\n return createPaymentSession(config, options);\n },\n async elements(\n options: PaymentSessionConfiguration\n ): Promise<Elements> {\n return createElements(config, options);\n },\n };\n })\n .catch((error) => {\n setInitializing(false);\n console.error('Error initializing Hyperswitch SDK:', error);\n throw error;\n });\n}\n\nexport const Hyperswitch = {\n init: loadHyper,\n};\n\nexport default Hyperswitch;\n\nexport {\n HyperElements,\n usePaymentSession,\n useWalletSession,\n useElements,\n useElements as useWidgets,\n} from './context/HyperElements';\n\nexport { CVCElement as CardCVCElement } from './views/CVCElement';\n\nexport { PaymentElement } from './views/PaymentElement';\n\nexport {\n isPlatformPaySupported,\n isGooglePaySupported,\n isApplePaySupported,\n isWalletSupported,\n} from './session/PlatformPaySupport';\n\nexport { GooglePayButton } from './views/GooglePayButton';\nexport type { GooglePayButtonProps } from './views/GooglePayButton';\n\nexport { ApplePayButton } from './views/ApplePayButton';\nexport type { ApplePayButtonProps } from './views/ApplePayButton';"],"names":["NativeHyperswitchModule","TurboModuleRegistry","get","NativeModules","NativeWidgetHelperModule","mapStatus","status","mapNativeResponseToPaymentResult","raw","parsed","JSON","parse","message","String","parseNativeResponse","type","code","widgetTags","Map","registerWidget","widgetId","nativeViewTag","set","unregisterWidget","delete","updateIntentCompleteForAllWidgets","sdkAuthorization","promises","values","map","tag","Promise","resolve","updateIntentCompleteForWidget","all","_isInitializing","setInitializing","value","_isSheetPresented","setSheetPresented","async","presentPaymentSheetWithPayload","payload","presentPaymentSheet","hyperswitchConfig","paymentSessionConfig","configuration","getReactTag","Error","reactTag","getWidget","undefined","parseBilling","parsePaymentMethod","billing","getCustomerSavedPaymentMethods","paymentMethodLayout","savedMethodCustomization","hiddenPaymentMethods","getCustomerLastUsedPaymentMethodData","getCustomerDefaultSavedPaymentMethodData","getCustomerSavedPaymentMethodData","args","confirmWithCustomerLastUsedPaymentMethod","id","confirmWithCustomerDefaultPaymentMethod","getWalletSession","promise","label","reject","timer","setTimeout","then","clearTimeout","error","isWalletEligible","wallet","catch","isGooglePayEligible","isApplePayEligible","launchWallet","bindPresentPaymentSheet","bindings","restConfig","platformPublishableKey","buildPresentPaymentSheetPayload","bindGetCustomerSavedPaymentMethods","bindGetWalletSession","updateIntent","intentResolver","newIntent","updateIntentInitForWidget","updateIntentInitForAllWidgets","createElementsNativeActions","confirmPayment","paymentElementRef","confirmOptions","nativeTag","stringify","confirmWidgetPayment","ref","current","process","env","NODE_ENV","getComponentNameFromType","$$typeof","REACT_CLIENT_REFERENCE","displayName","name","REACT_FRAGMENT_TYPE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","console","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","_context","REACT_FORWARD_REF_TYPE","innerType","render","REACT_MEMO_TYPE","REACT_LAZY_TYPE","_payload","_init","x","testStringCoercion","checkKeyStringCoercion","JSCompiler_inline_result","e","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","Symbol","toStringTag","constructor","call","getTaskName","UnknownOwner","elementRefGetterWithDeprecationWarning","componentName","this","didWarnAboutElementRef","props","jsxDEVImpl","config","maybeKey","isStaticChildren","debugStack","debugTask","dispatcher","children","isArrayImpl","length","validateChildKeys","Object","freeze","hasOwnProperty","keys","filter","k","join","didWarnAboutKeySpread","getter","getOwnPropertyDescriptor","isReactWarning","key","hasValidKey","propName","warnAboutAccessingKey","specialPropKeyWarningShown","defineProperty","configurable","defineKeyPropWarningGetter","owner","refProp","REACT_ELEMENT_TYPE","_owner","enumerable","_store","writable","ReactElement","ReactSharedInternals","A","getOwner","node","isValidElement","validated","object","React","require$$0","for","__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","prototype","Array","isArray","createTask","unknownOwnerDebugStack","react_stack_bottom_frame","callStackForError","bind","unknownOwnerDebugTask","reactJsxRuntime_development","Fragment","jsx","trackActualOwner","recentlyCreatedOwnerStacks","jsxs","jsxRuntimeModule","exports","jsxProd","reactJsxRuntime_production","require$$1","HyperElementsContext","createContext","HyperElements","hyper","options","paymentSession","setPaymentSession","useState","elements","setElements","setHyperswitchConfig","setPaymentSessionConfig","publishableKey","setPublishableKey","setSdkAuthorization","loading","setLoading","setError","walletSession","setWalletSession","walletEligibility","setWalletEligibility","googlePay","applePay","walletLoading","setWalletLoading","loadWalletSession","useCallback","wallets","useEffect","cancelled","session","sessionConfig","els","err","_jsx","Provider","useHyperElementsContext","ctx","useContext","useWalletSession","load","usePaymentSession","useElements","NativePaymentWidgetImpl","global","nativeFabricUIManager","require","default","requireNativeComponent","useNativeViewTag","viewRef","onReady","viewTag","setViewTag","isMounted","poll","attempt","findNodeHandle","CVCElement","forwardRef","_ref","onChange","onFocus","onBlur","onPaymentResult","style","useRef","shouldRegister","nativeOptions","useMemo","opts","layout","cvcIcon","widgetType","onPaymentEvent","event","nativeEvent","eventName","payloadString","outerDict","cvcStatus","isCvcFocused","Boolean","isCvcBlur","result","validEventStrings","makeUnknownEventWarningPayload","invalidEvents","validEvents","PaymentElement","UIManager","dispatchViewManagerCommand","useImperativeHandle","_options","warningEmitted","subscribedEvents","includes","validateSubscribedEventStrings","warningPayload","Platform","OS","flex","isGooglePaySupported","isApplePaySupported","isWalletSupported","isPlatformPaySupported","useWalletLaunch","contextSession","useOptionalPaymentSession","useOptionalWalletSession","inFlight","activeSession","GOOGLE_PAY_BUTTON_TYPE","BUY","BOOK","CHECKOUT","DONATE","ORDER","PAY","SUBSCRIBE","PLAIN","GOOGLE_PAY_APPEARANCE","light","dark","APPLE_PAY_BUTTON_TYPE","plain","buy","setUp","inStore","donate","checkout","book","subscribe","APPLE_PAY_BUTTON_STYLE","white","whiteOutline","black","isHidden","visibility","getBorderRadius","appearance","primaryButton","shapes","borderRadius","isDarkTheme","colorScheme","theme","NativeHyperGooglePayButton","globalThis","resolveNativeComponent","GooglePayButton","useColorScheme","launch","hidden","walletButtonsConfiguration","buttonStyle","buttonType","resolveGooglePayProps","Pressable","focusable","accessible","accessibilityRole","accessibilityLabel","onPress","StyleSheet","absoluteFill","NativeHyperApplePayButton","ApplePayButton","disabled","resolveApplePayProps","buttonBorderRadius","loadHyper","initialise","profileId","environment","customEndpoints","createPaymentSession","Hyperswitch","init"],"mappings":"+WAgDA,MAAMA,EACJC,EAAoBC,IAAU,4BAC9BC,EAAcH,wBClCVI,EACJH,EAAoBC,IAAU,6BAC9BC,EAAcC,yBCKV,SAAUC,EAAUC,GACxB,OAAQA,GACN,IAAK,YACL,IAAK,YACL,IAAK,mBACL,IAAK,UACH,MAAO,YACT,IAAK,YACL,IAAK,WACH,MAAO,WAGT,QACE,MAAO,SAEb,CAEM,SAAUC,EACdC,GAEA,MAAMC,EAjCF,SACJD,GAEA,GAAmB,iBAARA,GAA4B,OAARA,EAC7B,OAAOA,EAET,IACE,OAAOE,KAAKC,MAAMH,EACpB,CAAE,MACA,MAAO,CAAEF,OAAQ,SAAUM,QAASC,OAAOL,GAC7C,CACF,CAsBiBM,CAAoBN,GACnC,MAAO,CACLF,OAAQD,EAAUI,EAAOH,QACzBS,KAAMN,EAAOM,MAAQN,EAAOO,MAAQX,EAAUI,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gB,GACT,CACL+L,eAAgBhF,EAAOgF,eACvB3L,mBAAwB,MACtBmL,GhBNJ,SACJ/K,EACAC,GAEA,MAAMqC,EAAW,CAAEtC,oBAAmBC,wBACtC,MAAO,CACLF,oBAAqBsC,EAAwBC,GAC7C3B,+BACE+B,EAAmCJ,GACrChB,iBAAkBqB,EAAqBL,GACvCM,eAEJ,CgBJiBgT,CAAqBrP,EAAQwE,GAEtC,cAAMI,CACJJ,GAEA,MfoBD,CACL/K,kBAJFA,EejB8BuG,KfsBzBtD,EAA4BjD,EetBK+K,IfgBlC,IACJ/K,CehBM,KAGHiC,MAAOH,IAGN,MAFAtC,GAAgB,GAChBgF,QAAQ1C,MAAM,sCAAuCA,GAC/CA,GAEZ,CAEO,MAAM+T,GAAc,CACzBC,KAAMP","x_google_ignoreList":[12,13,14]}
1
+ {"version":3,"file":"index.bundle.js","sources":["../../../../src/codegen/modules/NativeHyperswitchModule.ts","../../../../src/codegen/modules/NativeWidgetHelperModule.ts","../../../../src/native/NativeResponseMapper.ts","../../../../src/widget/WidgetRegistry.ts","../../../../src/native/InitializationState.ts","../../../../src/session/presentPaymentSheet.ts","../../../../src/session/SavedPaymentMethods.ts","../../../../src/session/WalletSession.ts","../../../../src/session/binders.ts","../../../../src/utils/LaunchOptions.ts","../../../../src/session/PaymentSession.ts","../../../../src/session/Elements.ts","../../node_modules/react/cjs/react-jsx-runtime.development.js","../../node_modules/react/jsx-runtime.js","../../node_modules/react/cjs/react-jsx-runtime.production.js","../../../../src/context/HyperElements.tsx","../../../../src/views/PaymentWidgetBridge.ts","../../../../src/views/useNativeViewTag.ts","../../../../src/views/CVCElement.tsx","../../../../src/utils/EventValidator.ts","../../../../src/views/PaymentElement.tsx","../../../../src/session/PlatformPaySupport.ts","../../../../src/views/useWalletLaunch.ts","../../../../src/views/useWalletReady.ts","../../../../src/views/walletButtonConfig.ts","../../../../src/views/GooglePayButton.tsx","../../../../src/views/ApplePayButton.tsx","../../../../src/index.ts"],"sourcesContent":["import type { TurboModule } from 'react-native';\nimport { NativeModules, TurboModuleRegistry } from 'react-native';\n\nexport type CustomEndpoints = Object;\n\nexport interface Spec extends TurboModule {\n initialise(\n publishableKey: string,\n platformPublishableKey: string,\n profileId: string,\n environment: string,\n customEndpoints: CustomEndpoints\n ): Promise<string>;\n\n presentPaymentSheet(params: Object): Promise<string>;\n\n getCustomerSavedPaymentMethods(params?: Object): Promise<string>;\n\n getCustomerLastUsedPaymentMethodData(): Promise<string>;\n\n getCustomerDefaultSavedPaymentMethodData(): Promise<string>;\n\n getCustomerSavedPaymentMethodData(): Promise<string>;\n\n confirmWithCustomerLastUsedPaymentMethod(reactTag: number): Promise<string>;\n\n confirmWithCustomerDefaultPaymentMethod(reactTag: number): Promise<string>;\n\n confirmWithCustomerPaymentToken(\n reactTag: number,\n token: string\n ): Promise<string>;\n\n isGooglePaySupported(): Promise<boolean>;\n\n isApplePaySupported(): Promise<boolean>;\n\n getWalletSession(params?: Object): Promise<string>;\n\n isWalletEligible(wallet: string): Promise<boolean>;\n\n launchWallet(wallet: string): Promise<string>;\n}\n\n/**\n * Use `TurboModuleRegistry.get` first for new-arch TurboModules, and fall back\n * to `NativeModules` for legacy/old-arch support.\n */\nconst NativeHyperswitchModule =\n TurboModuleRegistry.get<Spec>('NativeHyperswitchModule') ??\n NativeModules.NativeHyperswitchModule;\n\nexport default NativeHyperswitchModule as Spec;\nexport { NativeHyperswitchModule };\n","import type { TurboModule } from 'react-native';\nimport { NativeModules, TurboModuleRegistry } from 'react-native';\n\nexport interface Spec extends TurboModule {\n confirmPayment(reactTag: number, callback: (result: string) => void): void;\n updateIntentInitForWidget(\n reactTag: number,\n callback: (result: string) => void\n ): void;\n updateIntentCompleteForWidget(\n reactTag: number,\n sdkAuthorization: string,\n callback: (result: string) => void\n ): void;\n}\n\nconst NativeWidgetHelperModule =\n TurboModuleRegistry.get<Spec>('NativeWidgetHelperModule') ??\n NativeModules.NativeWidgetHelperModule;\n\nexport default NativeWidgetHelperModule as Spec;\n","import type { PaymentResult } from '../types/paymentresult';\n\ninterface NativeResponse {\n status: string;\n message: string;\n code?: string;\n type?: string;\n data?: any;\n}\n\nexport function parseNativeResponse(\n raw: string | NativeResponse\n): NativeResponse {\n if (typeof raw === 'object' && raw !== null) {\n return raw as NativeResponse;\n }\n try {\n return JSON.parse(raw as string) as NativeResponse;\n } catch {\n return { status: 'failed', message: String(raw) };\n }\n}\n\nexport function mapStatus(status: string): PaymentResult['status'] {\n switch (status) {\n case 'succeeded':\n case 'completed':\n case 'requires_capture':\n case 'success':\n return 'completed';\n case 'cancelled':\n case 'canceled':\n return 'canceled';\n case 'failed':\n case 'error':\n default:\n return 'failed';\n }\n}\n\nexport function mapNativeResponseToPaymentResult(\n raw: string | NativeResponse\n): PaymentResult {\n const parsed = parseNativeResponse(raw);\n return {\n status: mapStatus(parsed.status),\n type: parsed.type ?? parsed.code ?? mapStatus(parsed.status) ?? '',\n message: parsed.message ?? parsed.code ?? '',\n };\n}\n","import NativeWidgetHelperModule from '../codegen/modules/NativeWidgetHelperModule';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\nimport type { PaymentResult } from '../types/paymentresult';\n\nconst widgetTags = new Map<string, number>();\n\nexport function registerWidget(widgetId: string, nativeViewTag: number): void {\n widgetTags.set(widgetId, nativeViewTag);\n}\n\nexport function getWidget(widgetId: string): number | undefined {\n return widgetTags.get(widgetId);\n}\n\nexport function unregisterWidget(widgetId: string): void {\n widgetTags.delete(widgetId);\n}\n\n/**\n * @deprecated Pass a `ref` to `<PaymentElement>` instead and call\n * `elements.confirmPayment(ref)`. The widget-id (string) path\n * exists only for backward compatibility and will be removed\n * in the next major release.\n */\nexport function confirmPayment(widgetId: string): Promise<string> {\n const nativeTag = widgetTags.get(widgetId);\n if (nativeTag === undefined) {\n return Promise.resolve(\n JSON.stringify({\n status: 'failed',\n message: `Widget ${widgetId} not found or not mounted`,\n type: undefined,\n })\n );\n }\n return new Promise((resolve) => {\n NativeWidgetHelperModule.confirmPayment(nativeTag, resolve);\n });\n}\n\nexport function updateIntentInitForAllWidgets(): Promise<PaymentResult[]> {\n const promises = [...widgetTags.values()].map(\n (tag) =>\n new Promise<PaymentResult>((resolve) => {\n NativeWidgetHelperModule.updateIntentInitForWidget(tag, (raw: string) =>\n resolve(mapNativeResponseToPaymentResult(raw))\n );\n })\n );\n return Promise.all(promises);\n}\n\nexport function updateIntentCompleteForAllWidgets(\n sdkAuthorization: string\n): Promise<PaymentResult[]> {\n const promises = [...widgetTags.values()].map(\n (tag) =>\n new Promise<PaymentResult>((resolve) => {\n NativeWidgetHelperModule.updateIntentCompleteForWidget(\n tag,\n sdkAuthorization,\n (raw: string) => resolve(mapNativeResponseToPaymentResult(raw))\n );\n })\n );\n return Promise.all(promises);\n}\n","/**\n * Tracks whether the Hyperswitch SDK is currently initialising (or re-initialising\n * after a reload). presentPaymentSheet should be blocked while this flag is true\n * so the native SDK is not asked to open a sheet before it is ready.\n *\n * Also tracks whether a payment sheet is currently presented so that a hot-reload\n * (or any other code path) cannot stack a second sheet on top of an open one.\n */\n\nlet _isInitializing = false;\n\nexport function setInitializing(value: boolean): void {\n _isInitializing = value;\n}\n\nexport function isInitializing(): boolean {\n return _isInitializing;\n}\n\nlet _isSheetPresented = false;\n\nexport function setSheetPresented(value: boolean): void {\n _isSheetPresented = value;\n}\n\nexport function isSheetPresented(): boolean {\n return _isSheetPresented;\n}\n","import NativeHyperswitchModule from '../codegen/modules/NativeHyperswitchModule';\nimport type { NativePaymentSheetPayload } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\nimport {\n isInitializing,\n isSheetPresented,\n setSheetPresented,\n} from '../native/InitializationState';\n\n/**\n * Low-level wrapper over `NativeHyperswitchModule.presentPaymentSheet`.\n *\n * Guards against two failure modes that silently confused merchants in\n * older SDK versions:\n * 1. Opening a sheet while `loadHyper()` is still initialising returns a\n * \"initialization_in_progress\" failure instead of passing an\n * inconsistent state to the native side.\n * 2. A second call while a sheet is already presented (fast-refresh,\n * developer mistake) short-circuits to \"sheet_already_presented\"\n * instead of stacking a duplicate.\n */\nexport async function presentPaymentSheetWithPayload(\n payload: NativePaymentSheetPayload\n): Promise<PaymentResult> {\n if (isInitializing()) {\n return {\n status: 'failed',\n type: 'initialization_in_progress',\n message:\n 'SDK is reloading. Please wait for initialisation to complete before presenting the payment sheet.',\n };\n }\n if (isSheetPresented()) {\n // A sheet is already open (e.g. a hot-reload fired while the sheet was\n // visible). Silently skip so the existing sheet is not covered by a\n // new one.\n return {\n status: 'canceled',\n type: 'sheet_already_presented',\n message: 'A payment sheet is already presented.',\n };\n }\n setSheetPresented(true);\n try {\n const raw = await NativeHyperswitchModule.presentPaymentSheet({\n hyperswitchConfig: payload.hyperswitchConfig,\n paymentSessionConfig: payload.paymentSessionConfig,\n configuration: payload.configuration,\n });\n return mapNativeResponseToPaymentResult(raw);\n } finally {\n setSheetPresented(false);\n }\n}\n","import NativeHyperswitchModule from '../codegen/modules/NativeHyperswitchModule';\nimport {\n HyperswitchConfiguration,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport {\n CustomerSavedPaymentMethodsSession,\n CustomerLastUsedPaymentMethod,\n SavedPaymentMethodsConfiguration,\n} from '../types/savedPaymentMethods';\nimport type { PaymentResult } from '../types/paymentresult';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\nimport { getWidget } from '../widget/WidgetRegistry';\n\nfunction getReactTag(widgetId?: string): number {\n if (!widgetId) {\n throw new Error('A widgetId is required to confirm a saved payment method');\n }\n\n const reactTag = getWidget(widgetId);\n if (reactTag === undefined) {\n throw new Error(`Widget ${widgetId} not found or not mounted`);\n }\n return reactTag;\n}\n\ntype RawCustomerPaymentMethod = Omit<\n CustomerLastUsedPaymentMethod,\n 'billing'\n> & {\n billing?: string | CustomerLastUsedPaymentMethod['billing'];\n};\n\nfunction parseBilling(\n raw: RawCustomerPaymentMethod['billing']\n): CustomerLastUsedPaymentMethod['billing'] {\n if (raw == null || typeof raw !== 'string') {\n return (raw ?? null) as CustomerLastUsedPaymentMethod['billing'];\n }\n try {\n return JSON.parse(raw) as CustomerLastUsedPaymentMethod['billing'];\n } catch {\n return null;\n }\n}\n\nfunction parsePaymentMethod(raw: string): CustomerLastUsedPaymentMethod | null {\n try {\n const parsed = JSON.parse(raw) as RawCustomerPaymentMethod;\n const result: CustomerLastUsedPaymentMethod = {\n ...parsed,\n billing: parseBilling(parsed.billing),\n };\n return result;\n } catch {\n return null;\n }\n}\n\nexport function createCustomerSavedPaymentMethodsSession(): CustomerSavedPaymentMethodsSession {\n return {\n async getCustomerLastUsedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerLastUsedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async getCustomerDefaultSavedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerDefaultSavedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async getCustomerSavedPaymentMethodData(): Promise<CustomerLastUsedPaymentMethod | null> {\n const raw =\n await NativeHyperswitchModule.getCustomerSavedPaymentMethodData();\n return parsePaymentMethod(raw);\n },\n\n async confirmWithCustomerLastUsedPaymentMethod(args?: {\n id?: string;\n }): Promise<PaymentResult> {\n const raw =\n await NativeHyperswitchModule.confirmWithCustomerLastUsedPaymentMethod(\n getReactTag(args?.id)\n );\n return mapNativeResponseToPaymentResult(raw);\n },\n\n async confirmWithCustomerDefaultPaymentMethod(args?: {\n id?: string;\n }): Promise<PaymentResult> {\n const raw =\n await NativeHyperswitchModule.confirmWithCustomerDefaultPaymentMethod(\n getReactTag(args?.id)\n );\n return mapNativeResponseToPaymentResult(raw);\n },\n };\n}\n\nexport async function getCustomerSavedPaymentMethods(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration,\n configuration?: SavedPaymentMethodsConfiguration\n): Promise<CustomerSavedPaymentMethodsSession> {\n const payload = {\n hyperswitchConfig,\n paymentSessionConfig,\n configuration : {\n ...configuration,\n paymentMethodLayout : {\n savedMethodCustomization : {\n hiddenPaymentMethods : configuration?.hiddenPaymentMethods ?? [],\n },\n }\n },\n };\n await NativeHyperswitchModule.getCustomerSavedPaymentMethods(payload);\n return createCustomerSavedPaymentMethodsSession();\n}\n","import NativeHyperswitchModule from '../codegen/modules/NativeHyperswitchModule';\nimport type {\n HyperswitchConfiguration,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type {\n WalletName,\n WalletSessionHandle,\n} from '../types/walletSession';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\n\nexport function createWalletSession(): WalletSessionHandle {\n return {\n isWalletEligible(wallet: WalletName): Promise<boolean> {\n return NativeHyperswitchModule.isWalletEligible(wallet).catch(() => false);\n },\n\n isGooglePayEligible(): Promise<boolean> {\n return NativeHyperswitchModule.isWalletEligible('google_pay').catch(\n () => false\n );\n },\n\n isApplePayEligible(): Promise<boolean> {\n return NativeHyperswitchModule.isWalletEligible('apple_pay').catch(\n () => false\n );\n },\n\n async launchWallet(wallet: WalletName): Promise<PaymentResult> {\n const raw = await NativeHyperswitchModule.launchWallet(wallet);\n return mapNativeResponseToPaymentResult(raw);\n },\n\n async launchGooglePay(): Promise<PaymentResult> {\n const raw = await NativeHyperswitchModule.launchWallet('google_pay');\n return mapNativeResponseToPaymentResult(raw);\n },\n\n async launchApplePay(): Promise<PaymentResult> {\n const raw = await NativeHyperswitchModule.launchWallet('apple_pay');\n return mapNativeResponseToPaymentResult(raw);\n },\n };\n}\n\nconst WALLET_SESSION_TIMEOUT_MS = 15000;\n\nfunction withTimeout<T>(promise: Promise<T>, label: string): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => {\n reject(new Error(`${label} timed out after ${WALLET_SESSION_TIMEOUT_MS}ms`));\n }, WALLET_SESSION_TIMEOUT_MS);\n\n promise.then(\n (value) => {\n clearTimeout(timer);\n resolve(value);\n },\n (error) => {\n clearTimeout(timer);\n reject(error);\n }\n );\n });\n}\n\nexport async function getWalletSession(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): Promise<WalletSessionHandle> {\n const raw = await withTimeout(\n NativeHyperswitchModule.getWalletSession({\n hyperswitchConfig,\n paymentSessionConfig,\n }),\n 'getWalletSession'\n );\n\n let status: string | undefined;\n let message: string | undefined;\n try {\n const parsed = JSON.parse(raw) as { status?: string; message?: string };\n status = parsed.status;\n message = parsed.message;\n } catch {\n status = undefined;\n }\n\n if (status === 'failed') {\n throw new Error(message ?? 'Failed to initialise the wallet session');\n }\n\n return createWalletSession();\n}\n","import type {\n HyperswitchConfiguration,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { PaymentSheetConfiguration } from '../types/PaymentSheetConfiguration';\nimport type {\n CustomerSavedPaymentMethodsSession,\n SavedPaymentMethodsConfiguration,\n} from '../types/savedPaymentMethods';\nimport { buildPresentPaymentSheetPayload } from '../utils/LaunchOptions';\nimport { presentPaymentSheetWithPayload } from './presentPaymentSheet';\nimport { getCustomerSavedPaymentMethods } from './SavedPaymentMethods';\nimport { getWalletSession } from './WalletSession';\nimport type { WalletSessionHandle } from '../types/walletSession';\n\n/** Options captured by every session-style factory (PaymentSession + Elements). */\ntype SessionBindings = {\n hyperswitchConfig: HyperswitchConfiguration;\n paymentSessionConfig: PaymentSessionConfiguration;\n};\n\n/**\n * Shared `presentPaymentSheet` implementation used by both\n * `PaymentSession` and `Elements` so sheet-presentation behavior cannot\n * drift between the two surfaces.\n */\nexport function bindPresentPaymentSheet(bindings: SessionBindings) {\n return async function presentPaymentSheet(\n configuration?: PaymentSheetConfiguration\n ): Promise<PaymentResult> {\n const payload = buildPresentPaymentSheetPayload(\n bindings.hyperswitchConfig,\n bindings.paymentSessionConfig,\n configuration\n );\n return presentPaymentSheetWithPayload(payload);\n };\n}\n\n/**\n * Shared `getCustomerSavedPaymentMethods` implementation used by both\n * `PaymentSession` and `Elements`.\n */\nexport function bindGetCustomerSavedPaymentMethods(bindings: SessionBindings) {\n return function getSaved(\n configuration?: SavedPaymentMethodsConfiguration\n ): Promise<CustomerSavedPaymentMethodsSession> {\n return getCustomerSavedPaymentMethods(\n bindings.hyperswitchConfig,\n bindings.paymentSessionConfig,\n configuration\n );\n };\n}\n\nexport function bindGetWalletSession(bindings: SessionBindings) {\n return function getWallets(): Promise<WalletSessionHandle> {\n return getWalletSession(\n bindings.hyperswitchConfig,\n bindings.paymentSessionConfig\n );\n };\n}\n","import type { PaymentSheetConfiguration } from '../types/PaymentSheetConfiguration';\nimport type {\n HyperswitchConfiguration,\n NativePaymentSheetPayload,\n PaymentSessionConfiguration,\n} from '../types/definitions';\n\nfunction buildPresentPaymentSheetPayload(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration,\n configuration?: PaymentSheetConfiguration\n): NativePaymentSheetPayload {\n // platformPublishableKey is internal to the RN bridge; it is not part of the\n // merchant-facing hyperswitchConfig payload.\n const restConfig = { ...hyperswitchConfig };\n delete restConfig.platformPublishableKey;\n return {\n hyperswitchConfig: restConfig as Record<string, unknown>,\n paymentSessionConfig: paymentSessionConfig,\n configuration: (configuration ?? {}) as Record<string, unknown>,\n };\n}\n\nexport { buildPresentPaymentSheetPayload };\n","import type {\n HyperswitchConfiguration,\n PaymentSession,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport {\n updateIntentInitForAllWidgets,\n updateIntentCompleteForAllWidgets,\n} from '../widget/WidgetRegistry';\nimport {\n bindGetCustomerSavedPaymentMethods,\n bindGetWalletSession,\n bindPresentPaymentSheet,\n} from './binders';\n\nexport async function updateIntent(\n intentResolver: () => Promise<PaymentSessionConfiguration>\n): Promise<void> {\n let newIntent: PaymentSessionConfiguration;\n try {\n await updateIntentInitForAllWidgets();\n newIntent = await intentResolver();\n await updateIntentCompleteForAllWidgets(newIntent.sdkAuthorization);\n } catch {\n await updateIntentCompleteForAllWidgets('');\n return;\n }\n}\n\nexport function createPaymentSession(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): PaymentSession {\n const bindings = { hyperswitchConfig, paymentSessionConfig };\n return {\n presentPaymentSheet: bindPresentPaymentSheet(bindings),\n getCustomerSavedPaymentMethods:\n bindGetCustomerSavedPaymentMethods(bindings),\n getWalletSession: bindGetWalletSession(bindings),\n updateIntent,\n };\n}\n","import type {\n HyperswitchConfiguration,\n PaymentElementHandle,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { Elements } from '../types/elements';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\nimport { confirmPayment as confirmWidgetPayment } from '../widget/WidgetRegistry';\nimport { updateIntent } from './PaymentSession';\nimport {\n bindGetCustomerSavedPaymentMethods,\n bindGetWalletSession,\n bindPresentPaymentSheet,\n} from './binders';\n\ntype ElementsNativeActions = Pick<\n Elements,\n | 'confirmPayment'\n | 'presentPaymentSheet'\n | 'getCustomerSavedPaymentMethods'\n | 'getWalletSession'\n | 'updateIntent'\n>;\n\nexport function createElementsNativeActions(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): ElementsNativeActions {\n const bindings = { hyperswitchConfig, paymentSessionConfig };\n return {\n presentPaymentSheet: bindPresentPaymentSheet(bindings),\n\n async confirmPayment(\n paymentElementRef: { current: PaymentElementHandle | null } | string,\n confirmOptions?: { confirmParams?: Record<string, any> }\n ): Promise<PaymentResult> {\n if (typeof paymentElementRef === 'string') {\n const result = await confirmWidgetPayment(paymentElementRef);\n return mapNativeResponseToPaymentResult(result);\n }\n\n const ref = paymentElementRef.current;\n if (!ref) {\n throw new Error('PaymentElement reference is not mounted');\n }\n return ref.confirmPayment(confirmOptions);\n },\n\n getCustomerSavedPaymentMethods:\n bindGetCustomerSavedPaymentMethods(bindings),\n\n getWalletSession: bindGetWalletSession(bindings),\n\n updateIntent,\n };\n}\n\nexport function createElements(\n hyperswitchConfig: HyperswitchConfiguration,\n paymentSessionConfig: PaymentSessionConfiguration\n): Elements {\n return {\n hyperswitchConfig,\n ...createElementsNativeActions(hyperswitchConfig, paymentSessionConfig),\n };\n}\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useState,\n type ReactNode,\n} from 'react';\nimport type {\n HyperswitchConfiguration,\n HyperswitchSession,\n PaymentSession,\n PaymentSessionConfiguration,\n} from '../types/definitions';\nimport type { Elements } from '../types/elements';\nimport type { WalletSessionHandle } from '../types/walletSession';\n\nexport type WalletEligibility = {\n googlePay: boolean;\n applePay: boolean;\n};\n\ninterface HyperElementsContext {\n paymentSession: PaymentSession | null;\n walletSession: WalletSessionHandle | null;\n walletEligibility: WalletEligibility;\n walletLoading: boolean;\n loadWalletSession: () => Promise<WalletSessionHandle | null>;\n elements: Elements | null;\n publishableKey: string | null;\n sdkAuthorization: string | null;\n hyperswitchConfig: HyperswitchConfiguration | null;\n paymentSessionConfig: PaymentSessionConfiguration | null;\n loading: boolean;\n error: Error | null;\n}\n\nconst HyperElementsContext = createContext<HyperElementsContext | undefined>(\n undefined\n);\n\nHyperElementsContext.displayName = 'HyperElementsContext';\n\nexport interface HyperElementsProps {\n hyper: HyperswitchSession | Promise<HyperswitchSession> | null;\n options: { sdkAuthorization: string };\n children: ReactNode;\n}\n\nexport function HyperElements({\n hyper,\n options,\n children,\n}: HyperElementsProps) {\n const [paymentSession, setPaymentSession] = useState<PaymentSession | null>(\n null\n );\n const [elements, setElements] = useState<Elements | null>(null);\n const [hyperswitchConfig, setHyperswitchConfig] =\n useState<HyperswitchConfiguration | null>(null);\n const [paymentSessionConfig, setPaymentSessionConfig] =\n useState<PaymentSessionConfiguration | null>(null);\n const [publishableKey, setPublishableKey] = useState<string | null>(null);\n const [sdkAuthorization, setSdkAuthorization] = useState<string | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const [walletSession, setWalletSession] = useState<WalletSessionHandle | null>(\n null\n );\n const [walletEligibility, setWalletEligibility] = useState<WalletEligibility>({\n googlePay: false,\n applePay: false,\n });\n const [walletLoading, setWalletLoading] = useState(false);\n\n const loadWalletSession = useCallback(async () => {\n if (!paymentSession) {\n return null;\n }\n setWalletLoading(true);\n try {\n const wallets = await paymentSession.getWalletSession();\n const [googlePay, applePay] = await Promise.all([\n wallets.isGooglePayEligible(),\n wallets.isApplePayEligible(),\n ]);\n setWalletSession(wallets);\n setWalletEligibility({ googlePay, applePay });\n return wallets;\n } catch {\n setWalletSession(null);\n setWalletEligibility({ googlePay: false, applePay: false });\n return null;\n } finally {\n setWalletLoading(false);\n }\n }, [paymentSession]);\n\n useEffect(() => {\n setWalletSession(null);\n setWalletEligibility({ googlePay: false, applePay: false });\n }, [paymentSession]);\n\n useEffect(() => {\n if (!hyper) return;\n\n let cancelled = false;\n\n (async () => {\n try {\n const session = await Promise.resolve(hyper);\n const sessionConfig = {\n sdkAuthorization: options.sdkAuthorization,\n };\n const els = await session.elements(sessionConfig);\n\n if (!cancelled) {\n setPaymentSession({\n ...els,\n } as PaymentSession);\n setHyperswitchConfig(els.hyperswitchConfig);\n setPaymentSessionConfig(sessionConfig);\n setElements(els);\n setPublishableKey(session.publishableKey ?? null);\n setSdkAuthorization(options.sdkAuthorization ?? null);\n setLoading(false);\n }\n } catch (err) {\n if (!cancelled) {\n setError(err instanceof Error ? err : new Error(String(err)));\n setLoading(false);\n }\n }\n })();\n\n return () => {\n cancelled = true;\n };\n }, [hyper, options.sdkAuthorization]);\n\n return (\n <HyperElementsContext.Provider\n value={{\n paymentSession,\n walletSession,\n walletEligibility,\n walletLoading,\n loadWalletSession,\n elements,\n publishableKey,\n sdkAuthorization,\n loading,\n error,\n paymentSessionConfig,\n hyperswitchConfig,\n }}\n >\n {children}\n </HyperElementsContext.Provider>\n );\n}\n\nexport function useHyperElementsContext(): HyperElementsContext {\n const ctx = useContext(HyperElementsContext);\n if (ctx === undefined) {\n throw new Error(\n 'useHyperElementsContext must be used inside <HyperElements>'\n );\n }\n return ctx;\n}\n\nexport type UseWalletSessionResult = {\n walletSession: WalletSessionHandle | null;\n isGooglePayEligible: boolean;\n isApplePayEligible: boolean;\n loading: boolean;\n load: () => Promise<WalletSessionHandle | null>;\n};\n\nexport function useWalletSession(): UseWalletSessionResult {\n const ctx = useHyperElementsContext();\n return {\n walletSession: ctx.walletSession,\n isGooglePayEligible: ctx.walletEligibility.googlePay,\n isApplePayEligible: ctx.walletEligibility.applePay,\n loading: ctx.walletLoading,\n load: ctx.loadWalletSession,\n };\n}\n\nexport function useOptionalWalletSession(): UseWalletSessionResult {\n const ctx = useContext(HyperElementsContext);\n return {\n walletSession: ctx?.walletSession ?? null,\n isGooglePayEligible: ctx?.walletEligibility.googlePay ?? false,\n isApplePayEligible: ctx?.walletEligibility.applePay ?? false,\n loading: ctx?.walletLoading ?? false,\n load: ctx?.loadWalletSession ?? (async () => null),\n };\n}\n\nexport function useOptionalPaymentSession(): PaymentSession | null {\n const ctx = useContext(HyperElementsContext);\n return ctx?.paymentSession ?? null;\n}\n\nexport function usePaymentSession(): PaymentSession | null {\n const ctx = useHyperElementsContext();\n return ctx.paymentSession;\n}\n\nexport function useElements(): Elements | null {\n const ctx = useHyperElementsContext();\n return ctx.elements;\n}\n","import { requireNativeComponent } from 'react-native';\nimport type { NativePaymentWidgetPropTypes } from '../types/NativeEventTypes';\n\ndeclare global {\n var nativeFabricUIManager: unknown | null | undefined;\n}\n\ntype NativePaymentWidgetComponent =\n React.ComponentType<NativePaymentWidgetPropTypes>;\n\nconst NativePaymentWidgetImpl: NativePaymentWidgetComponent =\n global.nativeFabricUIManager != null\n ? (require('../codegen/components/PaymentWidgetNativeComponent')\n .default as NativePaymentWidgetComponent)\n : (requireNativeComponent(\n 'RCTNativePaymentWidget'\n ) as unknown as NativePaymentWidgetComponent);\n\nexport default NativePaymentWidgetImpl;\n","import { useEffect, useState } from 'react';\nimport { findNodeHandle } from 'react-native';\n\nconst MAX_ATTEMPTS = 20;\nconst RETRY_INTERVAL_MS = 100;\n\n/**\n * Polls `findNodeHandle` until the native view is attached and returns the\n * native view tag. Retries up to {@link MAX_ATTEMPTS} times spaced\n * {@link RETRY_INTERVAL_MS}ms apart to give Fabric time to attach the\n * shadow node on slower devices.\n *\n * Calls `onReady` exactly once — on the first successful poll.\n */\nexport function useNativeViewTag(\n viewRef: React.RefObject<unknown>,\n onReady?: () => void\n): number | undefined {\n const [viewTag, setViewTag] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n if (viewTag !== undefined) return;\n\n let isMounted = true;\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n const poll = (attempt: number) => {\n if (!isMounted) return;\n if (viewRef.current == null) {\n if (attempt < MAX_ATTEMPTS) {\n timer = setTimeout(() => poll(attempt + 1), RETRY_INTERVAL_MS);\n }\n return;\n }\n const tag =\n findNodeHandle(\n viewRef.current as Parameters<typeof findNodeHandle>[0]\n ) ?? -1;\n if (tag !== -1) {\n onReady?.();\n setViewTag(tag);\n } else if (attempt < MAX_ATTEMPTS) {\n timer = setTimeout(() => poll(attempt + 1), RETRY_INTERVAL_MS);\n }\n };\n\n poll(0);\n\n return () => {\n isMounted = false;\n if (timer !== undefined) clearTimeout(timer);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [viewTag]);\n\n return viewTag;\n}\n","import { forwardRef, useEffect, useMemo, useRef } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { useHyperElementsContext } from '../context/HyperElements';\nimport type { CvcWidgetOptions } from '../types/definitions';\nimport { registerWidget, unregisterWidget } from '../widget/WidgetRegistry';\nimport type {\n PaymentEventNative,\n PaymentEventResult,\n} from '../types/NativeEventTypes';\nimport type { SavedMethodCustomization } from '../types/PaymentSheetConfiguration';\nimport NativePaymentWidgetImpl from './PaymentWidgetBridge';\nimport { useNativeViewTag } from './useNativeViewTag';\nimport { PaymentResult } from '../types/paymentresult';\n\ntype CVCElementProps = {\n id?: string;\n options?: CvcWidgetOptions;\n onChange?: (event: PaymentEventResult) => void;\n onFocus?: () => void;\n onReady?: () => void;\n onBlur?: () => void;\n onPaymentResult?: (result: PaymentResult) => void;\n style?: ViewStyle;\n};\n\ntype CVCWidgetRef = {\n confirmPayment: () => Promise<PaymentResult>;\n};\n\nfunction parsePaymentResult(result: string): PaymentResult {\n return JSON.parse(result);\n}\n\nexport const CVCElement = forwardRef<CVCWidgetRef, CVCElementProps>(\n (props, _ref) => {\n const {\n id,\n options,\n onChange,\n onFocus,\n onBlur,\n onPaymentResult,\n style,\n onReady,\n } = props;\n const { paymentSessionConfig, hyperswitchConfig } =\n useHyperElementsContext();\n const viewRef = useRef(null);\n const viewTag = useNativeViewTag(viewRef, onReady);\n\n const shouldRegister = id !== undefined && viewTag !== undefined;\n useEffect(() => {\n if (!shouldRegister) return undefined;\n const widgetId = id as string;\n const tag = viewTag as number;\n registerWidget(widgetId, tag);\n return () => unregisterWidget(widgetId);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [shouldRegister]);\n\n const nativeOptions = useMemo(() => {\n const opts = options as\n | (CvcWidgetOptions & {\n paymentMethodLayout?: {\n savedMethodCustomization?: SavedMethodCustomization;\n };\n })\n | undefined;\n const layout = opts?.paymentMethodLayout;\n return {\n ...opts,\n paymentMethodLayout: {\n ...layout,\n savedMethodCustomization: {\n ...layout?.savedMethodCustomization,\n cvcIcon: opts?.cvcIcon ?? 'shown',\n },\n },\n };\n }, [options]);\n\n const onPaymentEventInternal = (event: PaymentEventNative) => {\n onChange?.(event.nativeEvent);\n\n if (event.nativeEvent.eventName === 'CVC_STATUS') {\n try {\n const payloadString = event.nativeEvent.payload;\n const outerDict = (\n typeof payloadString === 'string'\n ? JSON.parse(payloadString)\n : payloadString\n ) as Record<string, unknown> | undefined;\n if (!outerDict) {\n return;\n }\n const cvcStatus = outerDict.cvcStatus as\n Record<string, unknown> | undefined;\n if (!cvcStatus) {\n return;\n }\n const isCvcFocused = Boolean(cvcStatus.isCvcFocused);\n const isCvcBlur = Boolean(cvcStatus.isCvcBlur);\n if (isCvcFocused) {\n onFocus?.();\n }\n if (isCvcBlur) {\n onBlur?.();\n }\n } catch {\n // Ignore malformed native events\n }\n }\n };\n\n const onPaymentResultInternal = (event: {\n nativeEvent: { result?: string };\n }) => {\n onPaymentResult?.(parsePaymentResult(event.nativeEvent.result ?? ''));\n };\n\n return (\n <NativePaymentWidgetImpl\n ref={viewRef}\n widgetType=\"cvcWidget\"\n sdkAuthorization={paymentSessionConfig?.sdkAuthorization ?? ''}\n onPaymentEvent={onPaymentEventInternal}\n onPaymentResult={onPaymentResultInternal}\n options={{\n hyperswitchConfig: hyperswitchConfig || undefined,\n paymentSessionConfig: paymentSessionConfig || undefined,\n configuration: nativeOptions as Record<string, unknown>,\n }}\n style={style}\n />\n );\n }\n);\n","const validEventStrings = [\n 'PAYMENT_METHOD_INFO_CARD',\n 'PAYMENT_METHOD_STATUS',\n 'FORM_STATUS',\n 'PAYMENT_METHOD_INFO_ADDRESS',\n 'PAYMENT_METHOD_INFO_BILLING_ADDRESS',\n 'CVC_STATUS',\n];\n\nexport function getValidEventsString(): string {\n return validEventStrings.join(', ');\n}\n\nexport function validateSubscribedEventStrings(\n subscribedEvents: string[] | undefined\n): string[] {\n if (!subscribedEvents) {\n return [];\n }\n return subscribedEvents.filter((event) => !validEventStrings.includes(event));\n}\n\nexport type UnknownEventWarningPayload = {\n message: string;\n invalidEvents: string[];\n validEvents: string[];\n};\n\nexport function makeUnknownEventWarningPayload(\n invalidEvents: string[]\n): UnknownEventWarningPayload {\n const invalidEventsStr = invalidEvents.join(', ');\n const validEventsStr = getValidEventsString();\n return {\n message: `Unknown event(s) subscribed: [${invalidEventsStr}]. Valid events are: ${validEventsStr}`,\n invalidEvents,\n validEvents: validEventStrings,\n };\n}\n","import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\nimport { UIManager, findNodeHandle, type ViewStyle, Platform } from 'react-native';\nimport NativePaymentWidgetImpl from './PaymentWidgetBridge';\nimport { registerWidget, unregisterWidget } from '../widget/WidgetRegistry';\nimport type { PaymentSheetConfiguration } from '../types/PaymentSheetConfiguration';\nimport { useHyperElementsContext } from '../context/HyperElements';\nimport {\n makeUnknownEventWarningPayload,\n validateSubscribedEventStrings,\n} from '../utils/EventValidator';\nimport type {\n PaymentEventNative,\n NativeEventEnvelope,\n PaymentEventResult,\n} from '../types/NativeEventTypes';\nimport type { PaymentElementHandle } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport { mapNativeResponseToPaymentResult } from '../native/NativeResponseMapper';\nimport NativeWidgetHelperModule from '../codegen/modules/NativeWidgetHelperModule';\nimport { useNativeViewTag } from './useNativeViewTag';\n\ntype PaymentElementProps = {\n widgetId: string;\n options?: PaymentSheetConfiguration;\n onPaymentResult: (result: PaymentResult) => void;\n onChange?: (event: PaymentEventResult) => void;\n onReady?: () => void;\n style?: ViewStyle;\n};\n\nexport const PaymentElement = forwardRef<\n PaymentElementHandle,\n PaymentElementProps\n>((props, ref) => {\n const { widgetId, options, onPaymentResult, onChange, onReady, style } =\n props;\n const { paymentSessionConfig, hyperswitchConfig } = useHyperElementsContext();\n const viewRef = useRef(null);\n const viewTag = useNativeViewTag(viewRef, onReady);\n\n useEffect(() => {\n if (viewTag === undefined) return undefined;\n registerWidget(widgetId, viewTag);\n return () => unregisterWidget(widgetId);\n }, [viewTag, widgetId]);\n\n // Old-arch view manager command \"1\": tells the native view to attach itself\n // to the active payment session. Without it the widget mounts but renders\n // an empty container on Paper.\n useEffect(() => {\n if (viewTag !== undefined) {\n UIManager.dispatchViewManagerCommand(viewTag, 1, []);\n }\n }, [viewTag]);\n\n useImperativeHandle(\n ref,\n () => ({\n confirmPayment: (_options?: {\n confirmParams?: Record<string, any>;\n }): Promise<PaymentResult> => {\n if (viewRef.current == null) {\n return Promise.resolve({\n status: 'failed',\n type: 'widget_not_ready',\n message: 'Widget not ready',\n });\n }\n const id =\n findNodeHandle(\n viewRef.current as Parameters<typeof findNodeHandle>[0]\n ) ?? -1;\n if (id === -1) {\n return Promise.resolve({\n status: 'failed',\n type: 'widget_not_ready',\n message: 'Unable to find native view handle',\n });\n }\n return new Promise<PaymentResult>((resolve) => {\n NativeWidgetHelperModule.confirmPayment(id, (raw) => {\n resolve(mapNativeResponseToPaymentResult(raw));\n });\n });\n },\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [viewTag]\n );\n\n const warningEmitted = useRef(false);\n\n useEffect(() => {\n if (!options || !onChange || warningEmitted.current) {\n return;\n }\n const subscribedEvents = options.subscribedEvents as string[] | undefined;\n\n const invalidEvents = validateSubscribedEventStrings(subscribedEvents);\n if (invalidEvents.length > 0) {\n warningEmitted.current = true;\n const warningPayload = makeUnknownEventWarningPayload(invalidEvents);\n onChange({\n eventName: 'UNKNOWN_EVENT_SUBSCRIBED',\n payload: JSON.stringify({\n message: warningPayload.message,\n invalidEvents: warningPayload.invalidEvents,\n validEvents: warningPayload.validEvents,\n }),\n });\n }\n }, [options, onChange]);\n\n const onPaymentResultInternal = (event: NativeEventEnvelope & { nativeEvent: {\n eventName: string;\n payload: string;\n target: number;\n}}) => {\n onPaymentResult(\n mapNativeResponseToPaymentResult(\n Platform.OS === 'ios'\n ? event.nativeEvent.result ?? \"\"\n : event.nativeEvent.payload ?? \"\"\n )\n );\n };\n\n const onPaymentEventInternal = (event: PaymentEventNative) => {\n onChange?.(event.nativeEvent);\n };\n\n return (\n <NativePaymentWidgetImpl\n ref={viewRef}\n sdkAuthorization={paymentSessionConfig?.sdkAuthorization ?? ''}\n widgetType=\"widgetPaymentSheet\"\n onPaymentEvent={onPaymentEventInternal}\n onPaymentResult={onPaymentResultInternal}\n options={{\n hyperswitchConfig: hyperswitchConfig || undefined,\n paymentSessionConfig: paymentSessionConfig || undefined,\n configuration: options as Record<string, unknown> | undefined,\n }}\n style={{ ...style, flex: 1 }}\n />\n );\n});\n","import { Platform } from 'react-native';\nimport NativeHyperswitchModule from '../codegen/modules/NativeHyperswitchModule';\nimport type { WalletName } from '../types/walletSession';\n\nexport function isGooglePaySupported(): Promise<boolean> {\n return NativeHyperswitchModule.isGooglePaySupported().catch(() => false);\n}\n\nexport function isApplePaySupported(): Promise<boolean> {\n return NativeHyperswitchModule.isApplePaySupported().catch(() => false);\n}\n\nexport function isWalletSupported(wallet: WalletName): Promise<boolean> {\n return wallet === 'google_pay'\n ? isGooglePaySupported()\n : isApplePaySupported();\n}\n\nexport function isPlatformPaySupported(): Promise<boolean> {\n if (Platform.OS === 'ios') {\n return isApplePaySupported();\n }\n if (Platform.OS === 'android') {\n return isGooglePaySupported();\n }\n return Promise.resolve(false);\n}\n","import { useRef } from 'react';\nimport {\n useOptionalPaymentSession,\n useOptionalWalletSession,\n} from '../context/HyperElements';\nimport type { PaymentSession } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { WalletName } from '../types/walletSession';\n\nexport type WalletLaunchOptions = {\n wallet: WalletName;\n label: string;\n session?: PaymentSession;\n onPaymentResult?: (result: PaymentResult) => void;\n};\n\nexport function useWalletLaunch({\n wallet,\n label,\n session,\n onPaymentResult,\n}: WalletLaunchOptions): () => Promise<void> {\n const contextSession = useOptionalPaymentSession();\n const { walletSession, load } = useOptionalWalletSession();\n const inFlight = useRef(false);\n\n return async () => {\n const activeSession = session ?? contextSession;\n\n if (!activeSession && !walletSession) {\n const error = new Error(\n `${label} was pressed without a payment session. Pass a \"session\" prop or render it inside <HyperElements>.`\n );\n if (!onPaymentResult) {\n throw error;\n }\n onPaymentResult({\n status: 'failed',\n type: 'no_session',\n message: error.message,\n });\n return;\n }\n\n if (inFlight.current) {\n const error = new Error(\n `${label} is already processing a payment. Ignoring this press.`\n );\n if (!onPaymentResult) {\n throw error;\n }\n onPaymentResult({\n status: 'failed',\n type: 'already_in_progress',\n message: error.message,\n });\n return;\n }\n inFlight.current = true;\n\n try {\n const wallets =\n walletSession ??\n (await load()) ??\n (await activeSession!.getWalletSession());\n\n const eligible = await wallets.isWalletEligible(wallet);\n if (!eligible) {\n const error = new Error(\n `${label} is not eligible for this payment.`\n );\n if (!onPaymentResult) {\n throw error;\n }\n onPaymentResult({\n status: 'failed',\n type: 'not_eligible',\n message: error.message,\n });\n return;\n }\n\n const result = await wallets.launchWallet(wallet);\n onPaymentResult?.(result);\n } catch (e) {\n const message = e instanceof Error ? e.message : String(e);\n if (!onPaymentResult) {\n throw e;\n }\n onPaymentResult({\n status: 'failed',\n type: 'launch_failed',\n message,\n });\n } finally {\n inFlight.current = false;\n }\n };\n}\n","import { useEffect, useRef } from 'react';\nimport {\n useOptionalPaymentSession,\n useOptionalWalletSession,\n} from '../context/HyperElements';\nimport type { PaymentSession } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { WalletName, WalletSessionHandle } from '../types/walletSession';\n\nexport type WalletReadyOptions = {\n wallet: WalletName;\n label: string;\n session?: PaymentSession;\n onReady?: () => void;\n onLoadError?: (error: PaymentResult) => void;\n};\n\n/**\n * Resolves wallet eligibility for a button, then calls `onReady` once when the\n * wallet is pressable or `onLoadError` once when it is not. Exactly one of them\n * fires per intent. The button owns this — merchants never load the wallet\n * session themselves.\n *\n * Inside `<HyperElements>` the shared session is reused, so several buttons\n * resolve off one round trip. With an explicit `session` prop the button\n * resolves against that session directly.\n */\nexport function useWalletReady({\n wallet,\n label,\n session,\n onReady,\n onLoadError,\n}: WalletReadyOptions): void {\n const contextSession = useOptionalPaymentSession();\n const { walletSession, load } = useOptionalWalletSession();\n\n const onReadyRef = useRef(onReady);\n const onLoadErrorRef = useRef(onLoadError);\n const walletSessionRef = useRef(walletSession);\n const loadRef = useRef(load);\n\n useEffect(() => {\n onReadyRef.current = onReady;\n onLoadErrorRef.current = onLoadError;\n walletSessionRef.current = walletSession;\n loadRef.current = load;\n }, [onReady, onLoadError, walletSession, load]);\n\n useEffect(() => {\n let cancelled = false;\n\n const fail = (type: string, message: string) => {\n onLoadErrorRef.current?.({ status: 'failed', type, message });\n };\n\n const resolveWallets = async (): Promise<WalletSessionHandle | null> => {\n if (session) {\n return session.getWalletSession();\n }\n if (walletSessionRef.current) {\n return walletSessionRef.current;\n }\n if (contextSession) {\n return loadRef.current();\n }\n return null;\n };\n\n const resolveEligibility = async () => {\n try {\n const wallets = await resolveWallets();\n if (cancelled) {\n return;\n }\n\n if (!wallets) {\n fail(\n 'no_session',\n `${label} has no payment session. Pass a \"session\" prop or render it inside <HyperElements>.`\n );\n return;\n }\n\n const eligible = await wallets.isWalletEligible(wallet);\n if (cancelled) {\n return;\n }\n\n if (eligible) {\n onReadyRef.current?.();\n } else {\n fail('not_eligible', `${label} is not eligible for this payment.`);\n }\n } catch (e) {\n if (cancelled) {\n return;\n }\n fail('launch_failed', e instanceof Error ? e.message : String(e));\n }\n };\n\n void resolveEligibility();\n\n return () => {\n cancelled = true;\n };\n }, [session, contextSession, wallet, label]);\n}\n","import type {\n ApplePayButtonStyle,\n ApplePayButtonType,\n ApplePayConfiguration,\n GooglePayButtonStyle,\n GooglePayButtonType,\n GooglePayConfiguration,\n PaymentSheetConfiguration,\n} from '../types/PaymentSheetConfiguration';\n\nconst GOOGLE_PAY_BUTTON_TYPE: Record<GooglePayButtonType, number> = {\n BUY: 1,\n BOOK: 6,\n CHECKOUT: 5,\n DONATE: 4,\n ORDER: 11,\n PAY: 1000,\n SUBSCRIBE: 7,\n PLAIN: 1001,\n};\n\nconst GOOGLE_PAY_APPEARANCE: Record<GooglePayButtonStyle, number> = {\n light: 1,\n dark: 2,\n};\n\nconst APPLE_PAY_BUTTON_TYPE: Record<ApplePayButtonType, number> = {\n plain: 0,\n buy: 1,\n setUp: 2,\n inStore: 3,\n donate: 4,\n checkout: 5,\n book: 6,\n subscribe: 7,\n};\n\nconst APPLE_PAY_BUTTON_STYLE: Record<ApplePayButtonStyle, number> = {\n white: 0,\n whiteOutline: 1,\n black: 2,\n};\n\nexport function isHidden(\n config?: GooglePayConfiguration | ApplePayConfiguration\n): boolean {\n return config?.visibility === 'hidden';\n}\n\nexport function getBorderRadius(options?: PaymentSheetConfiguration): number {\n return (\n options?.appearance?.primaryButton?.shapes?.borderRadius ??\n options?.appearance?.shapes?.borderRadius ??\n 4\n );\n}\n\nfunction isDarkTheme(\n options: PaymentSheetConfiguration | undefined,\n colorScheme: 'light' | 'dark'\n): boolean {\n const theme = options?.appearance?.theme;\n if (theme === 'Dark') {\n return true;\n }\n if (theme === 'Light') {\n return false;\n }\n return colorScheme === 'dark';\n}\n\nexport function resolveGooglePayProps(\n options: PaymentSheetConfiguration | undefined,\n colorScheme: 'light' | 'dark'\n) {\n const config = options?.walletButtonsConfiguration?.googlePay;\n const dark = isDarkTheme(options, colorScheme);\n const style = dark ? config?.buttonStyle?.dark : config?.buttonStyle?.light;\n\n return {\n hidden: isHidden(config),\n type: GOOGLE_PAY_BUTTON_TYPE[config?.buttonType ?? 'PLAIN'],\n appearance: GOOGLE_PAY_APPEARANCE[style ?? (dark ? 'dark' : 'light')],\n borderRadius: getBorderRadius(options),\n };\n}\n\nexport function resolveApplePayProps(\n options: PaymentSheetConfiguration | undefined,\n colorScheme: 'light' | 'dark'\n) {\n const config = options?.walletButtonsConfiguration?.applePay;\n const dark = isDarkTheme(options, colorScheme);\n const style = dark ? config?.buttonStyle?.dark : config?.buttonStyle?.light;\n\n return {\n hidden: isHidden(config),\n type: APPLE_PAY_BUTTON_TYPE[config?.buttonType ?? 'plain'],\n buttonStyle: APPLE_PAY_BUTTON_STYLE[style ?? (dark ? 'white' : 'black')],\n borderRadius: getBorderRadius(options),\n };\n}\n","import {\n Platform,\n Pressable,\n StyleSheet,\n requireNativeComponent,\n useColorScheme,\n} from 'react-native';\nimport type { ViewProps, ViewStyle } from 'react-native';\nimport { useWalletLaunch } from './useWalletLaunch';\nimport { useWalletReady } from './useWalletReady';\nimport { resolveGooglePayProps } from './walletButtonConfig';\nimport type { PaymentSession } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { PaymentSheetConfiguration } from '../types/PaymentSheetConfiguration';\n\ndeclare global {\n var nativeFabricUIManager: unknown | null | undefined;\n}\n\ntype NativeProps = ViewProps & {\n type?: number;\n appearance: number;\n borderRadius?: number;\n};\n\nfunction resolveNativeComponent(): React.ComponentType<NativeProps> | null {\n if (Platform.OS !== 'android') {\n return null;\n }\n try {\n if (globalThis.nativeFabricUIManager != null) {\n return require('../codegen/components/HyperGooglePayNativeComponent')\n .default as React.ComponentType<NativeProps>;\n }\n return requireNativeComponent(\n 'HyperGooglePayButton'\n ) as unknown as React.ComponentType<NativeProps>;\n } catch {\n return null;\n }\n}\n\nconst NativeHyperGooglePayButton = resolveNativeComponent();\n\nexport type GooglePayButtonProps = {\n options?: PaymentSheetConfiguration;\n session?: PaymentSession;\n onPaymentResult?: (result: PaymentResult) => void;\n onReady?: () => void;\n onLoadError?: (error: PaymentResult) => void;\n style?: ViewStyle;\n};\n\nexport function GooglePayButton({\n options,\n session,\n onPaymentResult,\n onReady,\n onLoadError,\n style,\n}: GooglePayButtonProps) {\n const colorScheme = useColorScheme();\n const launch = useWalletLaunch({\n wallet: 'google_pay',\n label: 'Google Pay',\n session,\n onPaymentResult,\n });\n\n useWalletReady({\n wallet: 'google_pay',\n label: 'Google Pay',\n session,\n onReady,\n onLoadError,\n });\n\n const { hidden, type, appearance, borderRadius } = resolveGooglePayProps(\n options,\n colorScheme === 'dark' ? 'dark' : 'light'\n );\n\n if (hidden || NativeHyperGooglePayButton == null) {\n return null;\n }\n\n return (\n <Pressable\n focusable\n accessible\n accessibilityRole=\"button\"\n accessibilityLabel=\"Google Pay\"\n onPress={launch}\n style={style}\n >\n <NativeHyperGooglePayButton\n type={type}\n appearance={appearance}\n borderRadius={borderRadius}\n style={StyleSheet.absoluteFill}\n />\n </Pressable>\n );\n}\n","import {\n Platform,\n Pressable,\n StyleSheet,\n requireNativeComponent,\n useColorScheme,\n} from 'react-native';\nimport type { ViewProps, ViewStyle } from 'react-native';\nimport { useWalletLaunch } from './useWalletLaunch';\nimport { useWalletReady } from './useWalletReady';\nimport { resolveApplePayProps } from './walletButtonConfig';\nimport type { PaymentSession } from '../types/definitions';\nimport type { PaymentResult } from '../types/paymentresult';\nimport type { PaymentSheetConfiguration } from '../types/PaymentSheetConfiguration';\n\ndeclare global {\n var nativeFabricUIManager: unknown | null | undefined;\n}\n\ntype NativeProps = ViewProps & {\n type?: number;\n buttonStyle?: number;\n buttonBorderRadius?: number;\n disabled?: boolean;\n};\n\nfunction resolveNativeComponent(): React.ComponentType<NativeProps> | null {\n if (Platform.OS !== 'ios') {\n return null;\n }\n try {\n if (globalThis.nativeFabricUIManager != null) {\n return require('../codegen/components/HyperApplePayNativeComponent')\n .default as React.ComponentType<NativeProps>;\n }\n return requireNativeComponent(\n 'HyperApplePayButton'\n ) as unknown as React.ComponentType<NativeProps>;\n } catch {\n return null;\n }\n}\n\nconst NativeHyperApplePayButton = resolveNativeComponent();\n\nexport type ApplePayButtonProps = {\n options?: PaymentSheetConfiguration;\n session?: PaymentSession;\n onPaymentResult?: (result: PaymentResult) => void;\n onReady?: () => void;\n onLoadError?: (error: PaymentResult) => void;\n disabled?: boolean;\n style?: ViewStyle;\n};\n\nexport function ApplePayButton({\n options,\n session,\n onPaymentResult,\n onReady,\n onLoadError,\n disabled = false,\n style,\n}: ApplePayButtonProps) {\n const colorScheme = useColorScheme();\n const launch = useWalletLaunch({\n wallet: 'apple_pay',\n label: 'Apple Pay',\n session,\n onPaymentResult,\n });\n\n useWalletReady({\n wallet: 'apple_pay',\n label: 'Apple Pay',\n session,\n onReady,\n onLoadError,\n });\n\n const { hidden, type, buttonStyle, borderRadius } = resolveApplePayProps(\n options,\n colorScheme === 'dark' ? 'dark' : 'light'\n );\n\n if (hidden || NativeHyperApplePayButton == null) {\n return null;\n }\n\n return (\n <Pressable\n focusable\n accessible\n accessibilityRole=\"button\"\n accessibilityLabel=\"Apple Pay\"\n onPress={launch}\n disabled={disabled}\n style={style}\n >\n <NativeHyperApplePayButton\n type={type}\n buttonStyle={buttonStyle}\n buttonBorderRadius={borderRadius}\n disabled={disabled}\n style={StyleSheet.absoluteFill}\n />\n </Pressable>\n );\n}\n","import type {\n HyperswitchConfiguration,\n PaymentSession,\n PaymentSessionConfiguration,\n HyperswitchSession,\n} from './types/definitions';\nexport type * from './types/savedPaymentMethods';\nexport type * from './types/walletSession';\nexport type * from './types/definitions';\nexport type * from './types/elements';\nexport type * from './types/NativeEventTypes';\nexport type * from './types/PaymentSheetConfiguration';\nexport type * from './types/paymentresult';\nimport NativeHyperswitchModule from './codegen/modules/NativeHyperswitchModule';\nimport { createPaymentSession } from './session/PaymentSession';\nimport { Elements } from './types/elements';\nimport { createElements } from './session/Elements';\nimport { setInitializing } from './native/InitializationState';\n\nexport function loadHyper(\n config: HyperswitchConfiguration\n): Promise<HyperswitchSession> {\n setInitializing(true);\n return NativeHyperswitchModule.initialise(\n config.publishableKey,\n config.platformPublishableKey ?? '',\n config.profileId ?? '',\n config.environment ?? 'PROD',\n config.customEndpoints ?? {}\n )\n .then(() => {\n setInitializing(false);\n return {\n publishableKey: config.publishableKey,\n async initPaymentSession(\n options: PaymentSessionConfiguration\n ): Promise<PaymentSession> {\n return createPaymentSession(config, options);\n },\n async elements(\n options: PaymentSessionConfiguration\n ): Promise<Elements> {\n return createElements(config, options);\n },\n };\n })\n .catch((error) => {\n setInitializing(false);\n console.error('Error initializing Hyperswitch SDK:', error);\n throw error;\n });\n}\n\nexport const Hyperswitch = {\n init: loadHyper,\n};\n\nexport default Hyperswitch;\n\nexport {\n HyperElements,\n usePaymentSession,\n useWalletSession,\n useElements,\n useElements as useWidgets,\n} from './context/HyperElements';\n\nexport { CVCElement as CardCVCElement } from './views/CVCElement';\n\nexport { PaymentElement } from './views/PaymentElement';\n\nexport {\n isPlatformPaySupported,\n isGooglePaySupported,\n isApplePaySupported,\n isWalletSupported,\n} from './session/PlatformPaySupport';\n\nexport { GooglePayButton } from './views/GooglePayButton';\nexport type { GooglePayButtonProps } from './views/GooglePayButton';\n\nexport { ApplePayButton } from './views/ApplePayButton';\nexport type { ApplePayButtonProps } from './views/ApplePayButton';"],"names":["NativeHyperswitchModule","TurboModuleRegistry","get","NativeModules","NativeWidgetHelperModule","mapStatus","status","mapNativeResponseToPaymentResult","raw","parsed","JSON","parse","message","String","parseNativeResponse","type","code","widgetTags","Map","registerWidget","widgetId","nativeViewTag","set","unregisterWidget","delete","updateIntentCompleteForAllWidgets","sdkAuthorization","promises","values","map","tag","Promise","resolve","updateIntentCompleteForWidget","all","_isInitializing","setInitializing","value","_isSheetPresented","setSheetPresented","async","presentPaymentSheetWithPayload","payload","presentPaymentSheet","hyperswitchConfig","paymentSessionConfig","configuration","getReactTag","Error","reactTag","getWidget","undefined","parseBilling","parsePaymentMethod","billing","getCustomerSavedPaymentMethods","paymentMethodLayout","savedMethodCustomization","hiddenPaymentMethods","getCustomerLastUsedPaymentMethodData","getCustomerDefaultSavedPaymentMethodData","getCustomerSavedPaymentMethodData","args","confirmWithCustomerLastUsedPaymentMethod","id","confirmWithCustomerDefaultPaymentMethod","getWalletSession","promise","label","reject","timer","setTimeout","then","clearTimeout","error","isWalletEligible","wallet","catch","isGooglePayEligible","isApplePayEligible","launchWallet","bindPresentPaymentSheet","bindings","restConfig","platformPublishableKey","buildPresentPaymentSheetPayload","bindGetCustomerSavedPaymentMethods","bindGetWalletSession","updateIntent","intentResolver","newIntent","updateIntentInitForWidget","updateIntentInitForAllWidgets","createElementsNativeActions","confirmPayment","paymentElementRef","confirmOptions","nativeTag","stringify","confirmWidgetPayment","ref","current","process","env","NODE_ENV","getComponentNameFromType","$$typeof","REACT_CLIENT_REFERENCE","displayName","name","REACT_FRAGMENT_TYPE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","console","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","_context","REACT_FORWARD_REF_TYPE","innerType","render","REACT_MEMO_TYPE","REACT_LAZY_TYPE","_payload","_init","x","testStringCoercion","checkKeyStringCoercion","JSCompiler_inline_result","e","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","Symbol","toStringTag","constructor","call","getTaskName","UnknownOwner","elementRefGetterWithDeprecationWarning","componentName","this","didWarnAboutElementRef","props","jsxDEVImpl","config","maybeKey","isStaticChildren","debugStack","debugTask","dispatcher","children","isArrayImpl","length","validateChildKeys","Object","freeze","hasOwnProperty","keys","filter","k","join","didWarnAboutKeySpread","getter","getOwnPropertyDescriptor","isReactWarning","key","hasValidKey","propName","warnAboutAccessingKey","specialPropKeyWarningShown","defineProperty","configurable","defineKeyPropWarningGetter","owner","refProp","REACT_ELEMENT_TYPE","_owner","enumerable","_store","writable","ReactElement","ReactSharedInternals","A","getOwner","node","isValidElement","validated","object","React","require$$0","for","__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","prototype","Array","isArray","createTask","unknownOwnerDebugStack","react_stack_bottom_frame","callStackForError","bind","unknownOwnerDebugTask","reactJsxRuntime_development","Fragment","jsx","trackActualOwner","recentlyCreatedOwnerStacks","jsxs","jsxRuntimeModule","exports","jsxProd","reactJsxRuntime_production","require$$1","HyperElementsContext","createContext","HyperElements","hyper","options","paymentSession","setPaymentSession","useState","elements","setElements","setHyperswitchConfig","setPaymentSessionConfig","publishableKey","setPublishableKey","setSdkAuthorization","loading","setLoading","setError","walletSession","setWalletSession","walletEligibility","setWalletEligibility","googlePay","applePay","walletLoading","setWalletLoading","loadWalletSession","useCallback","wallets","useEffect","cancelled","session","sessionConfig","els","err","_jsx","Provider","useHyperElementsContext","ctx","useContext","useWalletSession","load","useOptionalWalletSession","useOptionalPaymentSession","usePaymentSession","useElements","NativePaymentWidgetImpl","global","nativeFabricUIManager","require","default","requireNativeComponent","useNativeViewTag","viewRef","onReady","viewTag","setViewTag","isMounted","poll","attempt","findNodeHandle","CVCElement","forwardRef","_ref","onChange","onFocus","onBlur","onPaymentResult","style","useRef","shouldRegister","nativeOptions","useMemo","opts","layout","cvcIcon","widgetType","onPaymentEvent","event","nativeEvent","eventName","payloadString","outerDict","cvcStatus","isCvcFocused","Boolean","isCvcBlur","result","validEventStrings","makeUnknownEventWarningPayload","invalidEvents","validEvents","PaymentElement","UIManager","dispatchViewManagerCommand","useImperativeHandle","_options","warningEmitted","subscribedEvents","includes","validateSubscribedEventStrings","warningPayload","Platform","OS","flex","isGooglePaySupported","isApplePaySupported","isWalletSupported","isPlatformPaySupported","useWalletLaunch","contextSession","inFlight","activeSession","useWalletReady","onLoadError","onReadyRef","onLoadErrorRef","walletSessionRef","loadRef","fail","resolveWallets","eligible","resolveEligibility","GOOGLE_PAY_BUTTON_TYPE","BUY","BOOK","CHECKOUT","DONATE","ORDER","PAY","SUBSCRIBE","PLAIN","GOOGLE_PAY_APPEARANCE","light","dark","APPLE_PAY_BUTTON_TYPE","plain","buy","setUp","inStore","donate","checkout","book","subscribe","APPLE_PAY_BUTTON_STYLE","white","whiteOutline","black","isHidden","visibility","getBorderRadius","appearance","primaryButton","shapes","borderRadius","isDarkTheme","colorScheme","theme","NativeHyperGooglePayButton","globalThis","resolveNativeComponent","GooglePayButton","useColorScheme","launch","hidden","walletButtonsConfiguration","buttonStyle","buttonType","resolveGooglePayProps","Pressable","focusable","accessible","accessibilityRole","accessibilityLabel","onPress","StyleSheet","absoluteFill","NativeHyperApplePayButton","ApplePayButton","disabled","resolveApplePayProps","buttonBorderRadius","loadHyper","initialise","profileId","environment","customEndpoints","createPaymentSession","Hyperswitch","init"],"mappings":"+WAgDA,MAAMA,EACJC,EAAoBC,IAAU,4BAC9BC,EAAcH,wBClCVI,EACJH,EAAoBC,IAAU,6BAC9BC,EAAcC,yBCKV,SAAUC,EAAUC,GACxB,OAAQA,GACN,IAAK,YACL,IAAK,YACL,IAAK,mBACL,IAAK,UACH,MAAO,YACT,IAAK,YACL,IAAK,WACH,MAAO,WAGT,QACE,MAAO,SAEb,CAEM,SAAUC,EACdC,GAEA,MAAMC,EAjCF,SACJD,GAEA,GAAmB,iBAARA,GAA4B,OAARA,EAC7B,OAAOA,EAET,IACE,OAAOE,KAAKC,MAAMH,EACpB,CAAE,MACA,MAAO,CAAEF,OAAQ,SAAUM,QAASC,OAAOL,GAC7C,CACF,CAsBiBM,CAAoBN,GACnC,MAAO,CACLF,OAAQD,EAAUI,EAAOH,QACzBS,KAAMN,EAAOM,MAAQN,EAAOO,MAAQX,EAAUI,EAAOH,SAAW,GAChEM,QAASH,EAAOG,SAAWH,EAAOO,MAAQ,GAE9C,CC7CA,MAAMC,EAAa,IAAIC,IAEjB,SAAUC,EAAeC,EAAkBC,GAC/CJ,EAAWK,IAAIF,EAAUC,EAC3B,CAMM,SAAUE,EAAiBH,GAC/BH,EAAWO,OAAOJ,EACpB,CAoCM,SAAUK,EACdC,GAEA,MAAMC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M,eAEJ,CiBJiB0T,CAAqB/P,EAAQwE,GAEtC,cAAMI,CACJJ,GAEA,MhBoBD,CACL/K,kBAJFA,EgBjB8BuG,KhBsBzBtD,EAA4BjD,EgBtBK+K,IhBgBlC,IACJ/K,CgBhBM,KAGHiC,MAAOH,IAGN,MAFAtC,GAAgB,GAChBgF,QAAQ1C,MAAM,sCAAuCA,GAC/CA,GAEZ,CAEO,MAAMyU,GAAc,CACzBC,KAAMP","x_google_ignoreList":[12,13,14]}
@@ -9,8 +9,10 @@ export type ApplePayButtonProps = {
9
9
  options?: PaymentSheetConfiguration;
10
10
  session?: PaymentSession;
11
11
  onPaymentResult?: (result: PaymentResult) => void;
12
+ onReady?: () => void;
13
+ onLoadError?: (error: PaymentResult) => void;
12
14
  disabled?: boolean;
13
15
  style?: ViewStyle;
14
16
  };
15
- export declare function ApplePayButton({ options, session, onPaymentResult, disabled, style, }: ApplePayButtonProps): import("react").JSX.Element | null;
17
+ export declare function ApplePayButton({ options, session, onPaymentResult, onReady, onLoadError, disabled, style, }: ApplePayButtonProps): import("react").JSX.Element | null;
16
18
  //# sourceMappingURL=ApplePayButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApplePayButton.d.ts","sourceRoot":"","sources":["../../../../src/views/ApplePayButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAEpF,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,qBAAqB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACvD;AA4BD,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,OAAO,CAAC,E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glePayButtonProps = {
9
9
  options?: PaymentSheetConfiguration;
10
10
  session?: PaymentSession;
11
11
  onPaymentResult?: (result: PaymentResult) => void;
12
+ onReady?: () => void;
13
+ onLoadError?: (error: PaymentResult) => void;
12
14
  style?: ViewStyle;
13
15
  };
14
- export declare function GooglePayButton({ options, session, onPaymentResult, style, }: GooglePayButtonProps): import("react").JSX.Element | null;
16
+ export declare function GooglePayButton({ options, session, onPaymentResult, onReady, onLoadError, style, }: GooglePayButtonProps): import("react").JSX.Element | null;
15
17
  //# sourceMappingURL=GooglePayButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GooglePayButton.d.ts","sourceRoot":"","sources":["../../../../src/views/GooglePayButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAEpF,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,qBAAqB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACvD;AA2BD,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IAClD,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,eAAe,EACf,KAAK,GACN,EAAE,oBAAoB,sCAmCtB"}
1
+ {"version":3,"file":"GooglePayButton.d.ts","sourceRoot":"","sources":["../../../../src/views/GooglePayButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAEpF,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,qBAAqB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACvD;AA2BD,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,eAAe,EACf,OAAO,EACP,WAAW,EACX,KAAK,GACN,EAAE,oBAAoB,sCA2CtB"}
@@ -0,0 +1,22 @@
1
+ import type { PaymentSession } from '../types/definitions';
2
+ import type { PaymentResult } from '../types/paymentresult';
3
+ import type { WalletName } from '../types/walletSession';
4
+ export type WalletReadyOptions = {
5
+ wallet: WalletName;
6
+ label: string;
7
+ session?: PaymentSession;
8
+ onReady?: () => void;
9
+ onLoadError?: (error: PaymentResult) => void;
10
+ };
11
+ /**
12
+ * Resolves wallet eligibility for a button, then calls `onReady` once when the
13
+ * wallet is pressable or `onLoadError` once when it is not. Exactly one of them
14
+ * fires per intent. The button owns this — merchants never load the wallet
15
+ * session themselves.
16
+ *
17
+ * Inside `<HyperElements>` the shared session is reused, so several buttons
18
+ * resolve off one round trip. With an explicit `session` prop the button
19
+ * resolves against that session directly.
20
+ */
21
+ export declare function useWalletReady({ wallet, label, session, onReady, onLoadError, }: WalletReadyOptions): void;
22
+ //# sourceMappingURL=useWalletReady.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWalletReady.d.ts","sourceRoot":"","sources":["../../../../src/views/useWalletReady.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAuB,MAAM,wBAAwB,CAAC;AAE9E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,WAAW,GACZ,EAAE,kBAAkB,GAAG,IAAI,CA2E3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay-tech/react-native-hyperswitch",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Hyperswitch SDK for React Native",
5
5
  "main": "lib/commonjs/index.bundle.js",
6
6
  "module": "lib/module/index.bundle.js",