(()=>{"use strict";const e=window.wc.blocksCheckout,t=JSON.parse('{"apiVersion":3,"name":"mailpoet/marketing-optin-block","version":"0.1.0","title":"MailPoet Marketing Opt-in","category":"mailpoet","textdomain":"mailpoet","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/checkout-contact-information-block"],"editorScript":"file:./marketing-optin-block.js","editorStyle":"file:./marketing-optin-block.css"}'),o=window.wp.element,i=window.wc.wcSettings,n=window.ReactJSXRuntime,{optinEnabled:a,defaultText:l}=(0,i.getSetting)("mailpoet_data");(0,e.registerCheckoutBlock)({metadata:t,component:function({text:t,checkoutExtensionData:i}){const[c,s]=(0,o.useState)(!1),{setExtensionData:r}=i||{};return(0,o.useEffect)(()=>{a&&r&&r("mailpoet","optin",c)},[c,r]),a?(0,n.jsx)(e.CheckboxControl,{checked:c,onChange:s,label:(0,n.jsx)(o.RawHTML,{children:t||l})}):null}})})();