'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 market of the checkout, and automatically re-renders
 * your component if it changes.
 */
function useLocalizationMarket() {
  const api$1 = api.useApi();
  const extensionTarget = api$1.extension.target;
  if (!('market' in api$1.localization)) {
    throw new errors.ExtensionHasNoFieldError('market', extensionTarget);
  }
  return subscription.useSubscription(api$1.localization.market);
}

exports.useLocalizationMarket = useLocalizationMarket;
