1import{u as e,o as a,z as t,S as r,T as i,h as s,C as n,p as o,q as l,k as d}from"./2c1ab0fe.qpvfywqb.js";import{de as c,L as u,S as p,a1 as m,j as h,b,R as f,o as g,U as j,i as v,aa as y,a9 as S,bE as C,d as P,df as _,dg as k,aS as R,dh as A,di as I,ab as N,f as w,dj as E,dk as D,G as M,dl as T,dm as x,d5 as F,v as z,dn as L,dp as V,t as O,c5 as G,c6 as B,al as H,dq as U}from"./164ad2e3.DcJn775M.js";import{b as q,c as W,d as $,G as K}from"./6bfea526.WQUqRMom.js";import{e as X,aP as Y,cE as J,bc as Q,cF as Z,W as ee,aa as ae,bf as te,al as re,cG as ie,cH as se,cI as ne,cJ as oe,u as le}from"./4b4bc88f.DkycdxSK.js";import{u as de,R as ce,M as ue,a as pe,b as me,i as he,O as be,c as fe}from"./f8706cb6.PbccX-7u.js";import{K as ge}from"./dfc03c53.J0k3tRlF.js";import{W as je,P as ve,g as ye,a as Se}from"./c10167e6.BM-faetc.js";import{a as Ce,V as Pe,B as _e}from"./86720dbb.CVGIgA6H.js";import{a as ke}from"./f692f62f.0aS5Pgyt.js";import{DeliveryAddressEdit as Re}from"./91811554.DavrkhJI.js";import{b as Ae,C as Ie}from"./efa0389a.BiVLFqoF.js";import{C as Ne}from"./a422df8c.CDURsRjM.js";import{C as we}from"./74835653.Cr7sKbVy.js";import{P as Ee}from"./47b970b2.Bc5Vmfq5.js";import{V as De,u as Me,P as Te,I as xe,a as Fe,b as ze,S as Le,L as Ve}from"./dffdfb34.DKxh4eql.js";import{C as Oe}from"./4b1c22b7.zkM5jsqa.js";import{m as Ge}from"./21cc90a2.DHzOO82q.js";import{u as Be}from"./64de7b49.BnCPa5-S.js";import{h as He}from"./17425706.DtdfKQJ3.js";import"./d0bb51ec.CWfbNPnY.js";import"./app.DH8n-1bp.js";import"./f67abd2c.CNaB0QaR.js";import"./e12db40c.DhbHW8sF.js";import"./9dba8418.4R19B40l.js";import"./60a453ce.DBFo6PRx.js";import"./ac5a19ff.C1i8fdUP.js";import"./598fef4e.C71uub5O.js";import"./e77f7fe0.Bl46DOUC.js";import"./22345fd4.Bc95vVsB.js";import"./cc6ff67d.RYXq9KZi.js";import"./08a3b809.BKNVX2Vm.js";import"./d25d1b95.CoPrVoCi.js";import"./bf513f9c.DfVLzm1y.js";import"./e39bc11c.CaER5qTM.js";import"./7a8217fd.BSo0j5mC.js";import"./8599b02a.D6crYzGJ.js";import"./cf29e63b.B0brOI65.js";import"./0e9ee714.Cnsf3p8Q.js";import"./39921a74.C0GzP1-7.js";import"./e3e348f2.qdNJPs68.js";import"./71ae3d5c.ChDO3fdz.js";import"./ccdf3592.DmQuNZVR.js";import"./71b60e0a.DfPLdYsH.js";import"./24773686.NjNSWG1C.js";import"./1f5e7811.DBGnR3_R.js";import"./ec391382.CmRYZq9D.js";import"./dfca5da5.cHkNyCYM.js";import"./dae24aab.LuzlJRmB.js";import"./79974aab.Cl0DLekt.js";import"./2495faa4.DgGNI16D.js";import"./0e67bd3b.BulkkgyN.js";import"./a25deb9a.B5l1rGH9.js";import"./01973ac7.CzRJWXtH.js";import"./58314944.CL_6FNuP.js";import"./945a08d6.DPoKhjkl.js";import"./7bc8057b.Cjs5rQ1q.js";import"./f1968089.BiyF2g2x.js";import"./2b89a178.DlMzn79y.js";import"./b684bff6.Do6MtAvQ.js";import"./064f6ac1.BoVb1opw.js";import"./6fb6f9d8.BoDxvz0l.js";import"./cb38e5c2.k1ouuKLe.js";import"./1444e6bd.DTqbRn9m.js";import"./cb5cf153.CNHN3NCG.js";import"./55098bf1.CjSE9kMx.js";import"./ed9f2238.Brwxl8Yi.js";import"./78ab3dd0.DsAxQUAi.js";import"./910cd6e2.D9laAOO_.js";import"./347b440c.xpK15B3S.js";import"./9ce08e25.dSvNrRyM.js";import"./181d38d3.C21ZO0gV.js";import"./792bb671.B3OvVnSg.js";import"./d6447d9e.yVMcZZjx.js";import"./f49d4216.Che8BnjU.js";import"./f51e663e.D3CveQI2.js";import"./8e79be58.4pj59tZ-.js";import"./3ca8ef7e.DgXbCH_R.js";import"./90e26f5f.Ac9ME8KB.js";import"./31cc568e.95lmLO5k.js";import"./65f3d4da.Bb3QiqCm.js";import"./2fdb3dd3.BI5ol3i8.js";import"./ca5e9c49.BzUOvyL4.js";
1import"./f3e117aa.CgyApM5y.js";import"./1d34c07e.h4dJAaCz.js";import"./7b0c98ea.B8saOsP6.js";import"./434e3b0a.oup8Ur0H.js";import"./50130ded.CjqsTI7m.js";import"./b9c0319a.8x5xdIiw.js";import"./17e57de1.lSRGFmhc.js";import"./9babe369.DN4Uiit5.js";import"./a9fa9fda.BO9gwssW.js";import"./ca3e798e.XLlup-KR.js";import"./89e2d30a.C7YQuTRu.js";import"./0b8657b8.CeR0nGry.js";import"./d22d2b80.BRIhtVxA.js";import"./f58f39d8.z0CUAjnp.js";import"./e03065ab.V1fBuv4e.js";function Ue({openRedeemablesModal:a,includeStoreCredit:t=!0}){const{checkout:r,i18n:i}=X(),s=q(),n=W(s),o=$(),{canApplyGiftCards:l}=c(),{value:d}=Y(),f=d?.amount||0,g=t&&r.configuration.visibility.showStoreCreditRedemption.value&&0===o.value.length&&n.value;if(!g&&!l||0===f)return null;let j="";return j=l&&g?i.translate("payment.gift_card_store_credit.add_label"):l?i.translate("payment.gift_card_wrapper.add_label"):i.translate("payment.store_credit.add_label"),e(b,{padding:"none small-100",children:e(u,{onClick:a,textDecoration:"none",children:e(p,{direction:"inline",gap:"small-100",alignItems:"center",children:[e(m,{type:"plus",size:"base"}),e(h,{children:j})]})})})}const qe={VALIDATION_ERROR:"Please check your information and try again",SHIPPING_UNAVAILABLE:"Shipping is not available to this address",DISCOUNT_INVALID:"This discount code is not valid",INVENTORY_INSUFFICIENT:"Some items in your cart are no longer available",PAYMENT_METHOD_UNSUPPORTED:"This payment method is not supported",GENERAL_ERROR:"An error occurred. Please try again"};function We({errors:a,onDismiss:t,autoFocus:r}){if(0===a.length)return null;const i=a.map(e=>$e(e));return e(S,{tone:"critical",errorType:y.CheckoutError,onDismiss:t,autoFocus:r,children:1===i.length?e(h,{children:i[0]}):e(p,{gap:"small-200",children:a.map(a=>e(h,{children:$e(a)},`${a.code}-${a.message}`))})})}function $e(e){return e.message||qe[e.code]}function Ke(){const{checkout:a}=X(),t=a.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:r}=a.negotiator.parts,[n]=pe()??[],o=i(()=>J(),[]);return s(()=>{n&&(o.company.value=n)},[o.company,n]),n?e(b,{children:[e(b,{padding:"small-400"}),e(we,{address:r,addressErrors:o,addressType:"shipping",addressSettings:t,editDisabled:!1})]}):null}function Xe({errorSignal:a,isRequired:t,validatePhoneField:r}){const{i18n:i,checkout:{negotiator:s}}=X(),{shippingAddress:l}=s.parts,d=l.value,c=Q(l.fields.phone,a,r),[u,p]=n(!1);if(o(()=>{a.value&&p(!0)}),!u)return null;const m=i.translate("contact.phone_label"),h=i.translate("contact.optional_phone_label");return e(b,{children:[e(b,{padding:"small-400"}),e(Ee,{name:"phone",countryCode:d.countryCode||"",label:t?m:h,hideCountries:!0,required:t,autocomplete:"shipping tel-national",autoFocus:!0,...c})]})}function Ye(){const{hasError:a}=C(Z),{i18n:t,observability:r}=X(),{isSdkAvailable:i,hasPaymentSheetErrorSignal:s,onClick:n,walletName:o}=Je();return i?a?null:e(b,{children:e(u,{onClick:()=>{try{n()}catch(e){s.value=!0,r.error(new Qe(`Error on changing buyer shipping address for wallet ${o}. Details: ${e}`,{cause:e}))}},children:e(p,{direction:"inline",alignItems:"center",children:[e(m,{type:"arrow-up-right",size:"small"}),e(P,{display:"inline",inlineSize:"small-200"}),e(h,{children:t.translate("shipping.add_address")})]})})}):null}const Je=()=>{const e=_().value?ee.BuyWithPrime:ee.AmazonPay,{inMemoryAmazonPayParts:{hasPaymentSheetError:a,sdkStatus:t}}=ae(),r=k(e),i=l(()=>{if(t.value.status!==R.Available)throw new Qe(`SDK is not available for wallet ${e}`);(e===ee.BuyWithPrime?t.value.sdk.buywithprime:t.value.sdk.Pay).changeShippingAddress({amazonCheckoutSessionId:r.value})},[t,r,e]);return{isSdkAvailable:t.value.status===R.Available,hasPaymentSheetErrorSignal:a,onClick:i,walletName:e}};class Qe extends Error{constructor(){super(...arguments),this.name="ChangeAddressLinkError"}}const Ze=["1"];function ea(){const{formattedAddress:a,address:{firstName:t,lastName:r,phone:i,countryCode:s}}=A(["phone","firstName","lastName","company"]),{errorMessages:n,loading:o}=function(){const e=E();return{errorMessages:D(),loading:!e.value}}(),l=n.length>0,{errorSignal:d,validatePhoneField:c,isPhoneRequired:u}=me({loading:o,phone:i,countryCode:s});return e(p,{gap:"base",children:[l&&e(I,{}),e(Ne,{name:"restricted_address_edit",titleHidden:!0,values:Ze,hideRadioControl:!0,children:e(Ae,{value:"1",children:e(N,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"base",alignItems:"start",alignContent:"start",children:e(p,{alignItems:"start",borderRadius:"base",children:e(b,{borderRadius:"base",children:[e(b,{padding:"none",children:[e(w,{children:[t," ",r]}),e(w,{color:"subdued",children:a})]}),e(Ke,{}),e(Xe,{errorSignal:d,isRequired:u,validatePhoneField:c})]})})})})}),e(Ye,{})]})}function aa({children:a}){const{i18n:t}=X(),r=t.translate("taxes.tax_details");return e("section",{"aria-label":r,children:e(p,{direction:"block",gap:"small-200",children:[e(h,{color:"subdued",children:r}),a]})})}function ta({vatNumber:a,edit:t,loading:r}){const{i18n:i}=X();return r?e(M,{inlineSize:"large",size:"base"}):e(T,{accessibilityLabel:i.translate("taxes.vat_number.vaulted",{number:a}),graphic:"check-circle",removable:!0,onRemove:t,children:i.translate("taxes.vat_number.vaulted",{number:a})})}function ra({onAddressDelegation:a}){const{embed:t,i18n:r}=X();return"amazon"===t?.embedder?e(u,{textDecoration:"none",onClick:a,children:e(h,{tone:"accent",children:r.translate("embed.shipping.shipping_options")})}):e(ke,{onClick:a,textLabel:r.translate("contact.new_address_label")})}const ia=new Set(["guest","customerAccount","businessCustomer","sdkCartHints","shopPay"]);function sa(){return H(),null}function na(){const a=function(){const{checkout:{negotiator:e}}=X(),{context:a}=e;return d(()=>{const e=a.cachedMembershipViolations.value?.some(e=>"buy_with_prime"===e.handle);return e?"bwp_membership_violation":null})}();return a.value?e(oa,{errorMessagesType:a.value}):null}function oa({errorMessagesType:a}){const{i18n:t}=X();return"bwp_membership_violation"===a?e(S,{errorType:y.PaymentError,tone:"warning",children:t.translate("shipping.prime_not_available.default")},"shop-pay-buy-with-prime-shipping-error"):null}const la=a=>e(v,{padding:"small-400 none",children:a}),da={DefaultVaultedPaymentRollupContent:function({usesSharedVaultedSelector:i,hasPersistentRedeemablesManagement:s=!1,msiExpandedSlot:n,onSelectedPaymentMethodChange:o}){const{checkout:l}=X(),{paymentLines:d}=l.negotiator.parts,c=d.value.some(e=>"direct"===e.method.type),u=f().value,m=g("purchase.checkout.payment-method-list.render-before"),h=g("purchase.checkout.payment-method-list.render-after"),y=de(),S=a(!1),C=!s,P=(a,t)=>t?y(e(v,{children:a})):a;return e(r,{children:[e(p,{gap:"base",children:[s?null:e(ue,{includeStoreCredit:C,openRedeemablesModal:()=>S.value=!0}),e(je,{children:[e(j,{customizations:m,render:P}),i?e(ge,{msiSlot:n,onSelectedPaymentMethodChange:o}):e(ve,{renderVaultingAgreementInline:!0}),!s&&e(K,{}),e(Ue,{includeStoreCredit:C,openRedeemablesModal:()=>S.value=!0}),e(ce,{includeStoreCredit:C,open:S.value,onClose:()=>S.value=!1}),e(j,{customizations:h,render:P}),e(t,{when:l.configuration.visibility.showPurchaseOrderNumberField,children:e(Ce,{showHeading:!1})})]})]}),u&&!c&&e(b,{padding:"large-100 none",border:"none",children:e(Pe,{})})]})},VaultedBillingAddressRollupContent:function({renderInlineSelector:a=!1}){const{checkout:{identity:t}}=X();if(a){const a=ye({identity:t});return e(a,{renderFormOnly:!0})}return e(_e,{})},DefaultVaultedDeliveryAddressRollupContent:function({embedderErrors:a,onDismissEmbedderErrors:t,showMissingAddressField:r,onAddressDelegation:i,onFirstNamePersisted:s,vatIdFieldMode:n}){const{checkout:o}=X(),l=o.identity.current.value,d=he(o.configuration,l),c=g("Checkout::DeliveryAddress::RenderBefore"),u=g("purchase.checkout.delivery-address.render-after"),m=!E().value,h=x(),f=function({identitySource:a,restrictedAddressLoading:t,onFirstNamePersisted:r}){return"amazonPay"===a||"buyWithPrime"===a?e(t?M:ea,{}):ia.has(a)?e(Re,{onFirstNamePersisted:r}):e(be,{})}({identitySource:l,restrictedAddressLoading:m,onFirstNamePersisted:s}),v=r?null:d?e(p,{gap:"large-200",children:[e(be,{}),e(ra,{onAddressDelegation:i})]}):f;return e(p,{direction:"block",gap:"base",children:[a.length>0&&e(b,{children:e(F,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(We,{errors:a,onDismiss:t,autoFocus:!0})})}),e(j,{customizations:c}),v,e(j,{customizations:u}),h&&e(aa,{children:"vaulted"===n.status?e(ta,{vatNumber:h.taxId.value,edit:n.focus,loading:h.taxId.loading}):e(De,{taxId:h.taxId,applied:h.applied,inputRef:n.inputRef})})]})},VaultedLocalPickupOptionsRollupContent:function({onShowModal:a}){const{shop:t,checkout:{negotiator:i}}=X(),{deliveryNext:s}=i.current.fields,{progressing:n}=z(),o=te("deliveryNext"),l=re(),{value:c,loading:u}=L().value,{value:m,loading:h}=V().value,b=Boolean(c||m),f=u||h,g=l.value&&!n.value&&(o.value||f),j=ie(),v=d(()=>se(s.value)??[]),y=d(()=>t.shipPickupInOneOrderEnabled?j.value&&ne(j.value):v.value[0]),S=y.value?.pickupLocation?[y.value]:[],[C]=O({type:j.value?.type,deliveryMethodType:"PICK_UP"}),P=Me({deliveryMethodType:"PICK_UP",mode:"deliveryMethodScoped"}),_=P.value.merchandiseLines.length>0,k=d(()=>P.value.merchandiseLines),R=G(B(oe)).value;let A;return A=g?e(Te,{hideText:!0,singleItem:!0}):b?_?e(r,{children:[e(xe,{bannerType:"pickup",merchandiseLines:k}),e(sa,{})]}):e(Fe,{onShowModal:a,showLocationButton:!1}):e(p,{gap:"small-200",children:[R&&e(ze,{}),e(Le,{}),e(Ve,{methods:S,selectedDeliveryMethodHandle:C})]}),e(Oe.Provider,{value:!0,children:e(Ie,{presentation:"base",children:A})})},VaultedPaymentOptionsRollupContent:function({ineligibilityReason:a}){return e(Se,{ineligibilityReason:a})},VaultedShippingMethodsRollupContent:function({singleDeliveryGroup:a}){const{i18n:t}=X(),{hasMultipleDeliveryGroups:s,onlyDeliveryGroupType:n}=a.value,{customizationsBefore:o,customizationsAfter:l,customizationsForRollupReveal:d}=Be({hasMultipleDeliveryGroups:s,targeted:!1,shouldHandleRollup:!0}).value,c=d.length>0,u=i(()=>({groupType:n&&Ge(n),includeDeliverySelectionGroups:!1}),[n]),{uiStateSignal:m}=le(U);return e(r,{children:[c?e(j,{customizations:o,options:u,render:la}):null,"error"===m.value.status?null:e(p,{gap:"base",padding:c?"small-300 none":void 0,children:[e(na,{}),He("shipping.shipping_method_notice",t)?e(w,{children:t.translate("shipping.shipping_method_notice")}):null,e(fe,{})]}),c?e(j,{customizations:l,options:u,render:la}):null]})}};export{da as vaultedRollupContents};
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.