1import{u as e,q as a,w as r,S as s,T as t,m as i,x as n,C as o,s as l,t as d}from"./2c1ab0fe.GMbxnz74.js";import{d2 as c,L as u,c as p,I as m,o as h,B as f,d as b,w as g,U as v,a3 as y,F as j,W as S,bH as C,b as P,d3 as _,d4 as R,au as A,d5 as k,d6 as I,J as w,P as N,d7 as D,d8 as E,ai as M,d9 as T,da as x,cU as F,i as L,db as z,dc as V,cp as O,bE as B,a1 as G,dd as U}from"./164ad2e3.B4L1MRYB.js";import{b as H,c as q,d as W,G as K}from"./f3fe2775.Cg8b5yuM.js";import{S as $,bv as Q,W as J,cQ as Y,bq as X,cR as Z,a1 as ee,a9 as ae,T as re,bh as se,ak as te,cS as ie,cT as ne,cU as oe,cV as le,aa as de,aS as ce}from"./4c290a1e.DMQ9xOwP.js";import{u as ue,R as pe,M as me,a as he,b as fe,i as be,O as ge,c as ve}from"./f8706cb6.Dq4SNRnK.js";import{K as ye}from"./dfc03c53.A5u7HkwU.js";import{W as je,P as Se,g as Ce,a as Pe}from"./c10167e6.DW7aL1mi.js";import{e as _e,V as Re,B as Ae}from"./86720dbb.DHZl5FAg.js";import{a as ke}from"./7114e006.DxMyqTAB.js";import{DeliveryAddressEdit as Ie}from"./91811554.BUU75ZF9.js";import{b as we,C as Ne}from"./efa0389a.ZcaEqvMP.js";import{C as De}from"./a422df8c.B9fLTQ4u.js";import{C as Ee}from"./74835653.DeaMa2xw.js";import{P as Me}from"./47b970b2.C6dKnXeF.js";import{V as Te,u as xe,P as Fe,I as Le,a as ze,b as Ve,S as Oe,L as Be}from"./dffdfb34.5SAJ7sQR.js";import{C as Ge,h as Ue}from"./31cc568e.CVMsqQ1x.js";import{m as He}from"./21cc90a2.Ccyorzx_.js";import{u as qe}from"./64de7b49.yFRdciMn.js";import"./9f047e05.DwjCPgK0.js";import"./app.DGSHpWaV.js";import"./0a7dffce.BcNpdEJk.js";import"./5fda1420.BLaDhoyL.js";import"./60a453ce.Cg9T1Gj2.js";import"./bb728e1c.CHt2JlPY.js";import"./ac5a19ff.BchXgW63.js";import"./598fef4e.Blg5kMTg.js";import"./e77f7fe0.BZPIxVUE.js";import"./cc6ff67d.D2x8Yxrg.js";import"./08a3b809.DDk5v8y8.js";import"./bff2ff9b.Cy_si-5k.js";import"./87bfafec.4CtkSIvo.js";import"./e39bc11c.D2a9UHbt.js";import"./cf29e63b.BYllFEI4.js";import"./0e9ee714.BUAjwk_6.js";import"./39921a74.BMGPgeDG.js";import"./e3e348f2.DAaElZ9-.js";import"./ca5e9c49.DIuWAPOX.js";import"./ccdf3592.y_I-TghG.js";import"./e477f96c.DJuIaq7S.js";import"./0c0ad074.Dl7fvU-G.js";import"./cb38e5c2.Hmwo5zs2.js";import"./53bbdad9.oGVvLPt2.js";import"./945a08d6.c61SBjtG.js";import"./ec391382.CdHY2UiR.js";import"./dfca5da5.BJQx_CCE.js";import"./79974aab.DPBsbYrf.js";import"./6720fa5f.B84Z8I3K.js";import"./0e67bd3b.DUa61rto.js";import"./01973ac7.hFyCq2Rp.js";import"./58314944.D85q6ENI.js";import"./7a8217fd.C-KSXAi3.js";import"./2b89a178.dq9bza6T.js";import"./b684bff6.FsqZYmPf.js";import"./064f6ac1.DPGuEQ9h.js";import"./f1968089.lfvhhPdb.js";import"./cb5cf153.CBk88ZOK.js";import"./0727407f.DihGPUji.js";import"./55098bf1.SNyaSeYe.js";import"./ed9f2238.BDG257lM.js";import"./910cd6e2.C--KAxpp.js";import"./347b440c.-JodZrUc.js";import"./d5d34b3b.D0jJQL_d.js";import"./181d38d3.bNzFxA5T.js";import"./d6447d9e.BtUd7XAf.js";import"./f49d4216.C2ooXZfg.js";import"./f51e663e.Cb7U9v8A.js";import"./8e79be58.DbjZmhsu.js";import"./90e26f5f.C0yU_UAv.js";import"./2fdb3dd3.DyNzUnPi.js";
1import"./f3e117aa.DNg1dGVr.js";import"./a25deb9a.BE5O6zot.js";import"./7b0c98ea.B54fWMkZ.js";import"./50130ded.BKFMVDJg.js";import"./f692f62f.DHgy7Fzw.js";import"./b9c0319a.CIGlacbX.js";import"./3a819064.DvJdzPv7.js";import"./29034f35.DARWjbfB.js";import"./d22d2b80.CPLrR--0.js";function We({openRedeemablesModal:a,includeStoreCredit:r=!0}){const{checkout:s,i18n:t}=$(),i=H(),n=q(i),o=W(),{canApplyGiftCards:l}=c(),{value:d}=Q(),b=d?.amount||0,g=r&&s.configuration.visibility.showStoreCreditRedemption.value&&0===o.value.length&&n.value;if(!g&&!l||0===b)return null;let v="";return v=l&&g?t.translate("payment.gift_card_store_credit.add_label"):l?t.translate("payment.gift_card_wrapper.add_label"):t.translate("payment.store_credit.add_label"),e(f,{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:v})]})})})}const Ke={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 $e({errors:a,onDismiss:r,autoFocus:s}){if(0===a.length)return null;const t=a.map(e=>Qe(e));return e(S,{tone:"critical",errorType:j.CheckoutError,onDismiss:r,autoFocus:s,children:1===t.length?e(h,{children:t[0]}):e(p,{gap:"small-200",children:a.map(a=>e(h,{children:Qe(a)},`${a.code}-${a.message}`))})})}function Qe(e){return e.message||Ke[e.code]}function Je(){const{checkout:a}=$(),r=a.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:s}=J(),[n]=he()??[],o=t(()=>Y(),[]);return i(()=>{n&&(o.company.value=n)},[o.company,n]),n?e(f,{children:[e(f,{padding:"small-400"}),e(Ee,{address:s,addressErrors:o,addressType:"shipping",addressSettings:r,editDisabled:!1})]}):null}function Ye({errorSignal:a,isRequired:r,validatePhoneField:s}){const{i18n:t}=$(),{shippingAddress:i}=J(),l=i.value,d=X(i.fields.phone,a,s),[c,u]=n(!1);if(o(()=>{a.value&&u(!0)}),!c)return null;const p=t.translate("contact.phone_label"),m=t.translate("contact.optional_phone_label");return e(f,{children:[e(f,{padding:"small-400"}),e(Me,{name:"phone",countryCode:l.countryCode||"",label:r?p:m,hideCountries:!0,required:r,autocomplete:"shipping tel-national",autoFocus:!0,...d})]})}function Xe(){const{hasError:a}=C(Z),{i18n:r,observability:s}=$(),{isSdkAvailable:t,hasPaymentSheetErrorSignal:i,onClick:n,walletName:o}=Ze();return t?a?null:e(f,{children:e(u,{onClick:()=>{try{n()}catch(e){i.value=!0,s.error(new ea(`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:r.translate("shipping.add_address")})]})})}):null}const Ze=()=>{const e=_().value?ee.BuyWithPrime:ee.AmazonPay,{inMemoryAmazonPayParts:{hasPaymentSheetError:a,sdkStatus:r}}=ae(),s=R(e),t=l(()=>{if(r.value.status!==A.Available)throw new ea(`SDK is not available for wallet ${e}`);(e===ee.BuyWithPrime?r.value.sdk.buywithprime:r.value.sdk.Pay).changeShippingAddress({amazonCheckoutSessionId:s.value})},[r,s,e]);return{isSdkAvailable:r.value.status===A.Available,hasPaymentSheetErrorSignal:a,onClick:t,walletName:e}};
1class ea extends Error{constructor(){super(...arguments),this.name="ChangeAddressLinkError"}}const aa=["1"];function ra(){const{formattedAddress:a,address:{firstName:r,lastName:s,phone:t,countryCode:i}}=k(["phone","firstName","lastName","company"]),{errorMessages:n,loading:o}=function(){const e=D();return{errorMessages:E(),loading:!e.value}}(),l=n.length>0,{errorSignal:d,validatePhoneField:c,isPhoneRequired:u}=fe({loading:o,phone:t,countryCode:i});return e(p,{gap:"base",children:[l&&e(I,{}),e(De,{name:"restricted_address_edit",titleHidden:!0,values:aa,hideRadioControl:!0,children:e(we,{value:aa[0],children:e(w,{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(f,{borderRadius:"base",children:[e(f,{padding:"none",children:[e(N,{children:[r," ",s]}),e(N,{color:"subdued",children:a})]}),e(Je,{}),e(Ye,{errorSignal:d,isRequired:u,validatePhoneField:c})]})})})})}),e(Xe,{})]})}function sa({children:a}){const{i18n:r}=$(),s=r.translate("taxes.tax_details");return e("section",{"aria-label":s,children:e(p,{direction:"block",gap:"small-200",children:[e(h,{color:"subdued",children:s}),a]})})}function ta({vatNumber:a,edit:r,loading:s}){const{i18n:t}=$();return s?e(M,{inlineSize:"large",size:"base"}):e(T,{accessibilityLabel:t.translate("taxes.vat_number.vaulted",{number:a}),graphic:"check-circle",removable:!0,onRemove:r,children:t.translate("taxes.vat_number.vaulted",{number:a})})}function ia({onAddressDelegation:a}){const{embed:r,i18n:s}=$();return"amazon"===r?.embedder?e(u,{textDecoration:"none",onClick:a,children:e(h,{tone:"accent",children:s.translate("embed.shipping.shipping_options")})}):e(ke,{onClick:a,textLabel:s.translate("contact.new_address_label")})}const na=new Set(["guest","customerAccount","businessCustomer","sdkCartHints","shopPay"]);function oa(){return G(),null}function la(){const a=function(){const{context:e}=de();return d(()=>{const a=e.cachedMembershipViolations.value?.some(e=>"buy_with_prime"===e.handle);return a?"bwp_membership_violation":null})}();return a.value?e(da,{errorMessagesType:a.value}):null}function da({errorMessagesType:a}){const{i18n:r}=$();return"bwp_membership_violation"===a?e(S,{errorType:j.PaymentError,tone:"warning",children:r.translate("shipping.prime_not_available.default")},"shop-pay-buy-with-prime-shipping-error"):null}const ca=a=>e(y,{padding:"small-400 none",children:a}),ua={DefaultVaultedPaymentRollupContent:function({usesSharedVaultedSelector:t,hasPersistentRedeemablesManagement:i=!1,msiExpandedSlot:n,onSelectedPaymentMethodChange:o}){const{checkout:l}=$(),{paymentLines:d}=J(),c=d.value.some(e=>"direct"===e.method.type),u=b().value,m=g("purchase.checkout.payment-method-list.render-before"),h=g("purchase.checkout.payment-method-list.render-after"),j=ue(),S=a(!1),C=!i,P=(a,r)=>r?j(e(y,{children:a})):a;return e(s,{children:[e(p,{gap:"base",children:[i?null:e(me,{includeStoreCredit:C,openRedeemablesModal:()=>S.value=!0}),e(je,{children:[e(v,{customizations:m,render:P}),t?e(ye,{msiSlot:n,onSelectedPaymentMethodChange:o}):e(Se,{renderVaultingAgreementInline:!0}),!i&&e(K,{}),e(We,{includeStoreCredit:C,openRedeemablesModal:()=>S.value=!0}),e(pe,{includeStoreCredit:C,open:S.value,onClose:()=>S.value=!1}),e(v,{customizations:h,render:P}),e(r,{when:l.configuration.visibility.showPurchaseOrderNumberField,children:e(_e,{showHeading:!1})})]})]}),u&&!c&&e(f,{padding:"large-100 none",border:"none",children:e(Re,{})})]})},VaultedBillingAddressRollupContent:function({renderInlineSelector:a=!1}){const{checkout:{identity:r}}=$();if(a){const a=Ce({identity:r});return e(a,{renderFormOnly:!0})}return e(Ae,{})},DefaultVaultedDeliveryAddressRollupContent:function({embedderErrors:a,onDismissEmbedderErrors:r,showMissingAddressField:s,onAddressDelegation:t,onFirstNamePersisted:i,vatIdFieldMode:n}){const{checkout:o}=$(),l=o.identity.current.value,d=be(o.configuration,l),c=g("Checkout::DeliveryAddress::RenderBefore"),u=g("purchase.checkout.delivery-address.render-after"),m=!D().value,h=x(),b=function({identitySource:a,restrictedAddressLoading:r,onFirstNamePersisted:s}){return"amazonPay"===a||"buyWithPrime"===a?e(r?M:ra,{}):na.has(a)?e(Ie,{onFirstNamePersisted:s}):e(ge,{})}({identitySource:l,restrictedAddressLoading:m,onFirstNamePersisted:i}),y=s?null:d?e(p,{gap:"large-200",children:[e(ge,{}),e(ia,{onAddressDelegation:t})]}):b;return e(p,{direction:"block",gap:"base",children:[a.length>0&&e(f,{children:e(F,{target:"cart.deliveryGroups[0].deliveryAddress",children:e($e,{errors:a,onDismiss:r,autoF
1ocus:!0})})}),e(v,{customizations:c}),y,e(v,{customizations:u}),h&&e(sa,{children:"vaulted"===n.status?e(ta,{vatNumber:h.taxId.value,edit:n.focus,loading:h.taxId.loading}):e(Te,{taxId:h.taxId,applied:h.applied,inputRef:n.inputRef})})]})},VaultedLocalPickupOptionsRollupContent:function({onShowModal:a}){const{shop:r}=$(),{deliveryNext:t}=re(),{progressing:i}=L(),n=se("deliveryNext"),o=te(),{value:l,loading:c}=z().value,{value:u,loading:m}=V().value,h=Boolean(l||u),f=c||m,b=o.value&&!i.value&&(n.value||f),g=ie(),v=d(()=>ne(t.value)??[]),y=d(()=>r.shipPickupInOneOrderEnabled?g.value&&oe(g.value):v.value[0]),j=y.value?.pickupLocation?[y.value]:[],[S]=O({type:g.value?.type,deliveryMethodType:"PICK_UP"}),C=xe({deliveryMethodType:"PICK_UP",mode:"deliveryMethodScoped"}),P=C.value.merchandiseLines.length>0,_=d(()=>C.value.merchandiseLines),{hasViolations:R}=B(le);let A;return A=b?e(Fe,{hideText:!0,singleItem:!0}):h?P?e(s,{children:[e(Le,{bannerType:"pickup",merchandiseLines:_}),e(oa,{})]}):e(ze,{onShowModal:a,showLocationButton:!1}):e(p,{gap:"small-200",children:[R&&e(Ve,{}),e(Oe,{}),e(Be,{methods:j,selectedDeliveryMethodHandle:S})]}),e(Ge.Provider,{value:!0,children:e(Ne,{presentation:"base",children:A})})},VaultedPaymentOptionsRollupContent:function({ineligibilityReason:a}){return e(Pe,{ineligibilityReason:a})},VaultedShippingMethodsRollupContent:function({singleDeliveryGroup:a}){const{i18n:r}=$(),{hasMultipleDeliveryGroups:i,onlyDeliveryGroupType:n}=a.value,{customizationsBefore:o,customizationsAfter:l,customizationsForRollupReveal:d}=qe({hasMultipleDeliveryGroups:i,targeted:!1,shouldHandleRollup:!0}).value,c=d.length>0,u=t(()=>({groupType:n&&He(n),includeDeliverySelectionGroups:!1}),[n]),{uiStateSignal:m}=ce(U);return e(s,{children:[c?e(v,{customizations:o,options:u,render:ca}):null,"error"===m.value.status?null:e(p,{gap:"base",padding:c?"small-300 none":void 0,children:[e(la,{}),Ue("shipping.shipping_method_notice",r)?e(N,{children:r.translate("shipping.shipping_method_notice")}):null,e(ve,{})]}),c?e(v,{customizations:l,options:u,render:ca}):null]})}};export{ua 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.