PageSourceSearch

https://www.2cmp.com/cdn/shopifycloud/checkout-web/assets/c1/f8706cb6.BKYQh9AK.js

js 2cmp.com collected 2026-10-08 04:53:13 UTC 175,078 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["26e63865.CTITysiQ.js","2c1ab0fe.B2yRRyAW.js","164ad2e3.-hfWY9cN.js","4b4bc88f.JFrEI7LU.js","app.C_W8kcQ4.js","assets/app.CcGlIMpn.css","assets/wallet-prefilled-guest-return.BJvF0-q4.css","d0bb51ec.CiN57OqX.js","f67abd2c.Boj0gJpa.js","60a453ce.aSs2kW8G.js","e12db40c.ZpKYxNRe.js","9dba8418.BqWu-Ch9.js","assets/hydrate.BVNsrfvu.css","6bfea526.DhpjKDX-.js","ac5a19ff.BhdcadwW.js","598fef4e.C__a6xIj.js","assets/PaymentIcon.gzvCNwz_.css","e77f7fe0.B1UY2cg5.js","22345fd4.CQJ0n-1P.js","4b1c22b7.BOiV_1od.js","assets/PaymentLine.DT05kVlY.css","a422df8c.p_hgP_ap.js","efa0389a.DgBvBH2e.js","assets/Choice.CrYuHUmO.css","assets/EmptyState.BEvzDDvy.css","cc6ff67d.C_qUEjhN.js","08a3b809.DE8GX3m3.js","d25d1b95.DkedqTWK.js","bf513f9c.BITc5iYn.js","e39bc11c.DZRk2vl_.js","7a8217fd.C2rM5fX2.js","8599b02a.C02H2K0N.js","assets/useShopPayProgressIntercepts.CIy8uDiZ.css","cf29e63b.CWl11nWq.js","assets/Tipping.BcTJoNaV.css","dfc03c53.Dg5Pab1i.js","86720dbb.C0NBtMoX.js","dfca5da5.CtpsmRuf.js","dae24aab.xiAL8T3Q.js","assets/Section.CU18S7Ap.css","55098bf1.OVeEjE2R.js","0e67bd3b.DYIAHGYe.js","74835653.B3C9_9vV.js","3ca8ef7e.CGmhNbCs.js","2495faa4.B5RDSEV2.js","a9fa9fda.DtwHg2w5.js","ca3e798e.j1SNghYW.js","47b970b2.B55cGlxq.js","assets/PhoneField.uZEuHncj.css","064f6ac1.CZOb24JP.js","assets/Popover.Bi1nHaU-.css","assets/BillingAddressForm.BdwN7V1K.css","f692f62f.T4hOHGz4.js","9babe369.YjVJF-bz.js","b684bff6.YNZp59HI.js","assets/RedirectionNotice.DgiInWJ-.css","79974aab.Du4uYIZv.js","58314944.DeRGAACO.js","assets/PaymentMethodProgressionHost.BIxPaYCu.css","434e3b0a.B1BBnK_d.js","50130ded.DH09jAiU.js","65f3d4da.Bb3QiqCm.js","31cc568e.95lmLO5k.js","assets/KnownBuyerPaymentMethodSelector.BXqN6ZOx.css","c10167e6.CgbE6jxX.js","b9c0319a.B2HCovnd.js","dffdfb34.CA8WE4ll.js","1f5e7811.PrD3cLrR.js","assets/ShopPayLogo.87JMHPUK.css","c6c0cbda.AqWWc50G.js","assets/useHasViolations.BnDF3H7t.css","2fdb3dd3.CAXoTPkz.js","17425706.ozCo4ACy.js","cb5cf153.BGCuT8HB.js","e3e348f2.CUB8gYam.js","71ae3d5c.BTocP6cf.js","cb38e5c2.6itoXFFb.js","78ab3dd0.CxYXHIAF.js","ed9f2238.DoGJCDiA.js","6fb6f9d8.D5bv4loK.js","1444e6bd.m8JEnfnf.js","0b8657b8.-bvTvyc8.js","7b0c98ea.DsQmemn7.js","assets/TransitionHeight.CuRoM9zv.css","d22d2b80.Bn2GBJa_.js","f49d4216.Dq3WwT1N.js","assets/VatNumberValidationField.CYhzzEkL.css","f1968089.B9S0NE97.js","17e57de1.d8zWzF56.js","assets/PaymentOptionSelector.s-Kd_X2E.css","91811554.CYqi2oY6.js","64de7b49.BpfyYV-0.js","347b440c.b4pdpzx1.js","9ce08e25.q3KqAteP.js","assets/EstimatedDeliveryContent.B_THySFF.css","0e9ee714.p7sY_b4Y.js","39921a74.DpNP_yGV.js","assets/Switch.BS8yVgoP.css","ccdf3592.8u-hHDlt.js","71b60e0a.DfPLdYsH.js","24773686.DbrpS9Ga.js","ec391382.DK5Vlhzz.js","assets/StickyPayButton.Cv62Qqkq.css","a25deb9a.BCJws3RR.js","01973ac7.BHLY876L.js","945a08d6.zhlWcV3z.js","7bc8057b.C2psJszD.js","assets/constants.xO_7ctnq.css","2b89a178.FWorZmkI.js","910cd6e2.DZkJplDp.js","181d38d3.T13hkdEm.js","792bb671.B3OvVnSg.js","assets/Middot.D7Ujmshx.css","d6447d9e.IglBvAnL.js","f51e663e.DTa726QN.js","8e79be58.DGz48SHb.js","assets/ShippingMethodSelector.B0hio2RO.css","90e26f5f.QVrWOr6w.js","assets/SubscriptionPriceBreakdown.vTcdVGq4.css","assets/ShippingLines.LcqrKXE1.css","ca5e9c49.DCsOjSbY.js","f3e117aa.CW9Vq1VP.js","68887467.GX68sO1G.js","ca8e826d.Z4Yo84Sw.js","assets/Avatar.gBkEAe_p.css","17a5f1e4.Rx2_Gm8c.js","0e4087ec.C61RjYJw.js","7aefefff.CQiXfvjt.js","b3389d5c.BeFZm6h8.js","73a9b0a0.D2P9KQKP.js","81e109b1.DOkM2TK2.js","e0989459.bnt6Bm9T.js","cdfd59e6.DxvM3skh.js","assets/RememberMeSection.JBO5WNhc.css","fc21c11a.aqndU9GV.js","e129c76e.D6dvxVQ1.js","d4ea2faa.BWUhdW6Q.js","fe885b80.D8CKOxv4.js","f78726c8.90HJ76iF.js","assets/hooks.CKE1iCma.css","e477f96c.BeMbLJgj.js","1ed8f5e3.CRF_7oqg.js","assets/floating-layer.DfWUBaTh.css","7ee73f43.DtddgRqM.js","0c0ad074.BoVClIit.js","assets/useShopPayButtonClassName.BrcQzLuH.css","87bfafec.CxwEzGHg.js","assets/PayButtonSection.CZuxzxFG.css","d2e6a587.DsEYL8br.js","assets/MobileOrderSummary.DjDhVpQB.css","assets/BelowTheFoldContent.CyS-bj2t.css"])))=>i.map(i=>d[i]);
2import{_ as e}from"./app.C_W8kcQ4.js";import{u as n,k as t,w as a,S as i,X as r,i as o,x as l,h as s,T as u,y as c,I as d,j as p,p as h,L as m,s as v,o as y,g,q as f,z as b,n as _,ah as C,m as P,_ as S,G as A,N as k}from"./2c1ab0fe.B2yRRyAW.js";import{H as E,bD as w,aM as O,fA as I,L as R,hX as T,ce as L,dh as N,G as D,al as M,b as B,j as x,S as V,aa as F,B as H,ed as z,c4 as j,o as U,bY as G,c3 as Y,eO as W,A as q,dc as $,a1 as K,hC as J,gP as Z,f as X,ab as Q,c as ee,bs as ne,hY as te,c2 as ae,fL as ie,c0 as re,b$ as oe,dK as le,eV as se,br as ue,d3 as ce,e$ as de,d as pe,K as he,bR as me,l as ve,dR as ye,v as ge,hZ as fe,aW as be,cH as _e,a9 as Ce,eT as Pe,aX as Se,Z as Ae,h_ as ke,eY as Ee,au as we,hA as Oe,bZ as Ie,cQ as Re,h$ as Te,i0 as Le,i1 as Ne,i2 as De,ff as Me,eo as Be,cN as xe,hb as Ve,i3 as Fe,i4 as He,bP as ze,i5 as je,bK as Ue,cB as Ge,eZ as Ye,em as We,bE as qe,i6 as $e,i7 as Ke,d4 as Je,dk as Ze,dn as Xe,i8 as Qe,df as en,di as 
2nn,bV as tn,i9 as an,ia as rn,dl as on,dm as ln,cD as sn,hh as un,hi as cn,U as dn,f1 as pn,eW as hn,bL as mn,fc as vn,be as yn,aC as gn,aT as fn,ib as bn,bM as _n,ic as Cn,id as Pn,cp as Sn,ez as An,e_ as kn,fb as En,f2 as wn,ie as On,ai as In,as as Rn,M as Tn,cs as Ln,ig as Nn,m as Dn,ih as Mn,t as Bn,ii as xn,cC as Vn,f6 as Fn,c7 as Hn,cl as zn,cb as jn,dq as Un,f3 as Gn,aS as Yn,dr as Wn,i as qn,ao as $n,V as Kn,fh as Jn,p as Zn,ij as Xn,aj as Qn,eU as et,hq as nt,bq as tt,af as at,ag as it}from"./164ad2e3.-hfWY9cN.js";import{c as rt,cy as ot,a6 as lt,W as st,jc as ut,jL as ct,bH as dt,bx as pt,bD as ht,jM as mt,gC as vt,hT as yt,aM as gt,hR as ft,hP as bt,aO as _t,hS as Ct,jz as Pt,bt as St,aJ as At,bw as kt,jN as Et,n as wt,jO as Ot,ge as It,bI as Rt,b8 as Tt,bi as Lt,hw as Nt,L as Dt,m as Mt,jP as Bt,J as xt,ag as Vt,dk as Ft,x as Ht,I as zt,fb as jt,ae as Ut,gl as Gt,jQ as Yt,l as Wt,fw as qt,_ as $t,jR as Kt,K as Jt,b9 as Zt,jS as Xt,jT as Qt,f5 as ea,O as na,c8 as ta,ex as aa,H as ia,jU as ra,eP as oa,ek as la,ac as sa,e7 as ua,bd as ca,iV as da,ai as pa,gy as ha,b6 as ma,c4 as va,e3 as y
2a,jV as ga,z as fa,f6 as ba,iZ as _a,jW as Ca,jX as Pa,jY as Sa,i$ as Aa,gm as ka,u as Ea,gA as wa,V as Oa,jZ as Ia,ff as Ra,fc as Ta,d4 as La,cz as Na,cB as Da,cC as Ma,cA as Ba,j_ as xa,j as Va,eN as Fa,c$ as Ha,fA as za,i_ as ja,bl as Ua,au as Ga,j$ as Ya,db as Wa,at as qa,d9 as $a,c_ as Ka,j4 as Ja,k0 as Za,k1 as Xa,k2 as Qa,k3 as ei,k4 as ni,k5 as ti,j6 as ai,d2 as ii,k6 as ri,j1 as oi,ab as li,k7 as si,C as ui,k8 as ci,ar as di,k9 as pi,ka as hi,kb as mi,kc as vi,p as yi,h as gi,iP as fi,iQ as bi,kd as _i,ke as Ci,aq as Pi,bf as Si,iT as Ai}from"./4b4bc88f.JFrEI7LU.js";import{w as ki,x as Ei,C as wi,y as Oi,f as Ii,U as Ri,u as Ti,I as Li,i as Ni,z as Di,B as Mi,F as Bi,G as xi,H as Vi,J as Fi,K as Hi,k as zi,M as ji,S as Ui,N as Gi,O as Yi,Q as Wi,R as qi,h as $i,T as Ki,W as Ji,X as Zi,Y as Xi,Z as Qi,g as er,j as nr,_ as tr,D as ar,c as ir,$ as rr,d as or,a0 as lr,l as sr,m as ur,n as cr,e as dr,V as pr,p as hr,E as mr,o as vr}from"./dffdfb34.CA8WE4ll.js";import{k as yr,D as gr,u as fr,s as br,b as _r,c as Cr,l as Pr,a as Sr,H as Ar}from"./0e9ee714.p7sY_b4Y.js";import{X as kr,U as Er,N as wr,W as Or,b as Ir,Y as Rr,Z as Tr,c as Lr,d as Nr,G as Dr,S as Mr,e as Br,_ as xr,$ as Vr,a0 as Fr,a1 as Hr,a2 as zr,f as jr,n as Ur,v as Gr,x as Yr,p as Wr,q as qr,r as $r,z as Kr,s as Jr,A as Zr,V as Xr,a3 as Qr,a4 as eo,h as no,u as to,t as ao,T as io,i as ro}from"./6bfea526.DhpjKDX-.js";import{a as oo,c as lo,S as so,M as uo}from"./dfca5da5.CtpsmRuf.js";import{T as co,S as po,M as ho}from"./79974aab.Du4uYIZv.js";import{R as mo,P as vo,C as yo}from"./e77f7fe0.B1UY2cg5.js";import{A as go,C as fo,u as bo,S as _o}from"./0e67bd3b.DYIAHGYe.js";import{b as Co,a as Po,f as So,u as Ao}from"./a25deb9a.BCJws3RR.js";import{E as ko,u as Eo,b as wo,a as Oo,c as Io}from"./01973ac7.BHLY876L.js";import{u as Ro}from"./945a08d6.zhlWcV3z.js";import{c as To,a as Lo}from"./58314944.DeRGAACO.js";import{P as No}from"./598fef4e.C__a6xIj.js";import{O as Do,W as Mo,b as Bo,a as xo}from"./7a8217fd.C2rM5fX2.js";import{a as Vo,b as Fo,C as Ho}from"./efa0389a.DgBvBH2e.js";import{a as zo,S as jo,u as Uo,b as Go}from"./bf513f9c.BITc5iYn.js";import{U as Yo,I as Wo}from"./7bc8057b.C2psJszD.js";import{B as qo,A as $o}from"./74835653.B3C9_9vV.js";import{g as Ko,d as Jo,c as Zo,e as Xo}from"./d25d1b95.DkedqTWK.js";import{u as Qo,S as el}from"./c6c0cbda.AqWWc50G.js";import{S as nl,E as tl,f as al,r as il,e as rl,h as ol,i as ll,j as sl,b as ul,c as cl,I as dl,g as pl}from"./f1968089.B9S0NE97.js";import{b as hl,a as ml,t as vl,d as yl,u as gl,c as fl}from"./2b89a178.FWorZmkI.js";import{a as bl,v as _l,b as Cl,u as Pl}from"./1f5e7811.PrD3cLrR.js";import{a as Sl}from"./f67abd2c.Boj0gJpa.js";import{S as Al}from"./39921a74.DpNP_yGV.js";import{u as kl,a as El,M as wl,b as Ol}from"./b684bff6.YNZp59HI.js";import{C as Il,b as Rl,E as Tl}from"./a422df8c.p_hgP_ap.js";import{u as Ll,h as Nl}from"./17425706.ozCo4ACy.js";import{C as Dl}from"./cf29e63b.CWl11nWq.js";import{u as Ml,d as Bl,c as xl}from"./24773686.DbrpS9Ga.js";import{S as Vl}from"./6fb6f9d8.D5bv4loK.js";import{S as Fl}from"./cb5cf153.BGCuT8HB.js";import{S as Hl}from"./cb38e5c2.6itoXFFb.js";import{u as zl,a as jl}from"./22345fd4.CQJ0n-1P.js";import{v as Ul}from"./9dba8418.BqWu-Ch9.js";import{P as Gl}from"./47b970b2.B55cGlxq.js";import{I as Yl}from"./55098bf1.OVeEjE2R.js";import{a as Wl}from"./ed9f2238.DoGJCDiA.js";import{A as ql,C as $l}from"./4b1c22b7.BOiV_1od.js";import{V as Kl,M as Jl,u as Zl,a as Xl,S as Ql,R as es,b as ns}from"./910cd6e2.DZkJplDp.js";import{b as ts,a as as,g as is}from"./e12db40c.ZpKYxNRe.js";import{r as rs}from"./dae24aab.xiAL8T3Q.js";import{D as os,u as ls,S as ss}from"./d6447d9e.IglBvAnL.js";import{g as us}from"./65f3d4da.Bb3QiqCm.js";import{M as cs,c as ds,u as ps,b as hs}from"./64de7b49.BpfyYV-0.js";import{u as ms,S as vs,a as ys,E as gs}from"./347b440c.b4pdpzx1.js";import{b as fs}from"./2fdb3dd3.CAXoTPkz.js";import{u as bs}from"./ca5e9c49.DCsOjSbY.js";import{f as _s,i as Cs}from"./e3e348f2.CUB8gYam.js";import{S as Ps}from"./f3e117aa.CW9Vq1VP.js";import{T as Ss}from"./7b0c98ea.DsQmemn7.js";import{F as As}from"./3ca8ef7e.CGmhNbCs.js";import{D as ks}from"./f49d4216.Dq3WwT1N.js";import{S as Es}from"./f51e663e.DTa726QN.js";function ws(){const{i18n:e}=rt();return n(E,{level:1,children:e.translate("embed.header.review_order")})}function Os(){const{hasError:e}=w(ot),i=Co().value,{i18n:r,observability:o}=rt(),l=r.translate("review.blocks.change_link_label"),{inMemoryAmazonPayParts:{hasPaymentSheetError:s,sdkStatus:u}}=lt(),c=t(()=>{const e=u.value;return e.status===O.Available?e.sdk:void 0});if(!i)return null;const d=I(i.method.walletParams)?.checkout_session_id;return n(a,{when:c,children:t=>n(R,{onClick:()=>{try{t.buywithprime.changePaymentMethod({amazonPayOptions:{amazonCheckoutSessionId:d,isDeclined:e}})}catch(n){s.value=!0,o.error(new T(`Error on changing buyer payment method. Details: ${n}`,{cause:n}))}},children:l})})}function Is(){const e=rt(),{i18n:t}=e,a=function({checkout:e}){return"buyWithPrime"===e.identity.current.value?{rollupId:"buyWithPrimePayDetails",sdkButton:n(ki,{wallet:st.BuyWithPrime,isSdkOnly:!0}),changeLink:n(Os,{})}:{rollupId:"amazonPayDetails",sdkButton:n(go,{isSdkOnly:!0}),changeLink:n(kr,{})}}(e);return n(i,{children:[a.sdkButton,n(mo,{id:a.rollupId,label:t.translate("payment.title"),primaryContent:n(Rs,{}),primaryAction:a.changeLink})]})}function Rs(){const{brand:e,descriptor:t}=Er().value,a=L(),i=ut(),r=N();return a.value?i.value?n(wr,{vaulted:!0,reason:"giftCard"}):t&&r.value?n(Or,{brand:e,descriptor:t}):n(D,{}):n(wr,{vaulted:!0,reason:"freeOrder"})}function Ts({label:e}){const{i18n:t}=rt();return M(),n(i,{children:[n(B,{accessibilityRole:"status",children:n(x,{accessibilityVisibility:"exclusive",children:t.translate("vaulted.loading_section",{section:e(t)})})}
2),n(V,{gap:"small-300",children:[n(D,{inlineSize:"large"}),n(D,{inlineSize:"large"}),n(D,{inlineSize:"small"})]})]})}class Ls{#e=c(0);#n=d(()=>this.#e.value>0);get hasFailures(){return this.#n}register(){return this.#e.value+=1,()=>{this.#e.value-=1}}}const Ns=r(null);function Ds({children:e}){const t=u(()=>new Ls,[]);return n(Ns.Provider,{value:t,children:e})}function Ms(){const{i18n:e}=rt(),t=l(Ns);return t?n(a,{when:()=>t.hasFailures.value,children:n(B,{paddingBlockEnd:"base",children:n(ko,{bannerId:"VaultedRollupContentsLoadError",errorType:F.CheckoutError,heading:e.translate("error_page.terminal.title"),tone:"critical",autoFocus:!0,iconHidden:!0,children:n(V,{gap:"small-400",alignItems:"start",children:[n(x,{children:e.translate("error_page.terminal.message")}),n(H,{variant:"plain",onClick:()=>globalThis.location.reload(),children:e.translate("error_page.terminal.action.cta")})]})})})}):null}function Bs({children:e}){const t=l(Ns),a=t?.hasFailures.value??!1;return n(B,{inert:a,opacity:a?50:void 0,children:e})}const xs=()=>e(()=>import("./26e63865.CTITysiQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121]));function Vs(){return p(xs)}function Fs(e,t,a){return function({displayName:e,load:t,loadingLabel:a}){return o({displayName:e,load:t,suspense:!1,renderLoading:()=>n(Ts,{label:a}),useError:function(n){const{observability:t}=rt(),a=l(Ns);M({active:Boolean(n)}),s(()=>{if(n)return t.error(n,{metadata:{vaulted:{component:e,failure:"lazy_load",boundary:a?"present":"missing"}}}),a?.register()},[n,t,a])}})}({displayName:e,loadingLabel:t,load:async()=>a((await Vs()).vaultedRollupContents)})}const Hs=Fs("DefaultVaultedPaymentRollupContent",e=>e.translate("payment.title"),e=>e.DefaultVaultedPaymentRollupContent),zs=Fs("VaultedShippingMethodsRollupContent",e=>e.translate("shipping.title"),e=>e.VaultedShippingMethodsRollupContent),js=Fs("VaultedBillingAddressRollupContent",e=>e.translate("billing.billing_address_title"),e=>e.VaultedBillingAddressRollupContent),Us=Fs("DefaultVaultedDeliveryAddressRollupContent",e=>e.translate("shipping.shipping_address_title"),e=>e.DefaultVaultedDeliveryAddressRollupContent),Gs=Fs("VaultedLocalPickupOptionsRollupContent",e=>e.translate("local_pickup.title"),e=>e.VaultedLocalPickupOptionsRollupContent),Ys=Fs("VaultedPaymentOptionsRollupContent",e=>e.translate("payment.payment_option.title"),e=>e.VaultedPaymentOptionsRollupContent);function Ws(e,n){const t=new Set(n.map(e=>e.id));return e.some(e=>t.has(e.id))}function qs(e,n){const t=z();return h(()=>{n&&Ws(t.blockingExtensions.value,e)&&m(()=>n())}),Ws(t.blockingExtensions.value,e)}function $s(){const{checkout:{negotiator:e}}=rt(),{generalPaymentError:n,generalPaymentErrorCode:a}=e.parts,{violations:i}=j(ct);return t(()=>!!n.value&&(!dt(a.value)||i.value.size>0))}function Ks({showTips:e,billingFormPosition:n}){const t=U("Checkout::Dynamic::Render","PAYMENT1"),a=U("Checkout::Dynamic::Render","PAYMENT2"),i=U("Checkout::Dynamic::Render","PAYMENT3"),r="inContext"===n||"hidden"===n||"afterPayment"===n&&e?[[],t,a]:[a,t];return(e||"afterPayment"===n)&&r.push(i),r}function Js(e,n){return e.currentUrl.value.hash===`#${n}`}function Zs(e,n=!1){const{router:a}=rt(),i=v(e),r=t(()=>Js(a,i.value)),o=y(n);return s(()=>{r.peek()&&(o.value=!0)},[r,o]),o}function Xs({autoOpen:e=!0,isMissing:n,open:t}){s(()=>{e&&n&&(t.value=!0)},[e,n,t]);const{shopPay:{progressInterceptor:a}}=rt();s(()=>{if(n)return a.listenResult(e=>{e||(t.value=!0)})},[a,n,t])}function Qs(){const{loading:e}=W(),{checkout:n}=rt(),t=n.isShippingRequired.value,a=n.negotiator.parts.shippingAddress.value,{shippingAddress:i,deliveryNext:r}=n.negotiator.current.fields,o=i.value,l=vt(r.value),s=!t||!e&&(l||a?.countryCode===o?.countryCode),u=y(s);return s&&!u.value&&(u.value=!0),u}function eu(){const{shop:e}=rt(),n=e.hasFlagEnabled(ft),a=Ir(),i=bt(),r=_t(),o=Ct(),{loading:l}=W(),s=v(l),u=Rr(a),c=Qs(),d=t(()=>{const e=a.value;if(o.value&&e&&!(e.balance.amount<=0))return u.value?Tr({firstOrderTotal:i.value,storeCreditAccount:e}):0===r.value?.amount&&i.value?.currencyCode===e.balance.currencyCode?e.balance:void 0}),p=Lr(a),h=t(()=>{const e=c.value,t=!s.value,a=p.value,i=null!=d.value;return n&&e&&t&&a&&i});return{storeCreditBalanceForSubscriptionRenewals:d,showStoreCreditForSubscriptionRenewals:h}}function nu(){const{i18n:e,checkout:{negotiator:t}}=rt(),{paymentLines:a}=t.parts,{violations:i}=j(ct),{message:r,tone:o}=Eo(),l=[...i.value][0],u=l&&(l.localizedMessage||l.nonLocalizedMessage),c=a.value.find(e=>"giftCard"!==e.method.type&&"redeemable"!==e.method.type)?.method,d="customOnsite"===c?.type?c:void 0,p=d?e.translate("payment_errors.local_payment_method_unavailable",{payment_method:d.name}):void 0,h=Boolean(r)&&("critical"===o||"warning"===o),m=u&&p&&h?`${p}. ${u}
2`:void 0;return s(()=>{if(m)return q({content:m})},[m]),u&&d?n(ko,{errorType:F.PaymentError,bannerId:"LocalPaymentMethodUnavailableBanner",tone:"warning",heading:p,autoFocus:!h,children:u}):null}function tu({openRedeemablesModal:e,includeStoreCredit:t=!0}){const{i18n:a}=rt(),i=Nr(),{paymentLines:r}=$(),o=t&&i.value.length>0,l=r.length>0,s=[...t?i.value:[],...r];if(!s.length)return null;let u="";return u=l&&o?a.translate("payment.gift_card_store_credit.manage_label"):l?a.translate("payment.gift_card_wrapper.manage_label"):a.translate("payment.store_credit.manage_label"),n(V,{children:[n(V,{gap:"small-200",padding:"small-100",border:"base",borderRadius:"base base none none",children:s.map(e=>n(au,{paymentLine:e},Pt(e.method)))}),n(B,{inlineAlignment:"start",padding:"small-200",borderWidth:"none base base base",borderRadius:"none none base base",children:n(R,{onClick:e,textDecoration:"none",children:n(V,{direction:"inline",alignItems:"center",gap:"small-200",children:[n(K,{type:"edit"}),n(x,{children:u})]})})})]})}function au({paymentLine:e}){const{i18n:t}=rt();switch(e.method.redemptionSource){case"STORE_CREDIT":return n(Q,{gridAutoFlow:"column",gridAutoColumns:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",children:[n(V,{direction:"inline",alignItems:"center",gap:"small-100",children:[n(No,{type:"store-credit"}),n(x,{children:t.translate("payment.store_credit.label")})]}),n(X,{textAlign:"end",children:n(x,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]});case"CUSTOM":{const a=e.method.redemptionContent,i=J(a);return n(Q,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 70%) minmax(0, 30%)",gridTemplateRows:"minmax(0, 1fr)",children:[n(V,{direction:"inline",alignItems:"center",gap:"small-100",children:[n(No,{type:"gift-card"}),n(x,{children:t.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Z(i)})})]}),n(X,{textAlign:"end",children:n(x,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]})}default:return null}}function iu({open:e,onClose:t,includeStoreCredit:a=!0}){const{i18n:r,checkout:o}=rt(),l=Ir(),u=Lr(l),{canApplyGiftCards:c,paymentLines:d}=$(),p=St(),h=a&&o.configuration.visibility.showStoreCreditRedemption.value&&u.value,m=c||d.length>0,v=g(m);s(()=>{const n=v.current&&!m;v.current=m,e&&n&&!h&&t()},[h,m,t,e]);let y="";h&&m?y=r.translate("payment.gift_card_store_credit.manage_label"):m?y=r.translate("payment.gift_card_wrapper.manage_label"):h&&(y=r.translate("payment.store_credit.manage_label"));const f=()=>{(p.value||!c&&h)&&t()},b=a?n(i,{children:[n(Mr,{}),n(Br,{afterAppliedRedeemablesChange:f})]}):null;return n(Do,{heading:y,open:e,onHide:t,children:n(V,{gap:"base",children:[o.configuration.visibility.showStoreCreditRedemption.value?b:null,n(Dr,{afterAppliedRedeemablesChange:f,autoSelect:!0,showHeading:!1})]})})}function ru(){const e=Ir(),n=Lr(e),a=Rr(e),i=Qs(),r=_t();return t(()=>{const e=0===r.value?.amount&&!a.value;return n.value&&i.value&&!e})}function ou(){const{paymentLines:e}=$(),n=ru(),{showStoreCreditForSubscriptionRenewals:t}=eu();return Boolean(e.length)||n.value||t.value}function lu({afterAppliedRedeemablesChange:e,placement:i}){const{i18n:r,userEvents:o,shop:l,source:u,checkout:c}=rt(),{paymentLines:d,remove:p}=$(),{useStoreCreditForSubscriptionRenewals:m}=c.negotiator.parts,v=_t(),g=yt(),b=gt(),_=Ir(),C=Rr(_),P=y(xr.Init),S=t(()=>P.value===xr.Loading),A=ou(),k=ru(),{storeCreditBalanceForSubscriptionRenewals:E,showStoreCreditForSubscriptionRenewals:w}=eu(),O=t(()=>g.value||b.value),I=t(()=>g.value?r.translate("payment.store_credit.buying_gift_card"):b.value?r.translate("payment.store_credit.no_fixed_selling_plans"):void 0),R=Vr(_.value,P),T=Fr(_.value,P),L=y(N());function N({storeCreditSelected:e=C.value,subscriptionRenewalsSelected:n=m.value}={}){const t=d.map(({method:e})=>Pt(e));return e&&t.unshift(Hr),n&&t.splice(e?1:0,0,zr),t}s(()=>{L.value=N()},[d]),h(()=>{const e=C.value,n=m.value;L.value=N({storeCreditSelected:e,subscriptionRenewalsSelected:n})});const D=f((e,n)=>{const t=n?"add":"remove",a=i?`${i}_`:"";o.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(u,c,l),action:`${a}manage_redeemables_${t}_${e}`}})},[c,o,i,l,u]),M=f(async n=>{const t=L.value,a=t.length>n.length,{shorter:i,longer:r}=a?{shorter:n,longer:t}:{shorter:t,longer:n};L.value=n;const o=r.find(e=>!i.includes(e)),l=o===zr;let s=!1;if(o===Hr)if(D("store_credit",!a),a){const e=m.value;m.value=!1,({landed:s}=await T()),s||(m.value=e)}else({landed:s}=await R());else if(l){const e=!a;D("store_credit_subscription_renewals",e),m.value=e}else{D("gift_card",!a);const e=d.find(e=>Pt(e.method)===o);if(e?.method){const n=await p(e.method);s="success"===n?.status}}s&&e?.()},[e,R,L,d,D,p,T,m]),B=t(()=>S.value||O.value),F=t(()=>B.value||0===v.value?.amount&&!C.value),H=B;if(!A)return null;const z=_.value?.balance,j=E.value,U=I.value;return n(V,{gap:"base",borderRadius:"base base none none",padding:"expanded"===i?"small-100 none none none":void 0,children:n(Vo,{name:"redeemables_list",values:L.value,onChange:M,variant:"block",multiple:!0,children:[k.value&&z&&n(Fo,{value:Hr,disabled:F.value,secondaryContent:n(x,{type:"strong",children:r.formatCurrency(z.amount,{currency:z.currencyCode})}),details:U&&n(x,{children:U}),children:n(V,{direction:"inline",gap:"base",alignItems:"center",children:[n(x,{children:r.translate("payment.store_credit.apply_label")}),n(a,{when:S,children:n(ee,{})})]})}),w.value&&j&&n(Fo,{value:zr,disabled:H.value,details:n(V,{gap:"small-500",children:[n(x,{children:r.translate("payment.store_credit.remaining_for_subscription_charges_description",{amount:r.formatCurrency(j.amount,{currency:j.currencyCode})})}),U&&n(x,{children:U})]}),children:n(x,{children:r.translate("payment.store_credit.use_remaining_for_subscription_charges_label")})}),d.map(e=>n(su,{paymentLine:e},Pt(e.method)))]})})}function su({paymentLine:e}){const{i18n:t}=rt(),a=e.method.redemptionContent,i=J(a);return n(Fo,{value:Pt(e.method),secondaryContent:n(X,{textAlign:"end",children:n(x,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})}),children:n(V,{children:[n(X,{children:t.translate("payment.gift_card_checkbox_label")}),n(V,{direction:"inline",gap:"small-400",children:[n(K,{type:"gift-card"}),n(x,{color:"subdued",children:[" ",Z(i)]})]})]})})}function uu(){const{checkout:e}=rt(),t=y(!1),a=cu();switch(e.identity.current.value){case"shopPay":return n(lu,{placement:"summary"});case"customerAccount":case"businessCustomer":return n(V,{gap:"base",children:[a?n(i,{children:[n(Mr,{}),n(Br,{})]}):null,n(tu,{includeStoreCredit:!1,openRedeemablesModal:()=>t.value=!0}),n(iu,{includeStoreCredit:!1,open:t.value,onClose:()=>t.value=!1})]});default:return null}}function cu(){const{checkout:e}=rt(),n=Ir(),t=Lr(n),a=Rr(n),i=_t(),r=a.value,o=0===i.value?.amount&&!r;return t.value&&(e.configuration.visibility.showStoreCreditRedemption.value||r)&&!o}const du={ONE_PERCENT_CASHBACK:"1",THREE_PERCENT_CASHBACK:"3"};function pu({children:e}){return n(V,{direction:"inline",gap:"small-200",alignItems:"center",children:e})}function hu({handleNoValidCards:e}){const[t,a]=b(!1),{i18n:r,observability:o,shopPay:l,checkout:{negotiator:u}}=rt(),c=u.current.fields.paymentMethods.value,d=l.session.paymentMethodOption.value,p=jr(),h=p.selectedCreditCard.value,m=p.selectedPaymentMethod.value,v=p.selectedPaymentMethodItem.value,y=p.paymentMethods.value,g=l.user.hasFlow.value,f=Ur(h),_=y.find(e=>!e.isDisabled);if(s(()=>
2{if(t){const e=setTimeout(()=>{a(!1)},750);return()=>clearTimeout(e)}},[t]),s(()=>{_?"SHOPIFY_INSTALLMENTS"===d?.name&&!0===v?.isDisabled&&(p.selectPaymentMethod(_.method),a(!0)):g&&e()},[v?.isDisabled,d?.name,e,_,p,g]),!m)return null;if(t)return n(pu,{children:n(D,{})});if("CUSTOM_ONSITE"===m.paymentMethod){const e=c?.find(e=>m.paymentBrands&&kt(e,m.paymentBrands));if(!e)return o.log("shop_pay_payment_line_custom_onsite_payment_selected","customOnsitePaymentMethod was selected but not in negotiatedPaymentMethods",{selectedPaymentMethod:JSON.stringify(m),negotiatedPaymentMethods:JSON.stringify(c)}),null;const t=ne(e)&&Boolean(e.incentiveType),a=1===e.paymentBrands?.length?e.paymentBrands[0]:"generic";if(t){const t=du[e.incentiveType],i={title:r.translate("payment.usdc_cashback_title",{incentive_percentage:t}),additionalInfo:r.translate("payment.usdc_cashback_additional_info",{terms_url:Yo,incentive_percentage:t}),terms:r.translate("payment.usdc_cashback_terms"),termsUrl:Yo};return n(pu,{children:[n(x,{children:e.name}),n(Wo,{notice:i,selected:!1}),n(No,{type:a})]})}return n(vo,{paymentLine:{method:e},showAmount:!1})}if(Gr(m))return n(pu,{children:[n(x,{children:n(x,{children:r.translate("payment.ideal_label")})}),n(No,{type:"ideal"})]});if(Yr(m))return n(pu,{children:[n(x,{children:r.translate("brand.apple_pay")}),n(No,{type:"apple_pay"})]});if(Wr(m))return n(pu,{children:[n(x,{children:r.translate("brand.paypal")}),n(No,{type:"paypal"})]});if(qr(m)||$r(m)){const e=r.translate("payment_gateway.shop_pay.name"),t=$r(m)?r.translate("payment_gateway.shop_pay.installments_label"):void 0;return n(pu,{children:[n(x,{children:e}),n(No,{type:"shop_pay"}),t?n(x,{color:"subdued",children:t}):null]})}if(Kr(m))return n(pu,{children:n(x,{children:m.name})});if(Jr(m))return null;if(Zr(m))return null;const C=m.paymentAttributes;return n(Xr,{name:f,digits:n(i,{children:[n(yo,{}),n(x,{size:"base",tone:"neutral",children:C.lastDigits})]}),icon:n(No,{type:C.brand})})}function mu(){const{checkout:{negotiator:e}}=rt(),t=e.parts.paymentLines.value,a=u(()=>t.find(e=>"giftCard"!==e.method.type&&"redeemable"!==e.method.type),[t]);return n(V,{gap:"small-400",children:[a&&n(vo,{paymentLine:a,showCardBrandLabel:!0}),n(Qr,{})]})}function vu({openSignal:e}){const{checkout:{identity:t}}=rt();return"shopPay"===t.current.value?n(hu,{handleNoValidCards:()=>e.value=!0}):n(mu,{})}function yu(){const{i18n:e}=rt(),t=Et("STORE_CREDIT"),{paymentLines:a}=$(),i=[...t.value,...a];return i.length?n(V,{gap:"small-200",children:i.map(t=>{const a=t.cost?n(x,{children:[" - ",e.formatCurrency(t.cost.amount,{currency:t.cost.currencyCode,form:"short"})]}):null;switch(t.method.redemptionSource){case"STORE_CREDIT":return n(V,{direction:"inline",alignItems:"center",gap:"base",children:[n(No,{type:"store-credit"}),n(X,{children:[e.translate("payment.store_credit.label"),a]})]},Pt(t.method));case"CUSTOM":{const i=t.method.redemptionContent,r=J(i);return n(V,{direction:"inline",alignItems:"center",gap:"base",children:[n(No,{type:"gift-card"}),n(X,{children:[e.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Z(r)}),a]})]},Pt(t.method))}default:return null}})}):null}function gu({paymentExemptionReason:e}){const{checkout:{identity:t}}=rt();return"shopPay"!==t.current.value||"storeCredit"!==e&&"redeemables"!==e?n(yu,{}):n(wr,{vaulted:!0,reason:e})}function fu({hasPersistentRedeemablesManagement:e,openSignal:t}){const{checkout:a}=rt(),i=zo(),r=St();return"freeOrder"===i.value?n(wr,{vaulted:!0,reason:"freeOrder"}):"giftCard"===i.value?n(wr,{vaulted:!0,reason:"giftCard"}):function({identity:e,paymentExemptionReason:n,paymentFullyCoveredByRedeemablesAndGiftCards:t}){return!!t&&("shopPay"!==e.current.value||("storeCredit"===n||"redeemables"===n))}({identity:a.identity,paymentExemptionReason:i.value,paymentFullyCoveredByRedeemablesAndGiftCards:r.value})?n(gu,{paymentExemptionReason:i.value}):n(V,{gap:"small-200",children:[!e&&n(yu,{}),n(vu,{openSignal:t})]})}function bu(){const{checkout:e}=rt(),n=e.latestReceipt.value,{value:t}=e.negotiator.current.fields.paymentMethods,{inMemoryGooglePayParts:{sdkStatus:a,paymentSheetError:i},persistedGooglePaySignal:r,receiptErrorSignal:o}=lt(),l=te({shouldResetCustomerInfo:!1}),u=ae("failed"===n?.status&&"payment"===n.failure.type?n.failure:void 0),c=wt(l);return h(()=>{"error"===a.value.status&&m(()=>{c.current(),i.value={type:Ot}}
2)}),s(()=>{It(t,"GOOGLE_PAY")||i.value?.type===Ot||(i.value={type:Ot},c.current(),r.value={...r.value,receiptIdForPaymentFailure:n?.id}),n?.id!==r.value?.receiptIdForPaymentFailure&&"failed"===n?.status&&"payment"===n?.failure.type&&(r.value={...r.value,receiptIdForPaymentFailure:n?.id},o.value=u)},[c,n,o,t,r,i,u]),s(()=>()=>{o.value=void 0},[o]),null}function _u(){const{checkout:e}=rt(),n=e.latestReceipt.value,{value:t}=e.negotiator.current.fields.paymentMethods,{inMemoryPayPalParts:{paymentSheetError:a},persistedPayPalSignal:i}=lt(),r=ie(),o=wt(r),l=u(()=>It(t,"PAYPAL_EXPRESS"),[t]);return s(()=>{l||(o.current(),a.value={type:Ot})},[l,a,o]),s(()=>{if(!n)return;const e=n.id===i.value?.receiptIdForClearedToken,t="failed"===n.status&&"payment"===n.failure.type;!e&&t&&(i.value={...i.value,receiptIdForClearedToken:n?.id},o.current())},[n,l,a,i,o]),null}function Cu(){const{checkout:{identity:e}}=rt();switch(e.current.value){case"payPal":return n(_u,{});case"googlePay":return n(bu,{});default:return null}}function Pu(){const e=rt(),{checkout:a,i18n:r,shop:o,shopPay:l,webMcp:u}=e,c="shopPay"===a.identity.current.value,d=To(),p="payment",{hasAnyPaymentError:y,clearReceiptError:g}=function({clearReceiptErrorOnPaymentLineChange:e=!0}={}){const{hasViolations:n}=G(new Set([...pt,"PAYMENTS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"])),{hasError:t,clearError:a}=w(ht),{checkout:{negotiator:i}}=rt(),{lastJourneyProgression:r}=i,o="failed"===r.value.type&&"completion"===r.value.negotiationStage,l=$s(),s=Y();mt(()=>{e&&a()});const u=t&&!s,c=l.value;return{hasAnyPaymentError:n||u||o||c,errors:{hasExpiryViolation:n,hasReceiptPaymentFailure:t,hasReceiptPaymentError:u,hasSubmitCompletionFailure:o,hasGeneralPaymentError:c},clearReceiptError:a}}({clearReceiptErrorOnPaymentLineChange:!1}),{hasViolations:b}=G(Rt),{hasError:_}=re(),{hasError:C}=oe(),{paymentErrors:P}=le().value,S=P.length>0,{notSupportedError:A}=wo(),k=Boolean(A),E=e.checkout.negotiator.current.fields.buyerIdentity,{value:O}=e.checkout.negotiator.current.fields.paymentFlexibilityPaymentTermsTemplate,I=se(),R=null!=O&&!I.value,T=Tt().value,N=l.session.selectedPaymentMethod.value,D=Lt(N),{value:M}=e.checkout.negotiator.current.fields.paymentMethods,B=jr({enableAutoSelect:!1}),x=wt(B),{buyerHasActedSignal:F}=e.checkout.negotiator.context;s(()=>{if(u&&c)return u.unstable_provideSavedCardSelector(async e=>{const n=x.current;if(!(n instanceof eo))return!1;const t=n.cardPaymentMethods.value.find(({method:n})=>n.id===e)?.method;return!!t&&(F.value=!0,"handled"===(await n.selectPaymentMethod(t,"programmatic",{rebuild:!0})).status)})},[x,c,u,F]);const H=B.paymentMethods.value.length>0,z=null!=N&&Nt(N)?N.paymentBrands??[]:[],j=z.length>0?M?.find(e=>kt(e,z)):void 0,q=ue("Checkout::PaymentMethod::Render",j?.uiExtension?[j.uiExtension]:[]),J=function({checkout:e,shop:n,source:t},{customerProfile:a}){return"shopPay"===e.identity.current.value||Bt({identitySource:e.identity.current.value,isOrderSession:xt(t),storeVaultEnabled:n.storeVaultEnabled,customerProfile:a})}(e,{customerProfile:E.value?.customerProfile}),Z=J&&(c||H),X=J&&0===B.cardPaymentMethods.value.length,{expandedSlot:Q,collapsedSlot:ee}=no(B),ne=y||k||S||_||C,{directPaymentErrors:te,paymentLines:ae}=e.checkout.negotiator.parts,ie=ae.value.some(e=>e.method.type===Dt.CreditCard&&e.method.requiresCvvConfirmation),de=o.storeVaultGuestCvvVerificationEnabled&&ie,pe=Boolean(D)&&!D?.expired&&!D?.verified,he=Boolean(D?.expired)||ne||R||T||de||pe,me=U("purchase.checkout.payment-method-list.render-before"),ve=U("purchase.checkout.payment-method-list.render-after"),ye=Ro([...me,...ve]),ge=Ro(q),fe=yr([...me,...ve]),be=L(),_e=ut(),Ce=t(()=>!(!be.value||_e.value)||Boolean(E.value?.purchasingCompany)),Pe=Zs(p,he||b);qs(q.map(Mt),f(()=>{Pe.value=!0},[Pe])),s(()=>{(he||b)&&(Pe.value=!0)},[he,b,Pe]),to();const Se=f(()=>{Pe.value&&Lo(te)||(Pe.value=!Pe.value,Pe.value&&d(),function({userEvents:e,source:n,checkout:t,shop:a},i){"shopPay"===t.identity.current.value&&e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(n,t,a),action:i?"credit_card_expand":"credit_card_collapse"}})}(e,Pe.value))},[d,te,Pe,e]),Ae=function(){const{checkout:e}=rt(),n=ou(),t=cu(),{paymentLines:a}=$();switch(e.identity.current.value){case"shopPay":return{hasPersistentRedeemablesManagement:!0,show:n};case"customerAccount":case"businessCustomer":{const e=t||a.length>0;return{hasPersistentRedeemablesManagement:e,show:e}}default:return{hasPersistentRedeemablesManagement:!1,show:!1}}}(),ke=n(fu,{openSignal:Pe,hasPersistentRedeemablesManagement:Ae.hasPersistentRedeemablesManagement}),Ee=ne?n(Su,{paymentErrors:P}):null,we=function({checkout:e}){switch(e.identity.current.value){case"payPal":case"googlePay":case"applePay":return!1;default:return!0}}(e),Oe=we&&Ce.value,Ie=!we,Re=!Ie&&Pe.value,Te=Ie?null:Ee||de,Le=!Ie&&(fe||X||R),Ne=Re||Le||Boolean(Te);!function(e){const{checkout:{negotiator:n}}=rt(),{useStoreCreditForSubscriptionRenewals:t}=n.parts,{loading:a}=W(),i=v(e),r=v(a),o=yt(),l=gt(),{showStoreCreditForSubscriptionRenewals:s}=eu();h(()=>
2{const e=i.value,n=r.value,a=s.value,u=o.value,c=l.value;e&&!n&&(!a||u||c)&&m(()=>{t.value&&(t.value=!1)})})}(c),h(()=>{Lo(te)&&(Pe.value=!0)}),Xs({autoOpen:!1,isMissing:de||pe,open:Pe});const De=Oe?n(Hs,{usesSharedVaultedSelector:Z,hasPersistentRedeemablesManagement:Ae.hasPersistentRedeemablesManagement,msiExpandedSlot:Q,onSelectedPaymentMethodChange:g}):null;h(()=>{(ye.value||ge.value)&&(Pe.value=!0)});const Me=Ae.show?n(uu,{}):null,Be=Ne?void 0:ee,xe=Me?n(V,{gap:"base",children:[Me,Be]}):Be;return n(i,{children:n(ce,{target:"cart.paymentLines[0]",children:[n(mo,{open:Re,disabled:Le,id:p,label:r.translate("payment.title"),icon:n(K,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),primaryContent:ke,onToggle:Oe?Se:void 0,error:Te,renderChildrenWhenCollapsed:Oe,secondaryPersistentContent:xe,children:De}),n(Cu,{})]})})}function Su({paymentErrors:e}){return n(B,{children:[e.length>0?n(de,{errors:e,errorType:F.PaymentError}):n(i,{children:[n(Oo,{}),n(nu,{})]}),n(pe,{blockSize:"base"})]})}function Au({onPaymentDelegation:e}){const{embed:t,i18n:a}=rt(),{rollup:{action:{tone:i}={}}={}}=he();return"amazon"===t?.embedder?n(R,{textDecoration:"none",onClick:e,children:n(x,{tone:"accent",children:a.translate("embed.payment.payment_options")})}):n(H,{tone:"custom"===i?"custom":void 0,onClick:e,variant:"plain",textDecoration:"none",children:a.translate("payment.choose_new_payment_method")})}const ku={visa:"Visa",mastercard:"Mastercard",americanexpress:"American Express",amex:"American Express",discover:"Discover",dinersclub:"Diners Club",maestro:"Maestro",jcb:"JCB"};function Eu(e){return e.toLowerCase().replace(/[-_]/g,"")}function wu(e,n){return e&&"unknown"!==Eu(e)?ku[Eu(e)]??n.translate("payment_gateway.credit_card_label"):n.translate("payment_gateway.credit_card_label")}function Ou(){const{i18n:e,observability:t,embed:a,shopPay:i,checkout:r}=rt(),o=L(),l=Vt(),{delegatedPaymentInstrument:u}=r.negotiator.context,{message:c,tone:d,inventoryRecoveryReceiptId:p}=Eo(),{rollup:{blockPadding:h}={}}=he(),{violations:m,clearViolations:v}=j(Rt),y=Qo({violations:m}).value;s(()=>{let e=Ko(u.peek());return u.subscribe(n=>{const t=Ko(n);t!==e&&(e=t,v())})},[u,v]);const b=Boolean(a)&&r.configuration.isPaymentInstrumentsDelegationEnabled&&Boolean(u.value),_=b&&y,C=Ko(u.value),P=g(void 0);_&&(P.current=C);const S=Jo(u.value),{billingAddress:A}=r.negotiator.parts,k=Boolean(S&&!Ft(A.value,Zo(S))),w=b&&(_||P.current===C&&k),O=a?.embedder,I=Gt({embedder:O}),R=Ht(i.app.config),T=!a?.isFlagshipPartner||zt(a.embedder)||R||I?e.translate("payment.title"):e.translate("payment.payment_method"),N=a?.client?.paymentErrors.value.includes(jt.PaymentEmpty)??!1,D=g(!1),M=g(null),B=f(e=>{M.current=e,e&&D.current&&(e.focus(),D.current=!1)},[]),F=f(async()=>{const e=a?.client;if(!e)return;D.current=!1;const n=null!==M.current;try{const n=await e.paymentMethodChangeStart();if(!n)return;if(n.ucpPaymentInstrument)t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Ko(u.value)});else if(n.cart)try{await e.applyCart(n.cart),t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Ko(u.value)})}catch(i){t.log("delegated_payment_cart_update_error","Failed to apply cart update after payment selection",{error:String(i)})}}finally{!e.paymentErrors.value.length&&n&&(M.current?M.current.focus():D.current=!0)}},[a,t,u]),H=a?.client?.paymentErrors.value.includes(jt.PaymentDelegationError),z=H?e.translate("payment_errors.payment_credential_delegation_error"):void 0,U=z||c,G=z?"critical":d,Y=Ut(h),W=o.value&&U?n(V,{direction:"block",gap:Y,paddingBlockEnd:Y,children:[n(Io,{message:U,tone:G,inventoryRecoveryReceiptId:z?void 0:p}),!w&&a?.isFlagshipPartner&&n(Au,{onPaymentDelegation:F})]}):void 0;if(!o.value){const e=n(wr,{vaulted:!0,reason:"freeOrder"}),t="amazon"===O?{compact:e}:{primary:e};return n(mo,{id:"payment",label:T,primaryContent:t.primary,compactContent:t.compact,icon:n(K,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"})})}const q=u.value,$=Xo(q),J=$?.brand,Z=$?.lastDigits,X=!(l.value&&q&&J&&Z),Q=X?e.translate("payment.add_payment_method"):void 0,ee=n(x,{tone:"critical",children:e.translate("payment.add_payment_method")}),ne=Z?n(x,{accessibilityVisibility:"exclusive",children:`${wu(J,e)} ${e.translate("payment.ends_with_label",{last_digits:Z})}`}):null,te=n(x,{accessibilityVisibility:"hidden",children:n("bdi",{children:[wu(J,e),n(yo,{}),Z]})}),ae=(()=>
2{if(!X)return n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[ne,te,n(No,{type:J,size:"small",accessibilityVisibility:"hidden"})]})})(),ie=X?n(x,{tone:N?"critical":void 0,children:e.translate("payment.add_payment_method")}):n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[n("span",{"aria-hidden":"true",className:"EnNLk",children:n(No,{type:J})}),ne,te]}),re=X?n(x,{tone:"accent",decoration:"underline",children:e.translate("payment.add_new_payment_method")}):n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(x,{children:e.translate("payment.pay_with")})," ",ne,n(x,{type:"strong",accessibilityVisibility:"hidden",children:[wu(J,e),n(yo,{}),Z]}),n(No,{type:J,accessibilityVisibility:"hidden"})]}),oe="amazon"===O?{compact:re}:"google"!==O||I?{primary:ae,secondary:void 0===ae?ee:void 0}:{primary:ie};return n(mo,{buttonRef:B,id:"payment",label:T,open:w,disabled:w,onToggle:W?void 0:F,primaryContent:oe.primary,secondaryContent:oe.secondary,compactContent:oe.compact,buttonAccessibilityLabel:Q,icon:n(K,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),error:W,children:w?n(V,{direction:"block",gap:"base",children:[n(E,{level:3,children:e.translate("billing.billing_address_title")}),n(qo,{}),a?.isFlagshipPartner?n(Au,{onPaymentDelegation:F}):null]}):null})}const Iu=new Set(["amazonPay","buyWithPrime"]);function Ru(){const{checkout:{identity:e}}=rt();return Iu.has(e.current.value)?n(Is,{}):"sdkCartHints"===e.current.value?n(Ou,{}):n(Pu,{})}function Tu(e){if("filled"!==e?.status)return null;const{discountOffer:n}=e;if(!n.offerAmount||!n.campaignHandle)return null;const t=n.minimumOrderValue?{amount:n.minimumOrderValue,satisfied:Boolean(n.minimumOrderValueSatisfied),remainingAmount:n.minimumOrderValueRemainder??null}:null;return{adType:"SHOP_CASH_OFFER",campaignHandle:n.campaignHandle,offerAmount:n.offerAmount,redeemableAmount:!t||t.satisfied?n.offerAmount:null,minimumOrderValue:t}}function Lu(){const{checkout:e}=rt(),n=g(null);return t(()=>{const t=e.proposal.negotiated.fields.shopDiscountOffer.value;return"unavailable"===t?.status?(n.current=null,null):("filled"!==t?.status||(n.current=Tu(t)),n.current)})}const Nu=({requiresAvailableBalance:e=!0}={})=>{const n=function({requiresAvailableBalance:e=!0}={}){const n=hl({requiresAvailableBalance:e}),{checkout:{negotiator:a}}=rt(),{paymentMethods:i,shopCashBalance:r}=a.current.fields;return t(()=>{const{nonEligibleReason:t}=n.value,a=Boolean(i.value?.some(e=>"redeemable"===e.type&&"SHOP_CASH"===e.redemptionSource)),o=r.value,l=null==o||"unavailable"===o.status;let s;return s=e&&l?nl.ShopCashNotAvailable:a?t:nl.ShopCashMerchantNotSupported,{nonEligibleReason:s}})}({requiresAvailableBalance:e});return t(()=>{const{nonEligibleReason:e}=n.value;return e?{eligible:!1,reason:e}:{eligible:!0}})};function Du(){const{shop:e}=rt(),n=e.hasFlagEnabled(Yt);return Nu({requiresAvailableBalance:!n})}const Mu=()=>{const e=rt().shopPay.app.config,n=bl();return Wt(e,n)};function Bu(e,n,t){s(()=>{if(e&&t)return e.recordPresentation({component:n,displayLabel:t})},[n,t,e])}const xu=()=>{const{embed:e,i18n:t,shop:a,shopPay:i}=rt(),r=zt(e?.embedder),o=i.app.config.surface,l=a.hasFlagEnabled(qt),s=me();return(r?"shop_app"===o:l||"shop_app"===o)?n(R,{tone:"monochrome",onClick:()=>{r?function(e){if("undefined"==typeof window)return;const n=function(e){if(e)try{return new URL(e).origin}catch{return}}(e);n&&window.parent.postMessage({jsonrpc:"2.0",method:"ec.keep_shopping"},n)}(e?.client?.embedderOrigin):s.notify({keep_shopping:!0})},children:n(x,{size:"small",children:t.translate("shop_cash.minimum_order_value_banner_keep_shopping")})}):null},Vu=({adType:e,offerAmount:a,minimumOrderValueAmount:i,remainingAmount:r,incentivePresentation:o})=>{const{i18n:l}=rt(),s=Mu(),{hasMerchandiseDiscounts:u}=(()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.discountLines;return t(()=>{const e=n.value;return{hasMerchandiseDiscounts:!!e&&e.lines.some(e=>!!Sl(e)&&e.allocations.some(e=>"MERCHANDISELINE"===e.target.type)),orderDiscountAmount:e?e.lines.filter(e=>Sl(e)&&"CART"===e.discount.presentationLevel&&e.allocations.some(e=>"MERCHANDISELINE"===e.target.type)).reduce((e,n)=>{const t=n.amount?.amount;return t?e+t:e},0):0}})})().value,c=l.formatCurrency(a.amount,{currency:a.currencyCode,form:"short"}),d=l.formatCurrency(i.amount,{currency:i.currencyCode,form:"short"}),p=r?l.formatCurrency(r.amount,{currency:r.currencyCode,form:"short"}):void 0,h=Fu({adType:e,formatMinimumOrderAmount:d,formatRemainingAmou
2nt:p,formatOfferAmount:c,hasMerchandiseDiscounts:u});return Bu(o,"minimumOrderValueBanner","FLAT_AMOUNT_CASHBACK_OFFER"===e?h:void 0),n(B,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:s?"dHa7y":"O9AXs",children:[n(X,{type:"small",children:h}),n(xu,{})]})},Fu=({adType:e,formatMinimumOrderAmount:n,formatRemainingAmount:t,formatOfferAmount:a,hasMerchandiseDiscounts:i})=>{const{i18n:r}=rt(),o=i||!t;return"SHOP_CASH_OFFER"===e?o?r.translate("shop_cash.minimum_order_value_banner_discounts_offer_amount",{formatBoostedAmount:a,formatMinimumOrderAmount:n}):r.translate("shop_cash.minimum_order_value_banner",{formatRemainingAmount:t,formatBoostedAmount:a}):"FLAT_AMOUNT_CASHBACK_OFFER"===e?o?r.translate("shop_cash.minimum_order_value_banner_discounts_flat_cashback",{formatOfferAmount:a,formatMinimumOrderAmount:n}):r.translate("shop_cash.minimum_order_value_banner_flat_cashback",{formatRemainingAmount:t,formatOfferAmount:a}):""};function Hu({eligibility:e,offerEligibility:t,discountOffer:a}){const i=l(jo),r=i?.cashback?.incentive;if(!e.eligible&&!t.eligible)return[];const o=[];var s;return t.eligible&&a?.minimumOrderValue&&!a.minimumOrderValue.satisfied&&o.push(n(Vu,{adType:a.adType,offerAmount:a.offerAmount,minimumOrderValueAmount:a.minimumOrderValue.amount,remainingAmount:a.minimumOrderValue.remainingAmount},"mov-discount")),e.eligible&&(s=r,Boolean("ShopCashCheckoutFlatAmountCashbackIncentive"===s?.__typename&&s.minimumOrderValue&&!s.minimumOrderValueSatisfied))&&o.push(n(Vu,{adType:"FLAT_AMOUNT_CASHBACK_OFFER",offerAmount:r.cashbackAmount,minimumOrderValueAmount:r.minimumOrderValue,remainingAmount:r.minimumOrderValueRemainder,incentivePresentation:i?.incentivePresentation},"mov-cashback")),o}function zu(){const{checkout:e,embed:t}=rt(),{main:{section:a}}=ve(),i=Nu().value,r=Du().value,o=Lu(),l=ye().value.payment,s=Hu({eligibility:i,offerEligibility:r,discountOffer:o.value});return zt(t?.embedder)&&!e.configuration.visibility.showCashRedemption.value&&s.length>0?l?n(V,{padding:ju(a?.padding),gap:"small-200",children:s}):n(oo,{hideDivider:l,condition:!l,padding:"none large-200",children:n(V,{padding:"small-200 none",gap:"small-200",children:s})}):null}function ju(e){const[n,t]=(a=e,Array.isArray(a)?2===a.length?[a[1],a[1]]:[a[1],a[3]]:[a,a]);var a;return`small-200 ${Ut(n)??"none"} small-200 ${Ut(t)??"none"}`}function Uu({checked:e,onChange:t,disabled:a}){return n(Al,{checked:e,onChange:t,icon:"none",className:"mu1NS",accessibilityLabel:"Shop Cash",disabled:a})}function Gu(e,n){return null==e&&null==n||null!=e&&null!=n&&e.amount===n.amount&&e.currencyCode===n.currencyCode}function Yu({enabled:e=!0}={}){const{shopPay:n,checkout:{negotiator:t}}=rt(),a=l(jo),i=t.current.fields.buyerIdentity.value?.shopUser?.publicId;return e&&Boolean(i)&&!n.session.isInternalProgressing.value&&!1===a?.redemption.applying?.value}const Wu=e=>"redeemable"===e.method.type&&"SHOP_CASH"===e.method.redemptionSource,qu=e=>{if(!e)return tl;if(!e.method.redemptionContent?.details)return tl;const n={...tl};for(const t of e.method.redemptionContent.details){const e=al.find(e=>e===t.redemptionType);if(void 0===e)continue;const a={id:t.redemptionId??e,promotionId:"SHOP_PROMOTION"===e?t.redemptionId:void 0,type:e,destinationAmount:vl(t.destinationAmount),sourceAmount:ml(t.sourceAmount)};"SHOP_PROMOTION"===e?n.SHOP_PROMOTION=[...n.SHOP_PROMOTION,a]:n[e]=a}return n},$u=(e,n)=>{const t=e[n];return Array.isArray(t)?t.length>0:null!=t},Ku=()=>{const{checkout:{negotiator:e}}=rt(),{paymentLines:n}=e.current.fields;return t(()=>qu(n.value?.lines.find(Wu)))},Ju=()=>{const{checkout:{negotiator:e}}=rt(),{paymentLines:n}=e.parts;return t(()=>qu(n.value?.find(Wu)))},Zu=e=>({type:e.type,amount:e.destinationAmount,promotionId:e.promotionId}),Xu=({enabled:e=!0}={})=>{const{shopPay:n,checkout:{negotiator:t}}=rt(),a=Ju(),i=l(jo),r=i?.redemption.applying,{negotiate:o}=ge(),s=t.parts.paymentLines,u=yl(),c=Uo(),d=t.current.fields.buyerIdentity.value?.shopUser?.publicId;return f(async(t,{onNegotiateAccepted:i}={})=>{const{SHOP_CASH_BALANCE:l,SHOP_DISCOUNT_OFFER:p,SHOP_PROMOTION:h}=a.peek(),{SHOP_CASH_BALANCE:m=(l?Zu(l):null),SHOP_DISCOUNT_OFFER:v=(p?Zu(p):null),SHOP_PROMOTION:y=h.map(Zu)}=t,g=n.session.isInternalProgressing.value;if(!e)return;if(!r)return;if(g)return;if(!d)return;if(r.peek())return;_(()=>{r.value=!0});const f=s.peek().filter(e=>"redeemable"!==e.method.type||"SHOP_CASH"!==e.method.redemptionSource),b=Object.values(t).flatMap(e=>Array.isArray(e)?e:[e]).find(e=>null!=e)?.amount.currencyCode,C=[m,v,...y??[]].filter(e=>null!==e&&(!b||e.amount.currencyCode===b)),{selectedBillingAddress:P,selectedShippingAddress:S,isUsingApplePayShippingFallback:A}=u.value,k=!P.address1||"APPLE_PAY"===c.value,E=function(e,n,t){if(!t)return null;if(0===e.length)return null;const a=e.reduce((e,n)=>e+n.amount.amount,0),i=e[0].amount.currencyCode;return{cost:{amount:a,currencyCode:i},method:{type:"redeemable",redemptionSource:"SHOP_CASH",redemptionContent:{redemptionId:t,billingAddress:{streetAddress:n?{address1:n.address1??"",address2:n.address2,city:n.city??"",company:n.company,firstName:n.firstName,lastName:n.lastName??"",phone:n.phone,postalCode:n.postalCode,zoneCode:n.zoneCode,countryCode:n.countryCode??""}:null},destinationAmount:{amount:a.toString(),currencyCode:i},sourceAmount:{amount:a.toString(),currencyCode:i},redemptionPaymentOptionKind:"decoupled",details:e.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}))}}}}(C,!A&&S&&k?S:P,d);E&&f.push(E),s.value=f;try{i?.(),await o({silenceViolations:["non-shop-cash",...$t(["paymentLines","billingAddress"])]})}finally{_(()=>{r.value=!1})}},[r,e,o,c,s,a,d,u,n.session.isInternalProgressing])},Qu=()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.subtotalAfterMerchandiseDiscounts,a=bt(),i=ec(),r=nc();return t(()=>{const e=a.value,t=e?{amount:il(e.amount-i.value-r.value,C(e.currencyCode)),currencyCode:e.currencyCode}:void 0;return{orderTotal:e,orderSubtotal:n.value,redeemableTotal:t}})},ec=()=>{const{checkout:{negotiator:e}}=rt(),{paymentLines:n}=e.current.fields;return t(()=>(n.value?.lines??[]).reduce((e,n)=>n.cost&&((e=>"giftCard"===e.method.type)(n)||(e=>"redeemable"===e.method.type)(n)&&!(e=>"SHOP_CASH"===e.method.redemptionSource)(n))?e+n.cost.amount:e,0))},nc=()=>{const e=Ku();return t(()=>Object.values(e.value).flatMap(e=>Array.isArray(e)?e:[e]).reduce((e,n)=>n?"SHOP_CASH_BALANCE"===n.type?e:e+n.destinationAmount.amount:e,0))},tc=rl,ac=e=>{const{i18n:n,shopPay:t,webMcp:a,checkout:i}=rt(),r=Yu(),o=Xu(),l=Ju(),u=Ku(),{applying:c}=Go().redemption,{buyerIdentity:d,shopCashBalance:p}=i.negotiator.current.fields,h=Qu(),m=ic(d.value),v=ic(p.value),y=(g=p.value,"filled"===g?.status&&g.eligible&&(g.redeemableBalance?.amount??0)>0?void 0:ic(h.value));var g;const b=Boolean(l.value[tc]),_=u.value[tc]?.destinationAmount||null,C=f(async n=>{if(c.value)return;const t=n?e:null;Gu(_,t)&&Gu(l.value[tc]?.destinationAmount,t)||await o({[tc]:t?{type:"SHOP_CASH_BALANCE",amount:t,promotionId:null}:null})},[_,e,o,c,l]);s(()=>
2{if(a&&e.amount>0)return a.unstable_registerDeclaredField({key:"shop_cash",read(){const e=i.latestReceipt.value?.status;if(!e||!["processed","processing","processing_remote_checkouts","polling_for_order","action_required"].includes(e))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:Boolean(l.value[tc])}},prepare(n){if(null!==n&&"boolean"!=typeof n)return{requirement:"must be a boolean or null"};const a=!0===n;return{phase:"negotiate",changed:!0,apply:async()=>!(!r||c.value||t.session.isInternalProgressing.value||ic(d.value)!==m||ic(p.value)!==v||void 0!==y&&ic(h.value)!==y)&&(await C(a),Gu(u.value[tc]?.destinationAmount??null,a?e:null))}}})},[a,i,t.session,e,l,u,r,c,d,m,p,v,h,y,C]),s(()=>{_&&(Gu(_,e)||C(!0))},[e]);const P=n.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"});return{title:n.translate("order_summary.shop_cash_title"),amount:b?n.translate("shop_cash.redemption.balance.applied",{formattedAmount:P}):n.translate("shop_cash.redemption.balance.available",{formattedAmount:P}),checked:b,handleChange:C,disabled:c.value}};function ic(e){return JSON.stringify(e)??""}const rc={rollup:{blockAlignment:"center"}},oc=({redeemableBalance:e})=>{const{title:t,amount:a,checked:i,handleChange:r,disabled:o}=ac(e);return n("div",{className:"yY3sV",children:n(co,{theme:rc,children:n(mo,{label:t,primaryContent:a,primaryAction:n(Uu,{checked:i,onChange:r,disabled:o})})})})},lc=()=>{const{i18n:e}=rt(),t=Mu(),a=e.translate("payment_errors.vaulted_card_required_error");return n(B,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:P("Q9An4",t&&"K92xU"),children:n(X,{type:"small",children:a})})},sc={availableBalance:null,redeemableBalance:null};function uc(){const e=g([]),n=Qu(),{checkout:a}=rt(),i=a.proposal.negotiated.fields.shopPromotion;return t(()=>{const{orderTotal:t}=n.value,a=i.value;return"filled"===a?.status?e.current=a.promotions:"unavailable"===a?.status&&(e.current=[]),sl(e.current,t)})}const cc=()=>{const{recordRedemptionActionEvent:e}=gl(),{shop:n,shopPay:t}=rt(),a=n.hasFlagEnabled(qt),i=t.app.config.surface,r=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),o=u(()=>({shopPayCheckoutSurface:i,isReactNativeWebview:r,isShopCashBalanceBetaEnabled:a,isOnePageCheckout:!0,nEnabledCreditCards:0}),[i,r,a]),l=f(n=>{e({...o,...n})},[o,e]),s=f((e,n)=>{l({action:"auto-apply",redemptionType:e,source:n})},[l]),c=f((e,n)=>{l({action:"manually-apply",redemptionType:e,source:n})},[l]);return{recordRedemptionAutomaticallyApplied:s,recordRedemptionAutomaticallyRemoved:f((e,n)=>{l({action:"auto-remove",redemptionType:e,source:n})},[l]),recordRedemptionManuallyApplied:c,recordRedemptionManuallyRemoved:f((e,n)=>{l({action:"manually-remove",redemptionType:e,source:n})},[l])}},dc=({enabled:e=!0,redemptionTypes:n=al}={})=>{const t=Ku(),a=l(jo),i=a?.cashbackState.stale,{recordRedemptionAutomaticallyRemoved:r}=cc(),o=Xu({enabled:e}),u=Qo(j(Kt)).value;s(()=>{if(!e||!i||!u)return;let a=!1;for(const e of n)$u(t.value,e)&&(a=!0,r(e,"useRemoveRedemptionsOnViolation"));a&&(i.value=!0,o(Object.fromEntries(n.map(e=>[e,null]))))},[e,u])},pc=(e,{enabled:n=!0,retryOnReady:t=!1}={})=>{const a=Yu({enabled:n}),i=Xu({enabled:n}),{recordRedemptionAutomaticallyRemoved:r}=cc(),o=Ku(),l=Ju(),u=e.filter(e=>!e.eligibility.eligible).flatMap(e=>e.redemptionTypes??al),c=u.join(","),d=!!t&&a,p=t?u.filter(e=>$u(l.value,e)).join(","):"";s(()=>{if(!n||0===u.length)return;if(!t){const e=u.filter(e=>$u(o.value,e));if(0===e.length)return;return void i(Object.fromEntries(u.map(e=>[e,null])),{onNegotiateAccepted:()=>{for(const n of e)r(n,"useRemoveRedemptionsWhenIneligible")}})}if(!a)return;const e=u.filter(e=>$u(l.value,e));0!==e.length&&i(Object.fromEntries(u.map(e=>[e,null])),{onNegotiateAccepted:()=>{for(const n of e)r(n,"useRemoveRedemptionsWhenIneligible")}})},[n,d,c,p])};
2class hc extends Error{constructor(){super("Multiple Shop Cash payment lines present in negotiation response"),this.name="MultipleShopCashPaymentLinesAnomaly"}}const mc=({message:e})=>n(Q,{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:[n(K,{type:"alert-circle",size:"small"}),n(X,{color:"subdued",size:"small",children:e})]});function vc(){const{eligibility:e,offerEligibility:n,redeemableBalance:t,availableBalance:a,discountOffer:i,messages:r,showVaultedCardBanner:o,vaulted:l,isDigitalGoodsRedemptionAllowed:c}=yc();!function(e){const n=g(!1),t=g(performance.now()),{observability:a}=rt();s(()=>{if(!n.current&&e&&e.amount>0){const e=performance.now()-t.current;a.histogram({name:"new_performance_shop_cash_balance_display_time",value:Math.round(e)}),n.current=!0}},[e,a])}(a);const{shop:d}=rt(),p=d.hasFlagEnabled(Yt);return pc([{eligibility:e,redemptionTypes:[rl]},...p?[]:[{eligibility:n,redemptionTypes:[ul,cl]}]],{retryOnReady:p}),dc(),(e=>{const{client:n,shop:t,shopPay:a}=rt(),{recordRedemptionVisibilityEvent:i}=gl(),r=n.unstable_getSerialization("apiClientId"),o=t.hasFlagEnabled(qt),l=a.app.config.surface,c=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),d=ye().value.payment,p=u(()=>({visibility:"visible",reason:e.reason??"none",position:d?"vaulted":"unvaulted",shopPayCheckoutSurface:l,isReactNativeWebview:c,isShopCashBalanceBetaEnabled:o,apiClientId:r,isOnePageCheckout:!0,nEnabledCreditCards:0}),[l,c,o,r,e.reason,d]);s(()=>{i(p)},[i,e.reason])})(e),(({eligibility:e,availableBalance:n,redeemableBalance:t,discountOffer:a})=>{const{recordRedemptionEligibilityEvent:i}=gl(),{orderTotal:r,orderSubtotal:o}=Qu().value,l=u(()=>a?a.minimumOrderValue&&!a.minimumOrderValue.satisfied?"BELOW_MOV":void 0:"NO_CAMPAIGN",[a]),c=u(()=>{if(r)return{balance:n?.amount??0,balanceCurrency:n?.currencyCode??"USD",totalPrice:r.amount,totalPriceCurrency:r.currencyCode,subtotalPrice:o?.amount??0,subtotalPriceCurrency:o?.currencyCode??"USD",maxTotalRedemptionAllowed:t?.amount??0,isBoostAvailable:Boolean(a),boostCampaignId:a?.campaignHandle,offerAmountBelowMov:a?.minimumOrderValue?.remainingAmount?.amount,offerMinimumOrderValueRequired:a?.minimumOrderValue?.amount.amount,maxPostOfferRemainingAmount:0,maxOfferRedemptionAmount:a?.offerAmount?.amount,boostIneligibilityReason:l,redemptionIneligibilityReason:e.reason}},[n,r,o,a,t,l,e.reason]);s(()=>{c&&i(c)},[i,e.reason,n,t,a])})({eligibility:e,availableBalance:a,redeemableBalance:t,discountOffer:i.value}),(()=>{const{observability:e,source:n,checkout:{negotiator:t}}=rt(),a=t.current.fields.paymentLines.value,i=u(()=>a?.lines.filter(e=>"redeemable"===e.method.type&&"SHOP_CASH"===e.method.redemptionSource)??[],[a]),r=g(!1);s(()=>{if(!i)return;if(i.length<=1)return;if(r.current)return;const t=JSON.stringify(i.map(e=>e.method.redemptionContent?.details?.map(n=>({redemptionPaymentGroupId:e.method.redemptionContent?.redemptionId,redemptionId:n.redemptionId,type:n.redemptionType,amount:n.destinationAmount}))));r.current=!0,e.error(new hc,{severity:"error",metadata:{shopCash:{redemptions:t},source:{type:n.type},checkout:{token:n.checkoutSessionIdentifier||n.sourceId}}})},[i,e,n])})(),{eligibility:e,redeemableBalance:t,messages:r,showVaultedCardBanner:o,vaulted:l,isDigitalGoodsRedemptionAllowed:c}}function yc(){const e=ye().value.payment,t=Nu().value,a=Du().value,{redeemableBalance:i,availableBalance:r}=(()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.shopCashBalance.value,{redeemableTotal:t}=Qu().value,a=(()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.shopCashBalance.value,t=g(null);return"filled"===n?.status?t.current=n.availableBalance:"unavailable"===n?.status&&(t.current=null),t.current})();if("filled"===n?.status&&n.eligible&&null!=n.redeemableBalance&&n.redeemableBalance.amount>0)return{availableBalance:n.availableBalance,redeemableBalance:n.redeemableBalance};if(!a)return sc;if(a.amount<=0)return sc;if(!t)return sc;const i=ol(t.currencyCode);if(t.amount<=i)return sc;if(t.amount<a.amount)return{availableBalance:a,redeemableBalance:t};const r=il(t.amount-a.amount,C(t.currencyCode));return r>=i?{availableBalance:a,redeemableBalance:a}:{availableBalance:a,redeemableBalance:ll({amount:a.amount-(i-r),currencyCode:a.currencyCode})}})(),o=Lu(),l=uc().value,s=Hu({eligibility:t,offerEligibility:a,discountOffer:o.value}),{eligibilityMessage:u,showVaultedCardBanner:c}=(e=>{const t=(()=>{const{i18n:e}=rt();return t=>{if(t)switch(t){case"SHOP_CASH_INVALID_BILLING_ADDRESS":return e.translate("shop_cash.redemption_invali
2d_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:n(R,{target:"_blank",href:"https://shop.app/shop-cash-terms",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")}}})(),{checkout:{negotiator:a}}=rt(),{paymentLines:i}=a.current.fields,r=St().value&&Boolean(i.value?.lines.find(Wu));return{eligibilityMessage:t(e.reason),showVaultedCardBanner:r}})(t),d=!t.eligible&&"PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING"===t.reason,p=[];return u&&!d&&p.push(n(mc,{message:u},"eligibility-banner")),p.push(...s),{eligibility:t,offerEligibility:a,redeemableBalance:i,availableBalance:r,discountOffer:o,shopPromotionDiscounts:l,messages:p,showVaultedCardBanner:c,vaulted:e,isDigitalGoodsRedemptionAllowed:d}}const gc=()=>{const{eligibility:e,redeemableBalance:t,messages:a,showVaultedCardBanner:r,vaulted:o,isDigitalGoodsRedemptionAllowed:l}=vc();return r&&!o&&a.push(n(lc,{})),n(i,{children:[(e.eligible||l)&&t&&n(oo,{hideDivider:o,condition:!o,children:n(oc,{redeemableBalance:t})}),a.length>0&&n(oo,{hideDivider:o,condition:!o,padding:"none large-200",children:n(V,{padding:"small-200 none",gap:"small-200",children:a})})]})};function fc({formattedAddress:e}){const{i18n:t,checkout:a}=rt(),i=a.negotiator.current.fields.buyerIdentity.value?.purchasingCompany,r=a.addressManager.shipping.value,o=r.selectedAddress.value?.id===Dl&&Jt(i)||!e;return n(V,{children:[o&&n(X,{children:i?.location.name}),n(X,e?{children:e}:{color:"subdued",children:t.translate("review.blocks.no_address")})]})}const bc=new Set(["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE"]);function _c({id:e="deliveryAddress",label:t,formattedAddress:r}){const{i18n:o,checkout:{negotiator:l}}=rt(),s=Zs(e),c=l.current.fields.buyerIdentity.value?.purchasingCompany,d=Ll(),p=fe(),h=Qo(j(bc)).value,{deliveryAddressErrors:m}=le().value,v=r??p,y=u(()=>[`single_choice_${e}`],[e]),g=t??o.translate("shipping.shipping_address_title"),f=n(fc,{formattedAddress:v}),b=n(i,{children:[n(Il,{name:`single_choice_list_${e}`,values:y,hideRadioControl:!0,children:n(Fo,{value:`single_choice_${e}`,children:n(V,{children:[n(X,{children:c?.location.name}),n(X,{color:"subdued",children:v??o.translate("review.blocks.no_address")})]})})}),n(a,{when:d,children:n(B,{padding:"small-200 small-100 none small-100",children:n(fo,{showIcon:!0})})})]}),_="deliveryAddress"!==e?null:h?n(Ei,{message:o.translate("shipping_errors.shipping_method_not_available_generic.one")}):m.length>0?n(de,{errors:m,errorType:F.DeliveryError}):null;return n(mo,{id:e,label:g,open:s.value,onToggle:()=>{s.value=!s.value},primaryContent:f,error:_,children:b})}function Cc({isAbovePaymentSummary:e=!1}={}){const{checkout:{identity:t,negotiator:a}}=rt(),i=a.current.fields.buyerIdentity.value?.purchasingCompany,r=function(e){const n=e.current.value;return"customerAccount"===n||"businessCustomer"===n}(t)&&!e;return r?n(Sc,{renderInlineSelector:!0}):i?n(Pc,{purchasingCompany:i}):n(Sc,{})}function Pc({purchasingCompany:e}){const{i18n:t}=rt(),{shippingAddress:a,name:i}=e.location,{secondary:r}=Pe({address:a??{},nameLinePosition:"inline",addressDisplayName:i}),o=a?r:t.translate("review.blocks.no_address");return n(_c,{id:"billingAddress",label:t.translate("company_location.location_title"),formattedAddress:o})}function Sc({renderInlineSelector:e=!1}={}){const{i18n:t,checkout:{identity:a,negotiator:i}}=rt(),r=i.parts.billingAddress.value,o=Ac().value,l=null!=o&&i.parts.billingAddressOption.value===o.option,u="form"!==be().value,c=l&&o.sameAsShipping&&!u,d=c?o.address:r,p=_e(d,{displayName:!1}),{isMissingPhone:h}=kl({addressType:"billing"}),{isMissingFirstName:m}=El({addressType:"billing"}),v=h||m,y="billingAddress",b=Zs(y),_=Zt("deliveryNext").value,C=g(!0),{hasViolations:P,violations:S,clearViolations:A}=G(Rt),k=new Set([...h?["PAYMENTS_PHONE_NUMBER_REQUIRED"]:[],...m?Xt:[]]),E=ao(P,S,k),{hasViolations:w}=G(Qt);s(()=>{E&&(b.value=!0)},[E,b]),s(()=>{C.current?C.current=!1:A()},[A,r]),Xs({isMissing:v,open:b});const O=function(){const{userEvents:e,source:n,checkout:t,shop:a}=rt(),{billingAddress:i,billingAddressOption:r,shippingAddress:o}=t.negotiator.parts,l=Ac(),s=f(e=>{e?r.value="custom":Ft(i.value,o.value)?r.value="shipping":r.value="custom"},[i,r,o]),u=f(e=>{const n=l.value;e?(n&&r.value===n.option&&(i.value=n.address),r.value="custom"):n&&Ft(i.value,
2n.address)?r.value=n.option:r.value="custom"},[i,r,l]),c=f(i=>e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(n,t,a),action:i?"billing_addresses_expand":"billing_addresses_collapse"}}),[t,e,a,n]);return function({identity:e,switchBillingAddressOption:n,switchAndPrefillBillingAddressOption:t,recordShopPayInteraction:a}){switch(e.current.value){case"payPal":return n;case"customerAccount":case"businessCustomer":return t;case"shopPay":return a;default:return}}({identity:t.identity,switchBillingAddressOption:s,switchAndPrefillBillingAddressOption:u,recordShopPayInteraction:c})}(),I=f(()=>{const e=!b.value;return O?.(e),b.value=e,e},[O,b]);let R=E;!function(e,n){return"applePay"===e.current.value&&n}(a,w)?E&&!_&&(R=n(Ce,{errorType:F.PaymentError,tone:"critical",children:t.translate("address_management.invalid_billing_address_selected")})):R=n(Ce,{errorType:F.PaymentError,tone:"critical",children:t.translate("payment.billing_must_match_shipping_notice")});const T=t.formatName(d?.firstName,d?.lastName,!0);let L,N;return!l||c?(L=T,N=p):L=o.sameAsShipping?t.translate("billing.same_as_shipping"):p,n(mo,{id:y,label:t.translate("billing.billing_address_title"),open:b.value,onToggle:I,error:R,primaryContent:L,secondaryContent:N,renderChildrenWhenCollapsed:v,children:n(js,{renderInlineSelector:e})})}function Ac(){const{checkout:e}=rt(),{buyerIdentity:n}=e.negotiator.current.fields,a=Se();return t(()=>{if(n.value?.purchasingCompany){const{address:n,type:t}=e.addressManager.billing.value.suggestedAddress.value;return!n||"billing"!==t&&"billing-fact"!==t&&"shipping"!==t?null:{option:t,address:n,sameAsShipping:!1}}return{option:"shipping",address:a.value,sameAsShipping:!0}})}function kc(e,n){return e?n?`${n} · ${e}`:e:""}class Ec{constructor(e,n){this.appContext=e,this.providerData=n,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 Boolean(this.appContext.embed?.isFlagshipPartner)}get logo(){return null}get displayOptions(){return{vaultedContactType:"base",contentLayout:void 0}}hasCheckoutAsGuest(e){return"object"==typeof e&&null!==e&&"checkoutAsGuest"in e}}const wc="large-400";function Oc(){return n(V,{"aria-busy":!0,alignItems:"center",display:"inline",justifyContent:"center",children:n(V,{borderRadius:"fullyRounded",overflow:"hidden",children:n(we,{contentDisplay:"block",children:n(Ic,{})})})})}function Ic(){return n(pe,{blockSize:wc,inlineSize:wc})}const Rc=o({displayName:"VaultedContactAvatar",suspense:!1,load:()=>p(()=>e(()=>import("./68887467.GX68sO1G.js"),__vite__mapDeps([122,1,123,2,3,4,5,6,7,8,9,10,11,12,124]))),renderLoading:()=>n(Oc,{}),renderError:()=>n(Ic,{}),useError:Ee("VaultedContactAvatar")});function Tc(e,t=""){const a=e?.customerProfile?.firstName?.charAt(0),i=e?.customerProfile?.lastName?.charAt(0),r=t.charAt(0),o=(a??i??r).toUpperCase();return o?n(Rc,{initials:o}):null}function Lc({email:e,phone:t}){const{i18n:a,checkout:{configuration:i},observability:r,shop:{name:o}}=rt(),{hasExternalOrderNotifications:l}=i,c=function({email:e,phone:n}){return e?"email":n?"phone":void 0}({email:e,phone:t}),d=l?c:void 0;s(()=>{d&&(r.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}),r.counter({name:"shop_pay_external_order_notification_banner_suppressed",value:1,attributes:{contact_type:d}}))},[r,d]);const p=u(()=>l?null:e?a.translate("account_management.email_changed",{shopName:o,email:Nc(e)}):t?a.translate("account_management.phone_changed",{shopName:o,phone:Nc(t)}):null,[e,t,o,a,l]);return p?n(B,{padding:"small-200 none none none",children:n(Ie,{tone:"info",children:p})}):null}const Nc=e=>n(x,{type:"strong",children:e});function Dc({url:e,displayName:t}){return n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(B,{inl
2ineSize:"16px",blockSize:"16px",children:n(Re,{src:e,alt:"",accessibilityRole:"presentation",inlineSize:"fill",aspectRatio:"auto"})}),n(x,{size:"medium",type:"strong",children:t})]})}const Mc={amazonPay:class extends Ec{get displayContent(){return{contact:kc(this.appContext.checkout.proposal.proposed.email.value,this.appContext.checkout.proposal.proposed.shippingAddress.fields.firstName.value)}}get logo(){const e=this.isEmbeddedPartner?"xsmall":"medium";return n(Mo,{wallet:st.AmazonPay,size:e})}},applePay:class extends Ec{get logo(){return n(Mo,{wallet:"APPLE_PAY_BORDERLESS",size:"xsmall"})}},buyWithPrime:class extends Ec{get displayContent(){return{contact:kc(this.appContext.checkout.proposal.proposed.email.value,this.appContext.checkout.proposal.proposed.shippingAddress.fields.firstName.value)}}get logo(){return n(Mo,{wallet:st.BuyWithPrime,size:"large"})}},businessCustomer:class extends Ec{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.fields?.buyerIdentity.value}get isOrderOrDraftSession(){return Oe(this.appContext.source)}get displayContent(){const e=this.buyerIdentity?.purchasingCompany?.company.name??"",n=this.email;return{contact:this.appContext.i18n.translate("contact.company_contact_info",{companyName:e,contact:n??""})}}get logo(){return Tc(this.buyerIdentity,this.email)}get displayOptions(){return{vaultedContactType:"base",contentLayout:"box"}}get moreOptions(){const{accountInfo:e}=this.providerData,{i18n:n}=this.appContext;return e.showLogoutLink&&!this.isOrderOrDraftSession?[{label:n.translate("customer_account.sign_out_link_label"),onClick:e.logoutAndClearProposal}]:void 0}},customerAccount:class extends Ec{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.value.buyerIdentity}get logo(){return Tc(this.buyerIdentity,this.email)}get displayOptions(){return{vaultedContactType:"base",contentLayout:"box"}}get showShopPayVerification(){return Boolean(this.email)&&this.providerData.loadShopPayVerification}get moreOptions(){const{accountInfo:e}=this.providerData,{i18n:n}=this.appContext;return e.showLogoutLink?[{label:n.translate("customer_account.sign_out_link_label"),onClick:e.logoutAndClearProposal}]:void 0}},googlePay:class extends Ec{get logo(){const e=this.isEmbeddedPartner?"xxxsmall":"xxsmall";return n(Mo,{wallet:"GOOGLE_PAY",size:e})}},payPal:class extends Ec{get displayContent(){return{contact:this.payPalEmail||this.email}}get logo(){const e=this.isEmbeddedPartner?"xxsmall":"small";return n(Mo,{size:e,wallet:"PAYPAL_EXPRESS"})}get payPalEmail(){const e=na(this.appContext.checkout.proposal.proposed.paymentLines.value,"PAYPAL_EXPRESS");return e?.method.walletContent?.email||void 0}get children(){const e=this.displayContent.contact;return Boolean(e)&&Boolean(this.email)&&e!==this.email?n(Lc,{email:this.email}):null}get displayOptions(){return{vaultedContactType:"base",contentLayout:void 0,children:this.children}}},sdkCartHints:class extends Ec{get displayPhone(){return this.appContext.shop.contactInfoOptions.includes("PHONE")?this.phone:void 0}get displayContent(){const{i18n:e}=this.appContext,n=this.email||this.displayPhone||"";return{label:e.translate("contact.contact_method_title"),contact:n,useSummaryInContent:!0}}get hasError(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout;return Te({email:this.email,phone:this.phone,emailInputError:e.value,phoneInputError:n.value,hasViolations:this.displayableContactViolations.length>0})}get shouldHide(){const e=this.appContext.checkout.proposal.negotiated.fields.merchandiseLines.value?.lines;return!(Boolean(this.appContext.embed?.interstitialPartnerDisplayName)&&!this.appContext.checkout.identity.customerContactMethodPrefilled)&&Le({isFlagshipPartner:Boolean(this.appContext.embed?.isFlagshipPartner),hasError:this.hasError,hasOnlyDigitalItems:Ne(e)})}get shouldTriggerValidation(){return Boolean(this.email||this.phone)}get shouldClearClientSideValidation(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout;return!this.email&&!this.phone&&(this.isClearableContactError(e.value)||this.isClearableContactError(n.value))}get shouldMapServerViolationsToClient(){const{violationsSubscriptionResult:{hasViolations:e}}=this.providerData;return e}triggerClientSideValidation(){const{i18n:e}=this.appContext,{validation:{contactErrors:{emailInputError:n,phoneInputError:t}}}=this.appContext.checkout;n.value=void 0,t.value=void 0;const a=this.appContext.shop.contactInfoOptions.includes("PHONE"),i=this.validateContactInformation({email:this.email,phone:this.phone,phoneAllowed:a,translations:{emailBlank:e.translate("field_errors.email_blank"),emailInvalid:e.translate("field_errors.email_invalid"),blank:e.translate("field_errors.email_or_phone_blank")}});if(!i)return!1;switch(i.field){case"email":return n.value=i.error,!0;case"phone":return t.value=i.error,!0}}clearClientSideValidation(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout;this.isClearableContactError(e.value)&&(e.value=void 0),this.isClearableContactError(n.value)&&(n.value=void 0)}mapServerViolationsToClient(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout,{violationsSubscriptionResult:{clearViolations:t}}=this.providerData,a=Boolean(this.email||this.phone),i=Boolean(e.value)||Boolean(n.value);for(const r of this.displayableContactViolations)!i&&a&&"UnprocessableTermViolation"===r.__typename&&(e.value=r.localizedMessage??r.n
2onLocalizedMessage,n.value=void 0);t()}get logo(){const e=this.appContext.embed,t=Gt({embedder:e?.embedder}),a=e?.interstitialPartnerDisplayName,i=e?.interstitialPartnerProfileIconUrl;return t&&a&&!0===e?.isFlagshipPartner&&this.appContext.checkout.identity.customerContactMethodPrefilled?i?n(Dc,{url:i,displayName:a}):Tc(void 0,this.email):n(K,{type:"email",size:"fill"})}get displayOptions(){return{vaultedContactType:"rollup",expandable:!0,children:n(wi,{showEmailMarketingOptIn:!1})}}get displayableContactViolations(){const{violations:e,negotiationStage:n}=this.providerData.violationsSubscriptionResult,t=ta(this.email)||this.appContext.shop.contactInfoOptions.includes("PHONE")&&ta(this.phone),a="negotiation"===n&&!this.appContext.embed?.isFlagshipPartner&&t;return Array.from(e).filter(({code:e})=>!a||"BUYER_IDENTITY_MISSING_CONTACT_METHOD"!==e)}validateContactInformation({email:e,phone:n,phoneAllowed:t,translations:a}){if(!(e||n&&t))return{field:"email",error:t?a.blank:a.emailBlank};if(e){const n=_l(e,a.emailBlank),t=Cl(e,a.emailInvalid),i=n??t;if(i)return{field:"email",error:i}}else if(n&&t){const e=_l(n,a.blank);if(e)return{field:"phone",error:e}}}isClearableContactError(e){return!!e&&!("object"==typeof e&&"origin"in e&&"client"===e.origin)}},shopPay:class extends Ec{#t;#a;constructor(e,n){super(e,n),this.#t=(this.appContext.mobileCheckoutSdk.enabled||Boolean(this.appContext.embed?.isCheckoutKit()))&&Ht(this.appContext.shopPay.app.config),this.#a=aa(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 e=this.displayContent.contact,t=Boolean(e)&&Boolean(this.email)&&e!==this.email,a=Boolean(this.phone&&!this.email);return t||a?n(Lc,{email:this.email,phone:this.phone}):null}get displayOptions(){let e;return(this.#t||this.#a||!this.appContext.shopPay.visibility.showVaultedContactInlineLogo)&&(e="stack"),this.appContext.shopPay.visibility.showVaultedContactHeader||(e="box"),this.appContext.shopPay.visibility.showVaultedContact?{vaultedContactType:"base",contentLayout:e,children:this.children}:{vaultedContactType:"hidden"}}}};class Bc extends Error{constructor(){super("Guest identity should never be instantiated. Guest identity has vaultedSections.contact=false, so VaultedContact never renders."),this.name="GuestIdentityError"}}const xc=new ia(0,0,100);function Vc(){const e=rt(),a=e.checkout.identity.current.value,i=u(()=>({appContext:e,identitySource:a}),[e,a]),r=Ve().value,o=e.client.unstable_getSerialization("logoutUrl")||"",l=function(){const e=rt(),n=Bl(),a=Fe(),i=Po(),r=He(),o=function(){const{checkout:{wallets:e}}=rt(),{persistedPayPalSignal:n,inMemoryPayPalParts:{accountStatus:t}}=lt(),{clearForcedCheckoutLayout:a}=Ae(ea),i=f(()=>{n.value={isVenmo:!1},t.value={status:"not_connected"},a({wallet:e.escalatedWallet.value})},[e.escalatedWallet,n,t,a]);return ke({onClick:i,shouldResetCustomerInfo:!0,skipRedirect:!0})}(),l=v({amazonPayCheckoutAsGuest:n,applePayCheckoutAsGuest:a,buyWithPrimeCheckoutAsGuest:i,googlePayCheckoutAsGuest:r,payPalCheckoutAsGuest:o});return t(()=>{const n=l.value;switch(e.checkout.identity.current.value){case"amazonPay":return n.amazonPayCheckoutAsGuest;case"applePay":return n.applePayCheckoutAsGuest;case"buyWithPrime":return n.buyWithPrimeCheckoutAsGuest;case"googlePay":return n.googlePayCheckoutAsGuest;case"payPal":return n.payPalCheckoutAsGuest;default:return}})}().value,s=bo(),c=function(){const{shopPay:e,mobileCheckoutSdk:t,embed:a,router:i}=rt(),r=i.currentUrl.value,o=Boolean(a?.isFlagshipPartner)?"small":"medium",l=(t.enabled||a?.isCheckoutKit())&&Ht(e.app.config),s=aa(r.search),u=Pl({foregroundColor:Hl}),c=Pl({foregroundColor:xc});if(l||s||!e.visibility.showVaultedContactInlineLogo)return null;let d;return d=u?"branded":c?"white":"black","shop"!==e.logoBrand?n(Fl,{color:d,size:o}):n(Vl,{color:d,size:o})}(),d=function(){const{i18n:e,observability:n,userEvents:t,source:a,checkout:i,shop:r,persistence:o,shopPay:l,router:s}=rt(),c=i.negotiator,{visibility:d,app:{config:p}}=l,h=Ht(p),{replaceShopPayInHistory:m}=Ml(),v=f((e,t)=>
2{if("success"!==t.status)return i.unstable_setRedirectingExternally(!1),void n.log("shop_pay_switch_account_session_clear_failed","Shop Pay account switch session clear did not succeed",{status:t.status});o?.clearAll();const a=new URL(window.location.href);a.pathname=s.resolve(ra).pathname,a.searchParams.set(oa,"1"),m(a.toString())},[i,n,o,m,s]),y=De(v),{label:g}=Me(),b=Be({clearPii:!0}),_=xe(),C=Boolean(l.config.isReferral),P=f(()=>{i.unstable_setRedirectingExternally(!0),t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...At(a,i,r),action:"switch_account"}},{exportImmediately:!0});const e=c.block();c.waitForPendingNegotiations().then(()=>y()).catch(()=>{i.unstable_setRedirectingExternally(!1)}).finally(e)},[y,t,a,i,r,c]);return u(()=>{const n=[];return d.showSwitchAccountAction&&n.push({onClick:_?()=>{}:P,label:e.translate("account_management.switch_account")}),d.showCheckoutAsGuestKebabLink&&!C&&n.push({onClick:b,label:g}),!h&&d.showSwitchVaultedContactMenu?n:void 0},[g,b,P,e,_,C,h,d.showSwitchAccountAction,d.showCheckoutAsGuestKebabLink,d.showSwitchVaultedContactMenu])}(),p=G(la),h=De(f(()=>{e.persistence?.clearAll(),window.location.assign(o)},[e,o])),m=f(()=>{e.checkout.unstable_setRedirectingExternally(!0),h().catch(()=>{e.checkout.unstable_setRedirectingExternally(!1)})},[e.checkout,h]);return u(()=>function(e,n){const t=e.checkout.identity.current.value;if("guest"===t)throw new Bc;return function(e,n,t){return new(0,Mc[e])(n,t)}(t,e,n)}(i.appContext,{accountInfo:{logoutAndClearProposal:m,showLogoutLink:r},loadShopPayVerification:s.value,shopPayLogo:c,shopPayMoreOptions:d,checkoutAsGuest:l,violationsSubscriptionResult:p}),[i,m,r,s.value,c,d,l,p])}function Fc(e){const n=g(void 0),t=e.email,a=e.phone,i=Boolean(t||a);s(()=>{const r=n.current,o=Boolean(r),l=Boolean(r?.email||r?.phone),s=!o||r?.email!==t||r?.phone!==a;e.shouldTriggerValidation&&s?e.triggerClientSideValidation():o&&!l||i||!e.shouldClearClientSideValidation||e.clearClientSideValidation(),n.current={email:t,phone:a}},[t,i,a,e]),s(()=>{e.shouldMapServerViolationsToClient&&e.mapServerViolationsToClient()},[e])}function Hc({emailAddress:e,phone:t,logo:a,moreOptions:r,emailAlignment:o="end",children:l}){const{i18n:s,shop:u,checkout:{negotiator:c}}=rt(),d=u.hasFlagEnabled(sa)?t:void 0,p=e??(d?void 0:c.parts.email.value),h=p||d||n(D,{});return n(i,{children:[n(Q,{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,n(B,{maxInlineSize:"100%",children:"string"==typeof h?n(X,{children:[!p&&d&&n(i,{children:[n(x,{accessibilityVisibility:"exclusive",children:s.translate("contact.phone_label")})," "]}),n(ze,{children:h})]}):h}),r&&n(wl,{accessibilityLabel:s.translate("review.account_more_actions"),positionArea:"block-end",options:r})]}),l]})}function zc({layout:e,emailAlignment:t,...a}){const{i18n:i}=rt(),r=n(Hc,{...a,emailAlignment:t??("stack"===e||"box"===e?"start":"end")});switch(e){case"stack":return n(V,{gap:"base",padding:"none none base none",children:r});case"box":return n(B,{padding:"base none",children:n(V,{gap:"base",children:r})});default:return n(B,{role:"region",accessibilityLabel:i.translate("customer_account.rollup_label"),padding:"small-200 none base none",children:r})}}function jc(){const e="contact",t=Zs(e),r=f(()=>t.value=!t.value,[t]),o=Vc();Fc(o);const l=y(!1),u=Vt(),c=g(!1),{embed:d,i18n:p}=rt(),h=o.displayOptions,{vaultedContactType:m}=h,{label:v,contact:b,useSummaryInContent:_}=o.displayContent,C=o.email,P=o.displayPhone,S=o.hasError;if(s(()=>{o.hasError&&(t.value=!0)},[o.hasError,t]),"hidden"===m||o.shouldHide&&!c.current)return null;c.current=!0;const A=_?b:void 0,k="amazon"===d?.embedder?{compact:A}:{primary:A};return"rollup"===m?n(mo,{id:e,label:v??p.translate("contact.contact_method_title"),primaryContent:k.primary,compactContent:k.compact,open:t.value||S,onToggle:S||!h.expandable?void 0:r,icon:o.logo,children:h.children??null}):n(i,{children:[n(zc,{emailAddress:b,phone:P,logo:o.logo,moreOptions:o.moreOptions,layout:h.contentLayout,children:h.children??null}),o.showShopPayVerification?n(a,{when:u,children:n(Oi,{email:C??"",open:l.value,showPopover:e=>{l.value=e}})}):null]})}function Uc(){return je(new Set([...ua].filter(e=>e.startsWith("DELIVERY_COMPANY"))))}function Gc({loading:e,countryCode:n,phone:t}){const a=ca(),{i18n:i,checkout:r}=rt(),o=r.configuration.addressSettings.nonBillingAddressSettings.value,l=u(()=>o.isRequired("phone",{countryCode:n}),[n,o]),{validatePhoneNumber:c,isPhoneNumberUtilLoaded:d}=zl(),p=f(e=>{const t=ta(e);return l&&!t?i.translate("field_errors.phone_blank"):t&&!c(e??"",n)?i.translate("field_errors.shipping_line_phone_invalid"):void 0},[l,c,n,i]),h=g(!1);return s(()=>
2{if(h.current||!d||e)return;const n=p(t);a.value=n,h.current=!0},[l,d,e,t,a,p]),u(()=>({errorSignal:a,validatePhoneField:p,isPhoneRequired:l}),[a,l,p])}const Yc=new Set(da);function Wc(){const{shopPay:e,checkout:n,source:t,observability:a}=rt(),{deliveryMethodsAddressErrors:i}=n.negotiator.context,r=Bo(),{shippingAddress:o}=n.negotiator.parts,l=o.value,u=n.configuration.addressSettings.nonBillingAddressSettings.value,c="simulated"===t.type,d=Ue(l.countryCode,void 0,u),p=n.addressManager.shipping.value.selectedAddress.value,h=p?.address.countryCode,m=Ue(h??l.countryCode,void 0,u,null),{details:v}=pa(h),y=!h||void 0!==v&&!v.isFallback,{clearViolations:f}=j(Yc),b=g(!0);return s(()=>{b.current?b.current=!1:f()},[f,l]),xo("shippingAddress",async()=>{const t=async(e,t)=>await n.addressManager.shipping.value.createAddress(t)?{success:!0}:{success:!1,location:e,errors:Object.values(i).some(e=>void 0!==e.value)?[]:[r({offerGuestCheckout:!0})]};if(!c){const r=n.addressManager.shipping.value.selectedAddress.value,o=n.proposal.negotiated.fields.buyerIdentity.value?.customerProfile;if(r&&"CustomerProfile"===o?.__typename&&o.shippingAddresses.some(e=>e.id===r.id)){const o=e=>{_(()=>{for(const[n,t]of e)i[n].value=t})},s=()=>t("intercept_shipping_address_vault_ca",{address:r.address,selectAddress:!0,addressErrorsOverride:i});if(!y||r.address.countryCode!==h)return s();const u=m(r.address,"shipping");if(0===u.size)return s();const c=d(l,"shipping"),p=e=>{try{a.log("shop_pay_ca_vault_address_invalid","Selected customer-account address fails validation before Shop Pay vault-save",{invalidFields:Array.from(u.keys()).sort().join(","),proposalInvalidFields:Array.from(c.keys()).sort().join(","),proposalDiverges:!ha(l,r.address),outcome:e})}catch{}};if(0===c.size){const a=e.user.addresses.value.find(e=>ha(e.address,l));if(a&&await n.addressManager.shipping.value.selectAddress(a.id))return p("selected_matching_vaulted"),{success:!0};const r=await t("intercept_shipping_address_vault_ca_proposal",{address:l,selectAddress:!0,addressErrorsOverride:i});return p(r.success?"vaulted_proposal":"vault_proposal_rejected"),r}return p("blocked_client_side"),Ul({addressType:"shipping",validate:()=>c,setErrors:o})}}if(e.session.selectedShippingAddress.value||e.user.addresses.value.length)return{success:!0};const o=Ul({addressType:"shipping",validate:()=>d(l,"shipping"),setErrors:e=>{_(()=>{for(const[n,t]of e)i[n].value=t})}});return o.success?"authenticated_user"===e.user.flow.peek()?t("intercept_shipping_address_add_new",{address:l,addressErrorsOverride:i}):{success:!0}:o}),null}const qc=()=>{const{shopPay:e,checkout:{negotiator:n}}=rt(),{geolocation:a}=Ge(),{shippingAddress:i}=n.parts;return t(()=>{const n=i.value;return e.signup.phoneCountryCode.value??n.countryCode??a.country.code})};function $c({padding:e}){const{i18n:t,shopPay:a,checkout:{negotiator:i}}=rt(),{shopPayMobilePhoneInputShownSignal:r}=i.context,o=qc(),l=Boolean(a.user.phoneNumber.value),u=(()=>{const{i18n:e,shopPay:n}=rt(),{isPhoneNumberUtilLoaded:t,validatePhoneNumber:a}=zl(),i=qc(),r=f(n=>ta(n)?t&&!a(n??"",i.value,!0)?e.translate("mobile_phone_number.mobile_phone_invalid"):void 0:e.translate("field_errors.phone_blank"),[e,t,a,i]);return ma(n.signup.phoneNumberRawSignal,n.signup.phoneErrorRawSignal,r)})();S(()=>(r.value=!0,()=>{r.value=!1}),[r]);const c=g(o.peek());(()=>{const{shopPay:e,checkout:n}=rt(),t=n.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:a}=n.negotiator.parts,i=e.signup.phoneNumber.value,r=e.signup.phoneError.value,o=a.fields.countryCode.value,l=a.fields.phone.value,{deliveryMethodsAddressErrors:u}=n.negotiator.context,c=u.phone.value,{setAddressError:d}=Ye(u),p=qc(),{isPhoneNumberUtilLoaded:h}=zl(),m=g(!1),v=jl(p.value,i,!0);s(function(){l&&!i&&e.signup.unstable_setPhoneNumber(l);const n=e.signup.phoneCountryCode.value;o&&!n&&e.signup.unstable_setPhoneCountryCode(o)},[]),s(()=>{if(!m.current&&h&&i){const{prefix:n}=v;i.startsWith(n)||e.signup.unstable_setPhoneNumber(`${n}${i}`),m.current=!0}},[h]),va(async({parts:n,reason:a})=>{if("negotiation"!==a)return{behavior:"allow"};const{shippingAddress:i}=n;let r=e.signup.phoneNumber.peek();r&&r!==v.prefix||(r=void 0);const o=i.peek().phone;return{behavior:"allow",perform(){r!==o&&t.isVisible("phone",{countryCode:p.value,useMerchantSettings:!0})&&(i.fields.phone.value=r)}}}),s(function(){r!==c&&d("phone",r)},[r,c,d])})();const d=f(e=>{a.signup.unstable_setPhoneCountryCode(e)},[a.signup]);return n(V,{gap:"base",padding:e,children:[n(Gl,{name:"phone",countryCode:c.current,label:t.translate("mobile_phone_number.label"),autocomplete:"shipping tel",requireCountryCode:!0,disabled:l,onSelectedCountryChange:d,...u}),n(X,{type:"small",color:"subdued",children:t.translate("mobile_phone_number.disclaimer")})]})}const Kc="shipping";
2function Jc({filteredFields:e,additionalFieldGroups:t,children:i,settings:r}){const o=ya(),{shouldGateCrossBorder:l,crossBorderGate:u}=Wl(),c=rt(),{deliveryMethodsAddressErrors:d}=c.checkout.negotiator.context,{shippingAddress:p}=c.checkout.negotiator.parts,{checkout:h,i18n:m,userEvents:y,source:f,shop:b}=c,{configuration:C}=h,P=C.isAddressDelegationEnabled,{violations:S}=j(ua),A=S.value,k=p.fields?.countryCode.value,E=We(k),w=g(!1);s(()=>{if(!P)return;if(w.current)return;if(0===A.size)return;if(w.current=!0,Object.values(d).some(e=>{const n=e.value;return n&&"object"==typeof n&&"client"===n.origin&&"inline-validation"===n.type}))return;const e=E(Kc,Array.from(A));_(()=>{for(const[n,t]of e)void 0===d[n]?.value&&(d[n].value=t)})},[P,A,E,d]);const O=C.addressSettings.nonBillingAddressSettings.value,I=p.value,R=ga(),T=Qo(j(Yc)).value,L=C.defaultPhoneNumber.value;O.isRequired("phone",{countryCode:I.countryCode,useMerchantSettings:!0})&&!I.phone&&L&&(p.value={...I,phone:L});const N=v(Boolean(e&&e.length>0)),D=C.trackAddressAutoComplete?()=>{y.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...At(f,h,b),action:"address_autocomplete"}})}:void 0,M=n($o,{id:"shippingAddressForm",addressType:Kc,address:p,countries:o,settings:r,addressErrors:d,additionalFieldGroups:t,showSavedAddressSelector:!1,onAddressAutoComplete:D,onBeforeCountryChange:(e,n,t)=>{l(e)?u(n,{onCancel:t}):n()},filteredFields:e,children:i}),x=n(a,{when:N,fallback:M,children:n(B,{background:"base",borderRadius:"base",className:fa({colorLayer:"controlSelected"}),paddingInline:"base",paddingBlockStart:"large-100",paddingBlockEnd:"base",children:n(V,{direction:"block",gap:"base",children:[n(B,{padding:"none",children:[n(X,{children:[I.firstName," ",I.lastName]}),n(ql,{address:I,hiddenFields:["firstName","lastName","phone"],textColor:"subdued"})]}),M]})})});return n(Yl,{impressionType:"delivery_address",impressionFeatures:[],children:[Zc(c)&&n(Wc,{}),T&&C.visibility.showInvalidDeliveryAddressBanner.value&&n(B,{children:[n(Ii,{}),n(pe,{blockSize:"base"})]}),n(a,{when:R,children:n(B,{children:[n(Ie,{tone:"info",children:m.translate("address_management.draft_order_delivery_address_reminder")}),n(pe,{blockSize:"base"})]})}),x,n(a,{when:C.visibility.showStandalonePhoneField,children:n($c,{padding:"base none none none"})})]})}function Zc({checkout:e}){return"shopPay"===e.identity.current.value}const Xc=e=>{if(!e)return"unknown";const{taxId:n}=e;if(n.warnings.includes("DOMESTIC_NOT_APPLICABLE"))return"write";const{status:t}=e.taxId;return"pending"===t.type&&"VALID"===n.validated.status||"resolved"===t.type&&"VALID"===t.validationStatus?"vaulted":"write"};function Qc(){const e=qe(),{checkout:{negotiator:n}}=rt(),{paymentLines:a}=n.parts,{walletUsedForSubmissionSignal:i}=lt();return t(()=>e.value||ts({paymentLines:a.value,walletUsedForSubmission:i.value}))}function ed(e,n){return e.isAddressDelegationEnabled&&"shopPay"!==n&&!Sa(n)}const nd=new Set([...ua,..._a,...da,...Aa]),td=["phone","zoneCode","countryCode","firstName","lastName","name"],ad=["phone","zoneCode","countryCode","firstName","lastName","name","coordinates","oneTimeUse"];function id(e){return"pending"===e||"pendingCollapsed"===e}function rd(e){return"collapsed"===e||"pendingCollapsed"===e}function od({summary:e,forceOpen:r,initiallyOpen:o=!1,renderRollup:l}={}){const u=function(){const{checkout:{negotiator:e}}=rt(),t=e.current.fields.buyerIdentity.value?.purchasingCompany,a=fe();return t?n(fc,{formattedAddress:a}):void 0}(),c=u??e,d=v(function(){const{i18n:e}=rt(),t=Qo(j(_a)).value,a=Qo(j(Ca)).value,{hasError:i,error:r}=w(Pa),o=ae(r?{type:"payment",code:r}:void 0);return i&&o?n(Ce,{tone:"critical",errorType:F.DeliveryError,children:o}):t?n(Ei,{message:e.translate("shipping_errors.shipping_method_not_available_generic.one")}):a?n(Ei,{message:e.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions")}):null}()),p=ga(),{embed:C,i18n:P,shopPay:A,observability:k,userEvents:E,checkout:O,source:I,shop:R}=rt(),{shippingAddress:T}=O.negotiator.parts,{allViolations:L}=O.negotiator.current.fields,N=C?.client?.addressErrors.value.includes(ka.AddressEmpty)??!1,D=ya(),{installments:M}=A,H="shopPay"===O.identity.current.value,{isMissingPhone:z}=kl(),{isMissingFirstName:G}=El(),Y=z||G,W="google"===C?.embedder,q=O.configuration.addressSettings.nonBillingAddressSettings.value,$=t(()=>W&&q.isVisible("phone",{countryCode:T.value?.countryCode})),{formattedNumber:J}=jl(T.value?.countryCode??"",$.value?T.value?.phone:void 0),Z=t(()=>ed(O.configuration,O.identity.current.value)),{deliveryMethodsAddressErrors:X}=O.negotiator.context,Q=t(()=>Object.values(X).some(e=>void 0!==e.value)),ee=t(()=>Boolean(T.value?.countryCode&&!D?.some(e=>e.value===T.value.countryCode))),ne=function({checkout:e,i18n:t},a){return e.configuration.visibility.showInvalidDeliveryAddressBanner.value?n(Ii,{}):a?n(Ei,{message:t.translate("shipping_errors.unavailable_address_country")}):null}({checkout:O,i18n:P},ee.value),te=t(()=>
2function(e,n=[]){const t=Object.entries(e).reduce((e,[t,a])=>("boolean"!=typeof a&&!a||n.includes(t)||(e[t]=a),e),{});return 0===Object.keys(t).length}(T.value,Z.value?ad:td)),[ie,re]=b([]),{availableDeliveryAddresses:oe,mustSelectProvidedAddress:se}=O.proposal.negotiated.fields,ue=t(()=>oe.value??[]),ce=t(()=>se.value??!1),pe=U("Checkout::DeliveryAddress::RenderBefore"),he=U("purchase.checkout.delivery-address.render-after"),me=Ro([...pe,...he],{lazyReveal:!0}),ve=Je(),ye=t(()=>ue.value?.length&&Boolean(ue.value.find(e=>ha(T.value,e.address)))),ge=t(()=>Boolean(ye.value&&ce.value)),be=Ze(),Se=Vt(),Ae=Ea(Xe),ke=t(()=>Se.value&&"loading"===Ae.uiStateSignal.value?.status),Ee=t(()=>"filled"===Ae.uiStateSignal.value?.status),we=t(()=>!Z.value||!te.value&&Ee.value),Oe="deliveryAddress",Re=Zs(Oe,m(()=>o||(me.value||ge.value)&&we.value)),Te=function(e,n){const[t,a]=b(Xc(e)),i=g(null),r=y(!1);"vaulted"===t&&Xc(e)!==t&&a("write"),"unknown"===t&&Xc(e)!==t&&a(Xc(e));const o=f(e=>{i.current=e,n.value&&e&&r.value&&(r.value=!1,e.focus())},[r,n]);return h(()=>{n.value&&i.current&&r.value&&(r.value=!1,i.current.focus())}),{status:t,inputRef:o,focus:f(()=>{r.value=!0,a("write"),n.value&&i.current&&(r.value=!1,i.current.focus())},[r,n])}}(be,Re),Le=g(null),Ne=g(null),De=g(!1),Me=y("idle"),Be=id(Me.value),xe=rd(Me.value),Ve=y(!1),Fe=qs(wa([...pe,...he],"uiExtension").map(Mt),f(()=>{we.value&&(Re.value=!0)},[we,Re]));s(()=>{Fe&&we.value&&(Ve.value=!0)},[Fe,Ve,we.value]);const He=t(()=>Z.value&&Ve.value);s(()=>{we.value&&(me.value||Fe)&&(Re.value=!0)},[me.value,we.value,Fe,Re]),S(()=>{ve.current&&(Z.value&&te.value||Z.value&&xe||!1===ye.value&&(Re.value=!0))},[ye.value,Re,ve,Z.value,te.value,xe]),Xs({isMissing:Y,open:Re});const ze=le(),je=ze.value.deliveryAddressErrors,Ue=t(()=>ze.value.deliveryAddressErrors.length>0),Ge=Qc().value||"payPal"===O.identity.current.value,{violations:Ye,clearViolations:qe}=j(nd),en=Ye.value,nn=en.size>0,{missingAddressFieldSignal:tn,hasResolvedMissingAddressFieldSignal:an}=function({countryCode:e,addressType:n,addressViolations:t}){const{shop:a,checkout:{identity:i}}=rt(),r=a.hasFlagEnabled(ba),o=y(void 0),{violations:l}=$e(t),s=l.value,u=We(e),c=y(!1),d="applePay"===i.current.value||"googlePay"===i.current.value||"payPal"===i.current.value;if(r&&d&&void 0===o.value&&s.size>0&&!c.value){c.value=!0;const e=u(n,Array.from(s)),t=Ke({addressErrors:e});t&&(o.value=t)}return{missingAddressFieldSignal:o,hasResolvedMissingAddressFieldSignal:c}}({countryCode:T.value?.countryCode,addressType:"shipping",addressViolations:ua}),rn=t(()=>Boolean(tn.value)&&!Re.value),on=new Set([...z?Oa:[],...G?Ia:[],...rn.value?ua:[]]),ln=ao(nn,en,on),{hasError:sn,clearError:un}=w(Pa),cn=M.agreementError.value===dl.InvalidShippingAddress,dn=Zt("deliveryNext"),pn=t(()=>!Se.value||dn.value);h(()=>{ke.value&&m(()=>{un(),M.unstable_setAgreementError(null)})});const hn=f(()=>{qe(),un(),M.unstable_setAgreementError(null)},[qe,un,M]),mn=_e(T.value,{hiddenFields:["phone"],displayName:!1}),vn=P.formatName(T.value?.firstName,T.value?.lastName,!0),yn=T.value?.firstName&&T.value?.lastName?vn:void 0,gn=Pe({address:T.value??{}}),fn=n(a,{when:te,fallback:n(V,{children:[mn,$.value&&J&&n(x,{children:J})]}),children:n(x,{tone:"critical",children:P.translate("shipping.add_shipping_address")})}),bn=te.value?n(x,{tone:N?"critical":void 0,children:P.translate("shipping.add_shipping_address")}):yn,_n=te.value?void 0:n(V,{children:[gn.primary&&n(x,{children:gn.primary}),gn.secondary&&n(x,{children:gn.secondary}),$.value&&J&&n(x,{children:J})]}),Cn=n(a,{when:()=>te.value||!T.value?.postalCode,fallback:n(i,{children:[n(x,{children:P.translate("shipping.delivery_to")}),n(x,{type:"strong",children:yn})]}),children:n(x,{tone:"accent",decoration:"underline",children:P.translate("shipping.add_new_delivery_address")})}),Pn=t(()=>T.value?.postalCode),Sn=n(a,{when:()=>te.value||!Pn.value,fallback:n(V,{children:[n(x,{type:"strong",children:Pn}),$.value&&J&&n(x,{children:J})]}),children:()=>""}),An=(()=>{if(c)return{primary:c};switch(C?.embedder){case"amazon":return{compact:n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[Cn,Sn]})};case"google":return{primary:bn,secondary:_n};default:return{primary:yn,secondary:fn}}})(),kn=t(()=>Qe(L.value??[])&&!ke.value),En=v(ln&&!kn.value||sn||cn),wn=t(()=>pn.value?null:En.value&&ne&&!ke.value?{type:"invalid-address-banner",element:ne}:!d.value||kn.value||ke.value?!Ue.value||Ge||kn.value?kn.value?{type:"unavailable-in-buyer-location-banner",element:null}:null:{type:"validation-errors-banner",element:n(de,{errors:je,errorType:F.DeliveryError})}:{type:"default-vaulted-delivery-address-error-banner",element:d.value}),On=n(sd,{errorSignal:wn}),In=t(()=>Boolean(wn.value)||Ge&&Ue.value),Rn=v(ln),Tn=v(sn),Ln=v(r),Nn=v(Fe),Dn=t(()=>Q.value||Rn.value||Ue.value),Mn=t(()=>Boolean(Ln.value)||me.value||Nn.value&&we.value||He.value),Bn=t(()=>Z.value&&id(Me.value)&&rd(Me.value)&&!Mn.value&&!Tn.value&&!kn.value),xn=t(()=>an.value&&void 0===tn.value),Vn=t(()=>Dn.value&&!Bn.value),Fn=t(()=>Z.value&&Ee.value&&!Vn.value),Hn=t(()=>Fn.value&&rd(Me.value)),zn=t(()=>Mn.value||Tn.value||xn.value||!Bn.value&&In.value),jn=t(()=>Dn.value&&!(Z.value&&id(Me.value))||kn.value||Mn.value||Tn.value);De.current=jn.value;const Un=t(()=>{if(Z.value){if(te.value)return!1;if(Hn.value)return zn.value;if(Q.value&&!Bn.value&&(!an.value||!tn.value))return!0}return Re.value||zn.value}),Gn=f(()=>{Ne.current&&(clearTimeout(Ne.current),Ne.current=null)},[]),Yn=f(()=>{Gn(),Me.value="idle"}
2,[Gn,Me]),Wn=f(()=>{if(Gn(),De.current)return Me.value="collapsed",void(Re.value=!0);Me.value="collapsed",Re.value=!1},[Gn,Me,Re]),qn=f(()=>{Gn(),Ne.current=setTimeout(()=>{Ne.current=null,De.current||(Me.value="pendingCollapsed",Re.value=!1)},300)},[Gn,Me,Re]),$n=f(()=>{Yn(),Re.value=!0},[Yn,Re]);s(()=>Gn,[Gn]),s(()=>{Z.value&&Dn.value&&!Be&&Yn()},[Be,Dn.value,Z.value,Yn]);const Kn=f(async()=>{if(!Z.value||!C?.client)return;if(id(Me.value))return;re([]),Me.value="pending";const e=Un.value;He.value||qn();const n=performance.now();try{const a=await C.client.addressChangeStart("shipping").then(e=>({response:e,error:void 0})).catch(e=>({response:void 0,error:e})),i=performance.now()-n;if(a.error){const{error:n}=a;if(n instanceof Ra)return k.log("third_party_delivery_address_timeout","Address change timed out, falling back to manual entry.",{duration:i}),re([{code:"GENERAL_ERROR",message:String(P.translate("shipping.third_party_address_timeout"))}]),void $n();const t=n instanceof Error?n.message:String(n);return n instanceof Ta&&n.isUserCancelledError?(k.log("third_party_delivery_address_cancelled","User cancelled address selection",{duration:i}),Yn(),Re.value=e,void Le.current?.focus()):(n instanceof La?(k.log("third_party_delivery_address_protocol_error","Address change failed due to protocol/schema violation",{duration:i,technicalError:t}),C.client.error({code:"INVALID_PAYLOAD",message:"Invalid response format from address selection",timestamp:Date.now()})):k.log("third_party_delivery_address_error","Address change failed with error",{duration:i,error:t}),re([{code:"GENERAL_ERROR"}]),void $n())}const{response:r}=a;if(!r||"object"!=typeof r)return k.log("embedder_invalid_response","Invalid or missing response from embedder",{event:"checkout.addressChangeStart",duration:i,receivedResponse:r}),C.client.error({code:"INVALID_PAYLOAD",message:"Invalid or missing response from address selection",timestamp:Date.now()}),re([{code:"GENERAL_ERROR"}]),void $n();if(r?.errors&&r.errors.length>0)return re(r.errors),k.log("embedder_error_cancelled_operation","Address change cancelled due to embedder errors",{event:"checkout.addressChangeStart",errorCodes:r.errors.map(e=>e.code),duration:i}),void $n();if(r?.cart){_(()=>{for(const e of Object.values(X))e.value=void 0;qe()});try{await C.client.applyCart(r.cart),Ae.dispatch("addressReplaced"),He.value?Yn():Wn(),k.log("address_change_start_success","Successfully applied address change from embedder",{duration:i}),Le.current?.focus()}catch(t){k.log("cart_update_failed_after_address_change","Failed to apply cart update after address change",{event:"checkout.addressChangeStart",error:t instanceof Error?t.message:String(t),duration:i}),C.client.error({code:"INVALID_CART",message:"Failed to apply cart update after address change",timestamp:Date.now()}),re([{code:"GENERAL_ERROR"}]),$n()}}else He.value?Yn():Wn()}catch(t){const e=performance.now()-n;k.log("third_party_delivery_address_error","Error delegating address change to embedder.",{error:t instanceof Error?t.message:String(t),duration:e}),re([{code:"GENERAL_ERROR"}]),$n()}},[He,Z,C,k,re,P,X,Me,Ae,qe,Un,qn,$n,Yn,Re,Wn]),Jn=f(async()=>{if(He.value)return;if(Z.value){if(Re.value)return;return void(await Kn())}const e=!Re.value;!function({checkout:e,userEvents:n,shop:t,source:a},i){"shopPay"===e.identity.current.value&&n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(a,e,t),action:i?"shipping_addresses_expand":"shipping_addresses_collapse"}})}({userEvents:E,source:I,checkout:O,shop:R},e),Re.value=e},[He,E,I,O,R,Re,Kn,Z]);s(()=>{!Z.value||!xe||Vn.value||zn.value?Un.value?Re.value=!0:Hn.value&&!zn.value&&(Re.value=!1):Re.value=!1},[Re,Z.value,xe,Vn.value,Un.value,Hn.value,zn.value]);const Zn=0===pe.length&&0===he.length,Xn=1===ue.value.length&&ce.value&&Zn,Qn=p.value,et=!pn.value&&!ke.value&&!Bn.value&&ln&&!(Z.value&&te.value),nt=Z.value&&!Bn.value&&Q.value&&!te.value,tt=et||nt,at=(()=>{if(Z.value){const{firstName:e,lastName:t}=T.value,i=!0,r=P.formatName(e,t,i);return n(V,{children:[e&&t&&n(x,{children:r}),n(a,{when:te,fallback:n(x,{color:"subdued",children:mn}),children:n(x,{tone:"critical",children:P.translate("address_management.address_form.add_address")})})]})}return c??mn})(),it=te.value?P.translate("shipping.add_shipping_address"):void 0,ot=be&&!Un.value?n(Kl,{vatNumber:be.taxId.value,onAdd:()=>{Re.value=!0,Te.focus()}}):void 0,lt=rn.value?n(B,{padding:"none base base base",children:n(Jc,{filteredFields:tn.value?[tn.value]:void 0})}):void 0,st=lt&&ot?n(V,{direction:"block",gap:"base",children:[lt,ot]}):lt??ot,ut=n(Ie,{tone:"info",children:P.translate("address_management.draft_order_delivery_address_reminder")}),ct=Hn.value&&!zn.value||Bn.value?null:p.value?n(i,{children:[On,ut]}):wn.value?On:null,dt=rn.value?{}:{primaryContent:An.primary,secondaryContent:An.secondary,compactContent:An.compact,inlinePrimaryContent:bn,inlineSecondaryContent:_n,compactPrimaryContent:Cn,compactSecondaryContent:Sn,summary:at},pt={buttonRef:Le,open:Re.value,id:Oe,label:P.translate("shipping.shipping_address_title"),error:ct,buttonAccessibilityLabel:it,...dt,secondaryPersistentContent:st,onToggle:Qn?void 0:Jn,disabled:He.value||Xn||!Fn.value&&tt,renderChildrenWhenCollapsed:!0,icon:n(K,{id:"deliveryAddress-truckIcon",type:"truck",size:"fill"})},ht=n(Us,{embedderErrors:ie,onDismissEmbedderErrors:()=>re([]),showMissingAddressField:rn.value,onAddressDelegation:Kn,onFirstNamePersisted:hn,vatIdFieldMode:Te});return n(i,{children:[H&&n(Wc,{}),l?l(pt,ht):n(mo,{...pt,children:ht})]})}const ld=({errorBanner:e})=>n(B,{paddingBlock:"small-500",children:e}),sd=({errorSignal:e})=>{const t=e.value;if(!t)return null;const a=t.type;
2switch(a){case"invalid-address-banner":case"default-vaulted-delivery-address-error-banner":case"validation-errors-banner":return n(ld,{errorBanner:t.element});case"unavailable-in-buyer-location-banner":return n(ld,{errorBanner:n(Ri,{})});default:A(a)}};function ud(){const{formattedAddress:e,address:{phone:t,countryCode:a}}=en(["company"]),r=!N().value,{errorSignal:o}=Gc({loading:r,phone:t,countryCode:a}),l=Boolean(Uc()?.length),s=Boolean(nn()?.length),u=Boolean(o.value),c=Boolean(s||l||u);return n(od,{summary:r?n(D,{}):n(V,{direction:"inline",children:[c&&n(i,{children:[n(K,{tone:"critical",type:"alert-circle"}),n(pe,{display:"inline",inlineSize:"small-400"})]}),e]}),forceOpen:c})}function cd(e){const{checkout:{identity:a}}=rt(),i=function(){const{checkout:{negotiator:e}}=rt(),n=e.current.fields.buyerIdentity,a=tn(),i=an();return t(()=>Boolean(n.value?.purchasingCompany)&&(!a.value||i.value))}();return"amazonPay"===a.current.value||"buyWithPrime"===a.current.value?n(ud,{}):i.value?n(_c,{}):n(od,{...e})}function dd(){const{i18n:e,router:i,checkout:{negotiator:r}}=rt(),o=r.current.fields.buyerIdentity.value?.purchasingCompany,l=Ll(),s=an(),u="deliveryAddress",c=t(()=>Js(i,u));return!o||o.contact.locationCount<=1||s.value?n(E,{id:u,level:1,autoFocus:c.value,children:e.translate("shipping.delivery_title")}):n(Q,{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:[n(E,{id:u,level:1,autoFocus:c.value,children:e.translate("contact.ship_to_company",{companyName:o.location.name})}),n(a,{when:l,children:n(fo,{})})]})}function pd(){const{i18n:e}=rt(),{eligibility:t,redeemableBalance:a,messages:i,isDigitalGoodsRedemptionAllowed:r}=vc(),o=(t.eligible||r)&&a,l=i.length>0?n(V,{gap:"small-200",children:i}):void 0;return o||l?o?n(hd,{redeemableBalance:a,messages:l}):n(mo,{id:"cashRedemption",open:!1,label:e.translate("order_summary.shop_cash_title"),error:l}):null}function hd({redeemableBalance:e,messages:t}){const{i18n:a}=rt(),{amount:i,checked:r,handleChange:o,disabled:l}=ac(e),s=e?a.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"}):void 0;return n(mo,{id:"cashRedemption",open:!0,label:a.translate("order_summary.shop_cash_title"),primaryContent:s,error:t,primaryAction:n(Uu,{checked:r,onChange:o,disabled:l}),children:n(x,{fonts:"primary",tone:"accent",children:i})})}function md({onShowPickupLocations:e}={}){const{i18n:i}=rt(),r=ye(),[o]=rn(),l=o.includes("PICK_UP"),{value:s}=on().value,{value:u}=ln().value,c=Boolean(s||u),d=Ti({mode:"localPickup"}),p=t(()=>d.value.merchandiseLines),h=t(()=>d.value.allowAlternativeAction),m=t(()=>d.value.merchandiseLines.length>0),v=sn(),y=c&&!m.value;if(!l||!r.value.delivery)return null;const g=m.value&&c;return n(Ni,{name:"local-pickup-adjacent",variant:"adjacent",children:n(V,{gap:m.value?"base":"small-400",paddingBlockEnd:g?"base":void 0,children:[n(a,{when:v,children:n(B,{paddingBlockStart:"small-400",paddingBlockEnd:y?"small-400":void 0,children:n(E,{level:2,children:i.translate("delivery_options.pickup")})})}),n(a,{when:m,children:n(Li,{bannerType:"pickup",merchandiseLines:p,allowAlternativeAction:h})}),n(vd,{hasNoDeliveryMethods:c,onShowPickupLocations:e})]})})}function vd({hasNoDeliveryMethods:e,onShowPickupLocations:r}){const{i18n:o}=rt(),l=sn(),s=Na(),{progressing:u}=ge(),c=Zt("deliveryNext").value,d=Vt(),{isOnlyCountryAvailable:p}=Di(),h=y(!1),m=t(()=>s.value?.methods??[]),g=t(()=>{const e=s.value;return e&&Da(e)}),f=t(()=>m.value.length>0&&Mi(m.value)),b=v(G(Ma).hasViolations),_=Bi({allLocationsFarAway:f,selectedPickupOptionNoLongerAvailable:b}),C=un({methods:m.value,selectedDeliveryMethodHandle:g.value?.handle}),P=t(()=>cn(s.value?.targetMerchandiseLines)),S=t(()=>xi(m.value,p,P.value,o,{selectedDeliveryMethodHandle:g.value?.handle,allLocationsFarAway:f.value})),A=()=>{C(p?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain"),r?r():h.value=!0};return e?null:n(i,{children:[n(a,{when:_,children:n(Vi,{itemCount:P.value,methods:m.value,onChangeLocationClick:A})}),n(V,{direction:"inline",gap:"small-400",alignItems:"center",justifyContent:"space-between",paddingBlockStart:l.value?void 0:"small-200",paddingBlockEnd:l.value?"small":"small-200",children:[d.value&&!u.value&&c?n(D,{inl
2ineSize:"base"}):n(x,{color:"subdued",children:S}),n(Fi,{onClick:A})]}),r?null:n(Hi,{methods:s.value?.methods,type:s.value?.type,open:h.value,onClose:()=>{h.value=!1}})]})}const yd={isLocationFormVisible:!1};function gd({initiallyOpen:e=!1,renderRollup:a}){const{i18n:r,shop:o,checkout:{negotiator:l}}=rt(),{deliveryNext:s}=l.current.fields,{progressing:u}=ge(),c=Zt("deliveryNext"),d=Vt(),{value:p}=on().value,{value:h}=ln().value,m=Boolean(p||h),v=Na(),f=t(()=>Ba(s.value)??[]),_=t(()=>o.shipPickupInOneOrderEnabled?v.value&&Da(v.value):f.value[0]),C=t(()=>_.value?.handle??""),P=t(()=>({handle:C.value})),S=zi(),{isOnlyCountryAvailable:A}=Di(),k=_e(_.value?.pickupLocation?.address,{hiddenFields:["postalCode","countryCode","phone"]}),E=U("Checkout::PickupLocations::RenderBefore"),w=U("Checkout::PickupLocations::RenderAfter"),O=U("purchase.checkout.pickup-location-option-item.render-after"),I=E.length>0?n(dn,{customizations:E,options:yd}):void 0,R=w.length>0?n(dn,{customizations:w,options:yd}):void 0,T=ji(),L=un({methods:f.value||[],selectedDeliveryMethodHandle:_.value?.handle}),[N,M]=b(!1),B=y(e),x=y(!1),F=e=>{M(!0),x.value=e??!1},{currentAdditionalLocations:H,additionalLocationsCount:z}=function(e){const n=g(),a=t(()=>{const t=e.value?e.value.methods.length-1:void 0;return void 0!==t&&(n.current=t),t}),i=t(()=>a.value??n.current);return{currentAdditionalLocations:a,additionalLocationsCount:i}}(v),j=t(()=>Boolean(H.value)||d.value&&c.value&&0!==z.value);let G,Y,W,q,$;const K=T.value?n(V,{gap:"small-200",children:n(Ui,{variant:"banner"})}):void 0;if(d.value&&!u.value&&c.value)G=n(D,{}),Y=n(D,{inlineSize:"base"}),W=n(D,{inlineSize:"small"}),$=K;else if(_.value?.pickupLocation){const{cost:{amount:e,currencyCode:t},pickupLocation:{name:a}}=_.value,o="PickupInStoreLocation"===_.value.pickupLocation?.type?_.value.pickupLocation.distanceFromBuyer:void 0,l=o&&!A?Gi(r,o):void 0,s=0===e?r.translate("shipping.free_rate_label"):r.formatCurrency(e,{currency:t}),u="PickupInStoreLocation"===_.value.pickupLocation.type&&_.value.pickupLocation.instructions.trim();G=n(i,{children:[a,n(Jl,{}),s]}),Y=k||void 0;const c=l||u?n(Wi,{distanceLabel:l,instructions:u||void 0}):null,d=O.length>0?n(dn,{customizations:O,options:P.value}):null;W=c&&d?n(V,{gap:"small-400",children:[c,d]}):c??d??void 0,q=I?n(V,{gap:"small-200",children:I}):void 0,$=K||R?n(V,{gap:"small-200",children:[K,R]}):void 0}const J=!c.value&&!0===m,Z=m?n(Fi,{onClick:()=>{F(),L(A?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},commandFor:Yi}):void 0,X=j.value?n(fd,{locationCount:z.value,onShowModal:F,onTrackAnalytics:()=>L("checkout_pickup_buyer_reveal_more")}):void 0,Q=a?{id:"pickupLocations",label:r.translate("delivery_options.pickup"),open:B.value,disabled:J||O.length>0,onToggle:()=>{B.value=!B.value},primaryContent:G,secondaryContent:Y,primaryPersistentContent:q,secondaryPersistentContent:R}:{id:"pickupLocations",label:r.translate("local_pickup.title"),open:J,primaryContent:G,secondaryContent:Y,tertiaryContent:W,primaryPersistentContent:q,secondaryPersistentContent:$,primaryAction:Z,secondaryActions:X},ee=n(Gs,{onShowModal:F}),ne=a?n(V,{gap:"base",children:[n($l.Provider,{value:!1,children:n(md,{onShowPickupLocations:()=>F()})}),Z,ee,X]}):S&&ee;return n(i,{children:[a?a(Q,ne):n(mo,{...Q,children:ne}),n(Hi,{methods:v.value?.methods,type:v.value?.type,open:N,onClose:()=>{M(!1),x.value=!1},addressFocus:x})]})}function fd({locationCount:e,onShowModal:i,onTrackAnalytics:r}){const{progressing:o}=ge(),l=Zt("deliveryNext"),s=on(),u=t(()=>o.value||!l.value&&!s.value.loading);return n(a,{when:u,fallback:n(D,{}),children:n(bd,{locationCount:e,onShowModal:i,onTrackAnalytics:r})})}function bd({locationCount:e,onShowModal:t,onTrackAnalytics:a}){const{i18n:i}=rt();return e?n(H,{variant:"plain",textDecoration:"none",inlineAlignment:"start",onClick:()=>{t(),a()},children:n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:n(x,{type:"strong",children:e>20?i.translate("local_pickup.toggle_multiple_locations",{count:String(20)}):i.translate("local_pickup.toggle_more_locations",{count:e})})})}):null}function _d({destination:e}){const t=y(!1),a=y();return n(i,{children:[n("deliveryAddress"===e?cd:gd,{initiallyOpen:t.value,renderRollup:(e,n)=>(a.value={props:e,content:n},null)}),n(Cd,{rollup:a,switched:t})]})}function Cd({rollup:e,switched:t}){const a=e.value;return a?n(mo,{...a.props,children:n(V,{gap:"base",children:[n(Pd,{switched:t}),a.content]}
2)}):null}function Pd({switched:e}){const t=pn();return t?n(qi,{options:t.options,selected:t.selected,select:n=>{e.value=!0,t.select(n)},showChangedBanner:!1}):null}const Sd=new Set(["SHIPPING","PICK_UP"]);function Ad(){const{checkout:e,shop:n}=rt(),a=v(pn()),i=n.hasFlagEnabled(xa);return t(()=>"next"===a.value?.variant&&(!i||1===e.sections.availableToRender.value.filter(e=>"deliveryAddress"===e||"localPickupOptions"===e).length)&&function(e,n=[],t=[]){return"vaulted"===e&&n.every(({id:e})=>Sd.has(e))&&1===t.length&&Sd.has(t[0])}(e.configuration.deliveryMethodSelectorPlacement,a.value?.options.value,a.value?.selected.value))}const kd=()=>{const{i18n:e,checkout:{negotiator:t}}=rt(),a=y(!0),{value:i}=t.current.fields.optionalDuties,r=i?.buyerRefusesDuties?e.translate("shipping.duties_and_taxes_options.ddu_title"):e.translate("shipping.duties_and_taxes_options.ddp_title");return n(mo,{open:a.value,id:"optionalDuties",label:e.translate("shipping.duties_and_taxes_title"),primaryContent:r,onToggle:()=>a.value=!a.value,children:n(os,{})})};function Ed(){const{i18n:e,checkout:t}=rt(),a=t.negotiator.parts.shippingAddress.value,{deliveryNext:{value:i},buyerIdentity:{value:r}}=t.negotiator.current.fields,o=(t.proposal.facts.delivery??[])[0],l=r?.purchasingCompany,s=l?.location.name,u=Boolean(l)&&Boolean(s),c="unavailable"===i?.status?a:o?.deliveryAddress,d=_e(c??void 0,{countryFormat:"explicit",displayName:u}),p=e.formatName(c?.firstName,c?.lastName,!0);if(o?.pickupAddress)return n(wd,{address:o.pickupAddress??void 0});const h=c?p:e.translate("review.blocks.no_address"),m=u?s:h,v=u?e.translate("review.blocks.no_address"):void 0,y=c?d:v;return n(mo,{id:"orderEditDeliveryAddress",label:e.translate("review.blocks.shipping_address_title"),primaryContent:m,secondaryContent:y})}function wd({address:e}){const{i18n:t}=rt(),a=_e(e,{hiddenFields:["postalCode","countryCode","phone"]}),i=a?n(x,{children:a}):void 0;return n(mo,{id:"orderEditDeliveryAddress",label:t.translate("local_pickup.title"),primaryContent:i})}function Od(){const{i18n:e,checkout:t}=rt(),a=(t.proposal.facts.delivery??[])[0],i=a?.lines.filter(({deliveryChange:e,isFulfilled:n})=>"REMOVED"!==e&&!n).map(e=>n(gr,{line:e},e.title));return n(mo,{id:"orderEditShippingMethod",label:e.translate("shipping.title"),primaryContent:i})}function Id(){const{i18n:e,shopPay:n,checkout:a}=rt(),i=_t(),{paymentMethods:r}=a.negotiator.current.fields;return t(()=>function({i18n:e,shopPay:n,chargeAmount:t,numberOfPaymentTerms:a,installmentsUnavailable:i,paymentDue:r,installmentsConfig:o}){const l=us(n),s=r?.currencyCode,u=o?.availableLoanTypes,c=t?e.formatCurrency(t,{currency:s,form:"short"}):void 0,{payNowLabel:d,payNowSubtitle:p}={payNowLabel:e.translate("installments.installments_pay_now"),payNowSubtitle:e.translate("installments.installments_pay_now_subtitle")},h=()=>2===a?e.translate("installments.pay_in_installments_subtitle.split_pay_2"):1===a?e.translate("installments.pay_in_installments_subtitle.split_pay_30"):e.translate("installments.pay_in_installments_subtitle.split_pay"),m="GBP"===s?e.translate("installments.pay_in_installments.gb"):"AUD"===s?e.translate("installments.pay_in_installments.au"):!i&&c&&u&&0!==u.length?u.includes("ZERO_PERCENT")?e.translate("installments.pay_in_installments.only_interest"):u.includes("INTEREST")&&u.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments.all"):u.includes("INTEREST")?e.translate("installments.pay_in_installments.only_interest"):(g=c,2===a?e.translate("installments.pay_in_installments.only_split_pay_2",{amount:g}):1===a?e.translate("installments.pay_in_installments.only_split_pay_30",{amount:g}):e.translate("installments.pay_in_installments.only_split_pay",{amount:g})):2===a?e.translate("installments.pay_in_installments_no_amount_2"):1===a?e.translate("installments.pay_in_installments_no_amount_30"):e.translate("installments.pay_in_installments_no_amount"),v="GBP"===s?!i&&u&&c&&0!==u.length?2===a?h():u.includes("INTEREST")&&u.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:c}):u.includes("ZERO_PERCENT")&&u.includes("SPLIT_PAY")&&(6===a||12===a)?e.translate("installments.pay_in_installments_subt
2itle.split_pay_3_6z_12z_gb",{amount:c}):u.includes("ZERO_PERCENT")&&12===a?e.translate("installments.pay_in_installments_subtitle.zero_percent_12z_gb",{amount:c}):u?.includes("ZERO_PERCENT")&&6===a?e.translate("installments.pay_in_installments_subtitle.zero_percent_6z_gb",{amount:c}):u.includes("INTEREST")?e.translate("installments.pay_in_installments_subtitle.informational_gb"):e.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:c}):e.translate("installments.pay_in_installments_subtitle.informational_gb"):u&&c&&0!==u.length?u.includes("ZERO_PERCENT")?e.translate("installments.pay_in_installments_subtitle.interest"):u.includes("INTEREST")&&u.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments_subtitle.all",{amount:c}):u.includes("INTEREST")?e.translate("installments.pay_in_installments_subtitle.interest"):h():h(),y="SHOP_PAY"===l;var g;return{payNowLabel:d,payNowSubtitle:p,installmentsLabel:m,installmentsSubtitle:v,summary:"SHOP_PAY"===l?`${d} - ${p}`:`${m} - ${v}`,primaryLabel:y?d:m,secondaryLabel:y?p:v}}({i18n:e,shopPay:n,chargeAmount:a.installments.chargeAmount.value,numberOfPaymentTerms:a.installments.numberOfPaymentTerms.value,installmentsUnavailable:a.installments.isUnavailable.value,paymentDue:i.value,installmentsConfig:Va(r.value)}))}function Rd(){const{userEvents:e}=rt(),n=hn(Fa.SHOP_PAY_PAY_NOW),t=hn(Fa.SHOP_PAY_INSTALLMENTS),a=hn(Fa.SHOP_PAY_INSTALLMENTS_DEFAULTED),i=hn(Fa.SHOP_PAY_PAY_NOW_DEFAULTED);return{recordRetailEvent:f(r=>{const o=function(){switch(r){case"payment_method_pay_now":return n;case"payment_method_installments":default:return t;case"default_payment_method_installments":return a;case"default_payment_method_pay_now":return i}}();return e.monorailEvent({schemaId:"retail_shop_pay/2.0",payload:o})},[e,n,t,a,i])}}function Td({onAutoExpand:e,ineligibilityReasonLabel:n}){const{source:a,checkout:i,shop:r,observability:o,userEvents:l,shopPay:u,embed:c}=rt(),{visibility:d}=u,p=i.installments.isSupported.value,h=i.installments.isUnavailable.value,m=mn(),v=us(u),{paymentMethods:y}=i.negotiator.current.fields,f=t(()=>
2Va(y.value)),b=p?f.value?.availableLoanTypes:void 0,_=g(),C=fl(),P=u.user.installments.isRetryable.value,{recordRetailEvent:S}=Rd();s(()=>{n&&!P&&"SHOPIFY_INSTALLMENTS"===v&&u.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOP_PAY"})},[P,n,v,u.session]),s(()=>{u.session.isInternalProgressing.value||p&&!h&&(!m.value&&d.showAutoExpandedPaymentMethods&&e?.(),C.value.spiPreselected&&(u.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOPIFY_INSTALLMENTS"}),o.leaveErrorBreadcrumb("SPI preselected",{})))},[p,h,m.value,C.value.spiPreselected,u.session,o,d.showAutoExpandedPaymentMethods,e]),s(()=>{m.value&&p&&S(h?"default_payment_method_pay_now":"default_payment_method_installments")},[p,h,m.value,S]),s(()=>{!h&&b&&JSON.stringify(_.current)!==JSON.stringify(b)&&(l.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...pl(a,i,r,{embedPlatform:c?.platform,shopAppSurface:u.app.config.surface}),eventType:Ha.InterestEligibility,success:za(b),errorMessage:za(b)?void 0:JSON.stringify(["amount"])}}),l.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...pl(a,i,r,{embedPlatform:c?.platform,shopAppSurface:u.app.config.surface}),eventType:Ha.SplitPayEligibility,success:Boolean(b.includes("SPLIT_PAY")),errorMessage:b.includes("SPLIT_PAY")?void 0:JSON.stringify(["amount"])}}),_.current=b)},[b,h,l,a,i,r,c?.platform,u.app.config.surface])}function Ld(){const{i18n:e}=rt(),t=y(!1),a=Id(),i=vn(),r=f(()=>{t.value=!t.value},[t]);return Td({onAutoExpand:f(()=>{t.value=!0},[t]),ineligibilityReasonLabel:i}),n(mo,{open:t.value,id:"paymentOptions",label:e.translate("payment.payment_option.title"),primaryContent:a.value.primaryLabel,secondaryContent:a.value.secondaryLabel,onToggle:r,children:n(Ys,{ineligibilityReason:i})})}function Nd(){const{i18n:e}=rt();return n(mo,{label:e.translate("pickup_point.title"),open:!0,children:n(yn,{rowsInset:!0,children:n($i,{heading:"none"})})})}function Dd(){const{userEvents:e,shop:n,source:t,checkout:a}=rt();return{trackOnDeliveryToggle:f(i=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...At(t,a,n),action:i?"shipping_rates_expand":"shipping_rates_collapse"}})},[e,t,a,n]),trackSelectShippingMethod:f((i,r)=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_select_shipping_rate/3.1",payload:{...At(t,a,n),currentRate:i.handle??"",currentRatePrice:`${i?.cost?.amount??0}`,isLocalDelivery:!i.pickupLocation&&"LOCAL"===i.methodType,isLocalPickup:Boolean(i.pickupLocation),previousRate:r?.handle,previousRatePrice:"number"==typeof r?.cost?.amount?`${r?.cost?.amount}`:void 0}})},[e,t,a,n])}}const Md=o({displayName:"ShippingGroupsSummary",load:()=>p(()=>e(()=>import("./17a5f1e4.Rx2_Gm8c.js"),__vite__mapDeps([125,1,2,3,4,5,6,7,8,9,10,11,12,92,93,94,126,85,21,22,18,23,19,24,66,43,67,68,69,70,71,41,42,44,45,46,47,48,49,50,51,72,40,73,74,75,76,77,78,79,80,81,56,82,83,84,86,95,96,97,98,99,100,101,102,13,14,15,16,17,20,25,26,27,28,29,30,31,32,33,34,37,38,39,103,104,57,105,106,107,87,108,54,109,110,111,112,113,114,91,115,116,117,118,62,119,61,120,121]))),renderLoading:()=>n(D,{})});function Bd({lines:e,hideThumbnail:t,shippingTime:a}){const{i18n:r,checkout:o}=rt(),{deliveryExpectationLines:l}=ms(),s=o.configuration.layout.isOnePage.value,u=e=>{const t=e.methods.find(({handle:n})=>n===e.selectedDeliveryMethodHandle);if(!t)return null;const{handle:i,cost:o,costAfterDiscounts:u,brandedPromise:c,estimatedTimeInTransit:d}=t,p="LOCAL"===t.methodType,h=Boolean(t?.deliveryPredictionEligible),{deliveryExpectation:m}=bn(t,l||[],Boolean(h||c));return n(V,{gap:"small-400",children:n(B,{children:[n(vs,{methodTitle:_n({deliveryMethod:t,localDelivery:p?r.translate("shipping.local_delivery"):void 0}),showInterpunct:!0,price:n(ys,{cost:o,costAfterDiscounts:u,inlineDiscount:!0})}),a?n(X,{color:"subdued",size:s?void 0:"small",children:a}):n(gs,{deliveryMethod:t,deliveryExpectationLine:m,estimatedTimeInTransit:d,paragraphColor:"subdued"})]})},i)};return n(i,{children:e.map(e=>{const a=gn(e.targetMerchandiseLines??[]);return a.slice(0,1).map(i=>n(Q,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"large-100",alignItems:"center",alignContent:"center",children:[!t&&(a.length>1?n(fn,{variant:"fan-legacy",merchandise:a,size:"small",useResponsiveImageSources:!0,useTitleAsAltTextFallback:!0}):n(cs,{merchandiseItem:i,hideBadge:!0})),u(e)]},i.id))})})}function xd({deliveryNextValue:e}){const t=Ga(e).filter(Cn);return t.length?n(Q,{gridAutoRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",children:n(Bd,{lines:t,hideThumbnail:1===t.length})}):null}function Vd({cost:e,costAfterDiscounts:t,hideDiscountedTotalOnShippingSelector:a,styleOverrides:i={}}){return e&&t?n(ys,{cost:e,costAfterDiscounts:t,inlineDiscount:!0,preDiscountCost:a,styleOverrides:i}):null}function Fd(){const{i18n:e,checkout:{identity:{current:t}}}=rt(),a=t.value,i="amazonPay"===a||"buyWithPrime"===a;return!N().value&&i?n(mo,{id:"amazonPayShippingMethods",label:e.translate("shipping.title"),primaryContent:n(D,{})}):n(Hd,{})}function Hd(){const{embed:e,i18n:a,checkout:r}=rt(),o=ds(),{hasMultipleDeliveryGroups:l}=o.value,s=r.configuration.isAddressDelegationEnabled,{customizationsForRollupReveal:u}=ps({hasMultipleDeliveryGroups:l,targeted:!1,shouldHandleRollup:!0}).value,c=U("Checkout::ShippingMethodDetails::RenderAfter"),d=U("Checkout::ShippingMethodDetails::RenderExpanded"),{uiStateSignal:p}=Ea(Xe),{hasViolations:m}=G(Ya),y=v(m),g=Qc(),b=Qo(Pn(Wa)),_=t(()=>g.value&&b.value),C=sn(),P=Ro([...u,...c,...d],{lazyReveal:!0}),S="shippingMethod",A=Zs(S,P.peek()),k=v(qs(wa([...u,...c,...d],"uiExtension").map(Mt),f(()=>{A.value=!0},[A])));h(()=>{P.value&&(A.value=!0)}),h(()=>{(y.value||_.value||!C.value&&function(e){if("filled"!==e.status)return!1;const n=["SHIPPING","LOCAL"];return e.deliveryLines.some(e=>{const t=qa(e);return!!n.includes(t?.methodType||"")&&"available"===e.status&&e.hasDeliveryLineChange})}(p.value))&&(A.value=!0)});const E=function({identity:{current:e}}){const{trackOnDeliveryToggle:n}=Dd(),t=f(e=>{n(e)},[n]);return"shopPay"===e.value?t:void 0}({identity:r.identity}),w=f(()=>{const e=!A.value;E?.(e),A.value=e},[E,A]),{deliveryNext:O,shippingAddress:I}=r.negotiator.current.fields,{deliveryLines:R}=r.negotiator.parts,T=function({i18n:e,identity:{current:n}}){switch(n.value){case"amazonPay":case"buyWithPrime":case"businessCustomer":case"customerAccount":case"shopPay":return{addressIncompleteMessage:e.translate("shipping.method_summary.incomplete_address_selected"),addressInvalidMessage:e.translate("shipping_errors.invalid_shipping_method_summary")}
2;default:return}}({i18n:a,identity:r.identity}),L=function({state:e,addressInvalidMessage:t,addressIncompleteMessage:a}){const{i18n:r,checkout:{negotiator:o}}=rt(),l=o.current.fields.deliveryNext,s=Zt("deliveryNext"),{deliveryExpectationLines:u}=ms(),{rollup:{secondaryContent:{typography:{color:c}={}}={}}={}}=he(),d=sn(),p=c??"base",h="filled"===e.status?e.deliveryLines:void 0,m=Zl({deliveryLines:h}),v=Qo(j(ja)).value,y=Qo(j(_a)).value,g=n(V,{children:[n(D,{inlineSize:"base",size:"small"}),n(D,{inlineSize:"small",size:"extraSmall"})]});if("initial"===e.status||"loading"===e.status)return{compactPrimaryContent:n(D,{inlineSize:"base",size:"small"}),compactSecondaryContent:void 0,inlinePrimaryContent:g,inlineSecondaryContent:void 0,primaryContent:g,secondaryContent:void 0};if("empty"===e.status||"error"===e.status){const i=a??r.translate("shipping.method_summary.incomplete_address_entered"),o=t??r.translate("shipping.invalid_shipping_method_summary"),l=r.translate("shipping.different_shipping_method_summary");let s="empty"===e.status?i:o;v?s=i:y&&(s=l);const u=n(x,{children:s});return{compactPrimaryContent:u,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:u,primaryContent:u,secondaryContent:void 0}}if(Ua(l.value,d.value)){if(s.value)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:g,secondaryContent:void 0};let e=n(Md,{});return m?e=n(Ql,{summary:m}):d.value&&(e=n(xd,{deliveryNextValue:l.value})),{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:e,secondaryContent:m?n(Xl,{summary:m,secondaryContentColor:p}):void 0}}const f=d.value?e.deliveryLines.filter(Cn):e.deliveryLines,b=So(f);if(!b)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:void 0,secondaryContent:void 0};const{costAfterDiscounts:_,cost:C,hideDiscountedTotalOnShippingSelector:P}=b,S=_n({deliveryMethod:b,localDelivery:"LOCAL"===b.methodType?r.translate("shipping.local_delivery"):void 0}),A=u?.find(e=>e.deliveryStrategyHandle===b.handle),k=n(vs,{methodTitle:S,showInterpunct:!0,price:C&&_?n(Vd,{cost:C,costAfterDiscounts:_,hideDiscountedTotalOnShippingSelector:P}):void 0}),E=n(gs,{deliveryMethod:b,deliveryExpectationLine:A,paragraphColor:c??"base"});return{compactPrimaryContent:n(x,{type:"strong",children:n(vs,{methodTitle:S})}),compactSecondaryContent:n(i,{children:[n(gs,{deliveryMethod:b,deliveryExpectationLine:A,paragraphColor:c,formatContent:e=>e?n(V,{display:"inline",direction:"inline",columnGap:"none",alignItems:"center",children:["(",e,")"]}):null}),n(x,{color:c,children:n(Vd,{cost:C,costAfterDiscounts:_,hideDiscountedTotalOnShippingSelector:P,styleOverrides:{shouldBold:!1}})})]}),inlinePrimaryContent:k,inlineSecondaryContent:E,primaryContent:k,secondaryContent:E}}({state:p.value,addressIncompleteMessage:T?.addressIncompleteMessage,addressInvalidMessage:T?.addressInvalidMessage}),N=(()=>{switch(e?.embedder){case"amazon":{const{compactPrimaryContent:e,compactSecondaryContent:t}=L;return void 0===e&&void 0===t?{primary:L.primaryContent,secondary:L.secondaryContent}:{compact:n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[e,t]})}}case"google":return{primary:L.inlinePrimaryContent,secondary:L.inlineSecondaryContent};default:return{primary:L.primaryContent,secondary:L.secondaryContent}}})();h(()=>{const e=function(e,n,t){return $a(e).some(({line:e,method:a})=>{if("SHIPPING"!==a?.methodType&&"LOCAL"!==a?.methodType)return!1;if(!a?.phoneRequired)return!1;const i=n.find(n=>{const t=n.peek();return t.type===e.type&&t.id===e.id}),r=i?.fields.deliveryMethodOptions.value.phone?.value;return!r&&!t})}(O.value,R.value,I.value?.phone);e&&(A.value=!0)});const M=t(()=>("error"===p.value.status||"empty"===p.value.status)&&!(P.value||k.value));return h(()=>{M.value&&(A.value=!1)}),n(mo,{open:A.value,id:S,label:a.translate("shipping.title"),primaryContent:N.primary,secondaryContent:N.secondary,compactContent:N.compact,onToggle:s&&"empty"===p.value.status||M.value?void 0:w,renderChildrenWhenCollapsed:!0,icon:n(K,{id:"shippingMethod-packageDeliveryIcon",type:"package-delivery",size:"fill"}),children:n(zs,{singleDeliveryGroup:o})})}const zd={rollup:{label:{visibility:"visible"},blockAlignment:"center"}},jd={rollup:{label:{visibility:"hidden"},blockAlignment:"center"}},Ud={SHIPPING:{id:"shippingMerchandiseList"},PICK_UP:{id:"pickupMerchandiseList"}};function Gd({selectedDeliveryMethodType:e}){const{i18n:i}=rt(),r=sn(),{showOverlay:o}=Sn(),l=y(!1),s=Ud[e],u=Ki(e),{visibleSummary:c,isNegotiating:d}=Ji(u),p=Vt(),{shouldOpenModal:h}=Zi(),m=t(()=>{const e=c.value;return e?e.isAllItems?i.translate("split_delivery.all_items"):i.translate("split_delivery.items_count",{count:e.totalItemCount}):""}),v="PICK_UP"===e?i.translate("delivery_options.pick_up"):i.translate("delivery_options.ship"),g=n(a,{when:()=>!(void 0===c.value||p.value&&d.value),fallback:n(D,{}),children:n(x,{children:m})}),f=n(fn,{variant:"fan-legacy",sortByPrice:!0,merchandise:c.value?.merchandiseLines??[],size:"small"});if(h.value)return n(co,{theme:zd,children:n(mo,{id:s.id,label:v,thumbnail:f,onClick:()=>o(Xi),primaryContent:g})});const b=l.value||r.value;return n(co,{theme:b?jd:zd,children:n(mo,{id:s.id,label:v,thumbnail:f,open:b,onToggle:b?void 0:()=>{l.value=!l.value},primaryContent:g,children:n(Qi,{title:"PICK_UP"===e?i.translate("split_delivery.items_for_pickup"):i.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:e})})})}function Yd(){const{rollup:e}=he(),{padding:t}=ai({padding:[e?.blockPadding??"base",e?.inlinePadding??"base"]});return n(B,{padding:t,children:n(dd,{})})}function Wd({hideLastDivider:e,showTopDivider:i,stripBlockEndPadding:r}){const o=ye(),{negotiate:l}=ge(),{checkout:u,embed:c,source:d}=rt(),p=er(),h=t(()=>o.value.delivery&&u.isShippingRequired.value),m=t(()=>h.value&&p.value),v=Ka({checkout:u}),y=t(()=>o.value.contact&&u.configuration.showContactInformation),g=[...t(()=>ri({isContactVaulted:o.value.contact,configuration:u.configuration,identity:u.identity,embed:c})).value?[n(jc,{},"contact")]:[],...h.value?[n(cd,{},"delivery")]:[],...function(e){if(xt(d))return o.value.payment?[n(Ru,{},"payment")]:[];const t=[];return v&&t.push(n(Cc,{isAbovePaymentSummary:!0},"businessCustomerBilling")),o.value.payment&&(t.push(n(Ru,{},"payment")),e.configuration.visibility.showCashRedemption.value&&t.push(n(gc,{},"cashRedemption")),o.value.billing&&!v&&t.push(n(Cc,{},"billingAddress"))),t}(u)],f=g.length>0||y.value;var b;return s(()=>{b&&Vs().catch(()=>{})},[b=f]),function({hasSections:e,identity:n,wallets:t,negotiate:a}){s(()=>{e&&function({identity:e,wallets:n}){return"amazonPay"!==e.current.value&&"buyWithPrime"!==e.current.value&&!n.activeSession.value}({identity:n,wallets:t})&&a({silenceViolations:["all"]})},[])}({hasSections:f,identity:u.identity,wallets:u.wallets,negotiate:l}),0===g.length?null:n(B,{children:[n(Bs,{children:n($d,{hideLastDivider:e,showTopDivider:i,stripBlockEndPadding:r})}),n(a,{when:()=>o.value.payment,children:n(zu,{})}),n(a,{when:m,children:n(nr,{})})]})}function qd({sections:e,hideLastDivider:t,showTopDivider:a,stripBlockEndPadding:i}){const{checkout:{identity:r},shop:o}=rt(),l=function(e,n){return"guest"===e.current.value||"businessCustomer"===e.current.value&&n}(r,ye().value.payment),{vaulted:{spacing:s="none",cornerRadius:u,divider:{borderWidth:c="base",borderStyle:d="base",borderColor:p,visibility:h="visible"}={}}={}}=he(),{main:{section:m}}=ve(),{rendered:v}=En(),y=o.hasFlagEnabled(sa),g=!l&&!rs(t),f=v?.padding,{blockStart:b,blockEnd:_}=function(e){if(null==e)return{blockStart:!1,blockEnd:!1};const n=Array.isArray(e)?e[0]:e;let t=Array.isArray(e)?e[0]:e;return Array.isArray(e)&&4===e.length&&(t=e[2]),{blockStart:Kd(n),blockEnd:Kd(t)}}(y?void 0:f);return 0===e.length?null:n("div",{className:P("K6vpG",rs(a)&&"CU3YS",g&&"_5HWz9",b&&"r8rqQ",(_||i)&&"_2Ojsq"),style:Jd({spacing:s,borderWidth:c,borderStyle:d,borderColor:p??"base",visibility:h,cornerRadius:m?.cornerRadius??u}),children:e})}function $d({hideLastDivider:e,showTopDivider:t,stripBlockEndPadding:a}){const r=function(){const e=ye(),{checkout:t,shop:a,embed:r,i18n:o,source:l}=rt(),{identity:s,identity:{current:c}}=t,d=c.value,p=a.hasFlagEnabled(xa),h=a.hasFlagEnabled(sa),m=An(),v=kn(),y=Ka({checkout:t}),g=m.value&&!v.value,f=sn(),b=er(),_=void 0!==Na().value,C=Zt("deliveryNext"),P=Vt(),{deliveryLines:A}=t.negotiator.parts,k=Ja(A.value??[]).filter(e=>e.requiresShipping).length>0,w=Ki("PICK_UP").value.length>0,O=function(){const{eligibility:e,messages:n,redeemableBalance:t,discountOffer:a,shopPromotionDiscounts:i,isDigitalGoodsRedemptionAllowed:r}=yc(),o=Ku();if((e.eligible||r)&&t)return!0;
2const l=a?.value?.redeemableAmount,s=i.length>0;return!(!e.eligible||!l&&!s)||!!al.some(e=>$u(o.value,e))||n.length>0}(),I=u(()=>({isSplitShipAndPickup:f.value,isBusinessCustomerSingleChoiceMode:g,businessCustomerCannotProvideShippingAddress:m.value,redemptionEligibilityVisible:O,shouldAllowInlineSplit:b.value,hasShippingMerchandiseLines:k,hasLocalPickupDeliveryLine:_,hasPickupMerchandiseToDisplay:w,deliveryNextLoading:P.value&&C.value}),[f.value,g,m.value,O,b.value,k,_,w,P.value,C.value]),R=I.isSplitShipAndPickup?Za:Xa,T=R[d]??R.default,L=Ad(),N=e=>!L.value||"deliveryAddress"!==e&&"localPickupOptions"!==e?e:"deliveryDestination",D=e=>{switch(e){case"contact":return n(jc,{},e);case"businessCustomerSingleChoice":return n(_c,{},e);case"orderEditDeliveryAddress":return n(Ed,{},e);case"orderEditShippingMethod":return n(Od,{},e);case"deliveryAddress":return L.value?n(_d,{destination:e}):n(cd,{},e);case"shippingMerchandiseList":return n(Gd,{selectedDeliveryMethodType:"SHIPPING"},e);case"shippingMethods":return n(Fd,{},e);case"pickupMerchandiseList":return n(Gd,{selectedDeliveryMethodType:"PICK_UP"},e);case"localPickupOptions":return L.value?n(_d,{destination:e}):n(gd,{},e);case"pickupPoint":return n(Nd,{},e);case"dutyOptions":return n(kd,{},e);case"paymentOptions":return n(Ld,{},e);case"payment":return n(Ru,{},e);case"billing":return n(Cc,{isAbovePaymentSummary:y},e);case"cashRedemption":return n(pd,{},e);default:return n(i,{})}};S(()=>{p&&t.sections.unstable_providePreactContext(I)},[p,t.sections,I]);const M={configuration:t.configuration,installments:t.installments,isShippingRequired:t.isShippingRequired,vaultedSections:p?t.vaultedSections:{signal:e},source:l,proposal:t.proposal,identity:s,shop:a,embed:r},B=p?t.sections.availableToRenderGrouped.value:Qa(ei(T.filter(e=>ni[e].shouldRender({preactContext:I,concepts:M})),{preactContext:I,concepts:M}));let x=!1;return B.filter(e=>e.length>0).map(e=>{const a=[];for(const{sectionId:o,groupId:l}of e){const e=D(o);null!=l&&ti.has(l)?(!x&&t.configuration.visibility.showDeliveryHeading.value&&(a.push(n(h?Yd:dd,{},"deliveryHeading")),x=!0),a.push(n(ce,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ni,{name:o,children:e})},N(o)))):a.push(e)}const i=e[0]?.groupId,r=function(e,t,a){if(t.isSplitShipAndPickup)return"shipping"===e?n(E,{level:2,children:a.translate("delivery_options.ship_to_address")}):void 0}(i,I,o);return{groupId:i,header:r,elements:a}})}(),o=sn();if(0===r.length)return null;const l=r.length>1&&o.value;return n(i,{children:l?n(V,{gap:"large-200",children:r.map(({groupId:o,header:l,elements:s},u)=>{const c=0===u,d=u===r.length-1,p=n(lo,{hideDivider:"always",children:n(qd,{sections:s,hideLastDivider:!d||rs(e),showTopDivider:c&&rs(t),stripBlockEndPadding:d&&a})});return l?n(V,{gap:"base",children:[l,p]},o):n(i,{children:p},o)})}):n(qd,{sections:r.flatMap(e=>e.elements),hideLastDivider:e,showTopDivider:t,stripBlockEndPadding:a})})}function Kd(e){return null!=e&&"none"!==e}function Jd({spacing:e,borderWidth:n,borderStyle:t,borderColor:a,visibility:i,cornerRadius:r}){const o=Zd[e],l={none:"0px",...ii.borderWidth},s={base:ii.color.default.border,transparent:"transparent"},u="hidden"===i?"0px":l[n];return{"--vaulted-divider-width":u,"--vaulted-divider-style":Xd[t],"--vaulted-divider-color":s[a],"--vaulted-spacing":o,"--divider-offset":`calc((${o} + calc(${u} * 2)) / 2)`,"--vaulted-corner-radius":r?ii.borderRadius[r]:void 0}}const Zd={none:"0px",...ii.spacing},Xd={base:"solid",dashed:"dashed",dotted:"dotted"};function Qd(){const{methods:e}=wn(),{userEvents:n,shop:t,source:a,checkout:i}=rt(),r="shopPay"===i.identity.current.value;h(()=>
2{if(r)for(const r of e.value)m(()=>n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(a,i,t),action:`delivery_method_${r.toLowerCase()}_selected`}}))})}function ep(){Qd();const{shop:e,i18n:t,checkout:a}=rt(),i=pn(),r=Ad(),o=!e.hasFlagEnabled(oi),l=!a.configuration.visibility.showDeliveryHeading.value&&!o;if(!i)return null;if(r.value)return n(tr,{});const s=t.translate("shipping.delivery_title");return n($l.Provider,{value:!0,children:n(Ho,{presentation:"base",children:n(B,{padding:o?"none":"base none",accessibilityLabel:s,className:o?"_5hYUU":void 0,children:n(V,{gap:"base",children:[l&&n(x,{color:"subdued",children:s}),n(ar,{})]})})})})}function np(){const{source:e}=rt(),t=ye(),a=On(),r=pn(),o=Ad();return xt(e)||!t.value.delivery?null:n(i,{children:[n(ep,{}),a.value&&r&&!o.value?n(pe,{blockSize:"base"}):null]})}function tp({placement:e}){const{checkout:a,embed:i,shop:r,shopPay:o}=rt(),{current:l}=a.identity,s=ye(),u=li(),c=fs();return t(()=>si({configuration:a.configuration,identity:a.identity,shop:r,shopPay:o,embed:i,vaultedSections:s.value,isShippingRequired:a.isShippingRequired.value,hasSellingPlan:u.value,phoneCountryCode:c.value})).value!==e?null:n(ap,{vaultedContactTypeOverride:"sdkCartHints"===l.value?"base":void 0})}function ap({vaultedContactTypeOverride:e}){const t=Vc();Fc(t);const r=y(!1),o=Vt(),{embed:l}=rt(),s=t.displayOptions,u="base"===s.vaultedContactType,c="rollup"===s.vaultedContactType?e??"rollup":s.vaultedContactType,d=u?s.contentLayout:void 0,p="rollup"===s.vaultedContactType&&"base"===c;if("base"!==c)return null;const h=t.logo;let m=null;return(p&&t.hasError||u)&&(m=s.children??null),n(i,{children:[n(zc,{emailAddress:t.displayContent.contact,phone:t.displayPhone,logo:h,moreOptions:t.moreOptions,emailAlignment:p&&t.isEmbeddedPartner&&!l?.interstitialPartnerProfileIconUrl?"start":void 0,layout:p?void 0:d,children:m}),t.showShopPayVerification&&n(a,{when:o,children:n(Oi,{email:t.email??"",open:r.value,showPopover:e=>{r.value=e}})})]})}function ip({showDelivery:e,insideVaultedCard:t}){const{embed:r,shop:o}=rt(),l=Ad(),{rollup:{inlinePadding:s}}=he(),u=n(i,{children:[n(tp,{placement:"vaulted-adjacent"}),n(a,{when:e,children:n(np,{})}),n(a,{when:()=>!l.value,children:n(md,{})})]}),c=zt(r?.embedder);if(o.hasFlagEnabled(sa)){if(!c&&!t?.value)return u;const{padding:e}=ai({padding:["none",s??"base"]});return n(B,{padding:e,children:u})}const d=c?`none ${Ut(s)??"none"}`:void 0;return c?n(B,{padding:d,children:u}):u}const rp=(e,n)=>{if(e.length!==n.length)return!1;const t=[...e];return n.every(e=>{const n=t.findIndex(n=>n.promotionId===e.promotionId&&Gu(n.destinationAmount,e.availableBalance));return-1!==n&&(t.splice(n,1),!0)})};function op(e,n,t,a){const i=e?.status;return"pending"===i||(t||a)&&("filled"===i||n)}const lp=({discountOffer:e,eligibility:n,shopPromotionDiscounts:a,enabled:i=!0})=>{const r=Yu({enabled:i}),o=Xu({enabled:i}),{recordRedemptionAutomaticallyApplied:l,recordRedemptionAutomaticallyRemoved:c}=cc(),d=g(),p=Ku();!function(e,n=!0,a){const{setShopOfferReconciliationPending:i}=rt().shopPay,r=function(e,n){const a=v(e),i=v(n),r=Ku(),{checkout:{negotiator:o}}=rt(),{shopDiscountOffer:l,shopPromotion:s}=o.current.fields,u=o.loading;return t(()=>{const e=r.value,n=a.value.eligible,t=u.value,o=t.has("discountLines"),c=t.has("shopCashBalance"),d=i.value;if(void 0!==d){const a=e.SHOP_PROMOTION,i=a.length>0;if(op(s.value,i,o,t.has("shopPromotion")))return!0;if(d?.length){if(n?!rp(a,d):i||c)return!0}else if(i)return!0}const p=l.value,h=e.SHOP_DISCOUNT_OFFER?.destinationAmount;if(op(p,null!=h,o,t.has("shopDiscountOffer")))return!0;const m=Tu(p)?.redeemableAmount;return null==h?null!=m&&(n||c):!n||null==m||!Gu(h,m)})}(e,a);S(()=>{if(!n)return;const e=r.subscribe(i);return()=>{e(),i(!1)}},[n,r,i])}(n,i,a);const h=u(()=>{const t=p.value.SHOP_DISCOUNT_OFFER?.destinationAmount;return e?Gu(t,e.redeemableAmount)||!n.eligible&&e.redeemableAmount?void 0:{SHOP_DISCOUNT_OFFER:e.redeemableAmount?{type:"SHOP_DISCOUNT_OFFER",amount:e.redeemableAmount,promotionId:null}:null}:t?{SHOP_DISCOUNT_OFFER:null}:void 0},[e,p.value.SHOP_DISCOUNT_OFFER?.destinationAmount,n.eligible]),m=u(()=>{if(void 0===a)return;const e=p.value.SHOP_PROMOTION;return a&&0!==a.length?!rp(e,a)&&n.eligible?{SHOP_PROMOTION:a.map(e=>({type:"SHOP_PROMOTION",amount:e.availableBalance,promotionId:e.promotionId}))}:void 0:e.length>0?{SHOP_PROMOTION:null}:void 0},[a,p.value.SHOP_PROMOTION,n.eligible]),y=u(()=>{if(h||m)return{...h,...m}},[h,m]);s(()=>{i&&y?r&&d.current!==y&&o(y,{onNegotiateAccepted:()=>
2{d.current=y,Object.entries(y).forEach(([e,n])=>{(n?l:c)(e,"useApplyAutomaticRedemptions")})}}):d.current=void 0},[i,r,y])};function sp({active:e,ready:t}){const{i18n:a}=rt(),i=e.value&&!t.value?a.translate("general.loading"):null;return n(B,{accessibilityRole:"status",accessibilityVisibility:"exclusive",children:i})}const up=o({displayName:"BelowTheFoldContent",renderLoading:function(){return n(B,{"aria-busy":!0,padding:"large-200 none",children:n(V,{gap:"base",children:[n(D,{inlineSize:"large"}),n(D,{inlineSize:"base"}),n(we,{contentDisplay:"block",blockSize:"48px"})]})})},load:()=>p(()=>e(()=>import("./7aefefff.CQiXfvjt.js"),__vite__mapDeps([127,1,2,3,4,5,6,7,8,9,10,11,12,128,129,130,41,42,43,44,45,46,47,18,48,49,50,22,23,19,51,36,27,37,38,39,40,13,14,15,16,17,20,21,24,25,26,28,29,30,31,32,33,34,52,53,54,55,56,57,58,131,132,133,81,134,95,96,97,74,75,98,99,100,67,68,101,102,135,77,136,137,138,139,140,141,142,143,73,76,144,145,146,59,147,148,82,83,105,149,104,69,70,64,65,66,71,72,78,79,80,84,85,86,61,87,88,89,103,106,107,108,109,92,93,94,110,111,112,113,114,91,115,116,117,118,62,119,120,121,150]))),renderError(e){throw e}});function cp({children:e,fillAvailableBlockSize:t,ready:a}){const{checkout:i}=rt(),{progress:r}=ge(),o=_s(),l=f(()=>{r("one-page-form-submit",void 0,{skipToCompletion:o.value})},[r,o]),s=fr(l);return n(In,{disabled:!a.value,onSubmit:s,contentsClassName:t?"ifz7X":void 0,children:e},i.identity.current.value)}function dp({loading:e,lineItems:t,onClose:a}){const{i18n:i,url:r,checkout:{configuration:{allowRedirectToStorefront:o},negotiator:l}}=rt(),{checkoutProtocolModalEventSignal:u}=l.context,c=n(H,{variant:"primary",onClick:a,children:i.translate("stock.continue_cta_label")}),d=o&&n(R,{href:r.cart(),children:i.translate("stock.return_to_store_label")});return s(()=>()=>{u.value="none"},[u]),n(Tn,{heading:i.translate("stock.price_update.title"),open:!0,onShow:()=>{u.value="priceChange"},onHide:a,size:"large",children:n(V,{gap:"large-200",children:[n(X,{children:i.translate("stock.price_update.description")}),n(B,{children:n(Ps,{loading:e,lineItems:t,type:Rn.PriceChange})}),n(V,{direction:"inline",gap:"large-300",alignItems:"center",justifyContent:"end",children:[d,c]})]})})}function pp(e){return e.some(e=>"MERCHANDISE_EXPECTED_PRICE_MISMATCH"===e.code)}function hp(){const{checkout:{wallets:e,negotiator:i}}=rt(),r=function(){const{checkout:{negotiator:e}}=rt(),n=Zt("merchandiseLines"),a=e.parts.merchandiseLines,i=y(m(()=>a.value));return t(()=>{const t=e.current.fields.allViolations.value,a=pp(t??[]),r=e.current.fields.merchandiseLines.value,o=n.value,l=r?.lines??[],s=i.value,u=Ln(s,l,t,Nn).map(({proposed:e,negotiated:n})=>({line:e??n,problem:{type:Rn.PriceChange,negotiatedPrice:n?.itemPrice,proposedPrice:e?.itemPrice}}));return{hasViolation:a,loading:o,lineItems:u,updateProposal:()=>{u.length>0&&(i.value=l)}}})}(),o=Dn(),l=g(!1),s=t(()=>i.current.fields.allViolations.value?.some(e=>ui.has(e.code))),u=t(()=>!s.value&&r.value.hasViolation&&r.value.lineItems.length>0),c=t(()=>{const n=r.value;return u.value?l.current=!0:l.current&&!n.loading&&0===n.lineItems.length&&(l.current=!1),!e.activeSession.value&&l.current&&n.lineItems.length>0?n:void 0});h(()=>{u.value&&o("inventoryPriceChange",{element:{tagName:"modal"},timestamp:new Date,visible:!0})});const d=f(()=>{l.current=!1,r.value.updateProposal()},[r]);return n(a,{when:c,children:e=>n(dp,{loading:e.loading,lineItems:e.lineItems,onClose:d})})}function mp(){const{i18n:e,shop:t}=rt(),a=Mn(t.storefrontUrl)?.replace(/-/g,"‑");return a?n("strong",{"data-testid":"referral-title",className:"LaXGo",children:e.translate("merchant_redirect.referral_title",{merchant_url:a})}):null}function vp(){const{checkout:e,embed:a,shopPay:r}=rt(),o=Cs(),l=_s(),s=ye(),u="webview-rendered"===r.config.isReferral,c=a?.isFlagshipPartner??!1,d=t(()=>s.value.contact&&e.configuration.showContactInformation||s.value.delivery||s.value.payment).value,p=o.value,h=p||l.value||u;return d&&h?n(i,{children:[p?n(es,{}):null,l.value?n(ns,{isVaultedReview:!0}):null,u?n(mp,{}):null,h&&!c?n(pe,{blockSize:"base"}):null]}):null}function yp(){const{embed:e}=rt();return t=>!e?.isFlagshipPartner||zt(e.embedder)||Gt({embedder:e.embedder})?t:n(yn,{children:t})}function gp({showEmailMarketingOptIn:e,showPhoneMarketingOptIn:i,aboveFoldSpacing:r,paddingBlockStart:o,children:l}){const s=ir(),u=t(()=>i?.value??s.value.isRoot),c=t(()=>e.value||u.value),d=t(()=>e.value&&u.value),p=t(()=>d.value?r?"small-200":"base":"none"),h=t(()=>r?"large-200 none large-200 none":`${o?.value??"none"} none base none`);return n(a,{when:c,fallback:l,children:()=>n(ce,{target:"cart.buyerIdentity",children:n(V,{gap:r?"small-200":"base",padding:h.value,children:[n(V,{gap:p.value,children:[n(a,{when:e,children:n(rr,{origin:"payment_page"})}),n(a,{when:u,children:n(or,{})})]}),l]})})})}function fp({extensions:e,hideDivider:t="always"}){const a=yp();return n(dn,{gap:"base",customizations:rs(e),render:(e,i)=>i?a(n(lo,{hideDivider:t,children:e})):e})}function bp(e){const{i18n:n}=rt(),t=f(e=>e.reduce((t,a,i)=>i===e.length-1?n.translate("shipping.shipping_method_combinations.combination",{rest:t,current:a}):n.translate("shipping.shipping_method_combinations.with_separator",{rest:t,current:a}),""),[n]);return u(()=>{if(!ci(e))return[];const a=Ga(e);return function(e,n){const t=(n||[]).filter(di).map(as);return is(t).filter(e=>e.length>0).map(n=>function(e,n){return{...pi(e)??e[0],title:vi(e,n),cost:mi(e),costAfterDiscounts:hi(e)}}(n,e))}({businessDays:e=>n.translate("shipping.estimated_delivery_date",{count:e}),businessDaysRange:(e,t)=>
2n.translate("shipping.estimated_delivery_date_range",{minimum:e,maximum:t}),subscriptionsOnlyShippingTitle:n.translate("shipping.subscription_shipping"),combineTwoShippingTitles:(e,t)=>n.translate("shipping.shipping_method_combinations.combination",{rest:e,current:t}),combineMultipleShippingTitles:t,localDeliveryTitle:n.translate("shipping.local_delivery")},a)},[t,e,n])}function _p(){const{shopPay:e,checkout:{negotiator:n}}=rt(),{value:t}=n.current.fields.deliveryNext,a=Zt("deliveryNext").value,i=yi(t,"ONE_TIME_PURCHASE",!0),r=u(()=>i&&"available"===i.status?i.methods:[],[i]),o=bp(t),l=ci(t)?o:r,c=u(()=>l.reduce((e,n)=>{const t="LOCAL"===n.methodType?"SHIPPING":n.methodType;return"PICK_UP"===t||"SHIPPING"===t?{...e,[t]:[...e[t],n]}:e},{SHIPPING:[],PICK_UP:[]}),[l]),[d,p]=b(!0),h=e.session.selectedShippingAddress.value;s(()=>{p(!0)},[h]),s(()=>{a||p(!1)},[a]);const[,m]=b(),v=ls(m);return{methodsByType:c,availableDeliveryMethods:l,availableDeliveryMethodsLoading:d,progressiveShippingRatesLoading:v}}function Cp({onChange:e,prerequisitesLoading:n}){const{checkout:{negotiator:t}}=rt(),{value:a}=t.current.fields.deliveryNext,i=Zt("deliveryNext").value,r=yi(a,"ONE_TIME_PURCHASE",!0),o=bp(a),[l]=Bn({type:r?.type}),c=u(()=>{if(!n&&!i&&l&&null!=r&&"available"===r.status)return ci(a)?o.find(e=>e.handle===l):r.methods.find(e=>e.handle===l)},[n,i,l,r,a,o]),d=g(c);return s(()=>{c&&d.current&&d.current.handle!==c.handle&&e(c,d.current),d.current=c},[c,e]),{selectedDeliveryMethod:c}}function Pp(){const{i18n:e}=rt(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=_p(),a=n&&!t,{selectedDeliveryMethod:i}=Cp({onChange:()=>{},prerequisitesLoading:n||a}),r=i?e.translate("order_summary.updated_shipping_method",{shipping_method:i.title}):void 0,o=g(r);return s(()=>{const e=o.current;if(o.current=r,r&&r!==e)return q({content:r})},[r]),null}function Sp(){return xn("ONE_TIME_PURCHASE")?n(Pp,{}):null}function Ap({includeContact:e=!0}={}){const n=ye(),a=v(U("Checkout::Dynamic::Render","INFORMATION1")),i=v(U("Checkout::Dynamic::Render","INFORMATION2")),r=v(U("Checkout::Dynamic::Render","DELIVERY1")),o=v(U("Checkout::Dynamic::Render","DELIVERY2")),l=v(U("Checkout::Dynamic::Render","PAYMENT1")),s=v(U("Checkout::Dynamic::Render","PAYMENT2")),u=v(U("Checkout::Dynamic::Render","PAYMENT3")),c=g();return t(()=>{const t=n.value,d=[];t.contact&&("boolean"==typeof e?e:e.value)&&d.push(...a.value,...i.value),t.delivery&&d.push(...r.value,...o.value),t.payment&&d.push(...l.value,...s.value,...u.value);const p=c.current;return p&&(m=d,(h=p).length===m.length&&h.every((e,n)=>{const t=m[n];return void 0!==t&&Mt(e)===Mt(t)}))?p:(c.current=d,d);var h,m})}const kp=[br.Button,_r.Button,Cr.StickyFooter,Pr.Wrapper];function Ep(){const{shopPay:e,checkout:t}=rt(),[a]=Vn("ONE_TIME_PURCHASE");if("unauthenticated_user"!==e.user.flow.value)return null;const i=a[0],r="PICKUP_POINT"===i||"PICK_UP"===i;return!t.isShippingRequired.value||r?n($c,{}):null}const wp="contact";function Op({loginLink:e,title:a}){const{router:i}=rt(),r=t(()=>Js(i,wp));return n("div",{className:"nnGzs",children:[n(E,{id:wp,level:1,autoFocus:r.value,children:a}),e]})}function Ip(){const{client:e,i18n:t,source:i}
2=rt(),r=Fn(),o="simulated"===i.type;return n(a,{when:r,children:n(R,{href:o?void 0:e.unstable_getSerialization("loginUrl")||"",children:t.translate("customer_account.sign_in_link_label")})})}Ip.displayName="LoginLink";const Rp=()=>{const{i18n:e,userEvents:t,source:a,checkout:i,shop:r,shopPay:o}=rt();return n(R,{onClick:()=>{t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(a,i,r),action:"click_shop_pay_sign_in"}}),o.session.unstable_updateVerificationTrigger({source:el.LoginLink})},children:e.translate("account_management.sign_in_shop")})};function Tp({identityPresentation:e="form",showEmailMarketingOptIn:t}){const a="vaulted"===e,{i18n:r,checkout:{identity:o,validation:{contactErrors:{emailInputError:l}}},shopPay:u}=rt(),c="shopPay"===o.current.value,d=r.translate("field_errors.email_invalid"),p=u.userVerification.value;s(()=>{c&&"invalid"===p.status&&(l.value=d)},[c,l,d,p.status]);const h=f(e=>{if(c)return p.email===e&&"invalid"===p.status?d:void 0},[c,d,p.email,p.status]);return n(i,{children:[n(i,a?{children:[n(Op,{title:r.translate("contact.contact_method_title")}),n(pe,{blockSize:"base"}),n(tp,{placement:"standalone-vaulted"})]}:{children:[c&&n(i,{children:[n(Fl,{color:"branded"}),n(pe,{blockSize:"base"})]}),n(Op,{title:r.translate("contact.contact_method_title"),loginLink:n(Lp,{})})]}),n(pe,{blockSize:"base"}),n(wi,{hideAllOptIns:c&&!a,hideCustomerCard:a,showEmailMarketingOptIn:t,onValidateEmailInput:h}),c&&!a&&n(Ep,{})]})}function Lp(){const{checkout:{identity:e}}=rt(),t=Ao();return"shopPay"!==e.current.value?n(Ip,{}):t===_i.UnauthenticatedCheckout?n(Rp,{}):null}const Np=k(function({showForm:e=!0,identityPresentation:t="form",showEmailMarketingOptIn:a}){const r=U("Checkout::Contact::RenderAfter"),o=U("Checkout::Dynamic::Render","INFORMATION1"),l=U("Checkout::Dynamic::Render","INFORMATION2");return n(i,{children:[o.length?n(i,{children:n(dn,{customizations:o,gap:"base",marginBlockEnd:"large300"})}):null,e?n(Yl,{impressionType:"contact",impressionFeatures:[],children:[n(Tp,{identityPresentation:t,showEmailMarketingOptIn:a}),r.length?n(i,{children:n(dn,{customizations:r,marginBlockStart:"base"})}):null,l.length?n(i,{children:n(dn,{customizations:l,gap:"large-200",marginBlockStart:"large300"})}):null]}):n(i,{children:[r.length?n(i,{children:n(dn,{customizations:r,marginBlockStart:"base"})}):null,l.length?n(i,{children:n(dn,{customizations:l,gap:"large-200",marginBlockStart:"large300"})}):null]})]})});function Dp(){const{checkout:{identity:e},i18n:t}=rt(),{hasViolations:a}=G(da),{hasViolations:i}=G(Ca),r=Qo(j(Ci)).value;if(a&&Mp({identity:e}))return n(lr,{});if(r)return n(ce,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ei,{message:t.translate("field_errors.shipping_method_invalid_phone_number")})});const o=i?t.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions"):t.translate("shipping_errors.shipping_method_not_available_generic.one");return n(ce,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ce,{tone:"critical",heading:t.translate("shipping_errors.title"),errorType:F.DeliveryError,children:o})})}const Mp=({identity:e})=>"shopPay"===e.current.value,Bp=[{handle:"first"},{handle:"second"}];function xp(){const{i18n:e}=rt(),{shippableDeliveryLines:t}=Hn().value,a=t?.[0]?.methods||Bp;return n(Il,{name:"shippingMethods",variant:"block",hideRadioControl:1===a.length,children:a.map(({handle:t,description:a,estimatedTimeInTransit:i,deliveryPredictionEligible:r})=>{const o=Boolean(r),l=a;return n(Fo,{value:t,disabled:!0,accessibilityLabel:e.translate("general.loading"),secondaryContent:n(we,{inlineSize:"5ch"}
2),children:n(V,{gap:"small-500",children:[n(D,{inlineSize:"small"}),o||null!=i?n(D,{inlineSize:"base",size:"small",id:"pending-shipping-estimated-time"}):null,l?n(zn,{content:a,size:"small"}):null]})},t)})})}function Vp(){const e=rt();return n(Tl,{children:n(Rl,{children:Fp(e)})})}function Fp({checkout:e,i18n:n}){return"shopPay"===e.identity.current.value?n.translate("shipping_errors.invalid_shipping_method_summary"):n.translate("shipping_errors.empty_state")}const Hp=k(function(){const{uiStateSignal:e,initialUiStateSignal:t}=Ea(Xe),a=Vt(),i=a.value?e.value:t.value,r=Qc(),o=Qo(Pn(Wa)),l=r.value&&o.value,{hasViolations:s}=G(jp),u=a.value&&s&&!l&&"error"!==i.status,c=u?n(Up,{}):null,d=(()=>{switch(i.status){case"initial":case"empty":return n(Vp,{});case"loading":return n(xp,{});case"error":return n(Dp,{});case"filled":{const e=Pi(i.deliveryLines).filter(Cn),t=e.flatMap(({methods:e})=>e.map(({title:e})=>e));return n(Yl,{impressionType:"shipping_methods",impressionFeatures:t,children:n(zp,{lines:e,showErrorBanner:l,deliveryChangedBannerOwnedBySection:u})})}}})();return n(V,{gap:"base",children:[c,d]})});function zp({lines:e,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a}){const r=Dn(),o=jn(),[,l]=b(),u=ls(l),c=function({checkout:e}){return"shopPay"===e.identity.current.value?Gp:i}(rt());return s(()=>{r("shippingMethodsFilled",{timestamp:new Date}),o({type:"shipping_methods_filled"})},[o,r]),n(i,{children:[n(c,{}),n(V,{gap:"large-200",children:n(ss,{lines:e,loading:u,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a})})]})}Hp.displayName="OnePageShippingMethods";const jp=new Set(["DELIVERY_DELIVERY_LINE_DETAIL_CHANGED"]);function Up(){const{i18n:e}=rt();return n(Ce,{tone:"warning",errorType:F.DeliveryError,children:e.translate("shipping_errors.shipping_method")})}function Gp(){const{trackSelectShippingMethod:e}=Dd(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=_p();
2return Cp({onChange:e,prerequisitesLoading:n||n&&!t}),null}function Yp(){const{checkout:e,i18n:t}=rt(),a=e.addressManager.shipping.value,i=Ol("shipping"),{shouldGateCrossBorder:r,crossBorderGate:o}=Wl(),l=a.addresses.value.find(({id:e})=>e!==a.selectedAddress.value?.id),s=f(()=>{if(!l)return;const e=()=>i.selectAddress(l.id,{source:"select-saved-address-link"}),n=l.address.countryCode;n&&r(n)?o(e):e()},[i,l,r,o]);return l?n(Q,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",justifyContent:"start",justifyItems:"start",children:n(R,{id:"save_shipping_information",textDecoration:"none",onClick:s,children:t.translate("customer_account.saved_address_option_link")})}):null}function Wp(){Qd();const e=pn(),t=e?.options.value.some(e=>"PICKUP_POINT"===e.id)??!1,i=er();return n(V,{gap:"large-300",children:[t&&n($i.Prefetch,{}),n(ar,{}),n(Ni,{name:"delivery-methods",children:n(qp,{})}),n(a,{when:i,children:n(nr,{})})]})}function qp(){const{methods:e}=wn(),{i18n:i,router:r,checkout:{wallets:o,identity:l,negotiator:s}}=rt(),c=Un(),{deliveryNext:d,optionalDuties:p}=s.current.fields,h=hs(),m=Ze(),{shippingAddress:v}=s.parts;Gn(v,()=>{m&&m.taxId.reset()});const y=U("Checkout::DeliveryAddress::RenderBefore"),g=U("purchase.checkout.delivery-address.render-after"),b=ds(),{hasMultipleDeliveryGroups:_,onlyDeliveryGroupType:C}=b.value,{customizationsBefore:P,customizationsAfter:S}=ps({hasMultipleDeliveryGroups:_,targeted:!1}).value,A=t(()=>Ua(d.value,!0)||h.value.showShipmentBreakdown).value,k=A?"small-400":"base",w=Dn(),O=jn(),{negotiate:I}=ge(),R=f(({shipping:e})=>{o.activeSession.value||I({fieldsToResolve:["deliveryNext"],silenceViolations:["non-delivery-address",...Si],runListenersOnError:!0}),e.value=!0,w("sectionComplete",{section:"deliveryAddress",timestamp:new Date}),O({type:"section_complete",section:"deliveryAddress"})},[o,I,w,O]),T=f(({shipping:e})=>{e.value=!1},[]),L=e=>n(qn,{padding:A?"small-400 none":void 0,children:e}),N=u(()=>({groupType:C&&Yn(C),includeDeliverySelectionGroups:!1}),[C]),D=ir(),M=t(()=>D.value.isDelivery),x=sn(),F=er(),H=t(()=>!!x.value&&(e.value.includes("PICK_UP")&&e.value.includes("SHIPPING"))),z="shippingMethod",j=t(()=>Js(r,z)),G=zi(),Y=n(Wn,{sectionId:"localPickup",children:n(V,{gap:"small",children:[n(a,{when:H,children:n(E,{level:2,children:i.translate("delivery_options.pickup")})}),n(G?sr:ur,{})]})}),W=n(Wn,{sectionId:"shipping",children:[n(qn,{children:n(V,{gap:"base",children:[n(a,{when:H,children:n(E,{level:2,children:i.translate("delivery_options.ship_to_address")})}),n(a,{when:c,children:n(X,{color:"subdued",children:i.translate("shipping.shipping_used_as_billing_notice")})}),n(a,{when:H,children:n(a,{when:F,children:n(B,{border:"base",padding:"base",borderRadius:"large",children:n(cr,{selectedDeliveryMethodType:"SHIPPING"})})})}),n(dn,{customizations:y}),n(V,{gap:"large-300",children:[n(As,{children:n(_o,{onValid:R,onInvalid:T,children:n(Jc,{children:[$p({identity:l})&&n(Yp,{}),n(dr,{}),n(a,{when:M,children:n(or,{})}),m&&n(pr,{taxId:m.taxId,applied:m.applied})]})})}),n(dn,{customizations:g}),n(V,{gap:k,children:[n(E,{id:z,level:2,autoFocus:j.value,children:i.translate("shipping.shipping_method_title")}),n($n,{children:[n(a,{when:()=>h.value.showShipmentBreakdown,children:n(Ss,{children:[n(Es,{}),n(pe,{blockSize:"small-200"})]})}),Nl("shipping.shipping_method_notice",i)?n(X,{children:i.translate("shipping.shipping_method_notice")}):null,n(dn,{customizations:P,options:N,render:L}),n(Ss,{children:[n(Hp,{}),n(ks.Preload,{})]}),n(dn,{customizations:S,options:N,render:L})]})]})]})]})}),n(a,{when:()=>p.value?.refuseDutiesPermitted,children:n(qn,{accessibilityLabel:i.translate("shipping.duties_and_taxes_title"),children:n(V,{gap:"base",children:[n(E,{level:2,children:i.translate("shipping.duties_and_taxes_title")}),n(os,{})]})})})]}),q=t(()=>e.value.includes("PICKUP_POINT")),$=t(()=>e.value.includes("PICK_UP"));return n(a,{when:H,fallback:n(a,{when:()=>q.value||$.value,fallback:W,children:n(a,{when:q,fallback:Y,children:n(Wn,{sectionId:"pickupPoints",children:n($i,{})})})}),children:n(V,{gap:"large-300",children:[Y,W]})})}function $p({identity:e}){return"customerAccount"===e.current.value}const Kp=k(function(){const{shop:e,i18n:i}=rt(),r=U("Checkout::Dynamic::Render","DELIVERY1"),o=pn(),l=ye(),s=e.hasFlagEnabled(oi),u=v(Boolean(!s&&o)),c=t(()=>l.value.contact&&u.value),d=t(()=>c.value?void 0:"deliveryAddress"),p=t(()=>c.value?i.translate("shipping.delivery_title"):void 0);return n(lo,{accessibilityLabelledBy:d.value,accessibilityLabel:p.value,accessibilityRole:"group",children:n(V,{gap:"base",children:[n(a,{when:()=>!c.value,children:n(V,{gap:"small-400",children:n(dd,{})})}),n(Ri,{}),n(Wp,{}),n(dn,{customizations:r})]})})}),Jp=o({displayName:"MobileOrderSummaryBeforeDetails",load:()=>p(()=>e(async()=>{const{MobileOrderSummary:e}=await(import("./d2e6a587.DsEYL8br.js"));return{MobileOrderSummary:e}},__vite__mapDeps([148,1,3,4,5,6,2,7,8,9,10,11,12,82,83,141,142,105,100,149])).then(({MobileOrderSummary:e})=>({default:e}))),renderError(e){throw e}}),Zp="undefined"==typeof window?void 0:performance.now();"undefined"!=typeof window&&up.preload();const Xp=kp,Qp=k(function(){return(()=>{const{embed:e,checkout:{identity:n},shop:t}=rt(),a="shopPay"===n.current.value&&zt(e?.embedder),i=t.hasFlagEnabled(Yt),r=Lu(),o=Du().value;lp({enabled:a,discountOffer:a?r.value:null,shopPromotionDiscounts:void 0,eligibility:o}),pc([{eligibility:o,redemptionTypes:["SHOP_DISCOUNT_OFFER"]}],{enabled:a,retryOnReady:i}),dc({enabled:a,redemptionTypes:["SHOP_DISCOUNT_OFFER"]})})(),(()=>{const{checkout:e,embed:n,shop:t,source:a}=rt(),i=ye(),r="shopPay"===e.identity.current.value&&!zt(n?.embedder)&&e.configuration.visibility.showCashRedemption.value&&!(i.value.payment&&xt(a)),o=t.hasFlagEnabled(Yt),l=Lu(),s=uc(),u=Du().value;lp({enabled:r,discountOffer:r?l.value:null,shopPromotionDiscounts:r?s.value:null,eligibility:u}),pc([{eligibility:u,redemptionTypes:["SHOP_DISCOUNT_OFFER","SHOP_PROMOTION"]}],{enabled:r&&o,retryOnReady:!0})})(),null});function eh({isGuestPartialVaultedDelivery:e,isSectionStyleUnificationEnabled:a,children:i}){const r=t(()=>!e.value);
2return a?n(po,{target:e.value?"edgeToEdge":"vaulted",children:i}):n(ho,{target:"vaulted",condition:r,children:i})}const nh=k(function({children:e}){const{checkout:i,embed:r,environment:o,i18n:l,observability:u,shop:c,shopPay:d,source:p}=rt(),h="VISIBLE"===i.configuration.headerText?.visibility,m=y(!1),g=f(()=>{m.value||(m.value=!0,void 0!==Zp&&u.histogram({name:"one_page_below_fold_content_ready",value:Math.round(performance.now()-Zp),unit:"ms",attributes:{buildId:o.commitSha}}))},[o.commitSha,m,u]),b=Vt(),_=c.hasFlagEnabled(sa),C=Gt({embedder:r?.embedder}),P="google"===r?.embedder&&C,S=ye(),A=Sr(),k=t(()=>S.value.payment&&A.value),E=v(pn()),w=Kn(),O=t(()=>S.value.payment&&c.acceptTipPayments&&(w?.tippingPaymentAllowed??!0)&&i.configuration.visibility.showTips),I=v(rn()[0]),{postPurchaseEnabled:R}=bs(),T=t(()=>i.negotiator.current.fields.buyerIdentity.value?.customerProfile),L=Jn(),N=t(()=>P&&L.value),D=sn(),M=t(()=>S.value.contact&&i.configuration.showContactInformation||S.value.delivery&&i.isShippingRequired.value||S.value.payment),x=t(()=>S.value.delivery&&i.isShippingRequired.value||S.value.payment),F=t(()=>D.value&&M.value),H=li(),z=fs(),j=t(()=>si({configuration:i.configuration,identity:i.identity,shop:c,shopPay:d,embed:r,vaultedSections:S.value,isShippingRequired:i.isShippingRequired.value,hasSellingPlan:H.value,phoneCountryCode:z.value})),G=t(()=>"standalone-form"===j.value),Y=t(()=>"standalone-vaulted"===j.value),W=t(()=>"vaulted-adjacent"===j.value),q=t(()=>G.value||Y.value);!function(){const{negotiate:e}=ge(),{observability:n,checkout:t}=rt(),a=t.negotiator.current.fields.buyerIdentity,i=t.negotiator.parts.shippingAddress.value,r=t.negotiator.parts.billingAddress.value,{value:o=[]}=t.negotiator.current.fields.allViolations,l=gi(o),u=pp(o),c=t.isShippingRequired.value?i.countryCode:r.countryCode,d=a?.value?.countryCode,p=JSON.stringify(a?.value,(e,n)=>void 0===n?null:n);s(()=>{l||u||d&&c!==d&&(n.log("country_code_alignment_mismatch_detected","[EnsureBackAndFrontEndCountryCodeAlignment] There was a mismatch between the preselected and the buyerIdentity countryCode on checkout load.",{selectedCountryCode:c,buyerIdentityCountryCode:d,buyerIdentity:p}),e({silenceViolations:["all"]}))},[])}();const $=v(Zn({base:!0,medium:!1})),K=t(()=>!b.value||($.value??!1)),J=hr(),Z=t(()=>"hidden"!==J.value),X=v(U("Checkout::Contact::RenderAfter")),Q=function(){const{checkout:e,shop:n,source:a}=rt(),{email:i}=e.negotiator.parts,r=ye(),{buyerIdentity:o}=e.negotiator.current.fields,l=n.hasFlagEnabled(fi);return t(()=>{if("businessCustomer"===e.identity.current.value)return!1;const t=o.value;if(t?.customerProfile?.acceptsEmailMarketing)return!1;const s=e.configuration.visibility.showEmailMarketing&&"OFF"!==n.emailMarketing&&r.value.contact;if("sdkCartHints"===e.identity.current.value)return Boolean(s&&i.value);const u=l&&!bi(t?.countryCode);return Boolean(s&&"shopPayExternal"!==a.type&&!u&&!xt(a))})}(),{main:{section:ee}}=ve(),{lineItems:{priority:ne="base"}}=he(),te=v(Ai(ee)),ae=On(),ie=t(()=>"shopPay"===i.identity.current.value||S.value.payment||!te.value?"belowPayment":"abovePayment"),re=t(()=>!q.value&&Q.value&&"belowPayment"===ie.value),oe=t(()=>!q.value&&Q.value&&"abovePayment"===ie.value),le=t(()=>ae.value&&S.value.payment&&re.value&&K.value),se=t(()=>i.configuration.visibility.showEmailMarketing&&!xt(p)&&oe.value&&!T.value?.acceptsEmailMarketing),ue=ir(),de=t(()=>ue.value.isRoot?"belowPayment"!==ie.value||K.value&&te.value?"abovePayment":"belowPayment":"none"),pe=t(()=>"guest"===i.identity.current.value&&S.value.delivery||"businessCustomer"===i.identity.current.value&&!S.value.delivery&&S.value.payment),me=t(()=>"guest"===i.identity.current.value?pe.value&&!(S.value.contact&&S.value.payment):pe.value),fe=t(()=>!me.value&&i.isShippingRequired.value),be=t(()=>W.value||Y.value),_e=Ad(),Ce=t(()=>Boolean(!xt(p)&&S.value.delivery&&null!=E.value&&!_e.value)),Pe=t(()=>S.value.delivery&&I.value.includes("PICK_UP")&&!_e.value),Se=t(()=>Boolean(be.value||Pe.value||(fe.value||me.value)&&Ce.value)),Ae=t(()=>Boolean(fe.value&&Ce.value&&!be.value)),ke=zt(r?.embedder),Ee="beforeDetails"===i.configuration.orderSummary?.placement,we=t(()=>ke&&!Ee&&!Ae.value),Oe=t(()=>ke&&Se.value),Ie=t(()=>ke?Ee:te.value),Re=t(()=>"guest"===i.identity.current.value&&S.value.delivery&&!S.value.contact),Te=t(()=>!q.value&&te.value&&(se.value||"abovePayment"===de.value)),Le=t(()=>b.value&&S.value.contact&&!q.value&&X.value.length>0),Ne=t(()=>!q.value),De=Ap({includeContact:Ne}),Me=t(()=>b.value&&!L.value&&De.value.length>0),Be=xl(),xe=t(()=>b.value&&Be.value&&Ee),Ve=t(()=>Be.value&&!Ee),Fe=Boolean(r?.isFlagshipPartner)&&"high"===ne;Xn();const He=t(()=>!q.value&&(se.value||le.value)),ze=t(()=>"abovePayment"===de.value),je=t(()=>q.value?S.value.delivery&&i.isShippingRequired.value?l.translate("shipping.delivery_title"):l.translate("payment.title"):l.translate("contact.contact_method_title")),Ue=t(()=>!te.value&&!F.value&&(!Y.value||x.value)),Ge=t(()=>!(F.value&&S.value.contact)&&(!Y.value||x.value)&&(ae.value||te.value&&!S.value.contact)),Ye=t(()=>S.value.payment&&!le.value&&!Ve.value),We=t(()=>M.value&&!Re.value),qe=t(()=>_&&We.value),$e=t(()=>!_&&We.value),Ke=t(()=>qe.value&&Ue.value),Je=t(()=>!ke&&qe.value&&Ue.value&&!pe.value&&S.value.payment&&(!i.isShippingRequired.value||S.value.delivery)),Ze=t(()=>ke?Ee:ae.value||Je.value),Xe=t(()=>Je.value&&!K.value&&(re.value||"belowPayment"===de.value)&&!k.value&&!Le.value&&!Me.value&&!N.value),Qe=t(()=>Xe.value||k.value||Te.value||le.value||ae.value&&!te.value&&K.value||Ye.value&&(K.value||Ee)),en=t(()=>k.value||Ye.value||!S.value.payment&&S.value.delivery&&!K.value&&!Le.value||S.value.payment&&le.value);return n(Ds,{children:[n(Qp,{}),n(V,{blockSize:N.value?"100%":void 0,gap:"@media (inline-size >= extraSmall) large-200, none",children:[n(a,{when:we,children:n(Qn,{accessibilityRole:"presentation"})}),xt(p)?n(V,{gap:"base",padding:"@media (inline-size >= extraSmall) none, large-200 large-200 none large-200",children:n(et,{})}):null,n(nt,{section:"toast"}),!Fe&&n(nt,{section:"top"}),n(sp,{active:b,ready:m}),n(cp,{fillAvailableBlockSize:N.value,ready:m,children:[h&&n(B,{padding:"none none large-100 none",children:n(ws,{})}),"high"===ne&&n(B,{display:"@media (inline-size >= medium) none, auto",children:n(po,{target:"lineItems",children:n(lo,{hideDivider:Z,children:n(tt,{})})})}),Fe&&n(nt,{section:"top"}),n(a,{when:Z,children:n(po,{target:"expressCheckout",children:n(mr,{})})}),n(a,{when:xe,children:[n(at,{section:"summary",children:n(it,{section:"summary",children:n(B,{padding:"none large-200 large-100 large-200",children:n(po,{target:"plain",children:n(Jp,{})})})})}),n(Qn,{accessibilityRole:"presentation"})]}),n(vp,{}),n(Ms,{}),n(a,{when:q,children:()=>n(lo,{accessibilityLabel:l.translate("contact.contact_method_title"),children:n(at,{section:"contact",children:n(it,{section:"contact",children:n(Np,{showForm:i.configuration.showContactInformation,identityPresentation:Y.value?"vaulted":"form",showEmailMarketingOptIn:Y.value?Q.value:void 0})})})})}),n(ho,{target:"vaulted",condition:qe,children:n(oo,{hideDivider:en,condition:Ue,accessibilityLabel:je.value,children:n(ho,{target:"vaulted",condition:$e,children:[n(ip,{showDelivery:fe,insideVaultedCard:Ke}),n(oo,{condition:Ge,hideDivider:Qe,accessibilityLabel:je.value,children:n(V,{children:[n(a,{when:()=>!S.value.contact&&!G.value,children:n(at,{section:"contact",children:n(it,{section:"contact",children:n(Np,{showForm:i.configuration.showContactInformation})})})}),n(a,{when:()=>!pe.value,children:n(Wd,{hideLastDivider:Ze,showTopDivider:Oe,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})}),n(a,{when:F,children:n(so,{})})]})})}),n(a,{when:k,children:n(B,{paddingBlockStart:"small-300",paddingBlockEnd:"base",children:n(Ar,{})})}),n(a,{when:()=>(!q.value||ze.value)&&(te.value||le.value),children:n(it,{section:"contact",children:n(gp,{aboveFoldSpacing:!0,showEmailMarketingOptIn:He,showPhoneMarketingOptIn:ze})})}),n(a,{when:Le,children:n(it,{section:"contact",children:n(fp,{extensions:X,hideDivider:"whenEmpty"})})}),n(a,{when:me,children:n(a,{when:i.isShippingRequired,children:n(eh,{isGuestPartialVaultedDelivery:Re,isSectionStyleUnificationEnabled:_,children:[n(np,{}),n(uo,{condition:pe,accessibilityLabel:l.translate("shipping.delivery_title"),children:n(Wd,{hideLastDivider:Ie,showTopDivider:Oe,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})})}),n(a,{when:Me,children:n(fp,{extensions:De,hideDivider:"whenEmpty"})}),n(a,{when:()=>!S.value.delivery&&i.isShippingRequired.value,children:n(ce,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(at,{section:"delivery",children:n(it,{section:"delivery",children:n(Wn,{sectionId:"delivery",children:n(Kp,{})})})})})}),n(a,{when:O,children:n(io.Prefetch,{})}),n(a,{when:N,children:n(B,{className:"xoG3V","data-testid":"onepage-vaulted-spacing"})}),n(a,{when:b,children:n(up,{onReady:g,includeContactInVaultedExtensions:Ne,showMobileOrderSummary:Ve,showVaultedStateMarketingDisclosureBelowPayment:re,phoneMarketingPlacement:de,isSectionCustomized:te,showVaultedStateMarketingDisclosureOnMobile:le,expressCheckoutSlot:J,showVaultedCardConsentSpacing:Xe})})]}),R&&n(ro,{})]}),n(hp,{}),n(a,{when:i.isShippingRequired,children:n(Sp,{})}),n(vr,{id:"OnePage"}),e]})}),th=Object.freeze(Object.defineProperty({__proto__:null,MobileOrderSummaryBeforeDetails:Jp,default:nh,onePageCritical
2StyleClassNames:Xp},Symbol.toStringTag,{value:"Module"}));export{nu as L,tu as M,Jc as O,gp as P,iu as R,Bd as S,zu as U,fp as V,Uc as a,Gc as b,Hp as c,Rd as d,Id as e,Bu as f,Mu as g,Td as h,ed as i,$s as j,Ks as k,Js as l,Ap as m,gc as n,th as o,yp 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.