
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e790249d-ede4-5b0d-9df7-943880f084da")}catch(e){}}();
import { SkyfirePaymentProvider } from './skyfire.js';
import { X402PaymentProvider } from './x402.js';
/**
 * Resolves a payment provider from a `?payment=` query parameter value.
 *
 * Some providers require async initialization (e.g., fetching payment requirements
 * from the Apify API), so this function is async.
 *
 * @returns A PaymentProvider instance, or undefined if the value is not a known provider.
 */
export async function resolvePaymentProvider(paymentParam) {
    if (!paymentParam)
        return undefined;
    const providers = {
        skyfire: async () => SkyfirePaymentProvider.create(),
        x402: async () => X402PaymentProvider.create(),
    };
    const factory = providers[paymentParam];
    return factory === null || factory === void 0 ? void 0 : factory();
}
//# sourceMappingURL=resolve.js.map
//# debugId=e790249d-ede4-5b0d-9df7-943880f084da
