'use strict';

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

var api = require('./api.js');
var subscription = require('./subscription.js');
var errors = require('./errors.js');

/**
 * Returns the current customer privacy settings and metadata and
 * re-renders your component if the customer privacy settings change.
 */
function useCustomerPrivacy() {
  const api$1 = api.useApi();
  const extensionTarget = api$1.extension.target;
  if (!('customerPrivacy' in api$1)) {
    throw new errors.ExtensionHasNoFieldError('customerPrivacy', extensionTarget);
  }
  return subscription.useSubscription(api.useApi().customerPrivacy);
}

exports.useCustomerPrivacy = useCustomerPrivacy;
