@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 871 B
JavaScript
const r="/ ",n=(r,n)=>n?.value&&n?.currency?r.amount(n.value,n.currency,{currencyDisplay:n.currencyDisplay||"symbol"}):"",t=r=>{const n=r.get("payAmountFormat"),t=n.indexOf("%@");return t>=0&&n.substring(t+2).trim().length>0},e=(r,e,c)=>{const o=n(r,e);if(!o)return r.get("payButton");if(c&&t(r)){const n=u(r,c);return r.get("payAmountFormat").replace("%@",`${o}${n}`)}return r.get("payAmountFormat").replace("%@",o)},u=(r,n)=>{const t=n&&n?.value&&n?.currency?r.amount(n.value,n.currency,{currencyDisplay:n.currencyDisplay||"symbol"}):"";return`${t.length?"/ ":""}${t}`};function c(r,n,t,u,c,o){return n||(c?e(r,c):u?r.get("confirmPreauthorization"):e(r,t,o))}function o(r,n,e,c,o){return c||o||!e||!n||t(r)?null:u(r,n)}export{r as PAY_BTN_DIVIDER,n as amountLabel,c as createButtonLabel,o as createSecondaryLabel,e as payAmountLabel};
//# sourceMappingURL=utils.js.map