"use strict";const C=require("@accelbyte/sdk"),P=()=>({NODE_ENV:{key:"NODE_ENV",value:process.env.NODE_ENV},DEBUG_PROD:{key:"DEBUG_PROD",value:process.env.DEBUG_PROD},BASE_URL:{key:"JUSTICE_BASE_URL",value:process.env.JUSTICE_BASE_URL},LEGAL_WEB_URL:{key:"JUSTICE_LEGAL_WEB_URL",value:process.env.JUSTICE_LEGAL_WEB_URL},ADMINPORTAL_CLIENT_ID:{key:"ADMINPORTAL_CLIENT_ID",value:process.env.ADMINPORTAL_CLIENT_ID},CONF_EDITOR_REDIRECT_URI:{key:"CONF_EDITOR_REDIRECT_URI",value:process.env.CONF_EDITOR_REDIRECT_URI},CONF_EDITOR_BASE_PATH:{key:"CONF_EDITOR_BASE_PATH",value:process.env.CONF_EDITOR_BASE_PATH},PLAYERPORTAL_CLIENT_ID:{key:"PLAYERPORTAL_CLIENT_ID",value:process.env.PLAYERPORTAL_CLIENT_ID},PLAYERPORTAL_REDIRECT_URI:{key:"PLAYERPORTAL_REDIRECT_URI",value:process.env.PLAYERPORTAL_REDIRECT_URI},PLAYERPORTAL_BASE_PATH:{key:"PLAYERPORTAL_BASE_PATH",value:process.env.PLAYERPORTAL_BASE_PATH},PLAYERPORTAL_REDIS_HOST:{key:"PLAYERPORTAL_REDIS_HOST",value:process.env.PLAYERPORTAL_REDIS_HOST},PLAYERPORTAL_REDIS_PORT:{key:"PLAYERPORTAL_REDIS_PORT",value:process.env.PLAYERPORTAL_REDIS_PORT},PLAYERPORTAL_REDIS_EXPIRATION_TIME:{key:"PLAYERPORTAL_REDIS_EXPIRATION_TIME",value:process.env.PLAYERPORTAL_REDIS_EXPIRATION_TIME},NEWS_V2_URL:{key:"NEWS_V2_URL",value:process.env.NEWS_V2_URL},LAUNCHER_CLIENT_ID:{key:"LAUNCHER_CLIENT_ID",value:process.env.LAUNCHER_CLIENT_ID},LAUNCHER_REDIRECT_URI:{key:"LAUNCHER_REDIRECT_URI",value:process.env.LAUNCHER_REDIRECT_URI},LAUNCHER_STORE_KEY:{key:"LAUNCHER_STORE_KEY",value:process.env.LAUNCHER_STORE_KEY},SDK_PLAYGROUND_CLIENT_ID:{key:"SDK_PLAYGROUND_CLIENT_ID",value:process.env.SDK_PLAYGROUND_CLIENT_ID},SDK_PLAYGROUND_REDIRECT_URI:{key:"SDK_PLAYGROUND_REDIRECT_URI",value:process.env.SDK_PLAYGROUND_REDIRECT_URI},SDK_PLAYGROUND_BASE_PATH:{key:"SDK_PLAYGROUND_BASE_PATH",value:process.env.SDK_PLAYGROUND_BASE_PATH},NEWS_BASE_PATH:{key:"NEWS_BASE_PATH",value:process.env.NEWS_BASE_PATH},NAMESPACE:{key:"JUSTICE_PUBLISHER_NAMESPACE",value:process.env.JUSTICE_PUBLISHER_NAMESPACE},CONF_SERVER:{key:"JUSTICE_CONF_SERVER",value:process.env.JUSTICE_CONF_SERVER},STORYBOOK_CLIENT_ID:{key:"STORYBOOK_CLIENT_ID",value:process.env.STORYBOOK_CLIENT_ID},STORYBOOK_REDIRECT_URI:{key:"STORYBOOK_REDIRECT_URI",value:process.env.STORYBOOK_REDIRECT_URI},STORYBOOK_BASE_PATH:{key:"STORYBOOK_BASE_PATH",value:process.env.STORYBOOK_BASE_PATH},CACHE_URL:{key:"CACHE_URL",value:process.env.CACHE_URL},SERVER_PORT:{key:"PORT",value:process.env.PORT},CONTACT_SUPPORT_EMAIL:{key:"PLAYERPORTAL_CONTACT_SUPPORT_EMAIL",value:process.env.PLAYERPORTAL_CONTACT_SUPPORT_EMAIL},TELEMETRY_GOOGLE_ANALYTICS_TRACKING_ID:{key:"TELEMETRY_GOOGLE_ANALYTICS_TRACKING_ID",value:process.env.TELEMETRY_GOOGLE_ANALYTICS_TRACKING_ID},WALLET_VIRTUAL_CURRENCY_CODE:{key:"JUSTICE_WALLET_VIRTUAL_CURRENCY_CODE",value:process.env.JUSTICE_WALLET_VIRTUAL_CURRENCY_CODE},READY_PLAYER_ME_AVATAR_URL:{key:"PLAYERPORTAL_READYPLAYERME_AVATAR_URL",value:process.env.PLAYERPORTAL_READYPLAYERME_AVATAR_URL},MOCK_WINDOWS:{key:"MOCK_WINDOWS",value:process.env.MOCK_WINDOWS},ACCESS_TOKEN:{key:"ACCESS_TOKEN",value:process.env.ACCESS_TOKEN},IS_DISABLE_DISPLAY_NAME:{key:"JUSTICE_PLAYERPORTAL_DISABLE_DISPLAY_NAME",value:process.env.JUSTICE_PLAYERPORTAL_DISABLE_DISPLAY_NAME},IS_DISABLE_USERNAME:{key:"JUSTICE_PLAYERPORTAL_DISABLE_USER_NAME",value:process.env.JUSTICE_PLAYERPORTAL_DISABLE_USER_NAME},LEGALWEB_BASE_PATH:{key:"LEGALWEB_BASE_PATH",value:process.env.LEGALWEB_BASE_PATH},LEGAL_CONTACT_SUPPORT_EMAIL:{key:"LEGAL_CONTACT_SUPPORT_EMAIL",value:process.env.LEGAL_CONTACT_SUPPORT_EMAIL},JUSTICE_API_URL:{key:"JUSTICE_API_URL",value:process.env.JUSTICE_API_URL},FULL_ACCESS_LOG_ENABLED:{key:"FULL_ACCESS_LOG_ENABLED",value:process.env.FULL_ACCESS_LOG_ENABLED},LAUNCHER_APP_ID:{key:"LAUNCHER_APP_ID",value:process.env.LAUNCHER_APP_ID},LAUNCHER_GUID:{key:"LAUNCHER_GUID",value:process.env.LAUNCHER_GUID},LAUNCHER_PAYMENT_URL:{key:"LAUNCHER_PAYMENT_URL",value:process.env.LAUNCHER_PAYMENT_URL},PLAYERPORTAL_CDN_URL:{key:"PLAYERPORTAL_CDN_URL",value:process.env.PLAYERPORTAL_CDN_URL}}),D=(L=!0)=>(()=>{const A=P();return Object.keys(A).reduce((T,e)=>{const{key:O,value:I}=A[e];return I&&L&&(T[O]=I),L||(T[O]=I),T},{})})(),N=D(),_=P(),R=L=>L.value,S=(L,A)=>R(L)?R(L)==="true":A,U=()=>{const A=[_.ADMINPORTAL_CLIENT_ID,_.PLAYERPORTAL_CLIENT_ID,_.LAUNCHER_CLIENT_ID,_.SDK_PLAYGROUND_CLIENT_ID,_.STORYBOOK_CLIENT_ID].find(T=>T.value!==void 0&&T.value!=="");return(A==null?void 0:A.value)||""},s=()=>{const A=[_.CONF_EDITOR_REDIRECT_URI,_.PLAYERPORTAL_REDIRECT_URI,_.LAUNCHER_REDIRECT_URI,_.SDK_PLAYGROUND_REDIRECT_URI,_.STORYBOOK_REDIRECT_URI].find(T=>T.value!==void 0&&T.value!=="");return(A==null?void 0:A.value)||""};class E{static failOnMissing(A=[]){const T=A.reduce((e,{key:O,value:I})=>(I||e.push(O),e),[]);if(T.length>0)throw Error(`Missing required env var 
${T.map(e=>`❌ ${e}`).join(`
`)}`)}}E.BASE_URL=R(_.BASE_URL);E.CLIENT_ID=U();E.NAMESPACE=R(_.NAMESPACE);E.REDIRECT_URL=s();E.CONF_SERVER=R(_.CONF_SERVER);E.PLAYER_PORTAL_BASE_URL=C.DesktopChecker.isDesktopApp()?"":R(_.PLAYERPORTAL_BASE_PATH)??"";E.CONF_EDITOR_BASE_PATH=R(_.CONF_EDITOR_BASE_PATH);E.NODE_ENV=R(_.NODE_ENV);E.IS_DEV_MODE=R(_.NODE_ENV)==="development";E.IS_PROD_MODE=R(_.NODE_ENV)==="production";E.IS_DEBUG_PROD=R(_.DEBUG_PROD)==="true";E.CACHE_URL=R(_.CACHE_URL);E.LEGAL_WEB_URL=R(_.LEGAL_WEB_URL);E.CONTACT_SUPPORT_EMAIL=R(_.CONTACT_SUPPORT_EMAIL);E.TELEMETRY_GOOGLE_ANALYTICS_TRACKING_ID=R(_.TELEMETRY_GOOGLE_ANALYTICS_TRACKING_ID);E.WALLET_VIRTUAL_CURRENCY_CODE=R(_.WALLET_VIRTUAL_CURRENCY_CODE);E.READY_PLAYER_ME_AVATAR_URL=R(_.READY_PLAYER_ME_AVATAR_URL);E.IS_DISABLE_DISPLAY_NAME=S(_.IS_DISABLE_DISPLAY_NAME,!1);E.IS_DISABLE_USERNAME=S(_.IS_DISABLE_USERNAME,!1);E.MOCK_WINDOWS=S(_.MOCK_WINDOWS,!1);E.ACCESS_TOKEN=R(_.ACCESS_TOKEN);E.SERVER_PORT=R(_.SERVER_PORT);E.SDK_PLAYGROUND_BASE_PATH=R(_.SDK_PLAYGROUND_BASE_PATH);E.STORYBOOK_BASE_PATH=R(_.STORYBOOK_BASE_PATH);E.REDIS_HOST=R(_.PLAYERPORTAL_REDIS_HOST);E.REDIS_PORT=R(_.PLAYERPORTAL_REDIS_PORT);E.REDIS_EXPIRATION_TIME=R(_.PLAYERPORTAL_REDIS_EXPIRATION_TIME);E.NEWS_BASE_PATH=R(_.NEWS_BASE_PATH);E.NEWS_V2_URL=R(_.NEWS_V2_URL)||"";E.FULL_ACCESS_LOG_ENABLED=R(_.FULL_ACCESS_LOG_ENABLED);E.LAUNCHER_APP_ID=R(_.LAUNCHER_APP_ID);E.LAUNCHER_GUID=R(_.LAUNCHER_GUID);E.LAUNCHER_PAYMENT_URL=R(_.LAUNCHER_PAYMENT_URL);if(E.IS_DEV_MODE||E.IS_DEBUG_PROD){const L={...N};console.log("Env:",JSON.stringify(L,null,2).replace(/"/g,""))}exports.Env=E;
