import{aT as zn,c as I,aR as Z,a as e,aE as Se,ac as sn,y as Pe,ap as re,c4 as an,B as g,a9 as ee,V as U,bc as hn,b0 as pn,ep as mn,el as gn,S as ae,a8 as N,l as _,bY as yn,bP as F,c$ as Gn,I as fn,cD as K,aL as Ye,z as le,ah as be,eT as Wn,q as B,kW as Kn,kX as Yn,f8 as $n,fG as qn,hR as jn,kY as Xn,cH as Jn,hl as Qn,ee as Zn,hX as et,hr as on,hs as nt,at as ce,kZ as vn,bp as tt,k_ as st,fX as Sn,k$ as $e,aH as z,fk as de,fh as v,l0 as it,i as C,cC as oe,R as w,l1 as at,av as ve,l2 as ot,gc as rt,dK as W,aK as Le,g5 as Pn,l3 as bn,aB as Re,l4 as lt,l5 as ct,l6 as dt,cP as ut,C as Ve,jK as Cn,aW as ht,i5 as pt,dN as Ce,aJ as mt,l7 as gt,L as yt,a_ as kn,aj as ft,f5 as vt,l8 as St,aD as qe,l9 as Pt,bg as ye,dH as _n,la as bt,d$ as Mn,lb as Ct,lc as kt,ld as _t,le as Mt,lf as Et,lg as At,lh as wt,dm as Dt,dn as It,dr as Rt,bN as ke,gm as xt,ai as Lt,li as je,ds as Vt,dt as Ot,dp as En,dq as Tt,dJ as Bt,lj as Nt,lk as Ft,dX as Ht,dx as Ut,dy as rn,dw as zt,dz as ln,ll as Gt,b8 as Wt,dA as Kt,dL as Yt,dM as $t,dY as An,lm as ue,dI as qt,dV as jt,eN as Oe,ln as Xt,cy as Jt,lo as Qt,lp as wn,lq as Zt,jm as Dn,lr as es,ls as ns,lt as ts,fP as ss,a7 as is,lu as as,aw as os,b6 as rs,lv as ls,gf as cs,bW as ds,bE as us,u as He,eM as hs,lw as ps,lx as In,ly as ms,cV as Ue,dS as gs,lz as ys,br as fs,gF as vs,d5 as Ss,gW as Ps,lA as bs,fO as Cs,lB as cn,a6 as ks,fM as fe,Y as Q,lC as _s,X as xe,fN as Ms,gg as Es,lD as As,fJ as ws,U as Ds,b_ as Is,O as Rs,lE as xs,lF as Ls,lG as Vs,fI as Os,lH as Fe,fL as Ts,eO as Bs,a2 as Ns}from"./app.BTSv6d-3.js";import{T as ze,R as Rn,L as Fs}from"./LocalizationExtensionField.BED4JKQH.js";import{C as Hs,P as Us}from"./PaymentButtons.BG47O96K.js";import{S as zs}from"./StockProblemsLineItemList.DwiTJmLy.js";import{D as Gs,u as Ws,E as Ks,a as Ys,P as $s}from"./DeliveryMethodSelectorSection.DpvaEfM5.js";import{u as qs}from"./SeparatePaymentsNotice.DW3Om18s.js";import{S as js}from"./ShipmentBreakdown.BnllCDQm.js";import Xs from"./component-ShopPayVerificationSwitch.C0uZXEcj.js";import{P as Js}from"./PayButtonSection.B_rL1uKR.js";import"./RememberMeDescriptionText.DrLJIc9M.js";import"./ShopPayOptInDisclaimer.e7mZhwXa.js";import"./useEditorShopPayNavigation.tmD3cmD4.js";import"./VaultedPayment.8fS74ln2.js";import"./MerchandiseModal.2z-KWtZb.js";import"./StackedMerchandisePreview.CY3NDc1_.js";import"./useSubscribeMessenger.CHywrATV.js";import"./index.DqdNSX5G.js";function Qs({loading:n,lineItems:t,onClose:s}){const i=zn(),a=I(),{hasStorefront:o}=Z(),c=e(Se,{variant:"primary",onClick:s,children:a("stock.continue_cta_label")}),l=o&&e(Se,{href:i.cart(),variant:"plain",children:e(sn,{spacing:"small200",blockAlignment:"center",children:e(Pe,{children:a("stock.return_to_store_label")})})});return re(()=>()=>{an.value="none"},[]),e(pn,{heading:a("stock.price_update.title"),open:!0,onShow:()=>{an.value="priceChange"},onHide:s,size:"large",children:e(g,{spacing:"loose",children:[e(ee,{children:a("stock.price_update.description")}),e(U,{children:e(zs,{loading:n,lineItems:t,type:hn.PriceChange})}),e(sn,{spacing:"large300",blockAlignment:"center",inlineAlignment:"end",children:[l,c]})]})})}function dn({children:n}){const t=mn().isPartner(),{isActive:s,visibility:{showCheckoutAsGuestFeature:i}}=gn(),a=ae.default("none").when({viewportInlineSize:{min:"small"}},"block");return!n||!s||!i?null:e(_,{children:[e(N,{spacing:"large100"}),e(U,{inlineAlignment:"center",children:n}),t?e(N,{spacing:"base"}):e(U,{display:a,children:e(N,{spacing:"base"})})]})}function Zs({returnWindow:n}){const t=I(),{value:s}=yn(),i=s?.finalSaleSummary?.hasFinalSale,a=F(()=>{const o=n===-1;return i?o?t("order_summary.return_rules_experiment.unlimited_window_title_with_final_sale"):t("order_summary.return_rules_experiment.limited_window_title_with_final_sale",{count:n}):o?t("order_summary.return_rules_experiment.unlimited_window_title"):t("order_summary.return_rules_experiment.limited_window_title",{count:n})},[i,n,t]);return e(K,{border:"base",padding:"small-300",borderRadius:"base",children:e(U,{inlineAlignment:"center",children:e(Gn,{gridTemplateColumns:"auto auto",gap:"small-300",alignItems:"center",children:[e(fn,{type:"return",size:"base",color:"base"}),e(Pe,{color:"base",children:a})]})})})}function xn(n){return n.some(t=>t.code==="MERCHANDISE_EXPECTED_PRICE_MISMATCH")}function ei(){const{value:n}=Ye(),t=xn(n??[]),{loading:s,value:i}=yn(),a=le().merchandiseLines.value,o=F(()=>i?.lines??[],[i]),[c,l]=be(a),r=F(()=>Wn(c,o,n,Kn).map(({proposed:d,negotiated:u})=>({line:d??u,problem:{type:hn.PriceChange,negotiatedPrice:u?.itemPrice,proposedPrice:d?.itemPrice}})),[c,o,n]),p=B(()=>{r.length>0&&l(o)},[r,o,l]);return{hasViolation:t,loading:s,lineItems:r,updateProposal:p}}function ni({filteredAvailableDeliveryAddresses:n,selectedAddressId:t,handleChange:s}){const i=F(()=>n?new Map(n.map(o=>[o.id,o.address])):new Map,[n]),a=F(()=>new Map,[]);return e($n.Provider,{value:!0,children:e(Yn,{id:"modal_shipping_address",addressType:"shipping",selectedId:t,onChange:s,choices:a,ephemeralAddressChoices:i})})}function ti({shippingAddress:n}){const{nameLine:t,primary:s,secondary:i}=qn({address:n}),a=`${t}, ${s}`;return e(U,{padding:"large100",background:"subdued",borderRadius:"base",children:e(Pe,{tone:"accent",children:[e(ee,{children:e(Pe,{type:"strong",children:a})}),e(ee,{children:i})]})})}function si(){const n=I(),t=le(),s=t.mustSelectProvidedAddress.value,i=t.availableDeliveryAddresses.value,[a]=jn(),{setSelectedAddress:o,selectedAddress:c}=Xn(),l=Jn(),r=l?Qn(l):!1,{record:p}=Zn(),{name:d}=Z(),[u]=et(),[m,P]=be(c?.id),h=F(()=>s?i:i?.filter(f=>!a.find(A=>on(A.address,f.address))),[a,i,s]),b=F(()=>a?.some(f=>c?on(f.address,c.address):!1),[c,a]),S=h?.length===0,D=i&&i.length>=1&&!S&&!b,R=a?.length>=1,L=!!(!s&&D&&R&&!r),[k,V]=be(L);re(()=>{k&&p({schemaId:"shopify_pay_payment_page_ui_impression/2.0",payload:{elementText:h?.length===1?"single_address":"multiple_addresses",elementType:"shop_pay_merchant_set_address_modal",shopAccountUuid:u}})},[k]);const M=B(f=>{p({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{action:f}})},[p]),y=B(()=>{M("shop_pay_proposed_address_modal_continue");const f=h?.find(A=>A.id===m);o(f,"shipping_address"),V(!1)},[h,m,o,M]),O=B(()=>{M("shop_pay_proposed_address_modal_use_saved_address");const f=nt(a);f&&o(f,"shipping_address"),V(!1)},[o,a,M]),x=F(()=>h?new Map(h.map(f=>[f.id,f])):new Map,[h]),E=B(f=>{const A=x.get(f);P(A.id)},[x,P]),G=h?.length===1?e(ti,{shippingAddress:h[0].address}):e(ni,{filteredAvailableDeliveryAddresses:h,selectedAddressId:m,handleChange:E});return e(pn,{size:"large",open:k,heading:n("review_address_modal.title"),onHide:y,children:[e(_,{children:n("review_address_modal.subtitle",{count:h?.length||0,merchant:d})}),e(N,{spacing:"base"}),G,e(N,{spacing:"large200"}),e(g,{spacing:"small400",children:[e(Se,{variant:"primary",inlineSize:"fill",onClick:y,children:n("review_address_modal.continue")}),e(Se,{inlineSize:"fill",onClick:O,children:n("review_address_modal.use_saved_address")})]})]})}function ii({showSmsMarketingOptIn:n=!1}){const{checkout:t}=ce(),{acceptTipPayments:s}=Z(),{shopifyInstallments:i}=vn();tt();const a=st(),o=Sn(),c=$e(),{PurchaseOrderNumberField:l,GiftCardRedemption:r,StoreCreditRedemption:p,Installments:d,PaymentMethodSelector:u}=z(),{isOrderEditCheckout:m}=de(),P=c?.tippingPaymentAllowed??!0,h=!m&&s&&P&&t.configuration.visibility.showTips,b=v({shopPay:h&&!i(),default:h}),S=it({showTips:b,billingFormPosition:a}),D=C("purchase.checkout.payment-method-list.render-before"),R=C("purchase.checkout.payment-method-list.render-after");return e(Le,{target:"cart.paymentLines[0]",children:e(oe,{gap:"base",children:[e(ai,{}),e(w,{extensions:D}),e(at,{}),e(p,{}),e(d,{}),e(ve,{children:e(oe,{gap:"large-300",children:[e(ot,{dynamicPaymentExtensions:S.shift()||[],showSmsMarketingOptIn:n,children:[e(u,{}),e(w,{extensions:R}),e(w,{extensions:S.shift()||[]}),e(r,{})]}),o&&e(rt,{}),e(l,{showHeading:!1}),b&&e(_,{children:[e(W,{sectionId:"tips",children:e(ze,{})}),e(w,{extensions:S.shift()||[]})]}),e(Rn,{}),e(w,{extensions:S.flat()})]})})]})})}function ai(){const n=I(),t=Pn(),s="payment",i=bn(s),a=t?`${n("payment.billing_must_match_shipping_notice")} `:"",o=n("payment.card_security_notice");return e(oe,{gap:"small-400",children:[e(Re,{id:s,level:1,autoFocus:i,children:n("payment.title")}),e(ee,{color:"subdued",children:a+o})]})}function oi(){const n=I(),{availableDeliveryMethodsLoading:t,progressiveShippingRatesLoading:s}=ct(),i=t&&!s,{selectedDeliveryMethod:a}=dt({onChange:()=>{},prerequisitesLoading:t||i}),o=a?n("order_summary.updated_shipping_method",{shipping_method:a.title}):void 0;return re(()=>{if(o)return ut({content:o})},[o]),null}function ri(){return lt("ONE_TIME_PURCHASE")?e(oi,{}):null}function li(){const{negotiate:n}=Ve(),t=Cn(),s=le(),i=s.shippingAddress.value,a=s.billingAddress.value,o=ht(),{value:c=[]}=Ye(),l=pt(c),r=xn(c),{shippingRequired:p}=Ce(),d=p?i.countryCode:a.countryCode,u=t?.value?.countryCode,m=JSON.stringify(t?.value,(P,h)=>h===void 0?null:h);re(()=>{l||r||u&&d!==u&&(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:u,buyerIdentity:m}),n({silenceViolations:["all"]}))},[])}function ci({showSmsMarketingOptIn:n=!1}){const t=C("Checkout::Contact::RenderAfter"),s=C("Checkout::Dynamic::Render","INFORMATION1"),i=C("Checkout::Dynamic::Render","INFORMATION2"),{ContactForm:a}=z();return e(_,{children:[s.length?e(_,{children:e(w,{extensions:s,spacing:"base",marginBlockEnd:"large300"})}):null,e(mt,{impressionType:"contact",impressionFeatures:[],children:[e(a,{showSmsMarketingOptIn:n}),t.length?e(_,{children:e(w,{extensions:t,marginBlockStart:"base"})}):null,i.length?e(_,{children:e(w,{extensions:i,spacing:"large200",marginBlockStart:"large300"})}):null]})]})}function di(){const n=I(),{setSelectedAddress:t,addresses:s}=gt("shipping"),i=B(()=>{s.length>0&&t(s[0])},[s,t]);return s.length===0?null:e(kn,{inlineAlignment:"start",children:e(yt,{id:"save_shipping_information",textDecoration:"none",onClick:i,children:n("customer_account.saved_address_option_link")})})}function ui({localPickupDeliveryLine:n,onShowModal:t}){const s=I(),i=ft(),{methods:a,type:o}=n,[c]=vt(o),l=a.find(r=>r.handle===c);return l?e(g,{children:[i&&e(ee,{children:s("delivery_options.subscription_pickup_information")}),e(U,{border:"base",borderRadius:"large",children:[e(K,{padding:"base",children:e(kn,{columns:["fill","auto"],children:e(St,{method:l})})}),e(qe,{accessibilityRole:"presentation"}),e(K,{padding:"base",children:e(Se,{variant:"plain",inlineSize:"fill",textDecoration:"none",inlineAlignment:"start",onClick:t,commandFor:Pt,children:e(oe,{direction:"inline",gap:"small-200",alignItems:"center",justifyContent:"space-between",children:[e(Pe,{type:"strong",children:s("local_pickup.toggle_location")}),e(fn,{type:"chevron-right",size:"small-200"})]})})})]})]}):null}function hi(){return e(U,{border:"base",borderRadius:"large",children:[e(K,{padding:"base",paddingBlockEnd:"large-400",children:e(oe,{justifyContent:"space-between",direction:"inline",children:[e(oe,{direction:"block",gap:"small-400",children:[e(ye,{inlineSize:"large",size:"base"}),e(ye,{inlineSize:"base",size:"base"})]}),e(ye,{inlineSize:"small",size:"base"})]})}),e(qe,{accessibilityRole:"presentation"}),e(K,{padding:"base",children:e(ye,{inlineSize:"small",size:"base"})})]})}function pi(){const n=I(),{negotiating:t}=_n(),s=bt(),i=Mn(),{value:a,loading:o}=Ct(),{hasViolations:c}=kt(At),[l,r]=be(!1),p=()=>{r(!0)},d=()=>{r(!1)},u=t||!i||o||l?e(hi,{}):a?e(Mt,{onShowModal:p}):s?e(g,{children:[c&&e(Et,{}),e(ui,{localPickupDeliveryLine:s,onShowModal:p})]}):null;return e(Le,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(ve,{accessibilityLabel:n("delivery_options.pick_up_locations"),children:[u,e(_t,{methods:s?.methods,type:s?.type,open:l,onClose:d})]})})}function mi({showSmsMarketingOptIn:n=!1}){return wt(),e(g,{spacing:"large300",children:[e(Gs,{}),e(gi,{showSmsMarketingOptIn:n})]})}function gi({showSmsMarketingOptIn:n}){const t=Dt(),{method:s}=_n(),i=I(),{wallets:a}=ce(),{value:o}=It(),c=Rt(),l=ke(xt),{showShipmentBreakdown:r}=Lt(),p=je(),d=C("Checkout::DeliveryAddress::RenderBefore"),u=C("purchase.checkout.delivery-address.render-after"),{hasMultipleDeliveryGroups:m,onlyDeliveryGroupType:P}=Vt(),{extensionsBefore:h,extensionsAfter:b}=Ot({hasMultipleDeliveryGroups:m,targeted:!1}),S=c||r,D=En(),R=Tt(),{negotiate:L}=Ve(),k=B(({shipping:E})=>{a.activeSession||L({include:[],fieldsToResolve:["deliveryNext"],silenceViolations:["non-delivery-address"],runListenersOnError:!0}),E.value=!0,D("sectionComplete",{section:"deliveryAddress",timestamp:new Date}),R({type:"section_complete",section:"deliveryAddress"})},[a.activeSession,L,D,R]),V=B(({shipping:E})=>{E.value=!1},[]),M=E=>e(ve,{padding:S?"small-400 none":void 0,children:E}),y=n?e(An,{}):null,O="shippingMethod",x=bn(O);switch(s){case"PICKUP_POINT":return e(_,{children:e(W,{sectionId:"pickupPoints",children:e($t,{})})});case"PICK_UP":return e(_,{children:e(W,{sectionId:"localPickup",children:p==="treatment"?e(pi,{}):e(Yt,{})})});default:return e(W,{sectionId:"shipping",children:[e(ve,{accessibilityLabel:i("delivery_options.shipping_address"),children:e(g,{spacing:"base",children:[e(w,{extensions:d}),e(g,{spacing:"large300",children:[e(Bt,{children:e(Nt,{onValid:k,onInvalid:V,children:e(Ft,{children:[e(di,{}),e(Ht,{}),y]})})}),e(w,{extensions:u}),e(g,{spacing:S?"small400":"base",children:[e(Re,{id:O,level:l?1:2,autoFocus:x,children:i("shipping.shipping_method_title")}),e(Ut,{children:[r?e(rn,{children:[e(js,{}),e(N,{spacing:"small200"})]}):null,zt("shipping.shipping_method_notice",t)?e(ee,{children:i("shipping.shipping_method_notice")}):null,e(w,{extensions:h,options:{groupType:P&&ln(P),includeDeliverySelectionGroups:!1},render:M}),e(rn,{children:[e(Gt,{}),e(Wt.Preload,{})]}),e(w,{extensions:b,options:{groupType:P&&ln(P),includeDeliverySelectionGroups:!1},render:M})]})]})]})]})}),o?.refuseDutiesPermitted&&e(ve,{accessibilityLabel:i("shipping.duties_and_taxes_title"),children:e(g,{spacing:"base",children:[e(Re,{level:2,children:i("shipping.duties_and_taxes_title")}),e(Kt,{})]})})]})}}function yi({showSmsMarketingOptIn:n=!1}){const t=I(),s=Pn(),{DeliveryHeading:i}=z(),a=C("Checkout::Dynamic::Render","DELIVERY1"),o=je(),{contact:c}=ue(),l=o==="treatment"&&c;return e(Oe,{children:e(g,{children:[!l||s?e(g,{spacing:"small400",children:[!l&&e(i,{}),s&&e(ee,{color:"subdued",children:t("shipping.shipping_used_as_billing_notice")})]}):null,e(qt,{}),e(jt,{children:e(mi,{showSmsMarketingOptIn:n})}),e(w,{extensions:a})]})})}function fi(n){if(!n)return"";try{return new URL(vi(n)).hostname.replace("www.","")}catch{return n.replace(/^https?:\/\/(www\.)?/,"")}}const vi=n=>{const t="https://";return n.replace(/^(?:(.*:)?\/\/)?(.*)/i,(s,i,a)=>i?s:`${t}${a}`)},Si="LaXGo",Pi={ReferralTitle:Si};function bi(){const n=I(),t=Z(),s=fi(t.storefrontUrl)?.replace(/-/g,"‑");return s?e("strong",{"data-testid":"referral-title",className:Pi.ReferralTitle,children:n("shop_pay.checkout.referral_title",{merchant_url:s})}):null}function Ge(){const n=le(),t=n.email.value,s=n.phone.value,i=I(),{isOrderEditCheckout:a}=de(),o=Xt(),[c,l]=be(!1),r=v({customerAccount:t&&typeof t=="string"&&o,default:!1}),{VaultedContact:p}=z(),d=v({businessCustomer:!1,shopPay:!1,default:!0}),u=r?e(Xs,{email:t,open:c,showPopover:m=>{l(m)}}):null;if(a&&d){const m=t||s;return e(_,{children:[e(Jt,{id:"contact",label:i("contact.contact_method_title"),summary:m?e("p",{children:m}):e(ye,{})}),u]})}return e(_,{children:[e(p,{emailAddress:t,phone:s}),u]})}const Ci={contact:{shouldRender:n=>n.vaulted.contact},delivery:{shouldRender:n=>n.vaulted.delivery&&n.shippingRequired},payment:{shouldRender:n=>n.vaulted.payment},billing:{shouldRender:n=>n.isOrderEditCheckout?!1:n.showBillingAddressAbovePayment||n.vaulted.payment&&n.vaulted.billing},cashRedemption:{shouldRender:n=>n.isOrderEditCheckout?!1:n.vaulted.payment&&n.checkout.configuration.visibility.showCashRedemption}},ki=["contact","delivery","payment","billing","cashRedemption"],_i={businessCustomer:["contact","delivery","billing","payment","cashRedemption"]};function Mi(n){return _i[n]??ki}function Ei(){const t=Qt().identitySourceSignal.value,s=ue(),{checkout:i}=ce(),{shippingRequired:a}=Ce(),{isOrderEditCheckout:o}=de(),[c]=wn(),l=c.includes("PICK_UP"),{VaultedPayment:r,VaultedDelivery:p,VaultedBillingAddress:d,VaultedCashRedemption:u}=z(),m=v({businessCustomer:!a||l,default:!1}),P={vaulted:s,checkout:i,shippingRequired:a,isOrderEditCheckout:o,showBillingAddressAbovePayment:m},h=Mi(t),b={contact:Ge,delivery:p,payment:r,cashRedemption:u,billing:d};return h.filter(S=>Ci[S].shouldRender(P)).map(S=>{const D=b[S];return e(D,{},S)})}const Ai="ILN3z",Ie={DivideChildren:Ai,"DivideChildren--no-initial-divider":"TiyE2","DivideChildren--no-final-divider":"wyrwY","DivideChildren--final-mobile-divider":"_8S1mj"};function un({hideLastDivider:n}){const t=ue(),{negotiate:s}=Ve(),i=v({amazonPay:!1,buyWithPrime:!1,default:!0}),a=Zt(),o=(a?.is_referral&&a.layout==="web")??!1,{isOrderEditCheckout:c}=de(),{shippingRequired:l}=Ce(),{shippingRequired:r}=Ce(),p=c&&r,[d]=wn(),u=d.includes("PICK_UP"),{checkout:m}=ce(),{VaultedPayment:P,ReviewNotice:h,VaultedDelivery:b,VaultedBillingAddress:S,VaultedCashRedemption:D}=z(),R=Dn(),L=je(),k=es(),V=v({guest:!0,default:!1}),M=v({businessCustomer:t.payment,guest:!0,default:!1}),y=v({amazonPay:!0,buyWithPrime:!0,payPal:!0,googlePay:!0,shopPay:!0,default:!1}),O=v({businessCustomer:!0,default:!1}),x=ke(ns),E=t.delivery&&(l||p&&c),G=v({businessCustomer:!l||u,default:!1});function f(){return L==="treatment"?!t.contact&&!E?[]:[e(g,{spacing:"none",children:[t.contact&&e(Ge,{}),E&&e(b,{})]},"contact-delivery")]:[...t.contact?[e(Ge,{},"contact")]:[],...E?[e(b,{},"delivery")]:[]]}let A=[];const he=ke(ts),pe=Ei();if(he?A=pe:A=[...f(),...Y(m)],re(()=>{A.length>0&&i&&s({silenceViolations:["all"]})},[]),A.length===0)return null;return e(K,{children:[k?e(ss,{}):null,k&&y?e(is,{below:"large",children:e(N,{})}):null,R&&e(h,{}),o?e(bi,{}):null,x?e(as,{items:A,showBottomDivider:!n&&!M}):e("div",{className:os({[Ie.DivideChildren]:!0,[Ie["DivideChildren--no-final-divider"]]:n||M===!0,[Ie["DivideChildren--no-initial-divider"]]:V,[Ie["DivideChildren--final-mobile-divider"]]:O}),children:A})]});function Y(ne){if(c)return t.payment?[e(P,{},"payment")]:[];const T=[];return G&&T.push(e(S,{},"businessCustomerBilling")),t.payment&&(T.push(e(P,{},"payment")),ne.configuration.visibility.showCashRedemption&&T.push(e(D,{},"cashRedemption")),t.billing&&!G&&T.push(e(S,{},"billingAddress"))),T}}function Ln({includeContactAfterExtensions:n}={includeContactAfterExtensions:!1}){const t=ue(),s=C("Checkout::Contact::RenderAfter"),i=C("Checkout::Dynamic::Render","INFORMATION1"),a=C("Checkout::Dynamic::Render","INFORMATION2"),o=C("Checkout::Dynamic::Render","DELIVERY1"),c=C("Checkout::Dynamic::Render","DELIVERY2"),l=C("Checkout::Dynamic::Render","PAYMENT1"),r=C("Checkout::Dynamic::Render","PAYMENT2"),p=C("Checkout::Dynamic::Render","PAYMENT3");return F(()=>{let d=[];return t.contact&&(d=[...n?s:[],...i,...a]),t.delivery&&(d=[...d,...o,...c]),t.payment&&(d=[...d,...l,...r,...p]),d},[t,n,s,i,a,o,c,l,r,p])}function ji({children:n}){const{checkout:t}=ce(),s=Mn(),i=le(),a=i.email.value,o=i.phone.value,{progress:c}=Ve(),{shippingRequired:l}=Ce(),r=ue(),{value:p}=rs(),[d]=ls(),{postPurchaseEnabled:u}=cs(),m=I(),P=ds(),h=us(),{isOrderEditCheckout:b}=de(),{vaultedItem:{background:S,border:D}}=He(),{emailMarketing:R,smsMarketing:L}=Z(),k=ei(),V=En(),M=Dn(),y=t.configuration.visibility.showEmailMarketing&&R!=="OFF",O=Sn(),x=$e(),E=hs(),{value:G}=Cn(),f=ke(ps),A=In(),{value:he}=Ye(),Y=!he?.some(tn=>ms.has(tn.code))&&k.hasViolation&&k.lineItems.length>0;li(),re(()=>{Y&&V("inventoryPriceChange",{element:{tagName:"modal"},timestamp:new Date,visible:!0})},[Y,V]);const ne=B(()=>{k.updateProposal()},[k]),T=Ue({base:!0,medium:!1}),Te=Ue({base:!1,small:!0}),$=gs(),te=v({guest:$,customerAccount:$,sdkCartHints:$,externalVault:$,default:!1}),me=C("Checkout::Contact::RenderAfter"),_e=v({shopPay:P&&!!(T&&!Te),default:!1}),Be=v({shopPay:y,default:y&&r.contact}),Ne=v({shopPay:si,default:_}),se=f&&!ys(G?.countryCode),Me=v({businessCustomer:!1,sdkCartHints:!!(y&&r.contact&&a),default:Be&&!E&&!se&&!b}),q=v({shopPay:"belowPayment",default:r.payment?"belowPayment":"abovePayment"});let j=v({shopPay:!1,businessCustomer:!1,default:L!=="OFF"});x&&!x.smsMarketingEnabled&&(j=!1);const X=o&&!a?r.contact?"root":"contact":ws(p)||!l?"billing":"delivery",Ee=Me&&q==="belowPayment",J=Me&&q==="abovePayment",ie=Ee&&(T??!1),ge=t.configuration.visibility.showEmailMarketing&&!b&&J&&!h?.acceptsEmailMarketing,Ae=!b&&j&&X==="root"&&!h?.acceptsSmsMarketing,Vn=v({sdkCartHints:_,default:Oe}),we=v({guest:r.delivery,businessCustomer:!r.delivery&&r.payment,default:!1}),On=v({guest:we&&!(r.contact&&r.payment),businessCustomer:we,default:!1}),De=r.contact&&!(r.delivery&&r.payment)&&me.length>0&&(ge||Ae||T)?me:void 0,{SignUpContact:Tn}=z(),{acceleratedWalletPaymentMethods:Bn}=fs(),Nn=Ws(Bn),Fn=ke(vs),Qe=Ln({includeContactAfterExtensions:De===void 0}),{main:{section:Hn,spacing:Ze}}=Ss(),{lineItems:{priority:Un="base"}}=He(),H=Ps(Hn),en=H&&!S&&!D,nn=bs();return e(_,{children:[n,e(g,{spacing:ae.default("none").when({viewportInlineSize:{min:"extraSmall"}},"large200"),children:[b?e(g,{padding:ae.default(["large200","large200","none","large200"]).when({viewportInlineSize:{min:"extraSmall"}},"none"),children:e(Cs,{})}):null,e(cn,{section:"toast"}),e(cn,{section:"top"}),e(ks,{onSubmit:()=>c("one-page-form-submit",void 0,{skipToCompletion:M}),children:[e("div",{ref:Nn,children:e(fe,{hideDivider:r.payment&&!ie&&!nn,condition:!H,accessibilityLabel:m("contact.contact_method_title"),children:[te&&e(_,{children:[e(fe,{condition:H,hideDivider:!0,padding:_e?"none large-200 large-200 large-200":void 0,children:e(g,{spacing:"none",children:e(W,{sectionId:"expressCheckout",children:e(Q,{section:"expressCheckout",children:e(Ks,{})})})})}),e(Ys,{})]}),Un==="high"&&e(K,{display:ae.default("block").when({viewportInlineSize:{min:"medium"}},"none"),children:e(fe,{condition:H,children:e(_s,{})})}),e(fe,{condition:en,padding:!te&&_e?"none large-200 large-200 large-200":void 0,accessibilityLabel:m("contact.contact_method_title"),children:e(g,{spacing:"none",children:[!r.contact&&e(xe,{section:"contact",children:e(Q,{section:"contact",children:e(ci,{showSmsMarketingOptIn:!b&&j&&X==="contact"})})}),!we&&e(_,{children:[e(un,{hideLastDivider:H}),!en&&Ze!=="none"&&e(N,{spacing:Ze})]}),O&&e(Rn,{variant:"minimal"}),!H&&e(Q,{section:"contact",children:e(We,{renderAsVaulted:!0,showMarketingDisclosure:ge||ie,showSmsMarketingOptIn:Ae&&q!=="belowPayment",afterContactExtensions:De})})]})})]})}),e(Tn,{}),H&&e(Q,{section:"contact",children:e(We,{showMarketingDisclosure:ge,showSmsMarketingOptIn:Ae&&q!=="belowPayment",afterContactExtensions:De})}),On&&l&&e(Ms,{condition:we,accessibilityLabel:m("shipping.delivery_title"),children:e(un,{hideLastDivider:H})}),!A&&Qe.length?e(Ke,{extensions:Qe,hideDivider:"whenEmpty"}):null,!r.delivery&&l&&e(Le,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(xe,{section:"delivery",children:e(Q,{section:"delivery",children:e(W,{sectionId:"delivery",children:e(yi,{showSmsMarketingOptIn:!b&&j&&X==="delivery"})})})})}),s&&e(wi,{showMobileOrderSummary:nn,showVaultedStateMarketingDisclosureBelowPayment:Ee,showVaultedStateMarketingDisclosureOnMobile:ie,showPartialVaultedStateSmsMarketingOptIn:Ae&&q==="belowPayment",showSmsMarketingOptIn:j,smsMarketingOptInPlacement:X,isSectionCustomized:H,VaultedStateMarketingDisclosureWrapper:Vn,includeContactAfterExtensions:De===void 0,showExpressCheckoutSection:te,managedMarketsWithShopifyPaymentsFeatureFlagEnabled:Fn})]},d),u&&e(Es,{})]}),e(As,{}),Y&&e(Qs,{loading:k.loading,lineItems:k.lineItems,onClose:ne}),l&&e(ri,{}),e(Ne,{}),e($s,{id:"OnePage"})]})}function wi({showMobileOrderSummary:n,showVaultedStateMarketingDisclosureBelowPayment:t,showVaultedStateMarketingDisclosureOnMobile:s,isSectionCustomized:i,VaultedStateMarketingDisclosureWrapper:a,showPartialVaultedStateSmsMarketingOptIn:o,showSmsMarketingOptIn:c,smsMarketingOptInPlacement:l,includeContactAfterExtensions:r,showExpressCheckoutSection:p,managedMarketsWithShopifyPaymentsFeatureFlagEnabled:d}){const u=I(),m=ue(),P=In(),h=Ds(),b=qs(),{checkout:S}=ce(),{acceptTipPayments:D}=Z(),{currentDetour:R}=Is(),L=Rs(),k=v({shopPay:!m.payment,default:!1}),{visibility:{shouldRenderFloatingShopPayButton:V}}=gn(),{isOrderEditCheckout:M}=de(),y=Ue({base:!0,medium:!1}),O=xs(),{returnWindow:x}=Z();Ls();const E=le().localizationExtensions.value,G=E.length>0,f=ae.default("block").when({viewportInlineSize:{min:"medium"}},"none"),A=ae.default("none").when({viewportInlineSize:{min:"medium"}},"block"),{shopifyInstallments:he}=vn(),{setChatHideTriggerNode:pe}=Vs(),Y=B(J=>{pe(y&&J?J:null)},[y,pe]),ne=t&&!y,Te=$e()?.tippingPaymentAllowed??!0,$=m.payment&&D&&Te&&S.configuration.visibility.showTips,te=v({shopPay:$&&!he(),default:$}),me=mn().isPartner(),_e=F(()=>R?.type==="thankYou"?"Checkout::ThankYou::Dynamic::Render":"Checkout::Dynamic::Render",[R?.type]),Be=C(_e,"ORDER_SUMMARY4"),Ne=d?!p&&!!L.value:!!L.value,se=Ln({includeContactAfterExtensions:r}),Me=Os(),{Rewards:q,CashRedemption:Xe,MarketingDisclosure:j,BillingSection:Je,CheckoutAsGuest:X}=z(),{primaryButton:{visibility:Ee="visible"}}=He();return e(_,{children:e(Fe,{min:"medium",accessibilityLabel:u("payment.title"),hideDivider:!0,children:[Me?null:e(Ts,{}),!m.payment&&e(xe,{section:"payment",children:e(Q,{section:"payment",children:e(Fe,{max:"medium",accessibilityLabel:u("payment.title"),children:e(ii,{showSmsMarketingOptIn:!M&&c&&l==="billing"})})})}),!m.payment&&e(Xe,{}),G&&e(Oe,{accessibilityLabel:u("localized_fields.additional_information.title"),children:e(g,{padding:y?"none":["large400","none","none","none"],children:[e(Re,{level:2,children:u("localized_fields.additional_information.title")}),E.map((J,ie)=>{const ge=`${J.value.key}${ie}`;return e(Fs,{localizationExtension:J,index:ie},ge)})]})}),s&&i&&e(a,{children:e(j,{})}),y&&!M&&te&&e(U,{display:f,children:e(W,{sectionId:"tips",children:e(ze,{renderInSection:y})})}),y&&P&&se.length?e(Ke,{extensions:se,hideDivider:"whenEmpty"}):null,e(xe,{section:"summary",children:e(Q,{section:"summary",children:e("div",{ref:Y,children:[e(Fe,{max:"medium",hideDivider:!0,children:[n&&e(Bs,{}),e(g,{spacing:V?"none":"base",children:[e(g,{spacing:"base",children:[ne&&k&&e(g,{spacing:"none",children:[e(N,{spacing:"base"}),e(qe,{})]}),e(We,{renderAsVaulted:!0,showMarketingDisclosure:ne,showSmsMarketingOptIn:o,children:e(Je,{})}),!y&&!M&&te&&e(U,{display:A,children:e(W,{sectionId:"tips",children:[e(N,{spacing:"large300"}),e(ze,{})]})}),!y&&P&&se.length?e(Ke,{extensions:se}):null,Ne&&e(g,{padding:y?"none":["large400","none","none","none"],children:e(Ns,{textProps:{color:"subdued",size:"small"}})})]}),e(g,{spacing:"large200",children:[b&&e(Hs,{}),Ee==="visible"&&e(Js,{}),h&&e(Us,{}),x&&O?e(K,{display:f,children:e(Zs,{returnWindow:x})}):null,y&&e(w,{extensions:Be,spacing:"large200"})]})]}),e(q,{}),me?null:e(dn,{children:e(X,{})})]}),me?e(dn,{children:e(X,{})}):null]})})})]})})}function We({showMarketingDisclosure:n,showSmsMarketingOptIn:t,afterContactExtensions:s,renderAsVaulted:i,children:a}){const{MarketingDisclosure:o}=z();return!n&&!t&&!s?a:e(Le,{target:"cart.buyerIdentity",children:e(fe,{condition:!i,children:e(g,{spacing:i?"base":void 0,padding:i?["base","none","none","none"]:void 0,children:[(n||t)&&e(g,{spacing:n&&t?"base":"none",children:[n&&e(o,{}),t&&e(An,{})]}),s&&e(w,{extensions:s}),a]})})})}function Ke({extensions:n,hideDivider:t="always"}){return e(Oe,{hideDivider:t,children:e(w,{spacing:"base",extensions:n})})}export{We as PartialVaultedMarketingConsentMarkup,Ke as VaultedExtensionsSection,ji as default};