1import{c as e,b9 as n,W as t,as as r,ar as i,cI as o,d4 as a,d5 as s,ad as l}from"./9dba8418.nSn06qNc.js";import{c}from"./f67abd2c.BiDTv4D9.js";import{g as d,h as u,T as m,z as h,u as p,a7 as f,S as y,_ as g,N as v,m as b}from"./2c1ab0fe.Bywc2Brn.js";import{cK as P,bv as _,j as x,f as C,S as T,bH as S,bu as z,b as L,bJ as w,G as E,a0 as k}from"./164ad2e3.Bn4mVc0u.js";import{g as I,p as D,T as M}from"./9ce08e25.XYYnIMRV.js";function B(){const{shop:{asyncDeliveryPromiseExperienceEnabled:r},observability:i,checkout:{negotiator:o}}=e(),{value:a}=o.current.fields.deliveryExpectations,s=n("deliveryExpectations").value,{value:l}=o.current.fields.deliveryNext,c=n("deliveryNext").value,m=d();return u(()=>{if(!s&&"filled"===l?.status&&"filled"===a?.status&&m.current&&(m.current(),m.current=void 0),"filled"===l?.status&&s){const e=performance.now();m.current=()=>{const n=performance.now()-e;i.histogram({name:"delivery_expectations_loading_duration",value:n})}}},[a?.status,l?.status,c,s,i]),{deliveryExpectationLines:(()=>{const e=a?.deliveryExpectationLines?.some(({brandedPromise:e})=>e?.handle===t.BuyWithPrime);if("filled"===a?.status&&(r||e))return a?.deliveryExpectationLines})(),deliveryExpectationLinesLoading:void 0===a,status:a?.status}}function A(e){if(e.length<2)return!1;const n=e.map(e=>{const n=r(e);return n?i(n):void 0}),[t]=n;return Boolean(t&&n.every(e=>e===t))}function O(e){const n=[],t=new Map;for(const r of e){const e=o(r)??r.methods[0],a=e&&i(e),s=a?t.get(a):void 0;if(s)s.push(r);else{const e=[r];a&&t.set(a,e),n.push(e)}}return n.length===e.length?e:n.map(e=>{const n=e[0];return 1===e.length&&n?n:function(e){const n=a(e.map((e,n)=>({index:n,rate:e})),W).rate,t=e.flatMap(e=>e.targetMerchandiseLines??[]),r=o(n)??n.methods[0];return{...n,methods:r&&r!==n.methods[0]?[r,...n.methods.filter(e=>e!==r)]:n.methods,targetMerchandiseLines:t.length?t:n.targetMerchandiseLines}}(e)})}function W(e){const n=o(e)??e.methods[0],t=n?.priceBreakdown?.map(({amount:e})=>e.amount);return t?.length?Math.max(...t):n?.cost.amount??0}function j(e){const n=new Map;for(const t of e){const e=t.fields.id.value,r=t.fields.deliveryMethodHandle.value;e&&r&&n.set(e,r)}return n}function H(e,n){return e.map(e=>{const t=e.id?n.get(e.id):void 0;return{line:e,method:e.methods.find(({handle:e})=>e===t)}})}function U(e,n,t=(e,n)=>i(n)){const r=n.map(({line:e,method:n},r)=>({lineIndex:r,amountCombinabilityToken:n?t(e,n):void 0,amount:n?.cost.amount})),o=new Set;return e.forEach((e,n)=>{for(const i of e.methods){const a=i.cost.amount,s=t(e,i);s&&(r.some(e=>e.lineIndex!==n&&e.amountCombinabilityToken===s&&void 0!==e.amount&&(e.amount>a||e.amount===a&&e.lineIndex<n))&&o.add(i))}}),o}function $(e){const[n]=e;if(!n)return;const{priceBeforeDiscounts:t,priceAfterDiscounts:r}=c(e.map(e=>({costBeforeDiscounts:e.cost.amount,cost:e.costAfterDiscounts.amount,amountCombinabilityToken:i(e)})));return{totalCost:{amount:t,currencyCode:n.cost.currencyCode},totalCostAfterDiscounts:{amount:r,currencyCode:n.costAfterDiscounts.currencyCode}}}function N(e){const n=m(()=>I(e),[e]);return{theme:m(()=>D(n),[n])}}function F({brandedPromise:e,useCompactLogo:n}){const t=d(null),[r,i]=h(null);u(()=>{i(t.current)},[t]);const{theme:o}=N(r),a=X(o,e,t,n);return p("div",{ref:t,className:"Hlr02",children:a})}const X=(e,n,t,r)=>{if(e&&t.current){const t=K(e,n,r);if(t)return p(P,{src:t,alt:n.name,aspectRatio:"auto",className:R(n,t,r)})}return null},K=(e,n,t)=>{const r=e===M.Dark?"dark":"light";return n[`${r}Theme${t?"CompactLogoUrl":"LogoUrl"}`]||n[`${r}ThemeLogoUrl`]||n.logoUrl||""},R=(e,n,t)=>{if(((e,n)=>"shop_promise"===e.handle&&n.includes("shop_promise_2026"))(e,n))return t?"jrKZE":"TtorW"};function q({methodTitle:e,price:n,showInterpunct:t=!1,sellingPlan:r}){const i=p("bdi",{children:e});return p(G,n&&t&&r?{children:[i,_,n,p(x,{type:"strong",children:r})]}:t&&n?{children:[i,_,n]}:{children:i})}function G({children:e}){const n=f.toArray(e).flatMap((e,n,t)=>n<t.length-1?[e,"Â "]:e);return p(C,{children:p(x,{type:"strong",children:n})})}const J=void 0,V=!0,Z="small400";function Q({cost:n,costAfterDiscounts:t,included:r=!1,inlineDiscount:i,preDiscountCost:o=!1,styleOverrides:a={}}){const{shop:c,i18n:d}=e(),u=!c.hasFlagEnabled(s),{textSize:m=J,shouldBold:h=V,freeTextLetterCase:f="uppercase",costSpacing:g=Z}=a,v=h?"strong":void 0,{amount:b}=n,{amount:P}=t,_=u&&b>P,C=e=>e?p(x,{accessibilityVisibility:"exclusive",children:e}
1):null,z=({cost:e,accessibilityContext:n,isOriginalPrice:t=!1})=>{const r=0===e.amount;let o=m;return t&&(o=i?"base":"small"),p(y,r?{children:[C(n),p(x,{type:v,size:o,letterCase:f,children:d.translate("shipping.free_rate_label")})]}:{children:[C(n),p(x,{type:t?"redundant":v,color:t?"subdued":void 0,size:o,translate:!1,children:d.formatCurrency(e.amount,{currency:e.currencyCode})})]})},L=z({cost:t,accessibilityContext:_?d.translate("order_summary.price_after_discount_aria_text"):void 0});if(r&&P>0){const e=z({cost:t,accessibilityContext:d.translate("order_summary.original_price"),isOriginalPrice:!0}),n=p(S,{size:m,strong:h});return p(T,i?{direction:"inline",display:"inline",gap:l(g),alignItems:"baseline",children:[e,n]}:{gap:l(g),alignItems:"end",children:[e,n]})}if(o)return z({cost:n,accessibilityContext:d.translate("order_summary.original_price")});if(_){const e=z({cost:n,accessibilityContext:d.translate("order_summary.original_price"),isOriginalPrice:!0});return p(T,i?{direction:"inline",display:"inline",gap:l(g),alignItems:"baseline",children:[e,L]}:{gap:l(g),alignItems:"end",children:[e,L]})}return L}var Y=(e=>(e.Sync="Sync",e.Async="Async",e))(Y||{});const ee=new Map([[t.BuyWithPrime,"Sync"],["shop_promise","Async"]]);function ne({show:e,children:n,from:t={opacity:0},to:r={opacity:1},options:i={duration:500,fill:"forwards"},onStart:o,onEnd:a,animateOnShow:s=!0,animateOnHide:l=!0,unmountOnHide:c=!0}){const m=d(null),[f,y]=h(e),v=()=>{y(!1),a?.()},b={duration:500,fill:"forwards",...i};return g(()=>{if(f&&s){const e=m.current;if(e&&"function"==typeof e.animate)try{e.animate([t,r],b)}catch{}}},[f,s]),u(()=>{const n=m.current;if(e)o?.(),y(!0);else if(l&&n&&"function"==typeof n.animate)try{const e=n.animate([r,t],b);e&&(e.onfinish=v)}catch{v()}else v()},[e,l]),f||!c?p("div",{ref:m,children:n}):null}const te=v(function({timeInTransit:e,price:n,textSize:t,paragraphColor:r}){const i=z()(e);return null===i?null:p(C,{color:r,size:t,children:[p("bdi",{children:n?`(${i})`:i}),n?` · ${n}`:null]})});function re({title:e,price:n,textSize:t,paragraphColor:r}){return p(C,!e&&n?{color:r,children:n}:{color:r,size:t,children:[p("bdi",{children:n?`(${e})`:e}),n?` · ${n}`:null]})}const ie=v(function({timeInTransit:e,title:n,price:t,textSize:r,paragraphColor:i}){return n?p(re,{title:n,price:t,textSize:r,paragraphColor:i}):e?p(te,{timeInTransit:e,price:t,textSize:r,paragraphColor:i}):t?p(C,{color:i,size:r,children:t}):null});function oe(n,t){const{i18n:r}=e(),{brandedPromise:i}=t||{},{deliveryPromisePresentmentTitle:o}=n,{deliveryExpectationPresentmentTitle:a}=t||{},s=o?.short||"",l=o?.long||"",c=(e,n)=>n?e?.handle?n:r.translate("delivery_promise.estimated_delivery_format",{date:n}):"",d=c(i,a?.short),u=c(i,i?.handle?a?.long:a?.short);return{shouldDisplayPlaceholderTitle:Boolean((l||s)&&!u&&!d),deliveryPromiseTitle:u,deliveryPromiseTitleShort:d,deliveryPromisePlaceholderTitle:l,deliveryPromisePlaceholderTitleShort:s}}const ae={ShopPromiseWrapper:"x45Lq",WrapperHeightSmall:"m39UP",Branded:"_5XR55",Unbranded:"PWTWF"};function se({deliveryMethod:n,deliveryExpectationLine:t,estimatedTimeInTransit:r,hideDescription:i,formatContent:o=e=>e,paragraphColor:a,size:s}){const{deliveryPromiseTitle:l,deliveryPromisePlaceholderTitleShort:c,deliveryPromisePlaceholderTitle:m,deliveryPromiseTitleShort:f,shouldDisplayPlaceholderTitle:g}=oe(n,t),[v,P]=h(Boolean(l)),_=d(g),x=d(!1),S=d(null),[z,E]=h(null),{theme:k}=N(z),{observability:I,checkout:D}=e(),{shippingAddress:M}=D.negotiator.parts,B="shop_promise"===t?.brandedPromise?.handle,A=le(k,t?.brandedPromise?.handle),O=D.configuration.layout.isOnePage.value,{short:W,long:j}=t?.deliveryExpectationPresentmentTitle||{};u(()=>{E(S.current)},[S]),u(()=>{if(!x.current&&(W||j)){x.current=!0;const e=M.value.countryCode;I.counter({name:"estimated_delivery_date_rendered",value:1,attributes:{branded:String(B),...e&&{country_code:e}}})}},[W,j,B,M,I]);const H=l||f,U=m||c,$=n.description?.trim()||void 0;return H||U||B||$&&!i?o(p(T,{children:[(H||U||B)&&p("div",{className:b(ae.ShopPromiseWrapper,"small"===s?ae.WrapperHeightSmall:void 0),ref:S,children:[p(ne,{show:g&&!l,options:{duration:300},onEnd:()=>
1P(!0),animateOnShow:!1,children:U&&r||!r?p(y,{children:c&&p(C,{color:a,size:s,children:p(w,{children:c})})}):p(ie,{timeInTransit:r,textSize:O?void 0:"small",paragraphColor:a})}),p(ne,{animateOnShow:_.current,show:v,from:{opacity:0,transform:"translateX(-10px)"},to:{opacity:1,transform:"translateX(0)"},children:p("div",{className:ae[A],children:p(T,{direction:"inline",gap:"small-300",alignItems:"center",children:[p(L,{display:"@media (inline-size >= small) auto, none",children:l&&p(C,{color:a,size:s,children:l})}),p(L,{display:"@media (inline-size >= small) none, auto",children:f&&p(C,{color:a,size:s,children:f})}),B&&t?.brandedPromise&&p(F,{brandedPromise:t.brandedPromise,useCompactLogo:"small"===s})]})})})]}),$&&!i?p(C,{color:a,size:s,children:p("bdi",{children:$})}):null]})):null}const le=(e,n)=>"shop_promise"===n?e===M.Light?"Branded":"":"Unbranded";function ce({deliveryExpectationLine:n,deliveryMethod:t,formatContent:r=e=>e,size:i}){const{observability:o,checkout:{identity:a}}=e(),s="shopPay"===a.current.value,{deliveryPromiseTitle:l,deliveryPromiseTitleShort:c,deliveryPromisePlaceholderTitle:h,deliveryPromisePlaceholderTitleShort:f}=oe(t,n),{deliveryExpectationLinesLoading:g}=B(),v=m(()=>l||c?{long:l,short:c,fallback:!1}:h||f?{long:h,short:f,fallback:!0}:{long:"",short:"",fallback:!1},[h,f,l,c]),b=d(g);return u(()=>{b.current&&!g&&"buy_with_prime"===t.brandedPromise?.handle&&v.fallback&&(o.log("synch_branding_delivery_content_fallback_promise_shown","Fallback delivery promise shown",{is_shop_pay:s}),o.counter({name:"membership_fallback_delivery_promise_text_shown",value:1,attributes:{is_shop_pay:s}}))},[g,t.brandedPromise?.handle,b,s,o,v.fallback]),r(p(T,{direction:"inline",gap:"none small-400",alignItems:"center",children:[g?p(E,{inlineSize:"small"}):p(y,{children:[p(k,{below:"small",children:p(C,{size:i,children:v.long})}),p(k,{above:"extraSmall",children:p(C,{size:i,children:v.short})})]}),t.brandedPromise&&p(F,{brandedPromise:t.brandedPromise,useCompactLogo:"small"===i})]}))}function de(e){const{deliveryMethod:n,deliveryExpectationLine:t}=e,r=n.brandedPromise?.handle??t?.brandedPromise?.handle;return(r?ee.get(r):Y.Async)===Y.Sync?p(ce,{...e}):p(se,{...e})}export{F as B,de as E,q as S,Q as a,U as b,$ as c,O as d,ie as e,A as i,j as p,H as s,B as u};
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.