(()=>{"use strict";var e={20(e,t,o){var n=o(609),s=Symbol.for("react.element"),r=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,o){var n,a={},l=null,d=null;for(n in void 0!==o&&(l=""+o),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(d=t.ref),t)r.call(t,n)&&!i.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:s,type:e,key:l,ref:d,props:a,_owner:c.current}}},609(e){e.exports=window.React},848(e,t,o){e.exports=o(20)}},t={};const o=window.wc.blocksCheckout,n=window.wp.element,s=window.wc.wcSettings;var r=function o(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}(848);const{newsletter:c}=(0,s.getSetting)("omnisend_consent_data",""),{sms:i}=(0,s.getSetting)("omnisend_consent_data",""),a=JSON.parse('{"apiVersion":2,"name":"omnisend/checkout-block","version":"2.0.0","title":"Omnisend subscriber checkbox","category":"woocommerce","description":"Adds a checkbox field to let the shopper become a subscriber.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-contact-information-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}},"text":{"type":"string","default":""}},"textdomain":"omnisend-checkout-block","editorStyle":""}'),l=JSON.parse('{"apiVersion":2,"name":"omnisend/checkout-sms-block","version":"2.0.0","title":"Omnisend sms subscriber checkbox","category":"woocommerce","description":"Adds a checkbox field to let the shopper become a sms subscriber.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-contact-information-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}},"text":{"type":"string","default":""}},"textdomain":"omnisend-checkout-block","editorStyle":""}');(0,o.registerCheckoutBlock)({metadata:a,component:({checkoutExtensionData:e})=>{const[t,s]=(0,n.useState)(c.optInPreselected),{setExtensionData:i}=e;return(0,n.useEffect)((()=>{i("omnisend_consent","optin",t)}),[t,i]),c.optInEnabled?(0,r.jsx)("div",{id:"omnisend-subscribe-block",children:(0,r.jsx)(o.CheckboxControl,{id:"subscribe-to-newsletter",checked:t,onChange:s,children:c.optInText})}):null}}),(0,o.registerCheckoutBlock)({metadata:l,component:({checkoutExtensionData:e})=>{const[t,s]=(0,n.useState)(!1),{setExtensionData:c}=e;return(0,n.useEffect)((()=>{c("omnisend_consent","optin-sms",t)}),[t,c]),i.optInEnabled?(0,r.jsx)("div",{id:"omnisend-subscribe-block",children:(0,r.jsx)(o.CheckboxControl,{id:"subscribe-to-sms",checked:t,onChange:s,children:i.optInText})}):null}})})();