1import{u as e,e as Y,i as Q,S as M,T as B,h as j,k as X,o as Z,q as ee,f as A}from"./esnext-vendor.BDPAaZdq.js";import{d3 as te,L as R,c as g,I as x,o as b,B as y,d as ne,v as E,U as S,a3 as F,E as V,W as O,bJ as re,b as se,d4 as ie,d5 as oe,aB as N,d6 as ae,d7 as le,F as de,P as _,d8 as U,d9 as ce,am as H,da as ue,db as pe,cU as me,h as he,dc as ge,dd as ye,cq as ve,bG as fe,a1 as be,aH as Se,de as Pe}from"./hydrate.B0xlt2dG.js";import{b as Ce,c as Ae,d as Ee,G as ke}from"./components-useVaultedMsiInstallments.Br5peiWP.js";import{O as u,bo as De,Q as L,cC as _e,bi as Me,cD as Re,_ as D,a5 as Le,P as Ie,ba as Ne,ad as Te,cE as we,cF as ze,cG as Be,cH as xe,a6 as Fe,aL as Ve}from"./hooks-useReplaceShopPayInHistory.C8UL-mAH.js";import{u as Oe,R as Ue,M as He,a as Ge,b as We,i as Ke,O as G,c as $e}from"./OnePage.h2sKDhjN.js";import{K as qe}from"./KnownBuyerPaymentMethodSelector.CdxuW0E9.js";import{W as Je,P as Ye,g as Qe,a as je}from"./PaymentOptionSelector.CeDw_6xX.js";import{e as Xe,V as Ze,B as et}from"./components-PaymentMethodProgressionHost.BmXVNMRw.js";import{a as tt}from"./MissingFields.DB7ri4eR.js";import{DeliveryAddressEdit as nt}from"./component-DeliveryAddressEdit.CwbNC6Or.js";import{b as rt,C as st}from"./Choice.BIzIW4rp.js";import{C as it}from"./EmptyState.b83C9ddY.js";import{C as ot}from"./BillingAddressForm.aTSlVDrG.js";import{P as at}from"./PhoneField.ykPh8SPx.js";import{V as lt,u as dt,P as ct,I as ut,a as pt,b as mt,S as ht,L as gt}from"./components-VatNumberValidationField.mzwVZP7U.js";import{C as yt}from"./localization-index.Bo8bPuxq.js";import{u as vt}from"./MerchandiseModal.WyfeQS3f.js";import{h as ft}from"./helpers-getNormalizedPaymentMethodName.B-mE5wnL.js";import"./app.D1P6yWfp.js";import"./shared-permissions.BaDWlj5_.js";import"./hooks-useShopPayExternalAppContext.DyGXtar4.js";import"./amazon-pay-useAmazonPayPaymentLine.BXwZMsYY.js";import"./PaymentIcon.CQXs-ePm.js";import"./PaymentLine.BkPc0Zsc.js";import"./hooks-useUpdateCheckoutAddress.xu8w67CI.js";import"./helpers-derivations.DLW2fhKL.js";import"./graphql-PaymentSessionMutation.BhOnX3QJ.js";import"./money-toShopPayMoneyInput.-nuohgDW.js";import"./redemption-promotions.CgqGtCd-.js";import"./shop-pay-normalizeBuyerDetails.ThnUnxcv.js";import"./checkout-updaters-helpers.BAeH3ddd.js";import"./helpers-setAddressErrors.BA8OjimY.js";import"./StickyPayButton-StickyPayButton.module.C1AAyg_x.js";import"./Switch.BG-32C8R.js";import"./hooks-useWalletsTimeout.i08rvNYN.js";import"./hooks-usePostPurchase.BPY08f0g.js";import"./addresses-is-address-empty.Ch6V3XcM.js";import"./PayButton-helpers.Dg5kgVMm.js";import"./helpers-credit-card-disabled.BnSr1GsQ.js";import"./useShopPayButtonClassName.nv37ytUz.js";import"./AddressPresenter.B0qw2vWQ.js";import"./hooks-useShouldRevealCustomization.wOAvQfO_.js";import"./hooks-payment-button.DClnUefe.js";import"./Section._KuAKpGQ.js";import"./Section-SectionStyleOverride.CP0VFRId.js";import"./utilities-publishMessage.BORnEDuA.js";import"./utilities-stable-ref.Dvd2X3ul.js";import"./Rollup.iQVJ47hC.js";import"./ChangeCompanyLocationLink.Ci5U9F_D.js";import"./PaymentErrorBanner.CHfgrXa-.js";import"./hooks-useGeneralPaymentErrorMessage.Zl8_48Ok.js";import"./hooks-useShopPayProgressIntercepts.Sxhi7oHx.js";import"./hooks-usePreselectSpi.B-sbpaU9.js";import"./useAddressMutationsWithNegotiation.BfzEjUy6.js";
1import"./Popover.BUTwaoOa.js";import"./shop-pay-installments-monorail.D0Myc1k_.js";import"./ShopPayLogo.Cut4IRi6.js";import"./hooks-useSuppressShopPayModalOnLoad.brztd70E.js";import"./ImpressionEventCapture.iMEQlBKs.js";import"./cross-border-hooks.DVubeg9N.js";import"./Middot.BWQejzCr.js";import"./EstimatedDeliveryContent.C1e3pn_u.js";import"./hooks-useShowMobileOrderSummary.DmZ0FrVc.js";import"./shipping-methods-consolidated-included.DWdbzJpL.js";import"./ShippingLines.BkfCgQnP.js";import"./PendingShipping.2eopPL-C.js";import"./ShipmentBreakdown.C6RgvF4c.js";import"./ShippingMethodSelector.ByEQiDBW.js";import"./TextArea.C0R8_jwI.js";import"./FormLayout.CMVyKzjL.js";import"./SubscriptionPriceBreakdown.DYrSBpqu.js";import"./hooks-useForceShopPayUrl.F3deeEs7.js";import"./StockProblems-StockProblemsLineItemList.Cyf0iJV_.js";import"./hooks-useShopPayNewSignupLoginExperiment.CrD2gvGR.js";import"./TransitionHeight.M5zGQYzu.js";import"./hooks-usePaypalRowEffects.CTzKbnMt.js";import"./components-RedirectionNotice.module.BGJWZ6-9.js";import"./BillingAddressSelector.5rPdOC_H.js";import"./hooks-useStableHostMethodsReferences.DLE4q0sj.js";import"./Checkbox.CiixBh9Z.js";import"./hooks-useWalletsMonorailTrack.CvfUTPBc.js";import"./AutocompleteField-hooks.D2O1AcIY.js";function bt({openRedeemablesModal:t,includeStoreCredit:n=!0}){const{checkout:s,i18n:r}=u(),i=Ce(),o=Ae(i),l=Ee(),{canApplyGiftCards:a}=te(),{value:d}=De(),c=d?.amount||0,p=n&&s.configuration.visibility.showStoreCreditRedemption.value&&l.value.length===0&&o.value;if(!p&&!a||c===0)return null;let m="";return a&&p?m=r.translate("payment.gift_card_store_credit.add_label"):a?m=r.translate("payment.gift_card_wrapper.add_label"):m=r.translate("payment.store_credit.add_label"),e(y,{padding:"none small-100",children:e(R,{onClick:t,textDecoration:"none",children:e(g,{direction:"inline",gap:"small-100",alignItems:"center",children:[e(x,{type:"plus",size:"base"}),e(b,{children:m})]})})})}function St({usesSharedVaultedSelector:t,hasPersistentRedeemablesManagement:n=!1,msiExpandedSlot:s,onSelectedPaymentMethodChange:r}){const{checkout:i}=u(),{paymentLines:o}=L(),l=o.value.some(v=>v.method.type==="direct"),a=ne().value,d=E("purchase.checkout.payment-method-list.render-before"),c=E("purchase.checkout.payment-method-list.render-after"),p=Oe(),m=Y(!1),f=!n,h=(v,k)=>k?p(e(F,{children:v})):v;return e(M,{children:[e(g,{gap:"base",children:[n?null:e(He,{includeStoreCredit:f,openRedeemablesModal:()=>m.value=!0}),e(Je,{children:[e(S,{customizations:d,render:h}),t?e(qe,{msiSlot:s,onSelectedPaymentMethodChange:r}):e(Ye,{renderVaultingAgreementInline:!0}),!n&&e(ke,{}),e(bt,{includeStoreCredit:f,openRedeemablesModal:()=>m.value=!0}),e(Ue,{includeStoreCredit:f,open:m.value,onClose:()=>m.value=!1}),e(S,{customizations:c,render:h}),e(Q,{when:i.configuration.visibility.showPurchaseOrderNumberField,children:e(Xe,{showHeading:!1})})]})]}),a&&!l&&e(y,{padding:"large-100 none",border:"none",children:e(Ze,{})})]})}function Pt({renderInlineSelector:t=!1}){const{checkout:{identity:n}}=u();if(t){const s=Qe({identity:n});return e(s,{renderFormOnly:!0})}return e(et,{})}const Ct={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 At({errors:t,onDismiss:n,autoFocus:s}){if(t.length===0)return null;const r=t.map(i=>T(i));return e(O,{tone:"critical",errorType:V.CheckoutError,onDismiss:n,autoFocus:s,children:r.length===1?e(b,{children:r[0]}):e(g,{gap:"small-200",children:t.map(i=>e(b,{children:T(i)},`${i.code}-${i.message}`))})})}function T(t){return t.message||Ct[t.code]}function Et(){const{checkout:t}=u(),n=t.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:s}=L(),[r]=Ge()??[],i=B(()=>_e(),[]);return j(()=>{r&&(i.company.value=r)},[i.company,r]),r?e(y,{children:[e(y,{padding:"small-400"}),e(ot,{address:s,addressErrors:i,addressType:"shipping",addressSettings:n,editDisabled:!1})]}):null}function kt({errorSignal:t,isRequired:n,validatePhoneField:s}){const{i18n:r}=u(),{shippingAddress:i}=L(),o=i.value,l=Me(i.fields.phone,t,s),[a,d]=X(!1);if(Z(()=>{t.value&&d(!0)}
1),!a)return null;const c=r.translate("contact.phone_label"),p=r.translate("contact.optional_phone_label");return e(y,{children:[e(y,{padding:"small-400"}),e(at,{name:"phone",countryCode:o.countryCode||"",label:n?c:p,hideCountries:!0,required:n,autocomplete:"shipping tel-national",autoFocus:!0,...l})]})}function Dt(){const{hasError:t}=re(Re),{i18n:n,observability:s}=u(),{isSdkAvailable:r,hasPaymentSheetErrorSignal:i,onClick:o,walletName:l}=_t();return!r||t?null:e(y,{children:e(R,{onClick:()=>{try{o()}catch(d){i.value=!0,s.error(new W(`Error on changing buyer shipping address for wallet ${l}. Details: ${d}`,{cause:d}))}},children:e(g,{direction:"inline",alignItems:"center",children:[e(x,{type:"arrow-up-right",size:"small"}),e(se,{display:"inline",inlineSize:"small-200"}),e(b,{children:n.translate("shipping.add_address")})]})})})}const _t=()=>{const n=ie().value?D.BuyWithPrime:D.AmazonPay,{inMemoryAmazonPayParts:{hasPaymentSheetError:s,sdkStatus:r}}=Le(),i=oe(n),o=ee(()=>{if(r.value.status!==N.Available)throw new W(`SDK is not available for wallet ${n}`);(n===D.BuyWithPrime?r.value.sdk.buywithprime:r.value.sdk.Pay).changeShippingAddress({amazonCheckoutSessionId:i.value})},[r,i,n]);return{isSdkAvailable:r.value.status===N.Available,hasPaymentSheetErrorSignal:s,onClick:o,walletName:n}};class W extends Error{constructor(){super(...arguments),this.name="ChangeAddressLinkError"}}const w=["1"];function Mt(){const{formattedAddress:t,address:{firstName:n,lastName:s,phone:r,countryCode:i}}=ae(["phone","firstName","lastName","company"]),{errorMessages:o,loading:l}=Rt(),a=o.length>0,{errorSignal:d,validatePhoneField:c,isPhoneRequired:p}=We({loading:l,phone:r,countryCode:i});return e(g,{gap:"base",children:[a&&e(le,{}),e(it,{name:"restricted_address_edit",titleHidden:!0,values:w,hideRadioControl:!0,children:e(rt,{value:w[0],children:e(de,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"base",alignItems:"start",alignContent:"start",children:e(g,{alignItems:"start",borderRadius:"base",children:e(y,{borderRadius:"base",children:[e(y,{padding:"none",children:[e(_,{children:[n," ",s]}),e(_,{color:"subdued",children:t})]}),e(Et,{}),e(kt,{errorSignal:d,isRequired:p,validatePhoneField:c})]})})})})}),e(Dt,{})]})}function Rt(){const t=U();return{errorMessages:ce(),loading:!t.value}}function Lt({children:t}){const{i18n:n}=u(),s=n.translate("taxes.tax_details");return e("section",{"aria-label":s,children:e(g,{direction:"block",gap:"small-200",children:[e(b,{color:"subdued",children:s}),t]})})}function It({vatNumber:t,edit:n,loading:s}){const{i18n:r}=u();return s?e(H,{inlineSize:"large",size:"base"}):e(ue,{accessibilityLabel:r.translate("taxes.vat_number.vaulted",{number:t}),graphic:"check-circle",removable:!0,onRemove:n,children:r.translate("taxes.vat_number.vaulted",{number:t})})}function Nt({embedderErrors:t,onDismissEmbedderErrors:n,showMissingAddressField:s,onAddressDelegation:r,onFirstNamePersisted:i,vatIdFieldMode:o}){const{checkout:l}=u(),a=l.identity.current.value,d=Ke(l.configuration,a),c=E("Checkout::DeliveryAddress::RenderBefore"),p=E("purchase.checkout.delivery-address.render-after"),f=!U().value,h=pe(),P=zt({identitySource:a,restrictedAddressLoading:f,onFirstNamePersisted:i}),v=s?null:d?e(g,{gap:"large-200",children:[e(G,{}),e(Tt,{onAddressDelegation:r})]}):P;return e(g,{direction:"block",gap:"base",children:[t.length>0&&e(y,{children:e(me,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(At,{errors:t,onDismiss:n,autoFocus:!0})})}),e(S,{customizations:c}),v,e(S,{customizations:p}),h&&e(Lt,{children:o.status==="vaulted"?e(It,{vatNumber:h.taxId.value,edit:o.focus,loading:h.taxId.loading}):e(lt,{taxId:h.taxId,applied:h.applied,inputRef:o.inputRef})})]})}function Tt({onAddressDelegation:t}){const{embed:n,i18n:s}=u();return n?.embedder==="amazon"?e(R,{textDecoration:"none",onClick:t,children:e(b,{tone:"accent",children:s.translate("embed.shipping.shipping_options")})}):e(tt,{onClick:t,textLabel:s.translate("contact.new_address_label")})}const wt=new Set(["guest","customerAccount","businessCustomer","sdkCartHints","shopPay"]);function zt({identitySource:t,restrictedAddressLoading:n,onFirstNamePersisted:s}){return t==="amazonPay"||t==="buyWithPrime"?n?e(H,{}):e(Mt,{}):wt.has(t)?e(nt,{onFirstNamePersisted:s}):e(G,{})}function Bt({onShowModal:t}){const{shop:n}=u(),{deliveryNext:s}=Ie(),{progressing:r}=he(),i=Ne("deliveryNext"),o=Te(),{value:l,loading:a}=ge().value,{value:d,loading:c}=ye().value,p=!!(l||d),m=a||c,f=o.value&&!r.value&&(i.value||m),h=we(),P=A(()=>ze(s.value)??[]),v=A(()=>n.shipPickupInOneOrderEnabled?h.value&&Be(h.value):P.value[0]),k=v.value?.pickupLocation?[v.value]:[],[K]=ve({type:h.value?.type,deliveryMethodType:"PICK_UP"}),I=dt({deliveryMethodType:"PICK_UP",mode:"deliveryMethodScoped"}),$=I.value.merchandiseLines.length>0,q=A(()=>I.value.merchandiseLines),{hasViolations:J}=fe(xe);let C;return f?C=e(ct,{hideText:!0,singleItem:!0}):p?C=$?e(M,{children:[e(ut,{bannerType:"pickup",merchandiseLines:q}),e(xt,{})]}):e(pt,{onShowModal:t,showLocationButton:!1}):C=e(g,{gap:"small-200",children:[J&&e(mt,{}),e(ht,{}),e(gt,{methods:k,selectedDeliveryMethodHandle:K})]}),e(yt.Provider,{value:!0,children:e(st,{presentation:"base",children:C})})}
1function xt(){return be(),null}function Ft({ineligibilityReason:t}){return e(je,{ineligibilityReason:t})}function Vt(){const{context:t}=Fe();return A(()=>t.cachedMembershipViolations.value?.some(s=>s.handle==="buy_with_prime")?"bwp_membership_violation":null)}function Ot(){const t=Vt();return t.value?e(Ut,{errorMessagesType:t.value}):null}function Ut({errorMessagesType:t}){const{i18n:n}=u();return t==="bwp_membership_violation"?e(O,{errorType:V.PaymentError,tone:"warning",children:n.translate("shipping.prime_not_available.default")},"shop-pay-buy-with-prime-shipping-error"):Ht()}function Ht(t){return null}const z=t=>e(F,{padding:"small-400 none",children:t});function Gt({singleDeliveryGroup:t}){const{i18n:n}=u(),{hasMultipleDeliveryGroups:s,onlyDeliveryGroupType:r}=t.value,{customizationsBefore:i,customizationsAfter:o,customizationsForRollupReveal:l}=vt({hasMultipleDeliveryGroups:s,targeted:!1,shouldHandleRollup:!0}).value,a=l.length>0,d=B(()=>({groupType:r&&Se(r),includeDeliverySelectionGroups:!1}),[r]),{uiStateSignal:c}=Ve(Pe);return e(M,{children:[a?e(S,{customizations:i,options:d,render:z}):null,c.value.status==="error"?null:e(g,{gap:"base",padding:a?"small-300 none":void 0,children:[e(Ot,{}),ft("shipping.shipping_method_notice",n)?e(_,{children:n.translate("shipping.shipping_method_notice")}):null,e($e,{})]}),a?e(S,{customizations:o,options:d,render:z}):null]})}const br={DefaultVaultedPaymentRollupContent:St,VaultedBillingAddressRollupContent:Pt,DefaultVaultedDeliveryAddressRollupContent:Nt,VaultedLocalPickupOptionsRollupContent:Bt,VaultedPaymentOptionsRollupContent:Ft,VaultedShippingMethodsRollupContent:Gt};export{br 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.