"use strict";exports.__esModule = true;exports.isTestEnv = exports.isProductionEnv = exports.isDevelopmentEnv = void 0; // eslint-disable-next-line no-var


var isProcessEnvDefined = typeof process !== 'undefined' && typeof process.env !== 'undefined';

var isReactUITestEnv = function isReactUITestEnv() {
  // usefull when process doesn't exist (webpack5/vite/etc)
  var isReactUITestDefined = typeof REACT_UI_TEST !== 'undefined';

  if (isReactUITestDefined && Boolean(REACT_UI_TEST)) {
    return true;
  }

  if (isProcessEnvDefined) {
    switch (true) {
      case Boolean(process.env.REACT_UI_TEST): // when NODE_ENV is not usable (e.g., already used for dev/prod)
      case Boolean(process.env.REACT_APP_REACT_UI_TEST): // for usage with CRA
      case Boolean(process.env.STORYBOOK_REACT_UI_TEST): // for usage with storybook
      case Boolean(process.env.enableReactTesting): // deprecated, legacy variable
        return true;
    }
  }

  return false;
};

var isNodeTestEnv = isProcessEnvDefined && process.env.NODE_ENV === 'test';
var isNodeProductionEnv = isProcessEnvDefined && process.env.NODE_ENV === 'production';
var isNodeDevelopmentEnv = isProcessEnvDefined && process.env.NODE_ENV === 'development';

var isTestEnv = exports.isTestEnv = isNodeTestEnv || isReactUITestEnv();
var isProductionEnv = exports.isProductionEnv = isNodeProductionEnv;
var isDevelopmentEnv = exports.isDevelopmentEnv = isNodeDevelopmentEnv;