import imageLogoLight from 'app/assets/logo-dark.png';
import imageLogoDark from 'app/assets/logo.png';

export const applySelectedTheme = theme => {
  document.documentElement.setAttribute('data-theme', theme);
  global.dispatchEvent(new Event('themeChange'));
};

export const getTheme = () => {
  return (
    (document &&
      document.documentElement &&
      document.documentElement.getAttribute('data-theme')) ||
    'light'
  );
};

export const getLogoImage = () => {
  return getTheme() !== 'dark' ? imageLogoLight : imageLogoDark;
};

export const getFancyNodeColor = () => {
  return getTheme() !== 'dark' ? 'rgba(0,0,0, 0.3)' : 'rgba(255,255,255, 0.4)';
};

@@ -143,16 +143,36 @@
 me =%3E %7B%0A
+  if (document) %7B%0A  
   docume
@@ -225,16 +225,18 @@
 theme);%0A
+  
   global
@@ -277,16 +277,20 @@
 nge'));%0A
+  %7D%0A
 %7D;%0A%0Aexpo

Check that document is defined