'use strict';
import { appEnvironments, launchMode } from '../constants/environment-constants.js';
import { fileURLToPath } from 'url';
import { toolboxEnvSettingKeys } from '../infra/toolbox-env-setting-keys.js';
import { isString } from '../types/ensure-type.js';
import { getBooleanEnvSetting, getStringEnvSetting } from '../infra/env-functions.js';
import { folders } from '../../base-repo/app-constants/project-paths.js';
import { jsBasicTypes } from '../../base-repo/constants/basic-types.js';

var __defProp=Object['defineProperty'],__name=(_0x5440e0,_0x303806)=>__defProp(_0x5440e0,'name',{'value':_0x303806,'configurable':!![]});function isProd(){return getAppEnvironment()===appEnvironments['production'];}__name(isProd,'isProd');function isDev(){return getAppEnvironment()===appEnvironments['development'];}__name(isDev,'isDev');function isTest(){return getAppEnvironment()===appEnvironments['test'];}__name(isTest,'isTest');function isDemo(){return getAppEnvironment()===appEnvironments['demo'];}__name(isDemo,'isDemo');function isProdOrDemo(){return isProd()||isDemo();}__name(isProdOrDemo,'isProdOrDemo');function isWebUiTest(){return getBooleanEnvSetting(toolboxEnvSettingKeys['isWebUiTest']);}__name(isWebUiTest,'isWebUiTest');function isWebSocketDisabled(){return getBooleanEnvSetting(toolboxEnvSettingKeys['disableWebSockets']);}__name(isWebSocketDisabled,'isWebSocketDisabled');function getAppEnvironment(){const _0x3e6af1=getStringEnvSetting(toolboxEnvSettingKeys['appEnv']);if(isAppEnvironmentKey(_0x3e6af1))return appEnvironments[_0x3e6af1];return appEnvironments['development'];}__name(getAppEnvironment,'getAppEnvironment');function isCi(){return getBooleanEnvSetting(toolboxEnvSettingKeys['ci']);}__name(isCi,'isCi');function isBrowser(){return typeof window!==jsBasicTypes['undefined'];}__name(isBrowser,'isBrowser');function hasDocument(){return typeof document!==jsBasicTypes['undefined'];}__name(hasDocument,'hasDocument');function isPackageNodeMode(){if(!isBrowser()){const _0x2d36ca=fileURLToPath(import.meta.url);return _0x2d36ca['includes']('/'+folders['nodeModules']+'/');}return ![];}__name(isPackageNodeMode,'isPackageNodeMode');function getLaunchMode(){return getStringEnvSetting(toolboxEnvSettingKeys['launchMode'])??launchMode['direct'];}__name(getLaunchMode,'getLaunchMode');function isPackageMode(){return getLaunchMode()!==launchMode['direct'];}__name(isPackageMode,'isPackageMode');function isUsingS3(){return getBooleanEnvSetting(toolboxEnvSettingKeys['useS3Compatible']);}__name(isUsingS3,'isUsingS3');function isAppEnvironmentKey(_0x5a1ddb){return isString(_0x5a1ddb)&&Object['hasOwn'](appEnvironments,_0x5a1ddb);}__name(isAppEnvironmentKey,'isAppEnvironmentKey');

export { getAppEnvironment, getLaunchMode, hasDocument, isBrowser, isCi, isDemo, isDev, isPackageMode, isPackageNodeMode, isProd, isProdOrDemo, isTest, isUsingS3, isWebSocketDisabled, isWebUiTest };
