@adyen/adyen-platform-experience-web
Version:

37 lines (36 loc) • 1.01 kB
JavaScript
import { supportedCountries as n, supportedRegions as s, SupportedLocation as o } from "./constants.js";
const u = (e) => {
var r;
const t = (r = e == null ? void 0 : e.regions) == null ? void 0 : r.find((c) => c.type === "capital");
return (t == null ? void 0 : t.value) ?? "";
}, p = (e) => {
switch (e) {
case o.EU:
return "capital.legalSubtitleEU";
default:
return null;
}
}, a = (e) => {
switch (e) {
case o.AU:
return "capital.legalSubtitleAU";
case o.GB:
return "capital.legalSubtitleGB";
case o.US:
return "capital.legalSubtitleUS";
case o.CA:
return "capital.legalSubtitleCA";
default:
return null;
}
}, d = (e) => {
const t = u(e), r = e == null ? void 0 : e.countryCode;
return a(r) ?? p(t);
}, S = (e) => {
const t = u(e), r = (e == null ? void 0 : e.countryCode) ?? "";
return n.includes(r) || s.includes(t);
};
export {
d as getCapitalHeaderSubtitleByLegalEntity,
S as isCapitalRegionSupported
};