1import{u as e,S as n,o as i,T as t,w as a,s,k as r,q as o,g as l,p as d}from"./2c1ab0fe.Bf8FS-kA.js";import{j as c,bB as u,S as p,bT as m,f as h,t as g,L as v,M as b,aj as y,ab as f,H as _,d as C,k as T,a2 as S,aC as x,b as M,m as P,B as w,bA as L,v as j,aq as k,aS as D,aH as I,a1 as O,au as A,U as E}from"./164ad2e3.D0nOfU9-.js";import{C as R,a as B,b as H}from"./efa0389a.WJQGJ9HI.js";import{C as q,u as z}from"./4b1c22b7.BASQngy4.js";import{c as F,aQ as G,e2 as Q,_ as N}from"./4b4bc88f.DcJe9bVW.js";import{I as V}from"./55098bf1.BWRIbi3t.js";import{E as U,M as $,d as Z,u as K}from"./64de7b49.CoyEsjAj.js";import{u as W,a as J,i as X,c as Y,m as ee}from"./181d38d3.B-Rn_aAW.js";import{B as ne,u as ie,S as te,E as ae,a as se,p as re}from"./347b440c.SeAcXxcL.js";import{B as oe,D as le}from"./8d3a12c3.Cs2WBhqo.js";import{g as de,a as ce}from"./0e4087ec.CHtimU8c.js";import{u as ue}from"./app.C_ntWzAC.js";import{S as pe}from"./8e79be58.BLmAAEWw.js";import{g as me}from"./792bb671.B3OvVnSg.js";import"./d0bb51ec.CL_3Kdjr.js";import"./f67abd2c.CMIDVCe_.js";import"./60a453ce.0K3_0kXS.js";import"./e12db40c.B4InVJ1F.js";import"./9dba8418.CZTcH8_l.js";import"./22345fd4.v5I5uNqg.js";import"./9ce08e25.SbAKfAes.js";import"./9f3d9f8c.CI_BbbsS.js";import"./4aab4b34.CQQ12fu3.js";import"./3ca8ef7e.C6XOR-ST.js";import"./a422df8c.C_n6Vcf8.js";import"./47b970b2.Dc6LZ4kt.js";import"./a9fa9fda.ChMkqhXw.js";import"./ca3e798e.Dc6mNaNz.js";function he({summary:n}){const{transitText:i,brandedPromise:t,shipmentCountText:a}=n;return i||a?e(p,{direction:"inline",gap:"small-300",alignItems:"center",children:[i?e(c,{color:"subdued",children:i}):null,t?e(ne,{brandedPromise:t}):null,i&&a?e(c,{color:"subdued",accessibilityVisibility:"hidden",children:u}):null,a?e(c,{color:"subdued",children:a}):null]}):null}function ge({selectedShippingMethod:i}){const{i18n:t}=F(),{deliveryExpectationLines:a}=ie(),{cost:s,costAfterDiscounts:r,hideDiscountedTotalOnShippingSelector:o}=i,l=m({deliveryMethod:i,localDelivery:"LOCAL"===i.methodType?t.translate("shipping.local_delivery"):void 0}),d=a?.find(e=>e.deliveryStrategyHandle===i.handle),c=s&&r?e(n,{children:[u,e(se,{cost:s,costAfterDiscounts:r,inlineDiscount:!0,preDiscountCost:o})]}):null;return e(n,{children:[e(p,{direction:"inline",gap:"small-400",children:[e(te,{methodTitle:l}),c]}),e(ae,{deliveryMethod:i,deliveryExpectationLine:d,paragraphColor:"subdued"})]})}function ve({selectedShippingMethod:n,rollupOpen:i}){const{i18n:t}=F();return i?e(h,{color:"subdued",children:t.translate("shipping.shipping_method_title")}):e(p,{children:e(ge,{selectedShippingMethod:n})})}function be({shippingMethods:n,type:i,id:t,displayOnly:a=!1}){const[s]=g({type:i,id:t}),{includedMethods:r}=W().value,o=r.size?n.map(e=>r.has(e)?J(e):e):n,l=a?o[0]:o.find(({handle:e})=>e===s);return l?e(q.Provider,{value:!0,children:e(R,{presentation:"base",children:a?e(ve,{selectedShippingMethod:l}):e(p,{gap:"small-400",paddingBlockStart:"small-400",children:[e(ve,{selectedShippingMethod:l,rollupOpen:!0}),e(pe,{type:i,methods:o,id:t,isInSplitCartModal:!0})]})})}):null}function ye({merchandise:s,oneTimePurchaseIndex:r,oneTimePurchaseTotalCount:o}){const l=i(!1),d=i(!1),{i18n:c}=F(),u=s.length,{totalQuantity:m,firstFiveQuantity:g}=t(()=>s.reduce((e,n,i)=>{const t=n.quantity??0;return e.totalQuantity+=t,i<2&&(e.firstFiveQuantity+=t),e},{totalQuantity:0,firstFiveQuantity:0}),[s]),T=c.translate("shipping.split_shipping_merchandise_quantity_label_standard",{quantity:m});return e(f,{gridAutoFlow:"column",gridAutoColumns:"minmax(auto, max-content)",gridTemplateColumns:"minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-100",alignItems:"center",alignContent:"center",children:[e(a,{when:d,fallback:e(n,{children:[e(p,{direction:"inline",gap:"small-300",children:s.slice(0,2).map(n=>e($,{merchandiseItem:n},n.stableId))}),e(v,{onClick:()=>{u>2?l.value=!0:d.value=!0},children:u>2?c.translate("shipping.split_shipping_merchandise_quantity_label_additional",{quantity:m-g}):c.translate("shipping.split_shipping_merchandise_quantity_label_standard",{quantity:m})})]}),children:e(U,{merchandise:s})}),e(b,{heading:e(n,{children:[e(_,{level:1,children:T}),e(C,{blockSize:"small-500"}),e(h,{color:"subdued",children:r&&o?c.translate("shipping.split_shipping_merchandise_shipment_number",{number:r,total:o}):c.translate("order_summary.subscriptions")})]}),open:l.value,onHide:()=>l.value=!1,accessibilityLabel:T,children:[e(y,{}),e(f,{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gridAutoRows:"minmax(0, 1fr)",gap:"small-100",padding:"base none none none",children:e(U,{merchandise:s})})]})]})}function fe({merchandise:n,oneTimePurchaseIndex:i,oneTimePurchaseTotalCount:t}){const o=T(),l=s(n.length>1),d=r(()=>S(o.value.currentDetour)),c=r(()=>l.value&&d.value);return e(a,{when:c,fallback:e(U,{merchandise:n,thumbnailSize:d.value?"small":"base",merchandiseItemGap:d.value?"small-200":"base",thumbnailContentGap:d.value?"small-200":"base"}),children:e(ye,{merchandise:n,oneTimePurchaseIndex:i,oneTimePurchaseTotalCount:t})})}function _e({line:i,oneTimePurchaseIndex:t,oneTimePurchaseTotalCount:a,disableBorders:s=!1,heading:r}){const{id:o,type:l,methods:d,targetMerchandiseLines:c}=i,u=x(c??[]),{currentDetour:p}=T().value,m=S(p);return e(M,{className:"eK58p","data-delivery-line-id":o,background:"base",colorLayer:"control",border:s?"none":"base",borderRadius:s?"none":"base",children:[r&&e(n,{children:[e(M,{padding:"base",children:e(_,{level:3,children:r})}),e(y,{accessibilityRole:"presentation"})]}),e(M,{padding:"base",children:e(f,{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(auto, max-content) minmax(0, 1fr)",gridAutoRows:"1fr",gap:"small-100",children:[e(fe,{merchandise:u,oneTimePurchaseIndex:t,oneTimePurchaseTotalCount:a}),e(be,{shippingMethods:d,type:l,id:o,displayOnly:m})]})})]})}function Ce({lines:i,heading:t,customNode:a,isSingleCard:s=!1,get
1Sequence:r,showExtendedHeading:o=!1,oneTimePurchaseTotalCount:l}){const{i18n:d}=F(),c=i.length,m=T(),h=Z(),{presentsConsolidatedShipping:g}=W().value;if(!c)return null;const v=i.map((c,p)=>{const v=Boolean(a),b=p+1!==i.length,f=s&&(v||b),_=r(c);return e(n,{children:[e(_e,{line:c,disableBorders:s,heading:(()=>{if(S(m.value.currentDetour)||h.value)return;const e=o?t:void 0;if(g)return e;const n=d.translate("shipping.split_shipping_shipment_number",{number:_});return e?`${n} ${u} ${e}`:n})(),oneTimePurchaseIndex:p+1,oneTimePurchaseTotalCount:l},c.id??ue()),f&&e(y,{})]},c.id)});return a&&v.push(a),e(M,{colorLayer:"control",children:e(f,{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",gap:"small-200",children:e(p,s?{gap:"base",children:e(M,{overflow:"hidden",border:"base",borderRadius:"base",children:v})}:{gap:"large-200",children:v})})})}function Te({shippingGroupLines:n,oneTimePurchaseTotalCount:i}){const{i18n:s,shop:{name:l}}=F(),{buyWithPrimeLines:d,shipsNowLines:c,shipsLaterLines:u}=t(()=>de(n),[n]),m=t(()=>ce(n),[n]),h=t(()=>{let e=[...d,...c,...u];return m&&(e=[...e,...m.reduce((e,[,n])=>[...e,...n],[])]),e},[d,c,u,m]),g=o(e=>h.indexOf(e)+1,[h]),v=t(()=>d.length>0?s.translate("shipping.split_shipping_shipped_by_shop",{shop_name:l}):s.translate("shipping.pre_order_ships_now"),[d.length,s,l]),b=T(),y=r(()=>S(b.value.currentDetour)),f=u.length>0||!!m&&m?.length>0;return e(p,{gap:"large-200",children:[d.length>0&&e(Ce,{lines:d,getSequence:g,heading:s.translate("split_shipping.shipped_by_amazon_prime"),oneTimePurchaseTotalCount:i,customNode:e(a,{when:y,children:e(M,{padding:"small-100 base",children:e(oe,{})})}),isSingleCard:!0,showExtendedHeading:f}),c.length>0&&e(Ce,{lines:c,getSequence:g,heading:v,oneTimePurchaseTotalCount:i,showExtendedHeading:f}),u.length>0&&e(Ce,{lines:u,getSequence:g,heading:s.translate("shipping.pre_order_ships_later"),oneTimePurchaseTotalCount:i,showExtendedHeading:f}),m?.map(([n,t])=>t.length>0&&e(Ce,{lines:t,getSequence:g,heading:s.translate("shipping.pre_order_ships_date",{date:s.formatDate(new Date(n),{timeZone:"UTC",month:"long",day:"numeric",year:"numeric"})}),oneTimePurchaseTotalCount:i,showExtendedHeading:f},n))]})}const Se="more-shipping-options-modal";function xe({deliveryLines:n,openAtDeliveryLineId:t,onOpen:a,onClose:s}){const{i18n:u}=F(),m=u.translate("shipping.shipping_method_title"),h=P(),g=l(),v=W(),{total:_,presentsConsolidatedShipping:C}=v.value,T=i(!1),S=i(""),x=r(()=>{const{total:e,presentsConsolidatedShipping:n}=v.value;return n&&e?u.translate("order_summary.shipping_total_updated_label_with_price",{totalPrice:u.formatCurrency(e.amount,{currency:e.currencyCode,form:"name"})}):null}),L=l(null);d(()=>{if(!T.value)return L.current=null,void(S.value="");const e=x.value;if(!e)return void(S.value="");const n=L.current;L.current=e,n&&e!==n&&(S.value=e)});const j=Se,k=o(()=>{if(!t)return;const e=Array.from(document.getElementById(j)?.querySelectorAll("[data-delivery-line-id]")??[]).find(e=>e.dataset.deliveryLineId===t),n=window.matchMedia("(prefers-reduced-motion: reduce)").matches;e?.scrollIntoView({block:"start",behavior:n?"instant":"smooth"})},[t,j]),D=e(w,{variant:"primary",inlineSize:"fill",command:"--hide",commandFor:j,onClick:async()=>{await g.current,h("moreShippingOptions",{timestamp:new Date,subEvent:"modalSave"})},children:u.translate("payment.saved_credit_cards_modal.done")});return e(b,{heading:m,onShow:()=>{L.current=x.peek(),S.value="",T.value=!0,h("moreShippingOptions",{timestamp:new Date,subEvent:"modalOpen"}),a?.()},onAfterShow:k,onHide:async()=>{T.value=!1,g.current=s(),await g.current,h("moreShippingOptions",{timestamp:new Date,subEvent:"modalClose"})},id:j,footer:C?e(M,{background:"base",children:[e(y,{}),e(M,{paddingBlock:"base",paddingInline:"large-200",children:e(p,{gap:"base",children:[_&&e(f,{gridTemplateColumns:"1fr auto",gap:"base",children:[e(c,{type:"strong",children:u.translate("order_summary.multiple_shipping_lines_label")}),e(c,{type:"strong",translate:!1,children:u.formatCurrency(_.amount,{currency:_.currencyCode})})]}),e(M,{accessibilityVisibility:"exclusive",accessibilityRole:"status",children:S.value}),D]})})]}):void 0,padding:C?"none":"base",children:C?e(M,{paddingBlockStart:"base",paddingBlockEnd:"large-200",paddingInline:"large-200",children:e(Te,{shippingGroupLine
1s:n})}):e(p,{gap:"large-200",padding:"none none large-200 none",children:[e(Te,{shippingGroupLines:n}),D]})})}function Me({shopPromiseSummary:e,isPreOrder:n,formattedTimeInTransit:i,fallbackText:t}){return e?e.deliveryPromiseText:n?void 0:i??t}const Pe={border:"none",background:"transparent",backgroundSelected:"base"};function we({deliveryLines:s,deliveryMacrosOmitted:l=!1}){const{checkout:d,i18n:u}=F(),{negotiate:m}=j(),{deliveryMacros:h,deliveryLines:g}=d.negotiator.parts,v=i(!1),b=h.value,C=i(),T=i(),{selectedMacro:S,setSelectedMacro:x}=k(),w=S?.id,q=P(),U=z(),$=r(()=>G({checkout:d})),J=s.every(e=>1===e.methods.length),ne=v.value&&!S,te=Z(),ae=W(),oe=function(e,n,i){const{shop:t,i18n:a,checkout:{negotiator:s}}=F(),{deliveryMacros:r}=s.parts,o=L(),{deliveryExpectationLines:l}=ie(),d=new Map,c=r.value;if(!t.marketDrivenShippingEnabled||!c?.length)return d;const{shipsLaterLines:u}=de(e),p=ce(e),m=Boolean(u.length||p?.length),h=c.map(n=>{const i=new Set(Object.values(n.deliveryMethodHandles)),t=e.map(e=>({line:e,method:e.methods.find(({handle:e})=>i.has(e))})).filter(X);return{macro:n,resolvedMethods:t.map(({method:e})=>e).filter(e=>Boolean(e)),count:Y(t).length}}),g=h.find(({macro:e})=>e.id===n)??h[0],v=i>0?1===i:1===g?.count;for(const{macro:b,resolvedMethods:y,count:f}of h){if(f>1&&b.id===n)continue;const e=me({selectedMethods:y,deliveryExpectationLines:l??[],deliveryPromiseText:b.deliveryPromisePresentmentTitle?.short}),i=ee(y),t=Me({shopPromiseSummary:e,isPreOrder:m,formattedTimeInTransit:i?o(i)??void 0:void 0,fallbackText:b.deliveryPromisePresentmentTitle?.long}),s=v&&f>1?a.translate("shipping.split_shipping_multiple_shipment_quantity_label",{quantity:f}):void 0;d.set(b.id,{...t&&{transitText:t},...e?.brandedPromise&&{brandedPromise:e.brandedPromise},...s&&{shipmentCountText:s}})}return d}(s,w,ae.value.groups.length),ue=ae.value.groups.length,pe=ue>0?ue:s.length,ge=$.value||te.value,ve=s.length>=Q&&!U&&(ge||pe>1),be=l?ve:T.value??ve,ye=o(()=>{void 0===T.value&&(T.value=ve)},[T,ve]),{customizationsBefore:fe,customizationsAfter:_e}=K({targeted:!0,hasMultipleDeliveryGroups:!0}).value,Ce=t(()=>w?[w]:[],[w]),Te=o(async([e])=>{e&&(ye(),await x(e),q("deliveryMacroInteraction",{timestamp:new Date,subEvent:"delivery_macros_input_change"}))},[q,ye,x]),we=e=>{ye(),C.value=e?s.find(n=>n.methods.includes(e))?.id:void 0},Le=t(()=>({groupType:D("ONE_TIME_PURCHASE"),includeDeliverySelectionGroups:!J}),[J]);if(!b?.length&&!l)return null;const je=e(f,{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",children:e(I,{padding:U?"base none small-300 base":"base",borderRadius:"none none base base",onClick:we,commandFor:Se,children:e(f,{justifyItems:U?"start":"center",justifyContent:U?"start":"center",alignItems:"center",alignContent:"center",children:e(p,{direction:"inline",gap:"small-100",children:[U&&e(O,{type:"plus",tone:"accent"}),e(c,{type:U?"generic":"strong",tone:"accent",children:u.translate("shipping.split_shipping_more_shipping_options")})]})})})});let ke;if(l){const i=re(g.value);ke=e(n,{children:[e(le,{selectedDeliveryMethodHandles:s.map(e=>e.id?i.get(e.id):void 0),deliveryLines:s,choiceListContext:!1,bare:U,shipmentGroups:ae.value.groups,includedMethods:ae.value.includedMethods,shipmentCommandFor:Se,onShipmentClick:we}),!J&&e(n,{children:[!U&&e(y,{}),je]})]}),U||(ke=e(M,{background:"base",colorLayer:"control",border:"base",borderRadius:"base",padding:"none",children:ke}))}else if(J){const[n]=b;if(!n)return null;const i=oe.get(n.id),t=i&&(i.transitText||i.shipmentCountText)?e(he,{summary:i}):void 0;ke=1===ue?e(R,{...U?Pe:{},children:e(B,{variant:"block",name:"delivery-macros",values:[n.id],hideRadioControl:!0,children:e(H,{value:n.id,secondaryContent:0!==n.cost.amount&&e(se,{cost:n.cost,costAfterDiscounts:n.costAfterDiscounts,styleOverrides:{freeTextLetterCase:"uppercase",costSpacing:"none"}}),details:t,children:n.title})})}):e(M,{background:"base",colorLayer:"control",border:"base",borderRadius:"base",padding:"none",children:e(le,{selectedDeliveryMethodHandles:Object.values(n.deliveryMethodHandles),deliveryLines:s,choiceListContext:!1,isS
1haredRate:n.isSharedRate,shipmentGroups:ae.value.groups,includedMethods:ae.value.includedMethods,shipmentCommandFor:Se,onShipmentClick:we})})}else ke=e(R,{...U?Pe:{},children:e(B,{variant:"block",name:"delivery-macros",values:Ce,onChange:Te,blockFooter:je,children:b.map(n=>{const{id:i,title:t,cost:a,costAfterDiscounts:r}=n,o=ne?void 0:oe.get(i),l=o?[t,o.transitText,o.shipmentCountText].filter(Boolean).join(", "):t;return e(H,{value:i,selectedContent:e(le,{selectedDeliveryMethodHandles:Object.values(n.deliveryMethodHandles),deliveryLines:s,isSharedRate:n.isSharedRate,macroTitle:n.title,shipmentGroups:ae.value.groups,shipmentCommandFor:Se,onShipmentClick:we,includedMethods:ae.value.includedMethods}),selectedContentPadding:"none",secondaryContent:ne?e(A,{inlineSize:"5ch"}):0!==a.amount&&e(se,{cost:a,costAfterDiscounts:r,styleOverrides:{freeTextLetterCase:"uppercase",costSpacing:"none"}}),accessibilityLabel:l,children:ne?e(A,{inlineSize:"12ch",children:t}):e(p,{children:[e(c,{children:t}),o?e(he,{summary:o}):null]})},i)})})});return e(V,{impressionType:"delivery_macros",impressionFeatures:b.map(({id:e})=>e),children:e(p,{gap:"base",paddingBlockStart:U||be?"none":"small-100",children:[be&&e(p,{direction:"inline",alignItems:"center",gap:"small-400",children:[e(O,{type:"truck"}),e(c,{color:"subdued",children:ge?u.translate("shipping.split_shipping_multiple_shipment_notice"):u.translate("shipping.split_shipping_shipment_count_notice_one_time_purchase",{count:pe})})]}),e(a,{when:$,children:e(_,{level:3,children:u.translate("shipping.shipping_method_first_shipment_group_title.other")})}),e(E,{customizations:fe,options:Le}),ke,e(xe,{deliveryLines:s,openAtDeliveryLineId:C.value,onClose:()=>(v.value=!0,m({silenceViolations:N(["deliveryNext"]),onComplete:()=>{v.value=!1}}))}),e(E,{customizations:_e,options:Le})]})})}export{Pe as DELIVERY_MACRO_VAULTED_STYLE_OVERRIDES,we as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.