"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports._getHubUrlFromPortalHostname = _getHubUrlFromPortalHostname;
/**
 * Parse the portal url, and if it matches one of the AGO
 * Url patterns, return the correct Hub Url
 * If portalUrl does not match an AGO pattern, this will
 * return `undefined`
 * @param portalUrl
 * @private
 */
function _getHubUrlFromPortalHostname(portalUrl) {
    let result;
    if (/(qaext|\.mapsqa)\.arcgis.com/.exec(portalUrl)) {
        result = "https://hubqa.arcgis.com";
    }
    else if (/(devext|\.mapsdevext)\.arcgis.com/.exec(portalUrl)) {
        result = "https://hubdev.arcgis.com";
    }
    else if (/(www|\.maps)\.arcgis.com/.exec(portalUrl)) {
        result = "https://hub.arcgis.com";
    }
    return result;
}
//# sourceMappingURL=_get-hub-url-from-portal-hostname.js.map