PageSourceSearch

https://rasayanam.in/cdn/shopifycloud/checkout-web/assets/c1/f8706cb6.Bnci6QEq.js

js rasayanam.in collected 2026-10-02 06:29:48 UTC 175,367 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["26e63865.pCYl5ws-.js","2c1ab0fe.BqEHHmaW.js","164ad2e3.BA-GikTU.js","4c290a1e.FJVsH4yi.js","app.D2gvVyTR.js","assets/app.BuSMBobh.css","assets/previous.BpuyvRSB.css","65f3d4da.BdKZt11Z.js","60a453ce.BClq-svk.js","0a7dffce.BHf0S_6c.js","bb728e1c.uhKc-SJ5.js","assets/stopwatch.Kyhz8KoT.css","f3fe2775.BuWC6GWF.js","ac5a19ff.BHoedVx2.js","598fef4e.PfG1A8vt.js","assets/PaymentIcon.gzvCNwz_.css","e77f7fe0.B6M5o7QB.js","assets/PaymentLine.BGhbZYQP.css","a422df8c.ggO-AlYl.js","efa0389a.CmzfQUTJ.js","assets/Choice.B7lVAtpz.css","31cc568e.Dti0cJak.js","8599b02a.DjDpxYLZ.js","assets/index.CIy8uDiZ.css","assets/EmptyState.BEvzDDvy.css","cc6ff67d.CQwyXWHD.js","08a3b809.BqMk-s3U.js","e477f96c.CCUKKy0S.js","87bfafec.a5jzmgqb.js","e39bc11c.w_dcLWzY.js","bff2ff9b.BZBliUVS.js","cf29e63b.UPVrnMYo.js","assets/hasViolationsIgnoringCodes.BcTJoNaV.css","dfc03c53.CuQrwiah.js","86720dbb.B98R4NBr.js","dfca5da5.BUxySJFd.js","assets/Section.CU18S7Ap.css","55098bf1.CRzNngQq.js","0e67bd3b.IdsrMiz7.js","74835653.BtNhMTqJ.js","3ca8ef7e.D9Nch_50.js","assets/FormLayout.CrYq3At_.css","47b970b2.BwzlBSwQ.js","29034f35.CKhRr7lV.js","assets/PhoneField.uZEuHncj.css","064f6ac1.CtJPZ5b8.js","assets/Popover.Bi1nHaU-.css","53bbdad9.6B8LHIua.js","assets/BillingAddressForm.BdwN7V1K.css","7a8217fd.CAuGvD85.js","assets/useShopPayProgressIntercepts.xO_7ctnq.css","7114e006.D5JaP9sc.js","f692f62f.1VqP6fD-.js","assets/RedirectionNotice.B8v_QGNW.css","b684bff6.BBWgog5h.js","assets/MissingFields.BbxB_6wt.css","6720fa5f.CrCe0j_W.js","assets/Rollup.DKll7CHa.css","ccdf3592.B7Ukng27.js","58314944.CBBsxtpI.js","assets/PaymentMethodProgressionHost.BIxPaYCu.css","50130ded.BjO4oJHb.js","assets/KnownBuyerPaymentMethodSelector.BXqN6ZOx.css","c10167e6.DJgpnUit.js","b9c0319a.D5yZDWHr.js","dffdfb34.BGb6nQvv.js","0c0ad074.RgO7-3qK.js","5587f402.CiejVPa1.js","945a08d6.CbBX260S.js","assets/useShopPayButtonClassName.CpHF4L7Q.css","cb8fcd45.D99hrDC6.js","2fdb3dd3.CC5MqUe3.js","f1968089.DErP3-mp.js","cb5cf153.Cw_O6Mr1.js","e3e348f2.CzOvkbpO.js","ca5e9c49.COugV1Xp.js","ed9f2238.ChGZ5py3.js","0b8657b8.DAkNHzQn.js","79974aab.CiLYzGHS.js","7b0c98ea.B-oVlYQI.js","assets/TransitionHeight.CuRoM9zv.css","d22d2b80.CrBDr4H-.js","f49d4216.DkTq21k4.js","assets/VatNumberValidationField.CyiectWG.css","3a819064.Xmk2TvaB.js","assets/PaymentOptionSelector.s-Kd_X2E.css","91811554.C2rvMTji.js","64de7b49.DBBYkFfY.js","347b440c.DhRFIYzk.js","d5d34b3b.D_UYHSjm.js","assets/EstimatedDeliveryContent.B_THySFF.css","0e9ee714.CUvblzuU.js","39921a74.BrTHyyCQ.js","assets/Switch.BS8yVgoP.css","ec391382.K2o3oZbF.js","assets/StickyPayButton.CPXhWoNv.css","01973ac7.BJK4F5Uy.js","2b89a178.CeCOOCYG.js","910cd6e2.pc74Wwrs.js","181d38d3.Bx836TsC.js","assets/Middot.D7Ujmshx.css","d6447d9e.C1rIjiBE.js","f51e663e.BRJDCQ0a.js","8e79be58.BAhOGoFB.js","assets/ShippingMethodSelector.B0hio2RO.css","90e26f5f.RxBZE9Nq.js","assets/SubscriptionPriceBreakdown.vTcdVGq4.css","assets/ShippingLines.LcqrKXE1.css","f3e117aa.2wtgPU0T.js","a25deb9a.BtBRFgl8.js","assets/useShopPayNewSignupLoginExperiment.BYM12A8B.css","7a21cd4e.BAUMPiSr.js","assets/VaultedContactAvatar.BF3cX_zA.css","17a5f1e4.DBEYGsw0.js","0e4087ec.B3YfeV2W.js","7aefefff.CyKAthR-.js","a535174a.D8WAPvhF.js","5fd968f2.BIYX8FeS.js","assets/Captcha.CJQgLR0i.css","73a9b0a0.CiCbpTRv.js","e0989459.DUbIFUUJ.js","assets/RememberMeSection.JBO5WNhc.css","fc21c11a.BL45iHKA.js","4ea44c06.B-5F-oiB.js","f78726c8.D1GQbjRB.js","assets/useHasOrdersFromMultipleShops.B_iZlQze.css","assets/PaymentButtons.CKE1iCma.css","1ed8f5e3.CDOIq-vC.js","assets/floating-layer.DfWUBaTh.css","7ee73f43.DtdhcMpw.js","aea3fb03.BDHlih-c.js","assets/PayButtonSection.Bi0nhBOp.css","d2e6a587.CdnrCcyA.js","assets/MobileOrderSummary.DjDhVpQB.css","assets/BelowTheFoldContent.CmuzzmSI.css"])))=>i.map(i=>d[i]);
2import{_ as ln}from"./app.D2gvVyTR.js";import{u as t,g as h,k as O,S as U,X as rl,d as cn,x as Ft,h as M,T as re,y as ll,F as cl,r as dn,q as w,A as $,p as ke,f as St,m as q,e as he,l as _t,n as Nt,c as go,i as fo,_ as zn,a as dl,Q as un}from"./2c1ab0fe.BqEHHmaW.js";import{H as Fe,bD as Gn,fE as ul,fD as pl,as as hl,L as Qe,il as ml,bL as 
2La,d5 as Da,ad as pe,Y as Co,B as j,n as k,c as A,A as Ge,l as Wn,dZ as yl,im as vl,p as ne,bA as We,bI as gl,eF as Ta,bJ as De,a as So,d0 as xt,I as Ye,i0 as wa,g$ as Na,P as me,y as ct,S as fl,b8 as Cl,io as Sl,bH as _o,fQ as _l,bF as bl,bE as Pl,cY as Va,c6 as Al,b7 as El,cR as Vt,eU as Ba,b as xe,$ as bt,br as Rl,Z as Fa,dz as Ae,h as dt,av as ba,ip as bo,aC as Il,cp as pn,W as Qt,eL as Po,aD as kl,i as Ol,iq as Ml,eR as Ll,ac as xa,h_ as Dl,bB as Ha,cy as Tl,ir as wl,is as Nl,it as Vl,iu as Ao,fa as Bl,eb as Fl,cv as xl,hC as Hl,eK as Ul,iv as zl,ft as Gl,iw as Wl,bp as Yl,ix as jl,bl as ks,ci as Kl,eS as ql,e9 as Eo,c7 as $l,iy as Xl,iz as Jl,cS as Zl,d8 as Ro,db as Ua,eN as Ql,iA as ec,d3 as tc,d6 as nc,bw as ac,iB as Io,iC as ko,d9 as za,da as Oo,ck as et,hI as Mo,hJ as sc,U as Ie,eW as Pt,eO as kn,bm as oc,f6 as ic,aX as Lo,al as rc,az as Do,iD as lc,bh as To,iE as Ga,fF as cc,iF as wo,c3 as dc,eo as uc,eT as pc,f5 as hc,eX as No,iG as Vo,R as mc,aa as Bo,bv as yc,c9 as vc,iH as gc,bS as Wa,iI as fc,cl as Cc,iJ as Sc,cj as _c,e$ as bc,f$ as Pc,bO as Ac,b$ as Ec,bT as Fo,c$ as Rc,eY as Ic,dd as Nn,_ as ma,a6 as kc,f as Oc,fc as Mc,a1 as Lc,iK as Dc,a0 as Os,eM as Tc,fl as ya,iL as wc,N as On,O as Lt}from"./164ad2e3.BA-GikTU.js";import{O as v,cF as Nc,a6 as hn,_ as Ya,je as xo,ds as Vc,Q as ae,jM as Ho,bX as Bc,bN as Fc,bT as xc,a7 as ja,jN as Hc,P as G,h as Uc,i0 as Uo,aX as zo,h_ as zc,hY as Go,bp as mn,h$ as Gc,jB as Ct,bJ as Ka,ar as je,bM as Wo,jO as Wc,jP as Vn,gH as Yo,bY as qa,ba as Yc,bt as jc,aT as ut,hG as Kc,V as qc,dn as en,jQ as $c,b0 as lt,ae as Ke,w as Pa,h0 as Yn,aJ as jn,bx as pt,fD as Ms,ac as xn,bu as Ls,jR as Kn,iU as Xc,fU as $a,jS as va,jT as qn,gc as jo,jU as Jc,ga as Zc,gb as Qc,dC as ed,bb as qe,f0 as td,jV as nd,fx as ad,X as sd,cp as Hn,eM as Ko,M as od,f9 as id,jW as rd,fd as ld,ex as cd,a9 as yn,ek as tn,co as dd,iZ as Xa,ab as ud,d as Aa,bj as pd,cg as hd,eg as qo,jX as $o,N as md,fy as yd,jY as Xo,j1 as Ja,jZ as Jo,j_ as vd,j3 as gd,h1 as fd,aM as Za,hd as Zo,I as Cd,f1 as Sd,fG as _d,fE as bd,db as Pd,cG as Qa,cI as Qo,cJ as Ad,cH as Ed,j$ as ei,d7 as ti,fb as Mn,d5 as Ds,fZ as Ts,bz as ni,aE as ai,j2 as Rd,k0 as Id,dj as si,aq as kd,n as Od,dh as Md,d4 as oi,j7 as Ld,k1 as Dd,k2 as Td,k3 as wd,k4 as Nd,k5 as Vd,k6 as Bd,j9 as ii,da as Bn,k7 as Fd,j5 as ri,a8 as li,k8 as ci,k9 as xd,ka as es,aB as Hd,kb as Ud,kc as zd,kd as Gd,ke as Wd,fX as di,cS as Yd,iS as jd,iT as Kd,kf as qd,kg as $d,aA as Xd,iX as Jd}from"./4c290a1e.FJVsH4yi.js";import{w as Zd,x as nn,C as ui,y as pi,f as hi,U as mi,u as Qd,I as eu,i as ts,z as yi,B as tu,F as nu,G as au,H as su,J as vi,K as gi,k as fi,M as ou,S as iu,N as ru,O as lu,Q as cu,R as du,h as ns,T as uu,W as pu,X as hu,Y as mu,Z as yu,_ as vu,$ as gu,g as $n,j as Ci,a0 as fu,D as Si,c as as,a1 as Cu,d as _i,a2 as Su,l as _u,m as bu,n as Pu,e as Au,V as Eu,p as Ru,E as Iu,o as ku}from"./dffdfb34.BGb6nQvv.js";import{l as Ou,D as Mu,a as Lu,u as Du,s as Tu,c as wu,d as Nu,m as Vu,b as Bu,H as Fu}from"./0e9ee714.CUvblzuU.js";import{X as xu,U as Hu,N as Bt,W as Uu,b as vn,Y as Xn,Z as zu,c as Jn,d as Gu,G as Wu,S as bi,e as Pi,_ as ws,$ as Yu,a0 as ju,a1 as ga,a2 as fa,f as Ai,n as Ku,v as qu,x as $u,p as Xu,q as Ju,r as Ns,z as Zu,s as Qu,A as ep,V as tp,a3 as np,a4 as ap,h as sp,u as op,t as Ei,T as ip,i as rp}from"./f3fe2775.BuWC6GWF.js";import{a as an,c as sn,r as on,S as lp,M as cp}from"./dfca5da5.BUxySJFd.js";import{S as Fn,M as Ea}from"./79974aab.CiLYzGHS.js";import{R as de}from"./6720fa5f.CrCe0j_W.js";import{A as dp,C as Ri,u as up,S as pp}from"./0e67bd3b.IdsrMiz7.js";import{u as hp,g as Jt,e as mp,f as yp,h as vp}from"./bb728e1c.uhKc-SJ5.js";import{E as Ii,u as ki,a as gp,P as fp,b as Cp}from"./01973ac7.BJK4F5Uy.js";import{E as Sp,S as _p}from"./5587f402.CiejVPa1.js";import{u as Un,a as bp}from"./945a08d6.CbBX260S.js";import{c as Pp,a as Vs}from"./58314944.CBBsxtpI.js";import{P as Le}from"./598fef4e.PfG1A8vt.js";import{O as Ap,U as Bs,I as Ep,u as Rp}from"./7a8217fd.CAuGvD85.js";import{a as Ip,b as rn,C as kp}from"./efa0389a.CmzfQUTJ.js";import{a as Op,S as ss,u as Mp,b as Lp}from"./87bfafec.a5jzmgqb.js";import{P as Oi,C as Ra}from"./e77f7fe0.B6M5o7QB.js";import{B as Dp,A as Tp}from"./74835653.BtNhMTqJ.js";import{b as wp,a as Np,t as Vp,d as Bp,u as os,c as Fp}from"./2b89a178.CeCOOCYG.js";import{i as Fs,g as Mi,h as xp}from"./65f3d4da.BdKZt11Z.js";import{S as Hp}from"./39921a74.BrTHyyCQ.js";import{r as Li,b as Up,d as zp,e as Gp}from"./bff2ff9b.BZBliUVS.js";import{u as Di,a as Ti,M as Wp,b as Yp}from"./b684bff6.BBWgog5h.js";import{C as wi,b as jp,E as Kp}from"./a422df8c.ggO-AlYl.js";import{u as Ni,g as xs}from"./f1968089.DErP3-mp.js";import{C as qp}from"./cf29e63b.UPVrnMYo.js";import{W as gn,b as $p,C as Vi,S as Ia}from"./31cc568e.Dti0cJak.js";import{v as Hs,a as Xp,c as Us,S as Jp}from"./0c0ad074.RgO7-3qK.js";import{S as Bi}from"./cb5cf153.Cw_O6Mr1.js";import{u as is,A as Zp}from"./53bbdad9.6B8LHIua.js";import{v as zs}from"./8599b02a.DjDpxYLZ.js";import{P as Qp}from"./47b970b2.BwzlBSwQ.js";import{u as Fi}from"./29034f35.CKhRr7lV.js";import{I as rs}from"./55098bf1.CRzNngQq.js";import{a as xi}from"./ed9f2238.ChGZ5py3.js";import{V as eh,M as th,u as nh,a as ah,S as sh,R as oh,b as ih}from"./910cd6e2.pc74Wwrs.js";import{b as rh,a as lh,g as ch}from"./0a7dffce.BHf0S_6c.js";import{D as Hi,u as Ui,S as dh}from"./d6447d9e.C1rIjiBE.js";import{M as uh,c as zi,u as Gi,b as ph}from"./64de7b49.DBBYkFfY.js";import{u as Wi,S as Yi,E as ka}from"./347b440c.DhRFIYzk.js";import{b as ji}from"./2fdb3dd3.CC5MqUe3.js";import{u as hh}from"./d5d34b3b.D_UYHSjm.js";import{c as mh}from"./ca5e9c49.COugV1Xp.js";import{f as Ki,i as yh}from"./e3e348f2.CzOvkbpO.js";import{S as vh}
2from"./f3e117aa.2wtgPU0T.js";import{u as gh}from"./a25deb9a.BtBRFgl8.js";import{T as Gs}from"./7b0c98ea.B-oVlYQI.js";import{F as fh}from"./3ca8ef7e.D9Nch_50.js";import{D as Ch}from"./f49d4216.DkTq21k4.js";import{S as Sh}from"./f51e663e.BRJDCQ0a.js";import{m as _h}from"./ac5a19ff.BHoedVx2.js";function bh(){const{i18n:e}=v();return t(Fe,{level:1,children:e.translate("embed.header.review_order")})}function Ph(){const{hasError:e}=Gn(Nc),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}}=hn(),d=h(()=>{const c=l.value;return c.status===hl.Available?c.sdk:void 0});return n.value?t(O,{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(U,{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}=Hu().value,a=La(),s=xo(),o=Da();return a.value?s.value?t(Bt,{vaulted:!0,reason:"giftCard"}):!n||!o.value?t(pe,{}):t(Uu,{brand:e,descriptor:n}):t(Bt,{vaulted:!0,reason:"freeOrder"})}function Rh({checkout:e}){return e.identity.current.value==="buyWithPrime"?{rollupId:"buyWithPrimePayDetails",sdkButton:t(Zd,{wallet:Ya.BuyWithPrime,isSdkOnly:!0}),changeLink:t(Ph,{})}:{rollupId:"amazonPayDetails",sdkButton:t(dp,{isSdkOnly:!0}),changeLink:t(xu,{})}}function Ih({displayName:e,load:n,loadingLabel:a}){function s(o){const{observability:i}=v(),r=Ft(Zn);Co({active:!!o}),M(()=>{if(o)return i.error(o,{metadata:{vaulted:{component:e,failure:"lazy_load",boundary:r?"present":"missing"}}}),r?.register()},[o,i,r])}return cn({displayName:e,load:n,suspense:!1,renderLoading:()=>t(kh,{label:a}),useError:s})}function kh({label:e}){const{i18n:n}=v();return Co(),t(U,{children:[t(j,{accessibilityRole:"status",children:t(k,{accessibilityVisibility:"exclusive",children:n.translate("vaulted.loading_section",{section:e(n)})})}),t(A,{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 Zn=rl(null);function Mh({children:e}){const n=re(()=>new Oh,[]);return t(Zn.Provider,{value:n,children:e})}function Lh(){const{i18n:e}=v(),n=Ft(Zn);return n?t(O,{when:()=>n.hasFailures.value,children:t(j,{paddingBlockEnd:"base",children:t(Ii,{bannerId:"VaultedRollupContentsLoadError",errorType:Ge.CheckoutError,heading:e.translate("error_page.terminal.title"),tone:"critical",autoFocus:!0,iconHidden:!0,children:t(A,{gap:"small-400",alignItems:"start",children:[t(k,{children:e.translate("error_page.terminal.message")}),t(Wn,{variant:"plain",onClick:()=>globalThis.location.reload(),children:e.translate("error_page.terminal.action.cta")})]})})})}):null}function Dh({children:e}){const a=Ft(Zn)?.hasFailures.value??!1;return t(j,{inert:a,opacity:a?50:void 0,children:e})}const Th=()=>ln(()=>import("./26e63865.pCYl5ws-.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]));function qi(){return dn(Th)}function Ht(e,n,a){return Ih({displayName:e,loadingLabel:n,load:async()=>a((await qi()).vaultedRollupContents)})}const wh=Ht("DefaultVaultedPaymentRollupContent",e=>e.translate("payment.title"),e=>e.DefaultVaultedPaymentRollupContent),Nh=Ht("VaultedShippingMethodsRollupContent",e=>e.translate("shipping.title"),e=>e.VaultedShippingMethodsRollupContent),Vh=Ht("VaultedBillingAddressRollupContent",e=>e.translate("billing.billing_address_title"),e=>e.VaultedBillingAddressRollupContent),Bh=Ht("DefaultVaultedDeliveryAddressRollupContent",e=>e.translate("shipping.shipping_address_title"),e=>e.DefaultVaultedDeliveryAddressRollupContent),Fh=Ht("VaultedLocalPickupOptionsRollupContent",e=>e.translate("local_pickup.title"),e=>e.VaultedLocalPickupOptionsRollupContent),xh=Ht("VaultedPaymentOptionsRollupContent",e=>e.translate("payment.payment_option.title"),e=>e.VaultedPaymentOptionsRollupContent);function Hh(e){M(()=>{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:w(async a=>{await e.mutate(Uh,{variables:{experiments:[a]}})},[e])}};function Gh(){const{shop:e,checkout:n,shopPay:a}=v(),s=e.hasFlagEnabled(Vc),{recordExposure:o}=zh(),i=$(!1),r=a.installments.isServiceAvailable.value,l=a.user.installments.isRetryable.value,d=n.installments.isSupported.value,c=n.installments.isUnavailable.value,p=n.installments.config.value?.supportedCountries,u=re(()=>!d||!r||c&&!l,[d,r,c,l]);M(()=>{!s&&p?.includes("GB")&&n.installments.isSupported.value&&!u&&!i.current&&(o(Sp.handle),i.current=!0)},[s,p,u,n.installments.isSupported.value,o])}function Ws(e,n){const a=new Set(n.map(s=>s.id));return e.some(s=>a.has(s.id))}function ls(e,n){const a=yl();return ke(()=>{n&&Ws(a.blockingExtensions.value,e)&&St(()=>n())}),Ws(a.blockingExtensions.value,e)}function Wh(){const{generalPaymentError:e,generalPaymentErrorCode:n}=ae(),{violations:a}=vl(Ho);return h(()=>e.value?!Bc(n.value)||a.value.size>0:!1)}function nC({showTips:e,billingFormPosition:n}){const a=ne("Checkout::Dynamic::Render","PAYMENT1"),s=ne("Checkout::Dynamic::Render","PAYMENT2"),o=ne("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([...Fc,"PAYMENTS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"])),{hasError:a,clearError:s}=Gn(xc),{lastJourneyProgression:o}=ja(),i=o.value.type==="failed"&&o.value.negotiationStage==="completion",r=Wh(),l=gl();Hc(()=>{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 Qn(e,n){return e.currentUrl.value.hash===`#${n}`}function Ut(e,n=!1){const{router:a}=v(),s=q(e),o=h(()=>Qn(a,s.value)),i=he(n);return M(()=>{o.peek()&&(i.value=!0)},[o,i]),i}function cs({autoOpen:e=!0,isMissing:n,open:a}){M(()=>{e&&n&&(a.value=!0)},[e,n,a]);const{shopPay:{progressInterceptor:s}}=v();M(()=>
2{if(n)return s.listenResult(o=>{o||(a.value=!0)})},[s,n,a])}function $i(){const{loading:e}=Ta(),{checkout:n}=v(),a=n.isShippingRequired.value,s=ae().shippingAddress.value,{shippingAddress:o,deliveryNext:i}=G(),r=o.value,l=Uc(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}=ae(),{loading:a}=Ta(),s=q(e),o=q(a),i=Uo(),r=zo(),{showStoreCreditForSubscriptionRenewals:l}=ds();ke(()=>{const d=s.value,c=o.value,p=l.value,u=i.value,m=r.value;d&&!c&&(!p||u||m)&&St(()=>{n.value&&(n.value=!1)})})}function ds(){const{shop:e}=v(),n=e.hasFlagEnabled(zc),a=vn(),s=Go(),o=mn(),i=Gc(),{loading:r}=Ta(),l=q(r),d=Xn(a),c=$i(),p=h(()=>{const y=a.value;if(!(!i.value||!y||y.balance.amount<=0)){if(d.value)return zu({firstOrderTotal:s.value,storeCreditAccount:y});if(o.value?.amount===0&&s.value?.currencyCode===y.balance.currencyCode)return y.balance}}),u=Jn(a),m=h(()=>{const y=c.value,C=!l.value,f=u.value,S=p.value!=null;return n&&y&&C&&f&&S});return{storeCreditBalanceForSubscriptionRenewals:p,showStoreCreditForSubscriptionRenewals:m}}function Kh(){const{i18n:e}=v(),{paymentLines:n}=ae(),{violations:a}=De(Ho),{message:s,tone:o}=ki(),i=[...a][0],r=i&&(i.localizedMessage||i.nonLocalizedMessage),l=n.value.find(m=>m.method.type!=="giftCard"&&m.method.type!=="redeemable")?.method,d=l?.type==="customOnsite"?l:void 0,c=d?e.translate("payment_errors.local_payment_method_unavailable",{payment_method:d.name}):void 0,p=!!s&&(o==="critical"||o==="warning"),u=r&&c&&p?`${c}. ${r}`:void 0;return M(()=>{if(u)return So({content:u})},[u]),!r||!d?null:t(Ii,{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=Gu(),{paymentLines:o}=xt(),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(A,{children:[t(A,{gap:"small-200",padding:"small-100",border:"base",borderRadius:"base base none none",children:l.map(c=>t($h,{paymentLine:c},Ct(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(A,{direction:"inline",alignItems:"center",gap:"small-200",children:[t(Ye,{type:"edit"}),t(k,{children:d})]})})})]})}function $h({paymentLine:e}){const{i18n:n}=v();switch(e.method.redemptionSource){case"STORE_CREDIT":return t(ct,{gridAutoFlow:"column",gridAutoColumns:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",children:[t(A,{direction:"inline",alignItems:"center",gap:"small-100",children:[t(Le,{type:"store-credit"}),t(k,{children:n.translate("payment.store_credit.label")})]}),t(me,{textAlign:"end",children:t(k,{type:"strong",children:e.cost&&n.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]});case"CUSTOM":{const a=e.method.redemptionContent,s=wa(a);return t(ct,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 70%) minmax(0, 30%)",gridTemplateRows:"minmax(0, 1fr)",children:[t(A,{direction:"inline",alignItems:"center",gap:"small-100",children:[t(Le,{type:"gift-card"}),t(k,{children:n.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Na(s)})})]}),t(me,{textAlign:"end",children:t(k,{type:"strong",children:e.cost&&n.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]})}default:return null}}function Xh({open:e,onClose:n,includeStoreCredit:a=!0}){const{i18n:s,checkout:o}=v(),i=vn(),r=Jn(i),{canApplyGiftCards:l,paymentLines:d}=xt(),c=Ka(),p=a&&o.configuration.visibility.showStoreCreditRedemption.value&&r.value,u=l||d.length>0,m=$(u);M(()=>{const S=m.current&&!u;m.current=u,e&&S&&!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(U,{children:[t(bi,{}),t(Pi,{afterAppliedRedeemablesChange:C})]}):null;return t(Ap,{heading:y,open:e,onHide:n,children:t(A,{gap:"base",children:[o.configuration.visibility.showStoreCreditRedemption.value?f:null,t(Wu,{afterAppliedRedeemablesChange:C,autoSelect:!0,showHeading:!1})]})})}function Xi(){const e=vn(),n=Jn(e),a=Xn(e),s=$i(),o=mn();return h(()=>{const i=o.value?.amount===0&&!a.value;return n.value&&s.value&&!i}
2)}function Ji(){const{paymentLines:e}=xt(),n=Xi(),{showStoreCreditForSubscriptionRenewals:a}=ds();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}=xt(),{useStoreCreditForSubscriptionRenewals:c}=ae(),p=mn(),u=Uo(),m=zo(),y=vn(),C=Xn(y),f=he(ws.Init),S=h(()=>f.value===ws.Loading),g=Ji(),b=Xi(),{storeCreditBalanceForSubscriptionRenewals:_,showStoreCreditForSubscriptionRenewals:E}=ds(),N=h(()=>u.value||m.value),T=h(()=>{if(u.value)return a.translate("payment.store_credit.buying_gift_card");if(m.value)return a.translate("payment.store_credit.no_fixed_selling_plans")}),R=Yu(y.value,f),F=ju(y.value,f),L=he(x());M(()=>{L.value=x()},[l]),ke(()=>{const z=C.value,W=c.value;L.value=x({storeCreditSelected:z,subscriptionRenewalsSelected:W})});function x({storeCreditSelected:z=C.value,subscriptionRenewalsSelected:W=c.value}={}){const Y=l.map(({method:oe})=>Ct(oe));return z&&Y.unshift(ga),W&&Y.splice(z?1:0,0,fa),Y}const V=w((z,W)=>{const Y=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_${Y}_${z}`}})},[r,s,n,o,i]),D=w(async z=>{const W=L.value,Y=W.length>z.length,{shorter:oe,longer:Z}=Y?{shorter:z,longer:W}:{shorter:W,longer:z};L.value=z;const Q=Z.find(ie=>!oe.includes(ie)),ee=Q===ga,ge=Q===fa;let le=!1;if(ee)if(V("store_credit",!Y),Y){const ie=c.value;c.value=!1,{landed:le}=await F(),le||(c.value=ie)}else({landed:le}=await R());else if(ge){const ie=!Y;V("store_credit_subscription_renewals",ie),c.value=ie}else{V("gift_card",!Y);const ie=l.find(fe=>Ct(fe.method)===Q);ie?.method&&(le=(await d(ie.method))?.status==="success")}le&&e?.()},[e,R,L,l,V,d,F,c]),I=h(()=>S.value||N.value),H=h(()=>I.value||p.value?.amount===0&&!C.value),K=I;if(!g)return null;const se=y.value?.balance,X=_.value,P=T.value;return t(A,{gap:"base",borderRadius:"base base none none",padding:n==="expanded"?"small-100 none none none":void 0,children:t(Ip,{name:"redeemables_list",values:L.value,onChange:D,variant:"block",multiple:!0,children:[b.value&&se&&t(rn,{value:ga,disabled:H.value,secondaryContent:t(k,{type:"strong",children:a.formatCurrency(se.amount,{currency:se.currencyCode})}),details:P&&t(k,{children:P}),children:t(A,{direction:"inline",gap:"base",alignItems:"center",children:[t(k,{children:a.translate("payment.store_credit.apply_label")}),t(O,{when:S,children:t(fl,{})})]})}),E.value&&X&&t(rn,{value:fa,disabled:K.value,details:t(A,{gap:"small-500",children:[t(k,{children:a.translate("payment.store_credit.remaining_for_subscription_charges_description",{amount:a.formatCurrency(X.amount,{currency:X.currencyCode})})}),P&&t(k,{children:P})]}),children:t(k,{children:a.translate("payment.store_credit.use_remaining_for_subscription_charges_label")})}),l.map(z=>t(Zh,{paymentLine:z},Ct(z.method)))]})})}function Zh({paymentLine:e}){const{i18n:n}=v(),s=e.method.redemptionContent,o=wa(s);return t(rn,{value:Ct(e.method),secondaryContent:t(me,{textAlign:"end",children:t(k,{type:"strong",children:e.cost&&n.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})}),children:t(A,{children:[t(me,{children:n.translate("payment.gift_card_checkbox_label")}),t(A,{direction:"inline",gap:"small-400",children:[t(Ye,{type:"gift-card"}),t(k,{color:"subdued",children:[" ",Na(o)]})]})]})})}function Qh(){const{checkout:e}=v(),n=Ji(),a=Zi(),{paymentLines:s}=xt();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(A,{gap:"base",children:[a?t(U,{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=vn(),a=Jn(n),s=Xn(n),o=mn(),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 gt({children:e}){return t(A,{direction:"inline",gap:"small-200",alignItems:"center",children:e})}function nm({handleNoValidCards:e}){const[n,a]=_t(!1),o=G().paymentMethods.value,{i18n:i,observability:r,shopPay:l}=v(),d=l.session.paymentMethodOption.value,c=Ai(),p=c.selectedCreditCard.value,u=c.selectedPaymentMethod.value,m=c.selectedPaymentMethodItem.value,y=c.paymentMethods.value,C=l.user.hasFlow.value,f=Ku(p),S=y.find(_=>!_.isDisabled);if(M(()=>
2{if(n){const _=setTimeout(()=>{a(!1)},750);return()=>clearTimeout(_)}},[n]),M(()=>{const _=d?.name==="SHOPIFY_INSTALLMENTS"&&m?.isDisabled===!0;if(!S){C&&e();return}_&&(c.selectPaymentMethod(S.method),a(!0))},[m?.isDisabled,d?.name,e,S,c,C]),!u)return null;if(n)return t(gt,{children:t(pe,{})});if(u.paymentMethod==="CUSTOM_ONSITE"){const _=o?.find(T=>u.paymentBrands&&Wo(T,u.paymentBrands));if(!_)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(_)&&!!_.incentiveType,N=_.paymentBrands?.length===1?_.paymentBrands[0]:"generic";if(E){const T=tm[_.incentiveType],R={title:i.translate("payment.usdc_cashback_title",{incentive_percentage:T}),additionalInfo:i.translate("payment.usdc_cashback_additional_info",{terms_url:Bs,incentive_percentage:T}),terms:i.translate("payment.usdc_cashback_terms"),termsUrl:Bs};return t(gt,{children:[t(k,{children:_.name}),t(Ep,{notice:R,selected:!1}),t(Le,{type:N})]})}return t(Oi,{paymentLine:{method:_},showAmount:!1})}if(qu(u))return t(gt,{children:[t(k,{children:t(k,{children:i.translate("payment.ideal_label")})}),t(Le,{type:"ideal"})]});if($u(u))return t(gt,{children:[t(k,{children:i.translate("brand.apple_pay")}),t(Le,{type:"apple_pay"})]});if(Xu(u))return t(gt,{children:[t(k,{children:i.translate("brand.paypal")}),t(Le,{type:"paypal"})]});if(Ju(u)||Ns(u)){const _=i.translate("payment_gateway.shop_pay.name"),E=Ns(u)?i.translate("payment_gateway.shop_pay.installments_label"):void 0;return t(gt,{children:[t(k,{children:_}),t(Le,{type:"shop_pay"}),E?t(k,{color:"subdued",children:E}):null]})}if(Zu(u))return t(gt,{children:t(k,{children:u.name})});if(Qu(u)||ep(u))return null;const g="base",b=u.paymentAttributes;return t(tp,{name:f,digits:t(U,{children:[t(Ra,{}),t(k,{size:g,tone:"neutral",children:b.lastDigits})]}),icon:t(Le,{type:b.brand})})}function am(){const e=ae().paymentLines.value,n=re(()=>e.find(a=>a.method.type!=="giftCard"&&a.method.type!=="redeemable"),[e]);return t(A,{gap:"small-400",children:[n&&t(Oi,{paymentLine:n,showCardBrandLabel:!0}),t(np,{})]})}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=Wc("STORE_CREDIT"),{paymentLines:a}=xt(),s=[...n.value,...a];if(!s.length)return null;const o=" - ";return t(A,{gap:"small-200",children:s.map(i=>{const r=i.cost?t(k,{children:[o,e.formatCurrency(i.cost.amount,{currency:i.cost.currencyCode,form:"short"})]}):null;switch(i.method.redemptionSource){case"STORE_CREDIT":return t(A,{direction:"inline",alignItems:"center",gap:"base",children:[t(Le,{type:"store-credit"}),t(me,{children:[e.translate("payment.store_credit.label"),r]})]},Ct(i.method));case"CUSTOM":{const l=i.method.redemptionContent,d=wa(l);return t(A,{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:Na(d)}),r]})]},Ct(i.method))}default:return null}})})}function om({paymentExemptionReason:e}){const{checkout:{identity:n}}=v();return n.current.value==="shopPay"&&(e==="storeCredit"||e==="redeemables")?t(Bt,{vaulted:!0,reason:e}):t(Qi,{})}function im({hasPersistentRedeemablesManagement:e,openSignal:n}){const{checkout:a}=v(),s=Op(),o=Ka();return s.value==="freeOrder"?t(Bt,{vaulted:!0,reason:"freeOrder"}):s.value==="giftCard"?t(Bt,{vaulted:!0,reason:"giftCard"}):rm({identity:a.identity,paymentExemptionReason:s.value,paymentFullyCoveredByRedeemablesAndGiftCards:o.value})?t(om,{paymentExemptionReason:s.value}):t(A,{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}=G().paymentMethods,{inMemoryGooglePayParts:{sdkStatus:s,paymentSheetError:o},persistedGooglePaySignal:i,receiptErrorSignal:r}=hn(),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"&&St(()=>{c.current(),o.value={type:Vn}})}),M(()=>{const p=()=>{c.current(),i.value={...i.value,receiptIdForPaymentFailure:n?.id}};!Yo(a,"GOOGLE_PAY")&&o.value?.type!==Vn&&(o.value={type:Vn},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]),M(()=>()=>{r.value=void 0},[r]),null}function cm(){const{checkout:e}=v(),n=e.latestReceipt.value,{value:a}=G().paymentMethods,{inMemoryPayPalParts:{paymentSheetError:s},persistedPayPalSignal:o}=hn(),i=_l(),r=$(i);r.current=i;const l=re(()=>Yo(a,"PAYPAL_EXPRESS"),[a]);return M(()=>{l||(r.current(),s.value={type:Vn})},[l,s]),M(()=>
2{if(!n)return;const d=n.id===o.value?.receiptIdForClearedToken,c=n.status==="failed"&&n.failure.type==="payment";!d&&c&&(o.value={...o.value,receiptIdForClearedToken:n?.id},r.current())},[n,l,s,o]),null}function 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=Pp(),d="payment",{hasAnyPaymentError:c,clearReceiptError:p}=Yh({clearReceiptErrorOnPaymentLineChange:!1}),{hasViolations:u}=We(qa),{hasError:m}=bl(),{hasError:y}=Pl(),{paymentErrors:C}=Va().value,f=C.length>0,{notSupportedError:S}=gp(),g=!!S,b=G(),_=b.buyerIdentity,{value:E}=b.paymentFlexibilityPaymentTermsTemplate,N=Al(),T=E!=null&&!N.value,R=Yc().value,F=o.session.selectedPaymentMethod.value,L=jc(F),{value:x}=b.paymentMethods,V=Ai({enableAutoSelect:!1}),D=hp(V),{buyerHasActedSignal:I}=ut();M(()=>{if(!(!i||!r))return i.unstable_provideSavedCardSelector(async Be=>{const ze=D.current;if(!(ze instanceof ap))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})},[D,r,i,I]);const H=V.paymentMethods.value.length>0;Gh();const K=F!=null&&Kc(F)?F.paymentBrands??[]:[],se=K.length>0?x?.find(Be=>Wo(Be,K)):void 0,X=El("Checkout::PaymentMethod::Render",se?.uiExtension?[se.uiExtension]:[]),P=pm(e,{customerProfile:_.value?.customerProfile}),z=P&&(r||H),W=P&&V.cardPaymentMethods.value.length===0,{expandedSlot:Y,collapsedSlot:oe}=sp(V),Z=c||g||f||m||y,{directPaymentErrors:Q,paymentLines:ee}=ae(),le=ee.value.some(Be=>Be.method.type===qc.CreditCard&&Be.method.requiresCvvConfirmation),ie=s.storeVaultGuestCvvVerificationEnabled&&le,fe=!!L&&!L?.expired&&!L?.verified,Ee=!!L?.expired||Z||T||R||ie||fe,Ce=ne("purchase.checkout.payment-method-list.render-before"),ce=ne("purchase.checkout.payment-method-list.render-after"),Se=Un([...Ce,...ce]),_e=Un(X),be=Ou([...Ce,...ce]),J=La(),ye=xo(),B=h(()=>J.value&&!ye.value?!0:!!_.value?.purchasingCompany),te=Ut(d,Ee||u);ls(X.map(en),w(()=>{te.value=!0},[te])),M(()=>{(Ee||u)&&(te.value=!0)},[Ee,u,te]),op();const Re=w(()=>{te.value&&Vs(Q)||(te.value=!te.value,te.value&&l(),mm(e,te.value))},[l,Q,te,e]),Pe=Qh(),$e=t(im,{openSignal:te,hasPersistentRedeemablesManagement:Pe.hasPersistentRedeemablesManagement}),ue=Z?t(ym,{paymentErrors:C}):null,nt=hm(e),Ve=nt&&B.value,He=!nt,Ue=He?!1:te.value,Oe=He?null:ue||ie,ht=He?!1:be||W||T,Xe=Ue||ht||!!Oe;jh(r),ke(()=>{Vs(Q)&&(te.value=!0)}),cs({autoOpen:!1,isMissing:ie||fe,open:te});const Te=Ve?t(wh,{usesSharedVaultedSelector:z,hasPersistentRedeemablesManagement:Pe.hasPersistentRedeemablesManagement,msiExpandedSlot:Y,onSelectedPaymentMethodChange:p}):null;ke(()=>{(Se.value||_e.value)&&(te.value=!0)});const zt=Pe.show?t(em,{}):null,at=Xe?void 0:oe,Gt=zt?t(A,{gap:"base",children:[zt,at]}):at;return t(U,{children:t(Vt,{target:"cart.paymentLines[0]",children:[t(de,{open:Ue,disabled:ht,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:Gt,children:Te}),t(dm,{})]})})}function pm({checkout:e,shop:n,source:a},{customerProfile:s}){return e.identity.current.value==="shopPay"||$c({identitySource:e.identity.current.value,isOrderSession:lt(a),storeVaultEnabled: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(Ba,{errors:e,errorType:Ge.PaymentError}):t(U,{children:[t(fp,{}),t(Kh,{})]}),t(xe,{blockSize:"base"})]})}const vm="EnNLk",gm={InlineAlignmentWithContent:vm};function Ys({onPaymentDelegation:e}){const{embed:n,i18n:a}=v(),{rollup:{action:{tone:s}={}}={}}=bt();return n?.embedder==="amazon"?t(Qe,{textDecoration:"none",onClick:e,children:t(k,{tone:"accent",children:a.translate("embed.payment.payment_options")})}
2):t(Wn,{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 js(e){return e.toLowerCase().replace(/[-_]/g,"")}function Ca(e,n){return!e||js(e)==="unknown"?n.translate("payment_gateway.credit_card_label"):fm[js(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=La(),l=Ke(),{delegatedPaymentInstrument:d}=ut(),{message:c,tone:p,inventoryRecoveryReceiptId:u}=ki(),{rollup:{blockPadding:m}={}}=bt(),{hasViolations:y,clearViolations:C}=De(qa);M(()=>{let J=Jt(d.peek());return d.subscribe(ye=>{const B=Jt(ye);B!==J&&(J=B,C())})},[d,C]);const f=!!a&&i.configuration.isPaymentInstrumentsDelegationEnabled&&!!d.value,S=f&&y,g=Jt(d.value),b=$(void 0);S&&(b.current=g);const _=mp(d.value),{billingAddress:E}=ae(),N=!!(_&&!Pa(E.value,yp(_))),T=f&&(S||b.current===g&&N),R=a?.embedder,F=Yn({embedder:R,shop:s}),L=jn(o.app.config),x=a?.isFlagshipPartner&&!pt(a.embedder)&&!L&&!F?e.translate("payment.payment_method"):e.translate("payment.title"),V=a?.client?.paymentErrors.value.includes(Ms.PaymentEmpty)??!1,D=$(!1),I=$(null),H=w(J=>{I.current=J,J&&D.current&&(J.focus(),D.current=!1)},[]),K=w(async()=>{const J=a?.client;if(!J)return;D.current=!1;const ye=I.current!==null;try{const B=await J.paymentMethodChangeStart();if(!B)return;if(B.ucpPaymentInstrument)n.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Jt(d.value)});else if(B.cart)try{await J.applyCart(B.cart),n.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Jt(d.value)})}catch(te){n.log("delegated_payment_cart_update_error","Failed to apply cart update after payment selection",{error:String(te)})}}finally{!J.paymentErrors.value.length&&ye&&(I.current?I.current.focus():D.current=!0)}},[a,n,d]),X=a?.client?.paymentErrors.value.includes(Ms.PaymentDelegationError)?e.translate("payment_errors.payment_credential_delegation_error"):void 0,P=X||c,z=X?"critical":p,W=xn(m),Y=r.value&&P?t(A,{direction:"block",gap:W,paddingBlockEnd:W,children:[t(Cp,{message:P,tone:z,inventoryRecoveryReceiptId:X?void 0:u}),!T&&a?.isFlagshipPartner&&t(Ys,{onPaymentDelegation:K})]}):void 0;if(!r.value){const J=t(Bt,{vaulted:!0,reason:"freeOrder"}),ye=R==="amazon"?{compact:J}:{primary:J};return t(de,{id:"payment",label:x,primaryContent:ye.primary,compactContent:ye.compact,icon:t(Ye,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"})})}const oe="payment",Z=d.value,Q=vp(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(k,{tone:"critical",children:e.translate("payment.add_payment_method")}),Ee=ge?t(k,{accessibilityVisibility:"exclusive",children:`${Ca(ee,e)} ${e.translate("payment.ends_with_label",{last_digits:ge})}`}):null,Ce=t(k,{accessibilityVisibility:"hidden",children:t("bdi",{children:[Ca(ee,e),t(Ra,{}),ge]})}),ce=(()=>{if(!le)return t(A,{direction:"inline",gap:"small-400",alignItems:"center",children:[Ee,Ce,t(Le,{type:ee,size:"small",accessibilityVisibility:"hidden"})]})})(),Se=le?t(k,{tone:V?"critical":void 0,children:e.translate("payment.add_payment_method")}):t(A,{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(k,{tone:"accent",decoration:"underline",children:e.translate("payment.add_new_payment_method")}):t(A,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(k,{children:e.translate("payment.pay_with")})," ",Ee,t(k,{type:"strong",accessibilityVisibility:"hidden",children:[Ca(ee,e),t(Ra,{}),ge]}),t(Le,{type:ee,accessibilityVisibility:"hidden"})]}),be=R==="amazon"?{compact:_e}:R==="google"&&!F?{primary:Se}:{primary:ce,secondary:ce===void 0?fe:void 0};return t(de,{buttonRef:H,id:oe,label:x,open:T,disabled:T,onToggle:Y?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:Y,children:T?t(A,{direction:"block",gap:"base",children:[t(Fe,{level:3,children:e.translate("billing.billing_address_title")}),t(Dp,{}),a?.isFlagshipPartner?t(Ys,{onPaymentDelegation:K}):null]}):null})}const Sm=new Set(["amazonPay","buyWithPrime"]);function Oa(){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 ea(){const{checkout:e}=v(),n=$(null);return h(()=>{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=wp({requiresAvailableBalance:e}),a=G(),s=a.paymentMethods,o=a.shopCashBalance;return h(()=>{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=Ls.ShopCashNotAvailable:r?c=i:c=Ls.ShopCashMerchantNotSupported,{nonEligibleReason:c}})}const us=({requiresAvailableBalance:e=!0}={})=>{const n=_m({requiresAvailableBalance:e});return h(()=>{const{nonEligibleReason:a}=n.value;return a?{eligible:!1,reason:a}:{eligible:!0}})};function ta(){const{shop:e}=v(),n=e.hasFlagEnabled(Kn);return us({requiresAvailableBalance:!n})}const tr=()=>{const e=v().shopPay.app.config,n=bp();return Xc(e,n)};function bm(e,n,a){M(()=>{if(!(!e||!a))return e.recordPresentation({component:n,displayLabel:a})},[n,a,e])}const Pm=()=>{const e=G().discountLines;return h(()=>{const n=e.value,a=n?n.lines.some(o=>Fs(o)?o.allocations.some(i=>i.target.type==="MERCHANDISELINE"):!1):!1,s=n?n.lines.filter(i=>Fs(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=pt(e?.embedder),i=s.app.config.surface,r=a.hasFlagEnabled($a),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(k,{size:"small",children:n.translate("shop_cash.minimum_order_value_banner_keep_shopping")})}):null},Im="O9AXs",km="dHa7y",Ks={ShopCashMinimumOrderValueBannerLight:Im,ShopCashMinimumOrderValueBannerDark:km},qs=({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?Ks.ShopCashMinimumOrderValueBannerDark:Ks.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=Ft(ss),o=s?.cashback?.incentive;if(!e.eligible&&!n.eligible)return[];const i=[];return n.eligible&&a?.minimumOrderValue&&!a.minimumOrderValue.satisfied&&i.push(t(qs,{adType:a.adType,offerAmount:a.offerAmount,minimumOrderValueAmount:a.minimumOrderValue.amount,remainingAmou
2nt:a.minimumOrderValue.remainingAmount},"mov-discount")),e.eligible&&Mm(o)&&i.push(t(qs,{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}}=Fa(),s=us().value,o=ta().value,i=ea(),r=Ae().value.payment,l=nr({eligibility:s,offerEligibility:o,discountOffer:i.value});return pt(n?.embedder)&&!e.configuration.visibility.showCashRedemption.value&&l.length>0?r?t(A,{padding:Dm(a?.padding),gap:"small-200",children:l}):t(an,{hideDivider:r,condition:!r,padding:"none large-200",children:t(A,{padding:"small-200 none",gap:"small-200",children:l})}):null}function Dm(e){const[n,a]=Tm(e),s=xn(n)??"none",o=xn(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(Hp,{checked:e,onChange:n,icon:"none",className:Nm.ShopCashSwitch,accessibilityLabel:"Shop Cash",disabled:a})}function ft(e,n){return e==null&&n==null?!0:e==null||n==null?!1:e.amount===n.amount&&e.currencyCode===n.currencyCode}const ps=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=qn.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:Vp(a.destinationAmount),sourceAmount:Np(a.sourceAmount)};s==="SHOP_PROMOTION"?n.SHOP_PROMOTION=[...n.SHOP_PROMOTION,o]:n[s]=o}return n}
2,Zt=(e,n)=>{const a=e[n];return Array.isArray(a)?a.length>0:a!=null},At=()=>{const{paymentLines:e}=G();return h(()=>sr(e.value?.lines.find(ps)))},hs=()=>{const{paymentLines:e}=ae();return h(()=>sr(e.value?.find(ps)))},Sa=e=>({type:e.type,amount:e.destinationAmount,promotionId:e.promotionId}),na=({enabled:e=!0}={})=>{const{shopPay:n}=v(),a=hs(),o=Ft(ss)?.redemption.applying,{negotiate:i}=dt(),l=ae().paymentLines,d=Bp(),c=Mp(),p=G().buyerIdentity.value?.shopUser?.publicId,u=n.session.isInternalProgressing.value,m=o?.value===!1,y=e&&!!p&&!u&&m,C=async(S,{onNegotiateAccepted:g}={})=>{const{SHOP_CASH_BALANCE:b,SHOP_DISCOUNT_OFFER:_,SHOP_PROMOTION:E}=a.peek(),{SHOP_CASH_BALANCE:N=b?Sa(b):null,SHOP_DISCOUNT_OFFER:T=_?Sa(_):null,SHOP_PROMOTION:R=E.map(Sa)}=S,F=n.session.isInternalProgressing.value;if(!e||!o||F||!p||o.peek())return;Nt(()=>{o.value=!0});const L=l.peek().filter(P=>P.method.type!=="redeemable"||P.method.redemptionSource!=="SHOP_CASH"),x=Object.values(S).flatMap(P=>Array.isArray(P)?P:[P]).find(P=>P!=null)?.amount.currencyCode,V=[N,T,...R??[]].filter(P=>P!==null&&(!x||P.amount.currencyCode===x)),{selectedBillingAddress:D,selectedShippingAddress:I,isUsingApplePayShippingFallback:H}=d.value,K=!D.address1||c.value==="APPLE_PAY",X=f(V,H||!I||!K?D:I);X&&L.push(X),l.value=L;try{g?.(),await i({include:["paymentLines","billingAddress"],silenceViolations:["non-shop-cash"]})}finally{Nt(()=>{o.value=!1})}},f=(S,g)=>{if(!p||S.length===0)return null;const b=S.reduce((E,N)=>E+N.amount.amount,0),_=S[0].amount.currencyCode;return{cost:{amount:b,currencyCode:_},method:{type:"redeemable",redemptionSource:"SHOP_CASH",redemptionContent:{redemptionId:p,billingAddress:{streetAddress:g?{address1:g.address1??"",address2:g.address2,city:g.city??"",company:g.company,firstName:g.firstName,lastName:g.lastName??"",phone:g.phone,postalCode:g.postalCode,zoneCode:g.zoneCode,countryCode:g.countryCode??""}:null},destinationAmount:{amount:b.toString(),currencyCode:_},sourceAmount:{amount:b.toString(),currencyCode:_},redemptionPaymentOptionKind:"decoupled",details:S.map(E=>({sourceAmount:E.amount?{amount:E.amount.amount.toString(),currencyCode:E.amount.currencyCode}:null,destinationAmount:{amount:E.amount.amount.toString(),currencyCode:E.amount.currencyCode},redemptionId:E.promotionId??E.type,redemptionType:E.type}))}}}};return{isShopCashNegotiationReady:y,negotiateShopCash:C}},aa=()=>{const e=G().subtotalAfterMerchandiseDiscounts,n=Go(),a=xm(),s=Hm();return h(()=>{const o=n.value,i=o?{amount:Li(o.amount-a.value-s.value,go(o.currencyCode)),currencyCode:o.currencyCode}:void 0;return{orderTotal:o,orderSubtotal:e.value,redeemableTotal:i}})},Vm=e=>e.method.type==="giftCard",Bm=e=>e.method.type==="redeemable",Fm=e=>e.method.redemptionSource==="SHOP_CASH",xm=()=>{const{paymentLines:e}=G();return h(()=>(e.value?.lines??[]).reduce((a,s)=>s.cost&&(Vm(s)||Bm(s)&&!Fm(s))?a+s.cost.amount:a,0))},Hm=()=>{const e=At();return h(()=>Object.values(e.value).flatMap(n=>Array.isArray(n)?n:[n]).reduce((n,a)=>!a||a.type==="SHOP_CASH_BALANCE"?n:n+a.destinationAmount.amount,0))},Dt=jo,or=e=>{const{i18n:n,shopPay:a,webMcp:s,checkout:o}=v(),{isShopCashNegotiationReady:i,negotiateShopCash:r}=na(),l=hs(),d=At(),{applying:c}=Lp().redemption,{buyerIdentity:p,shopCashBalance:u}=G(),m=aa(),y=Tt(p.value),C=Tt(u.value),f=Um(u.value)?void 0:Tt(m.value),S=!!l.value[Dt],g=d.value[Dt]?.destinationAmount||null,b=w(async T=>{if(c.value)return;const R=T?e:null;ft(g,R)&&ft(l.value[Dt]?.destinationAmount,R)||await r({[Dt]:R?{type:"SHOP_CASH_BALANCE",amount:R,promotionId:null}:null})},[g,e,r,c,l]);M(()=>
2{if(!s||!(e.amount>0))return;const T=()=>i&&!c.value&&!a.session.isInternalProgressing.value&&Tt(p.value)===y&&Tt(u.value)===C&&(f===void 0||Tt(m.value)===f);return s.unstable_registerDeclaredField({key:"shop_cash",read(){const R=o.latestReceipt.value?.status;if(!(R&&["processed","processing","processing_remote_checkouts","polling_for_order","action_required"].includes(R)))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(R){if(R!==null&&typeof R!="boolean")return{requirement:"must be a boolean or null"};const F=R===!0;return{phase:"negotiate",changed:!0,async apply(){return T()?(await b(F),ft(d.value[Dt]?.destinationAmount??null,F?e:null)):!1}}}})},[s,o,a.session,e,l,d,i,c,p,y,u,C,m,f,b]),M(()=>{g&&(ft(g,e)||b(!0))},[e]);const _=n.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"}),E=n.translate("order_summary.shop_cash_title"),N=S?n.translate("shop_cash.redemption.balance.applied",{formattedAmount:_}):n.translate("shop_cash.redemption.balance.available",{formattedAmount:_});return{title:E,amount:N,checked:S,handleChange:b,disabled:c.value}};function Tt(e){return JSON.stringify(e)??""}function Um(e){return e?.status==="filled"&&e.eligible&&(e.redeemableBalance?.amount??0)>0}const zm="yY3sV",Gm={ShopCashToggleContainer:zm},Wm=({redeemableBalance:e})=>{const{title:n,amount:a,checked:s,handleChange:o,disabled:i}=or(e);return t("div",{className:Gm.ShopCashToggleContainer,children:t(ba,{theme:{rollup:{blockAlignment:"center"}},children:t(de,{label:n,primaryContent:a,primaryAction:t(ar,{checked:s,onChange:o,disabled:i})})})})},Ym="Q9An4",jm="K92xU",$s={ShopCashVaultedCreditCardRequiredBanner:Ym,Dark:jm},Km=()=>{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:fo($s.ShopCashVaultedCreditCardRequiredBanner,n&&$s.Dark),children:t(me,{type:"small",children:a})})},Ln={availableBalance:null,redeemableBalance:null},qm=()=>{const e=G().shopCashBalance.value,n=$(null);return e?.status==="filled"?n.current=e.availableBalance:e?.status==="unavailable"&&(n.current=null),n.current},$m=()=>{const e=G().shopCashBalance.value,{redeemableTotal:n}=aa().value,a=qm();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 Ln;const s=Up(n.currencyCode);if(n.amount<=s)return Ln;if(n.amount<a.amount)return{availableBalance:a,redeemableBalance:n};const o=Li(n.amount-a.amount,go(n.currencyCode));if(o>=s)return{availableBalance:a,redeemableBalance:a};const i=zp({amount:a.amount-(s-o),currencyCode:a.currencyCode});return{availableBalance:a,redeemableBalance:i}};function ir(){const e=$([]),n=aa(),{checkout:a}=v(),s=a.proposal.negotiated.fields.shopPromotion;return h(()=>{const{orderTotal:o}=n.value,i=s.value;return i?.status==="filled"?e.current=i.promotions:i?.status==="unavailable"&&(e.current=[]),Gp(e.current,o)})}const Xm=({eligibility:e,availableBalance:n,redeemableBalance:a,discountOffer:s})=>{const{recordRedemptionEligibilityEvent:o}=os(),{orderTotal:i,orderSubtotal:r}=aa().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?.remainingAmount?.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]);M(()=>{d&&o(d)},[o,e.reason,n,a,s])},Jm=e=>{const{client:n,shop:a,shopPay:s}=v(),{recordRedemptionVisibilityEvent:o}=os(),i=n.unstable_getSerialization("apiClientId"),r=a.hasFlagEnabled($a),l=s.app.c
2onfig.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]);M(()=>{o(p)},[o,e.reason])},Zm="https://shop.app/shop-cash-terms",Qm=e=>{const n=ey(),{paymentLines:a}=G(),o=Ka().value&&!!a.value?.lines.find(ps);return{eligibilityMessage:n(e.reason),showVaultedCardBanner:o}},ey=()=>{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:Zm,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")}}},ms=()=>{const{recordRedemptionActionEvent:e}=os(),{shop:n,shopPay:a}=v(),s=n.hasFlagEnabled($a),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=w(m=>{e({...r,...m})},[r,e]),d=w((m,y)=>{l({action:"auto-apply",redemptionType:m,source:y})},[l]),c=w((m,y)=>{l({action:"manually-apply",redemptionType:m,source:y})},[l]),p=w((m,y)=>{l({action:"auto-remove",redemptionType:m,source:y})},[l]),u=w((m,y)=>{l({action:"manually-remove",redemptionType:m,source:y})},[l]);return{recordRedemptionAutomaticallyApplied:d,recordRedemptionAutomaticallyRemoved:p,recordRedemptionManuallyApplied:c,recordRedemptionManuallyRemoved:u}},rr=({enabled:e=!0,redemptionTypes:n=qn}={})=>{const a=At(),o=Ft(ss)?.cashbackState.stale,{recordRedemptionAutomaticallyRemoved:i}=ms(),{negotiateShopCash:r}=na({enabled:e}),{hasViolations:l}=De(Jc);M(()=>{if(!e||!o||!l)return;let d=!1;for(const c of n)Zt(a.value,c)&&(d=!0,i(c,"useRemoveRedemptionsOnViolation"));d&&(o.value=!0,r(Object.fromEntries(n.map(c=>[c,null]))))},[e,l])},ys=(e,{enabled:n=!0,retryOnReady:a=!1}={})=>{const{isShopCashNegotiationReady:s,negotiateShopCash:o}=na({enabled:n}),{recordRedemptionAutomaticallyRemoved:i}=ms(),r=At(),l=hs(),d=e.filter(m=>!m.eligibility.eligible).flatMap(m=>m.redemptionTypes??qn),c=d.join(","),p=a?s:!1,u=a?d.filter(m=>Zt(l.value,m)).join(","):"";M(()=>{if(!n||d.length===0)return;if(!a){const y=d.filter(C=>Zt(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 m=d.filter(y=>Zt(l.value,y));m.length!==0&&o(Object.fromEntries(d.map(y=>[y,null])),{onNegotiateAccepted:()=>{for(const y of m)i(y,"useRemoveRedemptionsWhenIneligible")}})},[n,p,c,u])},ty=()=>{ny()},ny=()=>{const{observability:e,source:n}=v(),a=G().paymentLines.value,s=re(()=>a?.lines.filter(i=>i.method.type==="redeemable"&&i.method.redemptionSource==="SHOP_CASH")??[],[a]),o=$(!1);M(()=>
2{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 ay,{severity:"error",metadata:{shopCash:{redemptions:i},source:{type:n.type},checkout:{token:n.checkoutSessionIdentifier||n.sourceId}}})},[s,e,n])};class ay extends Error{constructor(){super("Multiple Shop Cash payment lines present in negotiation response"),this.name="MultipleShopCashPaymentLinesAnomaly"}}function sy(e){const n=$(!1),a=$(performance.now()),{observability:s}=v();M(()=>{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 oy=({message:e})=>t(ct,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",borderRadius:"base",borderWidth:"base",padding:"small-400 small-200",gap:"small-200",accessibilityRole:"alert",alignItems:"center",alignContent:"center",children:[t(Ye,{type:"alert-circle",size:"small"}),t(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();sy(s);const{shop:c}=v(),p=c.hasFlagEnabled(Kn);return ys([{eligibility:e,redemptionTypes:[jo]},...p?[]:[{eligibility:n,redemptionTypes:[Zc,Qc]}]],{retryOnReady:p}),rr(),Jm(e),Xm({eligibility:e,availableBalance:s,redeemableBalance:a,discountOffer:o.value}),ty(),{eligibility:e,redeemableBalance:a,messages:i,showVaultedCardBanner:r,vaulted:l,isDigitalGoodsRedemptionAllowed:d}}function cr(){const e=Ae().value.payment,n=us().value,a=ta().value,{redeemableBalance:s,availableBalance:o}=$m(),i=ea(),l=ir().value,d=nr({eligibility:n,offerEligibility:a,discountOffer:i.value}),{eligibilityMessage:c,showVaultedCardBanner:p}=Qm(n),u=!n.eligible&&n.reason==="PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING",m=[];return c&&!u&&m.push(t(oy,{message:c},"eligibility-banner")),m.push(...d),{eligibility:n,offerEligibility:a,redeemableBalance:s,availableBalance:o,discountOffer:i,shopPromotionDiscounts:l,messages:m,showVaultedCardBanner:p,vaulted:e,isDigitalGoodsRedemptionAllowed:u}}function iy(){const{eligibility:e,messages:n,redeemableBalance:a,discountOffer:s,shopPromotionDiscounts:o,isDigitalGoodsRedemptionAllowed:i}=cr(),r=At();if((e.eligible||i)&&a)return!0;const l=s?.value?.redeemableAmount,d=o.length>0;return!!(e.eligible&&(l||d)||qn.some(p=>Zt(r.value,p))||n.length>0)}const ry=()=>{const{eligibility:e,redeemableBalance:n,messages:a,showVaultedCardBanner:s,vaulted:o,isDigitalGoodsRedemptionAllowed:i}=lr();return s&&!o&&a.push(t(Km,{})),t(U,{children:[(e.eligible||i)&&n&&t(an,{hideDivider:o,condition:!o,children:t(Wm,{redeemableBalance:n})}),a.length>0&&t(an,{hideDivider:o,condition:!o,padding:"none large-200",children:t(A,{padding:"small-200 none",gap:"small-200",children:a})})]})};function dr({formattedAddress:e}){const{i18n:n,checkout:a}=v(),s=G().buyerIdentity.value?.purchasingCompany,r=a.addressManager.shipping.value.selectedAddress.value?.id===qp&&ed(s)||!e;return t(A,{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 ly=new Set(["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE"]);function vs({id:e="deliveryAddress",label:n,formattedAddress:a}){const{i18n:s}=v(),o=Ut(e),i=G().buyerIdentity.value?.purchasingCompany,r=Ni(),l=bo(),{hasViolations:d}=De(ly),{deliveryAddressErrors:c}=Va().value,p=a??l,u=()=>{o.value=!o.value},m=re(()=>[`single_choice_${e}`],[e]),y=n??s.translate("shipping.shipping_address_title"),C=t(dr,{formattedAddress:p}),f=t(U,{children:[t(wi,{name:`single_choice_list_${e}`,values:m,hideRadioControl:!0,children:t(rn,{value:`single_choice_${e}`,children:t(A,{children:[t(me,{children:i?.location.name}),t(me,{color:"subdued",children:p??s.translate("review.blocks.no_address")})]})})}),t(O,{when:r,children:t(j,{padding:"small-200 small-100 none small-100",children:t(Ri,{showIcon:!0})})})]}),S=g();function g(){return e!=="deliveryAddress"?null:d?t(nn,{message:s.translate("shipping_errors.shipping_method_not_available_generic.one")}):c.length>0?t(Ba,{errors:c,errorType:Ge.DeliveryError}):null}return t(de,{id:e,label:y,open:o.value,onToggle:u,primaryContent:C,error:S,children:f})}function cy(e){const n=e.current.value;return n==="customerAccount"||n==="businessCustomer"}function Ma({isAbovePaymentSummary:e=!1}={}){const{checkout:{identity:n}}=v(),a=G().buyerIdentity.value?.purchasingCompany;return cy(n)&&!e?t(Xs,{renderInlineSelector:!0}):a?t(dy,{purchasingCompany:a}):t(Xs,{})}function dy({purchasingCompany:e}){const{i18n:n}=v(),{shippingAddress:a,name:s}=e.location,{secondary:o}=Po({address:a??{},nameLinePosition:"inline",addressDisplayName:s}),i=a?o:n.translate("review.blocks.no_address");return t(vs,{id:"billingAddress",label:n.translate("company_location.location_title"),formattedAddress:i})}function Xs({renderInlineSelector:e=!1}={}){const n=ae(),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=pn(l,{displayName:!1}),{i18n:c,checkout:{identity:p}}=v(),{isMissingPhone:u}=Di({addressType:"billing"}),{isMissingFirstName:m}=Ti({addressType:"billing"}),y=u||m,C="billingAddress",f=Ut(C),S=qe("deliveryNext").value,g=$(!0),{hasViolations:b,violations:_,clearViolations:E}=We(qa),N=new Set([...u?["PAYMENTS_PHONE_NUMBER_REQUIRED"]:[],...m?td:[]]),T=Ei(b,_,N),{hasViolations:R}=We(nd);M(()=>{T&&(f.value=!0)},[T,f]),M(()=>
2{if(g.current){g.current=!1;return}E()},[E,a]),cs({isMissing:y,open:f});const F=uy(),L=w(()=>{const H=!f.value;return F?.(H),f.value=H,H},[F,f]);let x=T;py(p,R)?x=t(Qt,{errorType:Ge.PaymentError,tone:"critical",children:c.translate("payment.billing_must_match_shipping_notice")}):T&&!S&&(x=t(Qt,{errorType:Ge.PaymentError,tone:"critical",children:c.translate("address_management.invalid_billing_address_selected")}));const V=c.formatName(l?.firstName,l?.lastName,!0);let D,I;return!o||r?(D=V,I=d):s.sameAsShipping?D=c.translate("billing.same_as_shipping"):D=d,t(de,{id:C,label:c.translate("billing.billing_address_title"),open:f.value,onToggle:L,error:x,primaryContent:D,secondaryContent:I,renderChildrenWhenCollapsed:y,children:t(Vh,{renderInlineSelector:e})})}function ur(){const{checkout:e}=v(),{buyerIdentity:n}=G(),a=kl();return h(()=>{if(n.value?.purchasingCompany){const{address:s,type:o}=e.addressManager.billing.value.suggestedAddress.value;return!s||o!=="billing"&&o!=="billing-fact"&&o!=="shipping"?null:{option:o,address:s,sameAsShipping:!1}}return{option:"shipping",address:a.value,sameAsShipping:!0}})}function uy(){const{userEvents:e,source:n,checkout:a,shop:s}=v(),{billingAddress:o,billingAddressOption:i,shippingAddress:r}=ae(),l=ur(),d=w(u=>{u?i.value="custom":Pa(o.value,r.value)?i.value="shipping":i.value="custom"},[o,i,r]),c=w(u=>{const m=l.value;u?(m&&i.value===m.option&&(o.value=m.address),i.value="custom"):m&&Pa(o.value,m.address)?i.value=m.option:i.value="custom"},[o,i,l]),p=w(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 hy({identity:a.identity,switchBillingAddressOption:d,switchAndPrefillBillingAddressOption:c,recordShopPayInteraction:p})}function py(e,n){return e.current.value==="applePay"&&n}function hy({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 my(){const{checkout:{wallets:e}}=v(),{persistedPayPalSignal:n,inMemoryPayPalParts:{accountStatus:a}}=hn(),{clearForcedCheckoutLayout:s}=Ol(ad),o=w(()=>{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 yy extends tt{get displayContent(){const n=this.appContext.checkout.proposal.proposed.email.value,a=this.appContext.checkout.proposal.proposed.shippingAddress.fields.firstName.value;return{contact:pr(n,a)}}get logo(){const n=this.isEmbeddedPartner?"xsmall":"medium";return t(gn,{wallet:Ya.AmazonPay,size:n})}}class vy extends tt{get logo(){return t(gn,{wallet:"APPLE_PAY_BORDERLESS",size:"xsmall"})}}const Js="large-400";function gy(){return t(A,{"aria-busy":!0,alignItems:"center",display:"inline",justifyContent:"center",children:t(A,{borderRadius:"fullyRounded",overflow:"hidden",children:t(xa,{contentDisplay:"block",children:t(hr,{})})})})}function hr(){return t(xe,{blockSize:Js,inlineSize:Js})}const fy=cn({displayName:"VaultedContactAvatar",suspense:!1,load:()=>dn(()=>ln(()=>import("./7a21cd4e.BAUMPiSr.js").then(e=>e.V),__vite__mapDeps([111,1,2,3,4,5,6,7,8,9,10,11,112]))),renderLoading:()=>t(gy,{}),renderError:()=>t(hr,{}),useError:Ll("VaultedContactAvatar")});function gs(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(fy,{initials:i}):null}class Cy 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 gs(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 Sy 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(gn,{wallet:Ya.BuyWithPrime,size:"large"})}}class _y extends tt{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.value.buyerIdentity}get logo(){return gs(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 by extends tt{get logo(){const n=this.isEmbeddedPartner?"xxxsmall":"xxsmall";
2return t(gn,{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=Py({email:e,phone:n}),d=r?l:void 0;M(()=>{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:Zs(e)}):n?a.translate("account_management.phone_changed",{shopName:i,phone:Zs(n)}):null,[e,n,i,a,r]);return c?t(j,{padding:"small-200 none none none",children:t(Ha,{tone:"info",children:c})}):null}function Py({email:e,phone:n}){if(e)return"email";if(n)return"phone"}const Zs=e=>t(k,{type:"strong",children:e});class Ay extends tt{get displayContent(){return{contact:this.payPalEmail||this.email}}get logo(){const n=this.isEmbeddedPartner?"xxsmall":"small";return t(gn,{size:n,wallet:"PAYPAL_EXPRESS"})}get payPalEmail(){return sd(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 Ey({url:e,displayName:n}){return t(A,{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(k,{size:"medium",type:"strong",children:n})]})}class Ry 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=Yn({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(Ey,{url:o,displayName:s}):gs(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=Hn(this.email)||this.appContext.shop.contactInfoOptions.includes("PHONE")&&Hn(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=Hs(n,o.emailBlank),r=Xp(n,o.emailInvalid),l=i??r;if(l)return{field:"email",error:l}}else if(a&&s){const i=Hs(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 Iy extends tt{#e;#t;constructor(n,a){super(n,a),this.#e=(this.appContext.mobileCheckoutSdk.enabled||!!this.appContext.embed?.isCheckoutKit())&&jn(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 ky={amazonPay:yy,applePay:vy,buyWithPrime:Sy,businessCustomer:Cy,customerAccount:_y,googlePay:by,payPal:Ay,sdkCartHints:Ry,shopPay:Iy};function Oy(e,n){const a=e.checkout.identity.current.value;if(a==="guest")throw new Ly;return My(a,e,n)}function My(e,n,a){const s=ky[e];return new s(n,a)}class Ly extends Error{constructor(){super("Guest identity should never be instantiated. Guest identity has vaultedSections.contact=false, so VaultedContact never renders."),this.name="GuestIdentityError"}}const Dy=new od(0,0,100);function Ty(){const{shopPay:e,mobileCheckoutSdk:n,embed:a,router:s}=v(),o=s.currentUrl.value,r=!!a?.isFlagshipPartner?"small":"medium",l=(n.enabled||a?.isCheckoutKit())&&jn(e.app.config),d=Ko(o.search),c=Us({foregroundColor:_p}),p=Us({foregroundColor:Dy});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 wy(){const e=ja(),{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,m=jn(u),{replaceShopPayInHistory:y}=id(),C=w((F,L)=>{if(L.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:L.status});return}l?.clearAll();const x=new URL(window.location.href);x.pathname=c.resolve(rd).pathname,x.searchParams.set(ld,"1"),y(x.toString())},[i,a,l,y,c]),f=Ao(C),{label:S}=Bl(),g=Fl({clearPii:!0}),b=xl(),_=!!d.config.isReferral,E=w(()=>{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 F=e.block();e.waitForPendingNegotiations().then(()=>
2f()).catch(()=>{i.unstable_setRedirectingExternally(!1)}).finally(F)},[f,s,o,i,r,e]),N={onClick:b?()=>{}:E,label:n.translate("account_management.switch_account")},T={onClick:g,label:S},R=[];return p.showSwitchAccountAction&&R.push(N),p.showCheckoutAsGuestKebabLink&&!_&&R.push(T),!m&&p.showSwitchVaultedContactMenu?R:void 0}function Ny(){const e=v(),n=Ul(),a=zl(),s=Gl(),o=Wl(),i=my(),r=q({amazonPayCheckoutAsGuest:n,applePayCheckoutAsGuest:a,buyWithPrimeCheckoutAsGuest:s,googlePayCheckoutAsGuest:o,payPalCheckoutAsGuest:i});return h(()=>{const d=r.value;switch(e.checkout.identity.current.value){case"amazonPay":return d.amazonPayCheckoutAsGuest;case"applePay":return d.applePayCheckoutAsGuest;case"buyWithPrime":return d.buyWithPrimeCheckoutAsGuest;case"googlePay":return d.googlePayCheckoutAsGuest;case"payPal":return d.payPalCheckoutAsGuest;default:return}})}function 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=Ny().value,l=up(),d=Ty(),c=wy(),p=We(cd),u=Ao(w(()=>{e.persistence?.clearAll(),window.location.assign(o)},[e,o])),m=w(()=>{e.checkout.unstable_setRedirectingExternally(!0),u().catch(()=>{e.checkout.unstable_setRedirectingExternally(!1)})},[e.checkout,u]);return re(()=>Oy(a.appContext,{accountInfo:{logoutAndClearProposal:m,showLogoutLink:s},loadShopPayVerification:l.value,shopPayLogo:d,shopPayMoreOptions:c,checkoutAsGuest:r,violationsSubscriptionResult:p}),[a,m,s,l.value,d,c,r,p])}function vr(e){const n=$(void 0),a=e.email,s=e.phone,o=!!(a||s);M(()=>{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]),M(()=>{e.shouldMapServerViolationsToClient&&e.mapServerViolationsToClient()},[e])}function Vy({emailAddress:e,phone:n,logo:a,moreOptions:s,emailAlignment:o="end",children:i}){const{i18n:r,shop:l}=v(),d=ae(),c=l.hasFlagEnabled(yn)?n:void 0,p=e??(c?void 0:d.email.value),m=p||c||t(pe,{});return t(U,{children:[t(ct,{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 m=="string"?t(me,{children:[!p&&c&&t(U,{children:[t(k,{accessibilityVisibility:"exclusive",children:r.translate("contact.phone_label")})," "]}),t(Yl,{children:m})]}):m}),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(Vy,{...a,emailAlignment:n??(e==="stack"||e==="box"?"start":"end")});switch(e){case"stack":return t(A,{gap:"base",padding:"none none base none",children:i});case"box":return t(j,{padding:"base none",children:t(A,{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=Ut(e),a=w(()=>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:m,useSummaryInContent:y}=s.displayContent,C=s.email,f=s.displayPhone,S=s.hasError;if(M(()=>{s.hasError&&(n.value=!0)},[s.hasError,n]),p==="hidden"||s.shouldHide&&!r.current)return null;r.current=!0;const g=y?m:void 0,b=l?.embedder==="amazon"?{compact:g}:{primary:g};return p==="rollup"?t(de,{id:e,label:u??d.translate("contact.contact_method_title"),primaryContent:b.primary,compactContent:b.compact,open:n.value||S,onToggle:S||!c.expandable?void 0:a,icon:s.logo,children:c.children??null}):t(U,{children:[t(gr,{emailAddress:m,phone:f,logo:s.logo,moreOptions:s.moreOptions,layout:c.contentLayout,children:c.children??null}),s.showShopPayVerification?t(O,{when:i,children:t(pi,{email:C??"",open:o.value,showPopover:_=>{o.value=_}})}):null]})}
2function By(){return jl(new Set([...tn].filter(e=>e.startsWith("DELIVERY_COMPANY"))))}function Fy({loading:e,countryCode:n,phone:a}){const s=dd(),{i18n:o,checkout:i}=v(),r=i.configuration.addressSettings.nonBillingAddressSettings.value,l=re(()=>r.isRequired("phone",{countryCode:n}),[n,r]),{validatePhoneNumber:d,isPhoneNumberUtilLoaded:c}=is(),p=w(m=>{const y=Hn(m);if(l&&!y)return o.translate("field_errors.phone_blank");if(y&&!d(m??"",n))return o.translate("field_errors.shipping_line_phone_invalid")},[l,d,n,o]),u=$(!1);return M(()=>{if(u.current||!c||e)return;const m=p(a);s.value=m,u.current=!0},[l,c,e,a,s,p]),re(()=>({errorSignal:s,validatePhoneField:p,isPhoneRequired:l}),[s,l,p])}const Cr=new Set(Xa);function Sr(){const{shopPay:e,checkout:n,source:a,observability:s}=v(),{deliveryMethodsAddressErrors:o}=ut(),i=$p(),{shippingAddress:r}=ae(),l=r.value,d=n.configuration.addressSettings.nonBillingAddressSettings.value,c=a.type==="simulated",p=ks(l.countryCode,void 0,d),m=n.addressManager.shipping.value.selectedAddress.value?.address.countryCode,y=ks(m??l.countryCode,void 0,d,null),{details:C}=ud(m),f=!m||C!==void 0&&!C.isFallback,{clearViolations:S}=De(Cr),g=$(!0);return M(()=>{if(g.current){g.current=!1;return}S()},[S,l]),Rp("shippingAddress",async()=>{const b=async(E,N)=>{if(!await n.addressManager.shipping.value.createAddress(N)){const R=Object.values(o).some(F=>F.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,N=n.proposal.negotiated.fields.buyerIdentity.value?.customerProfile;if(E&&N?.__typename==="CustomerProfile"&&N.shippingAddresses.some(R=>R.id===E.id)){const R=D=>{Nt(()=>{for(const[I,H]of D)o[I].value=H})},F=()=>b("intercept_shipping_address_vault_ca",{address:E.address,selectAddress:!0,addressErrorsOverride:o});if(!f||E.address.countryCode!==m)return F();const L=y(E.address,"shipping");if(L.size===0)return F();const x=p(l,"shipping"),V=D=>{try{s.log("shop_pay_ca_vault_address_invalid","Selected customer-account address fails validation before Shop Pay vault-save",{invalidFields:Array.from(L.keys()).sort().join(","),proposalInvalidFields:Array.from(x.keys()).sort().join(","),proposalDiverges:!Aa(l,E.address),outcome:D})}catch{}};if(x.size===0){const D=e.user.addresses.value.find(H=>Aa(H.address,l));if(D&&await n.addressManager.shipping.value.selectAddress(D.id))return V("selected_matching_vaulted"),{success:!0};const I=await b("intercept_shipping_address_vault_ca_proposal",{address:l,selectAddress:!0,addressErrorsOverride:o});return V(I.success?"vaulted_proposal":"vault_proposal_rejected"),I}return V("blocked_client_side"),zs({addressType:"shipping",validate:()=>x,setErrors:R})}}if(e.session.selectedShippingAddress.value||e.user.addresses.value.length)return{success:!0};const _=zs({addressType:"shipping",validate:()=>p(l,"shipping"),setErrors:E=>{Nt(()=>{for(const[N,T]of E)o[N].value=T})}});return _.success?e.user.flow.peek()==="authenticated_user"?b("intercept_shipping_address_add_new",{address:l,addressErrorsOverride:o}):{success:!0}:_}),null}const fs=()=>{const{shopPay:e}=v(),{geolocation:n}=Kl(),{shippingAddress:a}=ae();return h(()=>{const s=a.value;return e.signup.phoneCountryCode.value??s.countryCode??n.country.code})},xy=()=>{const{shopPay:e,checkout:n}=v(),a=n.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:s}=ae(),o=e.signup.phoneNumber.value,i=e.signup.phoneError.value,r=s.fields.countryCode.value,l=s.fields.phone.value,{deliveryMethodsAddressErrors:d}=ut(),c=d.phone.value,{setAddressError:p}=ql(d),u=fs(),{isPhoneNumberUtilLoaded:m}=is(),y=$(!1),C=Fi(u.value,o,!0);M(function(){l&&!o&&e.signup.unstable_setPhoneNumber(l);const S=e.signup.phoneCountryCode.value;r&&!S&&e.signup.unstable_setPhoneCountryCode(r)},[]),M(()=>{if(!y.current&&m&&o){const{prefix:f}=C;o.startsWith(f)||e.signup.unstable_setPhoneNumber(`${f}${o}`),y.current=!0}},[m]),hd(async({parts:f,reason:S})=>{if(S!=="negotiation")return{behavior:"allow"};const{shippingAddress:g}=f;let b=e.signup.phoneNumber.peek();(!b||b===C.prefix)&&(b=void 0);const _=g.peek().phone;return{behavior:"allow",perform(){b!==_&&a.isVisible("phone",{countryCode:u.value,useMerchantSettings:!0})&&(g.fields.phone.value=b)}}}),M(function(){i!==c&&p("phone",i)},[i,c,p])},Hy=()=>{const{i18n:e,shopPay:n}=v(),{isPhoneNumberUtilLoaded:a,validatePhoneNumber:s}=is(),o=fs(),i=w(r=>{if(!Hn(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 pd(n.signup.phoneNumberRawSignal,n.signup.phoneErrorRawSignal,i)};function _r({padding:e}){const{i18n:n,shopPay:a}=v(),{shopPayMobilePhoneInputShownSignal:s}=ut(),o=fs(),i=!!a.user.phoneNumber.value,r=Hy();zn(()=>(s.value=!0,()=>{s.value=!1}),[s]);const l=$(o.peek());xy();const d=w(c=>{a.signup.unstable_setPhoneCountryCode(c)},[a.signup]);return t(A,{gap:"base",padding:e,children:[t(Qp,{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 Qs="shipping";function br({filteredFields:e,additionalFieldGroups:n,children:a,settings:s}){const{deliveryMethodsAddressErrors:o}=ut(),{shippingAddress:i}
2=ae(),r=qo(),{shouldGateCrossBorder:l,crossBorderGate:d}=xi(),c=(se,X,P)=>{l(se)?d(X,{onCancel:P}):X()},p=v(),{checkout:u,i18n:m,userEvents:y,source:C,shop:f}=p,{configuration:S}=u,g=S.isAddressDelegationEnabled,{violations:b}=De(tn),_=i.fields?.countryCode.value,E=Eo(_),N=$(!1);M(()=>{if(!g||N.current||b.size===0||(N.current=!0,Object.values(o).some(P=>{const z=P.value;return z&&typeof z=="object"&&z.origin==="client"&&z.type==="inline-validation"})))return;const X=E(Qs,Array.from(b));Nt(()=>{for(const[P,z]of X)o[P]?.value===void 0&&(o[P].value=z)})},[g,b,E,o]);const T=S.addressSettings.nonBillingAddressSettings.value,R=i.value,F=$o(),{hasViolations:L}=De(Cr),x=S.defaultPhoneNumber.value;T.isRequired("phone",{countryCode:R.countryCode,useMerchantSettings:!0})&&!R.phone&&x&&(i.value={...R,phone:x});const D=q(!!(e&&e.length>0)),I=S.trackAddressAutoComplete?()=>{y.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...je(C,u,f),action:"address_autocomplete"}})}:void 0,H=t(Tp,{id:"shippingAddressForm",addressType:Qs,address:i,countries:r,settings:s,addressErrors:o,additionalFieldGroups:n,showSavedAddressSelector:!1,onAddressAutoComplete:I,onBeforeCountryChange:c,filteredFields:e,children:a}),K=t(O,{when:D,fallback:H,children:t(j,{background:"base",borderRadius:"base",className:md({colorLayer:"controlSelected"}),paddingInline:"base",paddingBlockStart:"large-100",paddingBlockEnd:"base",children:t(A,{direction:"block",gap:"base",children:[t(j,{padding:"none",children:[t(me,{children:[R.firstName," ",R.lastName]}),t(Zp,{address:R,hiddenFields:["firstName","lastName","phone"],textColor:"subdued"})]}),H]})})});return t(rs,{impressionType:"delivery_address",impressionFeatures:[],children:[Uy(p)&&t(Sr,{}),L&&S.visibility.showInvalidDeliveryAddressBanner.value&&t(j,{children:[t(hi,{}),t(xe,{blockSize:"base"})]}),t(O,{when:F,children:t(j,{children:[t(Ha,{tone:"info",children:m.translate("address_management.draft_order_delivery_address_reminder")}),t(xe,{blockSize:"base"})]})}),K,t(O,{when:S.visibility.showStandalonePhoneField,children:t(_r,{padding:"base none none none"})})]})}function Uy({checkout:e}){return e.identity.current.value==="shopPay"}const Dn=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.validationStatus==="VALID"?"vaulted":"write"};function zy(e,n){const[a,s]=_t(Dn(e)),o=$(null),i=he(!1);a==="vaulted"&&Dn(e)!==a&&s("write"),a==="unknown"&&Dn(e)!==a&&s(Dn(e));const r=w(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=w(()=>{i.value=!0,s("write"),n.value&&o.current&&(i.value=!1,o.current.focus())},[i,n]);return{status:a,inputRef:r,focus:l}}function Cs(){const e=$l(),{paymentLines:n}=ae(),{walletUsedForSubmissionSignal:a}=hn();return h(()=>e.value||rh({paymentLines:n.value,walletUsedForSubmission:a.value}))}function Gy({countryCode:e,addressType:n,addressViolations:a}){const{shop:s,checkout:{identity:o}}=v(),i=s.hasFlagEnabled(yd),r=he(void 0),{violations:l}=Xl(a),d=Eo(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),m=d(n,u),y=Jl({addressErrors:m});y&&(r.value=y)}return{missingAddressFieldSignal:r,hasResolvedMissingAddressFieldSignal:c}}function Wy(){const{i18n:e}=v(),{hasViolations:n}=De(Ja),{hasViolations:a}=De(Jo),{hasError:s,error:o}=Gn(Xo),i=_o(o?{type:"payment",code:o}:void 0);return s&&i?t(Qt,{tone:"critical",errorType:Ge.DeliveryError,children:i}):n?t(nn,{message:e.translate("shipping_errors.shipping_method_not_available_generic.one")}):a?t(nn,{message:e.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions")}):null}function Yy(e,n){return e.isAddressDelegationEnabled&&n!=="shopPay"&&!vd(n)}function jy({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 Ky({checkout:e,i18n:n},a){return e.configuration.visibility.showInvalidDeliveryAddressBanner.value?t(hi,{}):a?t(nn,{message:n.translate("shipping_errors.unavailable_address_country")}):null}
2const qy=new Set([...tn,...Ja,...Xa,...gd]),$y=["phone","zoneCode","countryCode","firstName","lastName","name"],Xy=["phone","zoneCode","countryCode","firstName","lastName","name","coordinates","oneTimeUse"],Jy=300;function Tn(e){return e==="pending"||e==="pendingCollapsed"}function _a(e){return e==="collapsed"||e==="pendingCollapsed"}function Pr({summary:e,forceOpen:n,initiallyOpen:a=!1,renderRollup:s}={}){const{shippingAddress:o}=ae(),{allViolations:i}=G(),l=Qy()??e,d=q(Wy()),c=$o(),{embed:p,i18n:u,shopPay:m,observability:y,userEvents:C,checkout:f,source:S,shop:g}=v(),b=p?.client?.addressErrors.value.includes(fd.AddressEmpty)??!1,_=qo(),{installments:E}=m,N=f.identity.current.value==="shopPay",{isMissingPhone:T}=Di(),{isMissingFirstName:R}=Ti(),F=T||R,L=p?.embedder==="google",x=f.configuration.addressSettings.nonBillingAddressSettings.value,V=h(()=>L&&x.isVisible("phone",{countryCode:o.value?.countryCode})),{formattedNumber:D}=Fi(o.value?.countryCode??"",V.value?o.value?.phone:void 0),I=h(()=>Yy(f.configuration,f.identity.current.value)),{deliveryMethodsAddressErrors:H}=ut(),K=h(()=>Object.values(H).some(Me=>Me.value!==void 0)),se=h(()=>!!(o.value?.countryCode&&!_?.some(Me=>Me.value===o.value.countryCode))),X=Ky({checkout:f,i18n:u},se.value),P=h(()=>Zy(o.value,I.value?Xy:$y)),[z,W]=_t([]),{availableDeliveryAddresses:Y,mustSelectProvidedAddress:oe}=f.proposal.negotiated.fields,Z=h(()=>Y.value??[]),Q=h(()=>oe.value??!1),ee=ne("Checkout::DeliveryAddress::RenderBefore"),ge=ne("purchase.checkout.delivery-address.render-after"),le=Un([...ee,...ge],{lazyReveal:!0}),ie=Zl(),fe=h(()=>Z.value?.length&&!!Z.value.find(Me=>Aa(o.value,Me.address))),Ee=h(()=>!!(fe.value&&Q.value)),Ce=Ro(),ce=Ke(),Se=Za(Ua),_e=h(()=>ce.value&&Se.uiStateSignal.value?.status==="loading"),be=h(()=>Se.uiStateSignal.value?.status==="filled"),J=h(()=>!I.value||!P.value&&be.value),ye="deliveryAddress",B=Ut(ye,St(()=>a||(le.value||Ee.value)&&J.value)),te=zy(Ce,B),Re=$(null),Pe=$(null),$e=$(!1),ue=he("idle"),nt=Tn(ue.value),Ve=_a(ue.value),He=he(!1),Ue=ls(Zo([...ee,...ge],"uiExtension").map(en),w(()=>{J.value&&(B.value=!0)},[J,B]));M(()=>{Ue&&J.value&&(He.value=!0)},[Ue,He,J.value]);const Oe=h(()=>I.value&&He.value);M(()=>{J.value&&(le.value||Ue)&&(B.value=!0)},[le.value,J.value,Ue,B]),zn(()=>{ie.current&&(I.value&&P.value||I.value&&Ve||fe.value===!1&&(B.value=!0))},[fe.value,B,ie,I.value,P.value,Ve]),cs({isMissing:F,open:B});const ht=Va(),Xe=ht.value.deliveryAddressErrors,Te=h(()=>ht.value.deliveryAddressErrors.length>0),at=Cs().value||f.identity.current.value==="payPal",{hasViolations:Gt,violations:Be,clearViolations:ze}=De(qy),{missingAddressFieldSignal:we,hasResolvedMissingAddressFieldSignal:Et}=Gy({countryCode:o.value?.countryCode,addressType:"shipping",addressViolations:tn}),Je=h(()=>!!we.value&&!B.value),Cn=new Set([...T?Cd:[],...R?Sd:[],...Je.value?tn:[]]),Rt=Ei(Gt,Be,Cn),{hasError:Sn,clearError:It}=Gn(Xo),_n=E.agreementError.value===Ql.InvalidShippingAddress,sa=qe("deliveryNext"),Wt=h(()=>!ce.value||sa.value);ke(()=>{_e.value&&St(()=>{It(),E.unstable_setAgreementError(null)})});const bn=w(()=>{ze(),It(),E.unstable_setAgreementError(null)},[ze,It,E]),mt=pn(o.value,{hiddenFields:["phone"],displayName:!1}),oa=u.formatName(o.value?.firstName,o.value?.lastName,!0),kt=o.value?.firstName&&o.value?.lastName?oa:void 0,yt=Po({address:o.value??{}}),Yt=t(O,{when:P,fallback:t(A,{children:[mt,V.value&&D&&t(k,{children:D})]}),children:t(k,{tone:"critical",children:u.translate("shipping.add_shipping_address")})}),Pn=P.value?t(k,{tone:b?"critical":void 0,children:u.translate("shipping.add_shipping_address")}):kt,An=P.value?void 0:t(A,{children:[yt.primary&&t(k,{children:yt.primary}),yt.secondary&&t(k,{children:yt.secondary}),V.value&&D&&t(k,{children:D})]}),jt=t(O,{when:()=>P.value||!o.value?.postalCode,fallback:t(U,{children:[t(k,{children:u.translate("shipping.delivery_to")}),t(k,{type:"strong",children:kt})]}),children:t(k,{tone:"accent",decoration:"underline",children:u.translate("shipping.add_new_delivery_address")})}),En=h(()=>o.value?.postalCode),Kt=t(O,{when:()=>P.value||!En.value,fallback:t(A,{children:[t(k,{type:"strong",children:En}),V.value&&D&&t(k,{children:D})]}),children:()=>""}),qt=(()=>
2{if(l)return{primary:l};switch(p?.embedder){case"amazon":return{compact:t(A,{direction:"inline",gap:"small-400",alignItems:"center",children:[jt,Kt]})};case"google":return{primary:Pn,secondary:An};default:return{primary:kt,secondary:Yt}}})(),st=h(()=>ec(i.value??[])&&!_e.value),Ur=q(Rt&&!st.value||Sn||_n),ia=h(()=>Wt.value?null:Ur.value&&X&&!_e.value?{type:"invalid-address-banner",element:X}:d.value&&!st.value&&!_e.value?{type:"default-vaulted-delivery-address-error-banner",element:d.value}:Te.value&&!at&&!st.value?{type:"validation-errors-banner",element:t(Ba,{errors:Xe,errorType:Ge.DeliveryError})}:st.value?{type:"unavailable-in-buyer-location-banner",element:null}:null),bs=t(ev,{errorSignal:ia}),zr=h(()=>!!ia.value||at&&Te.value),Gr=q(Rt),ra=q(Sn),Wr=q(n),Yr=q(Ue),Rn=h(()=>K.value||Gr.value||Te.value),la=h(()=>!!Wr.value||le.value||Yr.value&&J.value||Oe.value),Ot=h(()=>I.value&&Tn(ue.value)&&_a(ue.value)&&!la.value&&!ra.value&&!st.value),jr=h(()=>Et.value&&we.value===void 0),ca=h(()=>Rn.value&&!Ot.value),Ps=h(()=>I.value&&be.value&&!ca.value),In=h(()=>Ps.value&&_a(ue.value)),Mt=h(()=>la.value||ra.value||jr.value||!Ot.value&&zr.value),Kr=h(()=>Rn.value&&!(I.value&&Tn(ue.value))||st.value||la.value||ra.value);$e.current=Kr.value;const $t=h(()=>{if(I.value){if(P.value)return!1;if(In.value)return Mt.value;if(K.value&&!Ot.value&&!(Et.value&&we.value))return!0}return B.value||Mt.value}),ot=w(()=>{Pe.current&&(clearTimeout(Pe.current),Pe.current=null)},[]),it=w(()=>{ot(),ue.value="idle"},[ot,ue]),da=w(()=>{if(ot(),$e.current){ue.value="collapsed",B.value=!0;return}ue.value="collapsed",B.value=!1},[ot,ue,B]),As=w(()=>{ot(),Pe.current=setTimeout(()=>{Pe.current=null,!$e.current&&(ue.value="pendingCollapsed",B.value=!1)},Jy)},[ot,ue,B]),vt=w(()=>{it(),B.value=!0},[it,B]);M(()=>ot,[ot]),M(()=>{I.value&&Rn.value&&!nt&&it()},[nt,Rn.value,I.value,it]);const ua=w(async()=>{if(!I.value||!p?.client||Tn(ue.value))return;W([]),ue.value="pending";const Me=$t.value;Oe.value||As();const Xt=performance.now();try{const rt=await p.client.addressChangeStart("shipping").then(ve=>({response:ve,error:void 0})).catch(ve=>({response:void 0,error:ve})),Ne=performance.now()-Xt;if(rt.error){const{error:ve}=rt;if(ve instanceof _d){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"))}]),vt();return}const Is=ve instanceof Error?ve.message:String(ve);if(ve instanceof bd&&ve.isUserCancelledError){y.log("third_party_delivery_address_cancelled","User cancelled address selection",{duration:Ne}),it(),B.value=Me,Re.current?.focus();return}ve instanceof Pd?(y.log("third_party_delivery_address_protocol_error","Address change failed due to protocol/schema violation",{duration:Ne,technicalError:Is}),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:Is}),W([{code:"GENERAL_ERROR"}]),vt();return}const{response:Ze}=rt;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"}]),vt();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}),vt();return}if(Ze?.cart){Nt(()=>{for(const ve of Object.values(H))ve.value=void 0;ze()});try{await p.client.applyCart(Ze.cart),Se.dispatch("addressReplaced"),Oe.value?it():da(),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()}
2),W([{code:"GENERAL_ERROR"}]),vt()}}else Oe.value?it():da()}catch(rt){const Ne=performance.now()-Xt;y.log("third_party_delivery_address_error","Error delegating address change to embedder.",{error:rt instanceof Error?rt.message:String(rt),duration:Ne}),W([{code:"GENERAL_ERROR"}]),vt()}},[Oe,I,p,y,W,u,H,ue,Se,ze,$t,As,vt,it,B,da]),qr=w(async()=>{if(Oe.value)return;if(I.value){if(B.value)return;await ua();return}const Me=!B.value;jy({userEvents:C,source:S,checkout:f,shop:g},Me),B.value=Me},[Oe,C,S,f,g,B,ua,I]);M(()=>{if(I.value&&Ve&&!ca.value&&!Mt.value){B.value=!1;return}$t.value?B.value=!0:In.value&&!Mt.value&&(B.value=!1)},[B,I.value,Ve,ca.value,$t.value,In.value,Mt.value]);const $r=ee.length===0&&ge.length===0,Xr=Z.value.length===1&&Q.value&&$r,Jr=c.value,Zr=!Wt.value&&!_e.value&&!Ot.value&&Rt&&!(I.value&&P.value),Qr=I.value&&!Ot.value&&K.value&&!P.value,el=Zr||Qr,tl=(()=>{if(I.value){const{firstName:Me,lastName:Xt}=o.value,Ne=u.formatName(Me,Xt,!0);return t(A,{children:[Me&&Xt&&t(k,{children:Ne}),t(O,{when:P,fallback:t(k,{color:"subdued",children:mt}),children:t(k,{tone:"critical",children:u.translate("address_management.address_form.add_address")})})]})}return l??mt})(),nl=P.value?u.translate("shipping.add_shipping_address"):void 0,pa=Ce&&!$t.value?t(eh,{vatNumber:Ce.taxId.value,onAdd:()=>{B.value=!0,te.focus()}}):void 0,ha=Je.value?t(j,{padding:"none base base base",children:t(br,{filteredFields:we.value?[we.value]:void 0})}):void 0,al=ha&&pa?t(A,{direction:"block",gap:"base",children:[ha,pa]}):ha??pa,sl=t(Ha,{tone:"info",children:u.translate("address_management.draft_order_delivery_address_reminder")}),ol=In.value&&!Mt.value||Ot.value?null:c.value?t(U,{children:[bs,sl]}):ia.value?bs:null,il=Je.value?{}:{primaryContent:qt.primary,secondaryContent:qt.secondary,compactContent:qt.compact,inlinePrimaryContent:Pn,inlineSecondaryContent:An,compactPrimaryContent:jt,compactSecondaryContent:Kt,summary:tl},Es={buttonRef:Re,open:B.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||(Ps.value?!1:el),renderChildrenWhenCollapsed:!0,icon:t(Ye,{id:"deliveryAddress-truckIcon",type:"truck",size:"fill"})},Rs=t(Bh,{embedderErrors:z,onDismissEmbedderErrors:()=>W([]),showMissingAddressField:Je.value,onAddressDelegation:ua,onFirstNamePersisted:bn,vatIdFieldMode:te});return t(U,{children:[N&&t(Sr,{}),s?s(Es,Rs):t(de,{...Es,children:Rs})]})}function Zy(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 Qy(){const e=G().buyerIdentity.value?.purchasingCompany,n=bo();return e?t(dr,{formattedAddress:n}):void 0}const wn=({errorBanner:e})=>t(j,{paddingBlock:"small-500",children:e}),ev=({errorSignal:e})=>{const n=e.value;if(!n)return null;const a=n.type;switch(a){case"invalid-address-banner":return t(wn,{errorBanner:n.element});case"default-vaulted-delivery-address-error-banner":return t(wn,{errorBanner:n.element});case"unavailable-in-buyer-location-banner":return t(wn,{errorBanner:t(mi,{})});case"validation-errors-banner":return t(wn,{errorBanner:n.element});default:dl(a)}};function tv(){const{formattedAddress:e,address:{phone:n,countryCode:a}}=tc(["company"]),o=!Da().value,{errorSignal:i}=Fy({loading:o,phone:n,countryCode:a}),r=!!By()?.length,l=!!nc()?.length,d=!!i.value,c=!!(l||r||d);return t(Pr,{summary:o?t(pe,{}):t(A,{direction:"inline",children:[c&&t(U,{children:[t(Ye,{tone:"critical",type:"alert-circle"}),t(xe,{display:"inline",inlineSize:"small-400"})]}),e]}),forceOpen:c})}function nv(){const e=G().buyerIdentity,n=ac(),a=Io();return h(()=>!!e.value?.purchasingCompany&&(!n.value||a.value))}function Ss(e){const{checkout:{identity:n}}=v(),a=nv();return n.current.value==="amazonPay"||n.current.value==="buyWithPrime"?t(tv,{}):a.value?t(vs,{}):t(Pr,{...e})}function _s(){const{i18n:e,router:n}=v(),a=G().buyerIdentity.value?.purchasingCompany,s=Ni(),o=Io(),i="deliveryAddress",r=h(()=>Qn(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(ct,{gridTemplateColumns:"@media (inline-size >= small) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",gap:"@media (inline-size >= small) base, none",alignItems:"@media (inline-size >= small) center, ''",alignContent:"@media (inline-size >= small) center, ''",justifyContent:"@media (inline-size >= small) start, ''",justifyItems:"@media (inline-size >= small) start, ''",children:[t(Fe,{id:i,level:1,autoFocus:r.value,children:e.translate("contact.ship_to_company",{companyName:a.location.name})}),t(O,{when:s,children:t(Ri,{})})]})}function av(){const{i18n:e}=v(),{eligibility:n,redeemableBalance:a,messages:s,isDigitalGoodsRedemptionAllowed:o}=lr(),i=(n.eligible||o)&&a,r=s.length>0?t(A,{gap:"small-200",children:s}):void 0;return!i&&!r?null:i?t(sv,{redeemableBalance:a,messages:r}):t(de,{id:"cashRedemption",open:!1,label:e.translate("order_summary.shop_cash_title"),error:r})}function sv({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(k,{fonts:"primary",tone:"accent",children:s})})}function Ar({onShowPickupLocations:e}={}){const{i18n:n}=v(),a=Ae(),[s]=ko(),o=s.includes("PICK_UP"),{value:i}=za().value,{value:r}=Oo().value,l=!!(i||r),d=Qd({mode:"localPickup"}),c=h(()=>d.value.merchandiseLines),p=h(()=>d.value.allowAlternativeAction),u=h(()=>d.value.merchandiseLines.length>0),m=et(),y=l&&!u.value;if(!o||!a.value.delivery)return null;const C=u.value&&l;return t(ts,{name:"local-pickup-adjacent",variant:"adjacent",children:t(A,{gap:u.value?"base":"small-400",paddingBlockEnd:C?"base":void 0,children:[t(O,{when:m,children:t(j,{paddingBlockStart:"small-400",paddingBlockEnd:y?"small-400":void 0,children:t(Fe,{level:2,children:n.translate("delivery_options.pickup")})})}),t(O,{when:u,children:t(eu,{bannerType:"pickup",merchandiseLines:c,allowAlternativeAction:p})}),t(ov,{hasNoDeliveryMethods:l,onShowPickupLocations:e})]})})}function ov({hasNoDeliveryMethods:e,onShowPickupLocations:n}){const{i18n:a}=v(),s=et(),o=Qa(),{progressing:i}=dt(),r=qe("deliveryNext").value,l=Ke(),{isOnlyCountryAvailable:d}=yi(),c=he(!1),p=h(()=>o.value?.methods??[]),u=h(()=>{const _=o.value;return _&&Qo(_)}),m=h(()=>p.value.length>0&&tu(p.value)),y=q(We(Ad).hasViolations),C=nu({allLocationsFarAway:m,selectedPickupOptionNoLongerAvailable:y}),f=Mo({methods:p.value,selectedDeliveryMethodHandle:u.value?.handle}),S=h(()=>sc(o.value?.targetMerchandiseLines)),g=h(()=>au(p.value,d,S.value,a,{selectedDeliveryMethodHandle:u.value?.handle,allLocationsFarAway:m.value})),b=()=>{f(d?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain"),n?n():c.value=!0};return e?null:t(U,{children:[t(O,{when:C,children:t(su,{itemCount:S.value,methods:p.value,onChangeLocationClick:b})}),t(A,{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(k,{color:"subdued",children:g}),t(vi,{onClick:b})]}),n?null:t(gi,{methods:o.value?.methods,type:o.value?.type,open:c.value,onClose:()=>{c.value=!1}})]})}function iv(e){const n=$(),a=h(()=>{const o=e.value?e.value.methods.length-1:void 0;return o!==void 0&&(n.current=o),o}),s=h(()=>a.value??n.current);return{currentAdditionalLocations:a,additionalLocationsCount:s}}const eo=20,to={isLocationFormVisible:!1};function Er({initiallyOpen:e=!1,renderRollup:n}){const{i18n:a,shop:s}=v(),{deliveryNext:o}=G(),{progressing:i}=dt(),r=qe("deliveryNext"),l=Ke(),{value:d}=za().value,{value:c}=Oo().value,p=!!(d||c),u=Qa(),m=h(()=>Ed(o.value)??[]),y=h(()=>s.shipPickupInOneOrderEnabled?u.value&&Qo(u.value):m.value[0]),C=h(()=>y.value?.handle??""),f=h(()=>({handle:C.value})),S=fi(),{isOnlyCountryAvailable:g}=yi(),b=pn(y.value?.pickupLocation?.address,{hiddenFields:["postalCode","countryCode","phone"]}),_=ne("Checkout::PickupLocations::RenderBefore"),E=ne("Checkout::PickupLocations::RenderAfter"),N=ne("purchase.checkout.pickup-location-option-item.render-after"),T=_.length>0?t(Ie,{customizations:_,options:to}):void 0,R=E.length>0?t(Ie,{customizations:E,options:to}):void 0,F=ou(),L=Mo({methods:m.value||[],selectedDeliveryMethodHandle:y.value?.handle}),[x,V]=_t(!1),D=he(e),I=he(!1),H=ce=>{V(!0),I.value=ce??!1},K=()=>{V(!1),I.value=!1},se=()=>{L(g?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},{currentAdditionalLocations:X,additionalLocationsCount:P}=iv(u),z=h(()=>!!X.value||l.value&&r.value&&P.value!==0);let W,Y,oe,Z,Q;const ee=F.value?t(A,{gap:"small-200",children:t(iu,{variant:"banner"})}):void 0;if(l.value&&!i.value&&r.value)W=t(pe,{}),Y=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,J=be&&!g?ru(a,be):void 0,ye=ce===0?a.translate("shipping.free_rate_label"):a.formatCurrency(ce,{currency:Se}),B=y.value.pickupLocation.type==="PickupInStoreLocation"&&y.value.pickupLocation.instructions.trim();W=t(U,{children:[_e,t(th,{}),ye]}),Y=b||void 0;const te=J||B?t(cu,{distanceLabel:J,instructions:B||void 0}):null,Re=N.length>0?t(Ie,{customizations:N,options:f.value}):null;te&&Re?oe=t(A,{gap:"small-400",children:[te,Re]}):oe=te??Re??void 0,Z=T?t(A,{gap:"small-200",children:T}):void 0,Q=ee||R?t(A,{gap:"small-200",children:[ee,R]}):void 0}const ge=!r.value&&p===!0,le=p?t(vi,{onClick:()=>{H(),se()},commandFor:lu}):void 0,ie=z.value?t(rv,{locationCount:P.value,onShowModal:H,onTrackAnalytics:()=>L("checkout_pickup_buyer_reveal_more")}):void 0,fe=n?{id:"pickupLocations",label:a.translate("delivery_options.pickup"),open:D.value,disabled:ge||N.length>0,onToggle:()=>{D.value=!D.value},primaryContent:W,secondaryContent:Y,primaryPersistentContent:Z,secondaryPersistentContent:R}:{id:"pickupLocations",label:a.translate("local_pickup.title"),open:ge,primaryContent:W,secondaryContent:Y,tertiaryContent:oe,primaryPersistentContent:Z,secondaryPersistentContent:Q,primaryAction:le,secondaryActions:ie},Ee=t(Fh,{onShowModal:H}),Ce=n?t(A,{gap:"base",children:[t(Vi.Provider,{value:!1,children:t(Ar,{onShowPickupLocations:()=>H()})}),le,Ee,ie]}):S&&Ee;return t(U,{children:[n?n(fe,Ce):t(de,{...fe,children:Ce}),t(gi,{methods:u.value?.methods,type:u.value?.type,open:x,onClose:K,addressFocus:I})]})}function rv({locationCount:e,onShowModal:n,onTrackAnalytics:a}){const{progressing:s}=dt(),o=qe("deliveryNext"),i=za(),r=h(()=>s.value||!o.value&&!i.value.loading);return t(O,{when:r,fallback:t(pe,{}),children:t(lv,{locationCount:e,onShowModal:n,onTrackAnalytics:a})})}function lv({locationCount:e,onShowModal:n,onTrackAnalytics:a}){const{i18n:s}=v();return e?t(Wn,{variant:"plain",textDecoration:"none",inlineAlignment:"start",onClick:()=>{n(),a()},children:t(A,{direction:"inline",gap:"small-400",alignItems:"center",children:t(k,{type:"strong",children:e>eo?s.translate("local_pickup.toggle_multiple_locations",{count:String(eo)}):s.translate("local_pickup.toggle_more_locations",{count:e})})})}):null}function no({destination:e}){const n=he(!1),a=he(),s=(o,i)=>(a.value={props:o,content:i},null);return t(U,{children:[e==="deliveryAddress"?t(Ss,{initiallyOpen:n.value,renderRollup:s}):t(Er,{initiallyOpen:n.value,renderRollup:s}),t(cv,{rollup:a,switched:n})]})}function cv({rollup:e,switched:n}){const a=e.value;return a?t(de,{...a.props,children:t(A,{gap:"base",children:[t(dv,{switched:n}),a.content]}
2)}):null}function dv({switched:e}){const n=Pt();if(!n)return null;const a=s=>{e.value=!0,n.select(s)};return t(du,{options:n.options,selected:n.selected,select:a,showChangedBanner:!1})}const ao=new Set(["SHIPPING","PICK_UP"]);function uv(e,n=[],a=[]){return e==="vaulted"&&n.every(({id:s})=>ao.has(s))&&a.length===1&&ao.has(a[0])}function fn(){const{checkout:e,shop:n}=v(),a=q(Pt()),s=n.hasFlagEnabled(ei);return h(()=>a.value?.variant==="next"&&(!s||pv(e.sections.availableToRender.value))&&uv(e.configuration.deliveryMethodSelectorPlacement,a.value?.options.value,a.value?.selected.value))}function pv(e){return e.filter(n=>n==="deliveryAddress"||n==="localPickupOptions").length===1}const hv=()=>{const{i18n:e}=v(),n=he(!0),{value:a}=G().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 mv(){const{i18n:e,checkout:n}=v(),a=ae().shippingAddress.value,{deliveryNext:{value:s},buyerIdentity:{value:o}}=G(),r=(n.proposal.facts.delivery??[])[0],l=o?.purchasingCompany,d=l?.location.name,c=!!l&&!!d,p=s?.status==="unavailable"?a:r?.deliveryAddress,u=pn(p??void 0,{countryFormat:"explicit",displayName:c}),m=e.formatName(p?.firstName,p?.lastName,!0);if(r?.pickupAddress)return t(yv,{address:r.pickupAddress??void 0});const y=p?m:e.translate("review.blocks.no_address"),C=c?d:y,f=c?e.translate("review.blocks.no_address"):void 0,S=p?u:f;return t(de,{id:"orderEditDeliveryAddress",label:e.translate("review.blocks.shipping_address_title"),primaryContent:C,secondaryContent:S})}function yv({address:e}){const{i18n:n}=v(),a=pn(e,{hiddenFields:["postalCode","countryCode","phone"]}),s=a?t(k,{children:a}):void 0;return t(de,{id:"orderEditDeliveryAddress",label:n.translate("local_pickup.title"),primaryContent:s})}function vv(){const{i18n:e,checkout:n}=v(),o=(n.proposal.facts.delivery??[])[0]?.lines.filter(({deliveryChange:i,isFulfilled:r})=>i!=="REMOVED"&&!r).map(i=>t(Mu,{line:i},i.title));return t(de,{id:"orderEditShippingMethod",label:e.translate("shipping.title"),primaryContent:o})}function gv({i18n:e,shopPay:n,chargeAmount:a,numberOfPaymentTerms:s,installmentsUnavailable:o,paymentDue:i,installmentsConfig:r}){const l=Mi(n),d=i?.currencyCode,c=r?.availableLoanTypes,p=a?e.formatCurrency(a,{currency:d,form:"short"}):void 0,{payNowLabel:u,payNowSubtitle:m}={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?S():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=()=>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_subt
2itle.split_pay"),b=()=>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}),_=y(),E=d==="GBP"?b():C(),N=()=>l==="SHOP_PAY"?`${u} - ${m}`:`${_} - ${E}`,T=l==="SHOP_PAY";return{payNowLabel:u,payNowSubtitle:m,installmentsLabel:_,installmentsSubtitle:E,summary:N(),primaryLabel:T?u:_,secondaryLabel:T?m:E}}function fv(){const{i18n:e,shopPay:n,checkout:a}=v(),s=mn(),{paymentMethods:o}=G();return h(()=>gv({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 Cv(){const{userEvents:e}=v(),n=kn(Mn.SHOP_PAY_PAY_NOW),a=kn(Mn.SHOP_PAY_INSTALLMENTS),s=kn(Mn.SHOP_PAY_INSTALLMENTS_DEFAULTED),o=kn(Mn.SHOP_PAY_PAY_NOW_DEFAULTED);return{recordRetailEvent:w(r=>{const l=(function(){switch(r){case"payment_method_pay_now":return n;case"payment_method_installments":return a;case"default_payment_method_installments":return s;case"default_payment_method_pay_now":return o;default:return a}})();return e.monorailEvent({schemaId:"retail_shop_pay/2.0",payload:l})},[e,n,a,s,o])}}function Sv({onAutoExpand:e,ineligibilityReasonLabel:n}){const{source:a,checkout:s,shop:o,observability:i,userEvents:r,shopPay:l,embed:d}=v(),{visibility:c}=l,p=s.installments.isSupported.value,u=s.installments.isUnavailable.value,m=oc(),y=Mi(l),{paymentMethods:C}=G(),f=h(()=>ti(C.value)),S=p?f.value?.availableLoanTypes:void 0,g=$(),b=Fp(),_=l.user.installments.isRetryable.value,{recordRetailEvent:E}=Cv(),N=Lu();M(()=>{n&&!_&&y==="SHOPIFY_INSTALLMENTS"&&l.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOP_PAY"})},[_,n,y,l.session]),M(()=>{l.session.isInternalProgressing.value||p&&!u&&(!m.value&&c.showAutoExpandedPaymentMethods&&e?.(),b.value.spiPreselected&&!N&&(l.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOPIFY_INSTALLMENTS"}),i.leaveErrorBreadcrumb("SPI preselected",{})))},[p,u,m.value,b.value.spiPreselected,l.session,i,c.showAutoExpandedPaymentMethods,N,e]),M(()=>{m.value&&p&&E(u?"default_payment_method_pay_now":"default_payment_method_installments")},[p,u,m.value,E]),M(()=>{u||!S||JSON.stringify(g.current)!==JSON.stringify(S)&&(r.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...xs(a,s,o,{embedPlatform:d?.platform,shopAppSurface:l.app.config.surface}),eventType:Ds.InterestEligibility,success:Ts(S),errorMessage:Ts(S)?void 0:JSON.stringify(["amount"])}}),r.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...xs(a,s,o,{embedPlatform:d?.platform,shopAppSurface:l.app.config.surface}),eventType:Ds.SplitPayEligibility,success:!!S.includes("SPLIT_PAY"),errorMessage:S.includes("SPLIT_PAY")?void 0:JSON.stringify(["amount"])}}),g.current=S)},[S,u,r,a,s,o,d?.platform,l.app.config.surface])}function _v(){const{i18n:e}=v(),n=he(!1),a=fv(),s=ic(),o=w(()=>{n.value=!n.value},[n]),i=w(()=>{n.value=!0},[n]);return Sv({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 bv(){const{i18n:e}=v();return t(de,{label:e.translate("pickup_point.title"),open:!0,children:t(Lo,{rowsInset:!0,children:t(ns,{heading:"none"})})})}function Rr(){const{userEvents:e,shop:n,source:a,checkout:s}=v(),o=w(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=w((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 Pv=cn({displayName:"ShippingGroupsSummary",load:()=>dn(()=>ln(()=>import("./17a5f1e4.DBEYGsw0.js"),__vite__mapDeps([113,1,2,3,4,5,6,7,8,9,10,11,21,22,23,88,89,90,114,82,18,19,20,24,65,40,13,41,66,67,47,68,69,70,71,38,39,42,43,44,45,46,48,72,37,73,74,75,76,77,78,79,80,81,83,91,92,93,58,27,94,95,12,14,15,16,17,25,26,28,29,30,31,32,35,36,56,57,96,59,49,50,97,54,98,99,100,101,102,87,103,104,105,106,107,108,109,110]))),renderLoading(){return t(pe,{})}});function Av({lines:e,hideThumbnail:n,shippingTime:a}){const{i18n:s,checkout:o}
2=v(),{deliveryExpectationLines:i}=Wi(),r=o.configuration.layout.isOnePage.value,l=d=>{const c=d.methods.find(({handle:b})=>b===d.selectedDeliveryMethodHandle);if(!c)return null;const{handle:p,cost:u,costAfterDiscounts:m,brandedPromise:y,estimatedTimeInTransit:C}=c,f=c.methodType==="LOCAL",S=!!c?.deliveryPredictionEligible,{deliveryExpectation:g}=lc(c,i||[],!!(S||y));return t(A,{gap:"small-400",children:t(j,{children:[t(Ia,{methodTitle:To({deliveryMethod:c,localDelivery:f?s.translate("shipping.local_delivery"):void 0}),showInterpunct:!0,price:t(Yi,{cost:u,costAfterDiscounts:m,inlineDiscount:!0})}),a?t(me,{color:"subdued",size:r?void 0:"small",children:a}):t(ka,{deliveryMethod:c,deliveryExpectationLine:g,estimatedTimeInTransit:C,paragraphColor:"subdued"})]})},p)};return t(U,{children:e.map(d=>{const c=rc(d.targetMerchandiseLines??[]);return c.slice(0,1).map(p=>t(ct,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"large-100",alignItems:"center",alignContent:"center",children:[!n&&(c.length>1?t(Do,{variant:"fan-legacy",merchandise:c,size:"small",useResponsiveImageSources:!0,useTitleAsAltTextFallback:!0}):t(uh,{merchandiseItem:p,hideBadge:!0})),l(d)]},p.id))})})}function Ev({state:e,addressInvalidMessage:n,addressIncompleteMessage:a}){const{i18n:s}=v(),o=G().deliveryNext,i=qe("deliveryNext"),{deliveryExpectationLines:r}=Wi(),{rollup:{secondaryContent:{typography:{color:l}={}}={}}={}}=bt(),d=et(),c=l??"base",p=e.status==="filled"?e.deliveryLines:void 0,u=nh({deliveryLines:p}),{hasViolations:m}=De(Rd),{hasViolations:y}=De(Ja),C=t(A,{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 L=a??s.translate("shipping.method_summary.incomplete_address_entered"),x=n??s.translate("shipping.invalid_shipping_method_summary"),V=s.translate("shipping.different_shipping_method_summary");let D=e.status==="empty"?L:x;m?D=L:y&&(D=V);const I=t(k,{children:D});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 L=t(Pv,{});return u?L=t(sh,{summary:u}):d.value&&(L=t(Rv,{deliveryNextValue:o.value})),{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:L,secondaryContent:u?t(ah,{summary:u,secondaryContentColor:c}):void 0}}const S=d.value?e.deliveryLines.filter(Ga):e.deliveryLines,g=cc(S);if(!g)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:void 0,secondaryContent:void 0};const{costAfterDiscounts:b,cost:_,hideDiscountedTotalOnShippingSelector:E}=g,N=To({deliveryMethod:g,localDelivery:g.methodType==="LOCAL"?s.translate("shipping.local_delivery"):void 0}),T=r?.find(L=>L.deliveryStrategyHandle===g.handle),R=t(Ia,{methodTitle:N,showInterpunct:!0,price:_&&b?t(so,{cost:_,costAfterDiscounts:b,hideDiscountedTotalOnShippingSelector:E}):void 0}),F=t(ka,{deliveryMethod:g,deliveryExpectationLine:T,paragraphColor:l??"base"});return{compactPrimaryContent:t(k,{type:"strong",children:t(Ia,{methodTitle:N})}),compactSecondaryContent:t(U,{children:[t(ka,{deliveryMethod:g,deliveryExpectationLine:T,paragraphColor:l,formatContent:L=>L?t(A,{display:"inline",direction:"inline",columnGap:"none",alignItems:"center",children:["(",L,")"]}):null}),t(k,{color:l,children:t(so,{cost:_,costAfterDiscounts:b,hideDiscountedTotalOnShippingSelector:E,styleOverrides:{shouldBold:!1}})})]}),inlinePrimaryContent:R,inlineSecondaryContent:F,primaryContent:R,secondaryContent:F}}function Rv({deliveryNextValue:e}){const n=ai(e).filter(Ga);return n.length?t(ct,{gridAutoRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",children:t(Av,{lines:n,hideThumbnail:n.length===1})}):null}function so({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 Iv(){const{i18n:e,checkout:{identity:{current:n}}}=v(),a=n.value,s=Da(),o=a==="amazonPay"||a==="buyWithPrime";return!s.value&&o?t(de,{id:"amazonPayShippingMethods",label:e.translate("shipping.title"),primaryContent:t(pe,{})}):t(kv,{})}function kv(){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=ne("Checkout::ShippingMethodDetails::RenderAfter"),d=ne("Checkout::ShippingMethodDetails::RenderExpanded"),{uiStateSignal:c}
2=Za(Ua),{hasViolations:p}=We(Id),u=q(p),m=Cs(),{hasViolations:y}=wo(si),C=q(y),f=h(()=>m.value&&C.value),S=et(),g=Un([...r,...l,...d],{lazyReveal:!0}),b="shippingMethod",_=Ut(b,g.peek()),E=q(ls(Zo([...r,...l,...d],"uiExtension").map(en),w(()=>{_.value=!0},[_])));ke(()=>{g.value&&(_.value=!0)}),ke(()=>{(u.value||f.value||!S.value&&Lv(c.value))&&(_.value=!0)});const N=Mv({identity:a.identity}),T=w(()=>{const H=!_.value;N?.(H),_.value=H},[N,_]),{deliveryNext:R,shippingAddress:F}=G(),{parts:{deliveryLines:L}}=kd(),x=Ov({i18n:n,identity:a.identity}),V=Ev({state:c.value,addressIncompleteMessage:x?.addressIncompleteMessage,addressInvalidMessage:x?.addressInvalidMessage}),D=(()=>{switch(e?.embedder){case"amazon":{const{compactPrimaryContent:H,compactSecondaryContent:K}=V;return H===void 0&&K===void 0?{primary:V.primaryContent,secondary:V.secondaryContent}:{compact:t(A,{direction:"inline",gap:"small-400",alignItems:"center",children:[H,K]})}}case"google":return{primary:V.inlinePrimaryContent,secondary:V.inlineSecondaryContent};default:return{primary:V.primaryContent,secondary:V.secondaryContent}}})();ke(()=>{Dv(R.value,L.value,F.value?.phone)&&(_.value=!0)});const I=h(()=>(c.value.status==="error"||c.value.status==="empty")&&!(g.value||E.value));return ke(()=>{I.value&&(_.value=!1)}),t(de,{open:_.value,id:b,label:n.translate("shipping.title"),primaryContent:D.primary,secondaryContent:D.secondary,compactContent:D.compact,onToggle:i&&c.value.status==="empty"||I.value?void 0:T,renderChildrenWhenCollapsed:!0,icon:t(Ye,{id:"shippingMethod-packageDeliveryIcon",type:"package-delivery",size:"fill"}),children:t(Nh,{singleDeliveryGroup:s})})}function Ov({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")};default:return}}function Mv({identity:{current:e}}){const{trackOnDeliveryToggle:n}=Rr(),a=w(s=>{n(s)},[n]);return e.value==="shopPay"?a:void 0}function Lv(e){if(e.status!=="filled")return!1;const n=["SHIPPING","LOCAL"];return e.deliveryLines.some(a=>{const s=Od(a);return n.includes(s?.methodType||"")?a.status==="available"&&a.hasDeliveryLineChange:!1})}function Dv(e,n,a){return Md(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 oo={rollup:{label:{visibility:"visible"},blockAlignment:"center"}},Tv={rollup:{label:{visibility:"hidden"},blockAlignment:"center"}},wv={SHIPPING:{id:"shippingMerchandiseList",getTargetMerchandiseLines:pu},PICK_UP:{id:"pickupMerchandiseList",getTargetMerchandiseLines:uu}};function io({selectedDeliveryMethodType:e}){const{i18n:n}=v(),{deliveryLines:a}=ae(),s=et(),{showOverlay:o}=dc(),i=he(!1),r=wv[e],l=h(()=>r.getTargetMerchandiseLines(a.value)),{visibleSummary:d,isNegotiating:c}=hu(l),p=Ke(),u=h(()=>mu(a.value)),m=h(()=>u.value>=yu),y=h(()=>{const _=d.value;return _?_.isAllItems?n.translate("split_delivery.all_items"):n.translate("split_delivery.items_count",{count:_.totalItemCount}):""}),C=e==="PICK_UP"?n.translate("delivery_options.pick_up"):n.translate("delivery_options.ship"),f=t(O,{when:()=>d.value!==void 0&&(!p.value||!c.value),fallback:t(pe,{}),children:t(k,{children:y})}),S=t(Do,{variant:"fan-legacy",sortByPrice:!0,merchandise:d.value?.merchandiseLines??[],size:"small"});if(m.value)return t(ba,{theme:oo,children:t(de,{id:r.id,label:C,thumbnail:S,onClick:()=>o(vu),primaryContent:f})});const g=i.value||s.value;return t(ba,{theme:g?Tv:oo,children:t(de,{id:r.id,label:C,thumbnail:S,open:g,onToggle:g?void 0:()=>{i.value=!i.value},primaryContent:f,children:t(gu,{title:e==="PICK_UP"?n.translate("split_delivery.items_for_pickup"):n.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:e})})})}function Nv(e,n,a){if(n.isSplitShipAndPickup&&e==="shipping")return t(Fe,{level:2,children:a.translate("delivery_options.ship_to_address")})}function Vv(){const{rollup:e}=bt(),{padding:n}=ii({padding:[e?.blockPadding??"base",e?.inlinePadding??"base"]});return t(j,{padding:n,children:t(_s,{})})}function Bv(){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(yn),u=uc(),m=pc(),y=oi({checkout:n}),C=u.value&&!m.value,f=et(),S=$n(),b=Qa().value!==void 0,_=qe("deliveryNext"),E=Ke(),{deliveryLines:N}=ae(),R=Ld(N.value??[]).filter(P=>P.requiresShipping).length>0,F=iy(),L=re(()=>({isSplitShipAndPickup:f.value,isBusinessCustomerSingleChoiceMode:C,businessCustomerCannotProvideShippingAddress:u.value,redemptionEligibilityVisible:F,shouldAllowInlineSplit:S.value,hasShippingMerchandiseLines:R,hasLocalPickupDeliveryLine:b,deliveryNextLoading:E.value&&_.value}),[f.value,C,u.value,F,S.value,R,b,E.value,_.value]),x=L.isSplitShipAndPickup?Dd:Td,V=x[d]??x.default,D=fn(),I=P=>D.value&&(P==="deliveryAddress"||P==="localPickupOptions")?"deliveryDestination":P,H=P=>{switch(P){case"contact":return t(fr,{},P);case"businessCustomerSingleChoice":return t(vs,{},P);case"orderEditDeliveryAddress":return t(mv,{},P);case"orderEditShippingMethod":return t(vv,{},P);case"deliveryAddress":return D.value?t(no,{destination:P}):t(Ss,{},P);case"shippingMerchandiseList":return t(io,{selectedDeliveryMethodType:"SHIPPING"},P);case"shippingMethods":return t(Iv,{},P);case"pickupMerchandiseList":return t(io,{selectedDeliveryMethodType:"PICK_UP"},P);case"localPickupOptions":return D.value?t(no,{destination:P}):t(Er,{},P);case"pickupPoint":return t(bv,{},P);case"dutyOptions":return t(hv,{},P);case"paymentOptions":return t(_v,{},P);case"payment":return t(Oa,{},P);case"billing":return t(Ma,{isAbovePaymentSummary:y},P);case"cashRedemption":return t(av,{},P);default:return t(U,{})}};zn(()=>{c&&n.sections.unstable_providePreactContext(L)},[c,n.sections,L]);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},se=c?n.sections.availableToRenderGrouped.value:wd(Nd(V.filter(P=>Vd[P].shouldRender({preactContext:L,concepts:K})),{preactContext:L,concepts:K}));let X=!1;return se.filter(P=>P.length>0).map(P=>{const z=[];for(const{sectionId:oe,groupId:Z}of P){const Q=H(oe);Z!=null&&Bd.has(Z)?(!X&&n.configuration.visibility.showDeliveryHeading.value&&(z.push(p?t(Vv,{},"deliveryHeading"):t(_s,{},"deliveryHeading")),X=!0),z.push(t(Vt,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(ts,{name:oe,children:Q})},I(oe)))):z.push(Q)}const W=P[0]?.groupId,Y=Nv(W,L,o);return{groupId:W,header:Y,elements:z}})}const Fv="K6vpG",xv="_5hYUU",Hv="CU3YS",Uv="_5HWz9",zv="r8rqQ",Gv="_2Ojsq",wt={DivideChildren:Fv,n
2oVaultedDividers:xv,ShowTopDivider:Hv,ShowBottomDivider:Uv,StripBlockStartPadding:zv,StripBlockEndPadding:Gv};function ro({hideLastDivider:e,showTopDivider:n,stripBlockEndPadding:a}){const s=Ae(),{negotiate:o}=dt(),{checkout:i,embed:r,shop:l,source:d}=v(),c=$n(),p=h(()=>s.value.delivery&&i.isShippingRequired.value),u=h(()=>p.value&&c.value),m=oi({checkout:i}),y=h(()=>s.value.contact&&i.configuration.showContactInformation),C=h(()=>Fd({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(Ss,{},"delivery")]:[]]}const S=[...f(),...b(i)],g=S.length>0||y.value;if(Hh(g),Kv({hasSections:g,identity:i.identity,wallets:i.wallets,negotiate:o}),S.length===0)return null;return t(j,{children:[t(Dh,{children:t(Wv,{hideLastDivider:e,showTopDivider:n,stripBlockEndPadding:a})}),t(O,{when:()=>s.value.payment,children:t(Lm,{})}),t(O,{when:u,children:t(Ci,{})})]});function b(_){if(lt(d))return s.value.payment?[t(Oa,{},"payment")]:[];const E=[];return m&&E.push(t(Ma,{isAbovePaymentSummary:!0},"businessCustomerBilling")),s.value.payment&&(E.push(t(Oa,{},"payment")),_.configuration.visibility.showCashRedemption.value&&E.push(t(ry,{},"cashRedemption")),s.value.billing&&!m&&E.push(t(Ma,{},"billingAddress"))),E}}function lo({sections:e,hideLastDivider:n,showTopDivider:a,stripBlockEndPadding:s}){const{checkout:{identity:o},shop:i}=v(),r=Ae(),l=$v(o,r.value.payment),{vaulted:{spacing:d="none",cornerRadius:c,divider:{borderWidth:p="base",borderStyle:u="base",borderColor:m="base",visibility:y="visible"}={}}={}}=bt(),{main:{section:C}}=Fa(),f=!l&&!on(n),S=hc().rendered?.padding,{blockStart:g,blockEnd:b}=Yv(i.hasFlagEnabled(yn)?void 0:S);return e.length===0?null:t("div",{className:fo(wt.DivideChildren,{[wt.ShowTopDivider]:on(a),[wt.ShowBottomDivider]:f,[wt.StripBlockStartPadding]:g,[wt.StripBlockEndPadding]:b||s}),style:jv({spacing:d,borderWidth:p,borderStyle:u,borderColor:m,visibility:y,cornerRadius:C?.cornerRadius??c}),children:e})}function Wv({hideLastDivider:e,showTopDivider:n,stripBlockEndPadding:a}){const s=Bv(),o=et();if(s.length===0)return null;const i=s.length>1&&o.value;return t(U,{children:i?t(A,{gap:"large-200",children:s.map(({groupId:r,header:l,elements:d},c)=>{const p=c===0,u=c===s.length-1,m=t(sn,{hideDivider:"always",children:t(lo,{sections:d,hideLastDivider:u?on(e):!0,showTopDivider:p&&on(n),stripBlockEndPadding:u&&a})});return l?t(A,{gap:"base",children:[l,m]},r):t(U,{children:m},r)})}):t(lo,{sections:s.flatMap(r=>r.elements),hideLastDivider:e,showTopDivider:n,stripBlockEndPadding:a})})}function co(e){return e!=null&&e!=="none"}function Yv(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:co(n),blockEnd:co(a)}}function jv({spacing:e,borderWidth:n,borderStyle:a,borderColor:s,visibility:o,cornerRadius:i}){const r=Xv[e],l={none:"0px",...Bn.borderWidth},d={base:Bn.color.default.border,transparent:"transparent"},c=o==="hidden"?"0px":l[n],p=Jv[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?Bn.borderRadius[i]:void 0}}function Kv({hasSections:e,identity:n,wallets:a,negotiate:s}){M(()=>{e&&qv({identity:n,wallets:a})&&s({silenceViolations:["all"]})},[])}function qv({identity:e,wallets:n}){return e.current.value==="amazonPay"||e.current.value==="buyWithPrime"?!1:!n.activeSession.value}function $v(e,n){return e.current.value==="guest"||e.current.value==="businessCustomer"&&n}const Xv={none:"0px",...Bn.spacing},Jv={base:"solid",dashed:"dashed",dotted:"dotted"};function Ir(){const{methods:e}=No(),{userEvents:n,shop:a,source:s,checkout:o}=v(),i=o.identity.current.value==="shopPay";ke(()=>{if(i)for(const r of e.value)St(()=>n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...je(s,o,a),action:`delivery_method_${r.toLowerCase()}_selected`}}))})}function Zv(){Ir();const{shop:e,i18n:n,checkout:a}=v(),s=Pt(),o=fn(),r=!e.hasFlagEnabled(ri),l=!a.configuration.visibility.showDeliveryHeading.value&&!r;if(!s)return null;if(o.value)return t(fu,{});const d=n.translate("shipping.delivery_title");return t(Vi.Provider,{value:!0,children:t(kp,{presentation:"base",children:t(j,{padding:r?"none":"base none",accessibilityLabel:d,className:r?wt.noVaultedDiv
2iders:void 0,children:t(A,{gap:"base",children:[l&&t(k,{color:"subdued",children:d}),t(Si,{})]})})})})}function kr(){const{source:e}=v(),n=Ae(),a=Vo(),s=Pt(),o=fn();return lt(e)||!n.value.delivery?null:t(U,{children:[t(Zv,{}),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 h(()=>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(Qv,{vaultedContactTypeOverride:i.value==="sdkCartHints"?"base":void 0})}function Qv({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(U,{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(O,{when:s,children:t(pi,{email:n.email??"",open:a.value,showPopover:m=>{a.value=m}})})]})}function eg({showDelivery:e,insideVaultedCard:n}){const{embed:a,shop:s}=v(),o=fn(),{rollup:{inlinePadding:i}}=bt(),r=t(U,{children:[t(Or,{placement:"vaulted-adjacent"}),t(O,{when:e,children:t(kr,{})}),t(O,{when:()=>!o.value,children:t(Ar,{})})]}),l=pt(a?.embedder);if(s.hasFlagEnabled(yn)){if(!l&&!n?.value)return r;const{padding:c}=ii({padding:["none",i??"base"]});return t(j,{padding:c,children:r})}const d=l?`none ${xn(i)??"none"}`:void 0;return l?t(j,{padding:d,children:r}):r}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&&ft(i.destinationAmount,s.availableBalance));return o===-1?!1:(a.splice(o,1),!0)})};function uo(e,n,a,s){const o=e?.status;return o==="pending"||(a||s)&&(o==="filled"||n)}function tg(e,n){const a=q(e),s=q(n),{shopDiscountOffer:o,shopPromotion:i}=G(),r=At(),l=ja().loading;return h(()=>{const d=r.value,c=a.value.eligible,p=l.value,u=p.has("discountLines"),m=p.has("shopCashBalance"),y=s.value;if(y!==void 0){const g=d.SHOP_PROMOTION,b=g.length>0;if(uo(i.value,b,u,p.has("shopPromotion")))return!0;if(y?.length){if(c?!Mr(g,y):b||m)return!0}else if(b)return!0}const C=o.value,f=d.SHOP_DISCOUNT_OFFER?.destinationAmount;if(uo(C,f!=null,u,p.has("shopDiscountOffer")))return!0;const S=er(C)?.redeemableAmount;return f==null?S!=null&&(c||m):!c||S==null||!ft(f,S)})}function ng(e,n=!0,a){const{setShopOfferReconciliationPending:s}=v().shopPay,o=tg(e,a);zn(()=>{if(!n)return;const i=o.subscribe(s);return()=>{i(),s(!1)}},[n,o,s])}const ag=()=>{const{embed:e,checkout:{identity:n},shop:a}=v(),s=n.current.value==="shopPay"&&pt(e?.embedder),o=a.hasFlagEnabled(Kn),i=ea(),r=ta().value;Lr({enabled:s,discountOffer:s?i.value:null,shopPromotionDiscounts:void 0,eligibility:r}),ys([{eligibility:r,redemptionTypes:["SHOP_DISCOUNT_OFFER"]}],{enabled:s,retryOnReady:o}),rr({enabled:s,redemptionTypes:["SHOP_DISCOUNT_OFFER"]})},sg=()=>{const{checkout:e,embed:n,shop:a,source:s}=v(),o=Ae(),i=e.identity.current.value==="shopPay"&&!pt(n?.embedder)&&e.configuration.visibility.showCashRedemption.value&&!(o.value.payment&&lt(s)),r=a.hasFlagEnabled(Kn),l=ea(),d=ir(),c=ta().value;Lr({enabled:i,discountOffer:i?l.value:null,shopPromotionDiscounts:i?d.value:null,eligibility:c}),ys([{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}=na({enabled:s}),{recordRedemptionAutomaticallyApplied:r,recordRedemptionAutomaticallyRemoved:l}=ms(),d=$(),c=At();ng(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(!ft(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]),m=re(()=>{if(!(!p&&!u))return{...p,...u}},[p,u]);M(()=>{if(!s||!m){d.current=void 0;return}!o||d.current===m||i(m,{onNegotiateAccepted:()=>{d.current=m,Object.entries(m).forEach(([y,C])=>{(C?r:l)(y,"useApplyAutomaticRedemptions")})}})},[s,o,m])};function og({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 ig(){return t(j,{"aria-busy":!0,padding:"large-200 none",children:t(A,{gap:"base",children:[t(pe,{inlineSize:"large"}),t(pe,{inlineSize:"base"}),t(xa,{contentDisplay:"block",blockSize:"48px"})]})})}const Dr=cn({displayName:"BelowTheFoldContent",renderLoading:ig,load:()=>dn(()=>ln(()=>import("./7aefefff.CyKAthR-.js"),__vite__mapDeps([115,1,2,3,4,5,6,7,8,9,10,11,116,117,96,59,118,119,38,39,40,13,41,42,43,44,45,46,47,19,20,48,34,27,35,36,37,12,14,15,16,17,18,21,22,23,24,25,26,28,29,30,31,32,49,50,51,52,53,54,55,56,57,58,60,120,121,77,122,91,92,93,74,75,67,66,68,69,94,95,123,124,125,76,126,127,128,129,73,130,131,63,64,65,70,71,72,78,79,80,81,82,83,84,85,132,89,133,97,98,88,90,99,100,101,102,87,103,104,105,106,107,108,109,110,134]))),renderError(e){throw e}}),rg="ifz7X",lg="xoG3V",Tr={OnePageFormContents:rg,OnePageFlexibleSpacer:lg};function cg({children:e,fillAvailableBlockSize:n,ready:a}){const{checkout:s}=v(),{progress:o}=dt(),i=Ki(),r=w(()=>{o("one-page-form-submit",void 0,{skipToCompletion:i.value})},[o,i]),l=Du(r);return t(mc,{disabled:!a.value,onSubmit:l,contentsClassName:n?Tr.OnePageFormContents:void 0,children:e},s.identity.current.value)}function dg({loading:e,lineItems:n,onClose:a}){const{i18n:s,url:o,checkout:{configuration:{allowRedirectToStorefront:i}}}=v(),{checkoutProtocolModalEventSignal:r}=ut(),l=t(Wn,{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 M(()=>()=>{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(A,{gap:"large-200",children:[t(me,{children:s.translate("stock.price_update.description")}),t(j,{children:t(vh,{loading:e,lineItems:n,type:Bo.PriceChange})}),t(A,{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 ug(){const e=G(),n=qe("merchandiseLines"),a=ae().merchandiseLines,s=he(St(()=>a.value));return h(()=>{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:m,negotiated:y})=>({line:m??y,problem:{type:Bo.PriceChange,negotiatedPrice:y?.itemPrice,proposedPrice:m?.itemPrice}}));return{hasViolation:i,loading:l,lineItems:p,updateProposal:()=>{p.length>0&&(s.value=d)}}})}function pg(){const{checkout:{wallets:e}}=v(),n=G(),a=ug(),s=Wa(),o=$(!1),i=h(()=>n.allViolations.value?.some(c=>xd.has(c.code))),r=h(()=>!i.value&&a.value.hasViolation&&a.value.lineItems.length>0),l=h(()=>{const c=a.value;return r.value?o.current=!0:o.current&&!c.loading&&c.lineItems.length===0&&(o.current=!1),!e.activeSession.value&&o.current&&c.lineItems.length>0?c:void 0});ke(()=>{r.value&&s("inventoryPriceChange",{element:{tagName:"modal"},timestamp:new Date,visible:!0})});const d=w(()=>{o.current=!1,a.value.updateProposal()},[a]);return t(O,{when:l,children:c=>t(dg,{loading:c.loading,lineItems:c.lineItems,onClose:d})})}const hg="LaXGo",mg={ReferralTitle:hg};function yg(){const{i18n:e,shop:n}=v(),a=fc(n.storefrontUrl)?.replace(/-/g,"‑");return a?t("strong",{"data-testid":"referral-title",className:mg.ReferralTitle,children:e.translate("merchant_redirect.referral_title",{merchant_url:a})}):null}function vg(){const{checkout:e,embed:n,shopPay:a}=v(),s=yh(),o=Ki(),i=Ae(),r=a.config.isReferral==="webview-rendered",l=n?.isFlagshipPartner??!1,c=h(()=>i.value.contact&&e.configuration.showContactInformation||i.value.delivery||i.value.payment).value,p=s.value,u=p||o.value||r;return c&&u?t(U,{children:[p?t(oh,{}):null,o.value?t(ih,{isVaultedReview:!0}):null,r?t(yg,{}):null,u&&!l?t(xe,{blockSize:"base"}):null]}):null}function gg(){const{embed:e,shop:n}=v();return a=>e?.isFlagshipPartner&&!pt(e.embedder)&&!Yn({embedder:e.embedder,shop:n})?t(Lo,{children:a}):a}function fg({showEmailMarketingOptIn:e,showPhoneMarketingOptIn:n,aboveFoldSpacing:a,paddingBlockStart:s,children:o}){const i=as(),r=h(()=>n?.value??i.value.isRoot),l=h(()=>e.value||r.value),d=h(()=>e.value&&r.value),c=h(()=>d.value?a?"small-200":"base":"none"),p=h(()=>a?"large-200 none large-200 none":`${s?.value??"none"} none base none`);return t(O,{when:l,fallback:o,children:()=>t(Vt,{target:"cart.buyerIdentity",children:t(A,{gap:a?"small-200":"base",padding:p.value,children:[t(A,{gap:c.value,children:[t(O,{when:e,children:t(Cu,{origin:"payment_page"})}),t(O,{when:r,children:t(_i,{})})]}),o]})})})}function po({extensions:e,hideDivider:n="always"}){const a=gg();return t(Ie,{gap:"base",customizations:on(e),render:(s,o)=>o?a(t(sn,{hideDivider:n,children:s})):s})}function Nr(e){const{i18n:n}=v(),a=w(o=>o.reduce((i,r,l)=>l===o.length-1?n.translate("shipping.shipping_method_combinations.combination",{rest:i,current:r}):n.translate("shipping.shipping_method_combinations.with_separator",{rest:i,current:r}),""),[n]);return re(()=>{if(!es(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 Cg(i,o)},[a,e,n])}function Cg(e,n){const a=(n||[]).filter(Hd).map(lh);return ch(a).filter(o=>o.length>0).map(o=>Sg(o,e))}function Sg(e,n){return{...Ud(e)??e[0],title:Wd(e,n),cost:Gd(e),costAfterDiscounts:zd(e)}}function Vr(){const{shopPay:e}=v(),{value:n}=G().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=es(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]=_t(!0),p=e.session.selectedShippingAddress.value;M(()=>{c(!0)},[p]),M(()=>{a||c(!1)},[a]);const[,u]=_t(),m=Ui(u);return{methodsByType:l,availableDeliveryMethods:r,availableDeliveryMethodsLoading:d,progressiveShippingRatesLoading:m}}function Br({onChange:e,prerequisitesLoading:n}){const{value:a}=G().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 es(a)?i.find(c=>c.handle===r):o.methods.find(c=>c.handle===r)},[n,s,r,o,a,i]),d=$(l);return M(()=>{l&&d.current&&d.current.handle!==l.handle&&e(l,d.current),d.current=l},[l,e]),{selectedDeliveryMethod:l}}function _g(){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 M(()=>{const l=r.current;if(r.current=i,!(!i||i===l))return So({content:i})},[i]),null}function bg(){return Sc("ONE_TIME_PURCHASE")?t(_g,{}):null}function Pg(){const{negotiate:e}=dt(),n=G(),a=n.buyerIdentity,s=ae(),o=s.shippingAddress.value,i=s.billingAddress.value,{observability:r,checkout:l}=v(),{value:d=[]}=n.allViolations,c=Yd(d),p=wr(d),u=l.isShippingRequired.value?o.countryCode:i.countryCode,m=a?.value?.countryCode,y=JSON.stringify(a?.value,(C,f)=>f===void 0?null:f);M(()=>{c||p||m&&u!==m&&(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:m,buyerIdentity:y}),e({silenceViolations:["all"]}))},[])}function Ag(){const{checkout:e,shop:n,source:a}=v(),{email:s}=ae(),o=Ae(),{buyerIdentity:i}=G(),r=n.hasFlagEnabled(jd);return h(()=>
2{if(e.identity.current.value==="businessCustomer")return!1;const l=i.value;if(l?.customerProfile?.acceptsEmailMarketing)return!1;const c=e.configuration.visibility.showEmailMarketing&&n.emailMarketing!=="OFF"&&o.value.contact;if(e.identity.current.value==="sdkCartHints")return!!(c&&s.value);const p=r&&!Kd(l?.countryCode);return!!(c&&a.type!=="shopPayExternal"&&!p&&!lt(a))})}function Eg({includeContact:e=!0}={}){const n=Ae(),a=q(ne("Checkout::Dynamic::Render","INFORMATION1")),s=q(ne("Checkout::Dynamic::Render","INFORMATION2")),o=q(ne("Checkout::Dynamic::Render","DELIVERY1")),i=q(ne("Checkout::Dynamic::Render","DELIVERY2")),r=q(ne("Checkout::Dynamic::Render","PAYMENT1")),l=q(ne("Checkout::Dynamic::Render","PAYMENT2")),d=q(ne("Checkout::Dynamic::Render","PAYMENT3")),c=$();return h(()=>{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 m=c.current;return m&&Rg(m,u)?m:(c.current=u,u)})}function Rg(e,n){return e.length===n.length&&e.every((a,s)=>{const o=n[s];return o!==void 0&&en(a)===en(o)})}const Ig=[Tu.Button,wu.Button,Nu.StickyFooter,Vu.Wrapper];function kg(){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 Og="nnGzs",Mg={HeaderWrapper:Og},ho="contact";function mo({loginLink:e,title:n}){const{router:a}=v(),s=h(()=>Qn(a,ho));return t("div",{className:Mg.HeaderWrapper,children:[t(Fe,{id:ho,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(O,{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 Lg=()=>{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 Dg({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;M(()=>{l&&c.status==="invalid"&&(i.value=d)},[l,i,d,c.status]);const p=w(u=>{if(l&&c.email===u&&c.status==="invalid")return d},[l,d,c.email,c.status]);return t(U,{children:[a?t(U,{children:[t(mo,{title:s.translate("contact.contact_method_title")}),t(xe,{blockSize:"base"}),t(Or,{placement:"standalone-vaulted"})]}):t(U,{children:[l&&t(U,{children:[t(Bi,{color:"branded"}),t(xe,{blockSize:"base"})]}),t(mo,{title:s.translate("contact.contact_method_title"),loginLink:t(Tg,{})})]}),t(xe,{blockSize:"base"}),t(ui,{hideAllOptIns:l&&!a,hideCustomerCard:a,showEmailMarketingOptIn:n,onValidateEmailInput:p}),l&&!a&&t(kg,{})]})}function Tg(){const{checkout:{identity:e}}=v(),n=gh();return e.current.value!=="shopPay"?t(Fr,{}):n===qd.UnauthenticatedCheckout?t(Lg,{}):null}const yo=un(function({showForm:n=!0,identityPresentation:a="form",showEmailMarketingOptIn:s}){const o=ne("Checkout::Contact::RenderAfter"),i=ne("Checkout::Dynamic::Render","INFORMATION1"),r=ne("Checkout::Dynamic::Render","INFORMATION2");return t(U,{children:[i.length?t(U,{children:t(Ie,{customizations:i,gap:"base",marginBlockEnd:"large300"})}):null,n?t(rs,{impressionType:"contact",impressionFeatures:[],children:[t(Dg,{identityPresentation:a,showEmailMarketingOptIn:s}),o.length?t(U,{children:t(Ie,{customizations:o,marginBlockStart:"base"})}):null,r.length?t(U,{children:t(Ie,{customizations:r,gap:"large-200",marginBlockStart:"large300"})}):null]}):t(U,{children:[o.length?t(U,{children:t(Ie,{customizations:o,marginBlockStart:"base"})}):null,r.length?t(U,{children:t(Ie,{customizations:r,gap:"large-200",marginBlockStart:"large300"})}):null]})]})});function wg(){const{checkout:{identity:e},i18n:n}=v(),{hasViolations:a}=We(Xa),{hasViolations:s}=We(Jo),{hasViolations:o}=De($d);if(a&&Ng({identity:e}))return t(Su,{});if(o)return t(Vt,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(nn,{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(Vt,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(Qt,{tone:"critical",heading:n.translate("shipping_errors.title"),errorType:Ge.DeliveryError,children:i})})}const Ng=({identity:e})=>e.current.value==="shopPay",Vg=[{handle:"first"},{handle:"second"}];function Bg(){const{i18n:e}=v(),{shippableDeliveryLines:n}=Ac().value,a=n?.[0]?.methods||Vg;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(rn,{value:s,disabled:!0,accessibilityLabel:e.translate("general.loading"),secondaryContent:t(xa,{inlineSize:"5ch"}),children:t(A,{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 Fg(){const e=v();return t(Kp,{children:t(jp,{children:xg(e)})})}function xg({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=un(function(){const{uiStateSignal:n,initialUiStateSignal:a}=Za(Ua),s=Ke(),o=s.value?n.value:a.value,i=Cs(),{hasViolations:r}=wo(si),l=i.value&&r,{hasViolations:d}=We(zg),c=s.value&&d&&!l&&o.status!=="error",p=c?t(Gg,{}):null,u=(()=>{switch(o.status){case"initial":case"empty":return t(Fg,{});case"loading":return t(Bg,{});case"error":return t(wg,{});case"filled":{const m=Xd(o.deliveryLines).filter(Ga),y=m.flatMap(({methods:C})=>C.map(({title:f})=>f));return t(rs,{impressionType:"shipping_methods",impressionFeatures:y,children:t(Hg,{lines:m,showErrorBanner:l,deliveryChangedBannerOwnedBySection:c})})}}})();return t(A,{gap:"base",children:[p,u]})});xr.displayName="OnePageShippingMethods";function Hg({lines:e,showErrorBanner:n,deliveryChangedBannerOwnedBySection:a}){const s=Wa(),o=Fo(),[,i]=_t(),r=Ui(i),l=Ug(v());return M(()=>{s("shippingMethodsFilled",{timestamp:new Date}),o({type:"shipping_methods_filled"})},[o,s]),t(U,{children:[t(l,{}),t(A,{gap:"large-200",children:t(dh,{lines:e,loading:r,showErrorBanner:n,deliveryChangedBannerOwnedBySection:a})})]})}function Ug({checkout:e}){return e.identity.current.value==="shopPay"?Wg:U}const zg=new Set(["DELIVERY_DELIVERY_LINE_DETAIL_CHANGED"]);function Gg(){const{i18n:e}=v();return t(Qt,{tone:"warning",errorType:Ge.DeliveryError,children:e.translate("shipping_errors.shipping_method")})}function Wg(){const{trackSelectShippingMethod:e}=Rr(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:a}=Vr();return Br({onChange:e,prerequisitesLoading:n||n&&!a}),null}function Yg(){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=w(()=>
2{if(!r)return;const d=()=>s.selectAddress(r.id,{source:"select-saved-address-link"}),c=r.address.countryCode;c&&o(c)?i(d):d()},[s,r,o,i]);return r?t(ct,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",justifyContent:"start",justifyItems:"start",children:t(Qe,{id:"save_shipping_information",textDecoration:"none",onClick:l,children:n.translate("customer_account.saved_address_option_link")})}):null}function jg(){Ir();const n=Pt()?.options.value.some(s=>s.id==="PICKUP_POINT")??!1,a=$n();return t(A,{gap:"large-300",children:[n&&t(ns.Prefetch,{}),t(Si,{}),t(ts,{name:"delivery-methods",children:t(Kg,{})}),t(O,{when:a,children:t(Ci,{})})]})}function Kg(){const{methods:e}=No(),{i18n:n,router:a,checkout:{wallets:s,identity:o}}=v(),i=Rc(),{deliveryNext:r,optionalDuties:l}=G(),d=ph(),c=Ro(),{shippingAddress:p}=ae();Ic(p,()=>{c&&c.taxId.reset()});const u=ne("Checkout::DeliveryAddress::RenderBefore"),m=ne("purchase.checkout.delivery-address.render-after"),y=zi(),{hasMultipleDeliveryGroups:C,onlyDeliveryGroupType:f}=y.value,{customizationsBefore:S,customizationsAfter:g}=Gi({hasMultipleDeliveryGroups:C,targeted:!1}).value,b=h(()=>ni(r.value,!0)||d.value.showShipmentBreakdown).value,_=b?"small-400":"base",E=Wa(),N=Fo(),{negotiate:T}=dt(),R=w(({shipping:Q})=>{s.activeSession.value||T({include:[],fieldsToResolve:["deliveryNext"],silenceViolations:["non-delivery-address"],runListenersOnError:!0}),Q.value=!0,E("sectionComplete",{section:"deliveryAddress",timestamp:new Date}),N({type:"section_complete",section:"deliveryAddress"})},[s,T,E,N]),F=w(({shipping:Q})=>{Q.value=!1},[]),L=Q=>t(ma,{padding:b?"small-400 none":void 0,children:Q}),x=re(()=>({groupType:f&&_h(f),includeDeliverySelectionGroups:!1}),[f]),V=as(),D=h(()=>V.value.isDelivery),I=et(),H=$n(),K=h(()=>I.value?e.value.includes("PICK_UP")&&e.value.includes("SHIPPING"):!1),se="shippingMethod",X=h(()=>Qn(a,se)),P=fi(),z=t(Nn,{sectionId:"localPickup",children:t(A,{gap:"small",children:[t(O,{when:K,children:t(Fe,{level:2,children:n.translate("delivery_options.pickup")})}),P?t(_u,{}):t(bu,{})]})}),W=t(Nn,{sectionId:"shipping",children:[t(ma,{children:t(A,{gap:"base",children:[t(O,{when:K,children:t(Fe,{level:2,children:n.translate("delivery_options.ship_to_address")})}),t(O,{when:i,children:t(me,{color:"subdued",children:n.translate("shipping.shipping_used_as_billing_notice")})}),t(O,{when:K,children:t(O,{when:H,children:t(j,{border:"base",padding:"base",borderRadius:"large",children:t(Pu,{selectedDeliveryMethodType:"SHIPPING"})})})}),t(Ie,{customizations:u}),t(A,{gap:"large-300",children:[t(fh,{children:t(pp,{onValid:R,onInvalid:F,children:t(br,{children:[qg({identity:o})&&t(Yg,{}),t(Au,{}),t(O,{when:D,children:t(_i,{})}),c&&t(Eu,{taxId:c.taxId,applied:c.applied})]})})}),t(Ie,{customizations:m}),t(A,{gap:_,children:[t(Fe,{id:se,level:2,autoFocus:X.value,children:n.translate("shipping.shipping_method_title")}),t(kc,{children:[t(O,{when:()=>d.value.showShipmentBreakdown,children:t(Gs,{children:[t(Sh,{}),t(xe,{blockSize:"small-200"})]})}),xp("shipping.shipping_method_notice",n)?t(me,{children:n.translate("shipping.shipping_method_notice")}):null,t(Ie,{customizations:S,options:x,render:L}),t(Gs,{children:[t(xr,{}),t(Ch.Preload,{})]}),t(Ie,{customizations:g,options:x,render:L})]})]})]})]})}),t(O,{when:()=>l.value?.refuseDutiesPermitted,children:t(ma,{accessibilityLabel:n.translate("shipping.duties_and_taxes_title"),children:t(A,{gap:"base",children:[t(Fe,{level:2,children:n.translate("shipping.duties_and_taxes_title")}),t(Hi,{})]})})})]}),Y=h(()=>e.value.includes("PICKUP_POINT")),oe=h(()=>e.value.includes("PICK_UP"));return t(O,{when:K,fallback:t(O,{when:()=>Y.value||oe.value,fallback:W,children:t(O,{when:Y,fallback:z,children:t(Nn,{sectionId:"pickupPoints",children:t(ns,{})})})}),children:t(A,{gap:"large-300",children:[z,W]})})}function qg({identity:e}){return e.current.value==="customerAccount"}const $g=un(function(){const{shop:n,i18n:a}=v(),s=ne("Checkout::Dynamic::Render","DELIVERY1"),o=Pt(),i=Ae(),l=!n.hasFlagEnabled(ri),d=q(!!(l&&o)),c=h(()=>i.value.contact&&d.value),p=h(()=>c.value?void 0:"deliveryAddress"),u=h(()=>c.value?a.translate("shipping.delivery_title"):void 0);return t(sn,{accessibilityLabelledBy:p.value,accessibilityLabel:u.value,accessibilityRole:"group",children:t(A,{gap:"base",children:[t(O,{when:()=>!c.value,children:t(A,{gap:"small-400",children:t(_s,{})})}),t(mi,{}),t(jg,{}),t(Ie,{customizations:s})]})})}),Hr=cn({displayName:"MobileOrderSummaryBeforeDetails",load:()=>dn(()=>ln(async()=>{const{MobileOrderSummary:e}=await import("./d2e6a587.CdnrCcyA.js");return{MobileOrderSummary:e}},__vite__mapDeps([132,1,3,4,5,6,2,7,8,9,10,11,79,80,127,128,68,89,133])).then(({MobileOrderSummary:e})=>({default:e}))),renderError(e){throw e}}),vo=typeof window>"u"?void 0:performance.now();typeof window<"u"&&Dr.preload();const Xg=Ig,Jg=un(function(){return ag(),sg(),null});function Zg({isGuestPartialVaultedDelivery:e,isSectionStyleUnificationEnabled:n,children:a}){const s=h(()=>!e.value);return n?t(Fn,{target:e.value?"edgeToEdge":"vaulted",children:a}):t(Ea,{target:"vaulted",condition:s,children:a})}const Qg=un(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),m=w(()=>{u.value||(u.value=!0,vo!==void 0&&r.histogram({name:"one_page_below_fold_content_ready",value:Math.round(performance.now()-vo),unit:"ms",attributes:{buildId:o.commitSha}}))},[o.commitSha,u,r]),y=Ke(),C=l.hasFlagEnabled(yn),f=Yn({embedder:s?.embedder,shop:l}),S=s?.embedder==="google"&&f,g=Ae(),b=Bu(),_=h(()=>g.value.payment&&b.value),E=q(Pt()),N=Oc(),T=h(()=>g.value.payment&&l.acceptTipPayments&&(N?.tippingPaymentAllowed??!0)&&a.configuration.visibility.showTips),R=q(ko()[0]),{postPurchaseEnabled:F}=mh(),L=G(),x=h(()=>L.buyerIdentity.value?.customerProfile),V=Mc(),D=h(()=>S&&V.value),I=et(),H=h(()=>g.value.contact&&a.configuration.showContactInformation||g.value.delivery&&a.isShippingRequired.value||g.value.payment),K=h(()=>g.value.delivery&&a.isShippingRequired.value||g.value.payment),se=h(()=>I.value&&H.value),X=li(),P=ji(),z=h(()=>ci({configuration:a.configuration,identity:a.identity,shop:l,shopPay:d,embed:s,vaultedSections:g.value,isShippingRequired:a.isShippingRequired.value,hasSellingPlan:X.value,phoneCountryCode:P.value})),W=h(()=>z.value==="standalone-form"),Y=h(()=>z.value==="standalone-vaulted"),oe=h(()=>z.value==="vaulted-adjacent"),Z=h(()=>W.value||Y.value);Pg();const Q=q(Lc({base:!0,medium:!1})),ee=h(()=>y.value?Q.value??!1:!0),ge=Ru(),le=h(()=>ge.value!=="hidden"),ie=q(ne("Checkout::Contact::RenderAfter")),fe=Ag(),{main:{section:Ee}}=Fa(),{lineItems:{priority:Ce="base"}}=bt(),ce=q(Jd(Ee)),Se=Vo(),_e=h(()=>a.identity.current.value==="shopPay"||g.value.payment||!ce.value?"belowPayment":"abovePayment"),be=h(()=>!Z.value&&fe.value&&_e.value==="belowPayment"),J=h(()=>!Z.value&&fe.value&&_e.value==="abovePayment"),ye=h(()=>Se.value&&g.value.payment&&be.value&&ee.value),B=h(()=>a.configuration.visibility.showEmailMarketing&&!lt(c)&&J.value&&!x.value?.acceptsEmailMarketing),te=as(),Re=h(()=>te.value.isRoot?_e.value==="belowPayment"&&(!ee.value||!ce.value)?"belowPayment":"abovePayment":"none"),Pe=h(()=>a.identity.current.value==="guest"&&g.value.delivery||a.identity.current.value==="businessCustomer"&&!g.value.delivery&&g.value.payment),$e=h(()=>a.identity.current.value==="guest"?Pe.value&&!(g.value.contact&&g.value.payment):Pe.value),ue=h(()=>!$e.value&&a.isShippingRequired.value),nt=h(()=>oe.value||Y.value),Ve=fn(),He=h(()=>!!(!lt(c)&&g.value.delivery&&E.value!=null&&!Ve.value)),Ue=h(()=>g.value.delivery&&R.value.includes("PICK_UP")&&!Ve.value),Oe=h(()=>!!(nt.value||Ue.value||(ue.value||$e.value)&&He.value)),ht=h(()=>!!(ue.value&&He.value&&!nt.value)),Xe=pt(s?.embedder),Te=a.configuration.orderSummary?.placement==="beforeDetails",zt=h(()=>Xe&&!Te&&!ht.value),at=h(()=>Xe&&Oe.value),Gt=h(()=>Xe?Te:ce.value),Be=h(()=>a.identity.current.value==="guest"&&g.value.delivery&&!g.value.contact),ze=h(()=>!Z.value&&ce.value&&(B.value||Re.value==="abovePayment")),we=h(()=>y.value&&g.value.contact&&!Z.value&&ie.value.length>0),Et=h(()=>!Z.value),Je=Eg({includeContact:Et}),Cn=h(()=>y.value&&!V.value&&Je.value.length>0),Rt=hh(),Sn=h(()=>y.value&&Rt.value&&Te),It=h(()=>Rt.value&&!Te),_n=!!s?.isFlagshipPartner&&Ce==="high";Dc();const sa=h(()=>!Z.value&&(B.value||ye.value)),Wt=h(()=>Re.value==="abovePayment"),bn=h(()=>Z.value?g.value.delivery&&a.isShippingRequired.value?i.translate("shipping.delivery_title"):i.translate("payment.title"):i.translate("contact.contact_method_title")),mt=h(()=>!ce.value&&!se.value&&(!Y.value||K.value)),oa=h(()=>!(se.value&&g.value.contact)&&(!Y.value||K.value)&&(Se.value||ce.value&&!g.value.contact)),kt=h(()=>g.value.payment&&!ye.value&&!It.value),yt=h(()=>H.value&&!Be.value),Yt=h(()=>C&&yt.value),Pn=h(()=>!C&&yt.value),An=h(()=>Yt.value&&mt.value),jt=h(()=>!Xe&&Yt.value&&mt.value&&!Pe.value&&g.value.payment&&(!a.isShippingRequired.value||g.value.delivery)),En=h(()=>Xe?Te:Se.value||jt.value),Kt=h(()=>jt.value&&!ee.value&&(be.value||Re.value==="belowPayment")&&!_.value&&!we.value&&!Cn.value&&!D.value),qt=h(()=>Kt.value||_.value||ze.value||ye.value||Se.value&&!ce.value&&ee.value||kt.value&&(ee.value||Te)),st=h(()=>_.value||kt.value||!g.value.payment&&g.value.delivery&&!ee.value&&!we.value||g.value.payment&&ye.value);return t(Mh,{children:[t(Jg,{}),t(A,{blockSize:D.value?"100%":void 0,gap:"@media (inline-size >= extraSmall) large-200, none",children:[t(O,{when:zt,children:t(Os,{accessibilityRole:"presentation"})}),lt(c)?t(A,{gap:"base",padding:"@media (inline-size >= extraSmall) none, large-200 large-200 none large-200",children:t(Tc,{})}):null,t(ya,{section:"toast"}),!_n&&t(ya,{section:"top"}),t(og,{active:y,ready:u}),t(cg,{fillAvailableBlockSize:D.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(Fn,{target:"lineItems",children:t(sn,{hideDivider:le,children:t(wc,{})})})}),_n&&t(ya,{section:"top"}),t(O,{when:le,children:t(Fn,{target:"expressCheckout",children:t(Iu,{})})}),t(O,{when:Sn,children:[t(On,{section:"summary",children:t(Lt,{section:"summary",children:t(j,{padding:"none large-200 large-100 large-200",children:t(Fn,{target:"plain",children:t(Hr,{})})})})}),t(Os,{accessibilityRole:"presentation"})]}),t(vg,{}),t(Lh,{}),t(O,{when:Z,children:()=>t(sn,{accessibilityLabel:i.translate("contact.contact_method_title"),children:t(On,{section:"contact",children:t(Lt,{section:"contact",children:t(yo,{show
2Form:a.configuration.showContactInformation,identityPresentation:Y.value?"vaulted":"form",showEmailMarketingOptIn:Y.value?fe.value:void 0})})})})}),t(Ea,{target:"vaulted",condition:Yt,children:t(an,{hideDivider:st,condition:mt,accessibilityLabel:bn.value,children:t(Ea,{target:"vaulted",condition:Pn,children:[t(eg,{showDelivery:ue,insideVaultedCard:An}),t(an,{condition:oa,hideDivider:qt,accessibilityLabel:bn.value,children:t(A,{children:[t(O,{when:()=>!g.value.contact&&!W.value,children:t(On,{section:"contact",children:t(Lt,{section:"contact",children:t(yo,{showForm:a.configuration.showContactInformation})})})}),t(O,{when:()=>!Pe.value,children:t(ro,{hideLastDivider:En,showTopDivider:at,stripBlockEndPadding:a.configuration.isUniversalCheckoutFinalizer})})]})}),t(O,{when:se,children:t(lp,{})})]})})}),t(O,{when:_,children:t(j,{paddingBlockStart:"small-300",paddingBlockEnd:"base",children:t(Fu,{})})}),t(O,{when:()=>(!Z.value||Wt.value)&&(ce.value||ye.value),children:t(Lt,{section:"contact",children:t(fg,{aboveFoldSpacing:!0,showEmailMarketingOptIn:sa,showPhoneMarketingOptIn:Wt})})}),t(O,{when:we,children:t(Lt,{section:"contact",children:t(po,{extensions:ie,hideDivider:"whenEmpty"})})}),t(O,{when:$e,children:t(O,{when:a.isShippingRequired,children:t(Zg,{isGuestPartialVaultedDelivery:Be,isSectionStyleUnificationEnabled:C,children:[t(kr,{}),t(cp,{condition:Pe,accessibilityLabel:i.translate("shipping.delivery_title"),children:t(ro,{hideLastDivider:Gt,showTopDivider:at,stripBlockEndPadding:a.configuration.isUniversalCheckoutFinalizer})})]})})}),t(O,{when:Cn,children:t(po,{extensions:Je,hideDivider:"whenEmpty"})}),t(O,{when:()=>!g.value.delivery&&a.isShippingRequired.value,children:t(Vt,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(On,{section:"delivery",children:t(Lt,{section:"delivery",children:t(Nn,{sectionId:"delivery",children:t($g,{})})})})})}),t(O,{when:T,children:t(ip.Prefetch,{})}),t(O,{when:D,children:t(j,{className:Tr.OnePageFlexibleSpacer,"data-testid":"onepage-vaulted-spacing"})}),t(O,{when:y,children:t(Dr,{onReady:m,includeContactInVaultedExtensions:Et,showMobileOrderSummary:It,showVaultedStateMarketingDisclosureBelowPayment:be,phoneMarketingPlacement:Re,isSectionCustomized:ce,showVaultedStateMarketingDisclosureOnMobile:ye,expressCheckoutSlot:ge,showVaultedCardConsentSpacing:Kt})})]}),F&&t(rp,{})]}),t(pg,{}),t(O,{when:a.isShippingRequired,children:t(bg,{})}),t(ku,{id:"OnePage"}),n]})}),aC=Object.freeze(Object.defineProperty({__proto__:null,MobileOrderSummaryBeforeDetails:Hr,default:Qg,onePageCriticalStyleClassNames:Xg},Symbol.toStringTag,{value:"Module"}));export{Kh as L,qh as M,br as O,fg as P,Xh as R,Av as S,Lm as U,po as V,By as a,Fy as b,xr as c,Cv as d,fv as e,Sv as f,Wh as g,Gh as h,Yy as i,nC as j,Qn as k,bm as l,tr as m,Eg as n,ry as o,aC as p,gg 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.