"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.OxyServicesLocationMixin = OxyServicesLocationMixin;
/**
 * Location Methods Mixin
 */

function OxyServicesLocationMixin(Base) {
  return class extends Base {
    constructor(...args) {
      super(...args);
    }

    /**
     * Update user location
     * @param latitude - Latitude coordinate
     * @param longitude - Longitude coordinate
     * @returns Location update result
     */
    async updateLocation(latitude, longitude) {
      try {
        return await this.makeRequest('POST', '/api/location', {
          latitude,
          longitude
        }, {
          cache: false
        });
      } catch (error) {
        throw this.handleError(error);
      }
    }

    /**
     * Get nearby users
     * @param radius - Optional search radius in meters
     * @returns Array of nearby users
     */
    async getNearbyUsers(radius) {
      try {
        const params = radius ? {
          radius
        } : undefined;
        return await this.makeRequest('GET', '/api/location/nearby', params, {
          cache: false // Don't cache location data - always get fresh data
        });
      } catch (error) {
        throw this.handleError(error);
      }
    }
  };
}
//# sourceMappingURL=OxyServices.location.js.map