1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["component-VaultedRollupContents.Dbcyzs7u.js","esnext-vendor.B9Da21W6.js","hydrate.B4yS4myh.js","addresses-is-address-empty.BgqK_zG_.js","app.3xnYS5zI.js","assets/app.Sxsz5knT.css","assets/is-address-empty.DJksNKpk.css","graphql-PaymentSessionMutation.DJrmXbx9.js","hooks-useShopPayExternalAppContext.DPMzO6wO.js","hooks-useReplaceShopPayInHistory.DcFB3a73.js","assets/previous.CbcMylZP.css","useAddressMutationsWithNegotiation.DNCHxdTZ.js","amazon-pay-useAmazonPayPaymentLine.BNRz9asa.js","PaymentIcon.JjE8o6o4.js","assets/PaymentIcon.gzvCNwz_.css","PaymentLine.BaMerjbg.js","localization-index.Bro8unL5.js","assets/index.CFj15lwv.css","Theme-ThemeOverride.DlST5SjW.js","assets/PaymentLine.D3bcP-mr.css","IncentiveBadge.D5Z_lWbZ.js","Choice.CDjRJs0E.js","Checkbox.BczifWI0.js","assets/Checkbox.SrYMuQu4.css","assets/Choice.aPApdPe_.css","assets/IncentiveBadge.Dlnp55te.css","hooks-useUpdateCheckoutAddress.BNYaFXwf.js","helpers-derivations.Cr-il7Z-.js","redemption-promotions.DLBLAp8j.js","payment-usePaymentExemptionReason.DMw_Ho83.js","cvv-cvvBridge.hYfPqjG6.js","shop-pay-normalizeBuyerDetails.D_U_lYsO.js","hooks-useShopPayProgressIntercepts.DIswdKHy.js","assets/useShopPayProgressIntercepts.CIy8uDiZ.css","proposal-delegated-payment-instrument.DdQUrP6a.js","Popover.CNzomHVN.js","assets/Popover.Bi1nHaU-.css","assets/useAddressMutationsWithNegotiation.BcTJoNaV.css","KnownBuyerPaymentMethodSelector.CRG_RreE.js","components-PaymentMethodProgressionHost.C-rEt68C.js","Section.DtSz0nUv.js","assets/Section.CU18S7Ap.css","shop-pay-installments-monorail.DvKk051s.js","ChangeCompanyLocationLink.DjKlk5Mg.js","BillingAddressForm.DavEQGPd.js","components-RedirectionNotice.module.CtEG0YAw.js","assets/RedirectionNotice.B8v_QGNW.css","PhoneField.DBCuSqxo.js","hooks-useSuppressShopPayModalOnLoad.BATXRvBx.js","assets/PhoneField.uZEuHncj.css","AddressPresenter.BLD4r5EN.js","assets/BillingAddressForm.BdwN7V1K.css","hooks-useGeneralPaymentErrorMessage.Dg4346To.js","assets/PaymentMethodProgressionHost.CyN3XztW.css","hooks-usePaypalRowEffects.C2o4Mi8y.js","assets/KnownBuyerPaymentMethodSelector.BXqN6ZOx.css","PaymentOptionSelector.D1WOt9EX.js","BillingAddressSelector.DTrrC6EY.js","components-VatNumberValidationField.D67SQ3lt.js","useShopPayButtonClassName.qvMFUOcV.js","shared-shop-theme.COUCqJYi.js","hooks-useShowShopPayOptin.BDMNomvs.js","hooks-useShouldRevealCustomization.CsootzFS.js","assets/useShopPayButtonClassName.CpHF4L7Q.css","hooks-useForceShopPayUrl.C2ZNNdwy.js","ShopPayLogo.D4bTvXV6.js","hooks-useWalletsTimeout.BM5fP26E.js","stopwatch.BB4J8gXS.js","assets/stopwatch.BxwwfmsJ.css","cross-border-hooks.BaPsRg4c.js","PayButton-helpers.CM5guAPL.js","MarketsProDisclaimer.CdZfE75O.js","Section-SectionStyleOverride.sufnDsdd.js","TransitionHeight.C3L27Pqk.js","assets/TransitionHeight.CuRoM9zv.css","AutocompleteField-hooks.DlPCpnup.js","PendingShipping.BF5kZQEo.js","assets/VatNumberValidationField.WmDmCQ5a.css","hooks-useStableHostMethodsReferences.DTUU3rzl.js","assets/PaymentOptionSelector.s-Kd_X2E.css","MerchandiseModal.DP2EJjwH.js","EstimatedDeliveryContent.N0DWzNeD.js","ShippingMethodRateLabel.BczUlK97.js","assets/EstimatedDeliveryContent.B_THySFF.css","StickyPayButton-StickyPayButton.module.BJnL9-DP.js","Switch.7EoeuAEf.js","assets/Switch.BS8yVgoP.css","hooks-payment-button.aUifgNQr.js","assets/StickyPayButton.CPXhWoNv.css","negotiated-findSelectedDeliveryMethod.BaIHcQBI.js","PaymentErrorBanner.BorVO5Qz.js","hooks-usePreselectSpi.C9HlQZO5.js","checkout-as-guest-amazon-pay.OZpfvDZ9.js","Middot.BV8s_EEX.js","shipping-methods-consolidated-included.Braf68bL.js","assets/Middot.D7Ujmshx.css","ShippingLines.D2wJ2oT7.js","ShipmentBreakdown.CGXd16n7.js","ShippingMethodSelector.B8AJyclX.js","TextArea.Iq2WHHZg.js","assets/ShippingMethodSelector.B0hio2RO.css","SubscriptionPriceBreakdown.Jvapmmt2.js","assets/SubscriptionPriceBreakdown.vTcdVGq4.css","assets/ShippingLines.LcqrKXE1.css","StockProblems-StockProblemsLineItemList.B-CUAZhR.js","hooks-useShopPayNewSignupLoginExperiment.Da9ORliN.js","VaultedContactAvatar.C3VcwZhA.js","assets/VaultedContactAvatar.BF3cX_zA.css","component-ShippingGroupsSummary.DjJ3L9Uw.js","shipping-methods-grouping.CtKrh_Du.js","page-BelowTheFoldContent.gk6Gs1sc.js","Captcha.C0uvDKuk.js","ShopPayCaptcha.cR3Ali-J.js","assets/Captcha.CJQgLR0i.css","RememberMeSection.n5aIcf6Q.js","assets/RememberMeSection.JBO5WNhc.css","component-MobileOrderSummary.CPrwILeP.js","styles-floating-layer.module.BCoSmdvP.js","assets/floating-layer.DfWUBaTh.css","assets/MobileOrderSummary.2B5x30PG.css","PayButtonSection.C4hyHlw5.js","PaymentButtons.DrUn-_md.js","assets/PaymentButtons.CKE1iCma.css","utils-useViolationsHandler.B-LGH1Km.js","assets/PayButtonSection.Bi0nhBOp.css","assets/BelowTheFoldContent.CmuzzmSI.css"])))=>i.map(i=>d[i]); 2import{_ as Zt,g as io}from"./app.3xnYS5zI.js";import{u as t,f as h,i as D,S as G,X as sl,d as Qt,x as wt,h as L,T as ie,y as ol,o as il,r as en,q as w,A as q,p as Me,G as gt,l as $,e as ue,k as ft,n as Mt,g as ro,c as lo,_ as On,a as rl,Q as tn}from"./esnext-vendor.B9Da21W6.js";import{m as Be,bP as Ln,fo as ll,$ as cl,L as we,ih as dl,c as Sa,dT as ba,ai as re,V as co,B as K,l as k,k as b,A as Fe,j as Dn,dL as uo,dG as ul,ii as pl,p as se,bM as We,bU as hl,eA as Pa,bV as pe,a as po,dN as Nt,I as Ye,hG as Aa,gP as Ea,P as he,G as ct,S as ml,b6 as yl,ij as vl,bT as ho,fB as gl,bR as fl,bQ as Cl,dB as Ra,ej as _l,b5 as Sl,cL as Ot,id as Ia,b as je,u as Vt,bq as mo,X as ka,d as Pe,f as ut,W as Lt,dO as yo,ik as vo,aC as bl,co as nn,il as go,eh as fo,aD as Pl,g as Al,im as El,fL as Rl,ah as Ma,ie as Il,bN as Oa,cv as kl,io as Ml,ip as Ol,iq as Ll,ir as Co,f1 as _o,e3 as Dl,cs as Tl,hs as wl,is as Nl,it as Vl,bo as Bl,iu as Fl,hE as So,fI as bo,bg as _s,ch as xl,eG as Hl,e1 as Po,c9 as zl,iv as Ul,iw as Gl,cM as Wl,dW as Ao,dZ as La,eQ as Yl,ix as jl,dR as Kl,dU as ql,bz as $l,iy as Eo,iz as Ro,dX as Da,dY as Io,cj as Qe,hx as ko,hz as Xl,U as ke,eJ as Ct,eS as fn,bh as Jl,eZ as Zl,aB as Ql,ay as Mo,iA as ec,bi as Oo,iB as Ta,iC as Lo,c3 as tc,ef as nc,eH as ac,iD as sc,eK as Do,iE as To,N as oc,af as wo,bu as ic,c6 as rc,iF as lc,bI as wa,iG as cc,aW as dc,ck as uc,iH as pc,ci as hc,eO as mc,fQ as yc,bE as vc,b$ as gc,bJ as No,cV as fc,eL as Cc,aw as _c,cW as An,Y as na,a6 as Sc,b7 as bc,f3 as Pc,_ as Ac,ex as Ec,iI as Rc,Z as Ss,ei as Ic,i2 as aa,iJ as kc,K as sa,M as jt}from"./hydrate.B4yS4myh.js";import{S as y,dD as Mc,ae as an,a6 as Na,a1 as Vo,du as Oc,dv as Lc,T as ne,k1 as Bo,ch as Dc,c7 as Tc,cd as wc,af as Va,k2 as Nc,a4 as Y,j as Vc,ij as Fo,bS as xo,ii as Bc,ie as Ho,bw as sn,ih as Fc,jv as vt,a3 as Ba,aC as Ke,c6 as zo,be as bs,k3 as xc,k4 as En,gT as Uo,ck as Fa,bc as Hc,bt as zc,ao as et,$ as Uc,V as Gc,dt as qt,k5 as Wc,b5 as lt,an as qe,x as ha,gZ as on,aS as Tn,bz as pt,fX as Ps,al as In,bu as As,ja as Yc,f$ as xa,k6 as oa,k7 as wn,gv as Go,k8 as jc,gt as Kc,gu as qc,dT as $c,bd as $e,jR as Xc,k9 as Jc,fR as Zc,av as Qc,cy as kn,f2 as Wo,O as ed,ka as td,fz as nd,eO as ad,jG as Dt,cx as sd,kb as rn,dO as od,kc as ln,kd as Yo,jp as id,ke as jo,aj as rd,e as ma,bm as ld,cr as cd,er as Ko,kf as qo,cq as dd,fS as ud,kg as $o,kh as Xo,ki as pd,g_ as hd,Q as Ha,hc as Jo,K as md,jS as yd,fe as vd,fd as gd,dl as fd,dE as za,dg as Zo,dG as Cd,dF as _d,kj as Qo,cY as ei,fx as Cn,cX as Es,g4 as Rs,bH as ti,b2 as ni,kk as Sd,dr as ai,aB as bd,n as Pd,dp as Ad,cV as si,jl as Ed,kl as Rd,km as Id,kn as kd,ko as Md,kp as Od,kq as Ld,db as Rn,kr as Dd,ji as oi,ks as ii,kt as Td,ku as Ua,aM as wd,kv as Nd,kw as Vd,kx as Bd,
2ky as Fd,g2 as ri,cR as xd,j8 as Hd,j9 as zd,kz as Ud,kA as Gd,aL as Wd,ah as Yd,jd}from"./addresses-is-address-empty.BgqK_zG_.js";import{t as Kd,C as li,v as qd,w as ci,U as Ga,a as $d,I as Xd,h as Wa,x as di,y as Jd,z as Zd,B as Qd,F as eu,G as ui,H as pi,j as hi,J as tu,S as nu,K as au,M as su,N as ou,O as iu,g as Ya,Q as ru,R as lu,T as cu,W as du,X as uu,Y as pu,Z as hu,f as Nn,i as mi,_ as mu,D as yi,u as ja,$ as yu,P as vi,k as vu,l as gu,m as fu,e as Cu,V as _u,o as Su,E as bu,n as Pu}from"./components-VatNumberValidationField.D67SQ3lt.js";import{j as Au,D as Eu,a as Ru,u as Iu,s as ku,c as Mu,d as Ou,k as Lu,b as Du,H as Tu}from"./StickyPayButton-StickyPayButton.module.BJnL9-DP.js";import{_ as wu,Y as Nu,N as Tt,Z as Vu,h as cn,$ as Vn,a0 as Bu,i as Bn,j as Fu,G as xu,S as gi,b as fi,a1 as Is,a2 as Hu,a3 as zu,a4 as ia,a5 as ra,c as Ci,q as Uu,x as Gu,z as Wu,s as Yu,t as ju,v as ks,B as Ku,w as qu,C as $u,V as Xu,a6 as Ju,a7 as Zu,d as Qu,u as ep,k as _i,l as Si,M as tp,m as np,T as ap,e as sp}from"./useAddressMutationsWithNegotiation.DNCHxdTZ.js";import{M as $t,S as Fn,r as Xt,c as op,a as ip}from"./Section.DtSz0nUv.js";import{S as la,M as ca}from"./Section-SectionStyleOverride.sufnDsdd.js";import{R as ce,P as bi,C as ya}from"./PaymentLine.BaMerjbg.js";import{A as rp,C as Pi,S as lp}from"./ChangeCompanyLocationLink.DjKlk5Mg.js";import{a as cp,u as dp,f as up}from"./negotiated-findSelectedDeliveryMethod.BaIHcQBI.js";import{u as pp}from"./hooks-useShowShopPayOptin.BDMNomvs.js";import{E as Ai,u as Ei,a as hp,P as mp,b as yp}from"./PaymentErrorBanner.BorVO5Qz.js";import{u as Mn,a as vp}from"./hooks-useShouldRevealCustomization.CsootzFS.js";import{d as gp,a as Ms}from"./hooks-useGeneralPaymentErrorMessage.Dg4346To.js";import{P as Le}from"./PaymentIcon.JjE8o6o4.js";import{O as fp,W as dn,b as Cp,a as _p}from"./hooks-useShopPayProgressIntercepts.DIswdKHy.js";import{a as Sp,C as Jt,b as bp}from"./Choice.CDjRJs0E.js";import{a as Pp,c as Ka,u as Ap,b as Ep}from"./payment-usePaymentExemptionReason.DMw_Ho83.js";import{I as Rp,C as Ri,b as Ip,E as kp}from"./IncentiveBadge.D5Z_lWbZ.js";import{B as Mp,A as Op}from"./BillingAddressForm.DavEQGPd.js";import{g as Kt,b as Lp,c as Dp,d as Tp,C as wp}from"./proposal-delegated-payment-instrument.DdQUrP6a.js";import{b as Np,a as Vp,t as Bp,d as Fp,u as qa,c as xp}from"./hooks-usePreselectSpi.C9HlQZO5.js";import{i as Os,h as Hp}from"./graphql-PaymentSessionMutation.DJrmXbx9.js";import{T as va}from"./Theme-ThemeOverride.DlST5SjW.js";import{S as zp}from"./Switch.7EoeuAEf.js";import{a as Ii,g as Up,b as Gp,d as Wp}from"./redemption-promotions.DLBLAp8j.js";import{u as Yp}from"./checkout-as-guest-amazon-pay.OZpfvDZ9.js";import{v as Ls,a as jp,c as Ds,S as Kp}from"./useShopPayButtonClassName.qvMFUOcV.js";import{S as ki}from"./ShopPayLogo.D4bTvXV6.js";import{S as qp}from"./shared-shop-theme.COUCqJYi.js";import{u as $p}from"./hooks-useReplaceShopPayInHistory.DcFB3a73.js";import{u as $a,A as Xp}from"./AddressPresenter.BLD4r5EN.js";import{e as Ts}from"./cvv-cvvBridge.hYfPqjG6.js";import{P as Jp}from"./PhoneField.DBCuSqxo.js";import{u as Mi}from"./hooks-useSuppressShopPayModalOnLoad.BATXRvBx.js";import{I as Xa,g as ws}from"./shop-pay-installments-monorail.DvKk051s.js";import{u as Oi}from"./cross-border-hooks.BaPsRg4c.js";import{V as Zp,M as Qp,u as eh,a as th,S as nh,R as ah,b as sh}from"./Middot.BV8s_EEX.js";import{b as oh,a as ih,g as rh}from"./hooks-useShopPayExternalAppContext.DPMzO6wO.js";import{C as Li,F as lh}from"./localization-index.Bro8unL5.js";import{D as Di,u as Ti,S as ch}from"./ShippingLines.D2wJ2oT7.js";import{M as dh,c as wi,u as Ni,b as uh}from"./MerchandiseModal.DP2EJjwH.js";import{S as ga}from"./ShippingMethodRateLabel.BczUlK97.js";import{u as Vi,S as Bi,E as fa}from"./EstimatedDeliveryContent.N0DWzNeD.js";import{a as ph}from"./components-RedirectionNotice.module.CtEG0YAw.js";import{f as Fi,i as hh}from"./hooks-useWalletsTimeout.BM5fP26E.js";import{S as mh}from"./StockProblems-StockProblemsLineItemList.B-CUAZhR.js";import{a as yh}from"./hooks-useShopPayNewSignupLoginExperiment.Da9ORliN.js";import{T as Ns}from"./TransitionHeight.C3L27Pqk.js";import{D as vh}from"./PendingShipping.BF5kZQEo.js";import{S as gh}from"./ShipmentBreakdown.CGXd16n7.js";function fh(){const{i18n:e}=y();return t(Be,{level:1,children:e.translate("embed.header.review_order")})}function Ch(){const{hasError:e}=Ln(Mc),n=cp(),{i18n:a,observability:s}=y(),o=a.translate("review.blocks.change_link_label"),i=ll(n.value?.method?.walletParams)?.checkout_session_id,{inMemoryAmazonPayParts:{hasPaymentSheetError:r,sdkStatus:l}}=an(),d=h(()=>{const c=l.value;return c.status===cl.Available?c.sdk:void 0});return n.value?t(D,{when:d,children:c=>t(we,{onClick:()=>{try{c.buywithprime.changePaymentMethod({amazonPayOptions:{amazonCheckoutSessionId:i,isDeclined:e}})}catch(p){r.value=!0,s.error(new dl(`Error on changing buyer payment method. Details: ${p}`,{cause:p}))}},children:o})}):null}function _h(){const e=y(),{i18n:n}=e,a=bh(e);return t(G,{children:[a.sdkButton,t(ce,{id:a.rollupId,label:n.translate("payment.title"),primaryContent:t(Sh,{}),primaryAction:a.changeLink})]})}function Sh(){const{brand:e,descriptor:n}=Nu().value,a=Sa(),s=Vo(),o=ba();return a.value?s.value?t(Tt,{vaulted:!0,reason:"giftCard"}):!n||!o.value?t(re,{}):t(Vu,{brand:e,descriptor:n}):t(Tt,{vaulted:!0,reason:"freeOrder"})}function bh({checkout:e}){return e.identity.current.value==="buyWithPrime"?{rollupId:"buyWithPrimePayDetails",sdkButton:t(Kd,{wallet:Na.BuyWithPrime,isSdkOnly:!0}),changeLink:t(Ch,{})}:{rollupId:"amazonPayDetails",sdkButton:t(rp,{isSdkOnly:!0}),changeLink:t(wu,{})}}function Ph({displayName:e,load:n,loadingLabel:a}){function s(o){const{observability:i}=y(),r=wt(xn);co({active:!!o}),L(()=>
2{if(o)return i.error(o,{metadata:{vaulted:{component:e,failure:"lazy_load",boundary:r?"present":"missing"}}}),r?.register()},[o,i,r])}return Qt({displayName:e,load:n,suspense:!1,renderLoading:()=>t(Ah,{label:a}),useError:s})}function Ah({label:e}){const{i18n:n}=y();return co(),t(G,{children:[t(K,{accessibilityRole:"status",children:t(k,{accessibilityVisibility:"exclusive",children:n.translate("vaulted.loading_section",{section:e(n)})})}),t(b,{gap:"small-300",children:[t(re,{inlineSize:"large"}),t(re,{inlineSize:"large"}),t(re,{inlineSize:"small"})]})]})}class Eh{#e=ol(0);#t=il(()=>this.#e.value>0);get hasFailures(){return this.#t}register(){return this.#e.value+=1,()=>{this.#e.value-=1}}}const xn=sl(null);function Rh({children:e}){const n=ie(()=>new Eh,[]);return t(xn.Provider,{value:n,children:e})}function Ih(){const{i18n:e}=y(),n=wt(xn);return n?t(D,{when:()=>n.hasFailures.value,children:t(K,{paddingBlockEnd:"base",children:t(Ai,{bannerId:"VaultedRollupContentsLoadError",errorType:Fe.CheckoutError,heading:e.translate("error_page.terminal.title"),tone:"critical",autoFocus:!0,iconHidden:!0,children:t(b,{gap:"small-400",alignItems:"start",children:[t(k,{children:e.translate("error_page.terminal.message")}),t(Dn,{variant:"plain",onClick:()=>globalThis.location.reload(),children:e.translate("error_page.terminal.action.cta")})]})})})}):null}function kh({children:e}){const a=wt(xn)?.hasFailures.value??!1;return t(K,{inert:a,opacity:a?50:void 0,children:e})}const Mh=()=>Zt(()=>import("./component-VaultedRollupContents.Dbcyzs7u.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105]));function xi(){return en(Mh)}function Bt(e,n,a){return Ph({displayName:e,loadingLabel:n,load:async()=>a((await xi()).vaultedRollupContents)})}const Oh=Bt("DefaultVaultedPaymentRollupContent",e=>e.translate("payment.title"),e=>e.DefaultVaultedPaymentRollupContent),Lh=Bt("VaultedShippingMethodsRollupContent",e=>e.translate("shipping.title"),e=>e.VaultedShippingMethodsRollupContent),Dh=Bt("VaultedBillingAddressRollupContent",e=>e.translate("billing.billing_address_title"),e=>e.VaultedBillingAddressRollupContent),Th=Bt("DefaultVaultedDeliveryAddressRollupContent",e=>e.translate("shipping.shipping_address_title"),e=>e.DefaultVaultedDeliveryAddressRollupContent),wh=Bt("VaultedLocalPickupOptionsRollupContent",e=>e.translate("local_pickup.title"),e=>e.VaultedLocalPickupOptionsRollupContent),Nh=Bt("VaultedPaymentOptionsRollupContent",e=>e.translate("payment.payment_option.title"),e=>e.VaultedPaymentOptionsRollupContent);function Vh(e){L(()=>{e&&xi().catch(()=>{})},[e])}const Bh={id:"c2d32a41854d2b88c435b1a8710244c3357bc9533fc69142a72d00b75acac5a8",type:"mutation",name:"ExperimentExposed",source:"mutation ExperimentExposed($experiments:[String!]!){experimentExposed(experiments:$experiments){userErrors{field message __typename}__typename}}"},Fh=()=>{const{graphql:{shopPayGraphql:e}}=y();return{recordExposure:w(async a=>{await e.mutate(Bh,{variables:{experiments:[a]}})},[e])}};function xh(){const{shop:e,checkout:n,shopPay:a}=y(),s=e.hasFlagEnabled(Oc),o=uo(),{recordExposure:i}=Fh(),r=q(!1),l=a.installments.isServiceAvailable.value,d=a.user.installments.isRetryable.value,c=o!==null,u=n.installments.isUnavailable.value,p=n.installments.config.value?.supportedCountries,m=ie(()=>!c||!l||u&&!d,[c,l,u,d]);L(()=>{!s&&p?.includes("GB")&&n.installments.isSupported.value&&!m&&!r.current&&(i(Lc.handle),r.current=!0)},[s,p,m,n.installments.isSupported.value,i])}function Vs(e,n){const a=new Set(n.map(s=>s.id));return e.some(s=>a.has(s.id))}function Ja(e,n){const a=ul();return Me(()=>{n&&Vs(a.blockingExtensions.value,e)&>(()=>n())}),Vs(a.blockingExtensions.value,e)}function Hh(){const{generalPaymentError:e,generalPaymentErrorCode:n}=ne(),{violations:a}=pl(Bo);return h(()=>e.value?!Dc(n.value)||a.value.size>0:!1)}function Zf({showTips:e,billingFormPosition:n}){const a=se("Checkout::Dynamic::Render","PAYMENT1"),s=se("Checkout::Dynamic::Render","PAYMENT2"),o=se("Checkout::Dynamic::Render","PAYMENT3"),i=n==="inContext"||n==="hidden"||n==="afterPayment"&&e?[[],a,s]:[s,a];return(e||n==="afterPayment")&&i.push(o),i}function zh({clearReceiptErrorOnPaymentLineChange:e=!0}={}){const{hasViolations:n}=We(new Set([...Tc,"PAYMENTS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"])),{hasError:a,clearError:s}=Ln(wc),{lastJourneyProgression:o}=Va(),i=o.value.type==="failed"&&o.value.negotiationStage==="completion",r=Hh(),l=hl();Nc(()=>{e&&s()});const d=a&&!l,c=r.value;return{hasAnyPaymentError:n||d||i||c,errors:{hasExpiryViolation:n,hasReceiptPaymentFailure:a,hasReceiptPaymentError:d,hasSubmitCompletionFailure:i,hasGeneralPaymentError:c},clearReceiptError:s}}function Hn(e,n){return e.currentUrl.value.hash===`#${n}`}function Ft(e,n=!1){const{router:a}=y(),s=$(e),o=h(()=>Hn(a,s.value)),i=ue(n);return L(()=>{o.peek()&&(i.value=!0)},[o,i]),i}function Za({autoOpen:e=!0,isMissing:n,open:a}){L(()=>{e&&n&&(a.value=!0)},[e,n,a]);const{shopPay:{progressInterceptor:s}}=y();L(()=>
2{if(n)return s.listenResult(o=>{o||(a.value=!0)})},[s,n,a])}function Hi(){const{loading:e}=Pa(),{checkout:n}=y(),a=n.isShippingRequired.value,s=ne().shippingAddress.value,{shippingAddress:o,deliveryNext:i}=Y(),r=o.value,l=Vc(i.value),d=s?.countryCode===r?.countryCode,c=!a||!e&&(l||d),u=ue(c);return c&&!u.value&&(u.value=!0),u}function Uh(e){const{useStoreCreditForSubscriptionRenewals:n}=ne(),{loading:a}=Pa(),s=$(e),o=$(a),i=Fo(),r=xo(),{showStoreCreditForSubscriptionRenewals:l}=Qa();Me(()=>{const d=s.value,c=o.value,u=l.value,p=i.value,m=r.value;d&&!c&&(!u||p||m)&>(()=>{n.value&&(n.value=!1)})})}function Qa(){const{shop:e}=y(),n=e.hasFlagEnabled(Bc),a=cn(),s=Ho(),o=sn(),i=Fc(),{loading:r}=Pa(),l=$(r),d=Vn(a),c=Hi(),u=h(()=>{const v=a.value;if(!(!i.value||!v||v.balance.amount<=0)){if(d.value)return Bu({firstOrderTotal:s.value,storeCreditAccount:v});if(o.value?.amount===0&&s.value?.currencyCode===v.balance.currencyCode)return v.balance}}),p=Bn(a),m=h(()=>{const v=c.value,C=!l.value,f=p.value,g=u.value!=null;return n&&v&&C&&f&&g});return{storeCreditBalanceForSubscriptionRenewals:u,showStoreCreditForSubscriptionRenewals:m}}function Gh(){const{i18n:e}=y(),{paymentLines:n}=ne(),{violations:a}=pe(Bo),{message:s,tone:o}=Ei(),i=[...a][0],r=i&&(i.localizedMessage||i.nonLocalizedMessage),l=n.value.find(m=>m.method.type!=="giftCard"&&m.method.type!=="redeemable")?.method,d=l?.type==="customOnsite"?l:void 0,c=d?e.translate("payment_errors.local_payment_method_unavailable",{payment_method:d.name}):void 0,u=!!s&&(o==="critical"||o==="warning"),p=r&&c&&u?`${c}. ${r}`:void 0;return L(()=>{if(p)return po({content:p})},[p]),!r||!d?null:t(Ai,{errorType:Fe.PaymentError,bannerId:"LocalPaymentMethodUnavailableBanner",tone:"warning",heading:c,autoFocus:!u,children:r})}function Wh({openRedeemablesModal:e,includeStoreCredit:n=!0}){const{i18n:a}=y(),s=Fu(),{paymentLines:o}=Nt(),i=n&&s.value.length>0,r=o.length>0,l=[...n?s.value:[],...o];if(!l.length)return null;let d="";return r&&i?d=a.translate("payment.gift_card_store_credit.manage_label"):r?d=a.translate("payment.gift_card_wrapper.manage_label"):d=a.translate("payment.store_credit.manage_label"),t(b,{children:[t(b,{gap:"small-200",padding:"small-100",border:"base",borderRadius:"base base none none",children:l.map(c=>t(Yh,{paymentLine:c},vt(c.method)))}),t(K,{inlineAlignment:"start",padding:"small-200",borderWidth:"none base base base",borderRadius:"none none base base",children:t(we,{onClick:e,textDecoration:"none",children:t(b,{direction:"inline",alignItems:"center",gap:"small-200",children:[t(Ye,{type:"edit"}),t(k,{children:d})]})})})]})}function Yh({paymentLine:e}){const{i18n:n}=y();switch(e.method.redemptionSource){case"STORE_CREDIT":return t(ct,{gridAutoFlow:"column",gridAutoColumns:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",children:[t(b,{direction:"inline",alignItems:"center",gap:"small-100",children:[t(Le,{type:"store-credit"}),t(k,{children:n.translate("payment.store_credit.label")})]}),t(he,{textAlign:"end",children:t(k,{type:"strong",children:e.cost&&n.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]});case"CUSTOM":{const a=e.method.redemptionContent,s=Aa(a);return t(ct,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 70%) minmax(0, 30%)",gridTemplateRows:"minmax(0, 1fr)",children:[t(b,{direction:"inline",alignItems:"center",gap:"small-100",children:[t(Le,{type:"gift-card"}),t(k,{children:n.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Ea(s)})})]}),t(he,{textAlign:"end",children:t(k,{type:"strong",children:e.cost&&n.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]})}default:return null}}function jh({open:e,onClose:n,includeStoreCredit:a=!0}){const{i18n:s,checkout:o}=y(),i=cn(),r=Bn(i),{canApplyGiftCards:l,paymentLines:d}=Nt(),c=Ba(),u=a&&o.configuration.visibility.showStoreCreditRedemption.value&&r.value,p=l||d.length>0,m=q(p);L(()=>{const g=m.current&&!p;m.current=p,e&&g&&!u&&n()},[u,p,n,e]);let v="";u&&p?v=s.translate("payment.gift_card_store_credit.manage_label"):p?v=s.translate("payment.gift_card_wrapper.manage_label"):u&&(v=s.translate("payment.store_credit.manage_label"));const C=()=>{(c.value||!l&&u)&&n()},f=a?t(G,{children:[t(gi,{}),t(fi,{afterAppliedRedeemablesChange:C})]}):null;return t(fp,{heading:v,open:e,onHide:n,children:t(b,{gap:"base",children:[o.configuration.visibility.showStoreCreditRedemption.value?f:null,t(xu,{afterAppliedRedeemablesChange:C,autoSelect:!0,showHeading:!1})]})})}function zi(){const e=cn(),n=Bn(e),a=Vn(e),s=Hi(),o=sn();return h(()=>{const i=o.value?.amount===0&&!a.value;return n.value&&s.value&&!i}
2)}function Ui(){const{paymentLines:e}=Nt(),n=zi(),{showStoreCreditForSubscriptionRenewals:a}=Qa();return!!e.length||n.value||a.value}function Kh({afterAppliedRedeemablesChange:e,placement:n}){const{i18n:a,userEvents:s,shop:o,source:i,checkout:r}=y(),{paymentLines:l,remove:d}=Nt(),{useStoreCreditForSubscriptionRenewals:c}=ne(),u=sn(),p=Fo(),m=xo(),v=cn(),C=Vn(v),f=ue(Is.Init),g=h(()=>f.value===Is.Loading),S=Ui(),P=zi(),{storeCreditBalanceForSubscriptionRenewals:_,showStoreCreditForSubscriptionRenewals:I}=Qa(),M=h(()=>p.value||m.value),E=h(()=>{if(p.value)return a.translate("payment.store_credit.buying_gift_card");if(m.value)return a.translate("payment.store_credit.no_fixed_selling_plans")}),A=Hu(v.value,f),F=zu(v.value,f),T=ue(N());L(()=>{T.value=N()},[l]),Me(()=>{const j=C.value,W=c.value;T.value=N({storeCreditSelected:j,subscriptionRenewalsSelected:W})});function N({storeCreditSelected:j=C.value,subscriptionRenewalsSelected:W=c.value}={}){const z=l.map(({method:oe})=>vt(oe));return j&&z.unshift(ia),W&&z.splice(j?1:0,0,ra),z}const V=w((j,W)=>{const z=W?"add":"remove",oe=n?`${n}_`:"";s.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...Ke(i,r,o),action:`${oe}manage_redeemables_${z}_${j}`}})},[r,s,n,o,i]),B=w(async j=>{const W=T.value,z=W.length>j.length,{shorter:oe,longer:ee}=z?{shorter:j,longer:W}:{shorter:W,longer:j};T.value=j;const Q=ee.find(te=>!oe.includes(te)),le=Q===ia,ye=Q===ra;let de=null;if(le)if(V("store_credit",!z),z){const te=c.value;c.value=!1,de=await F(),de?.status!=="success"&&(c.value=te)}else de=await A();else if(ye){const te=!z;V("store_credit_subscription_renewals",te),c.value=te}else{V("gift_card",!z);const te=l.find(Ce=>vt(Ce.method)===Q);te?.method&&(de=await d(te.method))}de?.status==="success"&&e?.()},[e,A,T,l,V,d,F,c]),R=h(()=>g.value||M.value),H=h(()=>R.value||u.value?.amount===0&&!C.value),X=R;if(!S)return null;const Z=v.value?.balance,O=_.value,x=E.value;return t(b,{gap:"base",borderRadius:"base base none none",padding:n==="expanded"?"small-100 none none none":void 0,children:t(Sp,{name:"redeemables_list",values:T.value,onChange:B,variant:"block",multiple:!0,children:[P.value&&Z&&t(Jt,{value:ia,disabled:H.value,secondaryContent:t(k,{type:"strong",children:a.formatCurrency(Z.amount,{currency:Z.currencyCode})}),details:x&&t(k,{children:x}),children:t(b,{direction:"inline",gap:"base",alignItems:"center",children:[t(k,{children:a.translate("payment.store_credit.apply_label")}),t(D,{when:g,children:t(ml,{})})]})}),I.value&&O&&t(Jt,{value:ra,disabled:X.value,details:t(b,{gap:"small-500",children:[t(k,{children:a.translate("payment.store_credit.remaining_for_subscription_charges_description",{amount:a.formatCurrency(O.amount,{currency:O.currencyCode})})}),x&&t(k,{children:x})]}),children:t(k,{children:a.translate("payment.store_credit.use_remaining_for_subscription_charges_label")})}),l.map(j=>t(qh,{paymentLine:j},vt(j.method)))]})})}function qh({paymentLine:e}){const{i18n:n}=y(),s=e.method.redemptionContent,o=Aa(s);return t(Jt,{value:vt(e.method),secondaryContent:t(he,{textAlign:"end",children:t(k,{type:"strong",children:e.cost&&n.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})}),children:t(b,{children:[t(he,{children:n.translate("payment.gift_card_checkbox_label")}),t(b,{direction:"inline",gap:"small-400",children:[t(Ye,{type:"gift-card"}),t(k,{color:"subdued",children:[" ",Ea(o)]})]})]})})}function $h(){const{checkout:e}=y(),n=Ui(),a=Gi(),{paymentLines:s}=Nt();switch(e.identity.current.value){case"shopPay":return{hasPersistentRedeemablesManagement:!0,show:n};case"customerAccount":case"businessCustomer":{const o=a||s.length>0;return{hasPersistentRedeemablesManagement:o,show:o}}default:return{hasPersistentRedeemablesManagement:!1,show:!1}}}function Xh(){const{checkout:e}=y(),n=ue(!1),a=Gi();switch(e.identity.current.value){case"shopPay":return t(Kh,{placement:"summary"});case"customerAccount":case"businessCustomer":return t(b,{gap:"base",children:[a?t(G,{children:[t(gi,{}),t(fi,{})]}):null,t(Wh,{includeStoreCredit:!1,openRedeemablesModal:()=>n.value=!0}),t(jh,{includeStoreCredit:!1,open:n.value,onClose:()=>n.value=!1})]});default:return null}}function Gi(){const{checkout:e}=y(),n=cn(),a=Bn(n),s=Vn(n),o=sn(),i=s.value,r=o.value?.amount===0&&!i;return a.value&&(e.configuration.visibility.showStoreCreditRedemption.value||i)&&!r}const Jh={ONE_PERCENT_CASHBACK:"1",THREE_PERCENT_CASHBACK:"3"};function mt({children:e}){return t(b,{direction:"inline",gap:"small-200",alignItems:"center",children:e})}function Zh({handleNoValidCards:e}){const[n,a]=ft(!1),o=Y().paymentMethods.value,{i18n:i,observability:r,shopPay:l}=y(),d=l.session.paymentMethodOption.value,c=Ci(),u=c.selectedCreditCard.value,p=c.selectedPaymentMethod.value,m=c.selectedPaymentMethodItem.value,v=c.paymentMethods.value,C=l.user.hasFlow.value,f=Uu(u),g=v.find(_=>!_.isDisabled);if(L(()=>
2{if(n){const _=setTimeout(()=>{a(!1)},750);return()=>clearTimeout(_)}},[n]),L(()=>{const _=d?.name==="SHOPIFY_INSTALLMENTS"&&m?.isDisabled===!0;if(!g){C&&e();return}_&&(c.selectPaymentMethod(g.method),a(!0))},[m?.isDisabled,d?.name,e,g,c,C]),!p)return null;if(n)return t(mt,{children:t(re,{})});if(p.paymentMethod==="CUSTOM_ONSITE"){const _=o?.find(E=>p.paymentBrands&&zo(E,p.paymentBrands));if(!_)return r.log("shop_pay_payment_line_custom_onsite_payment_selected","customOnsitePaymentMethod was selected but not in negotiatedPaymentMethods",{selectedPaymentMethod:JSON.stringify(p),negotiatedPaymentMethods:JSON.stringify(o)}),null;const I=yl(_)&&!!_.incentiveType,M=_.paymentBrands?.length===1?_.paymentBrands[0]:"generic";if(I){const E=Jh[_.incentiveType],A={title:i.translate("payment.usdc_cashback_title",{incentive_percentage:E}),additionalInfo:i.translate("payment.usdc_cashback_additional_info",{terms_url:bs,incentive_percentage:E}),terms:i.translate("payment.usdc_cashback_terms"),termsUrl:bs};return t(mt,{children:[t(k,{children:_.name}),t(Rp,{notice:A,selected:!1}),t(Le,{type:M})]})}return t(bi,{paymentLine:{method:_},showAmount:!1})}if(Gu(p))return t(mt,{children:[t(k,{children:t(k,{children:i.translate("payment.ideal_label")})}),t(Le,{type:"ideal"})]});if(Wu(p))return t(mt,{children:[t(k,{children:i.translate("brand.apple_pay")}),t(Le,{type:"apple_pay"})]});if(Yu(p))return t(mt,{children:[t(k,{children:i.translate("brand.paypal")}),t(Le,{type:"paypal"})]});if(ju(p)||ks(p)){const _=i.translate("payment_gateway.shop_pay.name"),I=ks(p)?i.translate("payment_gateway.shop_pay.installments_label"):void 0;return t(mt,{children:[t(k,{children:_}),t(Le,{type:"shop_pay"}),I?t(k,{color:"subdued",children:I}):null]})}if(Ku(p))return t(mt,{children:t(k,{children:p.name})});if(qu(p)||$u(p))return null;const S="base",P=p.paymentAttributes;return t(Xu,{name:f,digits:t(G,{children:[t(ya,{}),t(k,{size:S,tone:"neutral",children:P.lastDigits})]}),icon:t(Le,{type:P.brand})})}function Qh(){const e=ne().paymentLines.value,n=ie(()=>e.find(a=>a.method.type!=="giftCard"&&a.method.type!=="redeemable"),[e]);return t(b,{gap:"small-400",children:[n&&t(bi,{paymentLine:n,showCardBrandLabel:!0}),t(Ju,{})]})}function em({openSignal:e}){const{checkout:{identity:n}}=y();return n.current.value==="shopPay"?t(Zh,{handleNoValidCards:()=>e.value=!0}):t(Qh,{})}function Wi(){const{i18n:e}=y(),n=xc("STORE_CREDIT"),{paymentLines:a}=Nt(),s=[...n.value,...a];if(!s.length)return null;const o=" - ";return t(b,{gap:"small-200",children:s.map(i=>{const r=i.cost?t(k,{children:[o,e.formatCurrency(i.cost.amount,{currency:i.cost.currencyCode,form:"short"})]}):null;switch(i.method.redemptionSource){case"STORE_CREDIT":return t(b,{direction:"inline",alignItems:"center",gap:"base",children:[t(Le,{type:"store-credit"}),t(he,{children:[e.translate("payment.store_credit.label"),r]})]},vt(i.method));case"CUSTOM":{const l=i.method.redemptionContent,d=Aa(l);return t(b,{direction:"inline",alignItems:"center",gap:"base",children:[t(Le,{type:"gift-card"}),t(he,{children:[e.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Ea(d)}),r]})]},vt(i.method))}default:return null}})})}function tm({paymentExemptionReason:e}){const{checkout:{identity:n}}=y();return n.current.value==="shopPay"&&(e==="storeCredit"||e==="redeemables")?t(Tt,{vaulted:!0,reason:e}):t(Wi,{})}function nm({hasPersistentRedeemablesManagement:e,openSignal:n}){const{checkout:a}=y(),s=Pp(),o=Ba();return s.value==="freeOrder"?t(Tt,{vaulted:!0,reason:"freeOrder"}):s.value==="giftCard"?t(Tt,{vaulted:!0,reason:"giftCard"}):am({identity:a.identity,paymentExemptionReason:s.value,paymentFullyCoveredByRedeemablesAndGiftCards:o.value})?t(tm,{paymentExemptionReason:s.value}):t(b,{gap:"small-200",children:[!e&&t(Wi,{}),t(em,{openSignal:n})]})}function am({identity:e,paymentExemptionReason:n,paymentFullyCoveredByRedeemablesAndGiftCards:a}){return a?e.current.value!=="shopPay"?!0:n==="storeCredit"||n==="redeemables":!1}function sm(){const{checkout:e}=y(),n=e.latestReceipt.value,{value:a}=Y().paymentMethods,{inMemoryGooglePayParts:{sdkStatus:s,paymentSheetError:o},persistedGooglePaySignal:i,receiptErrorSignal:r}=an(),l=vl({shouldResetCustomerInfo:!1}),d=ho(n?.status==="failed"&&n.failure.type==="payment"?n.failure:void 0),c=q(l);return c.current=l,Me(()=>{s.value.status==="error"&>(()=>{c.current(),o.value={type:En}})}),L(()=>{const u=()=>{c.current(),i.value={...i.value,receiptIdForPaymentFailure:n?.id}};!Uo(a,"GOOGLE_PAY")&&o.value?.type!==En&&(o.value={type:En}
2,u()),n?.id!==i.value?.receiptIdForPaymentFailure&&n?.status==="failed"&&n?.failure.type==="payment"&&(i.value={...i.value,receiptIdForPaymentFailure:n?.id},r.value=d)},[n,r,a,i,o,d]),L(()=>()=>{r.value=void 0},[r]),null}function om(){const{checkout:e}=y(),n=e.latestReceipt.value,{value:a}=Y().paymentMethods,{inMemoryPayPalParts:{paymentSheetError:s},persistedPayPalSignal:o}=an(),i=gl(),r=q(i);r.current=i;const l=ie(()=>Uo(a,"PAYPAL_EXPRESS"),[a]);return L(()=>{l||(r.current(),s.value={type:En})},[l,s]),L(()=>{if(!n)return;const d=n.id===o.value?.receiptIdForClearedToken,c=n.status==="failed"&&n.failure.type==="payment";!d&&c&&(o.value={...o.value,receiptIdForClearedToken:n?.id},r.current())},[n,l,s,o]),null}function im(){const{checkout:{identity:e}}=y();switch(e.current.value){case"payPal":return t(om,{});case"googlePay":return t(sm,{});default:return null}}function rm(){const e=y(),{checkout:n,i18n:a,shop:s,shopPay:o,webMcp:i}=e,r=n.identity.current.value==="shopPay",l=gp(),d="payment",{hasAnyPaymentError:c,clearReceiptError:u}=zh({clearReceiptErrorOnPaymentLineChange:!1}),{hasViolations:p}=We(Fa),{hasError:m}=fl(),{hasError:v}=Cl(),{paymentErrors:C}=Ra().value,f=C.length>0,{notSupportedError:g}=hp(),S=!!g,P=Y(),_=P.buyerIdentity,{value:I}=P.paymentFlexibilityPaymentTermsTemplate,M=_l(),E=I!=null&&!M.value,A=Hc().value,F=o.session.selectedPaymentMethod.value,T=zc(F),{value:N}=P.paymentMethods,V=Ci({enableAutoSelect:!1}),B=pp(V),{buyerHasActedSignal:R}=et();L(()=>{if(!(!i||!r))return i.unstable_provideSavedCardSelector(async Ue=>{const Ge=B.current;if(!(Ge instanceof Zu))return!1;const Ve=Ge.cardPaymentMethods.value.find(({method:Je})=>Je.id===Ue)?.method;return Ve?(R.value=!0,(await Ge.selectPaymentMethod(Ve,"programmatic",{rebuild:!0})).status==="handled"):!1})},[B,r,i,R]);const H=V.paymentMethods.value.length>0;xh();const X=F!=null&&Uc(F)?F.paymentBrands??[]:[],Z=X.length>0?N?.find(Ue=>zo(Ue,X)):void 0,O=Sl("Checkout::PaymentMethod::Render",Z?.uiExtension?[Z.uiExtension]:[]),x=lm(e,{customerProfile:_.value?.customerProfile}),j=x&&(r||H),W=x&&V.cardPaymentMethods.value.length===0,{expandedSlot:z,collapsedSlot:oe}=Qu(V),ee=c||S||f||m||v,{directPaymentErrors:Q,paymentLines:le}=ne(),de=le.value.some(Ue=>Ue.method.type===Gc.CreditCard&&Ue.method.requiresCvvConfirmation),te=s.storeVaultGuestCvvVerificationEnabled&&de,Ce=!!T&&!T?.expired&&!T?.verified,Ae=!!T?.expired||ee||E||A||te||Ce,fe=se("purchase.checkout.payment-method-list.render-before"),ve=se("purchase.checkout.payment-method-list.render-after"),Ee=Mn([...fe,...ve]),Se=Mn(O),Re=Au([...fe,...ve]),J=Sa(),_e=Vo(),U=h(()=>J.value&&!_e.value?!0:!!_.value?.purchasingCompany),ae=Ft(d,Ae||p);Ja(O.map(qt),w(()=>{ae.value=!0},[ae])),L(()=>{(Ae||p)&&(ae.value=!0)},[Ae,p,ae]),ep();const Ne=w(()=>{ae.value&&Ms(Q)||(ae.value=!ae.value,ae.value&&l(),dm(e,ae.value))},[l,Q,ae,e]),be=$h(),De=t(nm,{openSignal:ae,hasPersistentRedeemablesManagement:be.hasPersistentRedeemablesManagement}),me=ee?t(um,{paymentErrors:C}):null,nt=cm(e),xe=nt&&U.value,He=!nt,ze=He?!1:ae.value,Ie=He?null:me||te,Xe=He?!1:Re||W||E,St=ze||Xe||!!Ie;Uh(r),Me(()=>{Ms(Q)&&(ae.value=!0)}),Za({autoOpen:!1,isMissing:te||Ce,open:ae});const at=xe?t(Oh,{usesSharedVaultedSelector:j,hasPersistentRedeemablesManagement:be.hasPersistentRedeemablesManagement,msiExpandedSlot:z,onSelectedPaymentMethodChange:u}):null;Me(()=>{(Ee.value||Se.value)&&(ae.value=!0)});const xt=be.show?t(Xh,{}):null,st=St?void 0:oe,bt=xt?t(b,{gap:"base",children:[xt,st]}):st;return t(G,{children:t(Ot,{target:"cart.paymentLines[0]",children:[t(ce,{open:ze,disabled:Xe,id:d,label:a.translate("payment.title"),icon:t(Ye,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),primaryContent:De,onToggle:xe?Ne:void 0,error:Ie,renderChildrenWhenCollapsed:xe,secondaryPersistentContent:bt,children:at}),t(im,{})]})})}function lm({checkout:e,shop:n,source:a},{customerProfile:s}){return e.identity.current.value==="shopPay"||Wc({identitySource:e.identity.current.value,isOrderSession:lt(a),storeVaultEnabled:n.storeVaultEnabled,customerProfile:s})}function cm({checkout:e}){switch(e.identity.current.value){case"payPal":case"googlePay":case"applePay":return!1;default:return!0}}function dm({userEvents:e,source:n,checkout:a,shop:s},o){a.identity.current.value==="shopPay"&&e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...Ke(n,a,s),action:o?"credit_card_expand":"credit_card_collapse"}})}function um({paymentErrors:e}){return t(K,{children:[e.length>0?t(Ia,{errors:e,errorType:Fe.PaymentError}):t(G,{children:[t(mp,{}),t(Gh,{})]}),t(je,{blockSize:"base"})]})}const pm="EnNLk",hm={InlineAlignmentWithContent:pm};function Bs({onPaymentDelegation:e}){const{embed:n,i18n:a}=y(),{rollup:{action:{tone:s}={}}={}}=Vt();return n?.embedder==="amazon"?t(we,{textDecoration:"none",onClick:e,children:t(k,{tone:"accent",children:a.translate("embed.payment.payment_options")})}
2):t(Dn,{tone:s==="custom"?"custom":void 0,onClick:e,variant:"plain",textDecoration:"none",children:a.translate("payment.choose_new_payment_method")})}const mm={visa:"Visa",mastercard:"Mastercard",americanexpress:"American Express",amex:"American Express",discover:"Discover",dinersclub:"Diners Club",maestro:"Maestro",jcb:"JCB"};function Fs(e){return e.toLowerCase().replace(/[-_]/g,"")}function da(e,n){return!e||Fs(e)==="unknown"?n.translate("payment_gateway.credit_card_label"):mm[Fs(e)]??n.translate("payment_gateway.credit_card_label")}function ym(){const{i18n:e,observability:n,embed:a,shop:s,shopPay:o,checkout:i}=y(),r=Sa(),l=qe(),{delegatedPaymentInstrument:d}=et(),{message:c,tone:u,inventoryRecoveryReceiptId:p}=Ei(),{rollup:{blockPadding:m}={}}=Vt(),{hasViolations:v,clearViolations:C}=pe(Fa);L(()=>{let J=Kt(d.peek());return d.subscribe(_e=>{const U=Kt(_e);U!==J&&(J=U,C())})},[d,C]);const f=!!a&&i.configuration.isPaymentInstrumentsDelegationEnabled&&!!d.value,g=f&&v,S=Kt(d.value),P=q(void 0);g&&(P.current=S);const _=Lp(d.value),{billingAddress:I}=ne(),M=!!(_&&!ha(I.value,Dp(_))),E=f&&(g||P.current===S&&M),A=a?.embedder,F=on({embedder:A,shop:s}),T=Tn(o.app.config),N=a?.isFlagshipPartner&&!pt(a.embedder)&&!T&&!F?e.translate("payment.payment_method"):e.translate("payment.title"),V=a?.client?.paymentErrors.value.includes(Ps.PaymentEmpty)??!1,B=q(!1),R=q(null),H=w(J=>{R.current=J,J&&B.current&&(J.focus(),B.current=!1)},[]),X=w(async()=>{const J=a?.client;if(!J)return;B.current=!1;const _e=R.current!==null;try{const U=await J.paymentMethodChangeStart();if(!U)return;if(U.ucpPaymentInstrument)n.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Kt(d.value)});else if(U.cart)try{await J.applyCart(U.cart),n.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Kt(d.value)})}catch(ae){n.log("delegated_payment_cart_update_error","Failed to apply cart update after payment selection",{error:String(ae)})}}finally{!J.paymentErrors.value.length&&_e&&(R.current?R.current.focus():B.current=!0)}},[a,n,d]),O=a?.client?.paymentErrors.value.includes(Ps.PaymentDelegationError)?e.translate("payment_errors.payment_credential_delegation_error"):void 0,x=O||c,j=O?"critical":u,W=In(m),z=r.value&&x?t(b,{direction:"block",gap:W,paddingBlockEnd:W,children:[t(yp,{message:x,tone:j,inventoryRecoveryReceiptId:O?void 0:p}),!E&&a?.isFlagshipPartner&&t(Bs,{onPaymentDelegation:X})]}):void 0;if(!r.value){const J=t(Tt,{vaulted:!0,reason:"freeOrder"}),_e=A==="amazon"?{compact:J}:{primary:J};return t(ce,{id:"payment",label:N,primaryContent:_e.primary,compactContent:_e.compact,icon:t(Ye,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"})})}const oe="payment",ee=d.value,Q=Tp(ee),le=Q?.brand,ye=Q?.lastDigits,de=!l.value||!ee||!le||!ye,te=de?e.translate("payment.add_payment_method"):void 0,Ce=t(k,{tone:"critical",children:e.translate("payment.add_payment_method")}),Ae=ye?t(k,{accessibilityVisibility:"exclusive",children:`${da(le,e)} ${e.translate("payment.ends_with_label",{last_digits:ye})}`}):null,fe=t(k,{accessibilityVisibility:"hidden",children:[da(le,e),t(ya,{}),ye]}),ve=(()=>{if(!de)return t(b,{direction:"inline",gap:"small-400",alignItems:"center",children:[Ae,fe,t(Le,{type:le,size:"small",accessibilityVisibility:"hidden"})]})})(),Ee=de?t(k,{tone:V?"critical":void 0,children:e.translate("payment.add_payment_method")}):t(b,{direction:"inline",gap:"small-400",alignItems:"center",children:[t("span",{"aria-hidden":"true",className:hm.InlineAlignmentWithContent,children:t(Le,{type:le})}),Ae,fe]}),Se=de?t(k,{tone:"accent",decoration:"underline",children:e.translate("payment.add_new_payment_method")}):t(b,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(k,{children:e.translate("payment.pay_with")})," ",Ae,t(k,{type:"strong",accessibilityVisibility:"hidden",children:[da(le,e),t(ya,{}),ye]}),t(Le,{type:le,accessibilityVisibility:"hidden"})]}),Re=A==="amazon"?{compact:Se}:A==="google"&&!F?{primary:Ee}:{primary:ve,secondary:ve===void 0?Ce:void 0};return t(ce,{buttonRef:H,id:oe,label:N,open:E,disabled:E,onToggle:z?void 0:X,primaryContent:Re.primary,secondaryContent:Re.secondary,compactContent:Re.compact,buttonAccessibilityLabel:te,icon:t(Ye,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),error:z,children:E?t(b,{direction:"block",gap:"base",children:[t(Be,{level:3,children:e.translate("billing.billing_address_title")}),t(Mp,{}),a?.isFlagshipPartner?t(Bs,{onPaymentDelegation:X}):null]}):null})}const vm=new Set(["amazonPay","buyWithPrime"]);function Ca(){const{checkout:{identity:e}}=y();return vm.has(e.current.value)?t(_h,{}):e.current.value==="sdkCartHints"?t(ym,{}):t(rm,{})}function Yi(e){if(e?.status!=="filled")return null;const{discountOffer:n}=e;if(!n.offerAmount||!n.campaignHandle)return null;const a=n.minimumOrderValue?{amount:n.minimumOrderValue,satisfied:!!n.minimumOrderValueSatisfied,remainingAmou
2nt:n.minimumOrderValueRemainder??null}:null;return{adType:"SHOP_CASH_OFFER",campaignHandle:n.campaignHandle,offerAmount:n.offerAmount,redeemableAmount:!a||a.satisfied?n.offerAmount:null,minimumOrderValue:a}}function zn(){const{checkout:e}=y(),n=q(null);return h(()=>{const a=e.proposal.negotiated.fields.shopDiscountOffer.value;return a?.status==="unavailable"?(n.current=null,null):(a?.status!=="filled"||(n.current=Yi(a)),n.current)})}function gm(){const e=Np(),n=Y(),a=n.paymentMethods,s=n.shopCashBalance;return h(()=>{const{nonEligibleReason:o}=e.value,i=!!a.value?.some(c=>c.type==="redeemable"&&c.redemptionSource==="SHOP_CASH"),r=s.value,l=r==null||r.status==="unavailable";let d;return l?d=As.ShopCashNotAvailable:i?d=o:d=As.ShopCashMerchantNotSupported,{nonEligibleReason:d}})}const Un=()=>{const e=gm();return h(()=>{const{nonEligibleReason:n}=e.value;return n?{eligible:!1,reason:n}:{eligible:!0}})},ji=()=>{const e=y().shopPay.app.config,n=vp();return Yc(e,n)};function fm(e,n,a){L(()=>{if(!(!e||!a))return e.recordPresentation({component:n,displayLabel:a})},[n,a,e])}const Cm=()=>{const e=Y().discountLines;return h(()=>{const n=e.value,a=n?n.lines.some(o=>Os(o)?o.allocations.some(i=>i.target.type==="MERCHANDISELINE"):!1):!1,s=n?n.lines.filter(i=>Os(i)&&i.discount.presentationLevel==="CART"&&i.allocations.some(r=>r.target.type==="MERCHANDISELINE")).reduce((i,r)=>{const l=r.amount?.amount;return l?i+l:i},0):0;return{hasMerchandiseDiscounts:a,orderDiscountAmount:s}})};function _m(e){if(typeof window>"u")return;const n=Sm(e);n&&window.parent.postMessage({jsonrpc:"2.0",method:"ec.keep_shopping"},n)}function Sm(e){if(e)try{return new URL(e).origin}catch{return}}const bm=()=>{const{embed:e,i18n:n,shop:a,shopPay:s}=y(),o=pt(e?.embedder),i=s.app.config.surface,r=a.hasFlagEnabled(xa),l=mo();return(o?i==="shop_app":r||i==="shop_app")?t(we,{tone:"monochrome",onClick:()=>{if(o){_m(e?.client?.embedderOrigin);return}l.notify({keep_shopping:!0})},children:t(k,{size:"small",children:n.translate("shop_cash.minimum_order_value_banner_keep_shopping")})}):null},Pm="O9AXs",Am="dHa7y",xs={ShopCashMinimumOrderValueBannerLight:Pm,ShopCashMinimumOrderValueBannerDark:Am},Hs=({adType:e,offerAmount:n,minimumOrderValueAmount:a,remainingAmount:s,incentivePresentation:o})=>{const{i18n:i}=y(),r=ji(),{hasMerchandiseDiscounts:l}=Cm().value,d=i.formatCurrency(n.amount,{currency:n.currencyCode,form:"short"}),c=i.formatCurrency(a.amount,{currency:a.currencyCode,form:"short"}),u=s?i.formatCurrency(s.amount,{currency:s.currencyCode,form:"short"}):void 0,p=Em({adType:e,formatMinimumOrderAmount:c,formatRemainingAmount:u,formatOfferAmount:d,hasMerchandiseDiscounts:l});return fm(o,"minimumOrderValueBanner",e==="FLAT_AMOUNT_CASHBACK_OFFER"?p:void 0),t(K,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:r?xs.ShopCashMinimumOrderValueBannerDark:xs.ShopCashMinimumOrderValueBannerLight,children:[t(he,{type:"small",children:p}),t(bm,{})]})},Em=({adType:e,formatMinimumOrderAmount:n,formatRemainingAmount:a,formatOfferAmount:s,hasMerchandiseDiscounts:o})=>{const{i18n:i}=y(),r=o||!a;return e==="SHOP_CASH_OFFER"?r?i.translate("shop_cash.minimum_order_value_banner_discounts_offer_amount",{formatBoostedAmount:s,formatMinimumOrderAmount:n}):i.translate("shop_cash.minimum_order_value_banner",{formatRemainingAmount:a,formatBoostedAmount:s}):e==="FLAT_AMOUNT_CASHBACK_OFFER"?r?i.translate("shop_cash.minimum_order_value_banner_discounts_flat_cashback",{formatOfferAmount:s,formatMinimumOrderAmount:n}):i.translate("shop_cash.minimum_order_value_banner_flat_cashback",{formatRemainingAmount:a,formatOfferAmount:s}):""};function Ki({eligibility:e,discountOffer:n}){const a=wt(Ka),s=a?.cashback?.incentive;if(!e.eligible)return[];const o=[];return n?.minimumOrderValue&&!n.minimumOrderValue.satisfied&&o.push(t(Hs,{adType:n.adType,offerAmount:n.offerAmount,minimumOrderValueAmount:n.minimumOrderValue.amount,remainingAmount:n.minimumOrderValue.remainingAmount},"mov-discount")),Rm(s)&&o.push(t(Hs,{adType:"FLAT_AMOUNT_CASHBACK_OFFER",offerAmount:s.cashbackAmount,minimumOrderValueAmount:s.minimumOrderValue,remainingAmou
2nt:s.minimumOrderValueRemainder,incentivePresentation:a?.incentivePresentation},"mov-cashback")),o}function Rm(e){return!!(e?.__typename==="ShopCashCheckoutFlatAmountCashbackIncentive"&&e.minimumOrderValue&&!e.minimumOrderValueSatisfied)}function Im(){const{checkout:e,embed:n}=y(),{main:{section:a}}=ka(),s=Un().value,o=zn(),i=Pe().value.payment,r=Ki({eligibility:s,discountOffer:o.value});return pt(n?.embedder)&&!e.configuration.visibility.showCashRedemption.value&&r.length>0?i?t(b,{padding:km(a?.padding),gap:"small-200",children:r}):t($t,{hideDivider:i,condition:!i,padding:"none large-200",children:t(b,{padding:"small-200 none",gap:"small-200",children:r})}):null}function km(e){const[n,a]=Mm(e),s=In(n)??"none",o=In(a)??"none";return`small-200 ${s} small-200 ${o}`}function Mm(e){return Array.isArray(e)?e.length===2?[e[1],e[1]]:[e[1],e[3]]:[e,e]}const Om="mu1NS",Lm={ShopCashSwitch:Om};function qi({checked:e,onChange:n,disabled:a}){return t(zp,{checked:e,onChange:n,icon:"none",className:Lm.ShopCashSwitch,accessibilityLabel:"Shop Cash",disabled:a})}function yt(e,n){return e==null&&n==null?!0:e==null||n==null?!1:e.amount===n.amount&&e.currencyCode===n.currencyCode}const es=e=>e.method.type==="redeemable"&&e.method.redemptionSource==="SHOP_CASH",$i=e=>{if(!e)return oa;if(!e.method.redemptionContent?.details)return oa;const n={...oa};for(const a of e.method.redemptionContent.details){const s=wn.find(i=>i===a.redemptionType);if(s===void 0)continue;const o={id:a.redemptionId??s,promotionId:s==="SHOP_PROMOTION"?a.redemptionId:void 0,type:s,destinationAmount:Bp(a.destinationAmount),sourceAmount:Vp(a.sourceAmount)};s==="SHOP_PROMOTION"?n.SHOP_PROMOTION=[...n.SHOP_PROMOTION,o]:n[s]=o}return n},ts=(e,n)=>{const a=e[n];return Array.isArray(a)?a.length>0:a!=null},_t=()=>{const{paymentLines:e}=Y();return h(()=>$i(e.value?.lines.find(es)))},Xi=()=>{const{paymentLines:e}=ne();return h(()=>$i(e.value?.find(es)))},ua=e=>({type:e.type,amount:e.destinationAmount,promotionId:e.promotionId}),Gn=({enabled:e=!0}={})=>{const{shopPay:n}=y(),a=Xi(),o=wt(Ka)?.redemption.applying,{negotiate:i}=ut(),l=ne().paymentLines,d=Fp(),c=Ap(),u=Y().buyerIdentity.value?.shopUser?.publicId,p=n.session.isInternalProgressing.value,m=o?.value===!1,v=e&&!!u&&!p&&m,{SHOP_CASH_BALANCE:C,SHOP_DISCOUNT_OFFER:f,SHOP_PROMOTION:g}=a.value,S=C?ua(C):null,P=f?ua(f):null,_=g.map(ua),I=async(E,{onNegotiateAccepted:A}={})=>{const{SHOP_CASH_BALANCE:F=S,SHOP_DISCOUNT_OFFER:T=P,SHOP_PROMOTION:N=_}=E,V=n.session.isInternalProgressing.value;if(!e||!o||V||!u||o.peek())return;Mt(()=>{o.value=!0});const B=l.peek().filter(z=>z.method.type!=="redeemable"||z.method.redemptionSource!=="SHOP_CASH"),R=Object.values(E).flatMap(z=>Array.isArray(z)?z:[z]).find(z=>z!=null)?.amount.currencyCode,H=[F,T,...N??[]].filter(z=>z!==null&&(!R||z.amount.currencyCode===R)),{selectedBillingAddress:X,selectedShippingAddress:Z,isUsingApplePayShippingFallback:O}=d.value,x=!X.address1||c.value==="APPLE_PAY",W=M(H,O||!Z||!x?X:Z);W&&B.push(W),l.value=B;try{A?.(),await i({include:["paymentLines","billingAddress"],silenceViolations:["non-shop-cash"]})}finally{Mt(()=>{o.value=!1})}},M=(E,A)=>{if(!u||E.length===0)return null;const F=E.reduce((N,V)=>N+V.amount.amount,0),T=E[0].amount.currencyCode;return{cost:{amount:F,currencyCode:T},method:{type:"redeemable",redemptionSource:"SHOP_CASH",redemptionContent:{redemptionId:u,billingAddress:{streetAddress:A?{address1:A.address1??"",address2:A.address2,city:A.city??"",company:A.company,firstName:A.firstName,lastName:A.lastName??"",phone:A.phone,postalCode:A.postalCode,zoneCode:A.zoneCode,countryCode:A.countryCode??""}:null},destinationAmount:{amount:F.toString(),currencyCode:T},sourceAmount:{amount:F.toString(),currencyCode:T},redemptionPaymentOptionKind:"decoupled",details:E.map(N=>({sourceAmount:N.amount?{amount:N.amount.amount.toString(),currencyCode:N.amount.currencyCode}:null,destinationAmount:{amount:N.amount.amount.toString(),currencyCode:N.amount.currencyCode},redemptionId:N.promotionId??N.type,redemptionType:N.type}))}}}};return{isShopCashNegotiationReady:v,negotiateShopCash:I}},It=Go,Ji=e=>{const{i18n:n,shopPay:a,webMcp:s,checkout:o}=y(),{isShopCashNegotiationReady:i,negotiateShopCash:r}=Gn(),l=Xi(),d=_t(),{applying:c}=Ep().redemption,{buyerIdentity:u,shopCashBalance:p}=Y(),m=u.value,v=p.value,C=!!l.value[It],f=d.value[It]?.destinationAmount||null,g=w(async I=>{if(c.value)return;const M=I?e:null;yt(f,M)&&yt(l.value[It]?.destinationAmount,M)||await r({[It]:M?{type:"SHOP_CASH_BALANCE",amount:M,promotionId:null}:null})},[f,e,r,c,l]);L(()=>
2{if(!s||!(e.amount>0))return;const I=()=>i&&!c.value&&!a.session.isInternalProgressing.value&&u.value===m&&p.value===v;return s.unstable_registerDeclaredField({key:"shop_cash",read(){const M=o.latestReceipt.value?.status;if(!(M&&["processed","processing","processing_remote_checkouts","polling_for_order","action_required"].includes(M)))return{key:"shop_cash",purpose:"dev.shopify.shopping.declared_fields.generic",title:"Shop Cash",description:"Apply the available Shop Cash balance. Resend true to retain it in a checkout update; omission or null removes it.",value_schema:{type:"boolean"},required:!1,value:!!l.value[It]}},prepare(M){if(M!==null&&typeof M!="boolean")return{requirement:"must be a boolean or null"};const E=M===!0;return{phase:"negotiate",changed:!0,async apply(){return I()?(await g(E),yt(d.value[It]?.destinationAmount??null,E?e:null)):!1}}}})},[s,o,a.session,e,l,d,i,c,u,m,p,v,g]),L(()=>{f&&(yt(f,e)||g(!0))},[e]);const S=n.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"}),P=n.translate("order_summary.shop_cash_title"),_=C?n.translate("shop_cash.redemption.balance.applied",{formattedAmount:S}):n.translate("shop_cash.redemption.balance.available",{formattedAmount:S});return{title:P,amount:_,checked:C,handleChange:g,disabled:c.value}},Dm="yY3sV",Tm={ShopCashToggleContainer:Dm},wm=({redeemableBalance:e})=>{const{title:n,amount:a,checked:s,handleChange:o,disabled:i}=Ji(e);return t("div",{className:Tm.ShopCashToggleContainer,children:t(va,{theme:{rollup:{blockAlignment:"center"}},children:t(ce,{label:n,primaryContent:a,primaryAction:t(qi,{checked:s,onChange:o,disabled:i})})})})},Nm="Q9An4",Vm="K92xU",zs={ShopCashVaultedCreditCardRequiredBanner:Nm,Dark:Vm},Bm=()=>{const{i18n:e}=y(),n=ji(),a=e.translate("payment_errors.vaulted_card_required_error");return t(K,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:ro(zs.ShopCashVaultedCreditCardRequiredBanner,n&&zs.Dark),children:t(he,{type:"small",children:a})})},ns=()=>{const e=Y().subtotalAfterMerchandiseDiscounts,n=Ho(),a=zm(),s=Um();return h(()=>{const o=n.value,i=o?{amount:Ii(o.amount-a.value-s.value,lo(o.currencyCode)),currencyCode:o.currencyCode}:void 0;return{orderTotal:o,orderSubtotal:e.value,redeemableTotal:i}})},Fm=e=>e.method.type==="giftCard",xm=e=>e.method.type==="redeemable",Hm=e=>e.method.redemptionSource==="SHOP_CASH",zm=()=>{const{paymentLines:e}=Y();return h(()=>(e.value?.lines??[]).reduce((a,s)=>s.cost&&(Fm(s)||xm(s)&&!Hm(s))?a+s.cost.amount:a,0))},Um=()=>{const e=_t();return h(()=>Object.values(e.value).flatMap(n=>Array.isArray(n)?n:[n]).reduce((n,a)=>!a||a.type==="SHOP_CASH_BALANCE"?n:n+a.destinationAmount.amount,0))},_n={availableBalance:null,redeemableBalance:null},Gm=()=>{const e=Y().shopCashBalance.value,n=q(null);return e?.status==="filled"?n.current=e.availableBalance:e?.status==="unavailable"&&(n.current=null),n.current},Wm=()=>{const e=Y().shopCashBalance.value,{redeemableTotal:n}=ns().value,a=Gm();if(e?.status==="filled"&&e.eligible&&e.redeemableBalance!=null&&e.redeemableBalance.amount>0)return{availableBalance:e.availableBalance,redeemableBalance:e.redeemableBalance};if(!a||a.amount<=0||!n)return _n;const s=Up(n.currencyCode);if(n.amount<=s)return _n;if(n.amount<a.amount)return{availableBalance:a,redeemableBalance:n};const o=Ii(n.amount-a.amount,lo(n.currencyCode));if(o>=s)return{availableBalance:a,redeemableBalance:a};const i=Gp({amount:a.amount-(s-o),currencyCode:a.currencyCode});return{availableBalance:a,redeemableBalance:i}};function Zi(){const e=q([]),n=ns(),{checkout:a}=y(),s=a.proposal.negotiated.fields.shopPromotion;return h(()=>{const{orderTotal:o}=n.value,i=s.value;return i?.status==="filled"?e.current=i.promotions:i?.status==="unavailable"&&(e.current=[]),Wp(e.current,o)})}const Ym=({eligibility:e,availableBalance:n,redeemableBalance:a,discountOffer:s})=>{const{recordRedemptionEligibilityEvent:o}=qa(),{orderTotal:i,orderSubtotal:r}=ns().value,l=ie(()=>{if(!s)return"NO_CAMPAIGN";if(s.minimumOrderValue&&!s.minimumOrderValue.satisfied)return"BELOW_MOV"},[s]),d=ie(()=>{if(i)return{balance:n?.amount??0,balanceCurrency:n?.currencyCode??"USD",totalPrice:i.amount,totalPriceCurrency:i.currencyCode,subtotalPrice:r?.amount??0,subtotalPriceCurrency:r?.currencyCode??"USD",maxTotalRedemptionAllowed:a?.amount??0,isBoostAvailable:!!s,boostCampaignId:s?.campaignHandle,offerAmountBelowMov:s?.minimumOrderValue?.remainingAmou
2nt?.amount,offerMinimumOrderValueRequired:s?.minimumOrderValue?.amount.amount,maxPostOfferRemainingAmount:0,maxOfferRedemptionAmount:s?.offerAmount?.amount,boostIneligibilityReason:l,redemptionIneligibilityReason:e.reason}},[n,i,r,s,a,l,e.reason]);L(()=>{d&&o(d)},[o,e.reason,n,a,s])},jm=e=>{const{client:n,shop:a,shopPay:s}=y(),{recordRedemptionVisibilityEvent:o}=qa(),i=n.unstable_getSerialization("apiClientId"),r=a.hasFlagEnabled(xa),l=s.app.config.surface,d=!!(typeof window<"u"&&window.ReactNativeWebView),c=Pe().value.payment,u=ie(()=>({visibility:"visible",reason:e.reason??"none",position:c?"vaulted":"unvaulted",shopPayCheckoutSurface:l,isReactNativeWebview:d,isShopCashBalanceBetaEnabled:r,apiClientId:i,isOnePageCheckout:!0,nEnabledCreditCards:0}),[l,d,r,i,e.reason,c]);L(()=>{o(u)},[o,e.reason])},Km="https://shop.app/shop-cash-terms",qm=e=>{const n=$m(),{paymentLines:a}=Y(),o=Ba().value&&!!a.value?.lines.find(es);return{eligibilityMessage:n(e.reason),showVaultedCardBanner:o}},$m=()=>{const{i18n:e}=y();return n=>{if(n)switch(n){case"SHOP_CASH_INVALID_BILLING_ADDRESS":return e.translate("shop_cash.redemption_invalid_billing_address");case"SHOP_CASH_INVALID_SHIPPING_ADDRESS":return e.translate("shop_cash.redemption_invalid_shipping_address");case"SHOP_CASH_MERCHANT_NOT_SUPPORTED":case"PAYMENTS_SHOP_CASH_UNSUPPORTED_CURRENCY":return e.translate("shop_cash.redemption_unsupported_merchant");case"SHOP_CASH_UNSUPPORTED_DELIVERY_METHOD_TYPE":return e.translate("shop_cash.redemption_unsupported_delivery_method");case"PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING":return e.translate("shop_cash.redemption_unsupported_shipping");case"PAYMENTS_SHOP_CASH_GIFT_CARD_NOT_ALLOWED":return e.translate("shop_cash.redemption_unsupported_gift_cards");case"INSUFFICIENT_FUNDING_LEDGER_BALANCE":return e.translate("shop_cash.redemption_error_exclusive_campaign_out_of_funds");case"BUYER_BALANCE_HOLD_ERROR":return e.translate("shop_cash.redemption_balance_hold",{shopRewardsTermsLink:t(we,{target:"_blank",href:Km,children:e.translate("shop_cash.shop_rewards_terms")})});case"DISCOUNT_OFFER_ERROR":return e.translate("shop_cash.exclusive_offer_error");case"SHOP_CASH_NOT_AVAILABLE":case"PAYMENTS_SHOP_CASH_ORDER_TOTAL_TOO_LOW":return;default:return e.translate("shop_cash.redemption_error")}}},as=()=>{const{recordRedemptionActionEvent:e}=qa(),{shop:n,shopPay:a}=y(),s=n.hasFlagEnabled(xa),o=a.app.config.surface,i=!!(typeof window<"u"&&window.ReactNativeWebView),r=ie(()=>({shopPayCheckoutSurface:o,isReactNativeWebview:i,isShopCashBalanceBetaEnabled:s,isOnePageCheckout:!0,nEnabledCreditCards:0}),[o,i,s]),l=w(m=>{e({...r,...m})},[r,e]),d=w((m,v)=>{l({action:"auto-apply",redemptionType:m,source:v})},[l]),c=w((m,v)=>{l({action:"manually-apply",redemptionType:m,source:v})},[l]),u=w((m,v)=>{l({action:"auto-remove",redemptionType:m,source:v})},[l]),p=w((m,v)=>{l({action:"manually-remove",redemptionType:m,source:v})},[l]);return{recordRedemptionAutomaticallyApplied:d,recordRedemptionAutomaticallyRemoved:u,recordRedemptionManuallyApplied:c,recordRedemptionManuallyRemoved:p}},Qi=({enabled:e=!0,redemptionTypes:n=wn}={})=>{const a=_t(),o=wt(Ka)?.cashbackState.stale,{recordRedemptionAutomaticallyRemoved:i}=as(),{negotiateShopCash:r}=Gn({enabled:e}),{hasViolations:l}=pe(jc);L(()=>{if(!e||!o||!l)return;let d=!1;for(const c of n)ts(a.value,c)&&(d=!0,i(c,"useRemoveRedemptionsOnViolation"));d&&(o.value=!0,r(Object.fromEntries(n.map(c=>[c,null]))))},[e,l])},er=(e,{enabled:n=!0}={})=>{const{negotiateShopCash:a}=Gn({enabled:n}),{recordRedemptionAutomaticallyRemoved:s}=as(),o=_t(),i=e.filter(r=>!r.eligibility.eligible).flatMap(r=>r.redemptionTypes??wn);L(()=>{if(!n||i.length===0)return;let r=!1;for(const l of i)ts(o.value,l)&&(r=!0,s(l,"useRemoveRedemptionsWhenIneligible"));r&&a(Object.fromEntries(i.map(l=>[l,null])))},[n,i.join(",")])},Xm=()=>{Jm()},Jm=()=>{const{observability:e,source:n}=y(),a=Y().paymentLines.value,s=ie(()=>a?.lines.filter(i=>i.method.type==="redeemable"&&i.method.redemptionSource==="SHOP_CASH")??[],[a]),o=q(!1);L(()=>{if(!s||s.length<=1||o.current)return;const i=JSON.stringify(s.map(r=>r.method.redemptionContent?.details?.map(l=>({redemptionPaymentGroupId:r.method.redemptionContent?.redemptionId,redemptionId:l.redemptionId,type:l.redemptionType,amount:l.destinationAmount}))));o.current=!0,e.error(new Zm,{severity:"error",metadata:{shopCash:{redemptions:i},source:{type:n.type},checkout:{token:n.checkoutSessionIdentifier||n.sourceId}}})},[s,e,n])};
2class Zm extends Error{constructor(){super("Multiple Shop Cash payment lines present in negotiation response"),this.name="MultipleShopCashPaymentLinesAnomaly"}}function Qm(e){const n=q(!1),a=q(performance.now()),{observability:s}=y();L(()=>{if(!n.current&&e&&e.amount>0){const o=performance.now()-a.current;s.histogram({name:"new_performance_shop_cash_balance_display_time",value:Math.round(o)}),n.current=!0}},[e,s])}const ey=({message:e})=>t(ct,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",borderRadius:"base",borderWidth:"base",padding:"small-400 small-200",gap:"small-200",accessibilityRole:"alert",alignItems:"center",alignContent:"center",children:[t(Ye,{type:"alert-circle",size:"small"}),t(he,{color:"subdued",size:"small",children:e})]});function tr(){const{eligibility:e,redeemableBalance:n,availableBalance:a,discountOffer:s,messages:o,showVaultedCardBanner:i,vaulted:r,isDigitalGoodsRedemptionAllowed:l}=nr();return Qm(a),er([{eligibility:e,redemptionTypes:[Go]},{eligibility:e,redemptionTypes:[Kc,qc]}]),Qi(),jm(e),Ym({eligibility:e,availableBalance:a,redeemableBalance:n,discountOffer:s.value}),Xm(),{eligibility:e,redeemableBalance:n,messages:o,showVaultedCardBanner:i,vaulted:r,isDigitalGoodsRedemptionAllowed:l}}function nr(){const e=Pe().value.payment,n=Un().value,{redeemableBalance:a,availableBalance:s}=Wm(),o=zn(),r=Zi().value,l=Ki({eligibility:n,discountOffer:o.value}),{eligibilityMessage:d,showVaultedCardBanner:c}=qm(n),u=!n.eligible&&n.reason==="PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING",p=[];return d&&!u&&p.push(t(ey,{message:d},"eligibility-banner")),p.push(...l),{eligibility:n,redeemableBalance:a,availableBalance:s,discountOffer:o,shopPromotionDiscounts:r,messages:p,showVaultedCardBanner:c,vaulted:e,isDigitalGoodsRedemptionAllowed:u}}function ty(){const{eligibility:e,messages:n,redeemableBalance:a,discountOffer:s,shopPromotionDiscounts:o,isDigitalGoodsRedemptionAllowed:i}=nr(),r=_t();if((e.eligible||i)&&a)return!0;const l=s?.value?.redeemableAmount,d=o.length>0;return!!(e.eligible&&(l||d)||wn.some(u=>ts(r.value,u))||n.length>0)}const ny=()=>{const{eligibility:e,redeemableBalance:n,messages:a,showVaultedCardBanner:s,vaulted:o,isDigitalGoodsRedemptionAllowed:i}=tr();return s&&!o&&a.push(t(Bm,{})),t(G,{children:[(e.eligible||i)&&n&&t($t,{hideDivider:o,condition:!o,children:t(wm,{redeemableBalance:n})}),a.length>0&&t($t,{hideDivider:o,condition:!o,padding:"none large-200",children:t(b,{padding:"small-200 none",gap:"small-200",children:a})})]})};function dt({message:e}){return e?t(Lt,{errorType:Fe.DeliveryError,tone:"critical",children:t(b,{al
2ignItems:"start",gap:"small-500",children:t(k,{children:e})})}):null}function ar({formattedAddress:e}){const{i18n:n,checkout:a}=y(),s=Y().buyerIdentity.value?.purchasingCompany,r=a.addressManager.shipping.value.selectedAddress.value?.id===wp&&$c(s)||!e;return t(b,{children:[r&&t(he,{children:s?.location.name}),e?t(he,{children:e}):t(he,{color:"subdued",children:n.translate("review.blocks.no_address")})]})}const ay=new Set(["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE"]);function ss({id:e="deliveryAddress",label:n,formattedAddress:a}){const{i18n:s}=y(),o=Ft(e),i=Y().buyerIdentity.value?.purchasingCompany,r=yo(),l=vo(),{hasViolations:d}=pe(ay),{deliveryAddressErrors:c}=Ra().value,u=a??l,p=()=>{o.value=!o.value},m=ie(()=>[`single_choice_${e}`],[e]),v=n??s.translate("shipping.shipping_address_title"),C=t(ar,{formattedAddress:u}),f=t(G,{children:[t(Ri,{name:`single_choice_list_${e}`,values:m,hideRadioControl:!0,children:t(Jt,{value:`single_choice_${e}`,children:t(b,{children:[t(he,{children:i?.location.name}),t(he,{color:"subdued",children:u??s.translate("review.blocks.no_address")})]})})}),t(D,{when:r,children:t(K,{padding:"small-200 small-100 none small-100",children:t(Pi,{showIcon:!0})})})]}),g=S();function S(){return e!=="deliveryAddress"?null:d?t(dt,{message:s.translate("shipping_errors.shipping_method_not_available_generic.one")}):c.length>0?t(Ia,{errors:c,errorType:Fe.DeliveryError}):null}return t(ce,{id:e,label:v,open:o.value,onToggle:p,primaryContent:C,error:g,children:f})}function sy(e){const n=e.current.value;return n==="customerAccount"||n==="businessCustomer"}function _a({isAbovePaymentSummary:e=!1}={}){const{checkout:{identity:n}}=y(),a=Y().buyerIdentity.value?.purchasingCompany;return sy(n)&&!e?t(Us,{renderInlineSelector:!0}):a?t(oy,{purchasingCompany:a}):t(Us,{})}function oy({purchasingCompany:e}){const{i18n:n}=y(),{shippingAddress:a,name:s}=e.location,{secondary:o}=fo({address:a??{},nameLinePosition:"inline",addressDisplayName:s}),i=a?o:n.translate("review.blocks.no_address");return t(ss,{id:"billingAddress",label:n.translate("company_location.location_title"),formattedAddress:i})}function Us({renderInlineSelector:e=!1}={}){const n=ne(),a=n.billingAddress.value,s=sr().value,o=s!=null&&n.billingAddressOption.value===s.option,i=bl().value!=="form",r=o&&s.sameAsShipping&&!i,l=r?s.address:a,d=nn(l,{displayName:!1}),{i18n:c,checkout:{identity:u}}=y(),{isMissingPhone:p}=_i({addressType:"billing"}),{isMissingFirstName:m}=Si({addressType:"billing"}),v=p||m,C="billingAddress",f=Ft(C),g=$e("deliveryNext").value,S=q(!0),{hasViolations:P,violations:_,clearViolations:I}=We(Fa),M=new Set([...p?["PAYMENTS_PHONE_NUMBER_REQUIRED"]:[],...m?Xc:[]]),E=go(P,_,M),{hasViolations:A}=We(Jc);L(()=>{E&&(f.value=!0)},[E,f]),L(()=>{if(S.current){S.current=!1;return}I()},[I,a]),Za({isMissing:v,open:f});const F=iy(),T=w(()=>{const H=!f.value;return F?.(H),f.value=H,H},[F,f]);let N=E;ry(u,A)?N=t(Lt,{errorType:Fe.PaymentError,tone:"critical",children:c.translate("payment.billing_must_match_shipping_notice")}):E&&!g&&(N=t(Lt,{errorType:Fe.PaymentError,tone:"critical",children:c.translate("address_management.invalid_billing_address_selected")}));const V=c.formatName(l?.firstName,l?.lastName,!0);let B,R;return!o||r?(B=V,R=d):s.sameAsShipping?B=c.translate("billing.same_as_shipping"):B=d,t(ce,{id:C,label:c.translate("billing.billing_address_title"),open:f.value,onToggle:T,error:N,primaryContent:B,secondaryContent:R,renderChildrenWhenCollapsed:v,children:t(Dh,{renderInlineSelector:e})})}function sr(){const{checkout:e}=y(),{buyerIdentity:n}=Y(),a=Pl();return h(()=>{if(n.value?.purchasingCompany){const{address:s,type:o}=e.addressManager.billing.value.suggestedAddress.value;return!s||o!=="billing"&&o!=="billing-fact"&&o!=="shipping"?null:{option:o,address:s,sameAsShipping:!1}}return{option:"shipping",address:a.value,sameAsShipping:!0}})}function iy(){const{userEvents:e,source:n,checkout:a,shop:s}=y(),{billingAddress:o,billingAddressOption:i,shippingAddress:r}=ne(),l=sr(),d=w(p=>{p?i.value="custom":ha(o.value,r.value)?i.value="shipping":i.value="custom"},[o,i,r]),c=w(p=>{const m=l.value;p?(m&&i.value===m.option&&(o.value=m.address),i.value="custom"):m&&ha(o.value,m.address)?i.value=m.option:i.value="custom"},[o,i,l]),u=w(p=>e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...Ke(n,a,s),action:p?"billing_addresses_expand":"billing_addresses_collapse"}}),[a,e,s,n]);return ly({identity:a.identity,switchBillingAddressOption:d,switchAndPrefillBillingAddressOption:c,recordShopPayInteraction:u})}function ry(e,n){return e.current.value==="applePay"&&n}function ly({identity:e,switchBillingAddressOption:n,switchAndPrefillBillingAddressOption:a,recordShopPayInteraction:s}){switch(e.current.value){case"payPal":return n;case"customerAccount":case"businessCustomer":return a;case"shopPay":return s;default:return}}function cy(){const{checkout:{wallets:e}}=y(),{persistedPayPalSignal:n,inMemoryPayPalParts:{accountStatus:a}}=an(),{clearForcedCheckoutLayout:s}=Al(Zc),o=w(()=>{n.value={isVenmo:!1},a.value={status:"not_connected"},s({wallet:e.escalatedWallet.value})},[e.escalatedWallet,n,a,s]);return El({onClick:o,shouldResetCustomerInfo:!0,skipRedirect:!0})}function or(e,n){return e?n?`${n} · ${e}`:e:""}class tt{constructor(n,a){this.appContext=n,this.providerData=a,this.triggerClientSideValidation=this.triggerClientSideValidation.bind(this),this.mapServerViolationsToClient=this.mapServerViolationsToClient.bind(this)}get email(){return this.appContext.checkout.proposal.proposed.email.value||void 0}get phone(){return this.appContext.checkout.proposal.proposed.phone.value||void 0}get displayContent(){return{contact:this.email}}get moreOptions(){if(this.hasCheckoutAsGuest(this.providerData))return this.providerData.checkoutAsGuest?[this.providerData.checkoutAsGuest]:void 0}get showShopPayVerification(){return!1}get hasError(){return!1}get shouldHide(){return!1}get shouldTriggerValidation(){return!1}get shouldClearClientSideValidation(){return!1}get shouldMapServerViolationsToClient(){return!1}triggerClientSideValidation(){return!1}clearClientSideValidation(){}mapServerViolationsToClient(){}get isEmbeddedPartner(){return!!this.appContext.embed?.isFlagshipPartner}get logo(){return null}get displayOptions(){return{vaultedContactType:"base",contentLayout:void 0}}hasCheckoutAsGuest(n){return typeof n=="object"&&n!==null&&"checkoutAsGuest"in n}}class dy extends tt{get displayContent(){const n=this.appContext.checkout.proposal.proposed.email.value,a=this.appContext.checkout.proposal.proposed.shippingAddress.fields.firstName.value;return{contact:or(n,a)}}get logo(){const n=this.isEmbeddedPartner?"xsmall":"medium";return t(dn,{wallet:Na.AmazonPay,size:n})}}class uy extends tt{get logo(){return t(dn,{wallet:"APPLE_PAY_BORDERLESS",size:"xsmall"})}}const Gs="large-400";function py(){return t(b,{"aria-busy":!0,alignItems:"center",display:"inline",justifyContent:"center",children:t(b,{borderRadius:"fullyRounded",overflow:"hidden",children:t(Ma,{contentDisplay:"block",children:t(ir,{})})})})}function ir(){return t(je,{blockSize:Gs,inlineSize:Gs})}const hy=Qt({displayName:"VaultedContactAvatar",suspense:!1,load:()=>en(()=>Zt(()=>import("./VaultedContactAvatar.C3VcwZhA.js").then(e=>e.V),__vite__mapDeps([106,1,2,3,4,5,6,7,8,9,10,107]))),renderLoading:()=>t(py,{}),renderError:()=>t(ir,{}),useError:Rl("VaultedContactAvatar")});function os(e,n=""){const a=e?.customerProfile?.firstName?.charAt(0),s=e?.customerProfile?.lastName?.charAt(0),o=n.charAt(0),i=(a??s??o).toUpperCase();return i?t(hy,{initials:i}):null}class my extends tt{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.fields?.buyerIdentity.value}get isOrderOrDraftSession(){return Il(this.appContext.source)}get displayContent(){const n=this.buyerIdentity?.purchasingCompany?.company.name??"",a=this.email;return{contact:this.appContext.i18n.translate("contact.company_contact_info",{companyName:n,contact:a??""})}}get logo(){return os(this.buyerIdentity,this.email)}get displayOptions(){return{vaultedContactType:"base",contentLayout:"box"}}get moreOptions(){const{accountInfo:n}=this.providerData,{i18n:a}=this.appContext;return n.showLogoutLink&&!this.isOrderOrDraftSession?[{label:a.translate("customer_account.sign_out_link_label"),onClick:n.logoutAndClearProposal}]:void 0}}class yy extends tt{get displayContent(){const n=this.appContext.checkout.proposal.proposed.email.value,a=this.appContext.checkout.proposal.proposed.shippingAddress.fields.firstName.value;return{contact:or(n,a)}}get logo(){return t(dn,{wallet:Na.BuyWithPrime,size:"large"})}}class vy extends tt{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.value.buyerIdentity}get logo(){return os(this.buyerIdentity,this.email)}get displayOptions(){return{vaultedContactType:"base",contentLayout:"box"}}get showShopPayVerification(){return!!this.email&&this.providerData.loadShopPayVerification}get moreOptions(){const{accountInfo:n}=this.providerData,{i18n:a}=this.appContext;return n.showLogoutLink?[{label:a.translate("customer_account.sign_out_link_label"),onClick:n.logoutAndClearProposal}]:void 0}}class gy extends tt{get logo(){const n=this.isEmbeddedPartner?"xxxsmall":"xxsmall";
2return t(dn,{wallet:"GOOGLE_PAY",size:n})}}function rr({email:e,phone:n}){const{i18n:a,checkout:{configuration:s},observability:o,shop:{name:i}}=y(),{hasExternalOrderNotifications:r}=s,l=fy({email:e,phone:n}),d=r?l:void 0;L(()=>{d&&(o.log("shop_pay_external_order_notification_banner_suppressed","Withheld the order notification banner: this checkout's order notifications are the merchant's to send",{contact_type:d}),o.counter({name:"shop_pay_external_order_notification_banner_suppressed",value:1,attributes:{contact_type:d}}))},[o,d]);const c=ie(()=>r?null:e?a.translate("account_management.email_changed",{shopName:i,email:Ws(e)}):n?a.translate("account_management.phone_changed",{shopName:i,phone:Ws(n)}):null,[e,n,i,a,r]);return c?t(K,{padding:"small-200 none none none",children:t(Oa,{tone:"info",children:c})}):null}function fy({email:e,phone:n}){if(e)return"email";if(n)return"phone"}const Ws=e=>t(k,{type:"strong",children:e});class Cy extends tt{get displayContent(){return{contact:this.payPalEmail||this.email}}get logo(){const n=this.isEmbeddedPartner?"xxsmall":"small";return t(dn,{size:n,wallet:"PAYPAL_EXPRESS"})}get payPalEmail(){return Qc(this.appContext.checkout.proposal.proposed.paymentLines.value,"PAYPAL_EXPRESS")?.method.walletContent?.email||void 0}get children(){const n=this.displayContent.contact;return!!n&&!!this.email&&n!==this.email?t(rr,{email:this.email}):null}get displayOptions(){return{vaultedContactType:"base",contentLayout:void 0,children:this.children}}}function _y({url:e,displayName:n}){return t(b,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(K,{inlineSize:"16px",blockSize:"16px",children:t(kl,{src:e,alt:"",accessibilityRole:"presentation",inlineSize:"fill",aspectRatio:"auto"})}),t(k,{size:"medium",type:"strong",children:n})]})}class Sy extends tt{get displayContent(){const{i18n:n}=this.appContext,a=this.appContext.shop.contactInfoOptions.includes("PHONE");let s="";return this.email?s=this.email:this.phone&&a&&(s=this.phone),{label:n.translate("contact.contact_method_title"),contact:s,useSummaryInContent:!0}}get hasError(){const{validation:{contactErrors:{emailInputError:n,phoneInputError:a}}}=this.appContext.checkout;return Ml({email:this.email,phone:this.phone,emailInputError:n.value,phoneInputError:a.value,hasViolations:this.displayableContactViolations.length>0})}get shouldHide(){const n=this.appContext.checkout.proposal.negotiated.fields.merchandiseLines.value?.lines;return!!this.appContext.embed?.interstitialPartnerDisplayName&&!this.appContext.checkout.identity.customerContactMethodPrefilled?!1:Ol({isFlagshipPartner:!!this.appContext.embed?.isFlagshipPartner,hasError:this.hasError,hasOnlyDigitalItems:Ll(n)})}get shouldTriggerValidation(){return!!(this.email||this.phone)}get shouldClearClientSideValidation(){const{validation:{contactErrors:{emailInputError:n,phoneInputError:a}}}=this.appContext.checkout;return!this.email&&!this.phone&&(this.isClearableContactError(n.value)||this.isClearableContactError(a.value))}get shouldMapServerViolationsToClient(){const{violationsSubscriptionResult:{hasViolations:n}}=this.providerData;return n}triggerClientSideValidation(){const{i18n:n}=this.appContext,{validation:{contactErrors:{emailInputError:a,phoneInputError:s}}}=this.appContext.checkout;a.value=void 0,s.value=void 0;const o=this.appContext.shop.contactInfoOptions.includes("PHONE"),i=this.validateContactInformation({email:this.email,phone:this.phone,phoneAllowed:o,translations:{emailBlank:n.translate("field_errors.email_blank"),emailInvalid:n.translate("field_errors.email_invalid"),blank:n.translate("field_errors.email_or_phone_blank")}});if(!i)return!1;switch(i.field){case"email":return a.value=i.error,!0;case"phone":return s.value=i.error,!0}}clearClientSideValidation(){const{validation:{contactErrors:{emailInputError:n,phoneInputError:a}}}=this.appContext.checkout;this.isClearableContactError(n.value)&&(n.value=void 0),this.isClearableContactError(a.value)&&(a.value=void 0)}mapServerViolationsToClient(){const{validation:{contactErrors:{emailInputError:n,phoneInputError:a}}}=this.appContext.checkout,{violationsSubscriptionResult:{clearViolations:s}}=this.providerData,o=!!(this.email||this.phone),i=!!n.value||!!a.value;for(const r of this.displayableContactViolations)i||!o||r.__typename!=="UnprocessableTermViolation"||(n.value=r.localizedMessage??r.n
2onLocalizedMessage,a.value=void 0);s()}get logo(){const n=this.appContext.embed,a=on({embedder:n?.embedder,shop:this.appContext.shop}),s=n?.interstitialPartnerDisplayName,o=n?.interstitialPartnerProfileIconUrl;return!a||!s||n?.isFlagshipPartner!==!0||!this.appContext.checkout.identity.customerContactMethodPrefilled?t(Ye,{type:"email",size:"fill"}):o?t(_y,{url:o,displayName:s}):os(void 0,this.email)}get displayOptions(){return{vaultedContactType:"rollup",expandable:!0,children:t(li,{showEmailMarketingOptIn:!1})}}get displayableContactViolations(){const{violations:n,negotiationStage:a}=this.providerData.violationsSubscriptionResult,s=kn(this.email)||this.appContext.shop.contactInfoOptions.includes("PHONE")&&kn(this.phone),o=a==="negotiation"&&!this.appContext.embed?.isFlagshipPartner&&s;return Array.from(n).filter(({code:i})=>!o||i!=="BUYER_IDENTITY_MISSING_CONTACT_METHOD")}validateContactInformation({email:n,phone:a,phoneAllowed:s,translations:o}){if(!n&&(!a||!s))return{field:"email",error:s?o.blank:o.emailBlank};if(n){const i=Ls(n,o.emailBlank),r=jp(n,o.emailInvalid),l=i??r;if(l)return{field:"email",error:l}}else if(a&&s){const i=Ls(a,o.blank);if(i)return{field:"phone",error:i}}}isClearableContactError(n){return n?!(typeof n=="object"&&"origin"in n&&n.origin==="client"):!1}}class by extends tt{#e;#t;constructor(n,a){super(n,a),this.#e=(this.appContext.mobileCheckoutSdk.enabled||!!this.appContext.embed?.isCheckoutKit())&&Tn(this.appContext.shopPay.app.config),this.#t=Wo(this.appContext.router.currentUrl.value.search)}get displayContent(){return{contact:this.appContext.shopPay.user.email.value}}get logo(){return this.providerData.shopPayLogo}get moreOptions(){return this.providerData.shopPayMoreOptions}get children(){const n=this.displayContent.contact,a=!!n&&!!this.email&&n!==this.email,s=!!(this.phone&&!this.email);return a||s?t(rr,{email:this.email,phone:this.phone}):null}get displayOptions(){let n;return(this.#e||this.#t||!this.appContext.shopPay.visibility.showVaultedContactInlineLogo)&&(n="stack"),this.appContext.shopPay.visibility.showVaultedContactHeader||(n="box"),this.appContext.shopPay.visibility.showVaultedContact?{vaultedContactType:"base",contentLayout:n,children:this.children}:{vaultedContactType:"hidden"}}}const Py={amazonPay:dy,applePay:uy,buyWithPrime:yy,businessCustomer:my,customerAccount:vy,googlePay:gy,payPal:Cy,sdkCartHints:Sy,shopPay:by};function Ay(e,n){const a=e.checkout.identity.current.value;if(a==="guest")throw new Ry;return Ey(a,e,n)}function Ey(e,n,a){const s=Py[e];return new s(n,a)}class Ry extends Error{constructor(){super("Guest identity should never be instantiated. Guest identity has vaultedSections.contact=false, so VaultedContact never renders."),this.name="GuestIdentityError"}}const Iy=new ed(0,0,100);function ky(){const{shopPay:e,mobileCheckoutSdk:n,embed:a,router:s}=y(),o=s.currentUrl.value,r=!!a?.isFlagshipPartner?"small":"medium",l=(n.enabled||a?.isCheckoutKit())&&Tn(e.app.config),d=Wo(o.search),c=Ds({foregroundColor:qp}),u=Ds({foregroundColor:Iy});if(l||d||!e.visibility.showVaultedContactInlineLogo)return null;let p;return c?p="branded":u?p="white":p="black",e.logoBrand!=="shop"?t(ki,{color:p,size:r}):t(Kp,{color:p,size:r})}function My(){const e=Va(),{i18n:n,observability:a,userEvents:s,source:o,checkout:i,shop:r,persistence:l,shopPay:d,router:c}=y(),{visibility:u,app:{config:p}}=d,m=Tn(p),{replaceShopPayInHistory:v}=$p(),C=w((F,T)=>{if(T.status!=="success"){i.unstable_setRedirectingExternally(!1),a.log("shop_pay_switch_account_session_clear_failed","Shop Pay account switch session clear did not succeed",{status:T.status});return}l?.clearAll();const N=new URL(window.location.href);N.pathname=c.resolve(td).pathname,N.searchParams.set(nd,"1"),v(N.toString())},[i,a,l,v,c]),f=Co(C),{label:g}=_o(),S=Dl({clearPii:!0}),P=Tl(),_=!!d.config.isReferral,I=w(()=>{i.unstable_setRedirectingExternally(!0),s.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...Ke(o,i,r),action:"switch_account"}},{exportImmediately:!0});const F=e.block();e.waitForPendingNegotiations().then(()=>
2f()).catch(()=>{i.unstable_setRedirectingExternally(!1)}).finally(F)},[f,s,o,i,r,e]),M={onClick:P?()=>{}:I,label:n.translate("account_management.switch_account")},E={onClick:S,label:g},A=[];return u.showSwitchAccountAction&&A.push(M),u.showCheckoutAsGuestKebabLink&&!_&&A.push(E),!m&&u.showSwitchVaultedContactMenu?A:void 0}function Oy(){const e=y(),n=Yp(),a=Nl(),s=dp(),o=Vl(),i=cy(),r=$({amazonPayCheckoutAsGuest:n,applePayCheckoutAsGuest:a,buyWithPrimeCheckoutAsGuest:s,googlePayCheckoutAsGuest:o,payPalCheckoutAsGuest:i});return h(()=>{const d=r.value;switch(e.checkout.identity.current.value){case"amazonPay":return d.amazonPayCheckoutAsGuest;case"applePay":return d.applePayCheckoutAsGuest;case"buyWithPrime":return d.buyWithPrimeCheckoutAsGuest;case"googlePay":return d.googlePayCheckoutAsGuest;case"payPal":return d.payPalCheckoutAsGuest;default:return}})}function lr(){const e=y(),n=e.checkout.identity.current.value,a=ie(()=>({appContext:e,identitySource:n}),[e,n]),s=wl().value,o=e.client.unstable_getSerialization("logoutUrl")||"",r=Oy().value,l=qd(),d=ky(),c=My(),u=We(ad),p=Co(w(()=>{e.persistence?.clearAll(),window.location.assign(o)},[e,o])),m=w(()=>{e.checkout.unstable_setRedirectingExternally(!0),p().catch(()=>{e.checkout.unstable_setRedirectingExternally(!1)})},[e.checkout,p]);return ie(()=>Ay(a.appContext,{accountInfo:{logoutAndClearProposal:m,showLogoutLink:s},loadShopPayVerification:l.value,shopPayLogo:d,shopPayMoreOptions:c,checkoutAsGuest:r,violationsSubscriptionResult:u}),[a,m,s,l.value,d,c,r,u])}function cr(e){const n=q(void 0),a=e.email,s=e.phone,o=!!(a||s);L(()=>{const i=n.current,r=!!i,l=!!(i?.email||i?.phone),d=!r||i?.email!==a||i?.phone!==s;e.shouldTriggerValidation&&d?e.triggerClientSideValidation():(!r||l)&&!o&&e.shouldClearClientSideValidation&&e.clearClientSideValidation(),n.current={email:a,phone:s}},[a,o,s,e]),L(()=>{e.shouldMapServerViolationsToClient&&e.mapServerViolationsToClient()},[e])}function Ly({emailAddress:e,logo:n,moreOptions:a,emailAlignment:s="end",children:o}){const{i18n:i}=y(),l=ne().email.value,d=e??l,c=d||t(re,{});return t(G,{children:[t(ct,{gridAutoFlow:"column",gridTemplateColumns:n?"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)":"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-300",alignItems:"center",alignContent:"center",justifyContent:s,justifyItems:s,children:[n,t(K,{maxInlineSize:"100%",children:typeof c=="string"?t(he,{children:t(Bl,{children:c})}):c}),a&&t(tp,{accessibilityLabel:i.translate("review.account_more_actions"),positionArea:"block-end",options:a})]}),o]})}function dr({layout:e,emailAlignment:n,...a}){const{i18n:s}=y(),i=t(Ly,{...a,emailAlignment:n??(e==="stack"||e==="box"?"start":"end")});switch(e){case"stack":return t(b,{gap:"base",padding:"none none base none",children:i});case"box":return t(K,{padding:"base none",children:t(b,{gap:"base",children:i})});default:return t(K,{role:"region",accessibilityLabel:s.translate("customer_account.rollup_label"),padding:"small-200 none base none",children:i})}}function ur(){const e="contact",n=Ft(e),a=w(()=>n.value=!n.value,[n]),s=lr();cr(s);const o=ue(!1),i=qe(),r=q(!1),{embed:l,i18n:d}=y(),c=s.displayOptions,{vaultedContactType:u}=c,{label:p,contact:m,useSummaryInContent:v}=s.displayContent,C=s.email,f=s.phone,g=s.hasError;if(L(()=>{s.hasError&&(n.value=!0)},[s.hasError,n]),u==="hidden"||s.shouldHide&&!r.current)return null;r.current=!0;const S=v?m:void 0,P=l?.embedder==="amazon"?{compact:S}:{primary:S};return u==="rollup"?t(ce,{id:e,label:p??d.translate("contact.contact_method_title"),primaryContent:P.primary,compactContent:P.compact,open:n.value||g,onToggle:g||!c.expandable?void 0:a,icon:s.logo,children:c.children??null}):t(G,{children:[t(dr,{emailAddress:m,phone:f,logo:s.logo,moreOptions:s.moreOptions,layout:c.contentLayout,children:c.children??null}),s.showShopPayVerification?t(D,{when:i,children:t(ci,{email:C??"",open:o.value,showPopover:_=>{o.value=_}})}):null]})}function Dy(){return Fl(new Set([...Dt].filter(e=>e.startsWith("DELIVERY_COMPANY"))))}function Ty({loading:e,countryCode:n,phone:a}){const s=sd(),{i18n:o,checkout:i}=y(),r=i.configuration.addressSettings.nonBillingAddressSettings.value,l=ie(()=>r.isRequired("phone",{countryCode:n}),[n,r]),{validatePhoneNumber:d,isPhoneNumberUtilLoaded:c}=$a(),u=w(m=>{const v=kn(m);if(l&&!v)return o.translate("field_errors.phone_blank");if(v&&!d(m??"",n))return o.translate("field_errors.shipping_line_phone_invalid")},[l,d,n,o]),p=q(!1);return L(()=>
2{if(p.current||!c||e)return;const m=u(a);s.value=m,p.current=!0},[l,c,e,a,s,u]),ie(()=>({errorSignal:s,validatePhoneField:u,isPhoneRequired:l}),[s,l,u])}function pr(){const{i18n:e,url:n,client:a}=y(),s=a.unstable_getSerialization("apiClientId"),o=bo(s),i=ne().shippingAddress.value,{href:r,onClick:l}=_o(),{countryName:d,loading:c}=So(i),{hasViolations:u}=pe(rn);if(!u)return null;if(o)return t(dt,{message:t(G,{children:e.translate("merchant_redirect.shop_app_not_supported",{storefront_link:t(we,{href:n.storefront(),children:e.translate("contact.storefront_link")})})})});const p=c?i.countryCode:d;return t(dt,{message:t(G,{children:e.translate("payment_errors.payment_method_not_supported",{country:p,checkout_as_guest_link:t(we,{href:r,onClick:l,children:e.translate("account_management.checkout_as_guest_link")})})})})}function wy({selectedAddress:e,shouldAddressModalSetAsDefault:n}){const{checkout:{address:a,identity:s},i18n:o}=y(),i=ne().shippingAddress.value,r=So(i),{createAddressParts:l}=et(),d=w(S=>{l.addressModalState.value={status:"editing",address:od(S.address,{extendedAddressMode:a.extendedAddressMode}),addressType:"shipping",addressId:S.id,setAsDefault:n?"default":"disabled"}},[a.extendedAddressMode,l.addressModalState,n]),c=e?t(we,{tone:"monochrome",onClick:()=>d(e),children:o.translate("shipping.address_update")}):o.translate("shipping.address_update"),{hasViolations:u}=pe(ln),{hasViolations:p}=pe(Yo),{hasViolations:m}=pe(Dt),{hasViolations:v}=pe(rn),{hasViolations:C}=pe(id),f=Ny({identity:s,hasMerchandiseUnavailableInBuyerLocationViolations:C,hasUnsupportedPaymentMethodViolations:v});if(f)return f;let g=o.translate("shipping_errors.invalid_selected_address");return p?g=o.translate("customer_account.incomplete_address",{update_address_link:c}):u?g=r.loading?t(b,{children:[t(re,{inlineSize:"large"}),t(re,{inlineSize:"small"})]}):o.translate("shipping_errors.shipping_method_not_available_generic.one"):(m||e)&&(g=o.translate("shipping_errors.invalid_selected_address_with_update_link",{update_address_link:c})),t(dt,{message:g})}function Ny({identity:e,hasMerchandiseUnavailableInBuyerLocationViolations:n,hasUnsupportedPaymentMethodViolations:a}){return e.current.value!=="shopPay"?null:n?t(Ga,{}):a?t(pr,{}):null}function hr(){const{checkout:e,client:n}=y(),a=e.addressManager.shipping.value.selectedAddress.value,s=!!a?.default,o=n.unstable_getSerialization("apiClientId"),i=mo(),r=q(!1),{hasViolations:l}=pe(ln),{hasViolations:d}=pe(jo),c=bo(o);return L(()=>{(l||d)&&c&&!r.current&&(i.notify(l?{no_delivery_strategy_available:!0}:{out_of_stock_at_origin:!0}),r.current=!0)},[l,d,c,i]),t(wy,{selectedAddress:a,shouldAddressModalSetAsDefault:s})}const mr=new Set(rn);function yr(){const{shopPay:e,checkout:n,source:a,observability:s}=y(),{deliveryMethodsAddressErrors:o}=et(),i=Cp(),{shippingAddress:r}=ne(),l=r.value,d=n.configuration.addressSettings.nonBillingAddressSettings.value,c=a.type==="simulated",u=_s(l.countryCode,void 0,d),m=n.addressManager.shipping.value.selectedAddress.value?.address.countryCode,v=_s(m??l.countryCode,void 0,d,null),{details:C}=rd(m),f=!m||C!==void 0&&!C.isFallback,{clearViolations:g}=pe(mr),S=q(!0);return L(()=>{if(S.current){S.current=!1;return}g()},[g,l]),_p("shippingAddress",async()=>{const P=async(I,M)=>{if(!await n.addressManager.shipping.value.createAddress(M)){const A=Object.values(o).some(F=>F.value!==void 0);return{success:!1,location:I,errors:A?[]:[i({offerGuestCheckout:!0})]}}return{success:!0}};if(!c){const I=n.addressManager.shipping.value.selectedAddress.value,M=n.proposal.negotiated.fields.buyerIdentity.value?.customerProfile;if(I&&M?.__typename==="CustomerProfile"&&M.shippingAddresses.some(A=>A.id===I.id)){const A=B=>{Mt(()=>{for(const[R,H]of B)o[R].value=H})},F=()=>P("intercept_shipping_address_vault_ca",{address:I.address,selectAddress:!0,addressErrorsOverride:o});if(!f||I.address.countryCode!==m)return F();const T=v(I.address,"shipping");if(T.size===0)return F();const N=u(l,"shipping"),V=B=>{try{s.log("shop_pay_ca_vault_address_invalid","Selected customer-account address fails validation before Shop Pay vault-save",{invalidFields:Array.from(T.keys()).sort().join(","),proposalInvalidFields:Array.from(N.keys()).sort().join(","),proposalDiverges:!ma(l,I.address),outcome:B})}catch{}};if(N.size===0){const B=e.user.addresses.value.find(H=>ma(H.address,l));if(B&&await n.addressManager.shipping.value.selectAddress(B.id))return V("selected_matching_vaulted"),{success:!0};const R=await P("intercept_shipping_address_vault_ca_proposal",{address:l,selectAddress:!0,addressErrorsOverride:o});return V(R.success?"vaulted_proposal":"vault_proposal_rejected"),R}return V("blocked_client_side"),Ts({addressType:"shipping",validate:()=>N,setErrors:A})}}if(e.session.selectedShippingAddress.value||e.user.addresses.value.length)return{success:!0};const _=Ts({addressType:"shipping",validate:()=>u(l,"shipping"),setErrors:I=>{Mt(()=>{for(const[M,E]of I)o[M].value=E})}});return _.success?e.user.flow.peek()==="authenticated_user"?P("intercept_shipping_address_add_new",{address:l,addressErrorsOverride:o}):{success:!0}:_}),null}const is=()=>{const{shopPay:e}=y(),{geolocation:n}=xl(),{shippingAddress:a}=ne();return h(()=>{const s=a.value;return e.signup.phoneCountryCode.value??s.countryCode??n.country.code})},Vy=()=>{const{shopPay:e,checkout:n}=y(),a=n.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:s}=ne(),o=e.signup.phoneNumber.value,i=e.signup.phoneError.value,r=s.fields.countryCode.value,l=s.fields.phone.value,{deliveryMethodsAddressErrors:d}=et(),c=d.phone.value,{setAddressError:u}
2=Hl(d),p=is(),{isPhoneNumberUtilLoaded:m}=$a(),v=q(!1),C=Mi(p.value,o,!0);L(function(){l&&!o&&e.signup.unstable_setPhoneNumber(l);const g=e.signup.phoneCountryCode.value;r&&!g&&e.signup.unstable_setPhoneCountryCode(r)},[]),L(()=>{if(!v.current&&m&&o){const{prefix:f}=C;o.startsWith(f)||e.signup.unstable_setPhoneNumber(`${f}${o}`),v.current=!0}},[m]),cd(async({parts:f,reason:g})=>{if(g!=="negotiation")return{behavior:"allow"};const{shippingAddress:S}=f;let P=e.signup.phoneNumber.peek();(!P||P===C.prefix)&&(P=void 0);const _=S.peek().phone;return{behavior:"allow",perform(){P!==_&&a.isVisible("phone",{countryCode:p.value,useMerchantSettings:!0})&&(S.fields.phone.value=P)}}}),L(function(){i!==c&&u("phone",i)},[i,c,u])},By=()=>{const{i18n:e,shopPay:n}=y(),{isPhoneNumberUtilLoaded:a,validatePhoneNumber:s}=$a(),o=is(),i=w(r=>{if(!kn(r))return e.translate("field_errors.phone_blank");if(a&&!s(r??"",o.value,!0))return e.translate("mobile_phone_number.mobile_phone_invalid")},[e,a,s,o]);return ld(n.signup.phoneNumberRawSignal,n.signup.phoneErrorRawSignal,i)};function vr({padding:e}){const{i18n:n,shopPay:a}=y(),{shopPayMobilePhoneInputShownSignal:s}=et(),o=is(),i=!!a.user.phoneNumber.value,r=By();On(()=>(s.value=!0,()=>{s.value=!1}),[s]);const l=q(o.peek());Vy();const d=w(c=>{a.signup.unstable_setPhoneCountryCode(c)},[a.signup]);return t(b,{gap:"base",padding:e,children:[t(Jp,{name:"phone",countryCode:l.current,label:n.translate("mobile_phone_number.label"),autocomplete:"shipping tel",requireCountryCode:!0,disabled:i,onSelectedCountryChange:d,...r}),t(he,{type:"small",color:"subdued",children:n.translate("mobile_phone_number.disclaimer")})]})}const Ys="shipping";function gr({filteredFields:e,additionalFieldGroups:n,children:a,settings:s}){const{deliveryMethodsAddressErrors:o}=et(),{shippingAddress:i}=ne(),r=Ko(),{shouldGateCrossBorder:l,crossBorderGate:d}=Oi(),c=(Z,O,x)=>{l(Z)?d(O,{onCancel:x}):O()},u=y(),{checkout:p,i18n:m,userEvents:v,source:C,shop:f}=u,{configuration:g}=p,S=g.isAddressDelegationEnabled,{violations:P}=pe(Dt),_=i.fields?.countryCode.value,I=Po(_),M=q(!1);L(()=>{if(!S||M.current||P.size===0||(M.current=!0,Object.values(o).some(x=>{const j=x.value;return j&&typeof j=="object"&&j.origin==="client"&&j.type==="inline-validation"})))return;const O=I(Ys,Array.from(P));Mt(()=>{for(const[x,j]of O)o[x]?.value===void 0&&(o[x].value=j)})},[S,P,I,o]);const E=g.addressSettings.nonBillingAddressSettings.value,A=i.value,F=qo(),{hasViolations:T}=pe(mr),N=g.defaultPhoneNumber.value;E.isRequired("phone",{countryCode:A.countryCode,useMerchantSettings:!0})&&!A.phone&&N&&(i.value={...A,phone:N});const B=$(!!(e&&e.length>0)),R=g.trackAddressAutoComplete?()=>{v.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...Ke(C,p,f),action:"address_autocomplete"}})}:void 0,H=t(Op,{id:"shippingAddressForm",addressType:Ys,address:i,countries:r,settings:s,addressErrors:o,additionalFieldGroups:n,showSavedAddressSelector:!1,onAddressAutoComplete:R,onBeforeCountryChange:c,filteredFields:e,children:a}),X=t(D,{when:B,fallback:H,children:t(K,{background:"base",borderRadius:"base",className:dd({colorLayer:"controlSelected"}),paddingInline:"base",paddingBlockStart:"large-100",paddingBlockEnd:"base",children:t(b,{direction:"block",gap:"base",children:[t(K,{padding:"none",children:[t(he,{children:[A.firstName," ",A.lastName]}),t(Xp,{address:A,hiddenFields:["firstName","lastName","phone"],textColor:"subdued"})]}),H]})})});return t(Xa,{impressionType:"delivery_address",impressionFeatures:[],children:[Fy(u)&&t(yr,{}),T&&g.visibility.showInvalidDeliveryAddressBanner.value&&t(K,{children:[t(hr,{}),t(je,{blockSize:"base"})]}),t(D,{when:F,children:t(K,{children:[t(Oa,{tone:"info",children:m.translate("address_management.draft_order_delivery_address_reminder")}),t(je,{blockSize:"base"})]})}),X,t(D,{when:g.visibility.showStandalonePhoneField,children:t(vr,{padding:"base none none none"})})]})}function Fy({checkout:e}){return e.identity.current.value==="shopPay"}const Sn=e=>{if(!e)return"unknown";const{taxId:n}=e;if(n.warnings.includes("DOMESTIC_NOT_APPLICABLE"))return"write";const{status:s}=e.taxId;return s.type==="pending"&&n.validated.status==="VALID"||s.type==="resolved"&&s.val
2idationStatus==="VALID"?"vaulted":"write"};function xy(e,n){const[a,s]=ft(Sn(e)),o=q(null),i=ue(!1);a==="vaulted"&&Sn(e)!==a&&s("write"),a==="unknown"&&Sn(e)!==a&&s(Sn(e));const r=w(d=>{o.current=d,n.value&&d&&i.value&&(i.value=!1,d.focus())},[i,n]);Me(()=>{n.value&&o.current&&i.value&&(i.value=!1,o.current.focus())});const l=w(()=>{i.value=!0,s("write"),n.value&&o.current&&(i.value=!1,o.current.focus())},[i,n]);return{status:a,inputRef:r,focus:l}}function rs(){const e=zl(),{paymentLines:n}=ne(),{walletUsedForSubmissionSignal:a}=an();return h(()=>e.value||oh({paymentLines:n.value,walletUsedForSubmission:a.value}))}function Hy({countryCode:e,addressType:n,addressViolations:a}){const{shop:s,checkout:{identity:o}}=y(),i=s.hasFlagEnabled(ud),r=ue(void 0),{violations:l}=Ul(a),d=Po(e),c=ue(!1),u=o.current.value==="applePay"||o.current.value==="googlePay"||o.current.value==="payPal";if(i&&u&&r.value===void 0&&l.size>0&&!c.value){c.value=!0;const p=Array.from(l),m=d(n,p),v=Gl({addressErrors:m});v&&(r.value=v)}return{missingAddressFieldSignal:r,hasResolvedMissingAddressFieldSignal:c}}function zy(){const{i18n:e}=y(),{hasViolations:n}=pe(ln),{hasViolations:a}=pe(Xo),{hasError:s,error:o}=Ln($o),i=ho(o?{type:"payment",code:o}:void 0);return s&&i?t(Lt,{tone:"critical",errorType:Fe.DeliveryError,children:i}):n?t(dt,{message:e.translate("shipping_errors.shipping_method_not_available_generic.one")}):a?t(dt,{message:e.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions")}):null}function Uy(e,n){return e.isAddressDelegationEnabled&&n!=="shopPay"&&!pd(n)}function Gy({checkout:e,userEvents:n,shop:a,source:s},o){e.identity.current.value==="shopPay"&&n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...Ke(s,e,a),action:o?"shipping_addresses_expand":"shipping_addresses_collapse"}})}function Wy({checkout:e,i18n:n},a){return e.configuration.visibility.showInvalidDeliveryAddressBanner.value?t(hr,{}):a?t(dt,{message:n.translate("shipping_errors.unavailable_address_country")}):null}const Yy=new Set([...Dt,...ln,...rn,...jo]),jy=["phone","zoneCode","countryCode","firstName","lastName","name"],Ky=["phone","zoneCode","countryCode","firstName","lastName","name","coordinates","oneTimeUse"],qy=300;function bn(e){return e==="pending"||e==="pendingCollapsed"}function pa(e){return e==="collapsed"||e==="pendingCollapsed"}function fr({summary:e,forceOpen:n,initiallyOpen:a=!1,renderRollup:s}={}){const{shippingAddress:o}=ne(),{allViolations:i}=Y(),l=Xy()??e,d=$(zy()),c=qo(),{embed:u,i18n:p,shopPay:m,observability:v,userEvents:C,checkout:f,source:g,shop:S}=y(),P=u?.client?.addressErrors.value.includes(hd.AddressEmpty)??!1,_=Ko(),{installments:I}=m,M=f.identity.current.value==="shopPay",{isMissingPhone:E}=_i(),{isMissingFirstName:A}=Si(),F=E||A,T=u?.embedder==="google",N=f.configuration.addressSettings.nonBillingAddressSettings.value,V=h(()=>T&&N.isVisible("phone",{countryCode:o.value?.countryCode})),{formattedNumber:B}=Mi(o.value?.countryCode??"",V.value?o.value?.phone:void 0),R=h(()=>Uy(f.configuration,f.identity.current.value)),{deliveryMethodsAddressErrors:H}=et(),X=h(()=>Object.values(H).some(Oe=>Oe.value!==void 0)),Z=h(()=>!!(o.value?.countryCode&&!_?.some(Oe=>Oe.value===o.value.countryCode))),O=Wy({checkout:f,i18n:p},Z.value),x=h(()=>$y(o.value,R.value?Ky:jy)),[j,W]=ft([]),{availableDeliveryAddresses:z,mustSelectProvidedAddress:oe}=f.proposal.negotiated.fields,ee=h(()=>z.value??[]),Q=h(()=>oe.value??!1),le=se("Checkout::DeliveryAddress::RenderBefore"),ye=se("purchase.checkout.delivery-address.render-after"),de=Mn([...le,...ye],{lazyReveal:!0}),te=Wl(),Ce=h(()=>ee.value?.length&&!!ee.value.find(Oe=>ma(o.value,Oe.address))),Ae=h(()=>!!(Ce.value&&Q.value)),fe=Ao(),ve=qe(),Ee=Ha(La),Se=h(()=>ve.value&&Ee.uiStateSignal.value?.status==="loading"),Re=h(()=>Ee.uiStateSignal.value?.status==="filled"),J=h(()=>!R.value||!x.value&&Re.value),_e="deliveryAddress",U=Ft(_e,gt(()=>a||(de.value||Ae.value)&&J.value)),ae=xy(fe,U),Ne=q(null),be=q(null),De=q(!1),me=ue("idle"),nt=bn(me.value),xe=pa(me.value),He=ue(!1),ze=Ja(Jo([...le,...ye],"uiExtension").map(qt),w(()=>{J.value&&(U.value=!0)},[J,U]));L(()=>{ze&&J.value&&(He.value=!0)},[ze,He,J.value]);const Ie=h(()=>R.value&&He.value);L(()=>{J.value&&(de.value||ze)&&(U.value=!0)},[de.value,J.value,ze,U]),On(()=>{te.current&&(R.value&&x.value||R.value&&xe||Ce.value===!1&&(U.value=!0))},[Ce.value,U,te,R.value,x.value,xe]),Za({isMissing:F,open:U});const Xe=Ra(),St=Xe.value.deliveryAddressErrors,at=h(()=>Xe.value.deliveryAddressErrors.length>0),st=rs().value||f.identity.current.value==="payPal",{hasViolations:bt,violations:Ue,clearViolations:Ge}=pe(Yy),{missingAddressFieldSignal:Ve,hasResolvedMissingAddressFieldSignal:Ht}=Hy({countryCode:o.value?.countryCode,addressType:"shipping",addressViolations:Dt}),Je=h(()=>!!Ve.value&&!U.value),pn=new Set([...E?md:[],...A?yd:[],...Je.value?Dt:[]]),Pt=go(bt,Ue,pn),{hasError:hn,clearError:zt}=Ln($o),mn=I.agreementError.value===Yl.InvalidShippingAddress,Wn=$e("deliveryNext"),Ut=h(()=>!ve.value||Wn.value);Me(()=>{Se.value&>(()=>{zt(),I.unstable_setAgreementError(null)})});const Yn=w(()=>{Ge(),zt(),I.unstable_setAgreementError(null)},[Ge,zt,I]),Gt=nn(o.value,{hiddenFields:["phone"],displayName:!1}),Vr=p.formatName(o.value?.firstName,o.value?.lastName,!0),jn=o.value?.firstName&&o.value?.lastName?Vr:void 0,yn=fo({address:o.value??{}}),Br=t(D,{when:x,fallback:t(b,{children:[Gt,V.value&&B&&t(k,{children:B})]}),children:t(k,{tone:"critical",children:p.translate("shipping.add_shipping_address")})}),cs=x.value?t(k,{tone:P?"critical":void 0,children:p.translate("shipping.add_shipping_address")}):jn,ds=x.value?void 0:t(b,{children:[yn.primary&&t(k,{children:yn.primary}),yn.secondary&&t(k,{children:yn.secondary}),V.value&&B&&t(k,{children:B})]}),us=t(D,{when:()=>x.value||!o.value?.postalCode,fallback:t(G,{children:[t(k,{children:p.translate("shipping.delivery_to")}),t(k,{type:"strong",children:jn})]}),children:t(k,{tone:"accent",decoration:"underline",children:p.translate("shipping.add_new_delivery_address")})}),ps=h(()=>o.value?.postalCode),hs=t(D,{when:()=>x.value||!ps.value,fallback:t(b,{children:[t(k,{type:"strong",children:ps}),V.value&&B&&t(k,{children:B})]}),children:()=>""}),Kn=(()=>
2{if(l)return{primary:l};switch(u?.embedder){case"amazon":return{compact:t(b,{direction:"inline",gap:"small-400",alignItems:"center",children:[us,hs]})};case"google":return{primary:cs,secondary:ds};default:return{primary:jn,secondary:Br}}})(),At=h(()=>jl(i.value??[])&&!Se.value),Fr=$(Pt&&!At.value||hn||mn),qn=h(()=>Ut.value?null:Fr.value&&O&&!Se.value?{type:"invalid-address-banner",element:O}:d.value&&!At.value&&!Se.value?{type:"default-vaulted-delivery-address-error-banner",element:d.value}:at.value&&!st&&!At.value?{type:"validation-errors-banner",element:t(Ia,{errors:St,errorType:Fe.DeliveryError})}:At.value?{type:"unavailable-in-buyer-location-banner",element:null}:null),ms=t(Jy,{errorSignal:qn}),xr=h(()=>!!qn.value||st&&at.value),Hr=$(Pt),$n=$(hn),zr=$(n),Ur=$(ze),vn=h(()=>X.value||Hr.value||at.value),Xn=h(()=>!!zr.value||de.value||Ur.value&&J.value||Ie.value),Et=h(()=>R.value&&bn(me.value)&&pa(me.value)&&!Xn.value&&!$n.value&&!At.value),Gr=h(()=>Ht.value&&Ve.value===void 0),Jn=h(()=>vn.value&&!Et.value),ys=h(()=>R.value&&Re.value&&!Jn.value),gn=h(()=>ys.value&&pa(me.value)),Rt=h(()=>Xn.value||$n.value||Gr.value||!Et.value&&xr.value),Wr=h(()=>vn.value&&!(R.value&&bn(me.value))||At.value||Xn.value||$n.value);De.current=Wr.value;const Wt=h(()=>{if(R.value){if(x.value)return!1;if(gn.value)return Rt.value;if(X.value&&!Et.value&&!(Ht.value&&Ve.value))return!0}return U.value||Rt.value}),ot=w(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),it=w(()=>{ot(),me.value="idle"},[ot,me]),Zn=w(()=>{if(ot(),De.current){me.value="collapsed",U.value=!0;return}me.value="collapsed",U.value=!1},[ot,me,U]),vs=w(()=>{ot(),be.current=setTimeout(()=>{be.current=null,!De.current&&(me.value="pendingCollapsed",U.value=!1)},qy)},[ot,me,U]),ht=w(()=>{it(),U.value=!0},[it,U]);L(()=>ot,[ot]),L(()=>{R.value&&vn.value&&!nt&&it()},[nt,vn.value,R.value,it]);const Qn=w(async()=>{if(!R.value||!u?.client||bn(me.value))return;W([]),me.value="pending";const Oe=Wt.value;Ie.value||vs();const Yt=performance.now();try{const rt=await u.client.addressChangeStart("shipping").then(ge=>({response:ge,error:void 0})).catch(ge=>({response:void 0,error:ge})),Te=performance.now()-Yt;if(rt.error){const{error:ge}=rt;if(ge instanceof vd){v.log("third_party_delivery_address_timeout","Address change timed out, falling back to manual entry.",{duration:Te}),W([{code:"GENERAL_ERROR",message:String(p.translate("shipping.third_party_address_timeout"))}]),ht();return}const Cs=ge instanceof Error?ge.message:String(ge);if(ge instanceof gd&&ge.isUserCancelledError){v.log("third_party_delivery_address_cancelled","User cancelled address selection",{duration:Te}),it(),U.value=Oe,Ne.current?.focus();return}ge instanceof fd?(v.log("third_party_delivery_address_protocol_error","Address change failed due to protocol/schema violation",{duration:Te,technicalError:Cs}),u.client.error({code:"INVALID_PAYLOAD",message:"Invalid response format from address selection",timestamp:Date.now()})):v.log("third_party_delivery_address_error","Address change failed with error",{duration:Te,error:Cs}),W([{code:"GENERAL_ERROR"}]),ht();return}const{response:Ze}=rt;if(!Ze||typeof Ze!="object"){v.log("embedder_invalid_response","Invalid or missing response from embedder",{event:"checkout.addressChangeStart",duration:Te,receivedResponse:Ze}),u.client.error({code:"INVALID_PAYLOAD",message:"Invalid or missing response from address selection",timestamp:Date.now()}),W([{code:"GENERAL_ERROR"}]),ht();return}if(Ze?.errors&&Ze.errors.length>0){W(Ze.errors),v.log("embedder_error_cancelled_operation","Address change cancelled due to embedder errors",{event:"checkout.addressChangeStart",errorCodes:Ze.errors.map(ge=>ge.code),duration:Te}),ht();return}if(Ze?.cart){Mt(()=>{for(const ge of Object.values(H))ge.value=void 0;Ge()});try{await u.client.applyCart(Ze.cart),Ee.dispatch("addressReplaced"),Ie.value?it():Zn(),v.log("address_change_start_success","Successfully applied address change from embedder",{duration:Te}),Ne.current?.focus()}catch(ge){v.log("cart_update_failed_after_address_change","Failed to apply cart update after address change",{event:"checkout.addressChangeStart",error:ge instanceof Error?ge.message:String(ge),duration:Te}),u.client.error({code:"INVALID_CART",message:"Failed to apply cart update after address change",timestamp:Date.now()}
2),W([{code:"GENERAL_ERROR"}]),ht()}}else Ie.value?it():Zn()}catch(rt){const Te=performance.now()-Yt;v.log("third_party_delivery_address_error","Error delegating address change to embedder.",{error:rt instanceof Error?rt.message:String(rt),duration:Te}),W([{code:"GENERAL_ERROR"}]),ht()}},[Ie,R,u,v,W,p,H,me,Ee,Ge,Wt,vs,ht,it,U,Zn]),Yr=w(async()=>{if(Ie.value)return;if(R.value){if(U.value)return;await Qn();return}const Oe=!U.value;Gy({userEvents:C,source:g,checkout:f,shop:S},Oe),U.value=Oe},[Ie,C,g,f,S,U,Qn,R]);L(()=>{if(R.value&&xe&&!Jn.value&&!Rt.value){U.value=!1;return}Wt.value?U.value=!0:gn.value&&!Rt.value&&(U.value=!1)},[U,R.value,xe,Jn.value,Wt.value,gn.value,Rt.value]);const jr=le.length===0&&ye.length===0,Kr=ee.value.length===1&&Q.value&&jr,qr=c.value,$r=!Ut.value&&!Se.value&&!Et.value&&Pt&&!(R.value&&x.value),Xr=R.value&&!Et.value&&X.value&&!x.value,Jr=$r||Xr,Zr=(()=>{if(R.value){const{firstName:Oe,lastName:Yt}=o.value,Te=p.formatName(Oe,Yt,!0);return t(b,{children:[Oe&&Yt&&t(k,{children:Te}),t(D,{when:x,fallback:t(k,{color:"subdued",children:Gt}),children:t(k,{tone:"critical",children:p.translate("address_management.address_form.add_address")})})]})}return l??Gt})(),Qr=x.value?p.translate("shipping.add_shipping_address"):void 0,ea=fe&&!Wt.value?t(Zp,{vatNumber:fe.taxId.value,onAdd:()=>{U.value=!0,ae.focus()}}):void 0,ta=Je.value?t(K,{padding:"none base base base",children:t(gr,{filteredFields:Ve.value?[Ve.value]:void 0})}):void 0,el=ta&&ea?t(b,{direction:"block",gap:"base",children:[ta,ea]}):ta??ea,tl=t(Oa,{tone:"info",children:p.translate("address_management.draft_order_delivery_address_reminder")}),nl=gn.value&&!Rt.value||Et.value?null:c.value?t(G,{children:[ms,tl]}):qn.value?ms:null,al=Je.value?{}:{primaryContent:Kn.primary,secondaryContent:Kn.secondary,compactContent:Kn.compact,inlinePrimaryContent:cs,inlineSecondaryContent:ds,compactPrimaryContent:us,compactSecondaryContent:hs,summary:Zr},gs={buttonRef:Ne,open:U.value,id:_e,label:p.translate("shipping.shipping_address_title"),error:nl,buttonAccessibilityLabel:Qr,...al,secondaryPersistentContent:el,onToggle:qr?void 0:Yr,disabled:Ie.value||Kr||(ys.value?!1:Jr),renderChildrenWhenCollapsed:!0,icon:t(Ye,{id:"deliveryAddress-truckIcon",type:"truck",size:"fill"})},fs=t(Th,{embedderErrors:j,onDismissEmbedderErrors:()=>W([]),showMissingAddressField:Je.value,onAddressDelegation:Qn,onFirstNamePersisted:Yn,vatIdFieldMode:ae});return t(G,{children:[M&&t(yr,{}),s?s(gs,fs):t(ce,{...gs,children:fs})]})}function $y(e,n=[]){const a=Object.entries(e).reduce((o,[i,r])=>(typeof r!="boolean"&&!r||n.includes(i)||(o[i]=r),o),{});return Object.keys(a).length===0}function Xy(){const e=Y().buyerIdentity.value?.purchasingCompany,n=vo();return e?t(ar,{formattedAddress:n}):void 0}const Pn=({errorBanner:e})=>t(K,{paddingBlock:"small-500",children:e}),Jy=({errorSignal:e})=>{const n=e.value;if(!n)return null;const a=n.type;switch(a){case"invalid-address-banner":return t(Pn,{errorBanner:n.element});case"default-vaulted-delivery-address-error-banner":return t(Pn,{errorBanner:n.element});case"unavailable-in-buyer-location-banner":return t(Pn,{errorBanner:t(Ga,{})});case"validation-errors-banner":return t(Pn,{errorBanner:n.element});default:rl(a)}};function Zy(){const{formattedAddress:e,address:{phone:n,countryCode:a}}=Kl(["company"]),o=!ba().value,{errorSignal:i}=Ty({loading:o,phone:n,countryCode:a}),r=!!Dy()?.length,l=!!ql()?.length,d=!!i.value,c=!!(l||r||d);return t(fr,{summary:o?t(re,{}):t(b,{direction:"inline",children:[c&&t(G,{children:[t(Ye,{tone:"critical",type:"alert-circle"}),t(je,{display:"inline",inlineSize:"small-400"})]}),e]}),forceOpen:c})}function Qy(){const e=Y().buyerIdentity,n=$l(),a=Eo();return h(()=>!!e.value?.purchasingCompany&&(!n.value||a.value))}function ls(e){const{checkout:{identity:n}}=y(),a=Qy();return n.current.value==="amazonPay"||n.current.value==="buyWithPrime"?t(Zy,{}):a.value?t(ss,{}):t(fr,{...e})}function Cr(){const{i18n:e,router:n}=y(),a=Y().buyerIdentity.value?.purchasingCompany,s=yo(),o=Eo(),i="deliveryAddress",r=h(()=>Hn(n,i));return!a||a.contact.locationCount<=1||o.value?t(Be,{id:i,level:1,autoFocus:r.value,children:e.translate("shipping.delivery_title")}):t(ct,{gridTemplateColumns:"@media (inline-size >= small) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",gap:"@media (inline-size >= small) base, none",alignItems:"@media (inline-size >= small) center, ''",alignContent:"@media (inline-size >= small) center, ''",justifyContent:"@media (inline-size >= small) start, ''",justifyItems:"@media (inline-size >= small) start, ''",children:[t(Be,{id:i,level:1,autoFocus:r.value,children:e.translate("contact.ship_to_company",{companyName:a.location.name})}),t(D,{when:s,children:t(Pi,{})})]})}function ev(){const{i18n:e}=y(),{eligibility:n,redeemableBalance:a,messages:s,isDigitalGoodsRedemptionAllowed:o}=tr(),i=(n.eligible||o)&&a,r=s.length>0?t(b,{gap:"small-200",children:s}):void 0;return!i&&!r?null:i?t(tv,{redeemableBalance:a,messages:r}):t(ce,{id:"cashRedemption",open:!1,label:e.translate("order_summary.shop_cash_title"),error:r})}function tv({redeemableBalance:e,messages:n}){const{i18n:a}=y(),{amount:s,checked:o,handleChange:i,disabled:r}=Ji(e),l=e?a.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"}):void 0;return t(ce,{id:"cashRedemption",open:!0,label:a.translate("order_summary.shop_cash_title"),primaryContent:l,error:n,primaryAction:t(qi,{checked:o,onChange:i,disabled:r}),children:t(k,{fonts:"primary",tone:"accent",children:s})})}function _r({onShowPickupLocations:e}={}){const{i18n:n}=y(),a=Pe(),[s]=Ro(),o=s.includes("PICK_UP"),{value:i}=Da().value,{value:r}=Io().value,l=!!(i||r),d=$d({mode:"localPickup"}),c=h(()=>d.value.merchandiseLines),u=h(()=>d.value.allowAlternativeAction),p=h(()=>d.value.merchandiseLines.length>0),m=Qe(),v=l&&!p.value;if(!o||!a.value.delivery)return null;const C=p.value&&l;return t(Wa,{name:"local-pickup-adjacent",variant:"adjacent",children:t(b,{gap:p.value?"base":"small-400",paddingBlockEnd:C?"base":void 0,children:[t(D,{when:m,children:t(K,{paddingBlockStart:"small-400",paddingBlockEnd:v?"small-400":void 0,children:t(Be,{level:2,children:n.translate("delivery_options.pickup")})})}),t(D,{when:p,children:t(Xd,{bannerType:"pickup",merchandiseLines:c,allowAlternativeAction:u})}),t(nv,{hasNoDeliveryMethods:l,onShowPickupLocations:e})]})})}function nv({hasNoDeliveryMethods:e,onShowPickupLocations:n}){const{i18n:a}=y(),s=Qe(),o=za(),{progressing:i}=ut(),r=$e("deliveryNext").value,l=qe(),{isOnlyCountryAvailable:d}=di(),c=ue(!1),u=h(()=>o.value?.methods??[]),p=h(()=>{const _=o.value;return _&&Zo(_)}),m=h(()=>u.value.length>0&&Jd(u.value)),v=$(We(Cd).hasViolations),C=Zd({allLocationsFarAway:m,selectedPickupOptionNoLongerAvailable:v}),f=ko({methods:u.value,selectedDeliveryMethodHandle:p.value?.handle}),g=h(()=>Xl(o.value?.targetMerchandiseLines)),S=h(()=>Qd(u.value,d,g.value,a,{selectedDeliveryMethodHandle:p.value?.handle,allLocationsFarAway:m.value})),P=()=>{f(d?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain"),n?n():c.value=!0};return e?null:t(G,{children:[t(D,{when:C,children:t(eu,{itemCount:g.value,methods:u.value,onChangeLocationClick:P})}),t(b,{direction:"inline",gap:"small-400",alignItems:"center",justifyContent:"space-between",paddingBlockStart:s.value?void 0:"small-200",paddingBlockEnd:s.value?"small":"small-200",children:[l.value&&!i.value&&r?t(re,{inlineSize:"base"}):t(k,{color:"subdued",children:S}),t(ui,{onClick:P})]}),n?null:t(pi,{methods:o.value?.methods,type:o.value?.type,open:c.value,onClose:()=>{c.value=!1}})]})}function av(e){const n=q(),a=h(()=>{const o=e.value?e.value.methods.length-1:void 0;return o!==void 0&&(n.current=o),o}),s=h(()=>a.value??n.current);return{currentAdditionalLocations:a,additionalLocationsCount:s}}const js=20,Ks={isLocationFormVisible:!1};function Sr({initiallyOpen:e=!1,renderRollup:n}){const{i18n:a,shop:s}=y(),{deliveryNext:o}=Y(),{progressing:i}=ut(),r=$e("deliveryNext"),l=qe(),{value:d}=Da().value,{value:c}=Io().value,u=!!(d||c),p=za(),m=h(()=>_d(o.value)??[]),v=h(()=>s.shipPickupInOneOrderEnabled?p.value&&Zo(p.value):m.value[0]),C=h(()=>v.value?.handle??""),f=h(()=>({handle:C.value})),g=hi(),{isOnlyCountryAvailable:S}=di(),P=nn(v.value?.pickupLocation?.address,{hiddenFields:["postalCode","countryCode","phone"]}),_=se("Checkout::PickupLocations::RenderBefore"),I=se("Checkout::PickupLocations::RenderAfter"),M=se("purchase.checkout.pickup-location-option-item.render-after"),E=_.length>0?t(ke,{customizations:_,options:Ks}):void 0,A=I.length>0?t(ke,{customizations:I,options:Ks}):void 0,F=tu(),T=ko({methods:m.value||[],selectedDeliveryMethodHandle:v.value?.handle}),[N,V]=ft(!1),B=ue(e),R=ue(!1),H=ve=>{V(!0),R.value=ve??!1},X=()=>{V(!1),R.value=!1},Z=()=>{T(S?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},{currentAdditionalLocations:O,additionalLocationsCount:x}=av(p),j=h(()=>!!O.value||l.value&&r.value&&x.value!==0);let W,z,oe,ee,Q;const le=F.value?t(b,{gap:"small-200",children:t(nu,{variant:"banner"})}):void 0;if(l.value&&!i.value&&r.value)W=t(re,{}),z=t(re,{inlineSize:"base"}),oe=t(re,{inlineSize:"small"}),Q=le;else if(v.value?.pickupLocation){const{cost:{amount:ve,currencyCode:Ee},pickupLocation:{name:Se}}=v.value,Re=v.value.pickupLocation?.type==="PickupInStoreLocation"?v.value.pickupLocation.distanceFromBuyer:void 0,J=Re&&!S?au(a,Re):void 0,_e=ve===0?a.translate("shipping.free_rate_label"):a.formatCurrency(ve,{currency:Ee}),U=v.value.pickupLocation.type==="PickupInStoreLocation"&&v.value.pickupLocation.instructions.trim();W=t(G,{children:[Se,t(Qp,{}),_e]}),z=P||void 0;const ae=J||U?t(ou,{distanceLabel:J,instructions:U||void 0}):null,Ne=M.length>0?t(ke,{customizations:M,options:f.value}):null;ae&&Ne?oe=t(b,{gap:"small-400",children:[ae,Ne]}):oe=ae??Ne??void 0,ee=E?t(b,{gap:"small-200",children:E}):void 0,Q=le||A?t(b,{gap:"small-200",children:[le,A]}):void 0}const ye=!r.value&&u===!0,de=u?t(ui,{onClick:()=>{H(),Z()},commandFor:su}):void 0,te=j.value?t(sv,{locationCount:x.value,onShowModal:H,onTrackAnalytics:()=>T("checkout_pickup_buyer_reveal_more")}):void 0,Ce=n?{id:"pickupLocations",label:a.translate("delivery_options.pickup"),open:B.value,disabled:ye||M.length>0,onToggle:()=>{B.value=!B.value},primaryContent:W,secondaryContent:z,primaryPersistentContent:ee,secondaryPersistentContent:A}:{id:"pickupLocations",label:a.translate("local_pickup.title"),open:ye,primaryContent:W,secondaryContent:z,tertiaryContent:oe,primaryPersistentContent:ee,secondaryPersistentContent:Q,primaryAction:de,secondaryActions:te},Ae=t(wh,{onShowModal:H}),fe=n?t(b,{gap:"base",children:[t(Li.Provider,{value:!1,children:t(_r,{onShowPickupLocations:()=>H()})}),de,Ae,te]}):g&&Ae;return t(G,{children:[n?n(Ce,fe):t(ce,{...Ce,children:fe}),t(pi,{methods:p.value?.methods,type:p.value?.type,open:N,onClose:X,addressFocus:R})]})}function sv({locationCount:e,onShowModal:n,onTrackAnalytics:a}){const{progressing:s}=ut(),o=$e("deliveryNext"),i=Da(),r=h(()=>s.value||!o.value&&!i.value.loading);return t(D,{when:r,fallback:t(re,{}),children:t(ov,{locationCount:e,onShowModal:n,onTrackAnalytics:a})})}function ov({locationCount:e,onShowModal:n,onTrackAnalytics:a}){const{i18n:s}=y();return e?t(Dn,{variant:"plain",textDecoration:"none",inlineAlignment:"start",onClick:()=>{n(),a()},children:t(b,{direction:"inline",gap:"small-400",alignItems:"center",children:t(k,{type:"strong",children:e>js?s.translate("local_pickup.toggle_multiple_locations",{count:String(js)}):s.translate("local_pickup.toggle_more_locations",{count:e})})})}):null}function qs({destination:e}
2){const n=ue(!1),a=ue(),s=(o,i)=>(a.value={props:o,content:i},null);return t(G,{children:[e==="deliveryAddress"?t(ls,{initiallyOpen:n.value,renderRollup:s}):t(Sr,{initiallyOpen:n.value,renderRollup:s}),t(iv,{rollup:a,switched:n})]})}function iv({rollup:e,switched:n}){const a=e.value;return a?t(ce,{...a.props,children:t(b,{gap:"base",children:[t(rv,{switched:n}),a.content]})}):null}function rv({switched:e}){const n=Ct();if(!n)return null;const a=s=>{e.value=!0,n.select(s)};return t(iu,{options:n.options,selected:n.selected,select:a,showChangedBanner:!1})}const $s=new Set(["SHIPPING","PICK_UP"]);function lv(e,n=[],a=[]){return e==="vaulted"&&n.every(({id:s})=>$s.has(s))&&a.length===1&&$s.has(a[0])}function un(){const{checkout:e,shop:n}=y(),a=$(Ct()),s=n.hasFlagEnabled(Qo);return h(()=>a.value?.variant==="next"&&(!s||cv(e.sections.availableToRender.value))&&lv(e.configuration.deliveryMethodSelectorPlacement,a.value?.options.value,a.value?.selected.value))}function cv(e){return e.filter(n=>n==="deliveryAddress"||n==="localPickupOptions").length===1}const dv=()=>{const{i18n:e}=y(),n=ue(!0),{value:a}=Y().optionalDuties,s=a?.buyerRefusesDuties?e.translate("shipping.duties_and_taxes_options.ddu_title"):e.translate("shipping.duties_and_taxes_options.ddp_title");return t(ce,{open:n.value,id:"optionalDuties",label:e.translate("shipping.duties_and_taxes_title"),primaryContent:s,onToggle:()=>n.value=!n.value,children:t(Di,{})})};function uv(){const{i18n:e,checkout:n}=y(),a=ne().shippingAddress.value,{deliveryNext:{value:s},buyerIdentity:{value:o}}
2=Y(),r=(n.proposal.facts.delivery??[])[0],l=o?.purchasingCompany,d=l?.location.name,c=!!l&&!!d,u=s?.status==="unavailable"?a:r?.deliveryAddress,p=nn(u??void 0,{countryFormat:"explicit",displayName:c}),m=e.formatName(u?.firstName,u?.lastName,!0);if(r?.pickupAddress)return t(pv,{address:r.pickupAddress??void 0});const v=u?m:e.translate("review.blocks.no_address"),C=c?d:v,f=c?e.translate("review.blocks.no_address"):void 0,g=u?p:f;return t(ce,{id:"orderEditDeliveryAddress",label:e.translate("review.blocks.shipping_address_title"),primaryContent:C,secondaryContent:g})}function pv({address:e}){const{i18n:n}=y(),a=nn(e,{hiddenFields:["postalCode","countryCode","phone"]}),s=a?t(k,{children:a}):void 0;return t(ce,{id:"orderEditDeliveryAddress",label:n.translate("local_pickup.title"),primaryContent:s})}function hv(){const{i18n:e,checkout:n}=y(),o=(n.proposal.facts.delivery??[])[0]?.lines.filter(({deliveryChange:i,isFulfilled:r})=>i!=="REMOVED"&&!r).map(i=>t(Eu,{line:i},i.title));return t(ce,{id:"orderEditShippingMethod",label:e.translate("shipping.title"),primaryContent:o})}function mv({i18n:e,shopPay:n,chargeAmount:a,numberOfPaymentTerms:s,installmentsUnavailable:o,paymentDue:i,installmentsConfig:r}){const l=io(n),d=i?.currencyCode,c=r?.availableLoanTypes,u=a?e.formatCurrency(a,{currency:d,form:"short"}):void 0,{payNowLabel:p,payNowSubtitle:m}={payNowLabel:e.translate("installments.installments_pay_now"),payNowSubtitle:e.translate("installments.installments_pay_now_subtitle")},v=()=>d==="GBP"?e.translate("installments.pay_in_installments.gb"):d==="AUD"?e.translate("installments.pay_in_installments.au"):o||!u||!c||c.length===0?g():c.includes("ZERO_PERCENT")?e.translate("installments.pay_in_installments.only_interest"):c.includes("INTEREST")&&c.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments.all"):c.includes("INTEREST")?e.translate("installments.pay_in_installments.only_interest"):f(u),C=()=>!c||!u||c.length===0?S():c.includes("ZERO_PERCENT")?e.translate("installments.pay_in_installments_subtitle.interest"):c.includes("INTEREST")&&c.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments_subtitle.all",{amount:u}):c.includes("INTEREST")?e.translate("installments.pay_in_installments_subtitle.interest"):S(),f=A=>s===2?e.translate("installments.pay_in_installments.only_split_pay_2",{amount:A}):s===1?e.translate("installments.pay_in_installments.only_split_pay_30",{amount:A}):e.translate("installments.pay_in_installments.only_split_pay",{amount:A}),g=()=>s===2?e.translate("installments.pay_in_installments_no_amount_2"):s===1?e.translate("installments.pay_in_installments_no_amount_30"):e.translate("installments.pay_in_installments_no_amount"),S=()=>s===2?e.translate("installments.pay_in_installments_subtitle.split_pay_2"):s===1?e.translate("installments.pay_in_installments_subtitle.split_pay_30"):e.translate("installments.pay_in_installments_subtitle.split_pay"),P=()=>o||!c||!u||c.length===0?e.translate("installments.pay_in_installments_subtitle.informational_gb"):s===2?S():c.includes("INTEREST")&&c.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:u}):c.includes("ZERO_PERCENT")&&c.includes("SPLIT_PAY")&&(s===6||s===12)?e.translate("installments.pay_in_installments_subtitle.split_pay_3_6z_12z_gb",{amount:u}):c.includes("ZERO_PERCENT")&&s===12?e.translate("installments.pay_in_installments_subtitle.zero_percent_12z_gb",{amount:u}):c?.includes("ZERO_PERCENT")&&s===6?e.translate("installments.pay_in_installments_subtitle.zero_percent_6z_gb",{amount:u}):c.includes("INTEREST")?e.translate("installments.pay_in_installments_subtitle.informational_gb"):e.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:u}),_=v(),I=d==="GBP"?P():C(),M=()=>l==="SHOP_PAY"?`${p} - ${m}`:`${_} - ${I}`,E=l==="SHOP_PAY";return{payNowLabel:p,payNowSubtitle:m,installmentsLabel:_,installmentsSubtitle:I,summary:M(),primaryLabel:E?p:_,secondaryLabel:E?m:I}}function yv(){const{i18n:e,shopPay:n,checkout:a}=y(),s=sn(),{paymentMethods:o}=Y();return h(()=>mv({i18n:e,shopPay:n,chargeAmount:a.installments.chargeAmount.value,numberOfPaymentTerms:a.installments.numberOfPaymentTerms.value,installmentsUnavailable:a.installments.isUnavailable.value,paymentDue:s.value,installmentsConfig:ei(o.value)}))}function vv(){const{userEvents:e}=y(),n=fn(Cn.SHOP_PAY_PAY_NOW),a=fn(Cn.SHOP_PAY_INSTALLMENTS),s=fn(Cn.SHOP_PAY_INSTALLMENTS_DEFAULTED),o=fn(Cn.SHOP_PAY_PAY_NOW_DEFAULTED);return{recordRetailEvent:w(r=>{const l=(function(){switch(r){case"payment_method_pay_now":return n;case"payment_method_installments":return a;case"default_payment_method_installments":return s;case"default_payment_method_pay_now":return o;default:return a}})();return e.monorailEvent({schemaId:"retail_shop_pay/2.0",payload:l})},[e,n,a,s,o])}}
2function gv({onAutoExpand:e,ineligibilityReasonLabel:n}){const{source:a,checkout:s,shop:o,observability:i,userEvents:r,shopPay:l,embed:d}=y(),{visibility:c}=l,p=uo()!==null,m=s.installments.isUnavailable.value,v=Jl(),C=io(l),{paymentMethods:f}=Y(),g=h(()=>ei(f.value)),S=p?g.value?.availableLoanTypes:void 0,P=q(),_=xp(),I=l.user.installments.isRetryable.value,{recordRetailEvent:M}=vv(),E=Ru();L(()=>{n&&!I&&C==="SHOPIFY_INSTALLMENTS"&&l.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOP_PAY"})},[I,n,C,l.session]),L(()=>{l.session.isInternalProgressing.value||p&&!m&&(!v.value&&c.showAutoExpandedPaymentMethods&&e?.(),_.value.spiPreselected&&!E&&(l.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOPIFY_INSTALLMENTS"}),i.leaveErrorBreadcrumb("SPI preselected",{})))},[p,m,v.value,_.value.spiPreselected,l.session,i,c.showAutoExpandedPaymentMethods,E,e]),L(()=>{v.value&&p&&M(m?"default_payment_method_pay_now":"default_payment_method_installments")},[p,m,v.value,M]),L(()=>{m||!S||JSON.str
2ingify(P.current)!==JSON.stringify(S)&&(r.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...ws(a,s,o,{embedPlatform:d?.platform,shopAppSurface:l.app.config.surface}),eventType:Es.InterestEligibility,success:Rs(S),errorMessage:Rs(S)?void 0:JSON.stringify(["amount"])}}),r.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...ws(a,s,o,{embedPlatform:d?.platform,shopAppSurface:l.app.config.surface}),eventType:Es.SplitPayEligibility,success:!!S.includes("SPLIT_PAY"),errorMessage:S.includes("SPLIT_PAY")?void 0:JSON.stringify(["amount"])}}),P.current=S)},[S,m,r,a,s,o,d?.platform,l.app.config.surface])}function fv(){const{i18n:e}=y(),n=ue(!1),a=yv(),s=Zl(),o=w(()=>{n.value=!n.value},[n]),i=w(()=>{n.value=!0},[n]);return gv({onAutoExpand:i,ineligibilityReasonLabel:s}),t(ce,{open:n.value,id:"paymentOptions",label:e.translate("payment.payment_option.title"),primaryContent:a.value.primaryLabel,secondaryContent:a.value.secondaryLabel,onToggle:o,children:t(Nh,{ineligibilityReason:s})})}function Cv(){const{i18n:e}=y();return t(ce,{label:e.translate("pickup_point.title"),open:!0,children:t(Ya,{heading:"none"})})}function br(){const{userEvents:e,shop:n,source:a,checkout:s}=y(),o=w(r=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...Ke(a,s,n),action:r?"shipping_rates_expand":"shipping_rates_collapse"}})},[e,a,s,n]),i=w((r,l)=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_select_shipping_rate/3.1",payload:{...Ke(a,s,n),currentRate:r.handle??"",currentRatePrice:`${r?.cost?.amount??0}`,isLocalDelivery:!r.pickupLocation&&r.methodType==="LOCAL",isLocalPickup:!!r.pickupLocation,previousRate:l?.handle,previousRatePrice:typeof l?.cost?.amount=="number"?`${l?.cost?.amount}`:void 0}})},[e,a,s,n]);return{trackOnDeliveryToggle:o,trackSelectShippingMethod:i}}const _v=Qt({displayName:"ShippingGroupsSummary",load:()=>en(()=>Zt(()=>import("./component-ShippingGroupsSummary.DjJ3L9Uw.js"),__vite__mapDeps([108,1,2,3,4,5,6,7,8,9,10,82,81,83,109,76,20,21,22,23,24,16,17,25,58,59,60,61,50,62,63,64,43,44,45,12,46,47,48,49,35,36,51,42,65,66,67,68,69,70,71,72,73,74,75,77,84,85,86,30,87,88,11,13,14,15,18,19,26,27,28,29,31,32,33,34,37,40,41,89,90,52,91,92,93,94,95,96,97,80,98,99,100,101,102,103,104,105]))),renderLoading(){return t(re,{})}});function Sv({lines:e,hideThumbnail:n,shippingTime:a}){const{i18n:s,checkout:o}=y(),{deliveryExpectationLines:i}=Vi(),r=o.configuration.layout.isOnePage.value,l=d=>{const c=d.methods.find(({handle:P})=>P===d.selectedDeliveryMethodHandle);if(!c)return null;const{handle:u,cost:p,costAfterDiscounts:m,brandedPromise:v,estimatedTimeInTransit:C}=c,f=c.methodType==="LOCAL",g=!!c?.deliveryPredictionEligible,{deliveryExpectation:S}=ec(c,i||[],!!(g||v));return t(b,{gap:"small-400",children:t(K,{children:[t(ga,{methodTitle:Oo({deliveryMethod:c,localDelivery:f?s.translate("shipping.local_delivery"):void 0}),showInterpunct:!0,price:t(Bi,{cost:p,costAfterDiscounts:m,inlineDiscount:!0})}),a?t(he,{color:"subdued",size:r?void 0:"small",children:a}):t(fa,{deliveryMethod:c,deliveryExpectationLine:S,estimatedTimeInTransit:C,paragraphColor:"subdued"})]})},u)};return t(G,{children:e.map(d=>{const c=Ql(d.targetMerchandiseLines??[]);return c.slice(0,1).map(u=>t(ct,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"large-100",alignItems:"center",alignContent:"center",children:[!n&&(c.length>1?t(Mo,{variant:"fan-legacy",merchandise:c,size:"small",useResponsiveImageSources:!0,useTitleAsAltTextFallback:!0}):t(dh,{merchandiseItem:u,hideBadge:!0})),l(d)]},u.id))})})}function bv({state:e,addressInvalidMessage:n,addressIncompleteMessage:a}){const{i18n:s}=y(),o=Y().deliveryNext,i=$e("deliveryNext"),{deliveryExpectationLines:r}=Vi(),{rollup:{secondaryContent:{typography:{color:l}={}}={}}={}}=Vt(),d=Qe(),c=l??"base",u=e.status==="filled"?e.deliveryLines:void 0,p=eh({deliveryLines:u}),{hasViolations:m}=pe(Yo),{hasViolations:v}=pe(ln),C=t(b,{children:[t(re,{inlineSize:"base",size:"small"}),t(re,{inlineSize:"small",size:"extraSmall"})]});if(e.status==="initial"||e.status==="loading")return{compactPrimaryContent:t(re,{inlineSize:"base",size:"small"}),compactSecondaryContent:void 0,inlinePrimaryContent:C,inlineSecondaryContent:void 0,primaryContent:C,secondaryContent:void 0};if(e.status==="empty"||e.status==="error"){const T=a??s.translate("shipping.method_summary.incomplete_address_entered"),N=n??s.translate("shipping.invali
2d_shipping_method_summary"),V=s.translate("shipping.different_shipping_method_summary");let B=e.status==="empty"?T:N;m?B=T:v&&(B=V);const R=t(k,{children:B});return{compactPrimaryContent:R,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:R,primaryContent:R,secondaryContent:void 0}}if(ti(o.value,d.value)){if(i.value)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:C,secondaryContent:void 0};let T=t(_v,{});return p?T=t(nh,{summary:p}):d.value&&(T=t(Pv,{deliveryNextValue:o.value})),{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:T,secondaryContent:p?t(th,{summary:p,secondaryContentColor:c}):void 0}}const g=d.value?e.deliveryLines.filter(Ta):e.deliveryLines,S=up(g);if(!S)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:void 0,secondaryContent:void 0};const{costAfterDiscounts:P,cost:_,hideDiscountedTotalOnShippingSelector:I}=S,M=Oo({deliveryMethod:S,localDelivery:S.methodType==="LOCAL"?s.translate("shipping.local_delivery"):void 0}),E=r?.find(T=>T.deliveryStrategyHandle===S.handle),A=t(ga,{methodTitle:M,showInterpunct:!0,price:_&&P?t(Xs,{cost:_,costAfterDiscounts:P,hideDiscountedTotalOnShippingSelector:I}):void 0}),F=t(fa,{deliveryMethod:S,deliveryExpectationLine:E,paragraphColor:l??"base"});return{compactPrimaryContent:t(k,{type:"strong",children:t(ga,{methodTitle:M})}),compactSecondaryContent:t(G,{children:[t(fa,{deliveryMethod:S,deliveryExpectationLine:E,paragraphColor:l,formatContent:T=>T?t(b,{display:"inline",direction:"inline",columnGap:"none",alignItems:"center",children:["(",T,")"]}):null}),t(k,{color:l,children:t(Xs,{cost:_,costAfterDiscounts:P,hideDiscountedTotalOnShippingSelector:I,styleOverrides:{shouldBold:!1}})})]}),inlinePrimaryContent:A,inlineSecondaryContent:F,primaryContent:A,secondaryContent:F}}function Pv({deliveryNextValue:e}){const n=ni(e).filter(Ta);return n.length?t(ct,{gridAutoRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",children:t(Sv,{lines:n,hideThumbnail:n.length===1})}):null}function Xs({cost:e,costAfterDiscounts:n,hideDiscountedTotalOnShippingSelector:a,styleOverrides:s={}}){return!e||!n?null:t(Bi,{cost:e,costAfterDiscounts:n,inlineDiscount:!0,preDiscountCost:a,styleOverrides:s})}function Av(){const{i18n:e,checkout:{identity:{current:n}}}=y(),a=n.value,s=ba(),o=a==="amazonPay"||a==="buyWithPrime";return!s.value&&o?t(ce,{id:"amazonPayShippingMethods",label:e.translate("shipping.title"),primaryContent:t(re,{})}):t(Ev,{})}function Ev(){const{embed:e,i18n:n,checkout:a}=y(),s=wi(),{hasMultipleDeliveryGroups:o}=s.value,i=a.configuration.isAddressDelegationEnabled,{customizationsForRollupReveal:r}=Ni({hasMultipleDeliveryGroups:o,targeted:!1,shouldHandleRollup:!0}).value,l=se("Checkout::ShippingMethodDetails::RenderAfter"),d=se("Checkout::ShippingMethodDetails::RenderExpanded"),{uiStateSignal:c}=Ha(La),{hasViolations:u}=We(Sd),p=$(u),m=rs(),{hasViolations:v}=Lo(ai),C=$(v),f=h(()=>m.value&&C.value),g=Qe(),S=Mn([...r,...l,...d],{lazyReveal:!0}),P="shippingMethod",_=Ft(P,S.peek()),I=$(Ja(Jo([...r,...l,...d],"uiExtension").map(qt),w(()=>{_.value=!0},[_])));Me(()=>{S.value&&(_.value=!0)}),Me(()=>{(p.value||f.value||!g.value&&kv(c.value))&&(_.value=!0)});const M=Iv({identity:a.identity}),E=w(()=>{const H=!_.value;M?.(H),_.value=H},[M,_]),{deliveryNext:A,shippingAddress:F}=Y(),{parts:{deliveryLines:T}}=bd(),N=Rv({i18n:n,identity:a.identity}),V=bv({state:c.value,addressIncompleteMessage:N?.addressIncompleteMessage,addressInvalidMessage:N?.addressInvalidMessage}),B=(()=>{switch(e?.embedder){case"amazon":{const{compactPrimaryContent:H,compactSecondaryContent:X}=V;return H===void 0&&X===void 0?{primary:V.primaryContent,secondary:V.secondaryContent}:{compact:t(b,{direction:"inline",gap:"small-400",alignItems:"center",children:[H,X]})}}case"google":return{primary:V.inlinePrimaryContent,secondary:V.inlineSecondaryContent};default:return{primary:V.primaryContent,secondary:V.secondaryContent}}})();Me(()=>{Mv(A.value,T.value,F.value?.phone)&&(_.value=!0)});const R=h(()=>(c.value.status==="error"||c.value.status==="empty")&&!(S.value||I.value));return Me(()=>{R.value&&(_.value=!1)}),t(ce,{open:_.value,id:P,label:n.translate("shipping.title"),primaryContent:B.primary,secondaryContent:B.secondary,compactContent:B.compact,onToggle:i&&c.value.status==="empty"||R.value?void 0:E,renderChildrenWhenCollapsed:!0,icon:t(Ye,{id:"shippingMethod-packageDeliveryIcon",type:"package-delivery",size:"fill"}),children:t(Lh,{singleDeliveryGroup:s})})}function Rv({i18n:e,identity:{current:n}}){switch(n.value){case"amazonPay":case"buyWithPrime":case"businessCustomer":case"customerAccount":case"shopPay":return{addressIncompleteMessage:e.translate("shipping.method_summary.incomplete_address_selected"),addressInvalidMessage:e.translate("shipping_errors.invalid_shipping_method_summary")}
2;default:return}}function Iv({identity:{current:e}}){const{trackOnDeliveryToggle:n}=br(),a=w(s=>{n(s)},[n]);return e.value==="shopPay"?a:void 0}function kv(e){if(e.status!=="filled")return!1;const n=["SHIPPING","LOCAL"];return e.deliveryLines.some(a=>{const s=Pd(a);return n.includes(s?.methodType||"")?a.status==="available"&&a.hasDeliveryLineChange:!1})}function Mv(e,n,a){return Ad(e).some(({line:s,method:o})=>!(o?.methodType==="SHIPPING"||o?.methodType==="LOCAL")||!o?.phoneRequired?!1:!n.find(d=>{const c=d.peek();return c.type===s.type&&c.id===s.id})?.fields.deliveryMethodOptions.value.phone?.value&&!a)}const Js={rollup:{label:{visibility:"visible"},blockAlignment:"center"}},Ov={rollup:{label:{visibility:"hidden"},blockAlignment:"center"}},Lv={SHIPPING:{id:"shippingMerchandiseList",getTargetMerchandiseLines:lu},PICK_UP:{id:"pickupMerchandiseList",getTargetMerchandiseLines:ru}};function Zs({selectedDeliveryMethodType:e}){const{i18n:n}=y(),{deliveryLines:a}=ne(),s=Qe(),{showOverlay:o}=tc(),i=ue(!1),r=Lv[e],l=h(()=>r.getTargetMerchandiseLines(a.value)),{visibleSummary:d,isNegotiating:c}=cu(l),u=qe(),p=h(()=>du(a.value)),m=h(()=>p.value>=uu),v=h(()=>{const _=d.value;return _?_.isAllItems?n.translate("split_delivery.all_items"):n.translate("split_delivery.items_count",{count:_.totalItemCount}):""}),C=e==="PICK_UP"?n.translate("delivery_options.pick_up"):n.translate("delivery_options.ship"),f=t(D,{when:()=>d.value!==void 0&&(!u.value||!c.value),fallback:t(re,{}),children:t(k,{children:v})}),g=t(Mo,{variant:"fan-legacy",sortByPrice:!0,merchandise:d.value?.merchandiseLines??[],size:"small"});if(m.value)return t(va,{theme:Js,children:t(ce,{id:r.id,label:C,thumbnail:g,onClick:()=>o(pu),primaryContent:f})});const S=i.value||s.value;return t(va,{theme:S?Ov:Js,children:t(ce,{id:r.id,label:C,thumbnail:g,open:S,onToggle:S?void 0:()=>{i.value=!i.value},primaryContent:f,children:t(hu,{title:e==="PICK_UP"?n.translate("split_delivery.items_for_pickup"):n.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:e})})})}function Dv(e,n,a){if(n.isSplitShipAndPickup&&e==="shipping")return t(Be,{level:2,children:a.translate("delivery_options.ship_to_address")})}function Tv(){const e=Pe(),{checkout:n,shop:a,embed:s,i18n:o,source:i}=y(),{identity:r,identity:{current:l}}=n,d=l.value,c=a.hasFlagEnabled(Qo),u=nc(),p=ac(),m=si({checkout:n}),v=u.value&&!p.value,C=Qe(),f=Nn(),S=za().value!==void 0,P=$e("deliveryNext"),_=qe(),{deliveryLines:I}=ne(),E=Ed(I.value??[]).filter(O=>O.requiresShipping).length>0,A=ty(),F=ie(()=>({isSplitShipAndPickup:C.value,isBusinessCustomerSingleChoiceMode:v,businessCustomerCannotProvideShippingAddress:u.value,redemptionEligibilityVisible:A,shouldAllowInlineSplit:f.value,hasShippingMerchandiseLines:E,hasLocalPickupDeliveryLine:S,deliveryNextLoading:_.value&&P.value}),[C.value,v,u.value,A,f.value,E,S,_.value,P.value]),T=F.isSplitShipAndPickup?Rd:Id,N=T[d]??T.default,V=un(),B=O=>V.value&&(O==="deliveryAddress"||O==="localPickupOptions")?"deliveryDestination":O,R=O=>{switch(O){case"contact":return t(ur,{},O);case"businessCustomerSingleChoice":return t(ss,{},O);case"orderEditDeliveryAddress":return t(uv,{},O);case"orderEditShippingMethod":return t(hv,{},O);case"deliveryAddress":return V.value?t(qs,{destination:O}):t(ls,{},O);case"shippingMerchandiseList":return t(Zs,{selectedDeliveryMethodType:"SHIPPING"},O);case"shippingMethods":return t(Av,{},O);case"pickupMerchandiseList":return t(Zs,{selectedDeliveryMethodType:"PICK_UP"},O);case"localPickupOptions":return V.value?t(qs,{destination:O}):t(Sr,{},O);case"pickupPoint":return t(Cv,{},O);case"dutyOptions":return t(dv,{},O);case"paymentOptions":return t(fv,{},O);case"payment":return t(Ca,{},O);case"billing":return t(_a,{isAbovePaymentSummary:m},O);case"cashRedemption":return t(ev,{},O);default:return t(G,{})}};On(()=>{c&&n.sections.unstable_providePreactContext(F)},[c,n.sections,F]);const H={configuration:n.configuration,installments:n.installments,isShippingRequired:n.isShippingRequired,vaultedSections:c?n.vaultedSections:{signal:e},source:i,proposal:n.proposal,identity:r,shop:a,embed:s},X=c?n.sections.availableToRenderGrouped.value:kd(Md(N.filter(O=>Od[O].shouldRender({preactContext:F,concepts:H})),{preactContext:F,concepts:H}));let Z=!1;return X.filter(O=>O.length>0).map(O=>{const x=[];for(const{sectionId:z,groupId:oe}of O){const ee=R(z);oe!=null&&Ld.has(oe)?(!Z&&n.configuration.visibility.showDeliveryHeading.value&&(x.push(t(Cr,{},"deliveryHeading")),Z=!0),x.push(t(Ot,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(Wa,{name:z,children:ee})},B(z)))):x.push(ee)}const j=O[0]?.groupId,W=Dv(j,F,o);return{groupId:j,header:W,elements:x}})}const wv="K6vpG",Nv="_5hYUU",Vv="CU3YS",Bv="_5HWz9",Fv="r8rqQ",xv="_2Ojsq",kt={DivideChildren:wv,noVaultedDiv
2iders:Nv,ShowTopDivider:Vv,ShowBottomDivider:Bv,StripBlockStartPadding:Fv,StripBlockEndPadding:xv};function Qs({hideLastDivider:e,showTopDivider:n}){const a=Pe(),{negotiate:s}=ut(),{checkout:o,embed:i,shop:r,source:l}=y(),d=Nn(),c=h(()=>a.value.delivery&&o.isShippingRequired.value),u=h(()=>c.value&&d.value),p=si({checkout:o}),m=h(()=>a.value.contact&&o.configuration.showContactInformation),v=h(()=>Dd({isContactVaulted:a.value.contact,configuration:o.configuration,identity:o.identity,embed:i,shop:r}));function C(){return[...v.value?[t(ur,{},"contact")]:[],...c.value?[t(ls,{},"delivery")]:[]]}const f=[...C(),...S(o)],g=f.length>0||m.value;if(Vh(g),Gv({hasSections:g,identity:o.identity,wallets:o.wallets,negotiate:s}),f.length===0)return null;return t(K,{children:[t(kh,{children:t(Hv,{hideLastDivider:e,showTopDivider:n})}),t(D,{when:()=>a.value.payment,children:t(Im,{})}),t(D,{when:u,children:t(mi,{})})]});function S(P){if(lt(l))return a.value.payment?[t(Ca,{},"payment")]:[];const _=[];return p&&_.push(t(_a,{isAbovePaymentSummary:!0},"businessCustomerBilling")),a.value.payment&&(_.push(t(Ca,{},"payment")),P.configuration.visibility.showCashRedemption.value&&_.push(t(ny,{},"cashRedemption")),a.value.billing&&!p&&_.push(t(_a,{},"billingAddress"))),_}}function eo({sections:e,hideLastDivider:n,showTopDivider:a}){const{checkout:{identity:s}}=y(),o=Pe(),i=Yv(s,o.value.payment),{vaulted:{spacing:r="none",cornerRadius:l,divider:{borderWidth:d="base",borderStyle:c="base",borderColor:u="base",visibility:p="visible"}={}}={}}=Vt(),{main:{section:m}}=ka(),v=!i&&!Xt(n),{blockStart:C,blockEnd:f}=zv(sc().rendered?.padding);return e.length===0?null:t("div",{className:ro(kt.DivideChildren,{[kt.ShowTopDivider]:Xt(a),[kt.ShowBottomDivider]:v,[kt.StripBlockStartPadding]:C,[kt.StripBlockEndPadding]:f}),style:Uv({spacing:r,borderWidth:d,borderStyle:c,borderColor:u,visibility:p,cornerRadius:m?.cornerRadius??l}),children:e})}function Hv({hideLastDivider:e,showTopDivider:n}){const a=Tv(),s=Qe();if(a.length===0)return null;const o=a.length>1&&s.value;return t(G,{children:o?t(b,{gap:"large-200",children:a.map(({groupId:i,header:r,elements:l},d)=>{const c=d===0,u=d===a.length-1,p=t(Fn,{hideDivider:"always",children:t(eo,{sections:l,hideLastDivider:u?Xt(e):!0,showTopDivider:c&&Xt(n)})});return r?t(b,{gap:"base",children:[r,p]},i):t(G,{children:p},i)})}):t(eo,{sections:a.flatMap(i=>i.elements),hideLastDivider:e,showTopDivider:n})})}function to(e){return e!=null&&e!=="none"}function zv(e){if(e==null)return{blockStart:!1,blockEnd:!1};const n=Array.isArray(e)?e[0]:e;let a=Array.isArray(e)?e[0]:e;return Array.isArray(e)&&e.length===4&&(a=e[2]),{blockStart:to(n),blockEnd:to(a)}}function Uv({spacing:e,borderWidth:n,borderStyle:a,borderColor:s,visibility:o,cornerRadius:i}){const r=jv[e],l={none:"0px",...Rn.borderWidth},d={base:Rn.color.default.border,transparent:"transparent"},c=o==="hidden"?"0px":l[n],u=Kv[a];return{"--vaulted-divider-width":c,"--vaulted-divider-style":u,"--vaulted-divider-color":d[s],"--vaulted-spacing":r,"--divider-offset":`calc((${r} + calc(${c} * 2)) / 2)`,"--vaulted-corner-radius":i?Rn.borderRadius[i]:void 0}}function Gv({hasSections:e,identity:n,wallets:a,negotiate:s}){L(()=>{e&&Wv({identity:n,wallets:a})&&s({silenceViolations:["all"]})},[])}function Wv({identity:e,wallets:n}){return e.current.value==="amazonPay"||e.current.value==="buyWithPrime"?!1:!n.activeSession.value}function Yv(e,n){return e.current.value==="guest"||e.current.value==="businessCustomer"&&n}const jv={none:"0px",...Rn.spacing},Kv={base:"solid",dashed:"dashed",dotted:"dotted"};function Pr(){const{methods:e}=Do(),{userEvents:n,shop:a,source:s,checkout:o}=y(),i=o.identity.current.value==="shopPay";Me(()=>{if(i)for(const r of e.value)gt(()=>n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...Ke(s,o,a),action:`delivery_method_${r.toLowerCase()}_selected`}}))})}function qv(){Pr();const{shop:e,i18n:n,checkout:a}=y(),s=Ct(),o=un(),r=!e.hasFlagEnabled(oi),l=!a.configuration.visibility.showDeliveryHeading.value&&!r;if(!s)return null;if(o.value)return t(mu,{});const d=n.translate("shipping.delivery_title");return t(Li.Provider,{value:!0,children:t(bp,{presentation:"base",children:t(K,{padding:r?"none":"base none",accessibilityLabel:d,className:r?kt.noVaultedDiv
2iders:void 0,children:t(b,{gap:"base",children:[l&&t(k,{color:"subdued",children:d}),t(yi,{})]})})})})}function Ar(){const{source:e}=y(),n=Pe(),a=To(),s=Ct(),o=un();return lt(e)||!n.value.delivery?null:t(G,{children:[t(qv,{}),a.value&&s&&!o.value?t(je,{blockSize:"base"}):null]})}function $v(){const{checkout:e,embed:n,shop:a}=y(),{current:s,customerContactMethodPrefilled:o}=e.identity,i=s.value,r=n?.isFlagshipPartner??!1,{contact:l}=Pe().value;return!ii({isContactVaulted:l,identity:i,isPartnerEmbed:r,embedder:n?.embedder,isInterstitialBrandingEnabled:on({embedder:n?.embedder,shop:a}),customerContactMethodPrefilled:o})||!e.configuration.showContactInformation?null:t(Xv,{vaultedContactTypeOverride:i==="sdkCartHints"?"base":void 0})}function Xv({vaultedContactTypeOverride:e}){const n=lr();cr(n);const a=ue(!1),s=qe(),{embed:o}=y(),i=n.displayOptions,r=i.vaultedContactType==="base",l=i.vaultedContactType==="rollup"?e??"rollup":i.vaultedContactType,d=r?i.contentLayout:void 0,c=i.vaultedContactType==="rollup"&&l==="base";if(l!=="base")return null;const u=n.logo;let p=null;return(c&&n.hasError||r)&&(p=i.children??null),t(G,{children:[t(dr,{emailAddress:n.displayContent.contact,phone:n.phone,logo:u,moreOptions:n.moreOptions,emailAlignment:c&&n.isEmbeddedPartner&&!o?.interstitialPartnerProfileIconUrl?"start":void 0,layout:c?void 0:d,children:p}),n.showShopPayVerification&&t(D,{when:s,children:t(ci,{email:n.email??"",open:a.value,showPopover:m=>{a.value=m}})})]})}function Jv({showDelivery:e}){const{embed:n}=y(),a=un(),{rollup:{inlinePadding:s}}=Vt(),o=t(G,{children:[t($v,{}),t(D,{when:e,children:t(Ar,{})}),t(D,{when:()=>!a.value,children:t(_r,{})})]}),i=pt(n?.embedder),r=i?`none ${In(s)??"none"}`:void 0;return i?t(K,{padding:r,children:o}):o}const Er=(e,n)=>{if(e.length!==n.length)return!1;const a=[...e];return n.every(s=>{const o=a.findIndex(i=>i.promotionId===s.promotionId&&yt(i.destinationAmount,s.availableBalance));return o===-1?!1:(a.splice(o,1),!0)})};function no(e,n,a,s){const o=e?.status;return o==="pending"||(a||s)&&(o==="filled"||n)}function Zv(e,n){const a=$(e),s=$(n),{shopDiscountOffer:o,shopPromotion:i}=Y(),r=_t(),l=Va().loading;return h(()=>{const d=r.value,c=a.value.eligible,u=l.value,p=u.has("discountLines"),m=u.has("shopCashBalance"),v=s.value;if(v!==void 0){const S=d.SHOP_PROMOTION,P=S.length>0;if(no(i.value,P,p,u.has("shopPromotion")))return!0;if(v?.length){if(c?!Er(S,v):P||m)return!0}else if(P)return!0}const C=o.value,f=d.SHOP_DISCOUNT_OFFER?.destinationAmount;if(no(C,f!=null,p,u.has("shopDiscountOffer")))return!0;const g=Yi(C)?.redeemableAmount;return f==null?g!=null&&(c||m):!c||g==null||!yt(f,g)})}function Qv(e,n=!0,a){const{setShopOfferReconciliationPending:s}=y().shopPay,o=Zv(e,a);On(()=>{if(!n)return;const i=o.subscribe(s);return()=>{i(),s(!1)}},[n,o,s])}const eg=()=>{const{embed:e,checkout:{identity:n}}=y(),a=n.current.value==="shopPay"&&pt(e?.embedder),s=zn(),o=Un().value;Rr({enabled:a,discountOffer:a?s.value:null,shopPromotionDiscounts:void 0,eligibility:o}),er([{eligibility:o,redemptionTypes:["SHOP_DISCOUNT_OFFER"]}],{enabled:a}),Qi({enabled:a,redemptionTypes:["SHOP_DISCOUNT_OFFER"]})},tg=()=>{const{checkout:e,embed:n,source:a}=y(),s=Pe(),o=e.identity.current.value==="shopPay"&&!pt(n?.embedder)&&e.configuration.visibility.showCashRedemption.value&&!(s.value.payment&<(a)),i=zn(),r=Zi(),l=Un().value;Rr({enabled:o,discountOffer:o?i.value:null,shopPromotionDiscounts:o?r.value:null,eligibility:l})},Rr=({discountOffer:e,eligibility:n,shopPromotionDiscounts:a,enabled:s=!0})=>{const{isShopCashNegotiationReady:o,negotiateShopCash:i}=Gn({enabled:s}),{recordRedemptionAutomaticallyApplied:r,recordRedemptionAutomaticallyRemoved:l}=as(),d=q(),c=_t();Qv(n,s,a);const u=ie(()=>{const v=c.value.SHOP_DISCOUNT_OFFER?.destinationAmount;if(!e)return v?{SHOP_DISCOUNT_OFFER:null}:void 0;if(!yt(v,e.redeemableAmount)&&!(!n.eligible&&e.redeemableAmount))return{SHOP_DISCOUNT_OFFER:e.redeemableAmount?{type:"SHOP_DISCOUNT_OFFER",amount:e.redeemableAmount,promotionId:null}:null}},[e,c.value.SHOP_DISCOUNT_OFFER?.destinationAmount,n.eligible]),p=ie(()=>{if(a===void 0)return;const v=c.value.SHOP_PROMOTION;if(!a||a.length===0)return v.length>0?{SHOP_PROMOTION:null}:void 0;if(!Er(v,a)&&n.eligible)return{SHOP_PROMOTION:a.map(C=>({type:"SHOP_PROMOTION",amount:C.availableBalance,promotionId:C.promotionId}))}},[a,c.value.SHOP_PROMOTION,n.eligible]),m=ie(()=>{if(!(!u&&!p))return{...u,...p}},[u,p]);L(()=>
2{if(!s||!m){d.current=void 0;return}!o||d.current===m||i(m,{onNegotiateAccepted:()=>{d.current=m,Object.entries(m).forEach(([v,C])=>{(C?r:l)(v,"useApplyAutomaticRedemptions")})}})},[s,o,m])};function ng({active:e,ready:n}){const{i18n:a}=y(),s=e.value&&!n.value?a.translate("general.loading"):null;return t(K,{accessibilityRole:"status",accessibilityVisibility:"exclusive",children:s})}function ag(){return t(K,{"aria-busy":!0,padding:"large-200 none",children:t(b,{gap:"base",children:[t(re,{inlineSize:"large"}),t(re,{inlineSize:"base"}),t(Ma,{contentDisplay:"block",blockSize:"48px"})]})})}const Ir=Qt({displayName:"BelowTheFoldContent",renderLoading:ag,load:()=>en(()=>Zt(()=>import("./page-BelowTheFoldContent.gk6Gs1sc.js"),__vite__mapDeps([110,1,2,3,4,5,6,7,8,9,10,111,112,90,52,113,114,39,28,40,41,21,22,23,24,42,43,44,16,17,45,12,46,47,48,49,35,36,50,51,11,13,14,15,18,19,20,25,26,27,29,30,31,32,33,34,37,53,61,115,71,116,73,74,62,117,118,119,120,84,85,86,66,67,68,70,69,59,60,63,87,88,121,122,123,65,89,124,56,57,58,64,72,75,76,77,78,79,91,92,93,81,82,83,94,95,96,97,80,98,99,100,101,102,103,104,105,125]))),renderError(e){throw e}}),sg="ifz7X",og="xoG3V",kr={OnePageFormContents:sg,OnePageFlexibleSpacer:og};function ig({children:e,fillAvailableBlockSize:n,ready:a}){const{checkout:s}=y(),{progress:o}=ut(),i=Fi(),r=w(()=>{o("one-page-form-submit",void 0,{skipToCompletion:i.value})},[o,i]),l=Iu(r);return t(oc,{disabled:!a.value,onSubmit:l,contentsClassName:n?kr.OnePageFormContents:void 0,children:e},s.identity.current.value)}function rg({loading:e,lineItems:n,onClose:a}){const{i18n:s,url:o,checkout:{configuration:{allowRedirectToStorefront:i}}}=y(),{checkoutProtocolModalEventSignal:r}=et(),l=t(Dn,{variant:"primary",onClick:a,children:s.translate("stock.continue_cta_label")}),d=i&&t(we,{href:o.cart(),children:s.translate("stock.return_to_store_label")});return L(()=>()=>{r.value="none"},[r]),t(ic,{heading:s.translate("stock.price_update.title"),open:!0,onShow:()=>{r.value="priceChange"},onHide:a,size:"large",children:t(b,{gap:"large-200",children:[t(he,{children:s.translate("stock.price_update.description")}),t(K,{children:t(mh,{loading:e,lineItems:n,type:wo.PriceChange})}),t(b,{direction:"inline",gap:"large-300",alignItems:"center",justifyContent:"end",children:[d,l]})]})})}function Mr(e){return e.some(n=>n.code==="MERCHANDISE_EXPECTED_PRICE_MISMATCH")}function lg(){const e=Y(),n=$e("merchandiseLines"),a=ne().merchandiseLines,s=ue(gt(()=>a.value));return h(()=>{const o=e.allViolations.value,i=Mr(o??[]),r=e.merchandiseLines.value,l=n.value,d=r?.lines??[],c=s.value,u=rc(c,d,o,lc).map(({proposed:m,negotiated:v})=>({line:m??v,problem:{type:wo.PriceChange,negotiatedPrice:v?.itemPrice,proposedPrice:m?.itemPrice}}));return{hasViolation:i,loading:l,lineItems:u,updateProposal:()=>{u.length>0&&(s.value=d)}}})}function cg(){const{checkout:{wallets:e}}=y(),n=Y(),a=lg(),s=wa(),o=q(!1),i=h(()=>n.allViolations.value?.some(c=>Td.has(c.code))),r=h(()=>!i.value&&a.value.hasViolation&&a.value.lineItems.length>0),l=h(()=>{const c=a.value;return r.value?o.current=!0:o.current&&!c.loading&&c.lineItems.length===0&&(o.current=!1),!e.activeSession.value&&o.current&&c.lineItems.length>0?c:void 0});Me(()=>{r.value&&s("inventoryPriceChange",{element:{tagName:"modal"},timestamp:new Date,visible:!0})});const d=w(()=>{o.current=!1,a.value.updateProposal()},[a]);return t(D,{when:l,children:c=>t(rg,{loading:c.loading,lineItems:c.lineItems,onClose:d})})}const dg="LaXGo",ug={ReferralTitle:dg};function pg(){const{i18n:e,shop:n}=y(),a=cc(n.storefrontUrl)?.replace(/-/g,"â");return a?t("strong",{"data-testid":"referral-title",className:ug.ReferralTitle,children:e.translate("merchant_redirect.referral_title",{merchant_url:a})}):null}function hg(){const{checkout:e,embed:n,shopPay:a}=y(),s=hh(),o=Fi(),i=Pe(),r=a.config.isReferral==="webview-rendered",l=n?.isFlagshipPartner??!1,c=h(()=>i.value.contact&&e.configuration.showContactInformation||i.value.delivery||i.value.payment).value,u=s.value,p=u||o.value||r;return c&&p?t(G,{children:[u?t(ah,{}):null,o.value?t(sh,{isVaultedReview:!0}):null,r?t(pg,{}):null,p&&!l?t(je,{blockSize:"base"}):null]}):null}function mg(){const{embed:e,shop:n}=y();return a=>e?.isFlagshipPartner&&!pt(e.embedder)&&!on({embedder:e.embedder,shop:n})?t(dc,{children:a}):a}function yg({showEmailMarketingOptIn:e,showPhoneMarketingOptIn:n,aboveFoldSpacing:a,paddingBlockStart:s,children:o}){const i=ja(),r=h(()=>n?.value??i.value.isRoot),l=h(()=>e.value||r.value),d=h(()=>e.value&&r.value),c=h(()=>d.value?a?"small-200":"base":"none"),u=h(()=>a?"large-200 none large-200 none":`${s?.value??"none"} none base none`);return t(D,{when:l,fallback:o,children:()=>t(Ot,{target:"cart.buyerIdentity",children:t(b,{gap:a?"small-200":"base",padding:u.value,children:[t(b,{gap:c.value,children:[t(D,{when:e,children:t(yu,{origin:"payment_page"})}),t(D,{when:r,children:t(vi,{})})]}),o]})})})}function ao({extensions:e,hideDivider:n="always"}){const a=mg();return t(ke,{gap:"base",customizations:Xt(e),render:(s,o)=>o?a(t(Fn,{hideDivider:n,children:s})):s})}function Or(e){const{i18n:n}=y(),a=w(o=>o.reduce((i,r,l)=>l===o.length-1?n.translate("shipping.shipping_method_combinations.combination",{rest:i,current:r}):n.translate("shipping.shipping_method_combinations.with_separator",{rest:i,current:r}),""),[n]);return ie(()=>{if(!Ua(e))return[];const o=ni(e),i={businessDays:r=>n.translate("shipping.estimated_delivery_date",{count:r}),businessDaysRange:(r,l)=>n.translate("shipping.estimated_delivery_date_range",{minimum:r,maximum:l}),subscriptionsOnlyShippingTitle:n.translate("shipping.subscription_shipping"),combineTwoShippingTitles:(r,l)=>n.translate("shipping.shipping_method_combinations.combination",{rest:r,current:l}),combineMultipleShippingTitles:a,localDeliveryTitle:n.translate("shipping.local_delivery")};return vg(i,o)},[a,e,n])}function vg(e,n){const a=(n||[]).filter(wd).map(ih);return rh(a).filter(o=>o.length>0).map(o=>gg(o,e))}function gg(e,n){return{...Nd(e)??e[0],title:Fd(e,n),cost:Bd(e),costAfterDiscounts:Vd(e)}}function Lr(){const{shopPay:e}=y(),{value:n}=Y().deliveryNext,a=$e("deliveryNext").value,s=ri(n,"ONE_TIME_PURCHASE",!0),o=ie(()=>s&&s.status==="available"?s.methods:[],[s]),i=Or(n),r=Ua(n)?i:o,l=ie(()=>r.reduce((v,C)=>{const f=C.methodType==="LOCAL"?"SHIPPING":C.methodType;return f==="PICK_UP"||f==="SHIPPING"?{...v,[f]:[...v[f],C]}:v},{SHIPPING:[],PICK_UP:[]}),[r]),[d,c]=ft(!0),u=e.session.selectedShippingAddress.value;L(()=>{c(!0)},[u]),L(()=>{a||c(!1)},[a]);const[,p]=ft(),m=Ti(p);return{methodsByType:l,availableDeliveryMethods:r,availableDeliveryMethodsLoading:d,progressiveShippingRatesLoading:m}}function Dr({onChange:e,prerequisitesLoading:n}){const{value:a}=Y().deliveryNext,s=$e("deliveryNext").value,o=ri(a,"ONE_TIME_PURCHASE",!0),i=Or(a),[r]=uc({type:o?.type}),l=ie(()=>{if(!(n||s||!r||o==null||o.status!=="available"))return Ua(a)?i.find(c=>c.handle===r):o.methods.find(c=>c.handle===r)},[n,s,r,o,a,i]),d=q(l);return L(()=>{l&&d.current&&d.current.handle!==l.handle&&e(l,d.current),d.current=l},[l,e]),{selectedDeliveryMethod:l}}function fg(){const{i18n:e}=y(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:a}=Lr(),s=n&&!a,{selectedDeliveryMethod:o}=Dr({onChange:()=>{},prerequisitesLoading:n||s}),i=o?e.translate("order_summary.updated_shipping_method",{shipping_method:o.title}):void 0,r=q(i);return L(()=>{const l=r.current;if(r.current=i,!(!i||i===l))return po({content:i})},[i]),null}function Cg(){return pc("ONE_TIME_PURCHASE")?t(fg,{}):null}function _g(){const{negotiate:e}=ut(),n=Y(),a=n.buyerIdentity,s=ne(),o=s.shippingAddress.value,i=s.billingAddress.value,{observability:r,checkout:l}=y(),{value:d=[]}=n.allViolations,c=xd(d),u=Mr(d),p=l.isShippingRequired.value?o.countryCode:i.countryCode,m=a?.value?.countryCode,v=JSON.stringify(a?.value,(C,f)=>f===void 0?null:f);L(()=>{c||u||m&&p!==m&&(r.log("country_code_alignment_mismatch_detected","[EnsureBackAndFrontEndCountryCodeAlignment] There was a mismatch between the preselected and the buyerIdentity countryCode on checkout load.",{selectedCountryCode:p,buyerIdentityCountryCode:m,buyerIdentity:v}),e({silenceViolations:["all"]}))},[])}function Sg(){const{checkout:e,shop:n,source:a}=y(),{email:s}=ne(),o=Pe(),{buyerIdentity:i}=Y(),r=n.hasFlagEnabled(Hd);return h(()=>
2{if(e.identity.current.value==="businessCustomer")return!1;const l=i.value;if(l?.customerProfile?.acceptsEmailMarketing)return!1;const c=e.configuration.visibility.showEmailMarketing&&n.emailMarketing!=="OFF"&&o.value.contact;if(e.identity.current.value==="sdkCartHints")return!!(c&&s.value);const u=r&&!zd(l?.countryCode);return!!(c&&a.type!=="shopPayExternal"&&!u&&!lt(a))})}function bg(){const e=Pe(),n=$(se("Checkout::Dynamic::Render","INFORMATION1")),a=$(se("Checkout::Dynamic::Render","INFORMATION2")),s=$(se("Checkout::Dynamic::Render","DELIVERY1")),o=$(se("Checkout::Dynamic::Render","DELIVERY2")),i=$(se("Checkout::Dynamic::Render","PAYMENT1")),r=$(se("Checkout::Dynamic::Render","PAYMENT2")),l=$(se("Checkout::Dynamic::Render","PAYMENT3")),d=q();return h(()=>{const c=e.value,u=[];c.contact&&u.push(...n.value,...a.value),c.delivery&&u.push(...s.value,...o.value),c.payment&&u.push(...i.value,...r.value,...l.value);const p=d.current;return p&&Pg(p,u)?p:(d.current=u,u)})}function Pg(e,n){return e.length===n.length&&e.every((a,s)=>{const o=n[s];return o!==void 0&&qt(a)===qt(o)})}const Ag=[ku.Button,Mu.Button,Ou.StickyFooter,Lu.Wrapper];function Eg(){const{shopPay:e,checkout:n}=y(),[a]=hc("ONE_TIME_PURCHASE");if(e.user.flow.value!=="unauthenticated_user")return null;const s=a[0],o=s==="PICKUP_POINT"||s==="PICK_UP";return!n.isShippingRequired.value||o?t(vr,{}):null}const Rg="nnGzs",Ig={HeaderWrapper:Rg},so="contact";function kg({loginLink:e,title:n}){const{router:a}=y(),s=h(()=>Hn(a,so));return t("div",{className:Ig.HeaderWrapper,children:[t(Be,{id:so,level:1,autoFocus:s.value,children:n}),e]})}function Tr(){const{client:e,i18n:n,source:a}=y(),s=mc(),o=a.type==="simulated";return t(D,{when:s,children:t(we,{href:o?void 0:e.unstable_getSerialization("loginUrl")||"",children:n.translate("customer_account.sign_in_link_label")})})}Tr.displayName="LoginLink";const Mg=()=>{const{i18n:e,userEvents:n,source:a,checkout:s,shop:o,shopPay:i}=y();return t(we,{onClick:()=>{n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...Ke(a,s,o),action:"click_shop_pay_sign_in"}}),i.session.unstable_updateVerificationTrigger({source:yc.LoginLink})},children:e.translate("account_management.sign_in_shop")})};function Og(){const{i18n:e,checkout:{identity:n,validation:{contactErrors:{emailInputError:a}}},shopPay:s}=y(),o=n.current.value==="shopPay",i=e.translate("field_errors.email_invalid"),r=s.userVerification.value;L(()=>{o&&r.status==="invalid"&&(a.value=i)},[o,a,i,r.status]);const l=w(d=>{if(o&&r.email===d&&r.status==="invalid")return i},[o,i,r.email,r.status]);return t(G,{children:[o&&t(G,{children:[t(ki,{color:"branded"}),t(je,{blockSize:"base"})]}),t(kg,{title:e.translate("contact.contact_method_title"),loginLink:t(Lg,{})}),t(je,{blockSize:"base"}),t(li,{hideAllOptIns:o,onValidateEmailInput:l}),o&&t(Eg,{})]})}function Lg(){const{checkout:{identity:e}}=y(),n=yh();return e.current.value!=="shopPay"?t(Tr,{}):n===Ud.UnauthenticatedCheckout?t(Mg,{}):null}const Dg=tn(function({showForm:n=!0}){const a=se("Checkout::Contact::RenderAfter"),s=se("Checkout::Dynamic::Render","INFORMATION1"),o=se("Checkout::Dynamic::Render","INFORMATION2");return t(G,{children:[s.length?t(G,{children:t(ke,{customizations:s,gap:"base",marginBlockEnd:"large300"})}):null,n?t(Xa,{impressionType:"contact",impressionFeatures:[],children:[t(Og,{}),a.length?t(G,{children:t(ke,{customizations:a,marginBlockStart:"base"})}):null,o.length?t(G,{children:t(ke,{customizations:o,gap:"large-200",marginBlockStart:"large300"})}):null]}):t(G,{children:[a.length?t(G,{children:t(ke,{customizations:a,marginBlockStart:"base"})}):null,o.length?t(G,{children:t(ke,{customizations:o,gap:"large-200",marginBlockStart:"large300"})}):null]})]})});function Tg(){const{checkout:{identity:e},i18n:n}=y(),{hasViolations:a}=We(rn),{hasViolations:s}=We(Xo),{hasViolations:o}=pe(Gd);if(a&&wg({identity:e}))return t(pr,{});if(o)return t(Ot,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(dt,{message:n.translate("field_errors.shipping_method_invalid_phone_number")})});const i=s?n.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions"):n.translate("shipping_errors.shipping_method_not_available_generic.one");return t(Ot,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(Lt,{tone:"critical",heading:n.translate("shipping_errors.title"),errorType:Fe.DeliveryError,children:i})})}const wg=({identity:e})=>e.current.value==="shopPay",Ng=[{handle:"first"},{handle:"second"}];function Vg(){const{i18n:e}=y(),{shippableDeliveryLines:n}=vc().value,a=n?.[0]?.methods||Ng;return t(Ri,{name:"shippingMethods",variant:"block",hideRadioControl:a.length===1,children:a.map(({handle:s,description:o,estimatedTimeInTransit:i,deliveryPredictionEligible:r})=>{const l=!!r,d=o;return t(Jt,{value:s,disabled:!0,accessibilityLabel:e.translate("general.loading"),secondaryContent:t(Ma,{inlineSize:"5ch"}),children:t(b,{gap:"small-500",children:[t(re,{inlineSize:"small"}),l||i!=null?t(re,{inlineSize:"base",size:"small",id:"pending-shipping-estimated-time"}):null,d?t(gc,{content:o,size:"small"}):null]})},s)})})}function Bg(){const e=y();return t(kp,{children:t(Ip,{children:Fg(e)})})}function Fg({checkout:e,i18n:n}){return e.identity.current.value==="shopPay"?n.translate("shipping_errors.invalid_shipping_method_summary"):n.translate("shipping_errors.empty_state")}const wr=tn(function(){const{uiStateSignal:n,initialUiStateSignal:a}
2=Ha(La),s=qe(),o=s.value?n.value:a.value,i=rs(),{hasViolations:r}=Lo(ai),l=i.value&&r,{hasViolations:d}=We(zg),c=s.value&&d&&!l&&o.status!=="error",u=c?t(Ug,{}):null,p=(()=>{switch(o.status){case"initial":case"empty":return t(Bg,{});case"loading":return t(Vg,{});case"error":return t(Tg,{});case"filled":{const m=Wd(o.deliveryLines).filter(Ta),v=m.flatMap(({methods:C})=>C.map(({title:f})=>f));return t(Xa,{impressionType:"shipping_methods",impressionFeatures:v,children:t(xg,{lines:m,showErrorBanner:l,deliveryChangedBannerOwnedBySection:c})})}}})();return t(b,{gap:"base",children:[u,p]})});wr.displayName="OnePageShippingMethods";function xg({lines:e,showErrorBanner:n,deliveryChangedBannerOwnedBySection:a}){const s=wa(),o=No(),[,i]=ft(),r=Ti(i),l=Hg(y());return L(()=>{s("shippingMethodsFilled",{timestamp:new Date}),o({type:"shipping_methods_filled"})},[o,s]),t(G,{children:[t(l,{}),t(b,{gap:"large-200",children:t(ch,{lines:e,loading:r,showErrorBanner:n,deliveryChangedBannerOwnedBySection:a})})]})}function Hg({checkout:e}){return e.identity.current.value==="shopPay"?Gg:G}const zg=new Set(["DELIVERY_DELIVERY_LINE_DETAIL_CHANGED"]);function Ug(){const{i18n:e}=y();return t(Lt,{tone:"warning",errorType:Fe.DeliveryError,children:e.translate("shipping_errors.shipping_method")})}function Gg(){const{trackSelectShippingMethod:e}=br(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:a}=Lr();return Dr({onChange:e,prerequisitesLoading:n||n&&!a}),null}function Wg(){const{checkout:e,i18n:n}=y(),a=e.addressManager.shipping.value,s=np("shipping"),{shouldGateCrossBorder:o,crossBorderGate:i}=Oi(),r=a.addresses.value.find(({id:d})=>d!==a.selectedAddress.value?.id),l=w(()=>{if(!r)return;const d=()=>s.selectAddress(r.id,{source:"select-saved-address-link"}),c=r.address.countryCode;c&&o(c)?i(d):d()},[s,r,o,i]);return r?t(ct,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",justifyContent:"start",justifyItems:"start",children:t(we,{id:"save_shipping_information",textDecoration:"none",onClick:l,children:n.translate("customer_account.saved_address_option_link")})}):null}function Yg(){Pr();const n=Ct()?.options.value.some(s=>s.id==="PICKUP_POINT")??!1,a=Nn();return t(b,{gap:"large-300",children:[n&&t(Ya.Prefetch,{}),t(yi,{}),t(Wa,{name:"delivery-methods",children:t(jg,{})}),t(D,{when:a,children:t(mi,{})})]})}function jg(){const{methods:e}=Do(),{i18n:n,router:a,checkout:{wallets:s,identity:o}}=y(),i=fc(),{deliveryNext:r,optionalDuties:l}=Y(),d=uh(),c=Ao(),{shippingAddress:u}=ne();Cc(u,()=>{c&&c.taxId.reset()});const p=se("Checkout::DeliveryAddress::RenderBefore"),m=se("purchase.checkout.delivery-address.render-after"),v=wi(),{hasMultipleDeliveryGroups:C,onlyDeliveryGroupType:f}=v.value,{customizationsBefore:g,customizationsAfter:S}=Ni({hasMultipleDeliveryGroups:C,targeted:!1}).value,P=h(()=>ti(r.value,!0)||d.value.showShipmentBreakdown).value,_=P?"small-400":"base",I=wa(),M=No(),{negotiate:E}=ut(),A=w(({shipping:Q})=>{s.activeSession.value||E({include:[],fieldsToResolve:["deliveryNext"],silenceViolations:["non-delivery-address"],runListenersOnError:!0}),Q.value=!0,I("sectionComplete",{section:"deliveryAddress",timestamp:new Date}),M({type:"section_complete",section:"deliveryAddress"})},[s,E,I,M]),F=w(({shipping:Q})=>{Q.value=!1},[]),T=Q=>t(na,{padding:P?"small-400 none":void 0,children:Q}),N=ie(()=>({groupType:f&&_c(f),includeDeliverySelectionGroups:!1}),[f]),V=ja(),B=h(()=>V.value.isDelivery),R=Qe(),H=Nn(),X=h(()=>R.value?e.value.includes("PICK_UP")&&e.value.includes("SHIPPING"):!1),Z="shippingMethod",O=h(()=>Hn(a,Z)),x=hi(),j=t(An,{sectionId:"localPickup",children:t(b,{gap:"small",children:[t(D,{when:X,children:t(Be,{level:2,children:n.translate("delivery_options.pickup")})}),x?t(vu,{}):t(gu,{})]})}),W=t(An,{sectionId:"shipping",children:[t(na,{children:t(b,{gap:"base",children:[t(D,{when:X,children:t(Be,{level:2,children:n.translate("delivery_options.ship_to_address")})}),t(D,{when:i,children:t(he,{color:"subdued",children:n.translate("shipping.shipping_used_as_billing_notice")})}),t(D,{when:X,children:t(D,{when:H,children:t(K,{border:"base",padding:"base",borderRadius:"large",children:t(fu,{selectedDeliveryMethodType:"SHIPPING"})})})}),t(ke,{customizations:p}),t(b,{gap:"large-300",children:[t(lh,{children:t(lp,{onValid:A,onInvalid:F,children:t(gr,{children:[Kg({identity:o})&&t(Wg,{}),t(Cu,{}),t(D,{when:B,children:t(vi,{})}),c&&t(_u,{taxId:c.taxId,applied:c.applied})]})})}),t(ke,{customizations:m}
2),t(b,{gap:_,children:[t(Be,{id:Z,level:2,autoFocus:O.value,children:n.translate("shipping.shipping_method_title")}),t(Sc,{children:[t(D,{when:()=>d.value.showShipmentBreakdown,children:t(Ns,{children:[t(gh,{}),t(je,{blockSize:"small-200"})]})}),Hp("shipping.shipping_method_notice",n)?t(he,{children:n.translate("shipping.shipping_method_notice")}):null,t(ke,{customizations:g,options:N,render:T}),t(Ns,{children:[t(wr,{}),t(vh.Preload,{})]}),t(ke,{customizations:S,options:N,render:T})]})]})]})]})}),t(D,{when:()=>l.value?.refuseDutiesPermitted,children:t(na,{accessibilityLabel:n.translate("shipping.duties_and_taxes_title"),children:t(b,{gap:"base",children:[t(Be,{level:2,children:n.translate("shipping.duties_and_taxes_title")}),t(Di,{})]})})})]}),z=h(()=>e.value.includes("PICKUP_POINT")),oe=h(()=>e.value.includes("PICK_UP"));return t(D,{when:X,fallback:t(D,{when:()=>z.value||oe.value,fallback:W,children:t(D,{when:z,fallback:j,children:t(An,{sectionId:"pickupPoints",children:t(Ya,{})})})}),children:t(b,{gap:"large-300",children:[j,W]})})}function Kg({identity:e}){return e.current.value==="customerAccount"}const qg=tn(function(){const{shop:n,i18n:a}=y(),s=se("Checkout::Dynamic::Render","DELIVERY1"),o=Ct(),i=Pe(),l=!n.hasFlagEnabled(oi),d=$(!!(l&&o)),c=h(()=>i.value.contact&&d.value),u=h(()=>c.value?void 0:"deliveryAddress"),p=h(()=>c.value?a.translate("shipping.delivery_title"):void 0);return t(Fn,{accessibilityLabelledBy:u.value,accessibilityLabel:p.value,accessibilityRole:"group",children:t(b,{gap:"base",children:[t(D,{when:()=>!c.value,children:t(b,{gap:"small-400",children:t(Cr,{})})}),t(Ga,{}),t(Yg,{}),t(ke,{customizations:s})]})})}),Nr=Qt({displayName:"MobileOrderSummaryBeforeDetails",load:()=>en(()=>Zt(async()=>{const{MobileOrderSummary:e}=await import("./component-MobileOrderSummary.CPrwILeP.js");return{MobileOrderSummary:e}},__vite__mapDeps([116,1,3,4,5,6,2,7,8,9,10,73,74,62,117,118,119])).then(({MobileOrderSummary:e})=>({default:e}))),renderError(e){throw e}}),oo=typeof window>"u"?void 0:performance.now();typeof window<"u"&&Ir.preload();const $g=Ag,Xg=tn(function(){return eg(),tg(),null}),Jg=tn(function({children:n}){const{checkout:a,embed:s,environment:o,i18n:i,observability:r,shop:l,source:d}=y(),c=a.configuration.headerText?.visibility==="VISIBLE",u=ue(!1),p=w(()=>{u.value||(u.value=!0,oo!==void 0&&r.histogram({name:"one_page_below_fold_content_ready",value:Math.round(performance.now()-oo),unit:"ms",attributes:{buildId:o.commitSha}}))},[o.commitSha,u,r]),m=qe(),v=l.hasFlagEnabled(Yd),C=on({embedder:s?.embedder,shop:l}),f=s?.embedder==="google"&&C,g=Pe(),S=Du(),P=h(()=>g.value.payment&&S.value),_=$(Ct()),I=bc(),M=h(()=>g.value.payment&&l.acceptTipPayments&&(I?.tippingPaymentAllowed??!0)&&a.configuration.visibility.showTips),E=$(Ro()[0]),{postPurchaseEnabled:A}=ph(),F=Y(),T=h(()=>F.buyerIdentity.value?.customerProfile),N=Pc(),V=h(()=>f&&N.value),B=Qe(),R=h(()=>g.value.contact&&a.configuration.showContactInformation||g.value.delivery&&a.isShippingRequired.value||g.value.payment),H=h(()=>B.value&&R.value);_g();const X=$(Ac({base:!0,medium:!1})),Z=h(()=>m.value?X.value??!1:!0),O=Su(),x=h(()=>O.value!=="hidden"),j=$(se("Checkout::Contact::RenderAfter")),W=Sg(),{main:{section:z}}=ka(),{lineItems:{priority:oe="base"}}=Vt(),ee=$(jd(z)),Q=To(),le=h(()=>a.identity.current.value==="shopPay"||g.value.payment||!ee.value?"belowPayment":"abovePayment"),ye=h(()=>W.value&&le.value==="belowPayment"),de=h(()=>W.value&&le.value==="abovePayment"),te=h(()=>Q.value&&g.value.payment&&ye.value&&Z.value),Ce=h(()=>a.configuration.visibility.showEmailMarketing&&!lt(d)&&de.value&&!T.value?.acceptsEmailMarketing),Ae=ja(),fe=h(()=>Ae.value.isRoot?le.value==="belowPayment"&&(!Z.value||!ee.value)?"belowPayment":"abovePayment":"none"),ve=h(()=>a.identity.current.value==="guest"&&g.value.delivery||a.identity.current.value==="businessCustomer"&&!g.value.delivery&&g.value.payment),Ee=h(()=>a.identity.current.value==="guest"?ve.value&&!(g.value.contact&&g.value.payment):ve.value),Se=h(()=>!Ee.value&&a.isShippingRequired.value),Re=h(()=>a.configuration.showContactInformation&&ii({isContactVaulted:g.value.contact,identity:a.identity.current.value,isPartnerEmbed:s?.isFlagshipPartner??!1,embedder:s?.embedder,isInterstitialBrandingEnabled:C,customerContactMethodPrefilled:a.identity.customerContactMethodPrefilled})),J=un(),_e=h(()=>!!(!lt(d)&&g.value.delivery&&_.value!=null&&!J.value)),U=h(()=>g.value.delivery&&E.value.includes("PICK_UP")&&!J.value),ae=h(()=>!!(Re.value||U.value||(Se.value||Ee.value)&&_e.value)),Ne=h(()=>!!(Se.value&&_e.value&&!Re.value)),be=pt(s?.embedder),De=a.configuration.orderSummary?.placement==="beforeDetails",me=h(()=>be&&!De&&!Ne.value),nt=h(()=>be&&ae.value),xe=h(()=>be?De:ee.value),He=h(()=>a.identity.current.value==="guest"&&g.value.delivery&&!g.value.contact),ze=h(()=>ee.value&&(Ce.value||fe.value==="abovePayment")),Ie=bg(),Xe=h(()=>m.value&&g.value.contact&&j.value.length>0),St=h(()=>m.value&&!N.value&&Ie.value.length>0),at=Ec(),xt=h(()=>m.value&&at.value&&De),st=h(()=>at.value&&!De),bt=!!s?.isFlagshipPartner&&oe==="high";Rc();const Ue=h(()=>Ce.value||te.value),Ge=h(()=>fe.value==="abovePayment"),Ve=h(()=>!ee.value&&!H.value),Ht=h(()=>!(H.value&&g.value.contact)&&(Q.value||ee.value&&!g.value.contact)),Je=h(()=>
2g.value.payment&&!te.value&&!st.value),pn=h(()=>R.value&&!He.value),Pt=h(()=>v&&pn.value),hn=h(()=>!v&&pn.value),zt=h(()=>!He.value),mn=h(()=>!be&&Pt.value&&Ve.value&&!ve.value&&g.value.payment&&(!a.isShippingRequired.value||g.value.delivery)),Wn=h(()=>be?De:Q.value||mn.value),Ut=h(()=>mn.value&&!Z.value&&(ye.value||fe.value==="belowPayment")&&!P.value&&!Xe.value&&!St.value&&!V.value),Yn=h(()=>Ut.value||P.value||ze.value||te.value||Q.value&&!ee.value&&Z.value||Je.value&&(Z.value||De)),Gt=h(()=>P.value||Je.value||!g.value.payment&&g.value.delivery&&!Z.value&&!Xe.value||g.value.payment&&te.value);return t(Rh,{children:[t(Xg,{}),t(b,{blockSize:V.value?"100%":void 0,gap:"@media (inline-size >= extraSmall) large-200, none",children:[t(D,{when:me,children:t(Ss,{accessibilityRole:"presentation"})}),lt(d)?t(b,{gap:"base",padding:"@media (inline-size >= extraSmall) none, large-200 large-200 none large-200",children:t(Ic,{})}):null,t(aa,{section:"toast"}),!bt&&t(aa,{section:"top"}),t(ng,{active:m,ready:u}),t(ig,{fillAvailableBlockSize:V.value,ready:u,children:[c&&t(K,{padding:"none none large-100 none",children:t(fh,{})}),oe==="high"&&t(K,{display:"@media (inline-size >= medium) none, auto",children:t(la,{target:"lineItems",children:t(Fn,{hideDivider:x,children:t(kc,{})})})}),bt&&t(aa,{section:"top"}),t(D,{when:x,children:t(la,{target:"expressCheckout",children:t(bu,{})})}),t(D,{when:xt,children:[t(sa,{section:"summary",children:t(jt,{section:"summary",children:t(K,{padding:"none large-200 large-100 large-200",children:t(la,{target:"plain",children:t(Nr,{})})})})}),t(Ss,{accessibilityRole:"presentation"})]}),t(hg,{}),t(Ih,{}),t(ca,{target:"vaulted",condition:Pt,children:t($t,{hideDivider:Gt,condition:Ve,accessibilityLabel:i.translate("contact.contact_method_title"),children:t(ca,{target:"vaulted",condition:hn,children:[t(Jv,{showDelivery:Se}),t($t,{condition:Ht,hideDivider:Yn,accessibilityLabel:i.translate("contact.contact_method_title"),children:t(b,{children:[t(D,{when:()=>!g.value.contact,children:t(sa,{section:"contact",children:t(jt,{section:"contact",children:t(Dg,{showForm:a.configuration.showContactInformation})})})}),t(D,{when:()=>!ve.value,children:t(Qs,{hideLastDivider:Wn,showTopDivider:nt})})]})}),t(D,{when:H,children:t(op,{})})]})})}),t(D,{when:P,children:t(K,{paddingBlockStart:"small-300",paddingBlockEnd:"base",children:t(Tu,{})})}),t(D,{when:()=>ee.value||te.value,children:t(jt,{section:"contact",children:t(yg,{aboveFoldSpacing:!0,showEmailMarketingOptIn:Ue,showPhoneMarketingOptIn:Ge})})}),t(D,{when:Xe,children:t(jt,{section:"contact",children:t(ao,{extensions:j,hideDivider:"whenEmpty"})})}),t(D,{when:Ee,children:t(D,{when:a.isShippingRequired,children:t(ca,{target:"vaulted",condition:zt,children:[t(Ar,{}),t(ip,{condition:ve,accessibilityLabel:i.translate("shipping.delivery_title"),children:t(Qs,{hideLastDivider:xe,showTopDivider:nt})})]})})}),t(D,{when:St,children:t(ao,{extensions:Ie,hideDivider:"whenEmpty"})}),t(D,{when:()=>!g.value.delivery&&a.isShippingRequired.value,children:t(Ot,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(sa,{section:"delivery",children:t(jt,{section:"delivery",children:t(An,{sectionId:"delivery",children:t(qg,{})})})})})}),t(D,{when:M,children:t(ap.Prefetch,{})}),t(D,{when:V,children:t(K,{className:kr.OnePageFlexibleSpacer,"data-testid":"onepage-vaulted-spacing"})}),t(D,{when:m,children:t(Ir,{onReady:p,showMobileOrderSummary:st,showVaultedStateMarketingDisclosureBelowPayment:ye,phoneMarketingPlacement:fe,isSectionCustomized:ee,showVaultedStateMarketingDisclosureOnMobile:te,expressCheckoutSlot:O,showVaultedCardConsentSpacing:Ut})})]}),A&&t(sp,{})]}),t(cg,{}),t(D,{when:a.isShippingRequired,children:t(Cg,{})}),t(Pu,{id:"OnePage"}),n]})}),Qf=Object.freeze(Object.defineProperty({__proto__:null,MobileOrderSummaryBeforeDetails:Nr,default:Jg,onePageCriticalStyleClassNames:$g},Symbol.toStringTag,{value:"Module"}));export{Gh as L,Wh as M,gr as O,yg as P,jh as R,Sv as S,Im as U,ao as V,yv as a,mg as b,Dy as c,Ty as d,wr as e,gv as f,Hh as g,xh as h,Uy as i,Zf as j,Hn as k,fm as l,ji as m,bg as n,ny as o,Qf as p,vv 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.