"use client";
'use strict';

var jsxRuntime = require('react/jsx-runtime');
var clerkIntl = require('../lib/clerk-intl.js');
var nextjs = require('@clerk/nextjs');

function ClerkProviderClient({ children, locale, signInUrl, signUpUrl, fallbackSignInUrl, fallbackSignUpUrl, waitlistUrl, }) {
    const currentLocalization = clerkIntl.clerkIntl[locale];
    // build the ClerkProvider props, only add when the parameter is not empty
    const clerkProviderProps = {
        localization: currentLocalization,
    };
    // Only add URL when the parameter is not empty
    if (signInUrl) {
        clerkProviderProps.signInUrl = `/${locale}${signInUrl}`;
    }
    if (signUpUrl) {
        clerkProviderProps.signUpUrl = `/${locale}${signUpUrl}`;
    }
    if (fallbackSignInUrl) {
        clerkProviderProps.signInFallbackRedirectUrl = `/${locale}${fallbackSignInUrl}`;
    }
    if (fallbackSignUpUrl) {
        clerkProviderProps.signUpFallbackRedirectUrl = `/${locale}${fallbackSignUpUrl}`;
    }
    if (waitlistUrl) {
        clerkProviderProps.waitlistUrl = `/${locale}${waitlistUrl}`;
    }
    // console.log('ClerkProviderClient props:', clerkProviderProps);
    return (jsxRuntime.jsx(nextjs.ClerkProvider, Object.assign({}, clerkProviderProps, { children: children })));
}

exports.ClerkProviderClient = ClerkProviderClient;
