import axios from 'axios';

function getRtxInfoV2(defaultRtx) {
  return new Promise(function (resolve, reject) {
    if (window.location.host.startsWith('localhost')) {
      resolve({
        rtx: defaultRtx || 'developer'
      });
      return;
    }
    axios({
      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);
    });
  });
}

export { getRtxInfoV2 };
