var _____WB$wombat$assign$function_____=function(name){return (globalThis._wb_wombat && globalThis._wb_wombat.local_init && globalThis._wb_wombat.local_init(name))||globalThis[name];};if(!globalThis.__WB_pmw){globalThis.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}var window = _____WB$wombat$assign$function_____("window");
var self = _____WB$wombat$assign$function_____("self");
var document = _____WB$wombat$assign$function_____("document");
var location = _____WB$wombat$assign$function_____("location");
var top = _____WB$wombat$assign$function_____("top");
var parent = _____WB$wombat$assign$function_____("parent");
var frames = _____WB$wombat$assign$function_____("frames");
var opener = _____WB$wombat$assign$function_____("opener");
import{i as v,bk as f,bc as P,bo as x,a as e,aJ as E,bf as I,G as L,bp as _,d as A,bq as D,bh as k,bi as M,z as B,bd as w,U as O,aF as C,br as G,bs as N,bt as F,a7 as z,bu as H,bv as U,bw as R,aG as q,aH as J,E as V,be as W}from"./app.ZXowmuNl.js";import{S as Y,M as Z}from"./StackedMerchandisePreview.aoM-w7_c.js";function m({lines:d,hideThumbnail:y,shippingTime:l}){const o=v(),{asyncDeliveryPromiseExperienceEnabled:g}=f(),{deliveryExpectationLines:c}=P(),h=x(),p=s=>{const i=s.methods.find(({handle:S})=>S===s.selectedDeliveryMethodHandle);if(!i)return null;const{handle:n,cost:t,costAfterDiscounts:a,brandedPromise:r,estimatedTimeInTransit:b}=i,u=i.methodType==="LOCAL",{deliveryExpectation:T}=_(i,c||[],!!(g||r));return e(O,{spacing:"small400",children:e(A,{children:[e(D,{methodTitle:k({deliveryMethod:i,localDelivery:u?o("shipping.local_delivery","Local delivery"):void 0}),showInterpunct:!0,price:e(M,{cost:t,costAfterDiscounts:a,inlineDiscount:!0})}),l?e(B,{color:"subdued",size:h?void 0:"small",children:l}):e(w,{deliveryMethod:i,deliveryExpectationLine:T,estimatedTimeInTransit:b})]})},n)};return e(L,{children:d.map(s=>{const i=E(s.targetMerchandiseLines??[]);return i.slice(0,1).map(n=>e(I,{columns:["auto","auto"],spacing:"large100",blockAlignment:"center",children:[!y&&(i.length>1?e(Y,{merchandiseItem:n,merchandiseLinesLength:i.length}):e(Z,{merchandiseItem:n,hideBadge:!0})),p(s)]},n.id))})})}const j=5;function X(){const d=v(),y=C(),{value:l}=G(),{selectedMacro:o}=N(),g=F.usePreload();if(z(()=>{g()},[]),l?.status!=="filled")return null;const c=H(l.lines).filter(U),{oneTimePurchaseLines:h}=R(c),{buyWithPrimeLines:p,shipsNowLines:s,shipsLaterLines:i}=q(c),n=J(c),t=h.length===1;if(h.length>j&&o&&o){const{cost:a,costAfterDiscounts:r,title:b,deliveryPromisePresentmentTitle:u}=o;return e(L,{children:[e(D,{methodTitle:b,showInterpunct:!0,price:e(M,{cost:a,costAfterDiscounts:r,styleOverrides:{textSize:"small",freeTextLetterCase:"uppercase",costSpacing:"none"}})}),u&&e(V,{color:"subdued",children:u.long})]})}return e(W,{spacing:"small200",children:[p?.length?e(m,{lines:p,hideThumbnail:t}):null,s?.length?e(m,{lines:s,hideThumbnail:t}):null,i?.length?e(m,{lines:i,shippingTime:d("shipping.pre_order_ships_later","Ships later"),hideThumbnail:t}):null,n?.map(([a,r])=>r.length?e(m,{lines:r,shippingTime:d("shipping.pre_order_ships_date",{date:y(new Date(a),{timeZone:"UTC",month:"short",day:"numeric"})},"Ships %{date}"),hideThumbnail:t},a):null)]})}export{X as default};