'use strict';

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

var axios = require('axios');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);

function getRtxInfoV2(defaultRtx) {
  return new Promise(function (resolve, reject) {
    if (window.location.host.startsWith('localhost')) {
      resolve({
        rtx: defaultRtx || 'developer'
      });
      return;
    }
    axios__default["default"]({
      url: "".concat(window.location.protocol, "//").concat(window.location.host, "/ts:auth/tauth/info.ashx"),
      method: 'get'
    }).then(function (response) {
      if (response.data.EngName) {
        resolve(Object.assign(Object.assign({}, response.data), {
          rtx: response.data.EngName
        }));
      }
    })["catch"](function (err) {
      reject(err);
    });
  });
}

exports.getRtxInfoV2 = getRtxInfoV2;
