PageSourceSearch

https://fanjoy.co/cdn/shopifycloud/checkout-web/assets/c1/OnePage.h2sKDhjN.js

js fanjoy.co collected 2026-10-01 10:28:28 UTC 177,410 bytes, 2 lines download raw bytes

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