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

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