'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vConsole_vConsole = require('./v-console.js');
require('../dom/dom.js');
require('../loader/loader.js');
require('../loader/little-loader.js');
require('./config.js');
require('./plugin/delay.js');
require('./plugin/env.js');
require('./plugin/feedback.js');
require('../clipboard/clipboard-web.js');
require('./plugin/msdk.js');
require('./plugin/version.js');
require('@babel/runtime/helpers/toConsumableArray');
require('./plugin/version-simple.js');
require('../time/time.js');

/**
 * 生成 v-console
 * 有几种情况：
 * 1. 不显示
 * 2. 立即显示
 * 3. 异步判断后，确定是否显示
 * @param params 参数
 * @example
 *
 * ```ts
 * genVConsole({
 *   immediateShow: isShowVConsole === 'true'
 *     || isTestEnv()
 *     || noDelay === V_CONSOLE_NO_DELAY.VALUE,
 *   hide: isShowVConsole === 'false' || !!UserInfo.tipUid(),
 *   asyncConfirmFunc: checkIsDevList,
 * });
 * ```
 */
function genVConsole(_ref) {
  var _ref$immediateShow = _ref.immediateShow,
    immediateShow = _ref$immediateShow === void 0 ? false : _ref$immediateShow,
    _ref$hide = _ref.hide,
    hide = _ref$hide === void 0 ? false : _ref$hide,
    _ref$vConsoleConfig = _ref.vConsoleConfig,
    vConsoleConfig = _ref$vConsoleConfig === void 0 ? {} : _ref$vConsoleConfig,
    asyncConfirmFunc = _ref.asyncConfirmFunc;
  var _a;
  if (hide) {
    return;
  }
  if (immediateShow) {
    vConsole_vConsole.loadVConsole(vConsoleConfig);
  }
  if (typeof asyncConfirmFunc === 'function') {
    (_a = asyncConfirmFunc === null || asyncConfirmFunc === void 0 ? void 0 : asyncConfirmFunc()) === null || _a === void 0 ? void 0 : _a.then(function () {
      vConsole_vConsole.loadVConsole(vConsoleConfig);
    })["catch"](function (error) {
      console.log('checkIsDevList', error);
    });
  }
}

exports.genVConsole = genVConsole;
