"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }

var _chunkWLS4D6VGjs = require('./chunk-WLS4D6VG.js');


var _chunk7QVYU63Ejs = require('./chunk-7QVYU63E.js');

// src/client/config.ts
var _clientConfig = null;
function configureJsonApi(config) {
  _clientConfig = config;
  if (config.bootstrapper) {
    _chunkWLS4D6VGjs.setBootstrapper.call(void 0, config.bootstrapper);
    config.bootstrapper();
  }
}
_chunk7QVYU63Ejs.__name.call(void 0, configureJsonApi, "configureJsonApi");
function configureClientConfig(config) {
  _clientConfig = config;
}
_chunk7QVYU63Ejs.__name.call(void 0, configureClientConfig, "configureClientConfig");
function getApiUrl() {
  if (_optionalChain([_clientConfig, 'optionalAccess', _ => _.apiUrl])) {
    return _clientConfig.apiUrl;
  }
  if (typeof process !== "undefined" && _optionalChain([process, 'access', _2 => _2.env, 'optionalAccess', _3 => _3.NEXT_PUBLIC_API_URL])) {
    return process.env.NEXT_PUBLIC_API_URL;
  }
  return "";
}
_chunk7QVYU63Ejs.__name.call(void 0, getApiUrl, "getApiUrl");
function getAppUrl() {
  if (_optionalChain([_clientConfig, 'optionalAccess', _4 => _4.appUrl])) {
    return _clientConfig.appUrl;
  }
  if (typeof process !== "undefined" && _optionalChain([process, 'access', _5 => _5.env, 'optionalAccess', _6 => _6.NEXT_PUBLIC_APP_URL])) {
    return process.env.NEXT_PUBLIC_APP_URL;
  }
  if (typeof window !== "undefined") {
    return window.location.origin;
  }
  return "";
}
_chunk7QVYU63Ejs.__name.call(void 0, getAppUrl, "getAppUrl");
function getTrackablePages() {
  return _nullishCoalesce(_optionalChain([_clientConfig, 'optionalAccess', _7 => _7.trackablePages]), () => ( []));
}
_chunk7QVYU63Ejs.__name.call(void 0, getTrackablePages, "getTrackablePages");
function getStripePublishableKey() {
  return _optionalChain([_clientConfig, 'optionalAccess', _8 => _8.stripePublishableKey]);
}
_chunk7QVYU63Ejs.__name.call(void 0, getStripePublishableKey, "getStripePublishableKey");

// src/i18n/config.ts
var _config = null;
function configureI18n(config) {
  _config = config;
}
_chunk7QVYU63Ejs.__name.call(void 0, configureI18n, "configureI18n");
function useI18nRouter() {
  if (!_optionalChain([_config, 'optionalAccess', _9 => _9.useRouter])) {
    throw new Error("i18n not configured. Call configureI18n() at app startup.");
  }
  return _config.useRouter();
}
_chunk7QVYU63Ejs.__name.call(void 0, useI18nRouter, "useI18nRouter");
function useI18nTranslations(namespace) {
  if (!_optionalChain([_config, 'optionalAccess', _10 => _10.useTranslations])) {
    return (key) => key;
  }
  return _config.useTranslations(namespace);
}
_chunk7QVYU63Ejs.__name.call(void 0, useI18nTranslations, "useI18nTranslations");
function getI18nLink() {
  if (!_optionalChain([_config, 'optionalAccess', _11 => _11.Link])) {
    throw new Error("i18n not configured. Call configureI18n() at app startup.");
  }
  return _config.Link;
}
_chunk7QVYU63Ejs.__name.call(void 0, getI18nLink, "getI18nLink");
function useI18nLocale() {
  if (_optionalChain([_config, 'optionalAccess', _12 => _12.useLocale])) {
    return _config.useLocale();
  }
  return "en";
}
_chunk7QVYU63Ejs.__name.call(void 0, useI18nLocale, "useI18nLocale");
function useI18nDateFnsLocale() {
  if (_optionalChain([_config, 'optionalAccess', _13 => _13.useDateFnsLocale])) {
    return _config.useDateFnsLocale();
  }
  return void 0;
}
_chunk7QVYU63Ejs.__name.call(void 0, useI18nDateFnsLocale, "useI18nDateFnsLocale");

