import{a as e,I as l,E as c,D as o,J as m,i as p,K as d,N as u,Q as g,B as k,U as _,X as y,G as b}from"./app.BpcE4wZo.js";import{M as w}from"./MerchandiseModal.CBu7RW1P.js";import{S as B,M as S}from"./StackedMerchandisePreview.CtRvezo1.js";function f({quantityTitle:n,open:t,onPress:i}){return e(m,{expanded:t,onPress:i,children:e(l,{blockAlignment:"center",spacing:"small400",children:[e(c,{tone:"accent",children:n}),e(o,{size:"small-200",tone:"accent",type:t?"chevron-up":"chevron-down"})]})})}function v({targetMerchandiseLines:n,selectedDeliveryMethod:t,merchandiseQuantityText:i,modalHeader:a}){return e(m,{overlay:e(w,{merchandiseLines:n,deliveryMethod:t,modalHeader:a,shouldRightAlignPrice:!0}),children:e(l,{blockAlignment:"center",children:[n.length>1?e(B,{merchandiseItem:n[0],merchandiseLinesLength:n.length}):e(S,{merchandiseItem:n[0],hideBadge:!0}),e(l,{spacing:"small500",blockAlignment:"center",children:[e(o,{tone:"accent",type:"truck",size:"small"}),e(c,{tone:"accent",size:"small",children:i})]})]})})}function I(){const n=p(),[t,i]=d(!1),{selectedDeliveryMethod:a}=u();if(!a)return null;const r=a.priceBreakdown??[];return e(b,{children:[e(c,{color:"subdued",children:e(l,{blockAlignment:"center",spacing:"small500",children:[e(o,{type:"truck"}),n("shipping.split_shipping_shipment_notice",{quantity_shipments:e(f,{quantityTitle:n("shipping.split_shipping_multiple_shipment_quantity_label",{quantity:r.length},"%{quantity} shipments"),open:t,onPress:()=>i(s=>!s)})},"Your order will arrive in %{quantity_shipments}")]})}),e(g,{open:t,id:"shipmentBreakdown",children:[e(k,{spacing:"small100"}),e(_,{spacing:"small100",children:r.map(({targetMerchandiseLines:s},h)=>e(v,{targetMerchandiseLines:s,selectedDeliveryMethod:a,merchandiseQuantityText:n("order_summary.discount_discovery.merchandise_quantity_label",{count:y(s)},{one:"%{count} item",other:"%{count} items"}),modalHeader:n("shipping.split_shipping_merchandise_shipment_number",{number:h+1,total:r.length},"Shipment %{number} of %{total}")},h))})]})]})}export{I as S};