import{aT as Nn,e as D,aR as X,a as e,aA as me,a5 as nn,a6 as ie,ak as oe,c4 as tn,B as f,a2 as Z,d as U,bc as dn,b0 as un,ej as hn,ef as pn,S as se,a1 as F,n as k,bY as mn,bO as N,cW as Hn,I as gn,cA as W,aL as Ye,ai as re,ab as Ee,eN as zn,kL as Un,q as B,kM as Gn,f2 as Wn,fB as Yn,ic as $n,kN as Kn,cD as qn,gD as jn,e8 as Jn,ij as Qn,gJ as sn,gK as Xn,ao as ge,kO as yn,bp as Zn,kP as et,fQ as fn,kQ as $e,aH as Y,ff as ye,fb as v,kR as nt,k as b,cz as ae,R as M,kS as tt,ar as pe,kT as st,g5 as it,dD as G,aK as Re,f_ as vn,kU as Sn,ax as Ae,kV as at,kW as ot,kX as rt,cL as lt,p as Le,hO as bn,aW as ct,it as dt,dG as De,aJ as ut,kY as ht,bP as pt,a_ as Pn,ad as mt,e$ as gt,b as we,bd as yt,kZ as ft,k_ as vt,az as Ke,k$ as St,bg as ue,dA as kn,l0 as bt,aE as Cn,l1 as Pt,l2 as kt,l3 as Ct,df as _t,dg as Mt,dj as Et,bM as Ie,gV as At,ac as Dt,l4 as wt,dk as It,dl as xt,dh as _n,di as Rt,dC as Lt,l5 as Vt,l6 as Tt,dQ as Ot,dq as Bt,dr as an,dp as Ft,ds as on,l7 as Nt,b8 as Ht,dt as zt,dE as Ut,dF as Gt,dR as Mn,dB as Wt,dO as Yt,l8 as $t,cy as Kt,l9 as Ve,la as qt,lb as jt,jC as En,lc as Jt,ld as Qt,fI as Xt,a0 as Zt,le as es,as as ns,b6 as ts,lf as ss,g9 as is,bW as as,bE as os,eH as rs,lg as ls,lh as An,li as cs,aF as ze,dL as ds,lj as us,br as hs,hc as ps,aC as ms,aD as gs,lk as ys,fH as fs,ll as rn,$ as vs,K as Q,lm as Ss,J as xe,ga as bs,ln as Ps,fE as ks,G as Cs,b_ as _s,D as Ms,lo as Es,lp as As,lq as Ds,fD as ws,fG as Is,eI as xs,U as Rs}from"./app.owqgWGYv.js";import{T as Ue,R as Dn,L as Ls}from"./LocalizationExtensionField.C5_Vy5Jg.js";import{C as Vs,P as Ts}from"./PaymentButtons.BvmHXI7E.js";import{S as Os}from"./StockProblemsLineItemList.BB0TP4oM.js";import{D as Bs,u as Fs,E as Ns,a as Hs,P as zs}from"./DeliveryMethodSelectorSection.OYHsyxh8.js";import{S as Te,M as he,a as Us,b as He}from"./Section.DrGY8mUP.js";import{u as Gs}from"./SeparatePaymentsNotice.CGfInKQt.js";import{S as Ws}from"./ShipmentBreakdown.BzI7UU4M.js";import Ys from"./component-ShopPayVerificationSwitch.XT3c0jAa.js";import{P as $s}from"./PayButtonSection.Byh3Erve.js";import"./ShopPayOptInDisclaimer.Bl8MpR5A.js";import"./useEditorShopPayNavigation.Ua6ZvAgB.js";import"./VaultedPayment.Bfd-gj_8.js";import"./MerchandiseModal.bIS5cY44.js";import"./StackedMerchandisePreview.C60CsUJD.js";import"./useSubscribeMessenger.Bkh-o6J2.js";import"./index.CZo637rF.js";function Ks({loading:t,lineItems:n,onClose:s}){const i=Nn(),a=D(),{hasStorefront:o}=X(),l=e(me,{variant:"primary",onClick:s,children:a("stock.continue_cta_label")}),c=o&&e(me,{href:i.cart(),variant:"plain",children:e(nn,{spacing:"small200",blockAlignment:"center",children:e(ie,{children:a("stock.return_to_store_label")})})});return oe(()=>()=>{tn.value="none"},[]),e(un,{heading:a("stock.price_update.title"),open:!0,onShow:()=>{tn.value="priceChange"},onHide:s,size:"large",children:e(f,{spacing:"loose",children:[e(Z,{children:a("stock.price_update.description")}),e(U,{children:e(Os,{loading:t,lineItems:n,type:dn.PriceChange})}),e(nn,{spacing:"large300",blockAlignment:"center",inlineAlignment:"end",children:[c,l]})]})})}function ln({children:t}){const n=hn().isPartner(),{isActive:s,visibility:{showCheckoutAsGuestFeature:i}}=pn(),a=se.default("none").when({viewportInlineSize:{min:"small"}},"block");return!t||!s||!i?null:e(k,{children:[e(F,{spacing:"large100"}),e(U,{inlineAlignment:"center",children:t}),n?e(F,{spacing:"base"}):e(U,{display:a,children:e(F,{spacing:"base"})})]})}function qs({returnWindow:t}){const n=D(),{value:s}=mn(),i=s?.finalSaleSummary?.hasFinalSale,a=N(()=>{const o=t===-1;return i?o?n("order_summary.return_rules_experiment.unlimited_window_title_with_final_sale"):n("order_summary.return_rules_experiment.limited_window_title_with_final_sale",{count:t}):o?n("order_summary.return_rules_experiment.unlimited_window_title"):n("order_summary.return_rules_experiment.limited_window_title",{count:t})},[i,t,n]);return e(W,{border:"base",padding:"small-300",borderRadius:"base",children:e(U,{inlineAlignment:"center",children:e(Hn,{gridTemplateColumns:"auto auto",gap:"small-300",alignItems:"center",children:[e(gn,{type:"return",size:"base",color:"base"}),e(ie,{color:"base",children:a})]})})})}function wn(t){return t.some(n=>n.code==="MERCHANDISE_EXPECTED_PRICE_MISMATCH")}function js(){const{value:t}=Ye(),n=wn(t??[]),{loading:s,value:i}=mn(),a=re().merchandiseLines.value,o=N(()=>i?.lines??[],[i]),[l,c]=Ee(a),r=N(()=>zn(l,o,t,Un).map(({proposed:d,negotiated:m})=>({line:d??m,problem:{type:dn.PriceChange,negotiatedPrice:m?.itemPrice,proposedPrice:d?.itemPrice}})),[l,o,t]),h=B(()=>{r.length>0&&c(o)},[r,o,c]);return{hasViolation:n,loading:s,lineItems:r,updateProposal:h}}function Js({filteredAvailableDeliveryAddresses:t,selectedAddressId:n,handleChange:s}){const i=N(()=>t?new Map(t.map(o=>[o.id,o.address])):new Map,[t]),a=N(()=>new Map,[]);return e(Wn.Provider,{value:!0,children:e(Gn,{id:"modal_shipping_address",addressType:"shipping",selectedId:n,onChange:s,choices:a,ephemeralAddressChoices:i})})}function Qs({shippingAddress:t}){const{nameLine:n,primary:s,secondary:i}=Yn({address:t}),a=`${n}, ${s}`;return e(U,{padding:"large100",background:"subdued",borderRadius:"base",children:e(ie,{tone:"accent",children:[e(Z,{children:e(ie,{type:"strong",children:a})}),e(Z,{children:i})]})})}function Xs(){const t=D(),n=re(),s=n.mustSelectProvidedAddress.value,i=n.availableDeliveryAddresses.value,[a]=$n(),{setSelectedAddress:o,selectedAddress:l}=Kn(),c=qn(),r=c?jn(c):!1,{record:h}=Jn(),{name:d}=X(),[m]=Qn(),[p,S]=Ee(l?.id),u=N(()=>s?i:i?.filter(y=>!a.find(V=>sn(V.address,y.address))),[a,i,s]),P=N(()=>a?.some(y=>l?sn(y.address,l.address):!1),[l,a]),C=u?.length===0,I=i&&i.length>=1&&!C&&!P,w=a?.length>=1,x=!!(!s&&I&&w&&!r),[_,R]=Ee(x);oe(()=>{_&&h({schemaId:"shopify_pay_payment_page_ui_impression/2.0",payload:{elementText:u?.length===1?"single_address":"multiple_addresses",elementType:"shop_pay_merchant_set_address_modal",shopAccountUuid:m}})},[_]);const E=B(y=>{h({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{action:y}})},[h]),g=B(()=>{E("shop_pay_proposed_address_modal_continue");const y=u?.find(V=>V.id===p);o(y,"shipping_address"),R(!1)},[u,p,o,E]),T=B(()=>{E("shop_pay_proposed_address_modal_use_saved_address");const y=Xn(a);y&&o(y,"shipping_address"),R(!1)},[o,a,E]),L=N(()=>u?new Map(u.map(y=>[y.id,y])):new Map,[u]),A=B(y=>{const V=L.get(y);S(V.id)},[L,S]),O=u?.length===1?e(Qs,{shippingAddress:u[0].address}):e(Js,{filteredAvailableDeliveryAddresses:u,selectedAddressId:p,handleChange:A});return e(un,{size:"large",open:_,heading:t("review_address_modal.title"),onHide:g,children:[e(k,{children:t("review_address_modal.subtitle",{count:u?.length||0,merchant:d})}),e(F,{spacing:"base"}),O,e(F,{spacing:"large200"}),e(f,{spacing:"small400",children:[e(me,{variant:"primary",inlineSize:"fill",onClick:g,children:t("review_address_modal.continue")}),e(me,{inlineSize:"fill",onClick:T,children:t("review_address_modal.use_saved_address")})]})]})}function Zs({showSmsMarketingOptIn:t=!1}){const{checkout:n}=ge(),{acceptTipPayments:s}=X(),{shopifyInstallments:i}=yn();Zn();const a=et(),o=fn(),l=$e(),{PurchaseOrderNumberField:c,GiftCardRedemption:r,StoreCreditRedemption:h,Installments:d,PaymentMethodSelector:m}=Y(),{isOrderEditCheckout:p}=ye(),S=l?.tippingPaymentAllowed??!0,u=!p&&s&&S&&n.configuration.visibility.showTips,P=v({shopPay:u&&!i(),default:u}),C=nt({showTips:P,billingFormPosition:a}),I=b("purchase.checkout.payment-method-list.render-before"),w=b("purchase.checkout.payment-method-list.render-after");return e(Re,{target:"cart.paymentLines[0]",children:e(ae,{gap:"base",children:[e(ei,{}),e(M,{extensions:I}),e(tt,{}),e(h,{}),e(d,{}),e(pe,{children:e(ae,{gap:"large-300",children:[e(st,{dynamicPaymentExtensions:C.shift()||[],showSmsMarketingOptIn:t,children:[e(m,{}),e(M,{extensions:w}),e(M,{extensions:C.shift()||[]}),e(r,{})]}),o&&e(it,{}),e(c,{showHeading:!1}),P&&e(k,{children:[e(G,{sectionId:"tips",children:e(Ue,{})}),e(M,{extensions:C.shift()||[]})]}),e(Dn,{}),e(M,{extensions:C.flat()})]})})]})})}function ei(){const t=D(),n=vn(),s="payment",i=Sn(s),a=n?`${t("payment.billing_must_match_shipping_notice")} `:"",o=t("payment.card_security_notice");return e(ae,{gap:"small-400",children:[e(Ae,{id:s,level:1,autoFocus:i,children:t("payment.title")}),e(Z,{color:"subdued",children:a+o})]})}function ni(){const t=D(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:s}=ot(),i=n&&!s,{selectedDeliveryMethod:a}=rt({onChange:()=>{},prerequisitesLoading:n||i}),o=a?t("order_summary.updated_shipping_method",{shipping_method:a.title}):void 0;return oe(()=>{if(o)return lt({content:o})},[o]),null}function ti(){return at("ONE_TIME_PURCHASE")?e(ni,{}):null}function si(){const{negotiate:t}=Le(),n=bn(),s=re(),i=s.shippingAddress.value,a=s.billingAddress.value,o=ct(),{value:l=[]}=Ye(),c=dt(l),r=wn(l),{shippingRequired:h}=De(),d=h?i.countryCode:a.countryCode,m=n?.value?.countryCode,p=JSON.stringify(n?.value,(S,u)=>u===void 0?null:u);oe(()=>{c||r||m&&d!==m&&(o.log("country_code_alignment_mismatch_detected","[EnsureBackAndFrontEndCountryCodeAlignment] There was a mismatch between the preselected and the buyerIdentity countryCode on checkout load.",{selectedCountryCode:d,buyerIdentityCountryCode:m,buyerIdentity:p}),t({silenceViolations:["all"]}))},[])}function ii({showSmsMarketingOptIn:t=!1}){const n=b("Checkout::Contact::RenderAfter"),s=b("Checkout::Dynamic::Render","INFORMATION1"),i=b("Checkout::Dynamic::Render","INFORMATION2"),{ContactForm:a}=Y();return e(k,{children:[s.length?e(k,{children:e(M,{extensions:s,spacing:"base",marginBlockEnd:"large300"})}):null,e(ut,{impressionType:"contact",impressionFeatures:[],children:[e(a,{showSmsMarketingOptIn:t}),n.length?e(k,{children:e(M,{extensions:n,marginBlockStart:"base"})}):null,i.length?e(k,{children:e(M,{extensions:i,spacing:"large200",marginBlockStart:"large300"})}):null]})]})}function ai(){const t=D(),{setSelectedAddress:n,addresses:s}=ht("shipping"),i=B(()=>{s.length>0&&n(s[0])},[s,n]);return s.length===0?null:e(Pn,{inlineAlignment:"start",children:e(pt,{id:"save_shipping_information",textDecoration:"none",onClick:i,children:t("customer_account.saved_address_option_link")})})}function oi({localPickupDeliveryLine:t}){const n=D(),s=mt(),{methods:i,type:a}=t,[o]=gt(a),{optionList:{typographyStyle:l}}=we(),c=yt(),r=i.find(d=>d.handle===o);if(!r)return null;const h=ft(r.cost,c,n);return e(f,{children:[s&&e(Z,{children:n("delivery_options.subscription_pickup_information")}),e(U,{border:"base",borderRadius:"large",children:[e(W,{padding:"base",children:e(Pn,{columns:["fill","auto"],children:[e(vt,{pickupLocation:r.pickupLocation}),e(ie,{type:l?void 0:"strong",style:l,letterCase:h.letterCase,children:h.amount})]})}),e(Ke,{accessibilityRole:"presentation"}),e(W,{padding:"base",children:e(me,{variant:"plain",inlineSize:"fill",textDecoration:"none",inlineAlignment:"start",overlay:e(St,{methods:i,type:a}),children:e(ae,{direction:"inline",gap:"small-200",alignItems:"center",justifyContent:"space-between",children:[e(ie,{type:"strong",children:n("local_pickup.toggle_location")}),e(gn,{type:"chevron-right",size:"small-200"})]})})})]})]})}function ri(){return e(U,{border:"base",borderRadius:"large",children:[e(W,{padding:"base",paddingBlockEnd:"large-400",children:e(ae,{justifyContent:"space-between",direction:"inline",children:[e(ae,{direction:"block",gap:"small-400",children:[e(ue,{inlineSize:"large",size:"base"}),e(ue,{inlineSize:"base",size:"base"})]}),e(ue,{inlineSize:"small",size:"base"})]})}),e(Ke,{accessibilityRole:"presentation"}),e(W,{padding:"base",children:e(ue,{inlineSize:"small",size:"base"})})]})}function li(){const t=D(),{negotiating:n}=kn(),s=bt(),i=Cn(),{value:a,loading:o}=Pt(),l=n||!i||o?e(ri,{}):a?e(kt,{}):s?e(oi,{localPickupDeliveryLine:s}):null;return e(Re,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(pe,{accessibilityLabel:t("delivery_options.pick_up_locations"),children:l})})}function ci({showSmsMarketingOptIn:t=!1}){return Ct(),e(f,{spacing:"large300",children:[e(Bs,{}),e(di,{showSmsMarketingOptIn:t})]})}function di({showSmsMarketingOptIn:t}){const n=_t(),{method:s}=kn(),i=D(),{wallets:a}=ge(),{value:o}=Mt(),l=Et(),c=Ie(At),{showShipmentBreakdown:r}=Dt(),h=wt(),d=b("Checkout::DeliveryAddress::RenderBefore"),m=b("purchase.checkout.delivery-address.render-after"),{hasMultipleDeliveryGroups:p,onlyDeliveryGroupType:S}=It(),{extensionsBefore:u,extensionsAfter:P}=xt({hasMultipleDeliveryGroups:p,targeted:!1}),C=l||r,I=_n(),w=Rt(),{negotiate:x}=Le(),_=B(({shipping:A})=>{a.activeSession||x({include:[],fieldsToResolve:["deliveryNext"],silenceViolations:["non-delivery-address"],runListenersOnError:!0}),A.value=!0,I("sectionComplete",{section:"deliveryAddress",timestamp:new Date}),w({type:"section_complete",section:"deliveryAddress"})},[a.activeSession,x,I,w]),R=B(({shipping:A})=>{A.value=!1},[]),E=A=>e(pe,{padding:C?"small-400 none":void 0,children:A}),g=t?e(Mn,{}):null,T="shippingMethod",L=Sn(T);switch(s){case"PICKUP_POINT":return e(k,{children:e(G,{sectionId:"pickupPoints",children:e(Gt,{})})});case"PICK_UP":return e(k,{children:e(G,{sectionId:"localPickup",children:h==="treatment"?e(li,{}):e(Ut,{})})});default:return e(G,{sectionId:"shipping",children:[e(pe,{accessibilityLabel:i("delivery_options.shipping_address"),children:e(f,{spacing:"base",children:[e(M,{extensions:d}),e(f,{spacing:"large300",children:[e(Lt,{children:e(Vt,{onValid:_,onInvalid:R,children:e(Tt,{children:[e(ai,{}),e(Ot,{}),g]})})}),e(M,{extensions:m}),e(f,{spacing:C?"small400":"base",children:[e(Ae,{id:T,level:c?1:2,autoFocus:L,children:i("shipping.shipping_method_title")}),e(Bt,{children:[r?e(an,{children:[e(Ws,{}),e(F,{spacing:"small200"})]}):null,Ft("shipping.shipping_method_notice",n)?e(Z,{children:i("shipping.shipping_method_notice")}):null,e(M,{extensions:u,options:{groupType:S&&on(S),includeDeliverySelectionGroups:!1},render:E}),e(an,{children:[e(Nt,{}),e(Ht.Preload,{})]}),e(M,{extensions:P,options:{groupType:S&&on(S),includeDeliverySelectionGroups:!1},render:E})]})]})]})]})}),o?.refuseDutiesPermitted&&e(pe,{accessibilityLabel:i("shipping.duties_and_taxes_title"),children:e(f,{spacing:"base",children:[e(Ae,{level:2,children:i("shipping.duties_and_taxes_title")}),e(zt,{})]})})]})}}function ui({showSmsMarketingOptIn:t=!1}){const n=D(),s=vn(),{DeliveryHeading:i}=Y(),a=b("Checkout::Dynamic::Render","DELIVERY1");return e(Te,{children:e(f,{children:[e(f,{spacing:"small400",children:[e(i,{}),s&&e(Z,{color:"subdued",children:n("shipping.shipping_used_as_billing_notice")})]}),e(Wt,{}),e(Yt,{children:e(ci,{showSmsMarketingOptIn:t})}),e(M,{extensions:a})]})})}function hi(t){if(!t)return"";try{return new URL(pi(t)).hostname.replace("www.","")}catch{return t.replace(/^https?:\/\/(www\.)?/,"")}}const pi=t=>{const n="https://";return t.replace(/^(?:(.*:)?\/\/)?(.*)/i,(s,i,a)=>i?s:`${n}${a}`)},mi="LaXGo",gi={ReferralTitle:mi};function yi(){const t=D(),n=X(),s=hi(n.storefrontUrl)?.replace(/-/g,"‑");return s?e("strong",{"data-testid":"referral-title",className:gi.ReferralTitle,children:t("shop_pay.checkout.referral_title",{merchant_url:s})}):null}function fi(){const t=re(),n=t.email.value,s=t.phone.value,i=D(),{isOrderEditCheckout:a}=ye(),o=$t(),[l,c]=Ee(!1),r=v({customerAccount:n&&typeof n=="string"&&o,default:!1}),{VaultedContact:h}=Y(),d=v({businessCustomer:!1,shopPay:!1,default:!0}),m=r?e(Ys,{email:n,open:l,showPopover:p=>{c(p)}}):null;if(a&&d){const p=n||s;return e(k,{children:[e(Kt,{id:"contact",label:i("contact.contact_method_title"),summary:p?e("p",{children:p}):e(ue,{})}),m]})}return e(k,{children:[e(h,{emailAddress:n,phone:s}),m]})}const vi="ILN3z",Me={DivideChildren:vi,"DivideChildren--no-initial-divider":"TiyE2","DivideChildren--no-final-divider":"wyrwY","DivideChildren--final-mobile-divider":"_8S1mj"};function cn({hideLastDivider:t}){const n=Ve(),{negotiate:s}=Le(),i=v({amazonPay:!1,buyWithPrime:!1,default:!0}),a=qt(),o=(a?.is_referral&&a.layout==="web")??!1,{isOrderEditCheckout:l}=ye(),{shippingRequired:c}=De(),{shippingRequired:r}=De(),h=l&&r,[d]=jt(),m=d.includes("PICK_UP"),{checkout:p}=ge(),{VaultedPayment:S,ReviewNotice:u,VaultedDelivery:P,VaultedBillingAddress:C,VaultedCashRedemption:I}=Y(),w=En(),x=Jt(),_=v({guest:!0,default:!1}),R=v({businessCustomer:n.payment,guest:!0,default:!1}),E=v({amazonPay:!0,buyWithPrime:!0,payPal:!0,googlePay:!0,shopPay:!0,default:!1}),g=v({businessCustomer:!0,default:!1}),T=Ie(Qt),L=n.delivery&&(c||h&&l),A=v({businessCustomer:!c||m,default:!1}),O=[...n.contact?[e(fi,{},"contact")]:[],...L?[e(P,{},"delivery")]:[],...y(p)];if(oe(()=>{O.length>0&&i&&s({silenceViolations:["all"]})},[]),O.length===0)return null;return e(W,{children:[x?e(Xt,{}):null,x&&E?e(Zt,{below:"large",children:e(F,{})}):null,w&&e(u,{}),o?e(yi,{}):null,T?e(es,{items:O,showBottomDivider:!t&&!R}):e("div",{className:ns({[Me.DivideChildren]:!0,[Me["DivideChildren--no-final-divider"]]:t||R===!0,[Me["DivideChildren--no-initial-divider"]]:_,[Me["DivideChildren--final-mobile-divider"]]:g}),children:O})]});function y(V){if(l)return n.payment?[e(S,{},"payment")]:[];const H=[];return A&&H.push(e(C,{},"businessCustomerBilling")),n.payment&&(H.push(e(S,{},"payment")),V.configuration.visibility.showCashRedemption&&H.push(e(I,{},"cashRedemption")),n.billing&&!A&&H.push(e(C,{},"billingAddress"))),H}}function In({includeContactAfterExtensions:t}={includeContactAfterExtensions:!1}){const n=Ve(),s=b("Checkout::Contact::RenderAfter"),i=b("Checkout::Dynamic::Render","INFORMATION1"),a=b("Checkout::Dynamic::Render","INFORMATION2"),o=b("Checkout::Dynamic::Render","DELIVERY1"),l=b("Checkout::Dynamic::Render","DELIVERY2"),c=b("Checkout::Dynamic::Render","PAYMENT1"),r=b("Checkout::Dynamic::Render","PAYMENT2"),h=b("Checkout::Dynamic::Render","PAYMENT3");return N(()=>{let d=[];return n.contact&&(d=[...t?s:[],...i,...a]),n.delivery&&(d=[...d,...o,...l]),n.payment&&(d=[...d,...c,...r,...h]),d},[n,t,s,i,a,o,l,c,r,h])}function Hi({children:t}){const{checkout:n}=ge(),s=Cn(),i=re(),a=i.email.value,o=i.phone.value,{progress:l}=Le(),{shippingRequired:c}=De(),r=Ve(),{value:h}=ts(),[d]=ss(),{postPurchaseEnabled:m}=is(),p=D(),S=as(),u=os(),{isOrderEditCheckout:P}=ye(),{vaultedItem:{background:C,border:I}}=we(),{emailMarketing:w,smsMarketing:x}=X(),_=js(),R=_n(),E=En(),g=n.configuration.visibility.showEmailMarketing&&w!=="OFF",T=fn(),L=$e(),A=rs(),{value:O}=bn(),y=Ie(ls),V=An(),{value:H}=Ye(),le=!H?.some(en=>cs.has(en.code))&&_.hasViolation&&_.lineItems.length>0;si(),oe(()=>{le&&R("inventoryPriceChange",{element:{tagName:"modal"},timestamp:new Date,visible:!0})},[le,R]);const fe=B(()=>{_.updateProposal()},[_]),ve=ze({base:!0,medium:!1}),Be=ze({base:!1,small:!0}),$=ds(),ee=v({guest:$,customerAccount:$,sdkCartHints:$,externalVault:$,default:!1}),ce=b("Checkout::Contact::RenderAfter"),Se=v({shopPay:S&&!!(ve&&!Be),default:!1}),Fe=v({shopPay:g,default:g&&r.contact}),Ne=v({shopPay:Xs,default:k}),ne=y&&!us(O?.countryCode),be=v({businessCustomer:!1,sdkCartHints:!!(g&&r.contact&&a),default:Fe&&!A&&!ne&&!P}),K=v({shopPay:"belowPayment",default:r.payment?"belowPayment":"abovePayment"});let q=v({shopPay:!1,businessCustomer:!1,default:x!=="OFF"});L&&!L.smsMarketingEnabled&&(q=!1);const j=o&&!a?r.contact?"root":"contact":ks(h)||!c?"billing":"delivery",Pe=be&&K==="belowPayment",J=be&&K==="abovePayment",te=Pe&&(ve??!1),de=n.configuration.visibility.showEmailMarketing&&!P&&J&&!u?.acceptsEmailMarketing,ke=!P&&q&&j==="root"&&!u?.acceptsSmsMarketing,xn=v({sdkCartHints:k,default:Te}),Ce=v({guest:r.delivery,businessCustomer:!r.delivery&&r.payment,default:!1}),Rn=v({guest:Ce&&!(r.contact&&r.payment),businessCustomer:Ce,default:!1}),_e=r.contact&&!(r.delivery&&r.payment)&&ce.length>0&&(de||ke||ve)?ce:void 0,{SignUpContact:Ln}=Y(),{acceleratedWalletPaymentMethods:Vn}=hs(),Tn=Fs(Vn),On=Ie(ps),Je=In({includeContactAfterExtensions:_e===void 0}),{main:{section:Bn,spacing:Qe}}=ms(),{lineItems:{priority:Fn="base"}}=we(),z=gs(Bn),Xe=z&&!C&&!I,Ze=ys();return e(k,{children:[t,e(f,{spacing:se.default("none").when({viewportInlineSize:{min:"extraSmall"}},"large200"),children:[P?e(f,{padding:se.default(["large200","large200","none","large200"]).when({viewportInlineSize:{min:"extraSmall"}},"none"),children:e(fs,{})}):null,e(rn,{section:"toast"}),e(rn,{section:"top"}),e(vs,{onSubmit:()=>l("one-page-form-submit",void 0,{skipToCompletion:E}),children:[e("div",{ref:Tn,children:e(he,{hideDivider:r.payment&&!te&&!Ze,condition:!z,accessibilityLabel:p("contact.contact_method_title"),children:[ee&&e(k,{children:[e(he,{condition:z,hideDivider:!0,padding:Se?"none large-200 large-200 large-200":void 0,children:e(f,{spacing:"none",children:e(G,{sectionId:"expressCheckout",children:e(Q,{section:"expressCheckout",children:e(Ns,{})})})})}),e(Hs,{})]}),Fn==="high"&&e(W,{display:se.default("block").when({viewportInlineSize:{min:"medium"}},"none"),children:e(he,{condition:z,children:e(Ss,{})})}),e(he,{condition:Xe,padding:!ee&&Se?"none large-200 large-200 large-200":void 0,accessibilityLabel:p("contact.contact_method_title"),children:e(f,{spacing:"none",children:[!r.contact&&e(xe,{section:"contact",children:e(Q,{section:"contact",children:e(ii,{showSmsMarketingOptIn:!P&&q&&j==="contact"})})}),!Ce&&e(k,{children:[e(cn,{hideLastDivider:z}),!Xe&&Qe!=="none"&&e(F,{spacing:Qe})]}),T&&e(Dn,{variant:"minimal"}),!z&&e(Q,{section:"contact",children:e(Ge,{renderAsVaulted:!0,showMarketingDisclosure:de||te,showSmsMarketingOptIn:ke&&K!=="belowPayment",afterContactExtensions:_e})})]})})]})}),e(Ln,{}),z&&e(Q,{section:"contact",children:e(Ge,{showMarketingDisclosure:de,showSmsMarketingOptIn:ke&&K!=="belowPayment",afterContactExtensions:_e})}),Rn&&c&&e(Us,{condition:Ce,accessibilityLabel:p("shipping.delivery_title"),children:e(cn,{hideLastDivider:z})}),!V&&Je.length?e(We,{extensions:Je,hideDivider:"whenEmpty"}):null,!r.delivery&&c&&e(Re,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(xe,{section:"delivery",children:e(Q,{section:"delivery",children:e(G,{sectionId:"delivery",children:e(ui,{showSmsMarketingOptIn:!P&&q&&j==="delivery"})})})})}),s&&e(Si,{showMobileOrderSummary:Ze,showVaultedStateMarketingDisclosureBelowPayment:Pe,showVaultedStateMarketingDisclosureOnMobile:te,showPartialVaultedStateSmsMarketingOptIn:ke&&K==="belowPayment",showSmsMarketingOptIn:q,smsMarketingOptInPlacement:j,isSectionCustomized:z,VaultedStateMarketingDisclosureWrapper:xn,includeContactAfterExtensions:_e===void 0,showExpressCheckoutSection:ee,managedMarketsWithShopifyPaymentsFeatureFlagEnabled:On})]},d),m&&e(bs,{})]}),e(Ps,{}),le&&e(Ks,{loading:_.loading,lineItems:_.lineItems,onClose:fe}),c&&e(ti,{}),e(Ne,{}),e(zs,{id:"OnePage"})]})}function Si({showMobileOrderSummary:t,showVaultedStateMarketingDisclosureBelowPayment:n,showVaultedStateMarketingDisclosureOnMobile:s,isSectionCustomized:i,VaultedStateMarketingDisclosureWrapper:a,showPartialVaultedStateSmsMarketingOptIn:o,showSmsMarketingOptIn:l,smsMarketingOptInPlacement:c,includeContactAfterExtensions:r,showExpressCheckoutSection:h,managedMarketsWithShopifyPaymentsFeatureFlagEnabled:d}){const m=D(),p=Ve(),S=An(),u=Cs(),P=Gs(),{checkout:C}=ge(),{acceptTipPayments:I}=X(),{currentDetour:w}=_s(),x=Ms(),_=v({shopPay:!p.payment,default:!1}),{visibility:{shouldRenderFloatingShopPayButton:R}}=pn(),{isOrderEditCheckout:E}=ye(),g=ze({base:!0,medium:!1}),T=Es(),{returnWindow:L}=X();As();const A=re().localizationExtensions.value,O=A.length>0,y=se.default("block").when({viewportInlineSize:{min:"medium"}},"none"),V=se.default("none").when({viewportInlineSize:{min:"medium"}},"block"),{shopifyInstallments:H}=yn(),{setChatHideTriggerNode:Oe}=Ds(),le=B(J=>{Oe(g&&J?J:null)},[g,Oe]),fe=n&&!g,Be=$e()?.tippingPaymentAllowed??!0,$=p.payment&&I&&Be&&C.configuration.visibility.showTips,ee=v({shopPay:$&&!H(),default:$}),ce=hn().isPartner(),Se=N(()=>w?.type==="thankYou"?"Checkout::ThankYou::Dynamic::Render":"Checkout::Dynamic::Render",[w?.type]),Fe=b(Se,"ORDER_SUMMARY4"),Ne=d?!h&&!!x.value:!!x.value,ne=In({includeContactAfterExtensions:r}),be=ws(),{Rewards:K,CashRedemption:qe,MarketingDisclosure:q,BillingSection:je,CheckoutAsGuest:j}=Y(),{primaryButton:{visibility:Pe="visible"}}=we();return e(k,{children:e(He,{min:"medium",accessibilityLabel:m("payment.title"),hideDivider:!0,children:[be?null:e(Is,{}),!p.payment&&e(xe,{section:"payment",children:e(Q,{section:"payment",children:e(He,{max:"medium",accessibilityLabel:m("payment.title"),children:e(Zs,{showSmsMarketingOptIn:!E&&l&&c==="billing"})})})}),!p.payment&&e(qe,{}),O&&e(Te,{accessibilityLabel:m("localized_fields.additional_information.title"),children:e(f,{padding:g?"none":["large400","none","none","none"],children:[e(Ae,{level:2,children:m("localized_fields.additional_information.title")}),A.map((J,te)=>{const de=`${J.value.key}${te}`;return e(Ls,{localizationExtension:J,index:te},de)})]})}),s&&i&&e(a,{children:e(q,{})}),g&&!E&&ee&&e(U,{display:y,children:e(G,{sectionId:"tips",children:e(Ue,{renderInSection:g})})}),g&&S&&ne.length?e(We,{extensions:ne,hideDivider:"whenEmpty"}):null,e(xe,{section:"summary",children:e(Q,{section:"summary",children:e("div",{ref:le,children:[e(He,{max:"medium",hideDivider:!0,children:[t&&e(xs,{}),e(f,{spacing:R?"none":"base",children:[e(f,{spacing:"base",children:[fe&&_&&e(f,{spacing:"none",children:[e(F,{spacing:"base"}),e(Ke,{})]}),e(Ge,{renderAsVaulted:!0,showMarketingDisclosure:fe,showSmsMarketingOptIn:o,children:e(je,{})}),!g&&!E&&ee&&e(U,{display:V,children:e(G,{sectionId:"tips",children:[e(F,{spacing:"large300"}),e(Ue,{})]})}),!g&&S&&ne.length?e(We,{extensions:ne}):null,Ne&&e(f,{padding:g?"none":["large400","none","none","none"],children:e(Rs,{textProps:{color:"subdued",size:"small"}})})]}),e(f,{spacing:"large200",children:[P&&e(Vs,{}),Pe==="visible"&&e($s,{}),u&&e(Ts,{}),L&&T?e(W,{display:y,children:e(qs,{returnWindow:L})}):null,g&&e(M,{extensions:Fe,spacing:"large200"})]})]}),e(K,{}),ce?null:e(ln,{children:e(j,{})})]}),ce?e(ln,{children:e(j,{})}):null]})})})]})})}function Ge({showMarketingDisclosure:t,showSmsMarketingOptIn:n,afterContactExtensions:s,renderAsVaulted:i,children:a}){const{MarketingDisclosure:o}=Y();return!t&&!n&&!s?a:e(Re,{target:"cart.buyerIdentity",children:e(he,{condition:!i,children:e(f,{spacing:i?"base":void 0,padding:i?["base","none","none","none"]:void 0,children:[(t||n)&&e(f,{spacing:t&&n?"base":"none",children:[t&&e(o,{}),n&&e(Mn,{})]}),s&&e(M,{extensions:s}),a]})})})}function We({extensions:t,hideDivider:n="always"}){return e(Te,{hideDivider:n,children:e(M,{spacing:"base",extensions:t})})}export{Ge as PartialVaultedMarketingConsentMarkup,We as VaultedExtensionsSection,Hi as default};