"use strict";(self.webpackChunkwebpackWcBlocksStylingJsonp=self.webpackChunkwebpackWcBlocksStylingJsonp||[]).push([[1084],{24225:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var c=n(80721),o=n(99196),r=n(91),a=n.n(r),s=n(69307),l=n(12904),u=n(68752);const i={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1};var b=n(74617),d=n(9818),p=n(94801),m=n(33554),k=n(28027),f=n(82346),g=n(75052);var h=n(31298);const v=(0,c.withFilteredAttributes)(h.Z)((({checkoutPageId:e,className:t,buttonLabel:c})=>{const r=(0,b.getSetting)("page-"+e,!1),h=(0,d.useSelect)((e=>e(p.CHECKOUT_STORE_KEY).isCalculating())),[v,E]=(()=>{const[e,t]=(0,s.useState)(""),n=(0,s.useRef)(null),c=(0,s.useRef)(new IntersectionObserver((e=>{e[0].isIntersecting?t("visible"):t(e[0].boundingClientRect.top>0?"below":"above")}),{threshold:1}));return(0,s.useLayoutEffect)((()=>{const e=n.current,t=c.current;return e&&t.observe(e),()=>{t.unobserve(e)}}),[]),[(0,o.createElement)("div",{"aria-hidden":!0,ref:n,style:i}),e]})(),[C,w]=(0,s.useState)(!1);(0,s.useEffect)((()=>{if("function"!=typeof n.g.addEventListener||"function"!=typeof n.g.removeEventListener)return;const e=()=>{w(!1)};return n.g.addEventListener("pageshow",e),()=>{n.g.removeEventListener("pageshow",e)}}),[]);const _=(0,d.useSelect)((e=>e(p.CART_STORE_KEY).getCartData())),y=(0,m.applyCheckoutFilter)({filterName:"proceedToCheckoutButtonLabel",defaultValue:c||g.B,arg:{cart:_}}),S=(0,m.applyCheckoutFilter)({filterName:"proceedToCheckoutButtonLink",defaultValue:r||u.sE,arg:{cart:_}}),{dispatchOnProceedToCheckout:L}=(0,f.b)(),N=(0,o.createElement)(l.Z,{className:"wc-block-cart__submit-button",href:S,disabled:h,onClick:e=>{L().then((t=>{t.some(k.qm)?e.preventDefault():w(!0)}))},showSpinner:C},y),T=(0,s.useMemo)((()=>getComputedStyle(document.body).backgroundColor),[]);return(0,o.createElement)("div",{className:a()("wc-block-cart__submit",t)},v,(0,o.createElement)("div",{className:"wc-block-cart__submit-container"},N),"below"===E&&(0,o.createElement)("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky",style:{backgroundColor:T}},N))}))}}]);