// import 'whatwg-fetch';
import './public-path';
import '!file-loader?name=[name].[ext]!./images/favicon.ico';
import './global.less';
import 'animate.css/animate.css';
// import 'antd/dist/antd.less';
import 'file-loader?name=.htaccess!./.htaccess'; // eslint-disable-line import/extensions
import '@wisdom-utils/utils/lib/helpers/format';
import 'sanitize.css/sanitize.css';
import { Storeage } from '@wisdom-utils/utils/lib/helpers';
import { initGlobalConfig } from './initConfig';
import './utils/event';

import { render } from './render';

// import store from './stores';
// eslint-disable-next-line no-restricted-globals
const namespace = `__PANDA_STORE__${location.hostname}`;
window.createStoreage = new Storeage(namespace);

const initLocale = () => {
  localStorage.setItem('umi_locale', 'zh-CN');
};
// 语音播报全局拦截
const setMessageVoice = () => {
  const rawSpeak = window.speechSynthesis.speak;
  window.speechSynthesis.speak = function(...args) {
    if (
      window.globalConfig &&
      window.globalConfig.hasOwnProperty('messageVoice') &&
      window.globalConfig.messageVoice === false
    )
      return;
    rawSpeak.apply(window.speechSynthesis, args);
  };
};
initGlobalConfig();
render({ appContent: '', loading: true });
initLocale();
setMessageVoice();
