(()=>{"use strict";const e=window.React,t=window.wp.element,n=window.wc.blocksCheckout,c=window.wp.plugins,a=window.wc.wcSettings,r=window.wcPPCP.utils;window.wp.i18n,(0,a.getSetting)("ppcpGeneralData").i18n,window.wp.apiFetch,window.wc.blocksCheckoutEvents,window.wp.data;const l=(0,a.getSetting)("paylaterParams"),o=({cart:c,extensions:o,context:s})=>{const w=l.enabled,i=(0,t.useRef)(null),{cartTotals:p}=c,{currency_code:u,total_price:m}=p,d=(e=>{const[n,c]=(0,t.useState)(null);return(0,t.useEffect)(()=>{n||(0,r.loadPayPalSdk)(e).then(e=>c(e))},[n]),n})((0,a.getSetting)("paypalQueryParams")),g=(0,t.useMemo)(()=>({amount:m/10**p.currency_minor_unit,currency:u,placement:"payment",...l.options}));return(0,t.useEffect)(()=>{d&&w&&d.Messages(g).render(i.current)},[d,g,w]),w?(0,e.createElement)(n.TotalsWrapper,null,(0,e.createElement)("div",{className:"wc-block-components-totals-item"},(0,e.createElement)("div",{ref:i,className:"wc-ppcp-paylater-msg__container"}))):null};(0,c.registerPlugin)("wc-ppcp",{render:()=>(0,e.createElement)(n.ExperimentalOrderMeta,null,(0,e.createElement)(o,null)),scope:"woocommerce-checkout"}),(this.wcPPCP=this.wcPPCP||{})["paylater-messaging"]={}})();
//# sourceMappingURL=paylater-messaging.js.map