'use strict';

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

var AUDIO_DECMIALS = 18;
var WAUDIO_DECMIALS = 8;
var CURRENT_USER_EXISTS_LOCAL_STORAGE_KEY = '@audius/libs:found-user';
exports.AuthHeaders = void 0;

(function (AuthHeaders) {
  AuthHeaders["MESSAGE"] = "Encoded-Data-Message";
  AuthHeaders["SIGNATURE"] = "Encoded-Data-Signature";
})(exports.AuthHeaders || (exports.AuthHeaders = {}));

var getTrackListens = function getTrackListens() {
  var timeFrame = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  var idsArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  var startTime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  var endTime = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  var limit = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  var offset = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
  var queryUrl = 'tracks/listens/';

  if (timeFrame != null) {
    switch (timeFrame) {
      case 'day':
      case 'week':
      case 'month':
      case 'year':
      case 'millennium':
        break;

      default:
        throw new Error('Invalid timeFrame value provided');
    }

    queryUrl += timeFrame;
  }

  var queryParams = {};

  if (idsArray !== null) {
    queryParams.id = idsArray;
  }

  if (limit !== null) {
    queryParams.limit = limit;
  }

  if (offset !== null) {
    queryParams.offset = offset;
  }

  if (startTime != null) {
    queryParams.start = startTime;
  }

  if (endTime != null) {
    queryParams.end = endTime;
  }

  var req = {
    url: queryUrl,
    method: 'get',
    params: queryParams
  };
  return req;
};

var requests = /*#__PURE__*/Object.freeze({
    __proto__: null,
    getTrackListens: getTrackListens
});

exports.AUDIO_DECMIALS = AUDIO_DECMIALS;
exports.CURRENT_USER_EXISTS_LOCAL_STORAGE_KEY = CURRENT_USER_EXISTS_LOCAL_STORAGE_KEY;
exports.IdentityAPI = requests;
exports.WAUDIO_DECMIALS = WAUDIO_DECMIALS;
//# sourceMappingURL=core.js.map
