'use strict';

exports.__esModule = true;

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _Device = require('./../Device');

var _Device2 = _interopRequireDefault(_Device);

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

var _browser = require('./browser');

var _browser2 = _interopRequireDefault(_browser);

var _wx = require('./wx');

var _wx2 = _interopRequireDefault(_wx);

var _dinghuo = require('./dinghuo');

var _dinghuo2 = _interopRequireDefault(_dinghuo);

var _wq = require('./wq');

var _wq2 = _interopRequireDefault(_wq);

var _cordova = require('./cordova');

var _cordova2 = _interopRequireDefault(_cordova);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Bridge = {};
if (_Device2.default.platform === 'wechat' || _Device2.default.platform === 'wework' || _Device2.default.platform === 'miniprogram') {
  Bridge = _extends({}, _base2.default, _wx2.default);
} else if (_Device2.default.platform === 'dinghuo') {
  Bridge = _extends({}, _base2.default, _dinghuo2.default);
} else if (_Device2.default.platform === 'waiqin') {
  Bridge = _extends({}, _base2.default, _cordova2.default);
} else if (_Device2.default.platform === 'wq') {
  Bridge = _extends({}, _base2.default, _wq2.default);
} else {
  Bridge = _extends({}, _base2.default, _browser2.default);
}

// 防止绑定事件时this指向window, 所以全局加一个变量用于存储this
window._bridge_self = Bridge;

exports.default = Bridge;
module.exports = exports['default'];