import{getElement as t,store as e}from"@wordpress/interactivity";const i="I acknowledge that using a private store means my plugin will inevitably break on the next store release.",{state:n}=e("woocommerce",{},{lock:i}),{state:a}=e("woocommerce/mini-cart",{},{lock:i});let r=null,s=null;const c=e("wc-ppcp/mini-cart-express",{state:{isHydrated:!1},callbacks:{onInit:()=>{c.isHydrated=!0},onDrawerOpen:()=>{if(c.isHydrated&&a.isOpen){const{ref:e}=t();document.dispatchEvent(new CustomEvent("wc-stripe:mini-cart-ready",{detail:{container:e}}))}},onCartUpdated:()=>{if(!c.isHydrated||!n.cart)return;const{ref:e}=t();clearTimeout(r),r=setTimeout(()=>{const t=JSON.stringify(n.cart);t!==s&&(s=t,e.offsetHeight&&(e.style.minHeight=e.offsetHeight+"px"),document.dispatchEvent(new CustomEvent("wc-ppcp:mini-cart-updated",{detail:{cart:n.cart,container:e}})))},150)}}});
//# sourceMappingURL=mini-cart-block.js.map