1. /* eslint-disable */
    
  2. 
    
  3. const NODE_ENV = process.env.NODE_ENV;
    
  4. if (NODE_ENV !== 'development' && NODE_ENV !== 'production') {
    
  5.   throw new Error('NODE_ENV must either be set to development or production.');
    
  6. }
    
  7. global.__DEV__ = NODE_ENV === 'development';
    
  8. global.__EXTENSION__ = false;
    
  9. global.__TEST__ = NODE_ENV === 'test';
    
  10. global.__PROFILE__ = NODE_ENV === 'development';
    
  11. global.__UMD__ = false;
    
  12. 
    
  13. const RELEASE_CHANNEL = process.env.RELEASE_CHANNEL;
    
  14. 
    
  15. // Default to running tests in experimental mode. If the release channel is
    
  16. // set via an environment variable, then check if it's "experimental".
    
  17. global.__EXPERIMENTAL__ =
    
  18.   typeof RELEASE_CHANNEL === 'string'
    
  19.     ? RELEASE_CHANNEL === 'experimental'
    
  20.     : true;
    
  21. 
    
  22. global.__VARIANT__ = !!process.env.VARIANT;
    
  23. 
    
  24. if (typeof window !== 'undefined') {
    
  25.   global.requestIdleCallback = function (callback) {
    
  26.     return setTimeout(() => {
    
  27.       callback({
    
  28.         timeRemaining() {
    
  29.           return Infinity;
    
  30.         },
    
  31.       });
    
  32.     });
    
  33.   };
    
  34. 
    
  35.   global.cancelIdleCallback = function (callbackID) {
    
  36.     clearTimeout(callbackID);
    
  37.   };
    
  38. } else {
    
  39.   global.AbortController =
    
  40.     require('abortcontroller-polyfill/dist/cjs-ponyfill').AbortController;
    
  41. }