1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4  value: true
5});
6exports.getAccountUsername = getAccountUsername;
7function _getUserState() {
8  const data = require("./getUserState");
9  _getUserState = function () {
10    return data;
11  };
12  return data;
13}
14const ANONYMOUS_USERNAME = 'anonymous';
15
16/**
17 * Get the owner of the project from the manifest if specified, falling back to a bunch of different things
18 * which may or may not be the owner of the project.
19 *
20 * @deprecated This may not actually be the owner of the project. Prefer to fetch the project owner using
21 * the EAS project ID, falling back to the `owner` field.
22 */
23function getAccountUsername(manifest = {}) {
24  var _getUserState$read$au;
25  // TODO: Must match what's generated in Expo Go.
26  const username = manifest.owner || process.env.EXPO_CLI_USERNAME || process.env.EAS_BUILD_USERNAME;
27  if (username) {
28    return username;
29  }
30  // Statically get the username from the global user state.
31  return ((_getUserState$read$au = (0, _getUserState().getUserState)().read().auth) === null || _getUserState$read$au === void 0 ? void 0 : _getUserState$read$au.username) || ANONYMOUS_USERNAME;
32}
33//# sourceMappingURL=getAccountUsername.js.map