import 'react';
import { ComparisonContainer } from './comparison/index.js';
export { ComparisonContainer as Comparison } from './comparison/index.js';
export { C as ComparisonSelfServe } from './ComparisonSelfServe-95b65d75.js';
import { C as ComparisonTableContainer } from './index-861c1077.js';
export { C as ComparisonTable } from './index-861c1077.js';
export { C as ComparisonTableHero, a as ComparisonTableHeroContainer } from './ComparisonTableHeroContainer-ef61d39c.js';
export { C as ComparisonTableVersus } from './ComparisonTableVersus-42de5787.js';
export { ProviderComparison } from './provider-comparison-widget/index.js';
import { W as WISE_ALIAS } from './provider-constants-b35398f2.js';
export { fetchQuotes } from './clients.js';
export { default as transformQuotesResponse } from './transformQuotesResponse.js';
export { t as transformQuotesResponseV2 } from './transformQuotesResponseV2-6eb16ebc.js';
export { b as isBankQuote, c as isMoneyTransferProviderQuote, a as isPartnerQuote, i as isWiseQuote } from './quoteFilters-9ddc9e2f.js';
export { calculateSavingAgainstMostExpensiveBankInSourceCurrency, calculateSavingAgainstMostExpensiveBankInTargetCurrency, supportsCalculatingSavingAgainstMostExpensiveBank } from './savingsCalculator.js';
export { T as TransferFeeComparisonContainer } from './TransferFeeComparisonContainer-a5d31129.js';
import 'react/jsx-runtime';
import '@transferwise/formatting';
import 'react-intersection-observer';
import 'react-intl';
import 'date-fns';
import 'duration-fns';
import './tracking-7717c145.js';
import '@transferwise/icons';
import '@transferwise/components';
import '@wise/components-theming';
import './ProviderLogo-d98111d0.js';
import './deliveryEstimationFormatter-39a5e91c.js';
export { T as TravelMoney } from './TravelMoney-40f2d621.js';
import 'prop-types';
import 'react-autobind';
import './ReceiveAmount-cf275e96.js';
import './style-inject.es-1f59c1d0.js';
import './ArrowIcon-b7e50f4d.js';
import './ErrorTemplate-39049770.js';
import 'date-fns/formatDistanceToNow';
import 'date-fns/locale/be';
import 'date-fns/locale/bg';
import 'date-fns/locale/ca';
import 'date-fns/locale/cs';
import 'date-fns/locale/da';
import 'date-fns/locale/de';
import 'date-fns/locale/el';
import 'date-fns/locale/en-GB';
import 'date-fns/locale/eo';
import 'date-fns/locale/es';
import 'date-fns/locale/fi';
import 'date-fns/locale/fr';
import 'date-fns/locale/hr';
import 'date-fns/locale/hu';
import 'date-fns/locale/id';
import 'date-fns/locale/is';
import 'date-fns/locale/it';
import 'date-fns/locale/ja';
import 'date-fns/locale/ko';
import 'date-fns/locale/mk';
import 'date-fns/locale/nb';
import 'date-fns/locale/nl';
import 'date-fns/locale/pl';
import 'date-fns/locale/pt';
import 'date-fns/locale/ro';
import 'date-fns/locale/ru';
import 'date-fns/locale/sk';
import 'date-fns/locale/sl';
import 'date-fns/locale/sr';
import 'date-fns/locale/sv';
import 'date-fns/locale/th';
import 'date-fns/locale/tr';
import 'date-fns/locale/zh-CN';
import 'date-fns/locale/zh-HK';
import '@wise/art';
import './CurrencySelector-18c13b52.js';
import './currencies-1f1f52ab.js';
import './tslib.es6-2e1f499a.js';
import './TapestryCard-38ddeade.js';
import './ComparisonTableHeroV2Table-a6d41584.js';
import './index-496e1bf2.js';
import './isConsideredMidmarketRate-4f12041d.js';
import './createUrl-71d09e7b.js';
import './TransferFee-05335190.js';
import './DeliveryEstimation-28e7c50f.js';
import './aliasFilter-a7b9c811.js';
import './ExchangeRateIndicator-7977c22d.js';
import './Label-19e06f9d.js';
import './generateUrl-3fc80d02.js';
import './ProviderComparisonTable-577b39d8.js';
import './createClassNamesFromStyles-24575b97.js';
import './parseAmount-c0794650.js';
import './encodeQueryParams-96e87b36.js';
import './extractQuote-aa1e3309.js';
import './sortQuotesByDeliverySpeedEstimate-f8c8a1b8.js';
import './fetchQuotes-31ac98ed.js';
import 'lodash.throttle';
import './index-27c99b06.js';
import '@babel/runtime/helpers/extends';

const PAYPAL = 'paypal';
const WESTERN_UNION = 'western-union';
const largestProviderByCountry = new Map([
    ['gb', [PAYPAL, WESTERN_UNION, 'hsbc', 'barclays', 'lloyds', 'moneygram', WISE_ALIAS]],
    ['us', [PAYPAL, WESTERN_UNION, 'chase', 'moneygram', 'wells-fargo', 'xoom', WISE_ALIAS]],
    ['au', [PAYPAL, WESTERN_UNION, 'commonwealth-bank-of-australia', 'anz', 'westpac', 'national-australia-bank', WISE_ALIAS]],
    ['hk', [PAYPAL, WESTERN_UNION, 'hang-seng', 'hsbc-hk', 'ocbc', 'ccb-hk', WISE_ALIAS]],
    ['es', [PAYPAL, WESTERN_UNION, 'lacaixa', 'bbva', 'sabadell', WISE_ALIAS]],
    ['nl', [PAYPAL, WESTERN_UNION, 'ing-nl', 'abn-amro-bank', 'rabobank', WISE_ALIAS]],
]);

const supportsCountry = (country) => {
    return largestProviderByCountry.has(country.toLowerCase());
};
const hasEnoughProviders = (quotes, country, requiredNumberOfProviders = 5) => {
    if (!supportsCountry(country)) {
        return false;
    }
    const filteredQuotes = filter(quotes, country);
    return filteredQuotes.length >= requiredNumberOfProviders;
};
const filter = (quotes, country) => {
    if (!supportsCountry(country)) {
        return quotes;
    }
    const largestProviders = largestProviderByCountry.get(country.toLowerCase()) || [];
    return quotes.filter((quote) => largestProviders.includes(quote.provider.alias));
};

/* eslint-disable fp/no-mutation,react/jsx-filename-extension */
ComparisonContainer.componentType = 'Comparison';
ComparisonTableContainer.componentType = 'Comparison Table';

export { hasEnoughProviders as hasEnoughLargestProviders };
//# sourceMappingURL=index.js.map
