1 line
No EOL
1.7 KiB
JavaScript
1 line
No EOL
1.7 KiB
JavaScript
(()=>{"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,c={},s=null,p=null;for(r in void 0!==o&&(s=""+o),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(p=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(c[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===c[r]&&(c[r]=t[r]);return{$$typeof:n,type:e,key:s,ref:p,props:c,_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":2,"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:c}=(0,a.getSetting)("mailpoet_data");(0,o.registerCheckoutBlock)({metadata:r,component:function({text:e,checkoutExtensionData:t}){const[r,a]=(0,n.useState)(!1),{setExtensionData:s}=t||{};return(0,n.useEffect)((()=>{l&&s&&s("mailpoet","optin",r)}),[r,s]),l?(0,i.jsx)(o.CheckboxControl,{checked:r,onChange:a,children:(0,i.jsx)(n.RawHTML,{children:e||c})}):null}})})(); |