// src/login/config.ts
var _useDiscordAuth = false;
var _useGoogleAuth = false;
var _useInternalAuth = true;
var _allowRegistration = true;
var _registrationMode = "open";
function configureLogin(params) {
  _useDiscordAuth = !!params.discordClientId;
  _useGoogleAuth = !!params.googleClientId;
  _useInternalAuth = _nullishCoalesce(params.useInternalAuth, () => ( true));
  _allowRegistration = _nullishCoalesce(params.allowRegistration, () => ( true));
  _registrationMode = _nullishCoalesce(params.registrationMode, () => ( "open"));
}
_chunk7QVYU63Ejs.__name.call(void 0, configureLogin, "configureLogin");
function isDiscordAuthEnabled() {
  return _useDiscordAuth;
}
_chunk7QVYU63Ejs.__name.call(void 0, isDiscordAuthEnabled, "isDiscordAuthEnabled");
function isGoogleAuthEnabled() {
  return _useGoogleAuth;
}
_chunk7QVYU63Ejs.__name.call(void 0, isGoogleAuthEnabled, "isGoogleAuthEnabled");
function isInternalAuthEnabled() {
  return _useInternalAuth;
}
_chunk7QVYU63Ejs.__name.call(void 0, isInternalAuthEnabled, "isInternalAuthEnabled");
function isRegistrationAllowed() {
  return _allowRegistration;
}
_chunk7QVYU63Ejs.__name.call(void 0, isRegistrationAllowed, "isRegistrationAllowed");
function getRegistrationMode() {
  return _registrationMode;
}
_chunk7QVYU63Ejs.__name.call(void 0, getRegistrationMode, "getRegistrationMode");

// src/roles/config.ts
var _roleId = null;
function configureRoles(roleId) {
  _roleId = roleId;
}
_chunk7QVYU63Ejs.__name.call(void 0, configureRoles, "configureRoles");
function getRoleId() {
  if (!_roleId) {
    throw new Error("Roles not configured. Call configureRoles() at app startup.");
  }
  return _roleId;
}
_chunk7QVYU63Ejs.__name.call(void 0, getRoleId, "getRoleId");
function isRolesConfigured() {
  return _roleId !== null;
}
_chunk7QVYU63Ejs.__name.call(void 0, isRolesConfigured, "isRolesConfigured");

// src/features/waitlist/config/waitlist.config.ts
var _waitlistConfig = {};
function configureWaitlist(config) {
  _waitlistConfig = config;
}
_chunk7QVYU63Ejs.__name.call(void 0, configureWaitlist, "configureWaitlist");
function getWaitlistConfig() {
  return _waitlistConfig;
}
_chunk7QVYU63Ejs.__name.call(void 0, getWaitlistConfig, "getWaitlistConfig");

// src/features/referral/config.ts
var DEFAULT_REFERRAL_CONFIG = {
  enabled: false,
  cookieName: "referral_code",
  cookieDays: 30,
  urlParamName: "ref",
  referralUrlBase: "",
  referralPath: "/"
};
var _referralConfig = { ...DEFAULT_REFERRAL_CONFIG };
function configureReferral(config) {
  _referralConfig = { ...DEFAULT_REFERRAL_CONFIG, ...config };
}
_chunk7QVYU63Ejs.__name.call(void 0, configureReferral, "configureReferral");
function getReferralConfig() {
  return _referralConfig;
}
_chunk7QVYU63Ejs.__name.call(void 0, getReferralConfig, "getReferralConfig");
function isReferralEnabled() {
  return _referralConfig.enabled;
}
_chunk7QVYU63Ejs.__name.call(void 0, isReferralEnabled, "isReferralEnabled");




























exports.configureJsonApi = configureJsonApi; exports.configureClientConfig = configureClientConfig; exports.getApiUrl = getApiUrl; exports.getAppUrl = getAppUrl; exports.getTrackablePages = getTrackablePages; exports.getStripePublishableKey = getStripePublishableKey; exports.configureI18n = configureI18n; exports.useI18nRouter = useI18nRouter; exports.useI18nTranslations = useI18nTranslations; exports.getI18nLink = getI18nLink; exports.useI18nLocale = useI18nLocale; exports.useI18nDateFnsLocale = useI18nDateFnsLocale; exports.configureLogin = configureLogin; exports.isDiscordAuthEnabled = isDiscordAuthEnabled; exports.isGoogleAuthEnabled = isGoogleAuthEnabled; exports.isInternalAuthEnabled = isInternalAuthEnabled; exports.isRegistrationAllowed = isRegistrationAllowed; exports.getRegistrationMode = getRegistrationMode; exports.configureRoles = configureRoles; exports.getRoleId = getRoleId; exports.isRolesConfigured = isRolesConfigured; exports.configureWaitlist = configureWaitlist; exports.getWaitlistConfig = getWaitlistConfig; exports.configureReferral = configureReferral; exports.getReferralConfig = getReferralConfig; exports.isReferralEnabled = isReferralEnabled;
//# sourceMappingURL=chunk-GP3MDKGE.js.map