(()=>{"use strict";var e,t={91:(e,t,o)=>{e.exports=o(753)},377:(e,t,o)=>{o.d(t,{e:()=>p});const n=window.wp.hooks,i=window.wp.element,r=window.ReactDOM,l=(window.wp.apiFetch,window.lodash);var c=o(609),s=o(91);const a=({pageType:e})=>{const[t,o]=(0,i.useState)([]),r=(0,c.useCallback)((0,l.debounce)((()=>{wp.apiFetch({path:"flexible-shipping/v1/free-shipping-notice",method:"GET"}).then((e=>{o(e)})).catch((e=>{console.log(e)}))}),2e3),[]);return(0,i.useEffect)((()=>{document.body.addEventListener("wc-blocks_added_to_cart",(e=>{r()})),(0,n.addAction)("flexible-shipping-cart-updated","flexible-shipping",r),r()}),[]),(0,s.jsx)(s.Fragment,{children:t.map(((t,o)=>null==e||t.blocks.includes(e)?(0,s.jsx)("div",{className:"woocommerce-info",dangerouslySetInnerHTML:{__html:t.content}},o):null))})},p=({checkoutExtensionData:e,cart:t,extensions:o})=>{const{setExtensionData:l}=e||{};return(0,i.useEffect)((()=>{0===document.querySelectorAll(".flexible-shipping-free-shipping-root").length&&void 0!==o["flexible-shipping-free-shipping-notice-block-integration"]&&(e=>{let t=document.getElementsByClassName("wp-block-woocommerce-cart");if(0===t.length&&(t=document.getElementsByClassName("wp-block-woocommerce-checkout")),t.length>0){const o=document.createElement("div");t[0].parentNode.insertBefore(o,t[0]),(0,r.createRoot)(o).render((0,s.jsx)(a,{pageType:e}))}})(o["flexible-shipping-free-shipping-notice-block-integration"].page_type)}),[]),(0,i.useEffect)((()=>{l&&l("flexible-shipping-free-shipping-notice-block-integration","fakeField","")}),[]),(0,i.useEffect)((()=>{(0,n.doAction)("flexible-shipping-cart-updated","flexible-shipping",{})}),[t]),(0,s.jsx)(s.Fragment,{})}},450:(e,t,o)=>{const n=window.wc.blocksCheckout;var i=o(377);const r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"flexible-shipping/free-shipping-notice-block-integration","version":"1.0.0","title":"Free Shipping Notice Block Integration","category":"woocommerce","description":"Adds a notice to the checkout and cart when free shipping is available.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-shipping-methods-block","woocommerce/cart-totals-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"textdomain":"flexible-shipping","editorScript":"file:./index.js","style":"file:./style-index.css","viewScript":"file:./frontend.js"}');(0,n.registerCheckoutBlock)({metadata:r,component:i.e})},609:e=>{e.exports=window.React},753:(e,t,o)=>{var n=o(609),i=Symbol.for("react.element"),r=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};t.Fragment=r,t.jsx=function(e,t,o){var n,r={},a=null,p=null;for(n in void 0!==o&&(a=""+o),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(p=t.ref),t)l.call(t,n)&&!s.hasOwnProperty(n)&&(r[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===r[n]&&(r[n]=t[n]);return{$$typeof:i,type:e,key:a,ref:p,props:r,_owner:c.current}}}},o={};function n(e){var i=o[e];if(void 0!==i)return i.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,e=[],n.O=(t,o,i,r)=>{if(!o){var l=1/0;for(p=0;p<e.length;p++){for(var[o,i,r]=e[p],c=!0,s=0;s<o.length;s++)(!1&r||l>=r)&&Object.keys(n.O).every((e=>n.O[e](o[s])))?o.splice(s--,1):(c=!1,r<l&&(l=r));if(c){e.splice(p--,1);var a=i();void 0!==a&&(t=a)}}return t}r=r||0;for(var p=e.length;p>0&&e[p-1][2]>r;p--)e[p]=e[p-1];e[p]=[o,i,r]},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={675:0,858:0,966:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var i,r,[l,c,s]=o,a=0;if(l.some((t=>0!==e[t]))){for(i in c)n.o(c,i)&&(n.m[i]=c[i]);if(s)var p=s(n)}for(t&&t(o);a<l.length;a++)r=l[a],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return n.O(p)},o=globalThis.webpackChunkflexible_shipping=globalThis.webpackChunkflexible_shipping||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var i=n.O(void 0,[966],(()=>n(450)));i=n.O(i)})();