"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

let getServerURL = (serverInfo, protocol) => {
  let {
    host,
    domain,
    port
  } = serverInfo;

  if (protocol) {
    if (protocol === 'ht' + 'tp') {
      port = Number(port) + 1;

      if (domain) {
        return `${protocol ? `${protocol}:` : ''}//${host}.${domain}.zohocorpin.com:${Number(port) + 1}`;
      }

      return `${protocol ? `${protocol}:` : ''}//${host}:${port}`;
    }
  }

  if (domain) {
    return `${protocol ? `${protocol}:` : ''}//${host}.${domain}.zohocorpin.com:${port}`;
  }

  return `${protocol ? `${protocol}:` : ''}//${host}:${port}`;
};

var _default = getServerURL;
exports.default = _default;