(()=>{"use strict";var e={538(e,t,o){var r=o(609),n=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,o){var r,s={},c=null,p=null;for(r in void 0!==o&&(c=""+o),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(p=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:n,type:e,key:c,ref:p,props:s,_owner:i.current}}},106(e,t,o){e.exports=o(538)},609(e){e.exports=window.React}},t={};const o=window.wc.blocksCheckout,r=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"}'),n=window.wp.element,a=window.wc.wcSettings;var i=function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(106);const{optinEnabled:l,defaultText:s}=(0,a.getSetting)("mailpoet_data");(0,o.registerCheckoutBlock)({metadata:r,component:function({text:e,checkoutExtensionData:t}){const[r,a]=(0,n.useState)(!1),{setExtensionData:c}=t||{};return(0,n.useEffect)((()=>{l&&c&&c("mailpoet","optin",r)}),[r,c]),l?(0,i.jsx)(o.CheckboxControl,{checked:r,onChange:a,label:(0,i.jsx)(n.RawHTML,{children:e||s})}):null}})})();