'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 setting values defined by the merchant for the extension.
 */
function useSettings() {
  const api$1 = api.useApi();
  const extensionTarget = api$1.extension.target;
  if (!('settings' in api$1)) {
    throw new errors.ExtensionHasNoFieldError('settings', extensionTarget);
  }
  const settings = subscription.useSubscription(api$1.settings);
  return settings;
}

exports.useSettings = useSettings;
