(()=>{"use strict";var e={20(e,t,o){var r=o(609),n=Symbol.for("react.element"),s=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,o){var r,l={},a=null,d=null;for(r in void 0!==o&&(a=""+o),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,r)&&!c.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===l[r]&&(l[r]=t[r]);return{$$typeof:n,type:e,key:a,ref:d,props:l,_owner:i.current}}},609(e){e.exports=window.React},848(e,t,o){e.exports=o(20)}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,o),s.exports}const r=window.wp.blocks,n=window.wp.element,s=(0,n.forwardRef)((function({icon:e,size:t=24,...o},r){return(0,n.cloneElement)(e,{width:t,height:t,...o,ref:r})}));var i=o(609);const c=window.wp.primitives,l=(0,i.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(c.Path,{fillRule:"evenodd",d:"M5 5.5h14a.5.5 0 01.5.5v1.5a.5.5 0 01-.5.5H5a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 9.232A2 2 0 013 7.5V6a2 2 0 012-2h14a2 2 0 012 2v1.5a2 2 0 01-1 1.732V18a2 2 0 01-2 2H6a2 2 0 01-2-2V9.232zm1.5.268V18a.5.5 0 00.5.5h12a.5.5 0 00.5-.5V9.5h-13z",clipRule:"evenodd"})),a=window.wp.blockEditor,d=window.wc.blocksCheckout,p=window.wc.wcSettings;var m=o(848);const{newsletter:u}=(0,p.getSetting)("omnisend_consent_data",""),{sms:b}=(0,p.getSetting)("omnisend_consent_data",""),f=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":""}'),w=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,r.registerBlockType)(f,{icon:{src:(0,m.jsx)(s,{icon:l})},edit:()=>{const e=(0,a.useBlockProps)();return u.optInEnabled?(0,m.jsx)("div",{...e,id:"omnisend-subscribe-block",children:(0,m.jsx)(d.CheckboxControl,{style:{marginTop:0,lineHeight:"normal"},id:"newsletter-text",checked:u.optInPreselected,disabled:!0,children:u.optInText})}):(0,m.jsx)("div",{})}}),(0,r.registerBlockType)(w,{icon:{src:(0,m.jsx)(s,{icon:l})},edit:()=>{const e=(0,a.useBlockProps)();return b.optInEnabled?(0,m.jsx)("div",{...e,id:"omnisend-subscribe-block",children:(0,m.jsx)(d.CheckboxControl,{style:{marginTop:0,lineHeight:"normal"},id:"sms-text",disabled:!0,children:b.optInText})}):(0,m.jsx)("div",{})}})})();